Skip to content

Commit edafaec

Browse files
zlyfunctionclaude
andcommitted
Add pigeon of the day beside the profile photo
Renders a procedurally generated pigeon in the empty space to the right of the avatar, linking through to pegeongen.html. The widget seeds itself from the local calendar date, so the bird is stable for the day and the link carries #seed=... to open the generator on that same bird. Inline SVG rather than an iframe, so it inherits page styling and the click reaches the wrapping link. Hidden below 900px where the profile row gets tight. The bilingual data-en/data-zh pair sits on the label span, not the anchor, because setLang() rewrites textContent and would otherwise wipe out the SVG. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 3e630d1 commit edafaec

2 files changed

Lines changed: 129 additions & 0 deletions

File tree

index.html

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,53 @@
407407
}
408408
}
409409

410+
/* ── Pigeon of the Day ── */
411+
.daily-pigeon {
412+
margin-left: auto;
413+
flex-shrink: 0;
414+
align-self: center;
415+
display: flex;
416+
flex-direction: column;
417+
align-items: center;
418+
gap: 4px;
419+
padding: 10px 14px 12px;
420+
border-radius: 18px;
421+
text-decoration: none;
422+
transition: transform 0.25s ease, background-color 0.25s ease;
423+
}
424+
425+
.daily-pigeon:hover {
426+
transform: translateY(-3px);
427+
background-color: var(--color-surface-variant);
428+
}
429+
430+
.daily-pigeon-slot {
431+
display: block;
432+
width: 150px;
433+
height: 150px;
434+
}
435+
436+
.daily-pigeon-slot svg {
437+
display: block;
438+
width: 100%;
439+
height: 100%;
440+
}
441+
442+
.daily-pigeon-label {
443+
font-family: var(--font-display);
444+
font-size: 12px;
445+
color: var(--color-accent);
446+
opacity: 0.85;
447+
white-space: nowrap;
448+
}
449+
450+
/* Below this width the profile row gets tight, then stacks at 640px. */
451+
@media (max-width: 900px) {
452+
.daily-pigeon {
453+
display: none;
454+
}
455+
}
456+
410457
.profile-info h1 {
411458
font-family: var(--font-display);
412459
font-size: 2.5rem;
@@ -1418,6 +1465,15 @@ <h1 data-en="Leyi Zhu" data-zh="朱乐宜">Leyi Zhu</h1>
14181465
<a href="mailto:leyi@nyu.edu" data-en="Email" data-zh="邮件">Email</a>
14191466
</div>
14201467
</div>
1468+
<!-- Procedurally generated pigeon, reseeded each day. The
1469+
data-en/data-zh pair sits on the label span only: setLang()
1470+
rewrites textContent, which would wipe out the SVG. -->
1471+
<a class="daily-pigeon" href="./pegeongen.html" data-daily-pigeon data-pigeon-size="150"
1472+
aria-label="Pigeon of the day — open the pigeon generator">
1473+
<span class="daily-pigeon-slot" data-pigeon-slot></span>
1474+
<span class="daily-pigeon-label" data-en="pigeon of the day"
1475+
data-zh="每日鸽子">pigeon of the day</span>
1476+
</a>
14211477
</div>
14221478
</section>
14231479

@@ -2012,6 +2068,7 @@ <h2 class="section-title" data-en="Miscellaneous" data-zh="其他">Miscellaneous
20122068
</div>
20132069
</footer>
20142070
<script defer src="./public_html/test.js"></script>
2071+
<script defer src="./pigeon-widget.js"></script>
20152072
</body>
20162073

20172074
</html>

pigeon-widget.js

Lines changed: 72 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)