feat(hero): rotate three positioning lines on a 10s cycle

All three lines render in the DOM; CSS drives the fade via data-active.
Reduced-motion users see the first line only (no interval, no fade).
Rotation pauses on hover and keyboard focus. aria-live=off on the
rotator so AT does not announce every swap; aria-hidden flips per-swap
to avoid duplicate heading announcements.

Also set vite.build.assetsInlineLimit=0 in astro.config.mjs so Astro
emits the rotator script as a same-origin external file (dist/assets/)
rather than inlining it — required for CSP script-src 'self' compliance.
This commit is contained in:
hsiegeln
2026-04-24 23:46:21 +02:00
parent 518d7a8afc
commit 77bf0bfa74
2 changed files with 67 additions and 2 deletions

View File

@@ -19,6 +19,11 @@ export default defineConfig({
vite: {
build: {
cssMinify: 'lightningcss',
// Prevent Astro from inlining small scripts into the HTML.
// Without this, the hero rotator script (< 4 KB) gets inlined as a
// <script type="module"> tag, which violates CSP script-src 'self'
// (no 'unsafe-inline'). Setting 0 forces all scripts to external files.
assetsInlineLimit: 0,
},
},
});