用这个模板做的 2 个案例
同一份提示词,不同的 [VARIABLES] 变量。点一个在上方预览。关于这个模板
黄昏赛道竞速游戏是一个单页面的浏览器赛车游戏。首屏就是赛道:一辆低多边形赛车行驶在倾斜的赛道上,夕阳低垂,影子拉得很长,天空从地平线的暖铜色过渡到头顶的深蓝色。桌面端侧边面板或手机端底部抽屉显示俱乐部名称和开始按钮,赛车和赛道始终可见。
赛车由方块、圆柱和短车厢拼成的封闭楔形,用代码构建,并非从模型加载,也不是任何已知的公路车型。赛道全长 1000 米,包含一个倾斜弯道、一个发夹弯、四个检查点门以及边缘障碍物:干草捆、轮胎堆和锥桶。漂移会填充加速槽,消耗后提供短暂的爆发速度。三名对手沿着固定路线行驶。一个半透明的幽灵会重复本浏览器中保存的最佳圈速。名次、圈数、时间和速度显示在 HUD 上,圆形小地图展示赛道和车群。驶出沥青路面后赛车会减速,然后回到上一个检查点门,而不是熄火停滞。三圈后登上领奖台。
键盘支持桌面端操作。窄屏设备会显示转向板以及油门、刹车和漂移按钮,位置避开小地图。减少动态效果模式会保留比赛,但移除镜头翻滚、尘土和额外脉冲。可选音效默认关闭,需手动开启。
开发者和独立开发者可以通过一个内容文件重新换肤:俱乐部、山脊、赛道、赛车、车手和三名对手。这些值会重写开始面板、赛道旁标牌、领奖台和保存圈速的键。赛道、门、速度和 HUD 保持不变,因此另一个虚构的俱乐部也能跑同一场比赛。成绩保存在浏览器中。
模板提示词
在线演示就是用这份提示词原样做出来的,没有额外补充。其他案例只是改了 [VARIABLES] 变量的值。 提示词保持英文原版,国内常用的 AI 编程工具都能直接理解;下面附中文参考译文。
# Dusk Track Racing Game Build this website exactly as described below. Replace the [VARIABLES] with your own values; keep everything else. ## Brief Build [BRAND], a single-page third-person race at [PLACE] on the closed circuit [TRACK]. The player drives the code-built [CAR] for 3 laps at golden hour, against three rivals named in [RIVALS], with checkpoint gates, a drift boost, a lap ghost saved in the browser, a minimap, and a podium. The live scene is the first screen. - Audience: Developers and indie hackers who want a finished, reskinnable Three.js arcade race that runs as static files and plays with a keyboard or on-screen touch controls. - Goal: Ship one complete heat: a start panel, a countdown, a full race, a pause state, and a podium. The player can beat the rivals, save a best lap, and race that lap as a ghost, on both 1440×900 and 390×844. - Tone: Warm, plain, and specific. US English. Club-heat language, no taunts, no military wording, and no real series, manufacturers, or drivers. ## Stack - Framework: Vite 6 + TypeScript 5 - Styling: Vanilla CSS - Libraries: three (MIT), @fontsource/big-shoulders-display (OFL-1.1), @fontsource/outfit (OFL-1.1), @fontsource/share-tech-mono (OFL-1.1) - Build: `npm run build` → static files in `dist/`. No backend, no server code, no external APIs. - Setup: - Scaffold Vite's vanilla TypeScript app. Scripts: dev=vite, build=tsc && vite build, preview=vite preview. Do not add React, a physics engine, a postprocessing stack, or a game framework. - In vite.config.ts set base to './', build.outDir to dist, build.emptyOutDir to true, and build.sourcemap to false. Enable strict TypeScript. - Install three and the three Fontsource packages above. Import Big Shoulders Display 500, 700, and 800, Outfit 400, 500, and 600, and Share Tech Mono 400 only. - Use index.html plus src/content.ts, main.ts, track.ts, cars.ts, drive.ts, race.ts, hud.ts, input.ts, audio.ts, and styles.css, plus public/favicon.svg and ASSETS.md. - Put every name, button label, and sentence in src/content.ts. Read [BRAND], [PLACE], [TRACK], [CAR], [DRIVER], and [RIVALS] from that file. Split [RIVALS] on commas into exactly three trimmed names. - Keep laps at 3, player number 14, rival colors #2f6f62, #d7a441, and #3d4c7a, and rival numbers 7, 22, and 3 for every variable set. A new place changes copy, not the biome, the clock time, the mesh, or the palette. - Gate labels other than the start line stay North Gate, Sweeper, and Hairpin. The start line label is [TRACK] plus the word line. - Derive the localStorage key and the tree seed from the lowercased brand and track, with spaces turned into hyphens. Never hard-code the default names outside content.ts. - Wait for document.fonts.ready before drawing canvas number plates or the hut sign. Set those textures to SRGBColorSpace. Set document.title from content.ts to [BRAND] — [TRACK], and match the static title in index.html to the default. ## Variables - [BRAND] — Racing club (default: "Pennyglass"). Invented club name. Start-screen title, hut sign, and half of the save key. - [PLACE] — Ridge name (default: "Wickpenny"). Invented place. Eyebrow on the start panel and the practice-heat line. - [TRACK] — Circuit name (default: "Barleycut"). Invented circuit. Subtitle, start-line callout, podium, and the other half of the save key. - [CAR] — Car name (default: "Skiff 4"). Invented closed-wheel car. Shown next to the circuit name. The mesh does not change. - [DRIVER] — Player name (default: "Nell Harp"). Invented driver. Podium sentence and the player's result row. - [RIVALS] — Three rivals (default: "Nia Pell, Omar Voss, Bess Calder"). Three invented names, comma-separated, in teal, gold, and dusk-blue order. - [CREDIT] — keep a small "Template by VibeFather" link to https://vibefather.ai/t/dusk-track-racing-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 - Ink `#1c1612` — Panels, minimap fill, car roof, tire rubber, start-stripe dark squares - Paper `#f6f1e7` — Text on ink, edge lines, start-stripe light squares, focus rings - Coral `#c4512c` — Player body, primary buttons, player minimap triangle - Gold `#e7c27a` — Center dashes, boost fill, minimap ribbon, drift button - Sun `#ffb067` — Directional light, gate veil, ghost emissive, boost glow - Horizon `#e7a15a` — Sky horizon band and fog tint - Zenith `#1e3a5f` — Sky top and the page background behind the canvas - Asphalt `#3a342e` — Racing surface - Runoff `#6b5344` — Dirt shoulders - Grass `#6d7a45` — Ground plane beyond the runoff - Pine `#3e5340` — Tree cones - Teal `#2f6f62` — First rival - Rival gold `#d7a441` — Second rival - Dusk blue `#3d4c7a` — Third rival - Danger `#d8452f` — Taillights, wrong-way banner, red start lamps ### Typography - Club name, position, speed, and podium place: Big Shoulders Display (OFL), weights 500/700/800 - Body, buttons, and HUD labels: Outfit (OFL), weights 400/500/600 - Lap times: Share Tech Mono (OFL), weights 400 ### Layout & motion - Spacing: 4 px base. Desktop panel padding 28 px and HUD inset 20 px. Mobile inset 14 px plus safe-area. Buttons at least 44 px, coarse-pointer controls at least 72 px. The start sheet on a phone stays within 58 vh and scrolls inside itself. - Radius: 18 px on the start, pause, and podium panels. Pill buttons. The minimap and steer pad are circles. The boost track is a 999 px capsule. World meshes stay faceted, not filleted like UI. - Motion: Chase camera eases with exponential smoothing and may roll up to 4 degrees against the steer. A boost widens FOV by 6 degrees for 1.2 seconds. - Motion: Countdown numerals use a 160 ms scale from 0.92 to 1. Drift dust is 12 short-lived specks. The armed boost bar pulses once. - Motion: Overlays fade over 180 ms and move no more than 8 px. Checkpoint callouts last 0.7 seconds. - Motion: prefers-reduced-motion removes roll, FOV kick, dust, pulses, overlay travel, and countdown scale. The race, ghost, and rivals still move, because that motion is the game. - Imagery: Draw the whole world in Three.js: sky shader, banked ribbon, closed-wheel wedge, gates, bales, tires, cones, pines, hills, a hut, and a grandstand of featureless box spectators. No photographs, generated images, HDRIs, downloaded models, or brand marks. Golden-hour light is one low warm sun and long shadows. The parked car on the ribbon is the first-screen anchor, with the start panel beside it rather than instead of it. ## Pages & Sections ### [BRAND] — [TRACK] (`index.html`) 1. **Race shell and start heat** — The document title is [BRAND] — [TRACK]. States are start, controls, countdown, racing, paused, and podium. Open on start. The eyebrow is [PLACE] in uppercase Outfit 600 at 12 px with 0.14 em tracking. The heading is [BRAND] in Big Shoulders Display 800. The line under it is [TRACK] · [CAR]. The deck is exactly: 3 laps of [TRACK] in the [CAR]. Drift to fill the boost, stay on the asphalt, and beat [first rival], [second rival], and [third rival]. The best-lap line reads Best lap m:ss.ss or No best lap yet. Fine print: A practice heat at [PLACE]. The best lap stays in this browser and comes back as a ghost. Buttons: Start race (primary, Coral) and Controls (Paper text on Ink). Put the optional [CREDIT] link under the fine print. Layout: Body margin 0, overflow hidden, background Zenith #1e3a5f. A fixed canvas fills the viewport. UI is a fixed layer, pointer-events none, with buttons and panels set back to auto. Desktop start panel is 420 px wide, 32 px from the left, vertically centered, Ink at 72% opacity, 8 px backdrop blur, 18 px radius, Paper text. The car sits in the right two-thirds. Under 700 px the panel is a bottom sheet, max-height 58 vh, internal scroll, and the camera lifts so the car and sky occupy the top of the screen. Do not use a loading wall or a type-only cover. Motion: The panel fades in over 180 ms after the first rendered frame. On the start state the car stays parked and the camera may sway 0.15 m over 6 seconds. Reduced motion freezes that sway. Start race moves to countdown and does not reload the page. 2. **Banked golden-hour circuit** — Axes: +x east, +y up, +z south. Build a CatmullRomCurve3 with closed set to true and tension 0.5, through these x,z meters: (0, 0), (72, 6), (136, 32), (168, 96), (128, 152), (56, 168), (-8, 136), (-56, 88), (-72, 32), (-32, -16), then back to the start. Scale x and z about the origin until the curve length is 1000 m. Sample 250 evenly spaced points. Yaw 0 faces +x. Positive yaw turns toward +z. With the nose built on local +z, set the yaw pivot's rotation.y to Math.PI / 2 - yaw. Right vector is normalize(cross(tangent, up)), so positive lateral is right of travel. Build each ribbon cross-section in the right/up plane, rotate it around the tangent by the bank angle, and keep the center point at y = 2. Gameplay lateral is the signed x,z distance to the centerline, not the distance along the tilted surface. Bank is +16 degrees from arc 200 to 500 and +8 degrees from arc 720 to 850, blended with smoothstep over 30 m, and 0 elsewhere. Positive bank raises the right edge. Asphalt half-width is 8 m, color #3a342e. Paper edge lines sit 0.4 m in from each edge. Gold center dashes are 4 m paint and 6 m gap. A start stripe at arc 0 is 0.8 m ink and paper squares across the asphalt, with no logo. Runoff continues to 18 m at 0.35 times the bank, color #6b5344. Beyond that, a grass plane #6d7a45. Curbs on the banked spans only: 0.6 m stripes of #c4512c and #f6f1e7. Layout: Gates at arcs 0, 250, 500, and 750. Each gate is two tapered pylons, 0.7 m at the base and 0.4 m at the top, 5.2 m tall, color #c4653a, placed 1.2 m outside each asphalt edge, with a 0.45 m cream beam at 4.2 m. The arc-0 beam uses the ink-and-paper stripe. A Sun-colored vertical plane between the pylons is opacity 0.22 and does not write depth. Callout names: [TRACK] line, North Gate, Sweeper, Hairpin. Hay-bale stacks, three boxes each in #c4a15a, at arcs 780, 805, and 830, lateral -6.6 m. Two tire stacks of four 8-sided rings, #2c2a28 with a #d4722a band, at arcs 460 and 478, lateral +7.2 m. Four cones, 0.7 m, #e07a2f with a Paper band, at arcs 560, 578, 596, and 614, laterals +6.6, -6.6, +6.6, -6.6. A wood grandstand of three steps, 18 m long, #8a6244, at arc 45, lateral +22, with 18 featureless spectator boxes in Coral, Teal, Rival gold, Dusk blue, Paper, and Ink. No faces. A hut at arc 45, lateral -22, Ink walls and a Coral roof, with one canvas sign reading [BRAND]. A five-lamp gantry at arc 70 is visual only. Fourteen pines and five hill domes must sit at least 22 m from the centerline, placed with a mulberry32 seed from [TRACK], never Math.random. Forty grass tufts may sit in the runoff. The grandstand, hut, gantry, trees, hills, and grass have no collision. Only bales, tires, cones, rivals, and the asphalt edge affect the car. Motion: The world does not rotate on its own. Start lamps are Ink housings, all Danger red during 3, 2, and 1, then #d6e38a for 1.5 seconds on GO, then dark. Reduced motion switches the lamp color without a glow pulse. Shadow casters are the car, gates, hut, and grandstand. 3. **Player car and arcade driving** — Build one closed-wheel wedge and clone it. It is not an open-wheel car and not a known road car: blunt two-step nose, short cabin, small lip spoiler, rectangular lamps, no giant wing, no sponsor livery. Local +z is the nose. Parent the mesh under the yaw pivot so that when yaw is 0 the nose points along world +x. Sill box 4.20 × 0.28 × 1.78 at y 0.36. Nose box 1.35 × 0.32 × 1.62 at z 1.25, y 0.55. Nose tip 0.70 × 0.18 × 1.40 at z 1.85, y 0.48. Tail box 0.85 × 0.36 × 1.70 at z -1.55, y 0.62. Cabin 1.45 × 0.55 × 1.28 at z -0.15, y 1.02, color #241c18. Windshield 0.08 × 0.42 × 1.18, rotated -32 degrees on x, at z 0.55, y 1.08, color #b7d4d8, opacity 0.55. Two spoiler uprights and a blade 1.40 m wide at y 1.12. Four arch boxes over the wheels. Wheels are 10-segment cylinders, radius 0.36, at x ±0.92 and z ±1.28. Hubs #e8d7b0. Headlights emissive #fff1cc. Taillights emissive #d8452f. Player body #c4512c, door number 14 on a 256×128 canvas. MeshStandardMaterial roughness 0.62 and metalness 0.08. Rivals recolor only the body panels. Layout: Simulate on the x,z plane. Speed is along yaw plus a drift slip angle. Each frame, project the car onto the nearest centerline sample, searching only ±40 samples from the last hit so the match cannot jump. Set height from the bank at that lateral offset and roll the mesh to the bank. Camera is a perspective chase: FOV 68, or 76 under 700 px, 7.2 m behind and 2.6 m up, looking 6 m ahead. Under 700 px use 9.2 m behind and 4.0 m up so the bottom sheet and the thumbs do not cover the car. Speed cap is 42 m/s, or 54 m/s while a boost is active. Acceleration is 16 m/s², brake is 28 m/s², and reverse caps at 6 m/s. With no throttle, coast at 3 m/s². Do not add quadratic drag, or the car cannot catch the rivals. Yaw rate eases from 1.6 rad/s at rest to 0.5 rad/s at top speed. Keyboard steer is digital and rate-limited at 3.5 units per second. The steer pad is analog. Motion: Fixed step 1/60, accumulator capped at 0.1 s. Wheels spin with speed and the front wheels steer up to 18 degrees. Drift when throttle is held, speed exceeds 18 m/s, and either the drift control is held or the brake is held with steer past 0.4, and a boost is not active. Slip angle moves toward steer times 16 degrees. The boost meter fills 0.40 per second while drifting and falls 0.15 per second otherwise. At 1 it stays armed. Shift, or releasing drift while armed, spends it: 1.2 s at the boost speed, then the meter is 0. Dust specks spawn only while drifting. Reduced motion skips dust and the FOV kick. Camera smoothing is 1 - exp(-8 dt) on position. 4. **Rivals, ghost, gates, and heat rules** — Three rivals use the same mesh on rails. Order in [RIVALS] maps to teal number 7, gold number 22, and dusk blue number 3. Spawn arcs and laterals: first 52 m and -2.4 m, second 36 m and +2.6 m, third 8 m and +0.4 m. The player spawns at arc 20 m, lateral 0, so the grid is first, second, player, third. Rival target speeds in m/s: 34 from 0–180, 27 from 180–460, 32 from 460–700, 18 from 700–860, and 34 from 860–1000, with acceleration limited to 10 m/s². They do not drift or boost. A rival completes a lap when its arc wraps forward past 0, and the first wrap counts as lap 1. Progress for every car is completed laps times 1000 plus current arc. That order drives the HUD place and the podium. If a rival overlaps the player inside 2.4 m, separate them and multiply both speeds by 0.92. The rival then returns to its lateral at 4 m/s. Obstacle hits multiply speed by 0.72, shove lateral 1.2 m away from the obstacle, and never leave speed under 7 m/s. Cooldown 0.45 s. Layout: Off asphalt means absolute lateral greater than 8 m: cap speed at 26 m/s, cut acceleration to 0.45, and show Back on the asphalt. If that lasts 1.2 s, or absolute lateral exceeds 20 m, reset to the last cleared gate at lateral 0, heading along the tangent, speed 16 m/s. The last cleared gate starts at arc 0, then updates to 250, 500, and 750 as those gates are passed in order. Show Reset for 0.8 s and ignore obstacle hits during it. Do not clear lap flags and do not end the heat. Gates must be taken forward, in order: 250, then 500, then 750, then arc 0. Ignore arc 0 until the player has reached arc 40 once. Crossing arc 0 with the three flags set completes a lap, stores the lap time, and clears the flags. HUD lap reads completed + 1, clamped to 3. The heat ends when the player completes 3 laps. Each car stores its own finish clock. Unfinished rivals sort behind finishers by progress around the lap. Wrong way, when the heading opposes the tangent for 0.4 s, shows Wrong way and does not reset the car. Motion: Record the player's world position and yaw every 100 ms during a lap, capped at 800 samples. If that lap is the best, keep it and write localStorage key [brand-slug]::[track-slug]::best-lap. Replay it as a Coral clone at opacity 0.32, emissive Sun at 0.15, depthWrite false, no shadow and no collision. Restart the ghost each time the player begins a lap. The first visit with no save shows no ghost. Clear ghost deletes the key and hides the clone. Cars stay still through the countdown. On GO the clock starts and input is live. Pause, the hidden document, and the podium freeze the clock and the step. 5. **HUD, minimap, touch, and podium** — During the race show position as 1st, 2nd, 3rd, or 4th; Lap 1 / 3 from the lap counter; the current lap time and Best m:ss.ss or Best — in Share Tech Mono; speed as a rounded km/h integer with a km/h label, prefixed R when reversing. Times use m:ss.ss under 10 minutes. The boost label is BOOST. Banners, one at a time, use the gate name, Back on the asphalt, Reset, or Wrong way. If the next rival is inside 30 m, a small line reads Ahead: and that rival's name, or Behind: when the rival is the car immediately back. Countdown is 3, 2, 1 at 700 ms each, then GO for 400 ms. Podium heading is Heat complete. If the player is first: [DRIVER] took [TRACK]. Otherwise: [DRIVER] finished [ordinal] at [TRACK]. Four rows show place, name, and time. A new best adds New best lap and the time. Buttons: Run it again, Clear ghost when a ghost exists, and Back to start. Pause heading is Paused, with Resume, Restart, and Controls. Layout: Desktop HUD: position and lap at the top left, lap time top center, speed top right, a 168 px minimap 24 px from the bottom right, and a 180×10 boost track bottom center. A Pause button, at least 44 px, is always available. Under 700 px: row one is Pause and speed, row two is position, lap, and lap time, the minimap shrinks to 104 px at the top right, and the boost track sits just above the touch controls. Touch controls show only when the pointer is coarse or the width is under 800 px. Left: a 132 px steer pad, 16 px from the safe-area corner. Right: GAS 92 px in Coral, BRAKE 72 px in Paper, DRIFT 72 px in Gold. Minimap is a 2D canvas, not a second WebGL view: Ink fill, 2 px Gold border, centerline in Gold, +x to the right and +z downward, 14% padding, a Paper tick at arc 0. Player triangle Coral, rivals as 6 px dots in their colors, ghost as a Gold ring, next gate as a Paper tick. The map does not rotate with the car. Motion: Passing a gate shows its name for 0.7 s. The boost fill uses scaleX from the left. An armed meter gets a Paper border and one pulse. Overlays fade 180 ms. Reduced motion uses instant overlay changes and a static full boost bar. Run it again and Restart return to the countdown on the same grid without reloading. Back to start returns to the parked car. Clear ghost can be used from the podium or the start panel. 6. **Controls, sound, and fallback** — Controls heading is Controls. Keyboard rows: W or Up arrow — gas; S or Down arrow — brake; A, D, or the arrow keys — steer; Space — drift; Shift — boost when the bar is full; R — return to the last checkpoint; P — pause. Touch rows: the left pad steers; Gas, Brake, and Drift sit on the right. Button: Back. Keys: W and ArrowUp throttle, S and ArrowDown brake, A and ArrowLeft steer left, D and ArrowRight steer right, Space drift, Shift boost, R reset, P or Escape pause during the race, Enter activates the primary button of the open overlay, Escape closes Controls. Prevent default on those keys so the page does not scroll. Releasing the pointer, blurring the window, or opening an overlay clears every held key and touch so the car cannot stick. Sound is off by default. The toggle reads Sound off or Sound on. When on, after that gesture, play a 440 Hz sine for 80 ms on each count, 660 Hz for 140 ms on GO, a 120 ms noise burst on boost, a quiet sawtooth engine at gain 0.02 whose pitch follows speed, and three short sines at 523, 659, and 784 Hz on the podium. No audio files. If AudioContext fails, leave sound off and do not log a loop of errors. Layout: The controls sheet is 480 px on desktop and a scrollable sheet on mobile, reached from the start panel or from pause, and it returns to that same state. All controls are real buttons with visible 2 px Gold focus rings. The canvas has an accessible name: Third-person race on a banked circuit at dusk. A polite live region announces lap changes, Reset, Wrong way, and the podium sentence, not every speed tick. The minimap is aria-hidden. Pair every sound with the visible countdown, banner, or podium. Motion: Held touch buttons use a 0.96 scale and a filled pressed state without delaying the input. Reduced motion removes that scale. Audio gain ramps over 40 ms. Sound goes silent while paused or when the toggle is off. 7. **Size, lighting, and the two viewports** — Target a clean first frame at 1440×900 and at 390×844, with no horizontal overflow and no console errors. Lighting: hemisphere sky #ffd2a8 and ground #6b5344 at intensity 0.5; one directional light #ffb067 at intensity 2.35 from position (-90, 22, 40); FogExp2 color #e0a06a density 0.011; ACES filmic tone mapping at exposure 1.05; PCF soft shadows, 2048 on desktop and 1024 under 800 px, bias -0.0003. The sky is the inside of a large sphere: Zenith overhead, Horizon at the horizon, #c46a3a below it, and a soft #fff1cc sun disc aligned with the directional light. No stars, no night, no neon, no bloom composer. Cap pixel ratio at 1.75, or 1.25 under 800 px. If the mean frame time over 180 frames exceeds 22 ms, once, drop the pixel ratio to 1 and the shadow map to 1024. Keep the heat rules. If WebGL cannot start, leave the start copy in place and add the sentence This browser could not start the 3D view. Try a browser with WebGL enabled. Do not retry in a loop. Layout: Resize the renderer and camera on viewport changes and honor safe-area insets. The page itself does not scroll. Panels that exceed the viewport scroll inside. Keep dist under 20 MB by using code geometry, instanced grass and spectators, and no image files. Stop the simulation while the document is hidden, and do not auto-resume when it returns; stay paused until Resume or Start race. Motion: Quality cuts never remove gates, rivals, the ghost, or touch controls. Reduced motion is independent of the quality cut: the race stays playable, and only the extra camera and UI motion drops. ## Assets - image: No image files and no generated stills. Draw the sky, track, cars, gates, obstacles, trees, hut, grandstand, number plates, hut sign, and minimap in code. Add an original public/favicon.svg: a 32 viewBox, Ink rounded rectangle, and a Coral five-sided wedge pointing right, with no letters. In ASSETS.md state that the scene is code-drawn and list the favicon as original. - icon: Do not install an icon package. Pause, sound, and the touch labels are text. The steer pad and boost track are CSS. List no third-party icons in ASSETS.md. - font: Self-host Big Shoulders Display, Outfit, and Share Tech Mono through the Fontsource packages named in the stack (OFL-1.1). Import only the weights listed. In ASSETS.md record the local woff2 files, the npm package pages, and the OFL license. Do not request fonts.googleapis.com, fonts.gstatic.com, or any other font CDN. - video: No video, no filmed gameplay, and no audio files. Optional sound is synthesized with Web Audio after the player turns Sound on. ## Don'ts - No backend, accounts, database, analytics, external APIs, multiplayer, or a global leaderboard. The best lap stays in localStorage under a key built from the brand and the track. - No CDN and no remote assets. Self-host fonts, import three from the installed package, use relative paths, and emit minified files to dist/ with source maps off and without copying src/ into dist/. Keep dist under 20 MB. - No routes, marketing sections, prices, or a scroll landing page. The only page is index.html, and the first screen is the parked car on the circuit. - Do not copy a source prompt, one-shot HTML page, filmed run, judge note, or playtest reading. Do not show a speed of 105 or a score of 000749. Do not mention Agent OS, GoldieBench, AI Profit Boardroom, Grok, xAI, or Julian Goldie. - Do not reuse a source car silhouette, circuit layout, gate design, or obstacle placement. Use the control points, gates, bales, tires, and cones specified here. Do not turn the heat into a night city, a hover vehicle, or a brick-breaking game. - No real racing series, manufacturers, circuits, liveries, sponsor marks, or real drivers. No celebrity or public-figure likeness, no faces on the spectators, and no brand logos. The start stripe is a generic ink-and-paper band, not a series identity. - No downloaded models, HDRIs, texture packs, stock photos, placeholder-image services, physics engines, or postprocessing bloom. Geometry and the sky stay in code. - No commercial fonts and no font CDN. Do not hard-code Pennyglass, Wickpenny, Barleycut, Skiff 4, Nell Harp, or the default rivals outside src/content.ts, and do not leave raw variable tokens on screen. - Do not invent dates, entry fees, online player counts, or any claim about VibeFather. The only VibeFather presence is the optional [CREDIT] link. - No autoplay audio, camera shake, full-screen flashing, or a permanent stall. Off-track play slows the car and then resets it to the last gate. Honor prefers-reduced-motion without disabling the race. - Do not let the clock run while paused, hidden, or on the podium. Clear stuck inputs when focus is lost. At 390×844 the steer pad, pedals, minimap, and start sheet must all be usable with no horizontal overflow and no console errors. - If WebGL fails, show the readable fallback sentence and do not throw in a loop. If frames run long, lower the pixel ratio and the shadow map once, and leave the lap rules, rivals, ghost, and controls in place. --- Inspired by Grok 4.7 In The Agent OS: 20 Games, One Shot, Real Scores by @JulianGoldieSEO — https://agentos.guide/grok-4-7-agent-os — Prompt by VibeFather · https://vibefather.ai/t/dusk-track-racing-game · CC BY-NC 4.0 (non-commercial; commercial use needs a VibeFather Pro license) · Request removal: https://vibefather.ai/takedown
中文参考译文(帮助理解,复制给 AI 时请用上面的英文原版)
# Dusk Track Racing Game 完全按照下面的描述构建这个网站。将 [VARIABLES] 替换为你自己的值;其余内容保持不变。 ## 简介 构建 [BRAND],一个在 [PLACE] 的封闭赛道 [TRACK] 上进行的单页第三人称赛车游戏。玩家驾驶由代码构建的 [CAR],在黄金时刻进行 3 圈比赛,对抗 [RIVALS] 中指定的三位对手,包含检查点门、漂移加速、保存在浏览器中的单圈幽灵、小地图和领奖台。实时场景是第一屏。 - 受众:希望获得一个完整、可换肤的 Three.js 街机赛车游戏的开发者和独立黑客,该游戏以静态文件运行,并可通过键盘或屏幕触控操作。 - 目标:交付一个完整的热身赛:开始面板、倒计时、完整比赛、暂停状态和领奖台。玩家可以击败对手、保存最佳单圈,并将该圈作为幽灵进行比赛,在 1440×900 和 390×844 两种分辨率下均可运行。 - 语气:温暖、平实、具体。美式英语。俱乐部热身赛用语,不嘲讽、不使用军事化措辞,不涉及真实系列、制造商或车手。 ## 技术栈 - 框架:Vite 6 + TypeScript 5 - 样式:原生 CSS - 库:three(MIT)、@fontsource/big-shoulders-display(OFL-1.1)、@fontsource/outfit(OFL-1.1)、@fontsource/share-tech-mono(OFL-1.1) - 构建:`npm run build` → `dist/` 中的静态文件。无后端、无服务器代码、无外部 API。 - 设置: - 搭建 Vite 的原生 TypeScript 应用。脚本:dev=vite,build=tsc && vite build,preview=vite preview。不要添加 React、物理引擎、后处理栈或游戏框架。 - 在 vite.config.ts 中将 base 设为 './',build.outDir 设为 dist,build.emptyOutDir 设为 true,build.sourcemap 设为 false。启用严格 TypeScript。 - 安装 three 和上述三个 Fontsource 包。仅导入 Big Shoulders Display 500、700 和 800,Outfit 400、500 和 600,以及 Share Tech Mono 400。 - 使用 index.html 以及 src/content.ts、main.ts、track.ts、cars.ts、drive.ts、race.ts、hud.ts、input.ts、audio.ts 和 styles.css,外加 public/favicon.svg 和 ASSETS.md。 - 将每个名称、按钮标签和句子放入 src/content.ts。从该文件读取 [BRAND]、[PLACE]、[TRACK]、[CAR]、[DRIVER] 和 [RIVALS]。将 [RIVALS] 按逗号拆分为恰好三个去除首尾空格的名称。 - 对每个变量集,保持圈数为 3、玩家编号为 14、对手颜色为 #2f6f62、#d7a441 和 #3d4c7a,对手编号为 7、22 和 3。新地点只改变文案,不改变生物群系、时钟时间、网格或调色板。 - 除起跑线外的门标签保持为 North Gate、Sweeper 和 Hairpin。起跑线标签为 [TRACK] 加上单词 line。 - 从转为小写的品牌和赛道派生 localStorage 键和树种子,空格转为连字符。绝不在 content.ts 之外硬编码默认名称。 - 在绘制 canvas 号码牌或小屋标牌之前等待 document.fonts.ready。将这些纹理设置为 SRGBColorSpace。从 content.ts 设置 document.title 为 [BRAND] — [TRACK],并将 index.html 中的静态标题匹配为默认值。 ## 变量 - [BRAND] — 赛车俱乐部(默认:“Pennyglass”)。虚构的俱乐部名称。开始界面标题、小屋标牌,以及存档键的一半。 - [PLACE] — 山脊名称(默认:“Wickpenny”)。虚构的地点。开始面板上的眉题和练习赛文案行。 - [TRACK] — 赛道名称(默认:“Barleycut”)。虚构的赛道。副标题、起跑线标注、领奖台,以及存档键的另一半。 - [CAR] — 赛车名称(默认:“Skiff 4”)。虚构的封闭式车轮赛车。显示在赛道名称旁边。网格模型不变。 - [DRIVER] — 玩家名称(默认:“Nell Harp”)。虚构的车手。领奖台语句和玩家的成绩行。 - [RIVALS] — 三位对手(默认:“Nia Pell, Omar Voss, Bess Calder”)。三个虚构名字,逗号分隔,按青绿色、金色和暮蓝色的顺序排列。 - [CREDIT] — 在页脚保留一个小型“Template by VibeFather”链接,指向 https://vibefather.ai/t/dusk-track-racing-game(默认:是;删除此行即可移除) Pages & Sections 下的文案是按默认值撰写的。如果你的取值不同,请为它们重写每一个标题、段落、标签和图片——保持相同的长度、语气和结构。布局、颜色、字体和动效保持所述不变。 将所有文案、图片路径和链接放在一个内容文件中(例如 `src/content.ts`),按区块作为键,以便之后无需改动组件即可替换内容。 ## 设计 ### 颜色 - 墨色(Ink)`#1c1612` — 面板、小地图填充、车顶、轮胎橡胶、起跑线深色方格 - 纸色(Paper)`#f6f1e7` — 墨色上的文字、边缘线、起跑线浅色方格、焦点环 - 珊瑚色(Coral)`#c4512c` — 玩家车身、主按钮、玩家小地图三角 - 金色(Gold)`#e7c27a` — 中央虚线、加速填充、小地图缎带、漂移按钮 - 日色(Sun)`#ffb067` — 平行光、门帘、幽灵自发光、加速辉光 - 地平线色(Horizon)`#e7a15a` — 天空地平线色带与雾色调 - 天顶色(Zenith)`#1e3a5f` — 天空顶部与画布后的页面背景 - 沥青色(Asphalt)`#3a342e` — 赛道表面 - 缓冲区色(Runoff)`#6b5344` — 泥土路肩 - 草色(Grass)`#6d7a45` — 缓冲区之外的地面 - 松色(Pine)`#3e5340` — 树冠 - 青绿色(Teal)`#2f6f62` — 第一位对手 - 对手金色(Rival gold)`#d7a441` — 第二位对手 - 暮蓝色(Dusk blue)`#3d4c7a` — 第三位对手 - 危险色(Danger)`#d8452f` — 尾灯、逆行横幅、红色起跑灯 ### 字体排印 - 俱乐部名称、名次、速度与领奖台名次:Big Shoulders Display(OFL),字重 500/700/800 - 正文、按钮与 HUD 标签:Outfit(OFL),字重 400/500/600 - 单圈时间:Share Tech Mono(OFL),字重 400 ### 布局与动效 - 间距:4 px 基准。桌面端面板内边距 28 px,HUD 内缩 20 px。移动端内缩 14 px 加安全区。按钮至少 44 px,粗指针控件至少 72 px。手机上的开始面板保持在 58 vh 以内并在自身内部滚动。 - 圆角:开始、暂停与领奖台面板为 18 px。胶囊按钮。小地图与转向盘为圆形。加速轨道为 999 px 胶囊形。世界网格保持棱面感,不像 UI 那样做圆角。 - 动效:追逐相机以指数平滑缓动,并可随转向侧倾至多 4 度。加速时 FOV 在 1.2 秒内扩大 6 度。 - 动效:倒计时数字使用 160 ms 的缩放,从 0.92 到 1。漂移尘土为 12 个短命微粒。蓄力完成的加速条脉冲一次。 - 动效:覆盖层在 180 ms 内淡入淡出,位移不超过 8 px。检查点提示持续 0.7 秒。 - 动效:prefers-reduced-motion 会移除侧倾、FOV 冲击、尘土、脉冲、覆盖层位移与倒计时缩放。比赛、幽灵与对手仍会移动,因为那种运动就是游戏本身。 - 图像:整个世界的绘制都在 Three.js 中完成:天空着色器、倾斜缎带赛道、封闭轮楔形车、门、草捆、轮胎、锥桶、松树、山丘、小屋,以及由无特征方块观众组成的看台。不使用照片、生成图像、HDRI、下载模型或品牌标识。黄金时刻的光照是一轮低垂的暖阳与长长的阴影。缎带赛道上的停放车辆是首屏的锚点,开始面板位于其旁,而非取代它。 ## 页面与区块 ### [BRAND] — [TRACK] (`index.html`) 1. **赛道外壳与起步热场** — 文档标题为 [BRAND] — [TRACK]。状态包括 start、controls、countdown、racing、paused 和 podium。打开时处于 start 状态。眉题为 [PLACE],全大写,Outfit 600,12 px,字距 0.14 em。标题为 [BRAND],Big Shoulders Display 800。其下的一行为 [TRACK] · [CAR]。副文案严格为:3 laps of [TRACK] in the [CAR]. Drift to fill the boost, stay on the asphalt, and beat [first rival], [second rival], and [third rival]. 最佳单圈行显示 Best lap m:ss.ss 或 No best lap yet。细则文字:A practice heat at [PLACE]. The best lap stays in this browser and comes back as a ghost. 按钮:Start race(主按钮,Coral)和 Controls(Paper 文字置于 Ink 上)。将可选的 [CREDIT] 链接放在细则文字下方。 布局:Body 外边距 0,overflow hidden,背景 Zenith #1e3a5f。一个固定 canvas 填满视口。UI 是固定层,pointer-events none,按钮和面板设回 auto。桌面端起始面板宽 420 px,距左侧 32 px,垂直居中,Ink 72% 不透明度,8 px 背景模糊,18 px 圆角,Paper 文字。车辆位于右侧三分之二区域。低于 700 px 时,面板为底部抽屉,max-height 58 vh,内部滚动,相机抬高,使车辆和天空占据屏幕顶部。不要使用加载墙或纯文字封面。 动效:面板在首帧渲染后 180 ms 内淡入。在 start 状态,车辆保持停放,相机可在 6 秒内摆动 0.15 m。减少动效会冻结该摆动。Start race 进入 countdown,且不重新加载页面。 2. **倾斜的黄金时刻赛道** — 坐标轴:+x 向东,+y 向上,+z 向南。构建一个 CatmullRomCurve3,closed 设为 true,tension 为 0.5,经过以下 x,z 米坐标:(0, 0)、(72, 6)、(136, 32)、(168, 96)、(128, 152)、(56, 168)、(-8, 136)、(-56, 88)、(-72, 32)、(-32, -16),然后回到起点。围绕原点缩放 x 和 z,直到曲线长度为 1000 m。采样 250 个等距点。Yaw 0 朝向 +x。正 yaw 转向 +z。车头构建在局部 +z 上,因此将 yaw 枢轴的 rotation.y 设为 Math.PI / 2 - yaw。右向量为 normalize(cross(tangent, up)),因此正横向为行进方向右侧。在 right/up 平面中构建每个带状横截面,围绕切线按倾斜角旋转,并保持中心点位于 y = 2。玩法横向是到中心线的带符号 x,z 距离,而不是沿倾斜表面的距离。倾斜在弧长 200 到 500 为 +16 度,在弧长 720 到 850 为 +8 度,用 smoothstep 在 30 m 内混合,其他位置为 0。正倾斜抬高右边缘。沥青半宽为 8 m,颜色 #3a342e。Paper 边缘线位于每侧边缘内 0.4 m。金色中心虚线为 4 m 涂料和 6 m 间隔。弧长 0 处的起跑条纹为 0.8 m 的 ink 和 paper 方块横跨沥青,无 logo。缓冲区继续到 18 m,倾斜为 0.35 倍,颜色 #6b5344。再往外是草地平面 #6d7a45。仅在倾斜路段设置路缘:0.6 m 条纹,颜色 #c4512c 和 #f6f1e7。 布局:门架位于弧长 0、250、500 和 750。每个门架是两根锥形塔柱,底部 0.7 m,顶部 0.4 m,高 5.2 m,颜色 #c4653a,放置在每侧沥青边缘外 1.2 m,并在 4.2 m 处有一根 0.45 m 的奶油色横梁。弧长 0 的横梁使用 ink-and-paper 条纹。塔柱之间有一个 Sun 色垂直平面,不透明度 0.22,不写入深度。标注名称:[TRACK] line、North Gate、Sweeper、Hairpin。干草捆堆,每堆三个箱子,颜色 #c4a15a,位于弧长 780、805 和 830,横向 -6.6 m。两组轮胎堆,每组四个 8 边形环,颜色 #2c2a28,带 #d4722a 色带,位于弧长 460 和 478,横向 +7.2 m。四个锥桶,高 0.7 m,颜色 #e07a2f,带 Paper 色带,位于弧长 560、578、596 和 614,横向 +6.6、-6.6、+6.6、-6.6。一个三级台阶的木制看台,长 18 m,颜色 #8a6244,位于弧长 45,横向 +22,有 18 个无面部特征的观众盒子,颜色为 Coral、Teal、Rival gold、Dusk blue、Paper 和 Ink。没有面部。一个小屋位于弧长 45,横向 -22,Ink 墙壁和 Coral 屋顶,有一个 canvas 标牌写着 [BRAND]。弧长 70 处的五灯龙门架仅作视觉用途。十四棵松树和五个山丘圆顶必须距中心线至少 22 m,使用来自 [TRACK] 的 mulberry32 种子放置,绝不用 Math.random。四十丛草可以位于缓冲区内。看台、小屋、龙门架、树木、山丘和草没有碰撞。只有草捆、轮胎、锥桶、对手和沥青边缘会影响车辆。 动效:世界不会自行旋转。起跑灯为 Ink 外壳,在 3、2 和 1 期间全部为 Danger 红色,然后在 GO 时变为 #d6e38a 持续 1.5 秒,然后变暗。减少动效会切换灯色而不带发光脉冲。阴影投射者为车辆、门架、小屋和看台。 3. **玩家车辆与街机驾驶** — 构建一个闭轮楔形车并克隆它。它不是开轮式赛车,也不是已知的量产车:钝头两步式车鼻、短座舱、小唇形扰流板、矩形灯、没有巨大尾翼、没有赞助商涂装。局部 +z 是车头。将网格父级设为 yaw 枢轴,使得 yaw 为 0 时车头指向世界 +x。侧裙盒 4.20 × 0.28 × 1.78,位于 y 0.36。车鼻盒 1.35 × 0.32 × 1.62,位于 z 1.25,y 0.55。车鼻尖端 0.70 × 0.18 × 1.40,位于 z 1.85,y 0.48。尾部盒 0.85 × 0.36 × 1.70,位于 z -1.55,y 0.62。座舱 1.45 × 0.55 × 1.28,位于 z -0.15,y 1.02,颜色 #241c18。挡风玻璃 0.08 × 0.42 × 1.18,绕 x 旋转 -32 度,位于 z 0.55,y 1.08,颜色 #b7d4d8,不透明度 0.55。两个扰流板支柱和一片宽 1.40 m 的翼片,位于 y 1.12。车轮上方有四个轮拱盒。车轮为 10 段圆柱体,半径 0.36,位于 x ±0.92 和 z ±1.28。轮毂 #e8d7b0。前灯自发光 #fff1cc。尾灯自发光 #d8452f。玩家车身 #c4512c,车门号码 14 绘制在 256×128 canvas 上。MeshStandardMaterial roughness 0.62 和 metalness 0.08。对手仅重新着色车身面板。 布局:在 x,z 平面上模拟。速度沿 yaw 方向加上漂移侧滑角。每帧将车辆投影到最近的中心线采样点,仅从上次命中点搜索 ±40 个采样点,使匹配不会跳跃。根据该横向偏移处的倾斜设置高度,并将网格侧倾到倾斜角。相机为透视追尾:FOV 68,低于 700 px 时为 76,后方 7.2 m,上方 2.6 m,看向前方 6 m。低于 700 px 时使用后方 9.2 m 和上方 4.0 m,使底部抽屉和拇指不会遮挡车辆。速度上限为 42 m/s,或 boost 激活时为 54 m/s。加速度为 16 m/s²,制动为 28 m/s²,倒车上限为 6 m/s。无油门时,以 3 m/s² 滑行。不要添加二次阻力,否则车辆无法追上对手。Yaw 速率从静止时的 1.6 rad/s 缓和到最高速度时的 0.5 rad/s。键盘转向为数字式,速率限制为每秒 3.5 单位。转向板为模拟式。 动效:固定步长 1/60,累加器上限 0.1 s。车轮随速度旋转,前轮最多转向 18 度。当油门按住、速度超过 18 m/s,且漂移控制按住或制动按住且转向超过 0.4,并且 boost 未激活时漂移。侧滑角向 steer 乘以 16 度移动。Boost 计量在漂移时每秒填充 0.40,否则每秒下降 0.15。达到 1 时保持待发。Shift,或在待发时松开漂移,会消耗它:以 boost 速度持续 1.2 s,然后计量为 0。尘土颗粒仅在漂移时生成。减少动效会跳过尘土和 FOV 冲击。相机位置平滑为 1 - exp(-8 dt)。 4. **对手、幽灵、门架与热场规则** — 三个对手在轨道上使用相同网格。[RIVALS] 中的顺序映射到 teal 号码 7、gold 号码 22 和 dusk blue 号码 3。生成弧长和横向:第一个 52 m 和 -2.4 m,第二个 36 m 和 +2.6 m,第三个 8 m 和 +0.4 m。玩家生成在弧长 20 m,横向 0,因此发车顺序为第一个、第二个、玩家、第三个。对手目标速度(m/s):0–180 为 34,180–460 为 27,460–700 为 32,700–860 为 18,860–1000 为 34,加速度限制为 10 m/s²。他们不漂移也不 boost。对手在其弧长向前越过 0 时完成一圈,第一次越过计为第 1 圈。每辆车的进度为已完成圈数乘以 1000 加上当前弧长。该顺序驱动 HUD 名次和领奖台。如果对手在 2.4 m 内与玩家重叠,将他们分开并将双方速度乘以 0.92。然后对手以 4 m/s 返回其横向位置。障碍物碰撞将速度乘以 0.72,将横向推离障碍物 1.2 m,并且速度绝不低于 7 m/s。冷却 0.45 s。 布局:偏离沥青路面指绝对横向距离大于 8 m:将速度上限设为 26 m/s,将加速度降至 0.45,并显示 Back on the asphalt。若该状态持续 1.2 s,或绝对横向距离超过 20 m,则重置到最后一个已通过的检查门,横向位置为 0,朝向沿切线方向,速度为 16 m/s。最后一个已通过的检查门从弧长 0 开始,随后在按顺序通过 250、500 和 750 处的检查门时依次更新。显示 Reset 持续 0.8 s,在此期间忽略障碍物碰撞。不要清除圈数标志,也不要结束比赛回合。检查门必须按顺序正向通过:先 250,再 500,再 750,最后弧长 0。在玩家首次到达弧长 40 之前,忽略弧长 0。在三个标志均已设置的情况下越过弧长 0 即完成一圈,存储该圈时间并清除标志。HUD 圈数显示为已完成圈数 + 1,上限为 3。玩家完成 3 圈时比赛回合结束。每辆车存储自己的完赛计时。未完成的对手按其在圈内的进度排在完赛者之后。逆行时,当朝向与切线方向相反持续 0.4 s,显示 Wrong way,且不重置车辆。 运动:在一圈中每 100 ms 记录玩家的世界位置和偏航角,最多 800 个采样。如果该圈为最佳圈,则保留它并写入 localStorage 键 [brand-slug]::[track-slug]::best-lap。将其作为 Coral 克隆以不透明度 0.32、自发光 Sun 为 0.15、depthWrite false、无阴影且无碰撞进行回放。每次玩家开始一圈时重新启动幽灵。首次访问且无存档时不显示幽灵。Clear ghost 会删除该键并隐藏克隆。车辆在倒计时期间保持静止。在 GO 时计时开始,输入生效。暂停、文档隐藏和领奖台会冻结计时和步进。 5. **HUD、小地图、触控和领奖台** — 比赛期间以 1st、2nd、3rd 或 4th 显示名次;从圈数计数器显示 Lap 1 / 3;当前圈时间和 Best m:ss.ss 或 Best —,使用 Share Tech Mono;速度显示为取整的 km/h 整数并带 km/h 标签,倒车时前缀为 R。时间在 10 分钟以下使用 m:ss.ss。加速标签为 BOOST。横幅一次显示一个,使用检查门名称、Back on the asphalt、Reset 或 Wrong way。如果下一名对手在 30 m 以内,则显示一行小字 Ahead: 和该对手的名字;当该对手是紧邻后方的车辆时显示 Behind:。倒计时为 3、2、1,各 700 ms,然后 GO 持续 400 ms。领奖台标题为 Heat complete。如果玩家为第一名:[DRIVER] took [TRACK]。否则:[DRIVER] finished [ordinal] at [TRACK]。四行显示名次、名字和时间。新最佳成绩会添加 New best lap 和该时间。按钮:Run it again、存在幽灵时的 Clear ghost,以及 Back to start。暂停标题为 Paused,包含 Resume、Restart 和 Controls。 布局:桌面 HUD:名次和圈数位于左上角,圈时间位于顶部中央,速度位于右上角,168 px 小地图距右下角 24 px,180×10 加速条位于底部中央。Pause 按钮至少 44 px,始终可用。低于 700 px:第一行为 Pause 和速度,第二行为名次、圈数和圈时间,小地图缩小至 104 px 并位于右上角,加速条位于触控控件正上方。触控控件仅在指针为 coarse 或宽度低于 800 px 时显示。左侧:132 px 转向板,距安全区域角落 16 px。右侧:GAS 92 px 为 Coral,BRAKE 72 px 为 Paper,DRIFT 72 px 为 Gold。小地图是 2D canvas,而非第二个 WebGL 视图:Ink 填充,2 px Gold 边框,中心线为 Gold,+x 向右、+z 向下,14% 内边距,弧长 0 处为 Paper 刻度。玩家三角形为 Coral,对手为其各自颜色的 6 px 圆点,幽灵为 Gold 圆环,下一检查门为 Paper 刻度。地图不随车辆旋转。 运动:通过检查门时显示其名称 0.7 s。加速填充使用从左开始的 scaleX。已就绪的计量条获得 Paper 边框并脉冲一次。覆盖层淡入淡出 180 ms。减少动态效果时使用即时覆盖层变化和静态满加速条。Run it again 和 Restart 在不重新加载的情况下返回同一发车格的倒计时。Back to start 返回停放的车辆。Clear ghost 可从领奖台或开始面板使用。 6. **控制、声音和回退** — 控制标题为 Controls。键盘行:W 或 Up arrow — 油门;S 或 Down arrow — 刹车;A、D 或方向键 — 转向;Space — 漂移;Shift — 加速条满时加速;R — 返回最后一个检查点;P — 暂停。触控行:左侧板转向;Gas、Brake 和 Drift 位于右侧。按钮:Back。按键:W 和 ArrowUp 油门,S 和 ArrowDown 刹车,A 和 ArrowLeft 左转,D 和 ArrowRight 右转,Space 漂移,Shift 加速,R 重置,P 或 Escape 在比赛期间暂停,Enter 激活打开的覆盖层的主按钮,Escape 关闭 Controls。阻止这些按键的默认行为,以免页面滚动。释放指针、窗口失焦或打开覆盖层会清除所有按住的键和触控,以免车辆卡住。声音默认关闭。切换显示 Sound off 或 Sound on。开启后,在该手势之后,每次计数播放 440 Hz 正弦波 80 ms,GO 时播放 660 Hz 140 ms,加速时播放 120 ms 噪声爆发,增益 0.02 的安静锯齿波引擎声其音高跟随速度,领奖台时播放 523、659 和 784 Hz 的三声短正弦波。无音频文件。如果 AudioContext 失败,保持声音关闭,并且不要记录循环错误。 布局:控制面板在桌面为 480 px,在移动端为可滚动面板,可从开始面板或暂停进入,并返回同一状态。所有控件均为真实按钮,具有可见的 2 px Gold 焦点环。canvas 具有可访问名称:Third-person race on a banked circuit at dusk。礼貌的实时区域播报圈数变化、Reset、Wrong way 和领奖台句子,而非每次速度跳动。小地图为 aria-hidden。将每个声音与可见的倒计时、横幅或领奖台配对。 运动:按住的触控按钮使用 0.96 缩放和填充按下状态,且不延迟输入。减少动态效果会移除该缩放。音频增益在 40 ms 内渐变。暂停或切换关闭时声音静音。 7. **尺寸、光照和两个视口** — 目标是在 1440×900 和 390×844 下获得干净的首帧,无水平溢出且无控制台错误。光照:半球天空 #ffd2a8 和地面 #6b5344,强度 0.5;一个方向光 #ffb067,强度 2.35,位置 (-90, 22, 40);FogExp2 颜色 #e0a06a,密度 0.011;ACES 电影色调映射,曝光 1.05;PCF 软阴影,桌面 2048,低于 800 px 为 1024,bias -0.0003。天空是一个大球体的内侧:头顶为 Zenith,地平线处为 Horizon,其下为 #c46a3a,以及与方向光对齐的柔和 #fff1cc 太阳圆盘。无星星、无夜晚、无霓虹、无 bloom composer。像素比上限为 1.75,低于 800 px 时为 1.25。如果 180 帧的平均帧时间超过 22 ms,则一次性将像素比降至 1,阴影贴图降至 1024。保留比赛回合规则。如果 WebGL 无法启动,保留开始文案并添加句子 This browser could not start the 3D view. Try a browser with WebGL enabled. 不要循环重试。 布局:在视口变化时调整渲染器和相机大小,并遵守安全区域内边距。页面本身不滚动。超出视口的面板在内部滚动。通过使用代码几何体、实例化草地和观众,以及无图像文件,将 dist 保持在 20 MB 以下。文档隐藏时停止模拟,返回时不要自动恢复;保持暂停直到 Resume 或 Start race。 运动:质量削减绝不会移除检查门、对手、幽灵或触控控件。减少动态效果独立于质量削减:比赛保持可玩,仅额外的相机和 UI 动态效果减少。 ## 资产 - 图片:不使用任何图片文件,也不生成静态图。天空、赛道、赛车、门、障碍物、树木、小屋、看台、号码牌、小屋标牌和小地图全部用代码绘制。添加一个原创的 public/favicon.svg:32 viewBox、Ink 圆角矩形,以及一个指向右侧的 Coral 五边形楔形,不含任何字母。在 ASSETS.md 中说明场景为代码绘制,并将该 favicon 列为原创。 - 图标:不要安装图标包。暂停、声音和触摸标签均为文本。转向板和加速轨道使用 CSS。在 ASSETS.md 中不要列出任何第三方图标。 - 字体:通过技术栈中指定的 Fontsource 包(OFL-1.1)自托管 Big Shoulders Display、Outfit 和 Share Tech Mono。仅导入列出的字重。在 ASSETS.md 中记录本地 woff2 文件、npm 包页面和 OFL 许可证。不要请求 fonts.googleapis.com、fonts.gstatic.com 或任何其他字体 CDN。 - 视频:不使用视频,不拍摄游戏画面,也不使用音频文件。可选声音在玩家开启 Sound 后通过 Web Audio 合成。 ## 不要做 - 不要后端、账户、数据库、分析、外部 API、多人模式或全局排行榜。最佳圈速保存在 localStorage 中,键由品牌和赛道构建。 - 不要 CDN,也不要远程资源。字体自托管,从已安装的包中导入 three,使用相对路径,并将压缩文件输出到 dist/,关闭 source map,且不将 src/ 复制到 dist/。保持 dist 在 20 MB 以下。 - 不要路由、营销区块、价格或滚动落地页。唯一的页面是 index.html,首屏是赛道上的停放车辆。 - 不要复制源提示词、一次性 HTML 页面、拍摄运行、评审笔记或试玩读数。不要显示速度 105 或分数 000749。不要提及 Agent OS、GoldieBench、AI Profit Boardroom、Grok、xAI 或 Julian Goldie。 - 不要复用源车辆轮廓、赛道布局、门设计或障碍物放置。使用此处指定的控制点、门、草捆、轮胎和锥桶。不要将热力赛变成夜间城市、悬浮车辆或打砖块游戏。 - 不要真实赛车系列、制造商、赛道、涂装、赞助商标记或真实车手。不要名人或公众人物肖像,观众不要有面孔,不要品牌标志。起点条纹是通用的墨纸色带,不是系列标识。 - 不要下载的模型、HDRI、纹理包、库存照片、占位图服务、物理引擎或后处理泛光。几何体和天空保持在代码中。 - 不要商业字体,也不要字体 CDN。不要在 src/content.ts 之外硬编码 Pennyglass、Wickpenny、Barleycut、Skiff 4、Nell Harp 或默认对手,不要在屏幕上留下原始变量令牌。 - 不要编造日期、报名费、在线玩家数量或任何关于 VibeFather 的声明。VibeFather 的唯一存在是可选的 [CREDIT] 链接。 - 不要自动播放音频、镜头抖动、全屏闪烁或永久停滞。偏离赛道会减慢车辆,然后将其重置到最后一个门。尊重 prefers-reduced-motion,但不禁用比赛。 - 不要在暂停、隐藏或在领奖台时让时钟继续运行。焦点丢失时清除卡住的输入。在 390×844 下,转向板、踏板、小地图和开始表都必须可用,无水平溢出且无控制台错误。 - 如果 WebGL 失败,显示可读的回退句子,不要在循环中抛出异常。如果帧运行时间过长,降低一次像素比和阴影贴图,并保留圈速规则、对手、幽灵和控制。 --- Inspired by Grok 4.7 In The Agent OS: 20 Games, One Shot, Real Scores by @JulianGoldieSEO — https://agentos.guide/grok-4-7-agent-os — Prompt by VibeFather · https://vibefather.ai/t/dusk-track-racing-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: "Dusk Track Racing Game"
colors:
ink: "#1c1612"
paper: "#f6f1e7"
coral: "#c4512c"
gold: "#e7c27a"
sun: "#ffb067"
horizon: "#e7a15a"
zenith: "#1e3a5f"
asphalt: "#3a342e"
runoff: "#6b5344"
grass: "#6d7a45"
pine: "#3e5340"
teal: "#2f6f62"
rival_gold: "#d7a441"
dusk_blue: "#3d4c7a"
danger: "#d8452f"
typography:
club_name_position_speed_and_podium_place: { family: "Big Shoulders Display", weights: [500, 700, 800] }
body_buttons_and_hud_labels: { family: "Outfit", weights: [400, 500, 600] }
lap_times: { family: "Share Tech Mono", weights: [400] }
spacing: "4 px base. Desktop panel padding 28 px and HUD inset 20 px. Mobile inset 14 px plus safe-area. Buttons at least 44 px, coarse-pointer controls at least 72 px. The start sheet on a phone stays within 58 vh and scrolls inside itself."
radius: "18 px on the start, pause, and podium panels. Pill buttons. The minimap and steer pad are circles. The boost track is a 999 px capsule. World meshes stay faceted, not filleted like UI."
---
# Dusk Track Racing 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
- **Ink** `#1c1612` — Panels, minimap fill, car roof, tire rubber, start-stripe dark squares
- **Paper** `#f6f1e7` — Text on ink, edge lines, start-stripe light squares, focus rings
- **Coral** `#c4512c` — Player body, primary buttons, player minimap triangle
- **Gold** `#e7c27a` — Center dashes, boost fill, minimap ribbon, drift button
- **Sun** `#ffb067` — Directional light, gate veil, ghost emissive, boost glow
- **Horizon** `#e7a15a` — Sky horizon band and fog tint
- **Zenith** `#1e3a5f` — Sky top and the page background behind the canvas
- **Asphalt** `#3a342e` — Racing surface
- **Runoff** `#6b5344` — Dirt shoulders
- **Grass** `#6d7a45` — Ground plane beyond the runoff
- **Pine** `#3e5340` — Tree cones
- **Teal** `#2f6f62` — First rival
- **Rival gold** `#d7a441` — Second rival
- **Dusk blue** `#3d4c7a` — Third rival
- **Danger** `#d8452f` — Taillights, wrong-way banner, red start lamps
## Typography
- **Club name, position, speed, and podium place** — Big Shoulders Display (OFL), weights 500/700/800. Self-host the font files.
- **Body, buttons, and HUD labels** — Outfit (OFL), weights 400/500/600. Self-host the font files.
- **Lap times** — Share Tech Mono (OFL), weights 400. Self-host the font files.
## Spacing & shape
- Spacing: 4 px base. Desktop panel padding 28 px and HUD inset 20 px. Mobile inset 14 px plus safe-area. Buttons at least 44 px, coarse-pointer controls at least 72 px. The start sheet on a phone stays within 58 vh and scrolls inside itself.
- Radius: 18 px on the start, pause, and podium panels. Pill buttons. The minimap and steer pad are circles. The boost track is a 999 px capsule. World meshes stay faceted, not filleted like UI.
## Motion
- Chase camera eases with exponential smoothing and may roll up to 4 degrees against the steer. A boost widens FOV by 6 degrees for 1.2 seconds.
- Countdown numerals use a 160 ms scale from 0.92 to 1. Drift dust is 12 short-lived specks. The armed boost bar pulses once.
- Overlays fade over 180 ms and move no more than 8 px. Checkpoint callouts last 0.7 seconds.
- prefers-reduced-motion removes roll, FOV kick, dust, pulses, overlay travel, and countdown scale. The race, ghost, and rivals still move, because that motion is the game.
## Imagery
Draw the whole world in Three.js: sky shader, banked ribbon, closed-wheel wedge, gates, bales, tires, cones, pines, hills, a hut, and a grandstand of featureless box spectators. No photographs, generated images, HDRIs, downloaded models, or brand marks. Golden-hour light is one low warm sun and long shadows. The parked car on the ribbon is the first-screen anchor, with the start panel beside it rather than instead of it.
## Tone
Warm, plain, and specific. US English. Club-heat language, no taunts, no military wording, and no real series, manufacturers, or drivers.
---
Inspired by Grok 4.7 In The Agent OS: 20 Games, One Shot, Real Scores by @JulianGoldieSEO — https://agentos.guide/grok-4-7-agent-os
— Prompt by VibeFather · https://vibefather.ai/t/dusk-track-racing-game · CC BY-NC 4.0 (non-commercial; commercial use needs a VibeFather Pro license) · Request removal: https://vibefather.ai/takedown
改成你自己的
- 本地卡丁车俱乐部:将 BRAND 设为俱乐部,PLACE 设为城镇,TRACK 设为赛道,然后将 DRIVER 和 RIVALS 换成领奖台上成员的名字。
- 工作室作品集项目:保留黄昏赛道,将 BRAND 设为你的工作室名称,用 CAR 和 DRIVER 注明项目和构建者。
- 生日或派对游戏:用主人的名字命名 BRAND,将 RIVALS 设为宾客,保留三圈比赛作为笔记本电脑或手机上的主要活动。
- 游戏开发竞赛作品:保留倾斜赛道和漂移加速,重命名 TRACK 和三名对手以契合主题,并发布静态构建作为可玩演示。
黄昏赛道竞速游戏:常见问题
在不改动 3D 代码的情况下,我可以在黄昏赛道竞速游戏中修改哪些内容?
黄昏赛道竞速游戏模板将所有名称和标签放在一个内容文件中。将 BRAND 设为你的俱乐部,PLACE 设为山脊,TRACK 设为赛道,CAR 设为赛车名称,DRIVER 设为玩家,RIVALS 设为三个逗号分隔的名字。这些值会重写开始面板、赛道旁标牌、领奖台和保存圈速的键,而赛道、门、速度和 HUD 保持不变。
黄昏赛道竞速游戏中的幽灵圈和最佳圈速保存是如何工作的?
黄昏赛道竞速游戏会将你的最佳圈速保存在浏览器中,并在后续比赛中以半透明幽灵回放。保存键由小写的品牌名和赛道名构成,因此更改 BRAND 或 TRACK 会重新开始最佳圈速和幽灵。成绩不会离开浏览器,没有账户或后端。
怎么用 AI 做一个黄昏赛道竞速游戏?
复制本页的提示词,或者运行 npx vibefather add dusk-track-racing-game,把 [CAR]、[BRAND]、[PLACE]、[TRACK] 换成你自己的内容,再粘贴到 Claude Code、Codex、Cursor 等 AI 编程工具里。在线演示就是用这份提示词原样做出来的。