From b293620bc9f8c3ed0638f1cea73eb8ab6c964eb7 Mon Sep 17 00:00:00 2001
From: Chuck Dries <chuck@chuckdries.com>
Date: Tue, 13 Jun 2017 19:15:00 -0700
Subject: [PATCH] Better scroll targets

---
 index.html | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/index.html b/index.html
index d1a88dc..5439fe2 100644
--- a/index.html
+++ b/index.html
@@ -207,11 +207,11 @@
         //execute scroll style modifications
         function sc(ypos) {
 
-            var wheight = window.innerHeight;
+            var windowHeight = window.innerHeight;
             //top thing
             var topDiv = document.getElementById("top");
             var mast = document.getElementById("mast");
-            var hcalc = wheight - ypos;
+            var hcalc = windowHeight - ypos;
             var topHeight = 100;
             if (hcalc > 100) {
                 topHeight = hcalc;
@@ -220,17 +220,17 @@
             }
             // var mastHeight = mast.clientHeight;
             // var halfHeight = Math.floor((topHeight / 2) - (mastHeight / 2));
-            if (topHeight < 300) {
+            if (topHeight < 315) {
                 topDiv.className = "small";
             } else {
                 topDiv.className = "large";
             }
-            topDiv.style.height = topHeight + "px";
+            topDiv.style.height = topHeight - 10 + "px"; //subtract 10 to account for padding-top on #top
             // console.log("topheight is " + topHeight + " and topDiv.style.height = " + topDiv.style.height);
             // mast.style.marginTop = halfHeight + "px";
 
             //background thing
-            var p = ((wheight - ypos) / wheight); //calulate ratio of scroll
+            var p = ((windowHeight - ypos) / windowHeight); //calulate ratio of scroll
             // x.innerHTML = " " + String(parseInt(p * 100)); //display it
             var rgb = Math.floor(Math.abs(1 - p) * 255); //set the color
             // var colorString = "rgb(" + rgb + "," + rgb + "," + rgb + ")";
@@ -239,7 +239,7 @@
         }
 
         function getScrollY() {
-            //internet explorer does not have a window.scrollY property, so we need to make our own
+            //internet explorer does not have a window.scrollY property, it has pageYOffset
             return typeof window.scrollY === "undefined" ? window.pageYOffset : window.scrollY;
         }