From 449a49f4f7021035d254936dc7012c870ff10db4 Mon Sep 17 00:00:00 2001 From: Cameron Kruse <14115927+cameronkruse@users.noreply.github.com> Date: Fri, 5 Jan 2024 18:15:18 -0800 Subject: [PATCH] updating main page --- src/css/style.css | 26 ++++++++++++++++++++++++++ src/main.js | 27 ++++++++++++++++++++------- 2 files changed, 46 insertions(+), 7 deletions(-) diff --git a/src/css/style.css b/src/css/style.css index d051025..3756b89 100644 --- a/src/css/style.css +++ b/src/css/style.css @@ -130,6 +130,7 @@ figure p { background-image: url("../chicken-headshot-transparent80.png"); background-position: center; background-repeat: no-repeat; + align-items: center; /* opacity: 0.8; */ } #intro h1 { @@ -348,6 +349,31 @@ figure p { margin: auto; /* background-color: #3b3b3b; */ } +#scroll-button { + border: none; + background-color: transparent; + padding: 1.5rem; + cursor: pointer; + align-items: center; + position: absolute; + bottom: 0px; +} + +#scroll-button:hover { + svg { + transition: transform 0.5s ease-in-out; + transform: translateY(-10px); + } +} +#scroll-text { + font-family: PPEiko-black-italic; + font-size: 1rem; + color: #f5c53b; + align-items: center; + position: absolute; + bottom: 0px; +} + @media only screen and (max-width: 767px) { #dynamic-frame, #static-frame, diff --git a/src/main.js b/src/main.js index bcd948d..fe32690 100644 --- a/src/main.js +++ b/src/main.js @@ -17,7 +17,13 @@ document.querySelector("#app").innerHTML = `

We just found them.

- +

+ +
SCROLL DOWN
@@ -26,16 +32,16 @@ document.querySelector("#app").innerHTML = `
-

THIS IS A CHICKEN

+

THIS IS A CHICKEN

-

THESE ARE 1,000 CHICKENS

+

THIS IS 1,000 CHICKENS

-

THESE ARE 10,000 CHICKENS

+

THIS IS 10,000 CHICKENS

-

THESE ARE 100,000 CHICKENS

+

THIS 🟨 IS 100,000 CHICKENS

There are 10 Billion Chickens raised in the United States every year

@@ -65,6 +71,13 @@ var step = article.selectAll(".step"); // initialize the scrollama var scroller = scrollama(); +var scrollButton = document.getElementById("scroll-button"); +scrollButton.addEventListener("click", function () { + window.scrollTo({ + top: window.innerHeight, + behavior: "smooth", + }); +}); // generic window resize listener event function handleResize() { @@ -72,8 +85,8 @@ function handleResize() { var stepH = Math.floor(window.innerHeight * 1); step.style("height", stepH + "px"); - var figureHeight = window.innerHeight / 1; - var figureMarginTop = (window.innerHeight - figureHeight) / 5; + var figureHeight = window.innerHeight / 4; + var figureMarginTop = (window.innerHeight - figureHeight) / 2; figure.style("height", figureHeight + "px").style("top", figureMarginTop + "px");