From b1c399d7b713f435b29052ff7147b99e541eba8f Mon Sep 17 00:00:00 2001 From: Kyle <41976328+ImKyle4815@users.noreply.github.com> Date: Wed, 7 Nov 2018 19:28:32 -0800 Subject: [PATCH] viewport --- data/scripts/main.js | 10 + index.html | 578 +++++++++++++++++++++---------------------- 2 files changed, 298 insertions(+), 290 deletions(-) diff --git a/data/scripts/main.js b/data/scripts/main.js index 681bcc4a..7e9c25ef 100644 --- a/data/scripts/main.js +++ b/data/scripts/main.js @@ -5,6 +5,16 @@ // Initialization // //============================================// //The following bits of code are run immediatly to initialize the program while allowing the variables to remain global. +//Setup viewport! +var minimumWidth = 769 +var viewport = document.createElement("meta") +viewport.setAttribute("name", "viewport") +if (screen.width < minimumWidth) { + viewport.setAttribute("content", "width=" + minimumWidth) +} else { + viewport.setAttribute("content", "width=device-width", "initial-scale=1") +} +document.head.appendChild(viewport) //Define initial variables var borderPath var secondColor diff --git a/index.html b/index.html index 3d99f537..797fd9fd 100644 --- a/index.html +++ b/index.html @@ -25,302 +25,300 @@
- -