Skip to content

Commit a95e0d1

Browse files
committed
Update dad birthday page design
1 parent 345195d commit a95e0d1

4 files changed

Lines changed: 116 additions & 24 deletions
316 KB
Loading
92.2 KB
Loading
117 KB
Loading

‎index.html‎

Lines changed: 116 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
/>
1313
<style>
1414
:root {
15-
--bg-1: #fff8f0;
16-
--bg-2: #ffe3d2;
17-
--ink: #2f1b14;
18-
--accent: #d94832;
19-
--accent-2: #f4a259;
20-
--card: rgba(255, 255, 255, 0.72);
15+
--bg-1: #0f172a;
16+
--bg-2: #1e293b;
17+
--ink: #e2e8f0;
18+
--accent: #b45309;
19+
--accent-2: #475569;
20+
--card: rgba(15, 23, 42, 0.62);
2121
}
2222

2323
* {
@@ -30,8 +30,8 @@
3030
font-family: "Manrope", sans-serif;
3131
color: var(--ink);
3232
background:
33-
radial-gradient(circle at 15% 20%, rgba(244, 162, 89, 0.3), transparent 40%),
34-
radial-gradient(circle at 85% 5%, rgba(217, 72, 50, 0.2), transparent 30%),
33+
radial-gradient(circle at 15% 20%, rgba(180, 83, 9, 0.28), transparent 40%),
34+
radial-gradient(circle at 85% 5%, rgba(71, 85, 105, 0.38), transparent 30%),
3535
linear-gradient(160deg, var(--bg-1), var(--bg-2));
3636
}
3737

@@ -52,15 +52,15 @@
5252
.f1 {
5353
width: 62px;
5454
height: 62px;
55-
background: rgba(217, 72, 50, 0.25);
55+
background: rgba(180, 83, 9, 0.35);
5656
top: 28px;
5757
left: -8px;
5858
}
5959

6060
.f2 {
6161
width: 38px;
6262
height: 38px;
63-
background: rgba(244, 162, 89, 0.45);
63+
background: rgba(148, 163, 184, 0.42);
6464
top: 170px;
6565
right: 28px;
6666
animation-delay: 0.9s;
@@ -69,7 +69,7 @@
6969
.f3 {
7070
width: 22px;
7171
height: 22px;
72-
background: rgba(47, 27, 20, 0.18);
72+
background: rgba(226, 232, 240, 0.25);
7373
right: -2px;
7474
bottom: 140px;
7575
animation-delay: 0.4s;
@@ -79,9 +79,9 @@
7979
.panel {
8080
background: var(--card);
8181
backdrop-filter: blur(6px);
82-
border: 1px solid rgba(255, 255, 255, 0.65);
82+
border: 1px solid rgba(148, 163, 184, 0.35);
8383
border-radius: 22px;
84-
box-shadow: 0 22px 40px rgba(74, 33, 20, 0.09);
84+
box-shadow: 0 22px 40px rgba(2, 6, 23, 0.35);
8585
}
8686

8787
.hero {
@@ -91,7 +91,7 @@
9191

9292
.tag {
9393
display: inline-block;
94-
border: 1px solid rgba(217, 72, 50, 0.3);
94+
border: 1px solid rgba(180, 83, 9, 0.6);
9595
color: var(--accent);
9696
font-weight: 800;
9797
letter-spacing: 0.08em;
@@ -133,8 +133,8 @@
133133
}
134134

135135
button.alt {
136-
background: #fff;
137-
color: var(--ink);
136+
background: rgba(148, 163, 184, 0.2);
137+
color: #f8fafc;
138138
}
139139

140140
.grid {
@@ -148,6 +148,39 @@
148148
padding: 20px;
149149
}
150150

151+
.gallery {
152+
margin-top: 18px;
153+
display: grid;
154+
gap: 14px;
155+
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
156+
}
157+
158+
.photo {
159+
overflow: hidden;
160+
border-radius: 18px;
161+
border: 1px solid rgba(148, 163, 184, 0.35);
162+
background: rgba(15, 23, 42, 0.65);
163+
box-shadow: 0 16px 30px rgba(2, 6, 23, 0.3);
164+
}
165+
166+
.photo img {
167+
display: block;
168+
width: 100%;
169+
height: 260px;
170+
object-fit: cover;
171+
transition: transform 0.35s ease;
172+
}
173+
174+
.photo:hover img {
175+
transform: scale(1.04);
176+
}
177+
178+
.photo figcaption {
179+
padding: 10px 12px 12px;
180+
font-size: 0.9rem;
181+
color: #cbd5e1;
182+
}
183+
151184
h2 {
152185
margin: 0 0 8px;
153186
font-size: 1.05rem;
@@ -162,7 +195,7 @@
162195
margin-top: 18px;
163196
text-align: center;
164197
font-size: 0.95rem;
165-
opacity: 0.8;
198+
opacity: 0.92;
166199
}
167200

168201
footer {
@@ -239,10 +272,43 @@ <h2>Birthday Wish</h2>
239272
</article>
240273
</section>
241274

275+
<section class="panel" style="margin-top: 18px" aria-label="Photo memories">
276+
<h2>Dad Through the Years</h2>
277+
<p style="margin-bottom: 14px">
278+
A few favorite memories worth celebrating today.
279+
</p>
280+
<div class="gallery">
281+
<figure class="photo">
282+
<img
283+
src="40136573_2012798265450233_639635619533815808_n.jpg"
284+
alt="Dad memory photo 1"
285+
loading="lazy"
286+
/>
287+
<figcaption>Always showing up with heart.</figcaption>
288+
</figure>
289+
<figure class="photo">
290+
<img
291+
src="106982433_3340753655988014_308260932475021008_n.jpg"
292+
alt="Dad memory photo 2"
293+
loading="lazy"
294+
/>
295+
<figcaption>Good times, great stories.</figcaption>
296+
</figure>
297+
<figure class="photo">
298+
<img
299+
src="511785219_29980892008220757_1753557587719935733_n.jpg"
300+
alt="Dad memory photo 3"
301+
loading="lazy"
302+
/>
303+
<figcaption>Still the strongest one in the room.</figcaption>
304+
</figure>
305+
</div>
306+
</section>
307+
242308
<footer>Made with love for your special day, Dad.</footer>
243309
</main>
244310

245-
<audio id="birthdaySong" preload="auto" autoplay>
311+
<audio id="birthdaySong" preload="auto" autoplay playsinline>
246312
<source src="Trump talks to Joe.mp3" type="audio/mpeg" />
247313
Your browser does not support audio playback.
248314
</audio>
@@ -262,16 +328,35 @@ <h2>Birthday Wish</h2>
262328

263329
async function tryAutoplay() {
264330
try {
331+
song.muted = false;
265332
await song.play();
266333
musicToggle.textContent = "Pause Birthday Song";
267334
return true;
268335
} catch {
269-
musicToggle.textContent = "Tap anywhere to start music";
270-
return false;
336+
try {
337+
song.muted = true;
338+
await song.play();
339+
musicToggle.textContent = "Unmute Birthday Song";
340+
cheerText.textContent = "Tap anywhere once to unmute the birthday song.";
341+
return true;
342+
} catch {
343+
musicToggle.textContent = "Tap anywhere to start music";
344+
return false;
345+
}
271346
}
272347
}
273348

274349
musicToggle.addEventListener("click", async () => {
350+
if (song.muted) {
351+
song.muted = false;
352+
musicToggle.textContent = "Pause Birthday Song";
353+
cheerText.textContent = "Love you, Dad.";
354+
if (song.paused) {
355+
await song.play().catch(() => {});
356+
}
357+
return;
358+
}
359+
275360
if (song.paused) {
276361
try {
277362
await song.play();
@@ -290,12 +375,19 @@ <h2>Birthday Wish</h2>
290375
});
291376

292377
document.addEventListener(
293-
"click",
378+
"pointerdown",
294379
() => {
380+
if (song.muted) {
381+
song.muted = false;
382+
cheerText.textContent = "Love you, Dad.";
383+
}
295384
if (song.paused) {
296-
song.play().then(() => {
297-
musicToggle.textContent = "Pause Birthday Song";
298-
}).catch(() => {});
385+
song
386+
.play()
387+
.then(() => {
388+
musicToggle.textContent = "Pause Birthday Song";
389+
})
390+
.catch(() => {});
299391
}
300392
},
301393
{ once: true }

0 commit comments

Comments
 (0)