fix: typewriter не замирает на первом слове (reduced-motion не останавливает печать) + переключатель темы прижат вправо

- extend_footer.html: убран ранний return при prefers-reduced-motion — печать идёт всегда, мигание гасится только через CSS (кейфрейм tw-blink уже отключается)
- typewriter.css: убрано двойное auto-поле (.logo margin-inline-end:auto конфликтовало с #menu margin-inline-start:auto при justify-content:space-between) — теперь только menu толкает вправо, солнышко встаёт сразу за меню
This commit is contained in:
2026-09-20 07:42:02 +00:00
parent 4e7deb6f0f
commit 1f58f8ccc7
2 changed files with 4 additions and 11 deletions
+3 -4
View File
@@ -39,18 +39,17 @@
} }
.nav > .logo { .nav > .logo {
order: 0; order: 0; /* logo stays left */
margin-inline-end: auto; /* push everything else to the right */
} }
.nav > #menu { .nav > #menu {
order: 1; order: 1;
margin-inline-start: auto; /* menu hugs the right edge */ margin-inline-start: auto; /* push menu (and what follows) to the right */
} }
.nav > .logo-switches { .nav > .logo-switches {
order: 2; order: 2;
margin-inline-start: 8px; margin-inline-start: 16px; /* small gap after the menu */
} }
/* 2) first post card: same card styling as .post-entry */ /* 2) first post card: same card styling as .post-entry */
+1 -7
View File
@@ -26,13 +26,7 @@
a.appendChild(box); a.appendChild(box);
a.appendChild(document.createTextNode(text.slice(close))); a.appendChild(document.createTextNode(text.slice(close)));
// reduced motion: static first word, no animation // reduced motion: blink is disabled via CSS; keep typing but no blink
if (matchMedia('(prefers-reduced-motion: reduce)').matches) {
box.firstChild.before(document.createTextNode(words[0] || ''));
box.querySelector('.tw-cursor').style.display = 'none';
return;
}
const TYPE = 90, ERASE = 50, HOLD = 1400, GAP = 400; const TYPE = 90, ERASE = 50, HOLD = 1400, GAP = 400;
let w = 0, i = 0, dir = 1; let w = 0, i = 0, dir = 1;
box.querySelector('.tw-cursor').style.display = 'inline-block'; box.querySelector('.tw-cursor').style.display = 'inline-block';