lookbkdev/lookbk-skills / skills/snow-globe-hero
snow-globe-hero
VerifiedBuild a website hero that is one still-life photograph of a glass snow globe on a stone plinth, ray traced in the browser - thick glass with Fresnel and total internal reflection, a water core that magnifies a handmade miniature, a caustic on the ledge - with the headline cut into the plinth as a V-cut inscription filled with paint or gilt and lit by the same light. Every loop the globe is shaken, flakes or glitter swirl, glint and settle, and the room goes still. Two art-directed sets on the editorial composition: a winter café in low sun, and a night observatory in moonlight with gold glitter. One self-contained HTML page plus a paste-in embed on the Motion Heroes kit v2, checked at four widths for text size, contrast and clearance, with a baked still picture if WebGL fails and a frame-exact seamless 14 s 1080p MP4. Use for cafés, bakeries, hotels, observatories, shops, gifts, seasonal launches or any brand that wants one quiet, real object instead of a decorated layout.
| File | Kind | Size |
|---|---|---|
| NOTICE.md | markdown | 1.3 KB |
| SKILL.md | skill md | 10.2 KB |
| TESTED.json | config | 767 B |
| assets/cafe-tall.webp | binary | 26.7 KB |
| assets/cafe-wide.webp | binary | 17.5 KB |
| assets/observatory-tall.webp | binary | 26.7 KB |
| assets/observatory-wide.webp | binary | 17.5 KB |
| examples/alder/hero.json | config | 1.5 KB |
| examples/pell-ridge/hero.json | config | 1.6 KB |
| scripts/build.mjs | script | 263 B |
| scripts/check.mjs | script | 179 B |
| scripts/chrome.mjs | script | 3.6 KB |
| scripts/color.mjs | script | 1.4 KB |
| scripts/effect/effect.js | script | 79.2 KB |
| scripts/effect/effect.mjs | script | 6.0 KB |
| scripts/inline.mjs | script | 1.7 KB |
| scripts/kit/KIT.md | markdown | 13.7 KB |
| scripts/kit/build.mjs | script | 47.4 KB |
| scripts/kit/cdp.mjs | script | 5.1 KB |
| scripts/kit/check.mjs | script | 15.7 KB |
| scripts/kit/fonts.json | config | 5.4 KB |
| scripts/kit/record.mjs | script | 8.1 KB |
| scripts/kit/runtime.js | script | 22.5 KB |
| scripts/kit/shell.css | other | 18.7 KB |
| scripts/kit/three.json | config | 6.3 KB |
| scripts/markup.mjs | script | 6.2 KB |
| scripts/record.mjs | script | 255 B |
| scripts/screenshot.mjs | script | 1.8 KB |
scripts/effect/effect.mjs
View on GitHub// Snow Globe: the effect description the Motion Heroes kit (v2) reads at
// build time. The drawing itself is effect.js (runs in the browser).
//
// Editorial composition, headline cut into the scene (typeMode "scene"): a
// glass snow globe on a turned base stands on a stone plinth by a window;
// the headline is a V-cut inscription filled with paint in the plinth’s
// front face, lit by the same light that throws the globe's shadow and
// caustic. Every loop the globe is shaken, the liquid swirls, the flakes
// settle and the room goes still again.
//
// Raw WebGL1, no libraries. The still picture (before the first frame, and
// if WebGL fails) is a baked photograph of the set without the inscription,
// shipped in assets/, with the page's own headline over it in theme.ink.
import { contrast, mix } from '../color.mjs'
const STILL = 0
export default {
id: 'snow-globe',
name: 'Snow Globe',
needs: 'webgl',
cssPrefix: 'sgh',
compositions: ['editorial'],
typeMode: 'scene',
stillTime: STILL,
posterTime: STILL,
assets: ['assets/cafe-wide.webp', 'assets/cafe-tall.webp', 'assets/observatory-wide.webp', 'assets/observatory-tall.webp'],
css: '.sgh-pic.sgh-tall{display:none}@media (max-width:759px){.sgh-pic.sgh-wide{display:none}.sgh-pic.sgh-tall{display:block}}',
params: {
scene: { type: 'enum', values: ['cafe', 'observatory'], default: ({ theme }) => (theme.mode === 'dark' ? 'observatory' : 'cafe'), doc: 'The miniature inside the glass, and the light that goes with it: a small café with lit windows, firs, a lamp post and a figure, under a low sun through a side window; or an observatory with its dome open, a fir and a figure looking up, in one shaft of moonlight' },
flakeKind: { type: 'enum', values: ['snow', 'glitter'], default: ({ theme }) => (theme.mode === 'dark' ? 'glitter' : 'snow'), doc: 'Flat white flakes, or gold and silver glitter that flashes as it turns' },
flakes: { type: 'integer', min: 60, max: 320, default: 220, doc: 'How many flakes or glitter pieces are in the liquid' },
wall: { type: 'color', default: ({ theme }) => mix(theme.background, theme.ink, 0.06), doc: 'The wall behind, as it looks in the shade' },
stone: { type: 'color', default: ({ theme }) => theme.background, doc: 'The plinth’s front face (where the headline is cut), as it looks in the shade' },
ledge: { type: 'color', default: ({ theme }) => mix(theme.background, '#ffffff', 0.06), doc: 'The plinth’s top, as it looks in the shade' },
paint: { type: 'color', default: ({ theme }) => theme.ink, doc: 'The paint (or gilt) that fills the cut letters' },
sun: { type: 'color', default: ({ theme }) => (theme.mode === 'dark' ? '#b8c8ff' : '#ffe1b8'), doc: 'The key light: a low sun through a side window, or the moon through the dome’s slit' },
sunStrength: { type: 'number', min: 0.5, max: 3, default: 1.5, doc: 'How bright the key is against the fill' },
fill: { type: 'color', default: ({ theme }) => (theme.mode === 'dark' ? '#525a6a' : '#c6cdd8'), doc: 'The cool fill from the room' },
base: { type: 'enum', values: ['walnut', 'ebony'], default: ({ theme }) => (theme.mode === 'dark' ? 'ebony' : 'walnut'), doc: 'The turned base, under lacquer, with a brass ring' },
lipLight: { type: 'number', min: 0, max: 2, default: ({ theme }) => (theme.mode === 'dark' ? 1.25 : 0), doc: 'A warm strip light hidden under the ledge’s lip that grazes down the face and the letters (the night set needs it; 0 for none)' },
polish: { type: 'number', min: 0, max: 1, default: ({ theme }) => (theme.mode === 'dark' ? 0.9 : 0), doc: 'How polished the plinth’s top is: 0 is honed stone, 1 a black mirror that reflects the globe and the base' },
cycle: { type: 'number', min: 12, max: 20, default: 14, doc: 'Seconds for one loop: hold, shake, swirl, settle, hold' },
shakeAt: { type: 'number', min: 0.5, max: 4, default: 2.2, doc: 'Seconds into the loop when the globe is shaken (the loop starts on a settled hold)' },
shake: { type: 'number', min: 0.4, max: 1.4, default: 1, doc: 'How hard the globe is shaken: the jolt, the slosh of the surface and the swirl' },
follow: { type: 'boolean', default: true, doc: 'On a live page a quick move across the globe, or a press on it, shakes it (once the snow has settled)' },
grain: { type: 'number', min: 0, max: 1, default: 0.5, doc: 'A fixed grain (about 1% at 0.5), the same on every frame so the loop closes' },
},
check(p, theme, problems) {
const r = contrast(p.paint, p.stone)
if (r < 3) problems.push(`effect.paint ${p.paint} on effect.stone ${p.stone} is ${r.toFixed(1)}:1; the cut letters need 3:1 (darker paint on light stone, or gilt on dark)`)
if (p.polish > 0.2 && p.scene === 'cafe' && theme.mode === 'light') problems.push('effect.polish is for the dark stone of the night set; honed limestone (polish 0) suits the café')
},
/** The letters the effect cuts: in the fill, and where the light reaches the face. */
typeGrounds(p, theme) {
const lit = theme.mode === 'dark' ? mix(p.stone, '#c99a5e', 0.18) : mix(p.stone, '#ffffff', 0.3)
return [
{ fg: p.paint, bg: p.stone },
{ fg: p.paint, bg: lit },
]
},
notes(p) {
const n = []
if (p.flakes > 260) n.push('more than 260 flakes reads as a blizzard; 180 to 240 settles into visible drifts')
return n
},
/** Before the first frame (and if WebGL fails): a baked photograph of the set, wide or tall; the page's headline shows over it in theme.ink. */
still(p, theme) {
const name = p.scene === 'observatory' ? 'observatory' : 'cafe'
const pic = (cls, file, w, h, par) =>
`<svg class="sgh-pic ${cls}" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 ${w} ${h}" preserveAspectRatio="${par}"><rect width="${w}" height="${h}" fill="${p.stone}"/><image href="assets/${file}" xlink:href="assets/${file}" width="${w}" height="${h}" preserveAspectRatio="${par}"/></svg>`
return {
backdrop: pic('sgh-wide', `${name}-wide.webp`, 1440, 900, 'xMidYMax slice') + pic('sgh-tall', `${name}-tall.webp`, 390, 844, 'xMidYMax slice'),
}
},
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |