跳到正文
VibeFather
免费注册

用这个模板做的 2 个案例

同一份提示词,不同的 [VARIABLES] 变量。点一个在上方预览。

关于这个模板

霓虹贪吃蛇 3D 游戏是一个单页浏览器游戏。首屏是 16×16 的暗色网格,一条由四节海玻璃色蛇身组成的蛇已摆好姿势,前方有一颗铜色珠子。桌面端,网格左侧放着一张磨砂卡片;手机端,卡片沿底部排列,网格保持可见。每一节蛇身会一起从一格滑到下一格。摄像机始终位于蛇头南侧,因此方向键始终与屏幕方向一致。

默认游戏是 Lumen Coil,一台来自 Northglass Hall 的街机,位于虚构的 Port Elling 市 Marrow Lane 18 号。玩家在 Relay Floor 上收集离子珠。每颗珠子增加一节蛇身,并得分为当前速度档位的 10 倍,速度档位随蛇身变长从 1 升到 5。HUD 显示得分、长度、档位和场地规则。Wrap 规则下,蛇从开放边缘的对面穿回;Walls 规则下,场地边缘画有一道低矮围栏,碰到围栏或撞到自己都会结束本局。每种规则都会在浏览器中保存最高分和五组姓名缩写。

珠子以每分钟 96 拍的节奏循环脉动,由 Web Audio 合成。桌面端用方向键和 WASD 操控。手机端使用滑动和四按钮方向键。暂停和游戏结束各有独立卡片。开启减少动态效果后,珠子保持静止,标题画面摄像机的小幅漂移停止,跟随速度也会减慢。

开发者和独立开发者可以将其作为静态文件发布,并通过一个内容文件重命名。六个变量分别覆盖游戏名、场馆、收集物、场地、街机标语和开场句。网格尺寸、颜色、速度和操控方式保持不变。Fern Current 是第二套名称,来自 Glasshouse After Hours 的夜间温室。

模板提示词

在线演示就是用这份提示词原样做出来的,没有额外补充。其他案例只是改了 [VARIABLES] 变量的值。 提示词保持英文原版,国内常用的 AI 编程工具都能直接理解;下面附中文参考译文。

# Neon Snake 3D Game

Build this website exactly as described below. Replace the [VARIABLES] with your own values; keep everything else.

## Brief
Build [BRAND], a complete single-page 3D snake game on a dark 16 by 16 grid called [ARENA]. A four-segment glowing capsule line and one pulsing bead are already in view behind a frosted start card. The line glides from cell to cell, the camera follows from the south, and the bead pulses with a short loop synthesized in Web Audio. Two floor rules, Wrap and Walls, speed steps 1 to 5, and local bests are part of the game. [STUDIO] presents it. Opening sentence: [TAGLINE].

- Audience: Indie hackers and front-end developers who want a finished static Three.js game with keyboard, swipe, and on-screen controls, readable on a desk and a phone.
- Goal: Ship one replayable run: a start card over a living grid, immediate play, growing speed, wrap or rail rules, pause, game over with initials, and bests stored in the browser. A second set of names must keep the same grid, snake, colors, and rules.
- Tone: Calm, precise, and a little playful. Short US English. Talk about the line, the floor, and the bead. No military ranks, no hype, and no cyber slang.

## Stack
- Framework: Vite 6 + TypeScript 5
- Styling: Vanilla CSS
- Libraries: three (MIT), lucide (ISC), @fontsource/syne (OFL), @fontsource-variable/outfit (OFL), @fontsource/ibm-plex-mono (OFL)
- Build: `npm run build` → static files in `dist/`. No backend, no server code, no external APIs.
- Setup:
  - Scaffold Vite's vanilla TypeScript template. Scripts: dev=vite, build=tsc && vite build, preview=vite preview. Package name is the slug of BRAND, not a fixed template id. Set vite base to './', build.outDir to dist, build.emptyOutDir to true, and build.sourcemap to false. tsconfig: strict true, noEmit true.
  - Install only three, lucide, @fontsource/syne, @fontsource-variable/outfit, and @fontsource/ibm-plex-mono as runtime dependencies, plus Vite and TypeScript as dev dependencies. Do not add React, a physics engine, a game framework, postprocessing, a tween library, or an audio decoder.
  - Import Syne 700 and 800 from @fontsource/syne, Outfit variable weights from @fontsource-variable/outfit/wght.css, and IBM Plex Mono 500 from @fontsource/ibm-plex-mono. Copy only the Lucide Pause, Volume2, and VolumeX icon nodes into src/icons.ts and render them with lucide createElement at 18px, currentColor, aria-hidden. Wait up to 800ms for document.fonts.ready, then show the card even if fonts are still swapping.
  - Use modules src/content.ts, main.ts, game.ts, scene.ts, audio.ts, ui.ts, and styles.css. Keep every proper name, button label, hint, and sentence in content.ts. Grid size, speeds, coordinates, and colors are named constants in game.ts and scene.ts.
  - World axes: +x east (screen right), +y up, +z south (toward the camera, screen down). North is decreasing iz and points up the screen during play. Cell (ix, iz) center is ((ix - 7.5) * 1.2, 0, (iz - 7.5) * 1.2) with ix and iz from 0 to 15. Playable lip is x and z of ±9.6. Wrap period is 19.2.
  - Use BRAND, STUDIO, PICKUP, ARENA, PLACE, and TAGLINE for all player-facing names. Sentence patterns: Collect ${PICKUP} on the ${ARENA}. The ${ARENA} is holding. Document title is BRAND, an em dash, and ARENA. When values differ from the defaults, rewrite TAGLINE so it does not name the old floor or the old pickup. Never show raw bracket placeholders. The capsule line stays a snake even if TAGLINE uses a metaphor.
  - Persist scores under the key slug(BRAND) + '-runs' and mute under slug(BRAND) + '-muted'. slug lowercases and turns every non-alphanumeric run into one hyphen, then trims hyphens. Lumen Coil becomes lumen-coil-runs. Wrap localStorage in try/catch and keep playing if it throws. No calendar dates.
  - One index.html, lang=en, viewport with viewport-fit=cover, a full-view canvas, and HTML overlays. Body margin 0, overflow hidden, background #07080A, height 100dvh. Touch-action none on the canvas. No router and no second page.
  - Read prefers-reduced-motion on load and on change. Reduced motion holds the bead at scale 1 and halo opacity 0.32, freezes the title drift and the grid breathe, sets follow smoothing to the slower taus, and skips the score pop and the death color flash. Audio may still play.
  - Cap device pixel ratio at 1.75, and at 1.25 below 800px. Antialiasing on, shadows off, alpha false. If the rolling frame time stays above 28ms for three seconds after the first two seconds of play, lower the cap by 0.25 once and not below 1. Do not change speeds when you do that.

## Variables
- [BRAND] — Game name (default: "Lumen Coil"). Invented name on the start heading, the top bar, the document title, and the save-key slug.
- [STUDIO] — Hall name (default: "Northglass Hall"). Invented hall or house. Shown as the eyebrow above the game name.
- [PICKUP] — Pickup (default: "ion beads"). Lowercase plural noun for what the line collects.
- [ARENA] — Floor name (default: "Relay Floor"). Invented name of the grid. Used in the collect sentence, the pause line, and the document title.
- [PLACE] — Cabinet line (default: "Cabinet 4, 18 Marrow Lane, Port Elling, 6pm–1am"). One short line: which cabinet or house, an invented street address, and hours.
- [TAGLINE] — Opening sentence (default: "Steer the sea-glass line across the Relay Floor."). One sentence under the game name. Rewrite it when the floor or the pickup changes. The 3D line stays capsules.
- [CREDIT] — keep a small "Template by VibeFather" link to https://vibefather.ai/t/neon-snake-3d-game in the footer (default: yes; delete this line to remove it)

The copy under Pages & Sections is written for the default values. If your values differ, rewrite every headline, paragraph, label and image for them — same length, tone and structure. Layout, colors, type and motion stay as described.
Keep all copy, image paths and links in one content file (for example `src/content.ts`), keyed by section, so the content can be swapped later without touching components.

## Design
### Colors
- Void `#07080A` — Page background, renderer clear color, fog, and the overlay scrim base
- Floor `#07100F` — Grid shader background
- Grid `#1E4A42` — Idle grid lines
- Hot line `#8CFFE0` — Grid lines near the head
- Sea glass `#2EE6A6` — Snake body emissive, primary button, focus ring, Wrap chip border, filled speed pips
- Head `#E9FFF8` — Head emissive, game name, and start heading
- Copper `#FF8A3D` — Bead emissive, bead halo, and the food pool on the floor
- Cream `#FFE6D0` — Bead core diffuse color
- Ink `#071410` — Text on the primary button
- Mist `#D5E8E2` — Body copy, HUD values, and ghost-button text
- Mute `#8AA39A` — Eyebrow, hints, place line, and the credit link
- Rail pink `#FF5D73` — Walls rail emissive, Walls chip border, and the brief death tint on the head
- Card `#0C1414` — Frosted cards at 82% opacity
- Stroke `#234840` — Card borders, idle chips, and unselected radios
- Pip `#1A3330` — Empty speed pips
- Hover `#76F6C4` — Primary button hover

### Typography
- Game name and start heading: Syne (OFL), weights 700/800
- UI, buttons, hints, and body: Outfit Variable (OFL), weights 400/500/600
- Scores, length, and step: IBM Plex Mono (OFL), weights 500

### Layout & motion
- Spacing: Use a 4px base. Desktop card padding 28px, inset 36px from the left. Mobile card inset 12px plus safe-area insets. HUD chip gap 8px, top-bar padding 12px 16px. Buttons are at least 44px tall. The pad keys are 64px. The center of the play view stays clear of the pad.
- Radius: Cards 20px, buttons 12px, radios 12px, HUD chips fully round, pad keys 14px. The snake and the bead are round capsules and spheres. The rail is a sharp low box.
- Motion: Simulation uses the frame delta capped at 0.05 seconds, with at most 3 cell crossings processed per frame. Render after the step.
- Motion: All capsules share one offset from 0 to 1 and glide together between cell centers. The play camera never yaws. Its position eases toward a southern offset with tau 0.28 seconds, or 0.62 when reduced motion is on.
- Motion: The bead swells on each quarter note at 96 beats per minute: scale 1 to 1.2 in 0.09 seconds, back to 1 by 0.32 seconds. Reduced motion holds scale 1 and halo opacity 0.32.
- Motion: Title camera drifts by a sine of 0.08 radians over about 28 seconds and stops when the run starts. Buttons darken or lighten on hover. A pressed control scales to 0.98 in 80ms unless reduced motion is on.
- Motion: Pause freezes the offset, the beat phase, and the title drift. The hidden tab pauses the same way and does not resume until Resume.
- Imagery: Draw the floor, the line, the bead, and the rail from Three.js primitives and one grid shader. No photographs, generated bitmaps, textures, HDRIs, or downloaded models. The first screen is that 3D floor beside or above a frosted card, never type on a flat field. The head has no face. No people and no portraits.

## Pages & Sections
### Lumen Coil — Relay Floor (`index.html`)
1. **Start card over the glowing floor** — Document title: Lumen Coil — Relay Floor, from BRAND and ARENA. Eyebrow, uppercase with 0.12em tracking: Northglass Hall. Heading: Lumen Coil. Deck, from TAGLINE: Steer the sea-glass line across the Relay Floor. Collect sentence: Collect ion beads on the Relay Floor. Always-visible rule line, with the noun taken from PICKUP: Each of the ion beads scores 10 times the current step. Primary button: Start run. Disclosure button: How to steer. Inside it, three lines: Arrows or W A S D point up, left, down, and right on the screen. You cannot turn back on yourself. On a phone, swipe the floor or use the pad. P or Esc pauses. And the rates: Steps run at 3.4, 4.4, 5.5, 6.6, and 7.8 cells a second. Floor rule radios, default Wrap: Wrap, with hint Leave an edge and return on the far side. Walls, with hint A low rail. Touch it and the run ends. Show the hint for the selected radio only. Best wrap and Best walls show the stored number or an em dash. Under the heading Recent, list the top 3 initials for the selected rule, or the sentence No runs saved on this browser yet. Place line, from PLACE: Cabinet 4, 18 Marrow Lane, Port Elling, 6pm–1am. If [CREDIT] is present, one 12px Outfit link in Mute under that line. Focus Start run on load. Switching radios updates the rail and the recent list and does not start the run.
   Layout: The canvas is already rendering the posed line and the bead before the click. Hide the HUD and the pad. Desktop at 900px and wider: a 400px card, 20px radius, 28px padding, background rgba(12,20,20,0.82), border 1px solid #234840, backdrop-filter blur(14px), placed 36px from the left and vertically centered, max-height calc(100dvh - 48px), overflow auto. It covers well under half of 1440px. Title camera position (6.2, 8.2, 10.8), lookAt (0.2, 0.25, 0.5), fov 44. At 1440×900 the whole four-capsule line and the bead must sit fully in the open area to the right of the card. If they do not, shift lookAt.x west until they do and keep the camera south of the floor. Mobile under 900px: a bottom sheet, left and right 12px, bottom 12px plus safe area, max-height 58dvh, same fill, radius 20px. Title camera (4.2, 12.4, 10.5), lookAt (4.2, 0.0, 3.6), fov 56, so the line and the bead fall in the top 42% of a 390×844 frame, above the sheet. Heading Syne 800, 44px desktop and 34px mobile, color #E9FFF8. Deck Outfit 400 16px, color #D5E8E2, line-height 1.45. Start run is full width, 48px, background #2EE6A6, text #071410, Outfit 600. Ghost controls use a #234840 border and Mist text.
   Motion: While the card is up the line does not move. The bead pulses. The title camera yaws by sin(time * 0.22) * 0.08 radians around the lookAt point. Reduced motion uses the base camera with no yaw. How to steer toggles its panel and does not start the game. Start run hides the card, shows the HUD, resumes the audio context, and begins movement on that click. The camera eases from the title rig to the follow rig. Enter activates the focused button.
2. **Grid, rail, snake, and bead** — The line is four capsules, not a picture of an animal. Head cell (11, 8), then (10, 8), (9, 8), (8, 8), facing east, offset 0, so the whole line sits in the eastern half of the floor and stays clear of the left card. First bead, and the bead after every restart, is cell (14, 8). Later beads pick a random cell that is not in the body. The head has no eyes, mouth, tongue, or markings. The bead is one sphere plus a soft halo, with no rings and no orbiting pieces.
   Layout: Floor: a 36 by 36 shader plane at y=0. Lines exist only inside x and z of ±9.6, on multiples of the cell edge. World distance to the nearest line feeds a 1.6px screen-width mask via fwidth. Line color mixes #1E4A42 to #8CFFE0 by smoothstep across 5.2 to 0.6 units from the head. A copper pool, smoothstep from 2.0 to 0.2 units around the bead, adds #FF8A3D at 35% strength. Outside the lip the lines fade to the floor color #07100F. A slow breathe multiplies line strength by 0.94 + 0.06 * sin(time * 1.3), frozen when reduced motion is on or the run is paused. FogExp2 color #07080A density 0.045. Ambient light #10211C intensity 0.25. A point light parented above the head, color #D7FFF3, intensity 4, distance 8, decay 2. Clear color, fog, and the page are #07080A. ACES filmic tone mapping, exposure 1.05, output color space sRGB. Head capsule: radius 0.38, cylinder length 0.28, center y 0.40, MeshStandardMaterial color #D9FFF4, emissive #E9FFF8, emissiveIntensity 2.0, roughness 0.4, metalness 0.08. Body capsules: radius 0.32, cylinder length 0.36, same y, shared material, emissive #2EE6A6, emissiveIntensity 1.5. Align each capsule's long axis with its short cell delta. Create the two geometries once. Show one mesh per segment, adding a mesh only when the line grows, up to 256. Bead core: sphere radius 0.32 at y 0.48, color #FFE6D0, emissive #FF8A3D, emissiveIntensity 1.6, roughness 0.25. Halo: sphere radius 0.58, MeshBasicMaterial #FF8A3D, opacity 0.30, depthWrite false, additive blending. Rail, visible only while Walls is selected: four boxes, height 0.16, thickness 0.12, inner face on the ±9.6 lip, centers at ±9.66. North and south boxes are 19.2 long along x. East and west boxes are 19.44 long along z so the corners meet. Material color #3A2428, emissive #FF5D73, emissiveIntensity 0.55, roughness 0.6. No posts and no towers. Hide the rail in Wrap. Favicon at public/favicon.svg: a 32 viewBox rounded square filled #07080A with one sea-glass arc, no text and no face.
   Motion: On the title card the meshes sit on cell centers. The bead scale and halo follow the beat clock. The rail appears or disappears immediately when the radio changes, with no camera cut. Reduced motion skips the breathe and the swell.
3. **Stepping, growth, and the two rules** — Speed from length, including the head: step 1 at length 4 to 7 is 3.4 cells a second and 10 points; step 2 at 8 to 11 is 4.4 and 20 points; step 3 at 12 to 16 is 5.5 and 30 points; step 4 at 17 to 22 is 6.6 and 40 points; step 5 at 23 or more is 7.8 and 50 points. Points are awarded at the step in effect when the bead is taken, then length grows by one and the step is recomputed. Filling all 256 cells ends the run as a clear floor after that last score.
   Layout: One shared offset advances by cellsPerSecond times dt. Every segment i glides from its origin cell toward its target: the head targets head plus direction, and each later segment targets the cell in front of it. Short delta: subtract or add 16 so each axis delta is -1, 0, or 1. World position is the origin center plus short delta times 1.2 times offset. In Wrap, if x or z leaves the ±9.6 lip, add or subtract 19.2 so the capsule reappears on the far lip instead of streaking across the middle. In Walls, do not wrap that coordinate. When offset reaches 1, resolve one crossing before subtracting. On a successful commit, subtract 1 and continue, at most 3 commits per frame. On rail, cross, or clear, leave offset at 1 and stop. Apply the queued turn first. The upcoming cell is the head plus that direction. In Walls, a cell outside 0 to 15 ends the run with reason rail and does not commit, so the head rests on the rail. In Wrap, wrap the cell with modulo 16. If the upcoming cell is occupied by any body cell, except the tail when the grow queue is 0, end with reason cross and do not commit. Otherwise commit. If the cell is the bead, add 10 times the current step, add 1 to the grow queue, and play the eat blip before moving the cells. Unshift the new head. If the grow queue is positive, decrement it and keep the tail; otherwise pop the tail. If this crossing ate a bead, pick the next bead uniformly at random among cells not in the updated body. If none remain, end with reason clear and hide the bead. A new tail capsule scales from 0.2 to 1 in 0.18 seconds, or appears full size when reduced motion is on. Ignore a queued turn that is the reverse of the current direction. One queued turn, replaced by the latest legal key. Apply it at the crossing, then clear it. Direction map, world and screen: north (0, -1) is up, south (0, +1) is down, west (-1, 0) is left, east (1, 0) is right.
   Motion: Segments move together for the whole step, including the tail. Only a capsule that is crossing an open edge jumps to the far lip. Pause, the hidden tab, and game over stop the offset. A hitch must not skip the collision check: the while-loop of at most 3 crossings is what prevents that.
4. **Follow camera and the beat** — During play the camera sits south of the head and does not swing behind it. Up on the keyboard stays up on the screen after a turn. The bead is the only thing locked to the music. There is no visualizer, no waveform, and no extra glow pass.
   Layout: Perspective camera, near 0.1, far 80. Desktop fov 44. Below 800px, fov 56. Desired position is the head world position plus (0, 7.4, 8.2) on desktop and plus (0, 10.2, 10.4) below 800px. Look point is the head plus (0, 0.4, -1.6) on desktop and (0, 0.3, -2.2) below 800px, so more of the floor north of the head stays in view above the pad. Each frame, move position and the look point toward those targets by 1 - exp(-dt / tau), then lookAt. Position tau 0.28 and look tau 0.16. Reduced motion: 0.62 and 0.45. camera.up stays (0, 1, 0). No roll, no shake, no fov punch. On game over, add 1.2 to the desired camera height. Reduced motion skips that extra height. Audio: create the AudioContext inside the Start run handler and call resume. Master gain 0.2. Loop at 96 beats per minute, quarter note 0.625 seconds, 8 beats. Schedule 0.15 seconds ahead from the animation frame, not from setInterval. Each beat: a triangle tick at 740Hz, gain 0.05, decay 0.05 seconds. Bass square through a lowpass at 220Hz, gain 0.12, duration 0.2 seconds, frequencies 55, 55, 41.2, 49, 43.65, 43.65, 32.7, 41.2 across the eight beats. Beats 0 and 4 also play a sine falling from 120Hz to 52Hz in 0.09 seconds, gain 0.2. Eat blip: sine 520Hz to 880Hz in 0.07 seconds, gain 0.15. Rail or cross ending: sine 200Hz to 45Hz in 0.32 seconds, gain 0.16, then stop the loop. A player-ended run only ramps the master to 0 in 0.08 seconds. A clear floor plays sines at 523, 659, and 784Hz, 0.12 seconds each, gain 0.12, then stops the loop. Mute sets the master gain to 0 in 0.03 seconds and stores the flag. The title card pulses from performance.now modulo 0.625. When the run starts, reset the phase to 0 and use the audio clock. Pause suspends the context and freezes the phase.
   Motion: Bead envelope after each beat, elapsed e: for e under 0.09, scale 1 + 0.2 * (e / 0.09) and halo opacity 0.28 + 0.28 * (e / 0.09); until 0.32, ease back to scale 1 and opacity 0.28; then hold. Reduced motion: scale 1, opacity 0.32, for the whole run including the title. A new bead scales from 0.6 to 1 in 0.09 seconds unless reduced motion is on.
5. **HUD, pause, and game over** — Top bar wordmark: Lumen Coil, Syne 700 18px, color #E9FFF8, with Northglass Hall in Outfit 500 12px color #8AA39A. Truncate the wordmark with ellipsis below 400px, max-width 58vw. Sound button aria-label Sound on or Sound off, aria-pressed, Lucide Volume2 or VolumeX. Pause button, Lucide Pause, aria-label Pause, visible only while the run is moving. HUD chips, IBM Plex Mono 13px: Score and the integer, Len and the length, Step and the digit plus five 6px pips, and the rule name Wrap or Walls. Group thousands with en-US separators. The Walls chip border is #FF5D73. The Wrap chip border is #2EE6A6. Other chip borders are #234840. Chip fill rgba(7,8,10,0.72), text #D5E8E2. Pause heading: Paused. Line: The Relay Floor is holding. Buttons: Resume and End run. End run opens game over with reason ended, keeps the score, and does not play the falling tone. Game over heading: Run over, or Floor clear when the board is full. Cause lines: The line crossed itself. The rail stopped the run. You ended the run. Every open cell is taken. Repeat Score, Len, Step, and the rule. If the score is above that rule's stored best and above 0, show New best for Wrap. or New best for Walls. and write the best immediately. Initials field, maxlength 3, letters only, uppercase, autocomplete off, aria-label Initials, three letters. Empty save stores YOU. Button Save, then Saved. Run again restarts the same rule, the same opening cells, the bead at (14, 8), score 0, and the audio loop, without reloading. Change rule returns to the start card with the radios available and the line posed again.
   Layout: Top bar is fixed, padding 12px 16px plus safe area, pointer-events none except its buttons, z-index 3. At 800px and wider the HUD is centered in that bar. Below 800px the HUD is a second row of four equal chips under the bar. HUD is hidden on the start card and on game over, and visible while playing or paused. Pause and game over are dialogs, aria-modal true, focus trapped, labelled by their headings. Desktop cards are 400px, centered, same frost as the start card. A scrim rgba(7,8,10,0.45) covers the view. Mobile: bottom sheets, max-height 70dvh, scroll inside. Game over does not trap the page behind a dead end: Run again and Change rule are both present. A visually hidden polite live region announces Run started, Paused, Run over with the score, and New best. The canvas accessible name is Glowing grid snake game.
   Motion: On an eat, the score digits scale 1 to 1.08 to 1 in 120ms. Reduced motion skips that pop. On a rail or cross ending, the head emissive eases to #FF5D73 over 0.32 seconds and then back, unless reduced motion is on. Dialogs fade in 160ms, or snap when reduced motion is on. Opening pause suspends audio and freezes the step. Resume continues the same offset and beat phase. Returning to a hidden tab stays paused.
6. **Keyboard, swipe, and the pad** — Keyboard during play: ArrowUp or W queues north, ArrowLeft or A west, ArrowDown or S south, ArrowRight or D east. Ignore e.repeat. A reverse of the current direction is ignored and does not clear a queued turn. The latest other direction replaces the queue. P or Escape pauses, and the same keys resume from pause. Escape does nothing on game over. Prevent default on those keys so the page does not scroll, except while the initials field is focused. Do not bind Space as a global shortcut. Buttons use native Enter and Space.
   Layout: Show the pad only while the run is moving, and only when the pointer is coarse or the width is under 800. Hide it on the start card, during pause, and on game over. Four 64px keys in a plus, gap 8px, center bottom 16px plus safe area. Empty center, no fifth button. Labels are CSS chevrons, 10px, color #D5E8E2, not extra icon files. Accessible names: Turn up, Turn left, Turn down, Turn right. They set the same four directions as the arrows. Swipe on the canvas during play: pointer down and up, ignore the gesture if it starts on a control. A swipe counts when the longer axis exceeds 28px and is at least 1.15 times the shorter axis. Swipe up, left, down, and right match the arrow keys. Release stuck keys and pointers on blur, pause, and when the tab hides.
   Motion: A pressed pad key uses fill rgba(46,230,166,0.16) and scale 0.98, or no scale when reduced motion is on. Focus ring is 2px solid #2EE6A6 with 3px offset on every control.
7. **Scores, phone fit, and fallback** — Stored JSON is an object with wrap and walls. Each holds best, a number, and board, up to five objects with name, score, and length. Sort the board by score descending, then length descending. Corrupt JSON resets to best 0 and an empty board. The numeric best updates at game over before Save. Save only edits the named board. Both rules are shown on the start card. Game over shows the named five for the rule just played. Mute persists across reloads. Nothing is sent off the device.
   Layout: Target 1440×900 and 390×844 with no horizontal overflow, no page scroll, and no console errors. Safe-area padding on the bar, the sheet, and the pad. The start sheet scrolls inside itself if a long hall name wraps. The wordmark ellipsizes before it collides with the sound button. If WebGL is missing or the renderer throws, hide the canvas and show the frost card with the heading, the deck, and the sentence This browser could not start the 3D floor. A current browser with WebGL still can. Keep How to steer available. Do not log that failure as an uncaught error. Dispose geometries, materials, listeners, and the audio context on teardown. Keep dist under 20 MB. Favicon linked from index.html. Internal links, if any, point at index.html.
   Motion: The pixel-ratio cut does not reset the run. Reduced motion and the quality cut are independent. The posed line is visible on the first presented frame, before the start button is pressed.

## Assets
- image: No photographs, generated bitmaps, or downloaded textures. Draw the floor, the line, the bead, the rail, and the halo in code. Favicon is the original SVG at public/favicon.svg, a dark rounded square and one sea-glass arc. In ASSETS.md state that the scene is code-drawn and that no external image file is used.
- icon: Copy only Pause, Volume2, and VolumeX from the lucide package (ISC) into src/icons.ts and draw them with lucide createElement. In ASSETS.md list those three icons, https://www.npmjs.com/package/lucide, Lucide contributors, and the ISC license. Pad chevrons are CSS, not icons.
- font: Self-host Syne, Outfit Variable, and IBM Plex Mono through @fontsource/syne, @fontsource-variable/outfit, and @fontsource/ibm-plex-mono (OFL). In ASSETS.md list the local woff2 files, the npm package pages, the copyright lines from the bundled OFL notices, and OFL. Do not request fonts.googleapis.com or any other font host.
- video: No video and no audio files. The loop, the eat blip, the ending tones, and the clear-floor tones are oscillators in Web Audio, started from the Start run gesture.

## Don'ts
- Do not add a backend, accounts, a database, analytics, remote APIs, multiplayer, payments, a form that submits anywhere, or a public leaderboard. Bests, initials, and mute stay in localStorage.
- Do not load scripts, fonts, icons, models, textures, images, or audio from a CDN. Use relative paths, emit minified files to dist/, and do not emit source maps or copy src/ into dist/. Keep dist under 20 MB.
- Do not build a marketing landing page, a pricing page, or a scroll story. The deliverable is one playable index.html, and the grid, the line, and the bead are visible on the first screen.
- Do not use Agent OS, GoldieBench, AI Profit Boardroom, AIPB, Grok, xAI, Julian Goldie, Built in the Agent OS, or Join AIPB. Do not use the slogans The chart is the vendor's. The game is yours. or Played, not posed.
- Do not use the titles NEONSNAKE, NEONSNAKE 3D, CYBER GRID 3D, or SELF-PILOTING NEON ARENA, or the interface words AUTO-PILOT, AUTOPILOT ON, LINK SEVERED, sector 7, GRID SYNC, INITIALIZE, data-nodes, or Slither through the synthwave grid.
- Do not give the snake eyes, a face, a tongue, orbital rings, corner pylons, or towers. Do not add autopilot, pathfinding, a self-playing demo, or a task overlay. Do not name or depict Nokia, a handset, or any shipped snake-game product.
- Do not yaw the play camera behind the head. Arrow keys, WASD, swipes, and the pad stay aligned to north, west, south, and east on the screen.
- Do not snap the body from cell to cell while only the head moves. Every capsule glides on the shared offset. A wrap moves one capsule to the far lip and does not draw a streak across the floor.
- Do not hard-code Lumen Coil, Northglass Hall, ion beads, Relay Floor, or Marrow Lane outside content.ts. When the variables change, keep the grid, speeds, colors, and controls. Never show raw bracket placeholders.
- Do not mention VibeFather except the single optional [CREDIT] link on the start card. Do not show a calendar date.
- Do not autoplay sound before Start run, shake the camera, or flash the whole screen. Honor prefers-reduced-motion for the bead swell, the title drift, the grid breathe, the score pop, and the death tint.
- Do not leave keys or pointers stuck after blur, pause, or a hidden tab. Do not advance the offset or the beat while paused.
- Do not drop the phone layout. At 390×844 the pad keys are 64px, type does not overflow, and the head and the bead sit above the start sheet.
- Do not show a blank page if WebGL fails. Show the frost fallback once, and do not throw in the frame loop.
- Do not add bloom postprocessing, particle trails, downloaded models, or a second scene. Internal links, if any, point at index.html rather than a bare directory.

---
Inspired by Grok Build neon snake demo — https://agentos.guide/grok-4-7-agent-os
— Prompt by VibeFather · https://vibefather.ai/t/neon-snake-3d-game · CC BY-NC 4.0 (non-commercial; commercial use needs a VibeFather Pro license) · Request removal: https://vibefather.ai/takedown
中文参考译文(帮助理解,复制给 AI 时请用上面的英文原版)
# 霓虹贪吃蛇 3D 游戏

完全按照以下描述构建此网站。将 [VARIABLES] 替换为你自己的值;其余内容保持不变。

## 简介
构建 [BRAND],一个完整的单页 3D 贪吃蛇游戏,位于一个名为 [ARENA] 的深色 16 x 16 网格上。一条四段发光的胶囊状线条和一颗脉动的珠子已经出现在磨砂开始卡片后面的视野中。线条从一个格子滑行到另一个格子,摄像机从南侧跟随,珠子随着一段用 Web Audio 合成的短循环脉动。两条地面规则,Wrap 和 Walls,速度档位 1 到 5,以及本地最佳成绩都是游戏的一部分。由 [STUDIO] 呈现。开场句:[TAGLINE]。

- 受众:独立开发者和前端开发者,他们想要一个完成的静态 Three.js 游戏,带有键盘、滑动和屏幕控件,在桌面和手机上都能清晰阅读。
- 目标:交付一次可重复游玩的运行:一个位于活动网格上的开始卡片、即时游玩、逐渐加快的速度、环绕或围栏规则、暂停、带首字母的游戏结束,以及存储在浏览器中的最佳成绩。第二组名称必须保持相同的网格、蛇、颜色和规则。
- 语气:平静、精确,带一点俏皮。简短的美式英语。谈论线条、地面和珠子。不要军衔,不要炒作,不要网络俚语。

## 技术栈
- 框架:Vite 6 + TypeScript 5
- 样式:原生 CSS
- 库:three(MIT)、lucide(ISC)、@fontsource/syne(OFL)、@fontsource-variable/outfit(OFL)、@fontsource/ibm-plex-mono(OFL)
- 构建:`npm run build` → `dist/` 中的静态文件。无后端、无服务端代码、无外部 API。
- 设置:
  - 搭建 Vite 的原生 TypeScript 模板。脚本:dev=vite,build=tsc && vite build,preview=vite preview。包名是 BRAND 的 slug,而不是固定的模板 id。将 vite base 设为 './',build.outDir 设为 dist,build.emptyOutDir 设为 true,build.sourcemap 设为 false。tsconfig:strict 为 true,noEmit 为 true。
  - 仅将 three、lucide、@fontsource/syne、@fontsource-variable/outfit 和 @fontsource/ibm-plex-mono 安装为运行时依赖,另将 Vite 和 TypeScript 安装为开发依赖。不要添加 React、物理引擎、游戏框架、后处理、补间库或音频解码器。
  - 从 @fontsource/syne 导入 Syne 700 和 800,从 @fontsource-variable/outfit/wght.css 导入 Outfit 可变字重,从 @fontsource/ibm-plex-mono 导入 IBM Plex Mono 500。仅将 Lucide 的 Pause、Volume2 和 VolumeX 图标节点复制到 src/icons.ts,并使用 lucide createElement 以 18px、currentColor、aria-hidden 渲染它们。最多等待 800ms 让 document.fonts.ready 完成,然后即使字体仍在替换也显示卡片。
  - 使用模块 src/content.ts、main.ts、game.ts、scene.ts、audio.ts、ui.ts 和 styles.css。将所有专有名称、按钮标签、提示和句子保留在 content.ts 中。网格尺寸、速度、坐标和颜色是 game.ts 和 scene.ts 中的命名常量。
  - 世界坐标轴:+x 向东(屏幕右方),+y 向上,+z 向南(朝向相机,屏幕下方)。北是递减的 iz,在游玩过程中指向屏幕上方。单元格 (ix, iz) 的中心是 ((ix - 7.5) * 1.2, 0, (iz - 7.5) * 1.2),其中 ix 和 iz 从 0 到 15。可玩边缘是 x 和 z 的 ±9.6。环绕周期是 19.2。
  - 对所有面向玩家的名称使用 BRAND、STUDIO、PICKUP、ARENA、PLACE 和 TAGLINE。句子模式:Collect ${PICKUP} on the ${ARENA}。The ${ARENA} is holding。文档标题是 BRAND、一个 em dash 和 ARENA。当值与默认值不同时,重写 TAGLINE,使其不再命名旧地板或旧拾取物。永远不要显示原始方括号占位符。即使 TAGLINE 使用隐喻,胶囊线仍保持为蛇形。
  - 将分数持久化在键 slug(BRAND) + '-runs' 下,将静音状态持久化在 slug(BRAND) + '-muted' 下。slug 会将所有非字母数字连续段转为一个小写连字符,然后修剪连字符。Lumen Coil 变为 lumen-coil-runs。将 localStorage 包裹在 try/catch 中,如果抛出异常则继续游玩。不使用日历日期。
  - 一个 index.html,lang=en,viewport 带 viewport-fit=cover,一个全视口 canvas,以及 HTML 覆盖层。Body margin 为 0,overflow hidden,背景 #07080A,高度 100dvh。canvas 上 touch-action none。无路由器,无第二个页面。
  - 在加载时和变化时读取 prefers-reduced-motion。减少动态效果会将珠子保持在缩放 1 和光晕不透明度 0.32,冻结标题漂移和网格呼吸,将跟随平滑设置为较慢的 taus,并跳过分数弹出和死亡颜色闪烁。音频仍可播放。
  - 将设备像素比上限设为 1.75,在 800px 以下设为 1.25。开启抗锯齿,关闭阴影,alpha 为 false。如果游玩前两秒后滚动帧时间连续三秒保持在 28ms 以上,将上限降低 0.25 一次,且不低于 1。这样做时不要改变速度。

## 变量
- [BRAND] — 游戏名称(默认:"Lumen Coil")。在开始标题、顶部栏、文档标题和存档键 slug 中使用的虚构名称。
- [STUDIO] — 大厅名称(默认:"Northglass Hall")。虚构的大厅或场馆。显示为游戏名称上方的小字标签。
- [PICKUP] — 拾取物(默认:"ion beads")。小写复数名词,表示线所收集的物品。
- [ARENA] — 地板名称(默认:"Relay Floor")。网格的虚构名称。用于收集语句、暂停行和文档标题中。
- [PLACE] — 机柜信息行(默认:"Cabinet 4, 18 Marrow Lane, Port Elling, 6pm–1am")。一行简短信息:哪个机柜或场馆、虚构的街道地址以及营业时间。
- [TAGLINE] — 开场句(默认:"Steer the sea-glass line across the Relay Floor.")。游戏名称下方的一句话。当地板或拾取物变化时重写此句。3D 线条保持为胶囊体。
- [CREDIT] — 在页脚保留一个小型 "Template by VibeFather" 链接指向 https://vibefather.ai/t/neon-snake-3d-game(默认:是;删除此行即可移除)

页面与区块下的文案是针对默认值编写的。如果你的值不同,请为它们重写每个标题、段落、标签和图片——保持相同的长度、语气和结构。布局、颜色、字体和动效保持所述不变。
将所有文案、图片路径和链接放在一个内容文件中(例如 `src/content.ts`),按区块作为键,以便之后无需改动组件即可替换内容。

## 设计
### 颜色
- 虚空(Void)`#07080A` — 页面背景、渲染器清除色、雾效,以及遮罩蒙版基底
- 地面(Floor)`#07100F` — 网格着色器背景
- 网格(Grid)`#1E4A42` — 空闲状态网格线
- 热力线(Hot line)`#8CFFE0` — 蛇头附近的网格线
- 海玻璃(Sea glass)`#2EE6A6` — 蛇身自发光、主按钮、焦点环、Wrap 芯片边框、已填充的速度点
- 蛇头(Head)`#E9FFF8` — 蛇头自发光、游戏名称,以及开始标题
- 铜色(Copper)`#FF8A3D` — 珠子自发光、珠子光晕,以及地面上的食物光池
- 奶油色(Cream)`#FFE6D0` — 珠子核心漫反射颜色
- 墨色(Ink)`#071410` — 主按钮上的文字
- 薄雾(Mist)`#D5E8E2` — 正文、HUD 数值,以及幽灵按钮文字
- 静默(Mute)`#8AA39A` — 眉题、提示、地点行,以及署名链接
- 轨道粉(Rail pink)`#FF5D73` — 墙壁轨道自发光、Walls 芯片边框,以及蛇头上短暂的死亡色调
- 卡片(Card)`#0C1414` — 磨砂卡片,82% 不透明度
- 描边(Stroke)`#234840` — 卡片边框、空闲芯片,以及未选中的单选项
- 点(Pip)`#1A3330` — 空的速度点
- 悬停(Hover)`#76F6C4` — 主按钮悬停

### 字体排印
- 游戏名称和开始标题:Syne(OFL),字重 700/800
- UI、按钮、提示和正文:Outfit Variable(OFL),字重 400/500/600
- 分数、长度和步数:IBM Plex Mono(OFL),字重 500

### 布局与动效
- 间距:使用 4px 基准。桌面端卡片内边距 28px,距左侧内缩 36px。移动端卡片内缩 12px,另加安全区域内边距。HUD 芯片间距 8px,顶栏内边距 12px 16px。按钮高度至少 44px。方向键为 64px。游戏视图中心保持避开方向键。
- 圆角:卡片 20px,按钮 12px,单选项 12px,HUD 芯片全圆角,方向键 14px。蛇和珠子是圆胶囊和球体。轨道是锐利的低矮盒体。
- 动效:模拟使用帧增量,上限 0.05 秒,每帧最多处理 3 次单元格穿越。在步进之后渲染。
- 动效:所有胶囊共享一个从 0 到 1 的偏移量,并在单元格中心之间一起滑动。游戏相机从不偏航。其位置以 tau 0.28 秒缓动至南向偏移,开启减少动效时为 0.62。
- 动效:珠子在 96 拍每分钟的每个四分音符上膨胀:在 0.09 秒内从缩放 1 到 1.2,到 0.32 秒时回到 1。减少动效时保持缩放 1 和光晕不透明度 0.32。
- 动效:标题相机以 0.08 弧度的正弦在约 28 秒内漂移,并在运行开始时停止。按钮在悬停时变暗或变亮。按下的控件在 80ms 内缩放到 0.98,除非开启减少动效。
- 动效:暂停会冻结偏移量、节拍相位和标题漂移。隐藏标签页以同样方式暂停,并且在恢复之前不会继续。
- 图像:地面、线条、珠子和轨道由 Three.js 图元和单个网格着色器绘制。不使用照片、生成的位图、纹理、HDRI 或下载的模型。首屏是那个 3D 地面位于磨砂卡片旁边或上方,绝不是平面上的文字。蛇头没有脸。没有人物,也没有肖像。

## 页面与区块
### Lumen Coil — Relay Floor(`index.html`)
1. **发光地板上的开始卡片** — 文档标题:Lumen Coil — Relay Floor,取自 BRAND 和 ARENA。眉题,大写并带 0.12em 字距:Northglass Hall。标题:Lumen Coil。副标题,取自 TAGLINE:Steer the sea-glass line across the Relay Floor。收集说明句:Collect ion beads on the Relay Floor。始终可见的规则行,名词取自 PICKUP:Each of the ion beads scores 10 times the current step。主按钮:Start run。展开按钮:How to steer。其内三行:Arrows or W A S D point up, left, down, and right on the screen。You cannot turn back on yourself。On a phone, swipe the floor or use the pad。P or Esc pauses。以及速率:Steps run at 3.4, 4.4, 5.5, 6.6, and 7.8 cells a second。地板规则单选按钮,默认 Wrap:Wrap,提示 Leave an edge and return on the far side。Walls,提示 A low rail. Touch it and the run ends。仅显示所选单选按钮的提示。Best wrap 和 Best walls 显示已存储的数字或一个长破折号。在 Recent 标题下,列出所选规则的前 3 个首字母缩写,或句子 No runs saved on this browser yet。地址行,取自 PLACE:Cabinet 4, 18 Marrow Lane, Port Elling, 6pm–1am。如果存在 [CREDIT],在该行下方显示一个 12px Outfit 链接,颜色为 Mute。加载时聚焦 Start run。切换单选按钮会更新轨道和最近列表,且不会开始运行。
   布局:画布在点击前已经渲染出摆好姿势的线和珠子。隐藏 HUD 和触控板。桌面端 900px 及以上:一张 400px 卡片,20px 圆角,28px 内边距,背景 rgba(12,20,20,0.82),边框 1px solid #234840,backdrop-filter blur(14px),距左侧 36px 并垂直居中,max-height calc(100dvh - 48px),overflow auto。它覆盖的面积远小于 1440px 的一半。标题相机位置 (6.2, 8.2, 10.8),lookAt (0.2, 0.25, 0.5),fov 44。在 1440×900 下,整条四胶囊线和珠子必须完全位于卡片右侧的开放区域内。如果不在,向西移动 lookAt.x 直到满足条件,并保持相机位于地板南侧。移动端 900px 以下:底部面板,左右各 12px,底部 12px 加安全区域,max-height 58dvh,相同填充,圆角 20px。标题相机 (4.2, 12.4, 10.5),lookAt (4.2, 0.0, 3.6),fov 56,使线和珠子落在 390×844 画框顶部 42% 区域内、面板上方。标题 Syne 800,桌面 44px、移动端 34px,颜色 #E9FFF8。副标题 Outfit 400 16px,颜色 #D5E8E2,行高 1.45。Start run 为全宽,48px,背景 #2EE6A6,文字 #071410,Outfit 600。幽灵控件使用 #234840 边框和 Mist 文字。
   动效:卡片显示期间线不移动。珠子脉动。标题相机围绕 lookAt 点按 sin(time * 0.22) * 0.08 弧度偏航。减少动态效果时使用基础相机,无偏航。How to steer 切换其面板,且不会开始游戏。Start run 隐藏卡片、显示 HUD、恢复音频上下文,并在该次点击时开始移动。相机从标题机位缓动到跟随机位。Enter 激活聚焦的按钮。
2. **网格、轨道、蛇和珠子** — 线是四个胶囊,不是动物图片。头部单元格 (11, 8),然后是 (10, 8)、(9, 8)、(8, 8),朝向东,偏移 0,因此整条线位于地板东半部,并与左侧卡片保持距离。第一个珠子,以及每次重新开始后的珠子,都是单元格 (14, 8)。后续珠子随机选择一个不在身体中的单元格。头部没有眼睛、嘴、舌头或标记。珠子是一个球体加一个柔和光晕,没有环,也没有环绕部件。
   布局:地板:一个 36×36 的着色器平面,位于 y=0。线条仅存在于 x 和 z 的 ±9.6 范围内,位于单元格边缘的倍数上。到最近线条的世界距离通过 fwidth 输入一个 1.6px 屏幕宽度遮罩。线条颜色在距头部 5.2 到 0.6 单位之间通过 smoothstep 从 #1E4A42 混合到 #8CFFE0。珠子周围 2.0 到 0.2 单位的铜色光池通过 smoothstep 以 35% 强度添加 #FF8A3D。在边缘之外,线条淡出到地板颜色 #07100F。缓慢呼吸将线条强度乘以 0.94 + 0.06 * sin(time * 1.3),在减少动态效果开启或运行暂停时冻结。FogExp2 颜色 #07080A 密度 0.045。环境光 #10211C 强度 0.25。一个点光源作为头部上方的父级,颜色 #D7FFF3,强度 4,距离 8,衰减 2。清除颜色、雾和页面均为 #07080A。ACES 电影色调映射,曝光 1.05,输出色彩空间 sRGB。头部胶囊:半径 0.38,圆柱长度 0.28,中心 y 0.40,MeshStandardMaterial 颜色 #D9FFF4,自发光 #E9FFF8,emissiveIntensity 2.0,粗糙度 0.4,金属度 0.08。身体胶囊:半径 0.32,圆柱长度 0.36,相同 y,共享材质,自发光 #2EE6A6,emissiveIntensity 1.5。将每个胶囊的长轴与其短单元格增量对齐。两个几何体只创建一次。每个段显示一个网格,仅在线条增长时添加网格,最多 256 个。珠子核心:球体半径 0.32,位于 y 0.48,颜色 #FFE6D0,自发光 #FF8A3D,emissiveIntensity 1.6,粗糙度 0.25。光晕:球体半径 0.58,MeshBasicMaterial #FF8A3D,不透明度 0.30,depthWrite false,加法混合。轨道,仅在选中 Walls 时可见:四个盒子,高度 0.16,厚度 0.12,内侧面位于 ±9.6 边缘,中心在 ±9.66。南北盒子沿 x 长 19.2。东西盒子沿 z 长 19.44,使角相接。材质颜色 #3A2428,自发光 #FF5D73,emissiveIntensity 0.55,粗糙度 0.6。没有柱子,没有塔。在 Wrap 中隐藏轨道。Favicon 位于 public/favicon.svg:一个 32 viewBox 的圆角方块,填充 #07080A,带一条海玻璃弧线,无文字、无面部。
   动效:在标题卡片上,网格位于单元格中心。珠子缩放和光晕跟随节拍时钟。单选按钮变化时轨道立即出现或消失,无镜头切换。减少动态效果跳过呼吸和膨胀。
3. **步进、增长和两条规则** — 速度由长度决定,包括头部:长度 4 到 7 时第 1 步为每秒 3.4 格、10 分;长度 8 到 11 时第 2 步为 4.4、20 分;长度 12 到 16 时第 3 步为 5.5、30 分;长度 17 到 22 时第 4 步为 6.6、40 分;长度 23 或以上时第 5 步为 7.8、50 分。分数在取到珠子时按生效的步进奖励,然后长度增加一,并重新计算步进。填满全部 256 个单元格后,在最后得分后以清空地板结束运行。
   布局:一个共享偏移量按 cellsPerSecond 乘以 dt 推进。每个段 i 从其起始单元格滑向其目标:头部目标为头部加方向,后续每个段目标为其前方的单元格。短增量:减去或加上 16,使每个轴增量为 -1、0 或 1。世界位置是起始中心加上短增量乘以 1.2 再乘以偏移量。在 Wrap 中,如果 x 或 z 离开 ±9.6 边缘,则加上或减去 19.2,使胶囊出现在对侧边缘,而不是横穿中间。在 Walls 中,不要环绕该坐标。当偏移量达到 1 时,在减去之前解析一次穿越。成功提交时,减去 1 并继续,每帧最多 3 次提交。在轨道、交叉或清空时,将偏移量保持在 1 并停止。先应用排队的转向。即将到达的单元格是头部加上该方向。在 Walls 中,0 到 15 之外的单元格以原因 rail 结束运行且不提交,因此头部停在轨道上。在 Wrap 中,用模 16 环绕单元格。如果即将到达的单元格被任何身体单元格占据,但增长队列为 0 时的尾部除外,则以原因 cross 结束且不提交。否则提交。如果该单元格是珠子,加上当前步进的 10 倍,增长队列加 1,并在移动单元格之前播放吃珠提示音。将新头部 unshift。如果增长队列为正,递减它并保留尾部;否则弹出尾部。如果这次穿越吃到了珠子,在更新后身体之外的单元格中均匀随机选择下一个珠子。如果没有剩余,以原因 clear 结束并隐藏珠子。新尾部胶囊在 0.18 秒内从 0.2 缩放到 1,或在减少动态效果开启时以完整大小出现。忽略与当前方向相反的排队转向。一个排队转向,由最新的合法按键替换。在穿越时应用它,然后清除它。方向映射,世界和屏幕:北 (0, -1) 为上,南 (0, +1) 为下,西 (-1, 0) 为左,东 (1, 0) 为右。
   动效:各段在整个步进中一起移动,包括尾部。只有正在穿越开放边缘的胶囊会跳到对侧边缘。暂停、隐藏标签页和游戏结束会停止偏移量。卡顿不得跳过碰撞检查:最多 3 次穿越的 while 循环正是防止这一点。
4. **跟随相机和节拍** — 游戏过程中相机位于头部南侧,不会摆到其后方。键盘上的上在转向后仍对应屏幕上的上。珠子是唯一与音乐锁定的东西。没有可视化器,没有波形,也没有额外发光通道。
   布局:透视相机,近裁剪面 0.1,远裁剪面 80。桌面端 fov 44。低于 800px 时,fov 56。期望位置为头部世界位置加上桌面端的 (0, 7.4, 8.2),以及低于 800px 时的 (0, 10.2, 10.4)。注视点为头部加上桌面端的 (0, 0.4, -1.6) 和低于 800px 时的 (0, 0.3, -2.2),这样头部以北更多的地板会保持在垫子上方可见。每一帧,将位置和注视点朝这些目标移动 1 - exp(-dt / tau),然后 lookAt。位置 tau 0.28,注视 tau 0.16。减少动态效果:0.62 和 0.45。camera.up 保持 (0, 1, 0)。无滚转、无抖动、无 fov 冲击。游戏结束时,将期望相机高度增加 1.2。减少动态效果会跳过该额外高度。音频:在 Start 运行处理函数内创建 AudioContext 并调用 resume。主增益 0.2。以每分钟 96 拍循环,四分音符 0.625 秒,8 拍。从动画帧提前 0.15 秒调度,而不是从 setInterval。每一拍:一个 740Hz 的三角波滴答,增益 0.05,衰减 0.05 秒。低音方波通过 220Hz 的低通,增益 0.12,时长 0.2 秒,八个节拍上的频率为 55、55、41.2、49、43.65、43.65、32.7、41.2。第 0 拍和第 4 拍还播放一个在 0.09 秒内从 120Hz 下降到 52Hz 的正弦波,增益 0.2。吃豆提示音:正弦波在 0.07 秒内从 520Hz 到 880Hz,增益 0.15。轨道或交叉结束:正弦波在 0.32 秒内从 200Hz 到 45Hz,增益 0.16,然后停止循环。玩家结束的运行只会在 0.08 秒内将主增益渐变到 0。清空地板播放 523、659 和 784Hz 的正弦波,每个 0.12 秒,增益 0.12,然后停止循环。静音会在 0.03 秒内将主增益设为 0 并存储该标志。标题卡从 performance.now 对 0.625 取模进行脉冲。当运行开始时,将相位重置为 0 并使用音频时钟。暂停会挂起上下文并冻结相位。
   运动:每一拍后的珠子包络,经过时间 e:当 e 小于 0.09 时,缩放 1 + 0.2 * (e / 0.09),光晕不透明度 0.28 + 0.28 * (e / 0.09);直到 0.32,缓动回缩放 1 和不透明度 0.28;然后保持。减少动态效果:整个运行期间包括标题,缩放 1,不透明度 0.32。新珠子在 0.09 秒内从 0.6 缩放到 1,除非启用了减少动态效果。
5. **HUD、暂停和游戏结束** — 顶栏字标:Lumen Coil,Syne 700 18px,颜色 #E9FFF8,Northglass Hall 使用 Outfit 500 12px 颜色 #8AA39A。低于 400px 时用省略号截断字标,最大宽度 58vw。声音按钮 aria-label Sound on 或 Sound off,aria-pressed,Lucide Volume2 或 VolumeX。暂停按钮,Lucide Pause,aria-label Pause,仅在运行移动时可见。HUD 芯片,IBM Plex Mono 13px:Score 和整数,Len 和长度,Step 和数字加五个 6px 点,以及规则名称 Wrap 或 Walls。使用 en-US 分隔符对千位分组。Walls 芯片边框为 #FF5D73。Wrap 芯片边框为 #2EE6A6。其他芯片边框为 #234840。芯片填充 rgba(7,8,10,0.72),文本 #D5E8E2。暂停标题:Paused。行:The Relay Floor is holding。按钮:Resume 和 End run。End run 以原因 ended 打开游戏结束,保留分数,并且不播放下降音调。游戏结束标题:Run over,或当棋盘已满时为 Floor clear。原因行:The line crossed itself. The rail stopped the run. You ended the run. Every open cell is taken。重复 Score、Len、Step 和规则。如果分数高于该规则存储的最佳分数且高于 0,显示 New best for Wrap. 或 New best for Walls. 并立即写入最佳分数。首字母字段,maxlength 3,仅字母,大写,autocomplete off,aria-label Initials,三个字母。空保存存储 YOU。按钮 Save,然后 Saved。Run again 重新开始相同规则、相同开局单元格、位于 (14, 8) 的珠子、分数 0 和音频循环,无需重新加载。Change rule 返回开始卡片,单选按钮可用且线条再次摆好。
   布局:顶栏固定,内边距 12px 16px 加上安全区域,除其按钮外 pointer-events none,z-index 3。在 800px 及更宽时,HUD 在该栏中居中。低于 800px 时,HUD 是栏下方第二行四个等宽芯片。HUD 在开始卡片和游戏结束时隐藏,在游玩或暂停时可见。暂停和游戏结束是对话框,aria-modal true,焦点被捕获,由其标题标记。桌面卡片为 400px,居中,与开始卡片相同的磨砂效果。遮罩 rgba(7,8,10,0.45) 覆盖视图。移动端:底部工作表,最大高度 70dvh,内部滚动。游戏结束不会将页面困在死胡同中:Run again 和 Change rule 都存在。一个视觉隐藏的礼貌实时区域宣布 Run started、Paused、Run over with the score 和 New best。画布的可访问名称为 Glowing grid snake game。
   运动:吃豆时,分数数字在 120ms 内从 1 缩放到 1.08 再回到 1。减少动态效果会跳过该弹出效果。在轨道或交叉结束时,头部自发光在 0.32 秒内缓动到 #FF5D73 然后返回,除非启用了减少动态效果。对话框在 160ms 内淡入,或在启用减少动态效果时立即显示。打开暂停会挂起音频并冻结步进。恢复会继续相同的偏移和节拍相位。返回到隐藏标签页时保持暂停。
6. **键盘、滑动和方向垫** — 游玩期间的键盘:ArrowUp 或 W 排队向北,ArrowLeft 或 A 向西,ArrowDown 或 S 向南,ArrowRight 或 D 向东。忽略 e.repeat。当前方向的反向会被忽略,并且不会清除已排队的转向。最新的其他方向会替换队列。P 或 Escape 暂停,相同的键从暂停恢复。Escape 在游戏结束时不做任何事。阻止这些键的默认行为,以免页面滚动,但首字母字段聚焦时除外。不要将 Space 绑定为全局快捷键。按钮使用原生 Enter 和 Space。
   布局:仅在运行移动时显示方向垫,并且仅在指针为粗略或宽度低于 800 时显示。在开始卡片、暂停期间和游戏结束时隐藏它。四个 64px 键呈十字形,间隙 8px,中心底部 16px 加上安全区域。中心为空,没有第五个按钮。标签是 CSS 箭头,10px,颜色 #D5E8E2,不是额外的图标文件。可访问名称:Turn up、Turn left、Turn down、Turn right。它们设置与箭头相同的四个方向。游玩期间在画布上滑动:指针按下和抬起,如果手势从控件上开始则忽略。当较长轴超过 28px 且至少为较短轴的 1.15 倍时,滑动计数。向上、向左、向下和向右滑动与箭头键匹配。在失焦、暂停和标签页隐藏时释放卡住的键和指针。
   运动:按下的方向垫键使用填充 rgba(46,230,166,0.16) 和缩放 0.98,或在启用减少动态效果时不缩放。焦点环为 2px 实线 #2EE6A6,每个控件上偏移 3px。
7. **分数、手机适配和回退** — 存储的 JSON 是一个包含 wrap 和 walls 的对象。每个都包含 best(一个数字)和 board(最多五个对象,包含 name、score 和 length)。按分数降序、然后长度降序对 board 排序。损坏的 JSON 重置为 best 0 和空 board。数字最佳分数在游戏结束时、Save 之前更新。Save 仅编辑命名 board。两个规则都显示在开始卡片上。游戏结束显示刚玩过的规则的命名前五名。静音在重新加载后保持。不会向设备外发送任何内容。
   布局:目标 1440×900 和 390×844,无水平溢出、无页面滚动、无控制台错误。栏、工作表和方向垫上的安全区域内边距。如果长大厅名称换行,开始工作表在自身内部滚动。字标在与声音按钮碰撞之前省略。如果缺少 WebGL 或渲染器抛出异常,隐藏画布并显示磨砂卡片,包含标题、牌组和句子 This browser could not start the 3D floor. A current browser with WebGL still can。保持 How to steer 可用。不要将该失败记录为未捕获错误。在拆卸时释放几何体、材质、监听器和音频上下文。保持 dist 低于 20 MB。Favicon 从 index.html 链接。内部链接(如果有)指向 index.html。
   运动:像素比削减不会重置运行。减少动态效果和质量削减是独立的。摆好的线条在第一个呈现的帧上可见,在按下开始按钮之前。

## 资产(Assets)
- 图像(image):不使用照片、生成的位图或下载的纹理。地面、线条、珠子、栏杆和光晕均用代码绘制。Favicon 是位于 public/favicon.svg 的原始 SVG,一个深色圆角方块和一条海玻璃弧线。在 ASSETS.md 中说明场景为代码绘制,且不使用任何外部图像文件。
- 图标(icon):仅将 lucide 包(ISC)中的 Pause、Volume2 和 VolumeX 复制到 src/icons.ts,并使用 lucide createElement 绘制它们。在 ASSETS.md 中列出这三个图标、https://www.npmjs.com/package/lucide、Lucide contributors 和 ISC 许可证。内边距箭头(Pad chevrons)是 CSS,不是图标。
- 字体(font):通过 @fontsource/syne、@fontsource-variable/outfit 和 @fontsource/ibm-plex-mono(OFL)自托管 Syne、Outfit Variable 和 IBM Plex Mono。在 ASSETS.md 中列出本地 woff2 文件、npm 包页面、捆绑的 OFL 声明中的版权行以及 OFL。不要请求 fonts.googleapis.com 或任何其他字体主机。
- 视频(video):不使用视频和音频文件。循环、进食提示音、结束音调和清空地面音调是 Web Audio 中的振荡器,由 Start run 手势启动。

## 不要做
- 不要添加后端、账户、数据库、分析、远程 API、多人模式、支付、任何会提交到某处的表单,或公开排行榜。最佳成绩、首字母缩写和静音状态保留在 localStorage 中。
- 不要从 CDN 加载脚本、字体、图标、模型、纹理、图像或音频。使用相对路径,将压缩文件输出到 dist/,不要输出 source map,也不要将 src/ 复制到 dist/。保持 dist 在 20 MB 以下。
- 不要构建营销落地页、定价页或滚动叙事。交付物是一个可玩的 index.html,并且网格、线条和珠子在首屏可见。
- 不要使用 Agent OS、GoldieBench、AI Profit Boardroom、AIPB、Grok、xAI、Julian Goldie、Built in the Agent OS 或 Join AIPB。不要使用口号 The chart is the vendor's. The game is yours. 或 Played, not posed.
- 不要使用标题 NEONSNAKE、NEONSNAKE 3D、CYBER GRID 3D 或 SELF-PILOTING NEON ARENA,也不要使用界面词语 AUTO-PILOT、AUTOPILOT ON、LINK SEVERED、sector 7、GRID SYNC、INITIALIZE、data-nodes 或 Slither through the synthwave grid。
- 不要给蛇加上眼睛、脸、舌头、轨道环、角柱或塔。不要添加自动驾驶、寻路、自玩演示或任务叠加层。不要命名或描绘 Nokia、手机或任何已发布的贪吃蛇游戏产品。
- 不要将游玩摄像机偏航到头部后方。方向键、WASD、滑动和触控板保持与屏幕上的北、西、南、东对齐。
- 不要在只有头部移动时让身体逐格瞬移。每个胶囊体都按共享偏移滑动。环绕会将一个胶囊体移动到远端边缘,并且不会在地面上画出拖痕。
- 不要在 content.ts 之外硬编码 Lumen Coil、Northglass Hall、ion beads、Relay Floor 或 Marrow Lane。当变量变化时,保持网格、速度、颜色和控制不变。永远不要显示原始方括号占位符。
- 除开始卡片上单个可选的 [CREDIT] 链接外,不要提及 VibeFather。不要显示日历日期。
- 不要在 Start run 之前自动播放声音、晃动摄像机或闪烁整个屏幕。对于珠子膨胀、标题漂移、网格呼吸、分数弹出和死亡色调,要遵循 prefers-reduced-motion。
- 不要在失焦、暂停或标签页隐藏后让按键或指针卡住。暂停时不要推进偏移或节拍。
- 不要放弃手机布局。在 390×844 下,触控板按键为 64px,文字不溢出,头部和珠子位于开始面板上方。
- 如果 WebGL 失败,不要显示空白页面。显示一次 frost fallback,并且不要在帧循环中抛出异常。
- 不要添加 bloom 后处理、粒子拖尾、下载的模型或第二个场景。内部链接(如果有)指向 index.html,而不是裸目录。

---
Inspired by Grok Build neon snake demo — https://agentos.guide/grok-4-7-agent-os
— Prompt by VibeFather · https://vibefather.ai/t/neon-snake-3d-game · CC BY-NC 4.0 (non-commercial; commercial use needs a VibeFather Pro license) · Request removal: https://vibefather.ai/takedown

个人项目可免费使用(CC BY-NC 4.0)。 商业用途需要 Pro.

DESIGN.md

单独的设计规范:配色、字体、间距和动效。可以把这套视觉用到你已有的项目上。

---
name: "Neon Snake 3D Game"
colors:
  void: "#07080A"
  floor: "#07100F"
  grid: "#1E4A42"
  hot_line: "#8CFFE0"
  sea_glass: "#2EE6A6"
  head: "#E9FFF8"
  copper: "#FF8A3D"
  cream: "#FFE6D0"
  ink: "#071410"
  mist: "#D5E8E2"
  mute: "#8AA39A"
  rail_pink: "#FF5D73"
  card: "#0C1414"
  stroke: "#234840"
  pip: "#1A3330"
  hover: "#76F6C4"
typography:
  game_name_and_start_heading: { family: "Syne", weights: [700, 800] }
  ui_buttons_hints_and_body: { family: "Outfit Variable", weights: [400, 500, 600] }
  scores_length_and_step: { family: "IBM Plex Mono", weights: [500] }
spacing: "Use a 4px base. Desktop card padding 28px, inset 36px from the left. Mobile card inset 12px plus safe-area insets. HUD chip gap 8px, top-bar padding 12px 16px. Buttons are at least 44px tall. The pad keys are 64px. The center of the play view stays clear of the pad."
radius: "Cards 20px, buttons 12px, radios 12px, HUD chips fully round, pad keys 14px. The snake and the bead are round capsules and spheres. The rail is a sharp low box."
---

# Neon Snake 3D Game — Design System

Apply this design system to an existing project. It describes the look and feel only; for the full site, use prompt.md.

## Colors
- **Void** `#07080A` — Page background, renderer clear color, fog, and the overlay scrim base
- **Floor** `#07100F` — Grid shader background
- **Grid** `#1E4A42` — Idle grid lines
- **Hot line** `#8CFFE0` — Grid lines near the head
- **Sea glass** `#2EE6A6` — Snake body emissive, primary button, focus ring, Wrap chip border, filled speed pips
- **Head** `#E9FFF8` — Head emissive, game name, and start heading
- **Copper** `#FF8A3D` — Bead emissive, bead halo, and the food pool on the floor
- **Cream** `#FFE6D0` — Bead core diffuse color
- **Ink** `#071410` — Text on the primary button
- **Mist** `#D5E8E2` — Body copy, HUD values, and ghost-button text
- **Mute** `#8AA39A` — Eyebrow, hints, place line, and the credit link
- **Rail pink** `#FF5D73` — Walls rail emissive, Walls chip border, and the brief death tint on the head
- **Card** `#0C1414` — Frosted cards at 82% opacity
- **Stroke** `#234840` — Card borders, idle chips, and unselected radios
- **Pip** `#1A3330` — Empty speed pips
- **Hover** `#76F6C4` — Primary button hover

## Typography
- **Game name and start heading** — Syne (OFL), weights 700/800. Self-host the font files.
- **UI, buttons, hints, and body** — Outfit Variable (OFL), weights 400/500/600. Self-host the font files.
- **Scores, length, and step** — IBM Plex Mono (OFL), weights 500. Self-host the font files.

## Spacing & shape
- Spacing: Use a 4px base. Desktop card padding 28px, inset 36px from the left. Mobile card inset 12px plus safe-area insets. HUD chip gap 8px, top-bar padding 12px 16px. Buttons are at least 44px tall. The pad keys are 64px. The center of the play view stays clear of the pad.
- Radius: Cards 20px, buttons 12px, radios 12px, HUD chips fully round, pad keys 14px. The snake and the bead are round capsules and spheres. The rail is a sharp low box.

## Motion
- Simulation uses the frame delta capped at 0.05 seconds, with at most 3 cell crossings processed per frame. Render after the step.
- All capsules share one offset from 0 to 1 and glide together between cell centers. The play camera never yaws. Its position eases toward a southern offset with tau 0.28 seconds, or 0.62 when reduced motion is on.
- The bead swells on each quarter note at 96 beats per minute: scale 1 to 1.2 in 0.09 seconds, back to 1 by 0.32 seconds. Reduced motion holds scale 1 and halo opacity 0.32.
- Title camera drifts by a sine of 0.08 radians over about 28 seconds and stops when the run starts. Buttons darken or lighten on hover. A pressed control scales to 0.98 in 80ms unless reduced motion is on.
- Pause freezes the offset, the beat phase, and the title drift. The hidden tab pauses the same way and does not resume until Resume.

## Imagery
Draw the floor, the line, the bead, and the rail from Three.js primitives and one grid shader. No photographs, generated bitmaps, textures, HDRIs, or downloaded models. The first screen is that 3D floor beside or above a frosted card, never type on a flat field. The head has no face. No people and no portraits.

## Tone
Calm, precise, and a little playful. Short US English. Talk about the line, the floor, and the bead. No military ranks, no hype, and no cyber slang.

---
Inspired by Grok Build neon snake demo — https://agentos.guide/grok-4-7-agent-os
— Prompt by VibeFather · https://vibefather.ai/t/neon-snake-3d-game · CC BY-NC 4.0 (non-commercial; commercial use needs a VibeFather Pro license) · Request removal: https://vibefather.ai/takedown

改成你自己的

  • 复古酒吧里的街机:将 BRAND 设为街机名,STUDIO 设为场所,PLACE 设为地址和营业时间,让开始卡片读起来像一台真实的机器。
  • 课堂编程演示:保留 Lumen Coil 的名称,将 ARENA 设为一个课程场地名,并使用 Wrap 规则展示网格游戏如何处理边缘。
  • 工作室作品集项目:将 STUDIO 设为你的工作室名,PICKUP 设为一个主题收集物,并用自己的话重写 TAGLINE 来描述线条和场地。
  • 朋友聚会派对游戏:将 BRAND 和 PLACE 设为一个虚构的场馆和地址,然后让玩家在游戏结束卡片上输入姓名缩写,共享最高分。

霓虹贪吃蛇 3D 游戏:常见问题

如何重命名游戏并更改收集物以匹配我自己的项目?

霓虹贪吃蛇 3D 游戏模板将所有面向玩家的名称放在一个内容文件中,包含六个变量:BRAND 表示游戏名,STUDIO 表示场馆,PICKUP 表示收集物,ARENA 表示场地,PLACE 表示街机标语,TAGLINE 表示开场句。修改这些值,并重写收集句和暂停句,使其指向你的场地和收集物。网格、颜色、速度和操控方式保持不变。

霓虹贪吃蛇 3D 游戏中的两种场地规则是什么,最高分如何运作?

霓虹贪吃蛇 3D 游戏模板提供两种场地规则。Wrap 规则下,蛇从开放边缘的对面穿回;Walls 规则下,场地边缘画有一道低矮围栏,碰到围栏或撞到自己都会结束本局。每种规则都会在浏览器中保存各自的最高分和五组姓名缩写,存储键由你的游戏名生成,因此重命名游戏会得到全新的分数表。

怎么用 AI 做一个霓虹贪吃蛇 3D 游戏?

复制本页的提示词,或者运行 npx vibefather add neon-snake-3d-game,把 [ARENA]、[BRAND]、[PLACE]、[PICKUP] 换成你自己的内容,再粘贴到 Claude Code、Codex、Cursor 等 AI 编程工具里。在线演示就是用这份提示词原样做出来的。

霓虹贪吃蛇 3D 游戏模板的演示是哪个 AI 模型做的?

演示由 Grok 4.7 在 Grok Build 里完成;另一个案例由 Grok 4.7 在 Grok Build 里完成。每次都用公开的提示词原样生成,没有额外补充。