17 lines
588 B
JavaScript
17 lines
588 B
JavaScript
// ── Pronoun pill: non-binary flag sweep on click ──────────────
|
|
(function () {
|
|
const pill = document.querySelector('.hero-pronouns');
|
|
if (!pill) return;
|
|
const reduceMotion = window.matchMedia('(prefers-reduced-motion: reduce)');
|
|
|
|
pill.addEventListener('click', () => {
|
|
if (window.achv) window.achv.mark('pronouns');
|
|
if (reduceMotion.matches) return;
|
|
if (pill.classList.contains('waving')) return;
|
|
pill.classList.add('waving');
|
|
});
|
|
pill.addEventListener('animationend', () => {
|
|
pill.classList.remove('waving');
|
|
});
|
|
})();
|