diff --git a/docs/accessibility.md b/docs/accessibility.md new file mode 100644 index 0000000..96cc10f --- /dev/null +++ b/docs/accessibility.md @@ -0,0 +1,84 @@ +# MiniCrafter accessibility + +Audit date: 2026-11-10 · Game version: 33 · Tools: axe-core 4.12.1 (injected with Playwright, as in `tests/smoke.mjs`), plus a manual pass at 1280×720 (desktop) and 812×375 sideways with `?touch=1` (phone). + +MiniCrafter is a 3D block game. Looking around and placing blocks needs sight and a mouse, keyboard or touch screen, so it is **not playable with a screen reader**. This page says what we do support, what we checked, and what is still open. + +## What we support (for schools) + +- **Whole-menu keyboard use.** Every menu, panel and setting can be reached and used with Tab, Shift+Tab, Enter and Space. Pop-up panels (worlds, Play Together, account, inventory, crafting, quest book, photo, pet, What's new, report) move focus into the panel, keep Tab inside it, and close with **Esc**. Focus goes back to the button you used. +- **Visible focus.** A thick yellow ring shows where the keyboard focus is. +- **Big touch targets.** On phones and tablets every button, tab, field, slider and the hotbar slots are at least 44×44 px. +- **Readable HUD.** Text drawn over the game (hints, messages, mode badge, level number, armor line, hotbar numbers) has a dark backing and is at least 4.5:1 against any sky, including pure white. +- **Not colour alone.** Hearts change shape (♥ full, ♡ empty) as well as colour. Quest progress shows "3 / 5" next to its bar. Finished quests show a ✅ and filled stars. The selected chip also gets a white border. +- **Reduced motion.** If the device asks for it (`prefers-reduced-motion`), fades and slides are switched off, the quest-complete card does not zoom in, the red damage flash is softer and shorter, and celebration confetti is skipped. The game has no camera bob or screen shake. +- **Labels.** Every icon-only button has an accessible name. The ✕ close button on every panel is labelled "Close". Health, air and food are announced as "Health: 7 of 10 hearts". Messages and hints are announced by screen readers. +- **Language and structure.** The page language is set (`lang="en"`). Panels are named dialogs. Headings run in order inside each panel. +- **Legal pages and the features page** pass axe-core with no violations. +- **No tracking or outside content** that could get in the way of assistive tools: the game loads nothing from other sites. + +Not supported yet: playing with a screen reader, a text-size setting, remapping keys, one-switch / eye-control play, and zooming the page on phones (see the open items below). If your school needs any of these, tell us. + +## Findings + +Severity: **High** blocks a group of players, **Medium** makes things hard, **Low** is a polish or best-practice item. "Fixed" means fixed in game version 33. + +| # | Issue | Where | Severity | Status | +|---|---|---|---|---| +| 1 | Esc did not close Play Together, account, My worlds, What's new, report or the adventure gate (it only worked in-game) | Menu pop-ups | High | Fixed | +| 2 | Keyboard focus stayed on the button behind a pop-up; Tab walked through the hidden menu underneath | All pop-ups | High | Fixed (focus moves in, Tab stays in, focus returns) | +| 3 | Focus ring was the browser's 1 px default line | Everywhere | Medium | Fixed (3 px ring) | +| 4 | HUD text had only a text-shadow and no backing: 1.2–2.5:1 on a bright sky (hint, toast, armor line, mode badge, level number) and 2.5:1 for hotbar numbers | HUD | High | Fixed (6.4–8.7:1 on white; hotbar counts 5.0:1) | +| 5 | Touch targets under 44 px: menu mode buttons (36), "Another idea" (30), sliders (16), selects (35), account tabs (30), Play Together chips (28), Back/Done (38), links (16), Bit's Run/Stop/speed (38–41), ✕ at short heights (40), hotbar slots (38–40) | Phone | Medium | Fixed (44 px minimum with `?touch=1` / touch devices; hotbar and XP bar nudged up 12 px on short phone screens) | +| 6 | Selected colour chip: white text on pink, 4.0:1 (axe `color-contrast`) | Play Together | Medium | Fixed (dark or white label by colour) | +| 7 | "Survival only" tags in the quest book were 2.5:1 (the dimming made them faint) | Quest book | Medium | Fixed | +| 8 | Hearts: empty vs full relied on red vs dark red | Survival HUD | Medium | Fixed (♡ vs ♥ shape, plus a spoken label) | +| 9 | Health, air and food had no text alternative | Survival HUD | Medium | Fixed | +| 10 | Toast, hint and quest-complete card were not announced | HUD | Medium | Fixed (`role="status"`) | +| 11 | No reduced-motion handling for the quest-complete zoom, fades, confetti, damage flash (only the "turn your phone" hint had it) | HUD, game | Medium | Fixed | +| 12 | Scrollable quest list and recipe list could not be scrolled with the keyboard (axe `scrollable-region-focusable`) | Quest book, crafting | Medium | Fixed | +| 13 | Pop-ups were plain `div`s: no dialog role or name | All pop-ups | Medium | Fixed | +| 14 | Fields with only a placeholder (World name, Seed, adult-check answer) | Worlds, gate | Low | Fixed (`aria-label`) | +| 15 | Colour-picker groups had a label but no role | Play Together | Low | Fixed | +| 16 | Axe `region`: content outside landmarks (menu, game view, HUD) | Everywhere | Low | Mostly fixed (menu is `main`, pop-ups are dialogs, game view is labelled). The in-game HUD still reports it. Not fixed: HUD is overlay chrome, and a screen reader cannot play the game anyway | +| 17 | Axe `meta-viewport`: pinch-zoom is switched off (`user-scalable=no`) | All game screens | Medium | **Not fixed.** On phones the canvas uses touch gestures and the browser zoom would fight them. Needs a design decision; see follow-ups | +| 18 | Smallest text is 11.5 px (item names under inventory blocks, "Quests (Q)" key hint, hotbar numbers 11 px) | Inventory, HUD | Low | Not fixed. Fits the layout and passes contrast; a text-size setting is the real fix | +| 19 | "Oops!" screen uses a second `h1` | Death screen | Low | Not fixed (it is a separate screen, so order is still fine) | +| 20 | Quest tracker layout on phones (fold, mini view and a `#quest-view` setting) | `#quest-tracker` | Not an accessibility fault | Out of scope here. Handled in PR #44, which is not covered by this audit. Re-check its header height (32–40 px before that change) against 44 px once it lands | +| 21 | Hotbar slots, block grid and crafting slots are not keyboard-reachable (1–9 and the wheel select hotbar slots, the inventory uses the mouse/touch) | Inventory, crafting | High | Not fixed (follow-up) | +| 22 | The 3D game cannot be played with a screen reader | Game | High | Not fixed (follow-up) | +| 23 | No in-game text-size setting | Settings | Medium | Not fixed (follow-up) | + +Axe results across the start menu (with settings open), Play Together, account (log in and create), What's new, report, My worlds, trade, adventure gate, rotate prompt, death, inventory, crafting, quest book, pet panel, photo mode, the HUD with Bit's panel, `features.html`, `privacy.html`, `terms.html` and `stats.html`: + +- Before: `color-contrast` (2 screens), `scrollable-region-focusable` (2 screens), `meta-viewport` and `region` everywhere. The static pages had no violations. +- After: only `meta-viewport` (item 17) and a few `region` hits on the HUD (item 16). + +## Manual checklist + +| Check | Desktop | Phone (812×375, `?touch=1`) | +|---|---|---| +| Touch targets ≥ 44 px | Not required for a mouse; all controls ≥ 24 px (WCAG 2.5.8) | Pass after the fix. The quest tracker header is the one exception (item 20) | +| HUD contrast ≥ 4.5:1 over a bright sky | Pass (computed against white, the worst case) | Pass | +| Smallest text | 11.5 px (item 18) | 11.5 px | +| Icon-only buttons have `aria-label` | Pass (pause, undo, inventory, fly, emoji, photo, respawn, jump, down, ✕) | Pass | +| Tab order through the menus | Play, Play Together, account, My worlds, Quest book, idea, mode buttons, settings, controls, report, links: matches the screen | Same | +| Esc closes every panel | Pass after the fix (item 1) | No Esc key on phones. Every panel has a ✕ and tapping outside it closes it | +| Focus visible | Pass after the fix | Pass | +| `prefers-reduced-motion` | Pass after the fix | Pass | +| Not colour alone | Pass after the fix | Pass | +| Page language and headings | `lang="en"`; one `h1` per screen; `h2` then `h3` inside panels | Same | + +## Follow-ups (bigger items, not in this change) + +1. **Keyboard access to slots.** Make the hotbar, block picker and crafting slots focusable with arrow keys (roving tabindex), so players who cannot use a mouse can build. +2. **Text-size setting** (Small / Normal / Large) in Settings, which also fixes item 18. +3. **Pinch-zoom on menus.** Allow page zoom while a menu is open and keep it off while playing (item 17). +4. **Screen-reader play.** Announce what the player is looking at, what is nearby and how to move. This is a large design job. Bit the robot's Blockly editor also needs its own check. +5. **Key remapping and one-switch play.** +6. **Quest tracker target size** once the phone layout change lands. +7. Add axe to `tests/` so a new violation fails the build (the audit script injected axe-core by hand; it is not stored in the repo). + +## How to re-run the audit + +Start the game with `node server/dev.mjs` (set `PORT` to change it). In Playwright, open the page, inject `axe.min.js` from the `axe-core` package (`await page.addScriptTag({ path })`), run `axe.run(document)` on each screen, and open each pop-up first, either with its button or by taking `hidden` off its `.overlay`. For the phone check use an 812×375 viewport and `?touch=1`. diff --git a/index.html b/index.html index 174125f..67141a0 100644 --- a/index.html +++ b/index.html @@ -24,7 +24,7 @@ -
+
@@ -50,14 +50,14 @@
-
+
FLYING
-
+
-
Quest complete!
+
Quest complete!
@@ -68,7 +68,7 @@
-
+
@@ -169,8 +169,8 @@

👫 Play Together

Build with family and friends, up to 4 players. There's no chat, just emoji, and the host lets each player in.

You are
-
-
+
+

🔒 Log in to play together. It keeps Play Together safe: only people with an account can make or join a game.

@@ -332,8 +332,8 @@

🗂 My worlds

✨ Make a new world

- - + +
@@ -408,7 +408,7 @@

Turn your phone sideways

⚔️ Adventure mode is for older players

It has night creatures that fight back, hunger, tougher falls and losing your things when you faint. Grown-ups, please answer:

- +

diff --git a/src/a11y.js b/src/a11y.js new file mode 100644 index 0000000..fc7d267 --- /dev/null +++ b/src/a11y.js @@ -0,0 +1,57 @@ +// Accessibility helpers (see docs/accessibility.md): pop-ups behave like proper dialogs +// (named, keyboard focus moves in, Tab stays inside, Esc closes) and one place to ask +// whether the player prefers reduced motion. +export const reduceMotion = matchMedia('(prefers-reduced-motion: reduce)'); + +// Menu-level pop-ups: Esc presses their Back/Done button (in-game panels have their own Esc handling). +const ESC_CLOSES = [['together', 'tg-close'], ['account', 'acc-done'], ['worlds', 'w-done'], ['news', 'news-done'], ['report', 'report-done'], ['gate', 'gate-cancel']]; +const FOCUSABLE = 'button, a[href], input:not([type=hidden]), select, summary, textarea, [tabindex="0"]'; +const shown = (el) => el.getClientRects().length > 0 && getComputedStyle(el).visibility !== 'hidden'; + +/** Call once, after every overlay exists in the page. */ +export function initA11y(overlayIds) { + const $ = (id) => document.getElementById(id); + let n = 0; + for (const id of overlayIds) { + const ov = $(id); + const panel = ov?.querySelector('.panel'); + if (!ov || !panel) continue; + const h = panel.querySelector('h1, h2'); + if (h) { if (!h.id) h.id = `a11y-title-${++n}`; ov.setAttribute('aria-labelledby', h.id); } + if (!ov.getAttribute('role')) ov.setAttribute('role', 'dialog'); + ov.setAttribute('aria-modal', 'true'); + panel.tabIndex = -1; + let opener = null; + new MutationObserver(() => { + if (!ov.classList.contains('hidden')) { + // Opened: remember where the player was, then move keyboard focus into the pop-up. + const a = document.activeElement; + opener = a && a !== document.body && !ov.contains(a) ? a : null; + requestAnimationFrame(() => { if (!ov.classList.contains('hidden') && !ov.contains(document.activeElement)) panel.focus({ preventScroll: true }); }); + } else if (opener) { + // Closed: hand focus back to the menu button that opened it (never to in-game controls). + if (opener.isConnected && $('menu').contains(opener) && shown(opener)) opener.focus({ preventScroll: true }); + opener = null; + } + }).observe(ov, { attributes: true, attributeFilter: ['class'] }); + } + // Long lists that scroll must be reachable by keyboard even when they hold no buttons. + for (const [id, label] of [['qb-list', 'Quests'], ['recipes', 'Recipes']]) { const el = $(id); if (el) { el.tabIndex = 0; el.setAttribute('role', 'region'); el.setAttribute('aria-label', label); } } + for (const id of ['tg-status', 'loading']) $(id)?.setAttribute('aria-live', 'polite'); + + document.addEventListener('keydown', (e) => { + const open = [...document.querySelectorAll('.overlay[aria-modal]:not(.hidden)')].pop(); + if (!open) return; + if (e.key === 'Escape') { + const hit = ESC_CLOSES.find(([ov]) => ov === open.id); + if (hit) { e.preventDefault(); $(hit[1]).click(); } + } else if (e.key === 'Tab') { + const items = [...open.querySelectorAll(FOCUSABLE)].filter((el) => !el.disabled && shown(el)); + if (!items.length) return; + const first = items[0], last = items[items.length - 1]; + if (!open.contains(document.activeElement) || document.activeElement === open.querySelector('.panel')) { e.preventDefault(); (e.shiftKey ? last : first).focus(); } + else if (e.shiftKey && document.activeElement === first) { e.preventDefault(); last.focus(); } + else if (!e.shiftKey && document.activeElement === last) { e.preventDefault(); first.focus(); } + } + }, true); +} diff --git a/src/main.js b/src/main.js index 37a22bc..6853865 100644 --- a/src/main.js +++ b/src/main.js @@ -30,6 +30,7 @@ import { Course, fmtTime } from './course.js'; import { PhotoMode, FRAMES, FILTERS, STICKERS } from './photo.js'; import { Insights, REPORTS } from './insights.js'; import { unseenNews, markNewsSeen } from './news.js'; +import { initA11y, reduceMotion } from './a11y.js'; const insights = new Insights(); // anonymous counts + error reports, online edition only @@ -110,7 +111,7 @@ const course = new Course({ onRespawn() { sfx.whoosh?.(); }, onFinish(r) { const p = player.pos; - for (const tile of [TILE.WOOL_RED, TILE.WOOL_BLUE, TILE.WOOL_YELLOW, TILE.WOOL_GREEN, TILE.COIN]) particles.burst(Math.floor(p.x), Math.floor(p.y) + 1, Math.floor(p.z), tile); + if (!reduceMotion.matches) for (const tile of [TILE.WOOL_RED, TILE.WOOL_BLUE, TILE.WOOL_YELLOW, TILE.WOOL_GREEN, TILE.COIN]) particles.burst(Math.floor(p.x), Math.floor(p.y) + 1, Math.floor(p.z), tile); sfx.fanfare?.(); sfx.yay?.(); const coins = r.total ? ` · 🪙 ${r.coins}/${r.total}` : ''; hint(`🏁 Finished in ${fmtTime(r.time)}${coins}${r.newBest ? (r.beatOld ? ' · 🏆 New best time!' : '') : ` · Best ${fmtTime(r.best)}`}`, 4500); @@ -495,15 +496,21 @@ function renderHotbar() { } } +/** Screen-reader text for a row of icons (hearts, bubbles, food); nothing when the row is empty. */ +function speak(el, text) { + if (text) { el.setAttribute('role', 'img'); el.setAttribute('aria-label', text); } else { el.removeAttribute('role'); el.removeAttribute('aria-label'); } +} + function renderStatus() { $('status').classList.toggle('hidden', !isSurvival()); if (!isSurvival()) return; let h = ''; for (let i = 0; i < MAX_HEALTH / 2; i++) { const v = survival.health - i * 2; - h += `♥`; + h += `${v >= 1 ? '♥' : '♡'}`; } $('hearts').innerHTML = h; + speak($('hearts'), `Health: ${Math.max(0, Math.ceil(survival.health / 2))} of ${MAX_HEALTH / 2} hearts`); const showAir = player?.headInWater || survival.air < MAX_AIR; $('bubbles').innerHTML = showAir ? '●'.repeat(Math.ceil(survival.air)) : ''; let f = ''; @@ -512,6 +519,8 @@ function renderStatus() { f += `🍗`; } $('hunger').innerHTML = f; + speak($('hunger'), isAdventure() ? `Food: ${Math.ceil(survival.hunger / 2)} of ${MAX_HUNGER / 2}` : ''); + speak($('bubbles'), showAir ? `Air: ${Math.ceil(survival.air)}` : ''); const armor = isAdventure() && adv.armor ? ITEMS.get(adv.armor) : null; $('armor-ind').textContent = armor ? `🛡️ ${itemName(adv.armor)} (−${Math.round(armor.armor * 100)}%)` : ''; renderXp(); @@ -1058,7 +1067,12 @@ function renderProfilePicker() { for (const [label, color] of items) { const b = document.createElement('button'); b.type = 'button'; b.className = 'chip' + (label === current ? ' on' : ''); b.textContent = label; - if (color) b.style.setProperty('--chip', color); + if (color) { + b.style.setProperty('--chip', color); + // Readable label on any player colour: dark ink on light colours, white on dark ones. + const [r, g, bl] = [1, 3, 5].map((i) => parseInt(color.slice(i, i + 2), 16) / 255).map((c) => (c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4)); + b.style.setProperty('--chip-ink', 0.2126 * r + 0.7152 * g + 0.0722 * bl > 0.3 ? '#10131c' : '#fff'); + } b.disabled = together.active || together.role === 'waiting' || together.role === 'connecting'; b.addEventListener('click', () => { together.profile = { ...together.profile, [key]: label }; saveProfile(together.profile); renderTogether(); }); box.appendChild(b); @@ -1280,6 +1294,8 @@ for (const [overlay, done] of [['inventory', 'inv-done'], ['craft', 'craft-done' ov.addEventListener('click', (e) => { if (e.target === ov) $(done).click(); }); } +initA11y(['together', 'account', 'worlds', 'news', 'report', 'gate', 'inventory', 'craft', 'pet', 'trade', 'questbook', 'photo', 'rotate', 'death']); + // Bit's side panel is not a pop-up (taps inside it must not close it), so it only gets the ✕. { const x = document.createElement('button'); @@ -1452,7 +1468,7 @@ survival.onDamage = () => { sfx.hurt(); const f = $('damage-flash'); f.classList.add('on'); - setTimeout(() => f.classList.remove('on'), 120); + setTimeout(() => f.classList.remove('on'), reduceMotion.matches ? 60 : 120); }; survival.onDeath = (reason) => { state = 'dead'; @@ -1910,7 +1926,7 @@ function foundStar(now) { const { x, y, z } = target; world.setBlock(x, y, z, B.AIR); world.flushDirty(); - for (const tile of [TILE.STAR, TILE.WOOL_RED, TILE.WOOL_BLUE, TILE.WOOL_YELLOW, TILE.WOOL_GREEN]) particles.burst(x, y, z, tile); + if (!reduceMotion.matches) for (const tile of [TILE.STAR, TILE.WOOL_RED, TILE.WOOL_BLUE, TILE.WOOL_YELLOW, TILE.WOOL_GREEN]) particles.burst(x, y, z, tile); sfx.fanfare?.(); sfx.yay?.(); hint('⭐ You found the Hidden Star! ⭐', 3500); if (isSurvival()) { inv.add(B.STAR, 1); renderHotbar(); } diff --git a/style.css b/style.css index 5eb81a1..a73259d 100644 --- a/style.css +++ b/style.css @@ -65,7 +65,7 @@ table.controls td:first-child { color: #e6c35c; white-space: nowrap; font-weight #hearts, #bubbles { display: flex; gap: 1px; font-size: 19px; line-height: 1; text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000; } .heart { color: #e0302a; } .heart.half { background: linear-gradient(90deg, #e0302a 50%, #3a1010 50%); -webkit-background-clip: text; background-clip: text; color: transparent; } -.heart.empty { color: #3a1010; } +.heart.empty { color: #ffd0cd; } .bubble { color: #8fd3ff; } #damage-flash { position: fixed; inset: 0; pointer-events: none; z-index: 6; background: radial-gradient(circle, transparent 40%, rgba(220, 0, 0, .55)); opacity: 0; transition: opacity .4s; } #damage-flash.on { opacity: 1; transition: none; } @@ -161,7 +161,7 @@ body.touch .qt-key { display: none; } .qb-item .qb-stars { white-space: nowrap; font-size: 1.05rem; } .qb-item.done { border-color: #66b043; } .qb-item.active { border-color: #ffd45a; } -.qb-item.off { opacity: .45; } +.qb-item.off { opacity: .72; } .qb-item .tag { font-size: .7rem; padding: 1px 6px; border-radius: 4px; background: #3a4255; margin-left: 6px; font-weight: 400; } /* Robot panel (docked so you can watch Bit work) */ @@ -329,7 +329,7 @@ select { width: 100%; } .tg-me { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: rgba(255, 255, 255, .04); border: 1px solid #2c3446; } .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; } .chip { padding: 4px 10px; border-radius: 999px; font-size: .85rem; background: #1b2030; border-color: var(--chip, #4b556b); } -.chip.on { background: var(--chip, #3f7d2a); border-color: #fff; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); } +.chip.on { background: var(--chip, #3f7d2a); border-color: #fff; color: var(--chip-ink, #fff); text-shadow: none; } .chip:disabled { opacity: .55; cursor: default; } .tg-start { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; } @media (max-width: 560px) { .tg-start { grid-template-columns: 1fr; } } @@ -507,3 +507,36 @@ body.touch #quest-tracker { right: calc(max(10px, env(safe-area-inset-right)) + .pet-panel .slot-grid { grid-template-columns: repeat(9, minmax(0, 50px)); } .pet-panel .slot-grid .slot { width: auto; height: auto; aspect-ratio: 1; } .pet-panel .slot-grid .slot img { width: 68%; height: auto; } + +/* ---------- Accessibility baseline (docs/accessibility.md) ---------- */ +/* A clear keyboard focus ring everywhere (the browser's own is a thin 1px line on our dark panels). */ +:focus-visible { outline: 3px solid #ffd45a; outline-offset: 2px; } +.panel:focus-visible, .overlay > .panel[tabindex="-1"]:focus { outline: none; } +input[type=range] { min-height: 24px; } + +/* HUD text sits over any sky, even a bright one: give it a dark backing so it stays above 4.5:1. */ +#hint, #toast, #armor-ind { background: rgba(8, 12, 22, .74); padding: 3px 12px; border-radius: 8px; } +#armor-ind:empty { display: none; } +#mode-badge { background: rgba(8, 12, 22, .78); } +#xp-level { background: rgba(8, 12, 22, .74); padding: 0 7px; border-radius: 8px; } +#hotbar { background: rgba(0, 0, 0, .62); } +.slot .num { font-size: 11px; color: #fff; } +.qb-item .tag { color: #e6ebf5; } + +/* Phones and tablets: every button, field and tab is at least 44px to tap. */ +body.touch button:not(.tbtn) { min-width: 44px; } +body.touch button:not(.tbtn), body.touch select, body.touch summary, +body.touch input[type=text], body.touch input[type=password], body.touch input[type=number], body.touch input[type=range] { min-height: 44px; } +body.touch .x-close { width: 44px; height: 44px; } +body.touch .legal-links a, body.touch .acc-privacy a, body.touch #news a, body.touch .install-help a { display: inline-block; padding: 14px 4px; } +body.touch details.fold > summary { padding-top: 12px; padding-bottom: 12px; } +body.touch #hud #hotbar .slot { width: 44px; height: 44px; } +body.touch #hud #hotbar .slot img { width: 30px; height: 30px; } +@media (max-height: 520px) { body.touch #xpbar { bottom: 66px; } body.touch #status { bottom: 74px; } } + +/* Reduced motion: no pop-in zoom for celebrations, no fades or slides, a gentler damage flash. */ +@media (prefers-reduced-motion: reduce) { + *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; } + #celebrate { transform: translate(-50%, -50%); } + #damage-flash { background: radial-gradient(circle, transparent 55%, rgba(220, 0, 0, .3)); } +} diff --git a/sw.js b/sw.js index ec5b616..d29673c 100644 --- a/sw.js +++ b/sw.js @@ -1,10 +1,11 @@ // Service worker: caches the whole game so it works offline once loaded. // Bump VERSION whenever files change so players get the update. -const VERSION = 'minicrafter-v31'; +const VERSION = 'minicrafter-v33'; const CORE = [ './', './index.html', './style.css', './privacy.html', './terms.html', './legal.css', './features.html', './features.css', './manifest.webmanifest', './site-config.json', './icons/icon-192.png', './icons/icon-512.png', './icons/icon-maskable-512.png', './icons/apple-touch-icon.png', './icons/favicon-32.png', './vendor/three.module.js', './vendor/blockly.min.js', './vendor/media/sprites.png', + './src/a11y.js', './src/adventure.js', './src/audio.js', './src/blocks.js',