diff --git a/index.html b/index.html index 869db54..b0d0d65 100644 --- a/index.html +++ b/index.html @@ -5,11 +5,14 @@ + Fabrika Hrádek Tour -
+
+ This browser doesn't seem to support canvas. sorry idk +
\ No newline at end of file diff --git a/res/script.js b/res/script.js index 20d1990..7d85c7b 100644 --- a/res/script.js +++ b/res/script.js @@ -1,4 +1,18 @@ function load_panorama() { - document.getElementById("panorama").style.backgroundImage = "./img/test.jpg" //NOT WORKING + console.log(window.width); + var ctx = document.getElementById('panorama').getContext('2d'); + var img = new Image(); + var width_buffer; + + img.onload = function() + { + width_buffer = 5000; + + ctx.canvas.width=width_buffer; + ctx.canvas.height=width_buffer / 2; + ctx.drawImage(img, 0, 0, img.width, img.height, 0, 0, width_buffer, width_buffer / 2); + }; + + img.src = './res/img/test.jpg'; } \ No newline at end of file diff --git a/res/style.css b/res/style.css index 1dc2acb..cab738e 100644 --- a/res/style.css +++ b/res/style.css @@ -1 +1,10 @@ -/*stuff*/ \ No newline at end of file +#panorama +{ + display: inline; +} + +#panorama_div +{ + width: 100%; + text-align:center; +} \ No newline at end of file