Added scroll animations for all pages

This commit is contained in:
blake committed 2025-11-20 08:51:17 -06:00
1 parent 2d758be092
commit da2a1f9519
6 files changed
+88 -40

No files matched your search

+9 -9
View File
@@ -136,11 +136,11 @@
</section>
<section class="meet-the-team-section">
<div class="heading">
<div class="heading animate-on-scroll">
<img class="sunburst" src="/img/sunburst.png" alt="sunburst icon" />
<h2>Meet our Team</h2>
</div>
<div class="meet-the-team">
<div class="meet-the-team animate-on-scroll">
<img
class="group-photo"
src="img/group.PNG"
@@ -154,7 +154,7 @@
</p>
</div>
<div class="mission-grid">
<div class="mission">
<div class="mission animate-on-scroll">
<div class="heading">
<img
class="sunburst"
@@ -176,7 +176,7 @@
neighbor in Sioux County goes hungry.
</p>
</div>
<div class="mission">
<div class="mission animate-on-scroll-delay">
<div class="heading">
<img
class="sunburst"
@@ -200,7 +200,7 @@
</p>
</div>
</div>
<div class="about-cta">
<div class="about-cta animate-on-scroll">
<h3>We Need Your Help!</h3>
<p>
Volunteers are primarily needed on Wedesdays for 2 shifts (1:30 -
@@ -214,7 +214,7 @@
>Volunteer Today</a
>
</div>
<p class="equal-text">
<p class="equal-text animate-on-scroll">
Hope Food Pantry is an equal opportunity provider.
</p>
</section>
@@ -305,15 +305,15 @@
</section>
<section class="visit-section">
<div class="heading">
<div class="heading animate-on-scroll">
<img class="sunburst" src="/img/sunburst.png" alt="sunburst icon" />
<h2>Visit Us</h2>
</div>
<p>
<p class="animate-on-scroll">
Hope Food Pantry is open every Wednesday from 1:30-5:30 located on the
Talitha Koum Campus in Sioux Center, IA. ​
</p>
<div class="visit-maps">
<div class="visit-maps animate-on-scroll">
<img src="/img/map.png" alt="Map showing directions to the pantry" />
<img
src="/img/directions.jpg"
+30
View File
@@ -1112,3 +1112,33 @@ address {
padding: 5rem;
width: 80%;
}
/* Animations */
.animate-on-scroll {
opacity: 0;
transform: translateY(3rem);
transition-property: opacity, transform;
transition-duration: 0.5s;
transition-timing-function: ease;
transition-delay: 0s;
}
.animate-on-scroll.visible {
opacity: 1;
transform: translateY(0);
}
.animate-on-scroll-delay {
opacity: 0;
transform: translateY(3rem);
transition-property: opacity, transform;
transition-duration: 0.5s;
transition-timing-function: ease;
transition-delay: 0.2s;
}
.animate-on-scroll-delay.visible {
opacity: 1;
transform: translateY(0);
}
+3 -3
View File
@@ -239,15 +239,15 @@
</section>
<section class="visit-section">
<div class="heading">
<div class="heading animate-on-scroll">
<img class="sunburst" src="/img/sunburst.png" alt="sunburst icon" />
<h2>Visit Us</h2>
</div>
<p>
<p class="animate-on-scroll">
Hope Food Pantry is open every Wednesday from 1:30-5:30 located on the
Talitha Koum Campus in Sioux Center, IA. ​
</p>
<div class="visit-maps">
<div class="visit-maps animate-on-scroll">
<img src="/img/map.png" alt="Map showing directions to the pantry" />
<img
src="/img/directions.jpg"
+15 -15
View File
@@ -90,17 +90,17 @@
</section>
<section class="how-to-help-section">
<div class="heading left-align">
<div class="heading left-align animate-on-scroll">
<img class="sunburst" src="/img/sunburst.png" alt="sunburst icon" />
<h2>How to Help</h2>
</div>
<p class="header-sub-text left-align">
<p class="header-sub-text left-align animate-on-scroll">
Contributing to this ministry strengthens our shared purpose and
amplifies the positive impact we can achieve in our community. Your
involvement helps sustain our pantry and reach those who need them
most.
</p>
<div class="how-to-help-grid">
<div class="how-to-help-grid animate-on-scroll">
<article class="how-to-help-card">
<div class="sub-heading sub-heading-yellow">
<img
@@ -169,7 +169,7 @@
</a>
</article>
</div>
<p class="verse">
<p class="verse animate-on-scroll">
And as for you, brothers and sisters, never tire of doing what is
good. <br />- 2 Thessalonians 3:13 -
</p>
@@ -181,7 +181,7 @@
<h2>Guest Guidelines</h2>
</div>
<div class="guest-grid">
<article class="guest-text">
<article class="guest-text animate-on-scroll">
<div class="sub-heading">
<img class="icon" src="/img/icons/shop.svg" alt="shop icon" />
<h3>Visit Frequency</h3>
@@ -196,7 +196,7 @@
very helpful to our volunteers.
</p>
</article>
<div class="guest-img-wrapper">
<div class="guest-img-wrapper animate-on-scroll-delay">
<img
class="guest-img"
src="/img/gallery/drivethru.jpg"
@@ -206,7 +206,7 @@
<span class="step-number">1</span>
</div>
</div>
<div class="guest-img-wrapper">
<div class="guest-img-wrapper animate-on-scroll">
<img
class="guest-img"
src="/img/gallery/clothing.jpg"
@@ -216,7 +216,7 @@
<span class="step-number">2</span>
</div>
</div>
<article class="guest-text">
<article class="guest-text animate-on-scroll-delay">
<div class="sub-heading">
<img
class="icon"
@@ -236,7 +236,7 @@
your vehicle.
</p>
</article>
<article class="guest-text">
<article class="guest-text animate-on-scroll">
<div class="sub-heading">
<img class="icon" src="/img/icons/write.svg" alt="paper icon" />
<h3>Paperwork & Forms</h3>
@@ -262,7 +262,7 @@
paperwork for our records.
</p>
</article>
<div class="guest-img-wrapper">
<div class="guest-img-wrapper animate-on-scroll-delay">
<img
class="guest-img"
src="/img/paperwork.jpg"
@@ -283,7 +283,7 @@
</section>
<section class="testimonial-section">
<div class="testimonials">
<div class="testimonials animate-on-scroll">
<div class="heading left-align">
<img class="sunburst" src="/img/sunburst.png" alt="sunburst icon" />
<h2>Testimonials</h2>
@@ -334,7 +334,7 @@
/>
</blockquote>
</div>
<div class="testimonial-image-wrapper">
<div class="testimonial-image-wrapper animate-on-scroll-delay">
<div class="testimonial-img">
<img
src="/img/testimonial.jpg"
@@ -498,15 +498,15 @@
</section>
<section class="visit-section">
<div class="heading">
<div class="heading animate-on-scroll">
<img class="sunburst" src="/img/sunburst.png" alt="sunburst icon" />
<h2>Visit Us</h2>
</div>
<p>
<p class="animate-on-scroll">
Hope Food Pantry is open every Wednesday from 1:30-5:30 located on the
Talitha Koum Campus in Sioux Center, IA. ​
</p>
<div class="visit-maps">
<div class="visit-maps animate-on-scroll">
<img src="/img/map.png" alt="Map showing directions to the pantry" />
<img
src="/img/directions.jpg"
+18
View File
@@ -33,3 +33,21 @@ const headerEl = document.querySelector(".header");
btnNavEl.addEventListener("click", function () {
headerEl.classList.toggle("nav-open");
});
// Scroll Animations
document.addEventListener("DOMContentLoaded", () => {
const observerOptions = { root: null, rootMargin: "0px", threshold: 0.75 };
const onIntersection = (entries, observer) => {
entries.forEach((entry) => {
if (entry.isIntersecting) {
entry.target.classList.add("visible");
observer.unobserve(entry.target);
}
});
};
const observer = new IntersectionObserver(onIntersection, observerOptions);
const elementsToAnimate = document.querySelectorAll(
".animate-on-scroll, .animate-on-scroll-delay"
);
elementsToAnimate.forEach((el) => observer.observe(el));
});
+13 -13
View File
@@ -79,15 +79,15 @@
</section>
<section class="volunteer-roles-section">
<div class="heading left-align">
<div class="heading left-align animate-on-scroll">
<img class="sunburst" src="/img/sunburst.png" alt="sunburst icon" />
<h2>Roles & Opportunities</h2>
</div>
<p class="header-sub-text left-align">
<p class="header-sub-text left-align animate-on-scroll">
When you arrive, staff will tell you the tasks you will be doing based
on the need for that day. <br />Assigned roles might include:
</p>
<ul class="volunteer-roles">
<ul class="volunteer-roles animate-on-scroll">
<div class="role-box left-align">
<img
class="sunburst-small"
@@ -132,12 +132,12 @@
</section>
<section class="volunteer-reasons-section">
<div class="heading">
<div class="heading animate-on-scroll">
<img class="sunburst" src="/img/sunburst.png" alt="sunburst icon" />
<h2>Why you should volunteer</h2>
</div>
<div class="volunteer-cards">
<article class="volunteer-card">
<article class="volunteer-card animate-on-scroll">
<h4>
Volunteering... <br />
connects you to the community.
@@ -154,7 +154,7 @@
<span class="step-number">1</span>
</div>
</article>
<article class="volunteer-card">
<article class="volunteer-card animate-on-scroll-delay">
<h4>
Volunteering... <br />
allows you to use your skills in a productive way.
@@ -171,7 +171,7 @@
<span class="step-number">2</span>
</div>
</article>
<article class="volunteer-card">
<article class="volunteer-card animate-on-scroll">
<h4>
Volunteering... <br />
provides a sense of purpose.
@@ -187,7 +187,7 @@
<span class="step-number">3</span>
</div>
</article>
<article class="volunteer-card">
<article class="volunteer-card animate-on-scroll-delay">
<h4>
Volunteering... <br />
helps you stay physically healthy.
@@ -203,7 +203,7 @@
<span class="step-number">4</span>
</div>
</article>
<article class="volunteer-card">
<article class="volunteer-card animate-on-scroll">
<h4>
Volunteering... <br />
helps counteract the effects of stress, anger, and anxiety.
@@ -218,7 +218,7 @@
<span class="step-number">5</span>
</div>
</article>
<article class="volunteer-card">
<article class="volunteer-card animate-on-scroll-delay">
<h4>
Volunteering... <br />
reflects God's love and purpose for you.
@@ -324,15 +324,15 @@
</section>
<section class="visit-section">
<div class="heading">
<div class="heading animate-on-scroll">
<img class="sunburst" src="/img/sunburst.png" alt="sunburst icon" />
<h2>Visit Us</h2>
</div>
<p>
<p class="animate-on-scroll">
Hope Food Pantry is open every Wednesday from 1:30-5:30 located on the
Talitha Koum Campus in Sioux Center, IA. ​
</p>
<div class="visit-maps">
<div class="visit-maps animate-on-scroll">
<img src="/img/map.png" alt="Map showing directions to the pantry" />
<img
src="/img/directions.jpg"