Skip to content

Commit a97597d

Browse files
jbriones1jbriones1
authored andcommitted
Updating with PR#124: Frosh 2025 Update
1 parent aced134 commit a97597d

File tree

3 files changed

+397
-299
lines changed

3 files changed

+397
-299
lines changed

frosh/2025/index.html

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,24 @@
2929
<h1>Ducky Frosh 2025</h1>
3030
</div>
3131
</hgroup>
32+
<div id="countdown">
33+
<div class="cd-col">
34+
<div id="cd-day" class="value"></div>
35+
<div class="label">days</div>
36+
</div>
37+
<div class="cd-col">
38+
<div id="cd-hour" class="value"></div>
39+
<div class="label">hours</div>
40+
</div>
41+
<div class="cd-col">
42+
<div id="cd-min" class="value"></div>
43+
<div class="label">minutes</div>
44+
</div>
45+
<div class="cd-col">
46+
<div id="cd-sec" class="value"></div>
47+
<div class="label">seconds</div>
48+
</div>
49+
</div>
3250
<nav class="hero-nav">
3351
<ul>
3452
<li><a class="button bg-box" href="#about">About</a></li>
@@ -167,7 +185,7 @@ <h2>What's a "Frosh Week"?</h2>
167185
</div>
168186
<aside class="duck-fact bg-box">
169187
<h2>Did you know...</h2>
170-
<p>If you mixed "Frosh" and "Duck" together, you get a bad word.</p>
188+
<p>Ducks have three eyelids per eye.</p>
171189
</aside>
172190
</section>
173191

frosh/2025/main.js

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,23 @@ function animateReedsParting() {
2525

2626
/**
2727
* Animates the duck swimming left to right.
28+
* Added code so it has a consistent velocity.
2829
*/
2930
function animateDucky() {
3031
const duck = document.getElementById('animated-duck-container');
3132

33+
// Get the width of the duck and have it start off the screen, based on its width
3234
const start = -duck.getBoundingClientRect().width;
35+
// and the width of the viewport
3336
const end = window.innerWidth;
3437

38+
// Get the distance the duck needs to travel and move it at a rate of 100px per second.
3539
const distance = end - start;
3640
const duration = distance / 100; // measured in pixels
3741

42+
// Set the duck to start at the left side
3843
gsap.set(duck, { left: start });
44+
// Move it to the right, repeat infinitely
3945
gsap.to('#animated-duck-container', {
4046
left: end,
4147
repeat: -1, // infinitely loop
@@ -59,8 +65,8 @@ function imagePopIn() {
5965
},
6066
y: '5vh',
6167
opacity: 0,
62-
duration: 1.2,
63-
ease: 'power3.out',
68+
duration: 0.5,
69+
ease: 'none',
6470
stagger: 0.2
6571
});
6672
});
@@ -99,11 +105,53 @@ function handleHeaderChanges() {
99105
});
100106
}
101107

108+
/**
109+
* Controls the countdown on the hero
110+
*/
111+
function setCountdown() {
112+
// Target time is September 8, 2025 PDT @ 1PM
113+
const target = new Date('2025-09-08T13:00:00.000-07:00').getTime();
114+
115+
// Don't show the countdown if it's past the Frosh start date.
116+
if (target < new Date().getTime()) {
117+
document.getElementById('countdown').style.display = 'none';
118+
return;
119+
}
120+
const secToMs = 1000;
121+
const minToMs = secToMs * 60;
122+
const hourToMs = minToMs * 60;
123+
const dayToMs = hourToMs * 24;
124+
125+
const secEle = document.getElementById('cd-sec');
126+
const minEle = document.getElementById('cd-min');
127+
const hourEle = document.getElementById('cd-hour');
128+
const dayEle = document.getElementById('cd-day');
129+
130+
let update = () => {
131+
const now = new Date().getTime();
132+
let difference = target - now;
133+
134+
let secs = Math.floor((difference / secToMs) % 60);
135+
let mins = Math.floor((difference / minToMs) % 60);
136+
let hours = Math.floor((difference / hourToMs) % 24);
137+
let days = Math.floor(difference / dayToMs);
138+
139+
secEle.textContent = secs;
140+
minEle.textContent = mins;
141+
hourEle.textContent = hours;
142+
dayEle.textContent = days;
143+
};
144+
145+
update();
146+
setInterval(update, 1000);
147+
}
148+
102149
window.addEventListener('load', _ => {
103150
gsap.registerPlugin(ScrollTrigger, ScrollSmoother);
104151
animateReedsParting();
105152
handleHeaderChanges();
106153
animateDucky();
154+
setCountdown();
107155
if (window.matchMedia('(min-width: 1280px').matches) {
108156
imagePopIn();
109157
}

0 commit comments

Comments
 (0)