Skip to content

Commit ed94a91

Browse files
author
Seth Bernstein
committed
fix footer and add scroll animation
1 parent daed4ba commit ed94a91

3 files changed

Lines changed: 102 additions & 24 deletions

File tree

index.html

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<body>
1515
<nav class="navbar">
1616
<div class="nav-content">
17-
<a href="#">Home</a>
17+
<a href="#home">Home</a>
1818
<a href="#about">About</a>
1919
<a href="#research">Research</a>
2020
<a href="#publications">Publications</a>
@@ -25,7 +25,7 @@
2525

2626
<div class="wrapper">
2727

28-
<header class="site-header">
28+
<header class="site-header" id="home">
2929
<div class="intro">
3030
<img src="assets/headshot.png" alt="Seth Bernstein" class="profile-pic" />
3131
<div class="intro-text">
@@ -50,7 +50,7 @@ <h1>Seth Bernstein</h1>
5050
</header>
5151

5252
<main>
53-
<section id="about">
53+
<section id="about" class="fade-in">
5454
<h2>About</h2>
5555
<p>
5656
I’m interested in making computing education more accessible and personally meaningful through
@@ -72,7 +72,7 @@ <h2>About</h2>
7272
</p>
7373
</section>
7474

75-
<section id="research">
75+
<section id="research" class="fade-in">
7676
<h2>Research</h2>
7777
<p>
7878
My research focuses on using LLMs to personalize learning in computing education. I study how
@@ -93,7 +93,7 @@ <h2>Research</h2>
9393

9494

9595

96-
<section id="publications">
96+
<section id="publications" class="fade-in">
9797
<h2>Publications</h2>
9898
<div class="sort-buttons">
9999
Sort by:
@@ -187,10 +187,7 @@ <h2>Publications</h2>
187187
</div>
188188
</section>
189189

190-
191-
192-
193-
<section id="service">
190+
<section id="service" class="fade-in">
194191
<h2>Service</h2>
195192
<p>
196193
Most of my service work has been rooted in the Temple HCI Lab, where I took on a leadership role

script.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,42 @@ function updateSortLabels() {
4040
titleBtn.textContent += currentSort.asc ? ` ${upArrow}` : ` ${downArrow}`;
4141
}
4242
}
43+
44+
document.addEventListener('DOMContentLoaded', () => {
45+
const faders = document.querySelectorAll('.fade-in');
46+
47+
const observer = new IntersectionObserver((entries) => {
48+
entries.forEach(entry => {
49+
if (entry.isIntersecting) {
50+
entry.target.classList.add('visible');
51+
observer.unobserve(entry.target);
52+
}
53+
});
54+
}, {
55+
threshold: 0.1
56+
});
57+
58+
faders.forEach(el => observer.observe(el));
59+
});
60+
61+
const navLinks = document.querySelectorAll(".navbar a[href^='#']");
62+
const sectionObserver = new IntersectionObserver(
63+
(entries) => {
64+
entries.forEach((entry) => {
65+
const id = entry.target.getAttribute("id");
66+
const link = document.querySelector(`.navbar a[href="#${id}"]`);
67+
if (entry.isIntersecting) {
68+
navLinks.forEach((lnk) => lnk.classList.remove("active"));
69+
if (link) link.classList.add("active");
70+
}
71+
});
72+
},
73+
{
74+
rootMargin: "-50% 0px -49% 0px", // center bias
75+
threshold: 0,
76+
}
77+
);
78+
79+
document.querySelectorAll("section").forEach((section) => {
80+
sectionObserver.observe(section);
81+
});

style.css

Lines changed: 57 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -112,39 +112,53 @@ h2 {
112112
.navbar {
113113
position: sticky;
114114
top: 0;
115-
background-color: #fdfdfd;
116-
border-bottom: 1px solid #ddd;
117115
z-index: 1000;
118-
padding: 10px 20px
116+
background-color: rgba(255, 255, 255, 0.9);
117+
backdrop-filter: blur(6px);
118+
border-bottom: 1px solid #ddd;
119+
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
119120
}
120121

121122
.nav-content {
122123
display: flex;
123-
gap: 20px;
124124
justify-content: center;
125+
gap: 24px;
125126
flex-wrap: wrap;
126-
font-size: 14px
127+
padding: 10px 20px;
128+
font-size: 15px;
127129
}
128130

129131
.navbar a {
130132
color: #004080;
133+
font-weight: 500;
131134
text-decoration: none;
132-
font-weight: 500
135+
position: relative;
136+
padding: 4px 2px;
137+
transition: color 0.2s ease;
133138
}
134139

135-
.navbar a:hover {
136-
text-decoration: underline
140+
.navbar a::after {
141+
content: '';
142+
position: absolute;
143+
bottom: 0;
144+
left: 0;
145+
height: 2px;
146+
width: 0;
147+
background-color: #004080;
148+
transition: width 0.2s ease;
137149
}
138150

139-
.site-footer {
140-
text-align: center;
141-
font-size: 13px;
142-
color: #666;
143-
margin-top: 60px;
144-
padding-top: 30px;
145-
border-top: 1px solid #ddd
151+
.navbar a:hover::after,
152+
.navbar a.active::after {
153+
width: 100%;
146154
}
147155

156+
.navbar a:hover,
157+
.navbar a.active {
158+
color: #002f66;
159+
}
160+
161+
148162
html {
149163
scroll-behavior: smooth
150164
}
@@ -196,4 +210,32 @@ body {
196210

197211
.navbar a:active {
198212
transform: scale(0.97);
213+
}
214+
215+
.fade-in {
216+
opacity: 0;
217+
transform: translateY(20px);
218+
transition: opacity 0.6s ease-out, transform 0.6s ease-out;
219+
}
220+
221+
.fade-in.visible {
222+
opacity: 1;
223+
transform: translateY(0);
224+
}
225+
226+
.site-footer {
227+
text-align: center;
228+
font-size: 13px;
229+
color: #666;
230+
margin-top: 60px;
231+
padding-top: 30px;
232+
border-top: 1px solid #ddd
233+
}
234+
235+
a {
236+
color: #666;
237+
}
238+
239+
header.site-header {
240+
scroll-margin-top: 80px;
199241
}

0 commit comments

Comments
 (0)