diff --git a/app/package-lock.json b/app/package-lock.json index c34ed60..37d8263 100644 --- a/app/package-lock.json +++ b/app/package-lock.json @@ -1,12 +1,12 @@ { "name": "microduck-sandbox", - "version": "1.0.0", + "version": "0.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "microduck-sandbox", - "version": "1.0.0", + "version": "0.1.0", "dependencies": { "@emotion/react": "^11.14.0", "@emotion/styled": "^11.14.1", diff --git a/app/package.json b/app/package.json index 2302af7..cf291ed 100644 --- a/app/package.json +++ b/app/package.json @@ -1,7 +1,7 @@ { "name": "microduck-sandbox", "private": true, - "version": "1.0.0", + "version": "0.1.0", "type": "module", "scripts": { "dev": "vite", diff --git a/app/src/ui/Hud.jsx b/app/src/ui/Hud.jsx index 9b8089c..be2d8bc 100644 --- a/app/src/ui/Hud.jsx +++ b/app/src/ui/Hud.jsx @@ -1,20 +1,19 @@ -// In-game HUD: Back (top-left), pre-order button (top-right, label flips -// to "Pre-order pack" while rollers are selected - the rollers ship in the -// accessory pack), quickbar (bottom-left: colour palette + loco switch), +// In-game HUD: Back (top-left), quickbar (bottom-left: colour palette + +// loco switch), // telemetry stack (bottom-right) and the LOADING ROLLERS line while the // roller stack streams in. // // Chrome reads as small comic PANELS: each group sits in a thick cream // keyline frame on a dark glass plate (1px ink inset between glass and // frame), with a caption box (cartouche) overlapping the frame's corner - -// flat cream (orange for the shop CTA) fill, ink keyline, hard 2px offset +// flat cream (orange for the active move) fill, ink keyline, hard 2px offset // shadow, half in / half out like a caption on a comic panel's edge. Same // tokens as the landing (Anton, orange, cream), zero radius everywhere. // Title-menu CTAs stay ComicButton. // // Whole HUD is hidden while the title/pause overlay is up; touch mode // strips it down to the thumbs + Back. -import { useEffect, useRef, useState } from "react"; +import { useEffect, useState } from "react"; import Box from "@mui/material/Box"; import { keyframes } from "@mui/material/styles"; import { useGame, gameApi } from "../store.js"; @@ -23,40 +22,6 @@ import { uiClick, isMuted, setMuted } from "../game/audio.js"; import { ORANGE, MONO } from "../theme.js"; import { ANTON, COMIC_INK, CREAM } from "./comic.jsx"; -// Matrix-style letter scramble: on change every glyph flips through random -// charset entries, then locks to its target left-to-right over ~0.45 s. -// Monospace keeps the width stable mid-scramble. -const SCRAMBLE_GLYPHS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789#$%&*<>/=+"; -function useScramble(target) { - const [text, setText] = useState(target.toUpperCase()); - const timer = useRef(null); - const shown = useRef(target.toUpperCase()); - useEffect(() => { - const t = target.toUpperCase(); - if (shown.current === t) return; - shown.current = t; - if (timer.current) clearInterval(timer.current); - const n = t.length; - const DUR = 450; // ms until the last letter locks - const rnd = () => SCRAMBLE_GLYPHS[(Math.random() * SCRAMBLE_GLYPHS.length) | 0]; - const t0 = performance.now(); - timer.current = setInterval(() => { - const k = Math.floor(((performance.now() - t0) / DUR) * n); - if (k >= n) { - clearInterval(timer.current); - timer.current = null; - setText(t); - return; - } - let out = t.slice(0, k); - for (let i = k; i < n; i++) out += rnd(); - setText(out); - }, 40); - return () => timer.current && clearInterval(timer.current); - }, [target]); - return text; -} - const recBlink = keyframes` 0%, 58% { opacity: 1; } 59%, 100% { opacity: 0.12; } @@ -129,7 +94,7 @@ const captionBaseSx = { boxShadow: `2px 2px 0 ${COMIC_INK}`, }; -function HudPlate({ caption, captionSide = "left", captionFill = "cream", children, sx }) { +function HudPlate({ caption, captionFill = "cream", children, sx }) { return ( {caption} @@ -260,41 +225,6 @@ function BackButton() { ); } -export const SHOP_URL = "https://store.pollen-robotics.com/collections/microduck"; - -// Exported: the title/pause overlay renders the same plate in the same -// spot, so the pause fade reads as the button staying put, not two -// different buttons swapping. -export function PreorderButton({ sx }) { - const locoWant = useGame((s) => s.locoWant); - const text = useScramble(locoWant === "rollers" ? "Pre-order pack" : "Pre-order"); - return ( - - uiClick()} - sx={{ - ...hudHitSx, - background: ORANGE, - color: COMIC_INK, - "&:hover": { filter: "brightness(1.07)" }, - "&:active": { filter: "brightness(0.92)" }, - }} - > - {text} - - - ); -} - function Quickbar() { const variant = useGame((s) => s.variant); const locoWant = useGame((s) => s.locoWant); @@ -621,7 +551,6 @@ export default function Hud() { return ( <> - {!touchMode && ( <> diff --git a/app/src/ui/TitleMenu.jsx b/app/src/ui/TitleMenu.jsx index c579860..0acffac 100644 --- a/app/src/ui/TitleMenu.jsx +++ b/app/src/ui/TitleMenu.jsx @@ -17,7 +17,6 @@ import { playConfirmBloop } from "../game/audio.js"; import { INK, ORANGE, MONO } from "../theme.js"; import { ComicButton, ComicTitle, HalftoneRamp, ANTON, CREAM } from "./comic.jsx"; import MenuDuck, { preloadMenuDuck, isMenuDuckReady } from "./MenuDuck.jsx"; -import { PreorderButton } from "./Hud.jsx"; import { readLayoutMap, resolveKeycaps } from "./keyboard-layout.js"; const rowIn = keyframes` @@ -381,11 +380,9 @@ export default function TitleMenu() { reach={60} /> - {/* Corner chrome, shared grammar with the vitrine header (drawn - duck head, top-left) and the in-game HUD (pre-order, top-right): - the title screen wears the same screen furniture as the game. - Gated with the rest of the reveal so the loading state is a - single centered spinner on bare ink. */} + {/* Corner branding, shared with the vitrine header (drawn duck + head, top-left). Gated with the rest of the reveal so the + loading state is a single centered spinner on bare ink. */} {ready && ( )} - {/* The in-game HUD's shop plate, verbatim: same component, same - fixed spot, so pausing never swaps it for a lookalike. */} - {ready && } - {/* Loading gate: one centered spinner on bare ink until logo, fonts, the duck stage's assets and the game boot are all in - then the whole composition (corner chrome included) reveals at