From a8eb7153352604eabf3c5017193f72c30706a0b7 Mon Sep 17 00:00:00 2001 From: Andrew Bash Date: Sat, 14 Oct 2017 15:33:34 -0400 Subject: [PATCH] =?UTF-8?q?Fixed=20parallaxing=20performance=20issues=20on?= =?UTF-8?q?=20Chrome=20by=20changing=20.logo=20to=20position:fixed,=20and?= =?UTF-8?q?=20making=20index.js=20animate=20.logo=E2=80=99s=20transform:tr?= =?UTF-8?q?anslate,=20rather=20than=20top.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/css/style.css | 3 +-- docs/js/index.js | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/css/style.css b/docs/css/style.css index 036fb3e..2e70f43 100644 --- a/docs/css/style.css +++ b/docs/css/style.css @@ -61,8 +61,7 @@ html, body { } .logo { - position: relative; - top: 0%; + position: fixed; width: 100vw; height: 100vh; display: -webkit-box; diff --git a/docs/js/index.js b/docs/js/index.js index 782aa86..8c0aad1 100644 --- a/docs/js/index.js +++ b/docs/js/index.js @@ -8,7 +8,7 @@ function parallax() { $.css("footer", "display", "block"); } else { $.css(".logo", { - top: $.scrollTop() / 1.5 + "px", + transform: "translateY( -" + $.scrollTop() / 2.5 + "px)", display: "" }); $.css("footer", "display", "none");