diff --git a/public/favicon.svg b/public/favicon.svg index 8f1e994b5..08bb32de1 100644 --- a/public/favicon.svg +++ b/public/favicon.svg @@ -1,5 +1,7 @@ - - - - + + + + + + diff --git a/src/client/App.tsx b/src/client/App.tsx index 8d3aff3f2..2d6b18c9c 100644 --- a/src/client/App.tsx +++ b/src/client/App.tsx @@ -10,6 +10,7 @@ import { HostPage } from "./pages/HostPage"; import { JoinPage } from "./pages/JoinPage"; import { ViewerPage } from "./pages/ViewerPage"; import { AppHeader } from "./components/living/Header"; +import { BrandLoader } from "./components/living/BrandMark"; import { Btn, Pill } from "./components/living/primitives"; import { ComicTooltip } from "./components/living/ComicTooltip"; import { Glyph, type GlyphName } from "./ui/icons"; @@ -206,8 +207,12 @@ function SiteAccessGate({
{access.kind === "checking" ? ( -
- +
+ {vis ? null : ( {t("gate.checking")} diff --git a/src/client/components/living/BrandMark.tsx b/src/client/components/living/BrandMark.tsx new file mode 100644 index 000000000..4cbc718df --- /dev/null +++ b/src/client/components/living/BrandMark.tsx @@ -0,0 +1,80 @@ +import { useEffect, useRef } from "react"; +import { bindSvgReplayOnPointerEnter } from "../../ui/animation"; + +export type BrandMotion = "static" | "once" | "loop"; + +export function BrandMark({ + size = 32, + motion = "static", +}: { + size?: number; + motion?: BrandMotion; +}) { + const animated = motion !== "static"; + const motionClass = + motion === "loop" ? " is-animated" : motion === "once" ? " is-once" : ""; + const markRef = useRef(null); + + useEffect(() => { + if (motion !== "once" || !markRef.current) return; + return bindSvgReplayOnPointerEnter(markRef.current); + }, [motion]); + + return ( + + ); +} + +export function BrandLoader() { + return ( + + ); +} diff --git a/src/client/components/living/Comic.tsx b/src/client/components/living/Comic.tsx index 4fb757e82..adc11f80c 100644 --- a/src/client/components/living/Comic.tsx +++ b/src/client/components/living/Comic.tsx @@ -722,7 +722,7 @@ ${rmBlock( ); } -/** 7. route-failed: 4 panels, one-shot 3.6s entrance + idle green flow. */ +/** 7. route-failed: 4 panels, direct and SFU paths both end unavailable. */ function SceneRouteFailed({ theme }: { theme: ComicTheme }) { return ( <> @@ -733,25 +733,26 @@ function SceneRouteFailed({ theme }: { theme: ComicTheme }) { .vls-rf-x{transform-box:fill-box;transform-origin:center;animation:vlsRfX 3.6s ease-out both} .vls-rf-spark{animation:vlsRfSpark 3.6s ease-out both} .vls-rf-dot{animation:vlsRfDot 3.6s ease-in-out both} -.vls-rf-green{stroke-dasharray:5 5;animation:vlsRfGreen 3.6s ease-out both,vlsRfFlow 1.1s linear 3.6s infinite} +.vls-rf-fallback{stroke-dasharray:5 5;animation:vlsRfFallback 3.6s ease-out both,vlsRfFailurePulse 2.6s ease-in-out 3.6s infinite} +.vls-rf-fallback-x{transform-box:fill-box;transform-origin:center;animation:vlsRfFallbackX 3.6s ease-out both,vlsRfFailureX 2.6s ease-in-out 3.6s infinite} .vls-rf-slots{animation:vlsRfSlots 3.6s ease-out both} -.vls-rf-star{transform-box:fill-box;transform-origin:center;animation:vlsRfStar 3.6s cubic-bezier(.3,1.5,.5,1) both} .vls-rf-grey{animation:vlsRfGrey 3.6s ease-out both} @keyframes vlsRfIn{from{opacity:0;transform:translateY(6px) scale(.9)}} @keyframes vlsRfMarch{from{stroke-dashoffset:0}to{stroke-dashoffset:-16}} @keyframes vlsRfX{0%,32%{opacity:0;transform:scale(1.7) rotate(8deg)}40%,100%{opacity:1;transform:scale(1) rotate(8deg)}} @keyframes vlsRfSpark{0%,32%{opacity:0}35%{opacity:1}44%,100%{opacity:0}} @keyframes vlsRfDot{0%,44%{transform:translate(0,0);opacity:0}46%{opacity:1}54%{transform:translate(2px,-31px)}60%{transform:translate(18px,-31px)}70%,100%{transform:translate(28px,-11px);opacity:0}} -@keyframes vlsRfGreen{0%,72%{opacity:0}80%,100%{opacity:1}} -@keyframes vlsRfFlow{to{stroke-dashoffset:-20}} +@keyframes vlsRfFallback{0%,72%{opacity:0}80%,100%{opacity:.42}} +@keyframes vlsRfFallbackX{0%,78%{opacity:0;transform:scale(1.6) rotate(8deg)}86%,100%{opacity:1;transform:scale(1) rotate(8deg)}} +@keyframes vlsRfFailurePulse{0%,100%{opacity:.42;stroke-dashoffset:0}50%{opacity:.72;stroke-dashoffset:-8}} +@keyframes vlsRfFailureX{0%,100%{opacity:1}50%{opacity:.58}} @keyframes vlsRfSlots{0%,60%{opacity:0}66%,100%{opacity:1}} -@keyframes vlsRfStar{0%,82%{opacity:0;transform:scale(0)}90%{opacity:1;transform:scale(1.25)}96%,100%{opacity:1;transform:scale(1)}} @keyframes vlsRfGrey{0%{opacity:.9}70%{opacity:.9}82%,100%{opacity:.15}} ${rmBlock( - ["vls-rf-panel", "vls-rf-march", "vls-rf-x", "vls-rf-spark", "vls-rf-dot", "vls-rf-green", "vls-rf-slots", "vls-rf-star", "vls-rf-grey"], + ["vls-rf-panel", "vls-rf-march", "vls-rf-x", "vls-rf-spark", "vls-rf-dot", "vls-rf-fallback", "vls-rf-fallback-x", "vls-rf-slots", "vls-rf-grey"], [ - [".vls-rf-green", "stroke-dasharray:none;opacity:1"], - [".vls-rf-slots,.vls-rf-star", "opacity:1"], + [".vls-rf-fallback", "stroke-dasharray:none;opacity:.42"], + [".vls-rf-fallback-x,.vls-rf-slots", "opacity:1;transform:none"], [".vls-rf-spark,.vls-rf-dot", "opacity:0"], [".vls-rf-grey", "opacity:.15"], ], @@ -800,21 +801,27 @@ ${rmBlock( - + - - - - - + + + + - + ); diff --git a/src/client/components/living/ComicTooltip.tsx b/src/client/components/living/ComicTooltip.tsx index 5f3991193..edc36d4b3 100644 --- a/src/client/components/living/ComicTooltip.tsx +++ b/src/client/components/living/ComicTooltip.tsx @@ -188,6 +188,9 @@ export function ComicTooltip({ }} onPointerDown={(event) => { if (event.pointerType !== "touch") return; + // A suppression token belongs only to the click synthesized for the + // completed long-press. A later touch starts a new, actionable gesture. + longPressed.current = false; cancelPress(); pressPoint.current = { x: event.clientX, y: event.clientY }; pressTimer.current = window.setTimeout(() => { @@ -240,6 +243,7 @@ export function ComicTooltip({ onClickCapture={(event) => { // The synthetic click after a long-press must not fire the control. if (longPressed.current) { + longPressed.current = false; event.preventDefault(); event.stopPropagation(); } diff --git a/src/client/components/living/Couch.tsx b/src/client/components/living/Couch.tsx index 2895f2411..eaafaad2c 100644 --- a/src/client/components/living/Couch.tsx +++ b/src/client/components/living/Couch.tsx @@ -21,7 +21,7 @@ export function PawnSvg({ color, crown }: { color: string; crown?: boolean }) { {led} diff --git a/src/client/components/living/RouteTree.tsx b/src/client/components/living/RouteTree.tsx index 43c991b96..e037dcae8 100644 --- a/src/client/components/living/RouteTree.tsx +++ b/src/client/components/living/RouteTree.tsx @@ -26,6 +26,16 @@ interface TreeNode { const ROW_BASE = 40; const NARROW_TOPOLOGY_QUERY = "(max-width: 640px)"; +const PAWN_CENTER_X = 20; +const HOST_SCALE = 0.85; +const ROOT_SCALE = 0.72; +const CHILD_SCALE = 0.52; +const ROOT_LABEL_OFFSET_Y = 36; +const CHILD_LABEL_OFFSET_Y = 20; + +function centeredPawnX(centerX: number, scale: number): number { + return centerX - PAWN_CENTER_X * scale; +} function subscribeToNarrowViewport(listener: () => void): () => void { if (typeof window === "undefined" || !window.matchMedia) return () => {}; @@ -122,7 +132,7 @@ export const RouteTree = memo(function RouteTree({ else add(null, node); } - const spacing = nodes.length > 10 ? 42 : 44; + const spacing = nodes.length > 10 ? 58 : 60; let row = 0; const pos = new Map(); function layout(node: TreeNode, depth: number): void { @@ -171,7 +181,7 @@ export const RouteTree = memo(function RouteTree({ ...pendingPos.map((point) => point.y), ]; const hostPos = { - x: layoutConfig.hostX, + x: rootYs.length > 0 ? layoutConfig.hostX : layoutConfig.baseWidth / 2, y: rootYs.length > 0 ? rootYs.reduce((sum, y) => sum + y, 0) / rootYs.length @@ -303,13 +313,13 @@ export const RouteTree = memo(function RouteTree({ @@ -343,11 +353,12 @@ export const RouteTree = memo(function RouteTree({ const point = pos.get(node.key)!; const child = node.via !== null && !node.sfu; const selected = selectedPeerId === node.key; + const scale = child ? CHILD_SCALE : ROOT_SCALE; return ( {selected ? ( @@ -364,7 +375,7 @@ export const RouteTree = memo(function RouteTree({ {compactVisibleLabel( @@ -403,8 +417,8 @@ export const RouteTree = memo(function RouteTree({ {compactVisibleLabel( diff --git a/src/client/components/living/Stage.tsx b/src/client/components/living/Stage.tsx index 821b11e70..1193b4a9d 100644 --- a/src/client/components/living/Stage.tsx +++ b/src/client/components/living/Stage.tsx @@ -5,6 +5,7 @@ import type { ReactNode } from "react"; import { Glyph, type GlyphName } from "../../ui/icons"; import { useCopy, type CopyKey } from "../../ui/copy"; import { Comic, type ComicKind } from "./Comic"; +import { BrandLoader, BrandMark } from "./BrandMark"; export type ChinState = "off" | "on" | "warn" | "bad" | "busy"; @@ -41,7 +42,13 @@ export function StaticNoise() { return