From: Robert Kaiser Date: Sun, 28 Oct 2012 19:35:27 +0000 (+0100) Subject: don't display h1, add a viewport tag, paint an initial image with explanations of... X-Git-Tag: production~13 X-Git-Url: https://git-public.kairo.at/?a=commitdiff_plain;h=51442fd43fc24ec7e8c2cf3d7231b21ff59e5911;p=mandelbrot-web.git don't display h1, add a viewport tag, paint an initial image with explanations of how to use the app --- diff --git a/index.html b/index.html index 525a3eb..2614c7c 100644 --- a/index.html +++ b/index.html @@ -6,6 +6,9 @@ + + KaiRo.at Mandelbrot Web diff --git a/js/mandelbrot.js b/js/mandelbrot.js index 7f6c38e..385ff2e 100644 --- a/js/mandelbrot.js +++ b/js/mandelbrot.js @@ -2,21 +2,28 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ +var gMainCanvas, gMainContext; var gColorPalette = []; var gStartTime = 0; var gCurrentImageData; var gLastImageData; function Startup() { - var img = document.getElementById("mbrotImage"); - img.addEventListener("mouseup", imgEvHandler, false); - img.addEventListener("mousedown", imgEvHandler, false); - img.addEventListener("mousemove", imgEvHandler, false); - img.addEventListener("touchstart", imgEvHandler, false); - img.addEventListener("touchend", imgEvHandler, false); - img.addEventListener("touchcancel", imgEvHandler, false); - img.addEventListener("touchleave", imgEvHandler, false); - img.addEventListener("touchmove", imgEvHandler, false); + gMainCanvas = document.getElementById("mbrotImage"); + gMainContext = gMainCanvas.getContext("2d"); + + gMainCanvas.addEventListener("mouseup", imgEvHandler, false); + gMainCanvas.addEventListener("mousedown", imgEvHandler, false); + gMainCanvas.addEventListener("mousemove", imgEvHandler, false); + gMainCanvas.addEventListener("touchstart", imgEvHandler, false); + gMainCanvas.addEventListener("touchend", imgEvHandler, false); + gMainCanvas.addEventListener("touchcancel", imgEvHandler, false); + gMainCanvas.addEventListener("touchleave", imgEvHandler, false); + gMainCanvas.addEventListener("touchmove", imgEvHandler, false); + + var initTile = new Image(); + initTile.src = "style/initial-overview.png"; + gMainContext.drawImage(initTile, 0, 0); } function getAdjustVal(aName) { @@ -173,8 +180,8 @@ function adjustCoordsAndDraw(aC_min, aC_max) { } function drawImage() { - var canvas = document.getElementById("mbrotImage"); - var context = canvas.getContext("2d"); + var canvas = gMainCanvas; + var context = gMainContext; document.getElementById("calcTime").textContent = "--"; diff --git a/manifest.appcache b/manifest.appcache index 985e6b0..1f1ceb0 100644 --- a/manifest.appcache +++ b/manifest.appcache @@ -4,9 +4,11 @@ CACHE MANIFEST index.html manifest.webapp js/mandelbrot.js +style/initial-overview.png style/mandelbrot.css style/mandelbrotIcon16.png style/mandelbrotIcon32.png +style/plain-overview.png NETWORK: diff --git a/style/initial-overview.png b/style/initial-overview.png new file mode 100644 index 0000000..13683a2 Binary files /dev/null and b/style/initial-overview.png differ diff --git a/style/mandelbrot.css b/style/mandelbrot.css index 04bc960..f375a14 100644 --- a/style/mandelbrot.css +++ b/style/mandelbrot.css @@ -6,6 +6,10 @@ body { font-family: sans-serif; } +h1 { + display: none; +} + #overlayArea { position: absolute; } diff --git a/style/plain-overview.png b/style/plain-overview.png new file mode 100644 index 0000000..be3c347 Binary files /dev/null and b/style/plain-overview.png differ