From 2af0530f8ab7c4ecc388123185b9da7d6b74c0db Mon Sep 17 00:00:00 2001 From: Storozhenko Evgeny Date: Sat, 19 Sep 2026 17:42:59 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20typewriter-=D1=8D=D1=84=D1=84=D0=B5?= =?UTF-8?q?=D0=BA=D1=82=20=D0=B2=20=D0=BB=D0=BE=D0=B3=D0=BE=D1=82=D0=B8?= =?UTF-8?q?=D0=BF=D0=B5=20dedinit()=20=E2=80=94=20=D1=82=D0=B5=D0=BC=D1=8B?= =?UTF-8?q?=20=D0=B1=D0=BB=D0=BE=D0=B3=D0=B0=20=D0=B2=20=D1=81=D0=BA=D0=BE?= =?UTF-8?q?=D0=B1=D0=BA=D0=B0=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - layouts/partials/extend_footer.html: инлайн-скрипт (печать/пауза/стирание/мигание, prefers-reduced-motion, слова из [params.typewriter]) - assets/css/extended/typewriter.css: блочный мигающий курсор - hugo.toml: [params.typewriter] words - openspec/changes/header-typewriter: proposal/design/specs/tasks Без зависимостей (Alpine не нужен), тема не модифицируется. --- assets/css/extended/typewriter.css | 30 +++++++ hugo.toml | 4 + layouts/partials/extend_footer.html | 58 +++++++++++++ openspec/changes/header-typewriter/design.md | 81 +++++++++++++++++ .../changes/header-typewriter/proposal.md | 42 +++++++++ .../specs/site-header-typewriter/spec.md | 86 +++++++++++++++++++ openspec/changes/header-typewriter/tasks.md | 37 ++++++++ 7 files changed, 338 insertions(+) create mode 100644 assets/css/extended/typewriter.css create mode 100644 layouts/partials/extend_footer.html create mode 100644 openspec/changes/header-typewriter/design.md create mode 100644 openspec/changes/header-typewriter/proposal.md create mode 100644 openspec/changes/header-typewriter/specs/site-header-typewriter/spec.md create mode 100644 openspec/changes/header-typewriter/tasks.md diff --git a/assets/css/extended/typewriter.css b/assets/css/extended/typewriter.css new file mode 100644 index 0000000..6ac0fc8 --- /dev/null +++ b/assets/css/extended/typewriter.css @@ -0,0 +1,30 @@ +/* dedinit() typewriter — animated blog topics inside the logo parens. + Progressive enhancement: pure CSS cursor blink, JS only drives the text. */ + +#dedinit-typewriter { + display: inline-block; + white-space: nowrap; /* never wrap the typed word */ + min-width: 0.5ch; /* keeps parens from collapsing when empty */ + text-align: left; +} + +#dedinit-typewriter .tw-cursor { + display: inline-block; + width: 0.55ch; + height: 1.05em; + margin-inline-start: 0.15ch; + background: currentColor; /* follows light/dark text color */ + vertical-align: -0.12em; + animation: tw-blink 1s steps(1) infinite; +} + +@keyframes tw-blink { + 50% { opacity: 0; } +} + +@media (prefers-reduced-motion: reduce) { + #dedinit-typewriter .tw-cursor { + animation: none; /* static cursor, no blink */ + opacity: 0.6; + } +} \ No newline at end of file diff --git a/hugo.toml b/hugo.toml index 66420ae..11f7a80 100644 --- a/hugo.toml +++ b/hugo.toml @@ -37,6 +37,10 @@ draft = false # Полный текст постов в RSS-ленте (content:encoded) ShowFullTextinRSS = true + # Типографика логотипа dedinit(): темы, печатаемые в скобках (typewriter) + [params.typewriter] + words = ["linux", "llm", "politics", "homelab", "nix", "devops"] + # Настройки PaperMod defaultTheme = "auto" disableThemeToggle = false diff --git a/layouts/partials/extend_footer.html b/layouts/partials/extend_footer.html new file mode 100644 index 0000000..06a5f27 --- /dev/null +++ b/layouts/partials/extend_footer.html @@ -0,0 +1,58 @@ +{{- /* dedinit() typewriter: animated topics inside logo parens. + Pure JS + CSS, no Alpine. Progressive enhancement — no-JS keeps + the plain "dedinit()" logo. Words configurable via hugo.toml: + [params.typewriter] words = ["linux", "llm", "politics"] */ -}} +{{- $tw_words := site.Params.typewriter.words | default (slice "linux" "llm" "politics" "homelab" "nix") -}} + \ No newline at end of file diff --git a/openspec/changes/header-typewriter/design.md b/openspec/changes/header-typewriter/design.md new file mode 100644 index 0000000..5dee897 --- /dev/null +++ b/openspec/changes/header-typewriter/design.md @@ -0,0 +1,81 @@ +# Design: Анимированный логотип-печатная машинка (header typewriter) + +## Context + +- Тема: rDedInit (форк PaperMod), Hugo Extended 0.165.x. +- Логотип в шапке — партиал `themes/rDedInit/layouts/partials/header.html`, + ссылка `