@arraypress/effects-astro 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +85 -0
- package/COMPONENTS.md +1264 -0
- package/LICENSE +139 -0
- package/README.md +197 -2
- package/package.json +60 -4
- package/src/components/AsciiRain.astro +36 -0
- package/src/components/BorderSweep.astro +39 -0
- package/src/components/Caustics.astro +39 -0
- package/src/components/ColorPanels.astro +62 -0
- package/src/components/Cursor.astro +97 -0
- package/src/components/DotGrid.astro +34 -0
- package/src/components/DotSurface.astro +35 -0
- package/src/components/EffectCanvas.astro +152 -0
- package/src/components/FitText.astro +35 -0
- package/src/components/FlutedGlass.astro +36 -0
- package/src/components/Glass.astro +69 -0
- package/src/components/GlassGlyph.astro +38 -0
- package/src/components/GlowField.astro +177 -0
- package/src/components/Grain.astro +98 -0
- package/src/components/HaloRing.astro +38 -0
- package/src/components/HighlightSweep.astro +74 -0
- package/src/components/ImageRipple.astro +56 -0
- package/src/components/Ink.astro +37 -0
- package/src/components/InkField.astro +45 -0
- package/src/components/IsoCity.astro +54 -0
- package/src/components/LightField.astro +40 -0
- package/src/components/LiquidMetal.astro +41 -0
- package/src/components/Magnetic.astro +52 -0
- package/src/components/Marquee.astro +216 -0
- package/src/components/MosaicReveal.astro +196 -0
- package/src/components/NebulaLogo.astro +38 -0
- package/src/components/NeonSwarm.astro +38 -0
- package/src/components/Ocean.astro +40 -0
- package/src/components/OutlineWordmark.astro +222 -0
- package/src/components/PaperBackground.astro +40 -0
- package/src/components/PaperShader.astro +55 -0
- package/src/components/Parallax.astro +49 -0
- package/src/components/ParticleLogo.astro +37 -0
- package/src/components/PixelGlitchText.astro +70 -0
- package/src/components/PointCloud.astro +37 -0
- package/src/components/ProductStack.astro +298 -0
- package/src/components/PulseMark.astro +189 -0
- package/src/components/RadiantGlass.astro +38 -0
- package/src/components/RainOnGlass.astro +71 -0
- package/src/components/Reveal.astro +115 -0
- package/src/components/ScrambleText.astro +52 -0
- package/src/components/ScrollReveal.astro +38 -0
- package/src/components/ShaderBackground.astro +55 -0
- package/src/components/SignalLines.astro +41 -0
- package/src/components/SilkRibbon.astro +37 -0
- package/src/components/SpotlightText.astro +131 -0
- package/src/components/Tilt.astro +79 -0
- package/src/components/Topography.astro +38 -0
- package/src/components/Typewriter.astro +66 -0
- package/src/components/VariableType.astro +59 -0
- package/src/components/VoxelLogo.astro +46 -0
- package/src/components/WaveBars.astro +41 -0
- package/src/components/WorldRoutes.astro +41 -0
- package/src/components/style.js +19 -0
- package/src/index.d.ts +143 -0
- package/src/index.js +105 -0
- package/src/runtime/ascii-rain.d.ts +53 -0
- package/src/runtime/ascii-rain.js +355 -0
- package/src/runtime/audio-meter.d.ts +65 -0
- package/src/runtime/audio-meter.js +282 -0
- package/src/runtime/audio.d.ts +26 -0
- package/src/runtime/audio.js +453 -0
- package/src/runtime/blur.d.ts +2 -0
- package/src/runtime/blur.js +56 -0
- package/src/runtime/canvas2d.d.ts +23 -0
- package/src/runtime/canvas2d.js +105 -0
- package/src/runtime/caustics.d.ts +40 -0
- package/src/runtime/caustics.js +286 -0
- package/src/runtime/color.d.ts +33 -0
- package/src/runtime/color.js +213 -0
- package/src/runtime/curl.d.ts +5 -0
- package/src/runtime/curl.js +81 -0
- package/src/runtime/cursor.d.ts +9 -0
- package/src/runtime/cursor.js +80 -0
- package/src/runtime/device.d.ts +14 -0
- package/src/runtime/device.js +73 -0
- package/src/runtime/dot-grid.d.ts +27 -0
- package/src/runtime/dot-grid.js +245 -0
- package/src/runtime/dot-surface.d.ts +46 -0
- package/src/runtime/dot-surface.js +429 -0
- package/src/runtime/feedback.d.ts +18 -0
- package/src/runtime/feedback.js +131 -0
- package/src/runtime/fit-text.d.ts +5 -0
- package/src/runtime/fit-text.js +60 -0
- package/src/runtime/fluid.d.ts +55 -0
- package/src/runtime/fluid.js +504 -0
- package/src/runtime/fluted-glass.d.ts +27 -0
- package/src/runtime/fluted-glass.js +157 -0
- package/src/runtime/gl.d.ts +19 -0
- package/src/runtime/gl.js +104 -0
- package/src/runtime/glass-glyph.d.ts +49 -0
- package/src/runtime/glass-glyph.js +355 -0
- package/src/runtime/glass-sheen.d.ts +2 -0
- package/src/runtime/glass-sheen.js +30 -0
- package/src/runtime/glsl.d.ts +17 -0
- package/src/runtime/glsl.js +78 -0
- package/src/runtime/glyphs.d.ts +22 -0
- package/src/runtime/glyphs.js +107 -0
- package/src/runtime/halo-ring.d.ts +47 -0
- package/src/runtime/halo-ring.js +334 -0
- package/src/runtime/height-field.d.ts +50 -0
- package/src/runtime/height-field.js +176 -0
- package/src/runtime/image-ripple.d.ts +25 -0
- package/src/runtime/image-ripple.js +353 -0
- package/src/runtime/image.d.ts +11 -0
- package/src/runtime/image.js +81 -0
- package/src/runtime/in-view.d.ts +6 -0
- package/src/runtime/in-view.js +36 -0
- package/src/runtime/ink-field/shaders.js +258 -0
- package/src/runtime/ink-field/sim.js +582 -0
- package/src/runtime/ink-field.d.ts +39 -0
- package/src/runtime/ink-field.js +311 -0
- package/src/runtime/ink.d.ts +31 -0
- package/src/runtime/ink.js +109 -0
- package/src/runtime/instancing.d.ts +12 -0
- package/src/runtime/instancing.js +37 -0
- package/src/runtime/iso-camera.d.ts +35 -0
- package/src/runtime/iso-camera.js +85 -0
- package/src/runtime/iso-city/figures.d.ts +30 -0
- package/src/runtime/iso-city/figures.js +136 -0
- package/src/runtime/iso-city/look.d.ts +34 -0
- package/src/runtime/iso-city/look.js +105 -0
- package/src/runtime/iso-city/plan.d.ts +59 -0
- package/src/runtime/iso-city/plan.js +463 -0
- package/src/runtime/iso-city/roads.d.ts +64 -0
- package/src/runtime/iso-city/roads.js +320 -0
- package/src/runtime/iso-city/scene.d.ts +27 -0
- package/src/runtime/iso-city/scene.js +432 -0
- package/src/runtime/iso-city/shaders.d.ts +6 -0
- package/src/runtime/iso-city/shaders.js +233 -0
- package/src/runtime/iso-city/shadows.d.ts +13 -0
- package/src/runtime/iso-city/shadows.js +148 -0
- package/src/runtime/iso-city/traffic.d.ts +80 -0
- package/src/runtime/iso-city/traffic.js +457 -0
- package/src/runtime/iso-city.d.ts +37 -0
- package/src/runtime/iso-city.js +458 -0
- package/src/runtime/lens-map.d.ts +11 -0
- package/src/runtime/lens-map.js +146 -0
- package/src/runtime/light-field.d.ts +29 -0
- package/src/runtime/light-field.js +292 -0
- package/src/runtime/liquid-glass.d.ts +48 -0
- package/src/runtime/liquid-glass.js +423 -0
- package/src/runtime/liquid-metal/beads.js +217 -0
- package/src/runtime/liquid-metal/field.js +88 -0
- package/src/runtime/liquid-metal/look.js +64 -0
- package/src/runtime/liquid-metal/shaders.js +255 -0
- package/src/runtime/liquid-metal/wave.js +53 -0
- package/src/runtime/liquid-metal.d.ts +46 -0
- package/src/runtime/liquid-metal.js +366 -0
- package/src/runtime/loop.d.ts +7 -0
- package/src/runtime/loop.js +112 -0
- package/src/runtime/magnetic.d.ts +9 -0
- package/src/runtime/magnetic.js +46 -0
- package/src/runtime/marquee.d.ts +2 -0
- package/src/runtime/marquee.js +27 -0
- package/src/runtime/mesh.d.ts +30 -0
- package/src/runtime/mesh.js +217 -0
- package/src/runtime/mosaic-reveal.d.ts +34 -0
- package/src/runtime/mosaic-reveal.js +504 -0
- package/src/runtime/motion.d.ts +2 -0
- package/src/runtime/motion.js +21 -0
- package/src/runtime/mount.d.ts +13 -0
- package/src/runtime/mount.js +120 -0
- package/src/runtime/nebula-logo.d.ts +31 -0
- package/src/runtime/nebula-logo.js +282 -0
- package/src/runtime/neon-swarm.d.ts +31 -0
- package/src/runtime/neon-swarm.js +258 -0
- package/src/runtime/ocean/presets.d.ts +54 -0
- package/src/runtime/ocean/presets.js +184 -0
- package/src/runtime/ocean/shader.d.ts +14 -0
- package/src/runtime/ocean/shader.js +389 -0
- package/src/runtime/ocean/view.d.ts +24 -0
- package/src/runtime/ocean/view.js +98 -0
- package/src/runtime/ocean/waves.d.ts +29 -0
- package/src/runtime/ocean/waves.js +119 -0
- package/src/runtime/ocean.d.ts +31 -0
- package/src/runtime/ocean.js +173 -0
- package/src/runtime/palettes.d.ts +37 -0
- package/src/runtime/palettes.js +75 -0
- package/src/runtime/paper-look.d.ts +42 -0
- package/src/runtime/paper-look.js +91 -0
- package/src/runtime/paper-looks.d.ts +17 -0
- package/src/runtime/paper-looks.js +21 -0
- package/src/runtime/paper.d.ts +37 -0
- package/src/runtime/paper.js +285 -0
- package/src/runtime/particle-logo.d.ts +31 -0
- package/src/runtime/particle-logo.js +196 -0
- package/src/runtime/ping-pong.d.ts +43 -0
- package/src/runtime/ping-pong.js +175 -0
- package/src/runtime/pixel-glitch.d.ts +17 -0
- package/src/runtime/pixel-glitch.js +287 -0
- package/src/runtime/point-cloud.d.ts +33 -0
- package/src/runtime/point-cloud.js +287 -0
- package/src/runtime/pointer.d.ts +27 -0
- package/src/runtime/pointer.js +128 -0
- package/src/runtime/points.d.ts +25 -0
- package/src/runtime/points.js +130 -0
- package/src/runtime/pools.d.ts +2 -0
- package/src/runtime/pools.js +25 -0
- package/src/runtime/product-stack.d.ts +24 -0
- package/src/runtime/product-stack.js +210 -0
- package/src/runtime/radiant-glass.d.ts +29 -0
- package/src/runtime/radiant-glass.js +282 -0
- package/src/runtime/rain-on-glass/backdrop.d.ts +22 -0
- package/src/runtime/rain-on-glass/backdrop.js +185 -0
- package/src/runtime/rain-on-glass/shader.d.ts +2 -0
- package/src/runtime/rain-on-glass/shader.js +168 -0
- package/src/runtime/rain-on-glass/wipe.d.ts +16 -0
- package/src/runtime/rain-on-glass/wipe.js +65 -0
- package/src/runtime/rain-on-glass.d.ts +27 -0
- package/src/runtime/rain-on-glass.js +210 -0
- package/src/runtime/ramp.d.ts +2 -0
- package/src/runtime/ramp.js +30 -0
- package/src/runtime/random.d.ts +2 -0
- package/src/runtime/random.js +22 -0
- package/src/runtime/scroll-reveal.d.ts +22 -0
- package/src/runtime/scroll-reveal.js +73 -0
- package/src/runtime/shader-background.d.ts +42 -0
- package/src/runtime/shader-background.js +261 -0
- package/src/runtime/shader-backgrounds/band-lens.js +72 -0
- package/src/runtime/shader-backgrounds/common.js +53 -0
- package/src/runtime/shader-backgrounds/grain-gradient.js +87 -0
- package/src/runtime/shader-backgrounds/grid.js +33 -0
- package/src/runtime/shader-backgrounds/mesh-gradient.js +74 -0
- package/src/runtime/shader-backgrounds/silk.js +57 -0
- package/src/runtime/shader-backgrounds/waves.js +31 -0
- package/src/runtime/shape.d.ts +42 -0
- package/src/runtime/shape.js +313 -0
- package/src/runtime/silk-ribbon.d.ts +23 -0
- package/src/runtime/silk-ribbon.js +206 -0
- package/src/runtime/slideshow.d.ts +27 -0
- package/src/runtime/slideshow.js +234 -0
- package/src/runtime/spotlight.d.ts +9 -0
- package/src/runtime/spotlight.js +97 -0
- package/src/runtime/stack-poses.d.ts +53 -0
- package/src/runtime/stack-poses.js +273 -0
- package/src/runtime/stage.d.ts +47 -0
- package/src/runtime/stage.js +187 -0
- package/src/runtime/swarm.d.ts +49 -0
- package/src/runtime/swarm.js +199 -0
- package/src/runtime/text-motion.d.ts +41 -0
- package/src/runtime/text-motion.js +165 -0
- package/src/runtime/text.d.ts +11 -0
- package/src/runtime/text.js +90 -0
- package/src/runtime/tilt.d.ts +19 -0
- package/src/runtime/tilt.js +116 -0
- package/src/runtime/topography.d.ts +71 -0
- package/src/runtime/topography.js +650 -0
- package/src/runtime/trackers.d.ts +21 -0
- package/src/runtime/trackers.js +76 -0
- package/src/runtime/variable-type.d.ts +43 -0
- package/src/runtime/variable-type.js +358 -0
- package/src/runtime/voxel-logo.d.ts +31 -0
- package/src/runtime/voxel-logo.js +237 -0
- package/src/runtime/waves.d.ts +70 -0
- package/src/runtime/waves.js +799 -0
- package/src/runtime/world-labels.d.ts +29 -0
- package/src/runtime/world-labels.js +59 -0
- package/src/runtime/world-land.d.ts +8 -0
- package/src/runtime/world-land.js +105 -0
- package/src/runtime/world-map.d.ts +69 -0
- package/src/runtime/world-map.js +308 -0
- package/src/runtime/world-plan.d.ts +101 -0
- package/src/runtime/world-plan.js +333 -0
- package/src/runtime/world-routes.d.ts +75 -0
- package/src/runtime/world-routes.js +673 -0
- package/src/styles/border-sweep.css +82 -0
- package/src/styles/glass.css +104 -0
- package/src/styles/motion.css +218 -0
- package/src/styles/reveal.css +51 -0
- package/src/vendor/paper/LICENSE +201 -0
- package/src/vendor/paper/NOTICE +5 -0
- package/src/vendor/paper/README.md +8 -0
- package/src/vendor/paper/get-shader-color-from-string.js +100 -0
- package/src/vendor/paper/get-shader-noise-texture.js +17 -0
- package/src/vendor/paper/presets.js +3678 -0
- package/src/vendor/paper/shader-sizing.js +37 -0
- package/src/vendor/paper/shader-utils.js +130 -0
- package/src/vendor/paper/shaders/color-panels.js +223 -0
- package/src/vendor/paper/shaders/dithering.js +270 -0
- package/src/vendor/paper/shaders/dot-grid.js +109 -0
- package/src/vendor/paper/shaders/dot-orbit.js +122 -0
- package/src/vendor/paper/shaders/fluted-glass.js +360 -0
- package/src/vendor/paper/shaders/gem-smoke.js +572 -0
- package/src/vendor/paper/shaders/god-rays.js +132 -0
- package/src/vendor/paper/shaders/grain-gradient.js +300 -0
- package/src/vendor/paper/shaders/halftone-cmyk.js +294 -0
- package/src/vendor/paper/shaders/halftone-dots.js +320 -0
- package/src/vendor/paper/shaders/heatmap.js +383 -0
- package/src/vendor/paper/shaders/image-dithering.js +198 -0
- package/src/vendor/paper/shaders/lens-distortion.js +275 -0
- package/src/vendor/paper/shaders/liquid-metal.js +632 -0
- package/src/vendor/paper/shaders/mesh-gradient.js +130 -0
- package/src/vendor/paper/shaders/metaballs.js +110 -0
- package/src/vendor/paper/shaders/neuro-noise.js +76 -0
- package/src/vendor/paper/shaders/paper-texture.js +526 -0
- package/src/vendor/paper/shaders/perlin-noise.js +166 -0
- package/src/vendor/paper/shaders/pulsing-border.js +238 -0
- package/src/vendor/paper/shaders/simplex-noise.js +91 -0
- package/src/vendor/paper/shaders/smoke-ring.js +132 -0
- package/src/vendor/paper/shaders/spiral.js +82 -0
- package/src/vendor/paper/shaders/static-mesh-gradient.js +130 -0
- package/src/vendor/paper/shaders/static-radial-gradient.js +187 -0
- package/src/vendor/paper/shaders/swirl.js +103 -0
- package/src/vendor/paper/shaders/voronoi.js +138 -0
- package/src/vendor/paper/shaders/warp.js +129 -0
- package/src/vendor/paper/shaders/water.js +121 -0
- package/src/vendor/paper/shaders/waves.js +65 -0
- package/src/vendor/paper/vertex-shader.js +159 -0
package/COMPONENTS.md
ADDED
|
@@ -0,0 +1,1264 @@
|
|
|
1
|
+
# Components
|
|
2
|
+
|
|
3
|
+
Every component in `@arraypress/effects-astro`, with every prop. Generated from the components' own types by `node scripts/components-doc.mjs`; do not edit by hand.
|
|
4
|
+
|
|
5
|
+
Import each from its own path: `import Name from '@arraypress/effects-astro/Name.astro'`.
|
|
6
|
+
|
|
7
|
+
## `<AsciiRain>`
|
|
8
|
+
|
|
9
|
+
AsciiRain: data rain on a rippling surface, drawn in text characters, with red and blue fringes at the glyph edges. The pointer ripples the surface and a click sends a ring out. See src/runtime/ascii-rain.js.
|
|
10
|
+
|
|
11
|
+
```astro
|
|
12
|
+
<section class="hero" style="position: relative; background: #000">
|
|
13
|
+
<AsciiRain colors={['#6d28d9', '#2563eb', '#22d3ee']} quiet={{ x: 0.25, y: 0.4, radius: 0.6 }} />
|
|
14
|
+
<h1>…</h1>
|
|
15
|
+
</section>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
| Prop | Type | |
|
|
19
|
+
|---|---|---|
|
|
20
|
+
| `colors` | `string[]` | Three CSS hex colours the glyphs take, the brightest nearly white. Default a cool cyan and green. |
|
|
21
|
+
| `palette` | `PaletteName \| (string & {})` | A shared palette by name (`PALETTES`, any case), when there are no `colors`. |
|
|
22
|
+
| `glitch` | `number` | How often rows jump sideways for a moment, their colours splitting wider; 0 for never. Default 1. |
|
|
23
|
+
| `glyphs` | `string` | A character set (`data`: hollow and solid bars; `bars`, `ascii`, `blocks`, `binary`, `boxes`) or the characters, darkest first. Default `data`. |
|
|
24
|
+
| `cell` | `number` | A character cell's height in CSS px. Default 14. |
|
|
25
|
+
| `aspect` | `number` | A cell's width over its height. Default 1 for `data`, 0.6 for type. |
|
|
26
|
+
| `angle` | `number` | Which way the streaks run, degrees: 0 rightwards, 90 down, 180 left, 270 up. Default 0. |
|
|
27
|
+
| `lines` | `number` | Streak lanes across the surface. Default 40. |
|
|
28
|
+
| `trail` | `number` | A streak's length, a share of the gap between them (0–1). Default 0.3. |
|
|
29
|
+
| `density` | `number` | How many lanes have a streak at any time, 0–1. Default 0.7. |
|
|
30
|
+
| `width` | `number` | A lane's streak width, a share of the lane (0–1). Default 0.9. |
|
|
31
|
+
| `pattern` | `'cloud' \| 'waves'` | A still cloud of data, or streaks running on a rippling surface. Default `cloud`. |
|
|
32
|
+
| `speed` | `number` | How fast it moves: the rows stream, or the streaks run; 0 for one still frame. Default 1. |
|
|
33
|
+
| `variance` | `number` | How much each lane's speed differs, 0–1. Default 0.6. |
|
|
34
|
+
| `ripple` | `number` | How tall the surface's waves are; 0 for flat. Default 1. |
|
|
35
|
+
| `waves` | `number` | How close together the waves are. Default 1. |
|
|
36
|
+
| `tilt` | `number` | How far the surface leans back, degrees (0 face-on, 80 nearly edge-on). Default 58. |
|
|
37
|
+
| `zoom` | `number` | How much of the surface fills the frame (larger is closer). Default 1. |
|
|
38
|
+
| `lighting` | `number` | How strongly the waves are lit and shaded; 0 for flat. Default 1. |
|
|
39
|
+
| `aberration` | `number` | How far blue bleeds left and red right of each glyph, CSS px; 0 for none. Default 3. |
|
|
40
|
+
| `interactive` | `boolean` | With `waves`, whether the pointer ripples the surface and a click drops a ring. Default true. |
|
|
41
|
+
| `quiet` | `{ x?: number; y?: number; radius?: number; depth?: number } \| null` | An area kept clear: centre (0–1 from the top left), radius (share of the height), depth (0–1). |
|
|
42
|
+
| `font` | `string` | The font the glyphs are drawn in. Default a monospace stack. |
|
|
43
|
+
| `fixed` | `boolean` | Fill the viewport (position: fixed). Default false. |
|
|
44
|
+
| `class` | `string` | Classes for the element. |
|
|
45
|
+
|
|
46
|
+
## `<BorderSweep>`
|
|
47
|
+
|
|
48
|
+
BorderSweep: a light travelling round an element's outline, on hover and focus or (`always`) all the time. A wrapper for `class="sweep-ring"` from border-sweep.css; for elements you render yourself, import `@arraypress/effects-astro/border-sweep.css` and add the class.
|
|
49
|
+
|
|
50
|
+
```astro
|
|
51
|
+
<BorderSweep as="a" href="/pricing" class="card" color="#a5b4fc" always>…</BorderSweep>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
| Prop | Type | |
|
|
55
|
+
|---|---|---|
|
|
56
|
+
| `as` | `HTMLTag` | The element to render. Default `div`. |
|
|
57
|
+
| `color` | `string` | The light's colour. Default the text colour. |
|
|
58
|
+
| `speed` | `number` | Seconds a lap takes. Default 2.6. |
|
|
59
|
+
| `width` | `number` | The ring's width, px. Default 1. |
|
|
60
|
+
| `always` | `boolean` | Run all the time, not only on hover. Default false. |
|
|
61
|
+
| `class` | `string` | Classes for the element. |
|
|
62
|
+
|
|
63
|
+
## `<Caustics>`
|
|
64
|
+
|
|
65
|
+
Caustics: sunlight through rippling water onto a pool floor, a bright, shifting net of light over an aqua ground, with a faint rainbow at the edges of its lines. The pointer stirs the water where it is; faint tiles can lie on the floor. See src/runtime/caustics.js.
|
|
66
|
+
|
|
67
|
+
```astro
|
|
68
|
+
<section class="hero" style="position: relative">
|
|
69
|
+
<Caustics tiles quiet={{ radius: 0.5 }} />
|
|
70
|
+
<h1>The pool is <em>open.</em></h1>
|
|
71
|
+
</section>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
| Prop | Type | |
|
|
75
|
+
|---|---|---|
|
|
76
|
+
| `colors` | `string[]` | The water and the light, in any order: the darkest is the deep water towards the edges, the lightest the light, the one between the floor. One or two colours work too. Default aqua `#2cc3d0`, deep teal `#0b7ea8`, sun `#f2fff9`. |
|
|
77
|
+
| `palette` | `PaletteName \| (string & {})` | A shared palette by name (`PALETTES`, any case), when there are no `colors`. |
|
|
78
|
+
| `background` | `string` | The ground the edges fall away into, and what shows without WebGL. Default: the deep water, darkened. |
|
|
79
|
+
| `scale` | `number` | How large the net of light is, 0.4–3: 2 doubles it. Default 1. |
|
|
80
|
+
| `speed` | `number` | How fast the water moves, 0–3; 0 holds it still. Default 1. |
|
|
81
|
+
| `intensity` | `number` | How bright the light is, 0–2. Default 1. |
|
|
82
|
+
| `tiles` | `boolean` | Faint pool tiles on the floor, bent by the water. Default false. |
|
|
83
|
+
| `interactive` | `boolean` | Whether the pointer disturbs the water where it is. Default true. |
|
|
84
|
+
| `quiet` | `{ x?: number; y?: number; radius?: number; depth?: number } \| null` | An area where the light is kept low behind copy: centre (0–1 from the top left), radius (a share of the height), depth (0–1). Default none; `{}` for the middle. |
|
|
85
|
+
| `fixed` | `boolean` | Fill the viewport, behind the page (position: fixed, z-index -1). Default false. |
|
|
86
|
+
| `class` | `string` | Classes for the element. |
|
|
87
|
+
|
|
88
|
+
## `<ColorPanels>`
|
|
89
|
+
|
|
90
|
+
ColorPanels: translucent panels of colour that swing open out of the dark and sweep past, like pages turning towards you. Paper's color-panels shader (Apache-2.0, vendored), with its settings as plain props; each prop's default is the Opening preset's, and with another `preset` the props left out are that preset's.
|
|
91
|
+
|
|
92
|
+
```astro
|
|
93
|
+
<ColorPanels />
|
|
94
|
+
<ColorPanels preset="Glass" background="#0b0b10" />
|
|
95
|
+
<ColorPanels palette="Lagoon" density={3} edges quiet={{ radius: 0.5 }} />
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
| Prop | Type | |
|
|
99
|
+
|---|---|---|
|
|
100
|
+
| `palette` | `PaletteName \| (string & {})` | A shared palette by name (`PALETTES`, any case), when there are no `colors`. |
|
|
101
|
+
| `quiet` | `{ x?: number; y?: number; radius?: number; depth?: number }` | Dims it towards its `background` behind the copy: the centre (`x` across, `y` down, 0–1), the `radius` (of the height) and the `depth`, 0–1. Default none. |
|
|
102
|
+
| `preset` | `'Opening' \| 'Default' \| 'Glass' \| 'Gradient'` | Paper's preset to start from: `Opening` (cyan panels opening out of the dark, on plum), `Default` (seven colours fanning out over black), `Glass` (four colours with lit, blurred edges, on clear) or `Gradient` (panels shading from one colour to the next, on aqua). Default `'Opening'`. |
|
|
103
|
+
| `colors` | `string[]` | The panels' colours, up to seven, taken in turn. Default `['#00ffff']`. |
|
|
104
|
+
| `background` | `string` | The colour behind the panels. Default `'#570044'`. |
|
|
105
|
+
| `density` | `number` | How closely the panels follow one another, 0.25–7. Default 2.21. |
|
|
106
|
+
| `skewLeft` | `number` | Skews each panel's left edge as it nears, -1–1. Default -1. |
|
|
107
|
+
| `skewRight` | `number` | Skews each panel's right edge as it nears, -1–1. Default -1. |
|
|
108
|
+
| `length` | `number` | How long the panels are, 0–3. Default 0.52. |
|
|
109
|
+
| `edges` | `boolean` | Light along each panel's edges. Default false. |
|
|
110
|
+
| `blur` | `number` | Softens the panels' sides, 0–0.5 (0 sharp). Default 0. |
|
|
111
|
+
| `fadeInner` | `number` | Fades the panels where they meet, at the centre, 0–1. Default 0. |
|
|
112
|
+
| `fadeOuter` | `number` | Fades the panels at their outer ends, nearest you, 0–1. Default 1. |
|
|
113
|
+
| `blend` | `number` | Shades each panel into the next colour, 0–1 (0 one colour each). Default 0. |
|
|
114
|
+
| `zoom` | `number` | How large the panels are drawn, 0.1–4. Default 2.32. |
|
|
115
|
+
| `rotation` | `number` | Turns the whole look, degrees, 0–360. Default 360. |
|
|
116
|
+
| `offset` | `[number, number]` | Where the panels' centre sits, `[x, y]`, -1–1, right and down. Default `[-0.3, 0.6]`. |
|
|
117
|
+
| `speed` | `number` | How fast the panels turn, 0–4 (0 holds). Default 2. |
|
|
118
|
+
| `fixed` | `boolean` | Fill the viewport, behind the page (position: fixed, z-index -1). Default false. |
|
|
119
|
+
| `class` | `string` | Classes for the element. |
|
|
120
|
+
|
|
121
|
+
## `<Cursor>`
|
|
122
|
+
|
|
123
|
+
Cursor: a custom cursor for the whole page: a dot at the pointer and a ring that trails it. Over links, buttons and anything with `data-cursor` the ring swells, showing that element's `data-cursor` text as a label (`<a data-cursor="View">`). The system cursor stays; it is not hidden. Only with a mouse or trackpad; no trail with reduced motion. Place it once, in the layout. See src/runtime/cursor.js.
|
|
124
|
+
|
|
125
|
+
```astro
|
|
126
|
+
<Cursor color="#ffffff" />
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
| Prop | Type | |
|
|
130
|
+
|---|---|---|
|
|
131
|
+
| `ease` | `number` | How quickly the ring catches up, 0–1 (1 is no trail). Default 0.18. |
|
|
132
|
+
| `targets` | `string` | What makes the ring swell. Default `a, button, [data-cursor]`. |
|
|
133
|
+
| `color` | `string` | The dot's and ring's colour. Default white. |
|
|
134
|
+
| `size` | `number` | The ring's size at rest, px. Default 32. |
|
|
135
|
+
| `blend` | `string` | Blend with the page: `difference` inverts what is under it, readable on any ground. Default `difference`. |
|
|
136
|
+
|
|
137
|
+
## `<DotGrid>`
|
|
138
|
+
|
|
139
|
+
DotGrid: a sea of dots you can drop stones into. A slow current moves through a fixed grid of dots, a swell sits under the pointer, and a click sends a widening ripple across, lifting and pushing the dots. See src/runtime/dot-grid.js.
|
|
140
|
+
|
|
141
|
+
```astro
|
|
142
|
+
<DotGrid fixed color="#ffffff" pitch={26} />
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
| Prop | Type | |
|
|
146
|
+
|---|---|---|
|
|
147
|
+
| `color` | `string` | The dots' colour. Default `#ffffff`. |
|
|
148
|
+
| `pitch` | `number` | Space between dots, CSS px. Default 26. |
|
|
149
|
+
| `dot` | `number` | A dot's size at rest, CSS px. Default 1.6. |
|
|
150
|
+
| `round` | `boolean` | Round dots rather than square. Default false. |
|
|
151
|
+
| `flow` | `number` | How strongly the noise current lights and nudges the dots; 0 for none. Default 1. |
|
|
152
|
+
| `speed` | `number` | How fast a ripple travels, CSS px a second. Default 620. |
|
|
153
|
+
| `life` | `number` | Seconds before a ripple is spent. Default 2.6. |
|
|
154
|
+
| `push` | `number` | How far a ripple displaces dots, CSS px. Default 9. |
|
|
155
|
+
| `radius` | `number` | The pointer's swell, CSS px; 0 for none. Default 210. |
|
|
156
|
+
| `greet` | `boolean` | Drop one ripple from the middle soon after it first comes on screen. Default true. |
|
|
157
|
+
| `ripples` | `boolean` | Whether clicks drop ripples. Default true. |
|
|
158
|
+
| `fixed` | `boolean` | Fill the viewport, behind the page (position: fixed, z-index -1). Default false. |
|
|
159
|
+
| `class` | `string` | Classes for the element. |
|
|
160
|
+
|
|
161
|
+
## `<DotSurface>`
|
|
162
|
+
|
|
163
|
+
DotSurface: a halftone sea. A grid of round dots lies on a slowly rolling sheet seen in perspective, each dot sized and lit by how the light catches the sheet: lit crests swell into large bright dots, troughs shrink to pinpoints. The pointer raises a soft swell; a click sends a ring across. See src/runtime/dot-surface.js.
|
|
164
|
+
|
|
165
|
+
```astro
|
|
166
|
+
<DotSurface color="#ff8a1f" quiet={{ x: 0.3, y: 0.3, radius: 0.5 }} />
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
| Prop | Type | |
|
|
170
|
+
|---|---|---|
|
|
171
|
+
| `color` | `string` | The dots' colour. Default `#ff8a1f`. |
|
|
172
|
+
| `colors` | `string[]` | A gradient instead (up to five), blended in Oklab, from near to far or left to right (see `gradient`). |
|
|
173
|
+
| `palette` | `PaletteName \| (string & {})` | A shared palette by name (`PALETTES`, any case), when there are no `colors` or `color`. |
|
|
174
|
+
| `gradient` | `'depth' \| 'width'` | Which way `colors` runs: near to far, or left to right. Default `depth`. |
|
|
175
|
+
| `pitch` | `number` | Space between dots, CSS px, at the middle of the sheet (nearer is wider, further closer). Default 10. |
|
|
176
|
+
| `dot` | `number` | The largest dot, CSS px, at the middle of the sheet. Default 6. |
|
|
177
|
+
| `amplitude` | `number` | How tall the swells are: 1 a gentle roll, 2 a heavy sea, 0 flat. Default 1. |
|
|
178
|
+
| `speed` | `number` | How fast the sheet rolls; 0 holds it still. Default 1. |
|
|
179
|
+
| `tilt` | `number` | The camera's angle above the sheet, degrees (10 grazing, 70 nearly overhead). Default 42. |
|
|
180
|
+
| `light` | `[number, number, number]` | Where the light comes from: x right, y up, z into the distance. Default `[-0.5, 0.6, -0.6]`. |
|
|
181
|
+
| `interactive` | `boolean` | Whether the pointer raises a swell and a click sends a ring. Default true. |
|
|
182
|
+
| `quiet` | `{ x?: number; y?: number; radius?: number; depth?: number } \| null` | An area kept dim behind copy: centre (0–1 from the top left), radius (a share of the height), depth (0–1). Default none; `{}` for the middle. |
|
|
183
|
+
| `fixed` | `boolean` | Fill the viewport, behind the page (position: fixed, z-index -1). Default false. |
|
|
184
|
+
| `class` | `string` | Classes for the element. |
|
|
185
|
+
|
|
186
|
+
## `<FitText>`
|
|
187
|
+
|
|
188
|
+
FitText: one line of text sized to exactly span its parent's content width, whatever the text and the window. See src/runtime/fit-text.js. Give it a CSS font-size as the fallback without script.
|
|
189
|
+
|
|
190
|
+
```astro
|
|
191
|
+
<FitText as="div" class="wordmark">Northwave</FitText>
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
| Prop | Type | |
|
|
195
|
+
|---|---|---|
|
|
196
|
+
| `as` | `HTMLTag` | The element to render. Default `div`. |
|
|
197
|
+
| `class` | `string` | Classes for the element. |
|
|
198
|
+
|
|
199
|
+
## `<FlutedGlass>`
|
|
200
|
+
|
|
201
|
+
FlutedGlass: a pane of slanted fluted glass over soft blooms of colour, the main one following the pointer. Each rib bends what is behind it and fringes it with a thin rainbow. See src/runtime/fluted-glass.js.
|
|
202
|
+
|
|
203
|
+
```astro
|
|
204
|
+
<section class="hero" style="position: relative">
|
|
205
|
+
<FlutedGlass colors={['#4f46e5', '#a78bfa', '#f0abfc']} />
|
|
206
|
+
<h1>Brands seen through <em>a different light.</em></h1>
|
|
207
|
+
</section>
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
| Prop | Type | |
|
|
211
|
+
|---|---|---|
|
|
212
|
+
| `colors` | `string[]` | The blooms' colours, the one that follows the pointer first. Default indigo, violet, pink. |
|
|
213
|
+
| `palette` | `PaletteName \| (string & {})` | A shared palette by name (`PALETTES`, any case), when there are no `colors`. |
|
|
214
|
+
| `background` | `string` | The ground behind the glass. Default `#f4f4f5`. |
|
|
215
|
+
| `angle` | `number` | The flutes' slant, degrees from vertical. Default -35. |
|
|
216
|
+
| `frequency` | `number` | Flutes across the longer side. Default 9. |
|
|
217
|
+
| `softness` | `number` | 0: flat flutes with sharp seams; 1: a gentle curve all across. Default 0.5. |
|
|
218
|
+
| `refraction` | `number` | How hard each flute bends what is behind it. Default 1.5. |
|
|
219
|
+
| `dispersion` | `number` | How far the colours part at the seams; 0 for none. Default 0.6. |
|
|
220
|
+
| `highlight` | `number` | The highlight along each flute; 0 for none. Default 0.35. |
|
|
221
|
+
| `bloom` | `number` | How strong the blooms are. Default 1. |
|
|
222
|
+
| `fixed` | `boolean` | Fill the viewport, behind the page (position: fixed, z-index -1). Default false. |
|
|
223
|
+
| `class` | `string` | Classes for the element. |
|
|
224
|
+
|
|
225
|
+
## `<Glass>`
|
|
226
|
+
|
|
227
|
+
Glass: a liquid glass panel, with a rim that catches the light and a sheen that follows the pointer. A wrapper for `class="glass"` from glass.css that also starts the sheen; for elements you render yourself, import `@arraypress/effects-astro/glass.css` and add the class, then call `glassSheen()` once.
|
|
228
|
+
|
|
229
|
+
```astro
|
|
230
|
+
<Glass as="article" class="card" tint="#08080a">…</Glass>
|
|
231
|
+
<Glass refract dispersion={0.5} style="border-radius: 28px">…</Glass>
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
| Prop | Type | |
|
|
235
|
+
|---|---|---|
|
|
236
|
+
| `as` | `HTMLTag` | The element to render. Default `div`. |
|
|
237
|
+
| `tint` | `string` | The body's tint colour. Default near-black. |
|
|
238
|
+
| `amount` | `number` | How much of the tint the body takes, 0–100 (%). Default 30. |
|
|
239
|
+
| `blur` | `number` | How much it blurs what is behind, px. Default 20, or 0.5 with `refract`. |
|
|
240
|
+
| `lift` | `number` | How far it rises on hover, px; 0 for none. Default 2. |
|
|
241
|
+
| `refract` | `boolean \| number` | Bends what is behind like a thick lens at the rim, 0–2, or `true` for 1. Chromium only; elsewhere the frost stays. Default false. |
|
|
242
|
+
| `dispersion` | `number` | With `refract`, how much the rim splits what it bends into colours, 0–1. Default 0.35. |
|
|
243
|
+
| `bezel` | `number` | With `refract`, how wide the bending rim is, px. Default 28. |
|
|
244
|
+
| `specular` | `number` | With `refract`, how bright the highlight along the rim is, 0–1. Default 0.7. |
|
|
245
|
+
| `class` | `string` | Classes for the element. |
|
|
246
|
+
|
|
247
|
+
## `<GlassGlyph>`
|
|
248
|
+
|
|
249
|
+
GlassGlyph: a character or a logo as a thick slab of dark, smoked glass, lit from behind by beams of one coloured light. The light barely shows on the near-black ground; the glass catches it and glows with it through its body and bevels. The slab turns slowly on its own and leans away from the pointer; the light stays put. See src/runtime/glass-glyph.js.
|
|
250
|
+
|
|
251
|
+
```astro
|
|
252
|
+
<section class="hero" style="position: relative">
|
|
253
|
+
<GlassGlyph text="7" font="900 Anton, sans-serif" colors={['#c6ff00', '#9fb08a']} />
|
|
254
|
+
<h1>…</h1>
|
|
255
|
+
</section>
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
| Prop | Type | |
|
|
259
|
+
|---|---|---|
|
|
260
|
+
| `text` | `string` | The character or word to make of glass. |
|
|
261
|
+
| `font` | `string` | Its CSS font, without the size. Default: the page's, bold. |
|
|
262
|
+
| `src` | `string` | An image (an SVG logo) to make of glass instead. |
|
|
263
|
+
| `area` | `{ x: number; y: number; width: number; height: number }` | Where the shape sits, each 0–1 from the top left. Default the right half. |
|
|
264
|
+
| `light` | `{ x: number; y: number }` | Where the beams of light cross, each 0–1 from the top left. Default two fifths of the way into the shape's area, a little below its middle. |
|
|
265
|
+
| `colors` | `string[]` | The light's colour, then the glass's tint. Default acid green, white. |
|
|
266
|
+
| `palette` | `PaletteName \| (string & {})` | A shared palette by name (`PALETTES`, any case), when there are no `colors`. |
|
|
267
|
+
| `background` | `string` | The ground. Default `#050505`. |
|
|
268
|
+
| `refraction` | `number` | How hard the glass bends what is behind it, most of all across its bevels, 0–2. Default 1. |
|
|
269
|
+
| `thickness` | `number` | How wide the bevel round the edge is, a share of the height, 0.01–0.1. Default 0.035. |
|
|
270
|
+
| `zoom` | `number` | How much the glass magnifies the light behind it, 1–1.3. Default 1.04. |
|
|
271
|
+
| `aberration` | `number` | How far the colours part where it bends, 0–2; 0 for none. Default 0.6. |
|
|
272
|
+
| `frost` | `number` | Frosted glass: how much more the light through it is blurred, 0–1. Default 0. |
|
|
273
|
+
| `tint` | `number` | How much the glass takes the tint colour, 0–1. Default 0.1. |
|
|
274
|
+
| `highlight` | `number` | The lit rims and the glints, 0–2. Default 0.8. |
|
|
275
|
+
| `fresnel` | `number` | How much the bevels mirror the light, 0–1. Default 0.5. |
|
|
276
|
+
| `lightAngle` | `number` | Where the light on the rims comes from, degrees, 0–360 (0 right, 90 top). Default 135. |
|
|
277
|
+
| `glow` | `number` | How strong the coloured light is, 0–2. Default 1. |
|
|
278
|
+
| `ambient` | `number` | How much of the light shows outside the glass, 0–1: 0 is a black ground, 1 the full beams. Default 0.1. |
|
|
279
|
+
| `halftone` | `boolean` | Dither the light outside the glass into dots where it fades. Default false. |
|
|
280
|
+
| `sway` | `number` | How far the slab turns on its own and away from the pointer, 0–2; 0 holds it still. Default 1. |
|
|
281
|
+
| `fixed` | `boolean` | Fill the viewport, behind the page (position: fixed, z-index -1). Default false. |
|
|
282
|
+
| `class` | `string` | Classes for the element. |
|
|
283
|
+
|
|
284
|
+
## `<GlowField>`
|
|
285
|
+
|
|
286
|
+
GlowField: a light laid over a section's background, or over a shader: a hard light source above an organic wash, so a headline has something to sit in. Pure CSS gradients that move only by transform and opacity, so it costs next to nothing and cannot fail to start.
|
|
287
|
+
|
|
288
|
+
```astro
|
|
289
|
+
<section class="hero" style="position: relative">
|
|
290
|
+
<GlowField variant="beam" color="#a5b4fc" />
|
|
291
|
+
<h1>…</h1>
|
|
292
|
+
</section>
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
| Prop | Type | |
|
|
296
|
+
|---|---|---|
|
|
297
|
+
| `variant` | `'bloom' \| 'beam' \| 'horizon' \| 'wash'` | The shape of the light. Default `bloom`. |
|
|
298
|
+
| `color` | `string` | The light's colour. Default white. |
|
|
299
|
+
| `intensity` | `number` | A multiplier on its strength; 1 as designed. Default 1. |
|
|
300
|
+
| `tone` | `'dark' \| 'light'` | The ground it is on: `dark` adds light, `light` shades. Default `dark`. |
|
|
301
|
+
| `x` | `number` | Where across the top the light comes from, 0–100 (%). Default 50. |
|
|
302
|
+
| `still` | `boolean` | Hold the light still. Default false. |
|
|
303
|
+
| `class` | `string` | Classes for the element. |
|
|
304
|
+
|
|
305
|
+
## `<Grain>`
|
|
306
|
+
|
|
307
|
+
Grain: a film-grain texture over a section (or the whole page with `fixed`). Big smooth gradients band on 8-bit screens; grain dithers them, so a shader reads as film rather than plastic. Blended with `overlay`, which keeps blacks black and textures the mid-tones, as film grain does, where plain alpha would lift the blacks into fog.
|
|
308
|
+
|
|
309
|
+
```astro
|
|
310
|
+
<section style="position: relative">
|
|
311
|
+
<LightField colors={…} />
|
|
312
|
+
<Grain opacity={0.2} />
|
|
313
|
+
<h1>…</h1>
|
|
314
|
+
</section>
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
| Prop | Type | |
|
|
318
|
+
|---|---|---|
|
|
319
|
+
| `opacity` | `number` | How strong, 0–1 (stronger than the number suggests, with overlay). Default 0.22. |
|
|
320
|
+
| `frequency` | `number` | How fine; higher is finer (0.75 is about 1px). Default 0.75. |
|
|
321
|
+
| `fixed` | `boolean` | Cover the viewport (position: fixed). Default false. |
|
|
322
|
+
| `blend` | `string` | The blend with what is under it. Default `overlay`. |
|
|
323
|
+
| `still` | `boolean` | Hold the grain still. Default false. |
|
|
324
|
+
| `class` | `string` | Classes for the element. |
|
|
325
|
+
|
|
326
|
+
## `<HaloRing>`
|
|
327
|
+
|
|
328
|
+
HaloRing: a ring of light on a dark ground, a soft-cornered outline around the copy whose bright core line glows inward a little and far outward. Colour travels around it, and its hottest stretches burn to white; the pointer draws it close and lights it up. See src/runtime/halo-ring.js.
|
|
329
|
+
|
|
330
|
+
```astro
|
|
331
|
+
<section class="hero" style="position: relative">
|
|
332
|
+
<HaloRing colors={['#ffb020', '#ff5a6e', '#2f7bff']} />
|
|
333
|
+
<h1>Something new arrives Friday.</h1>
|
|
334
|
+
</section>
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
| Prop | Type | |
|
|
338
|
+
|---|---|---|
|
|
339
|
+
| `colors` | `string[]` | Three colours looped around the ring, blended in Oklab. Default amber, coral, electric blue (`['#ffb020', '#ff5a6e', '#2f7bff']`). |
|
|
340
|
+
| `palette` | `PaletteName \| (string & {})` | A shared palette by name (`PALETTES`, any case), when there are no `colors`. |
|
|
341
|
+
| `shape` | `HaloShape` | The outline: a rounded hexagon, a rounded rectangle fitted to the element, a circle, or a slow drift between the hexagon and a squarer rectangle. Default `morph`. |
|
|
342
|
+
| `corner` | `number` | How round the corners are: 0 sharp, 1 as round as they go. Default 0.3. |
|
|
343
|
+
| `margin` | `number` | Space between the ring and the element's edge, a share of its shorter side. Default 0.05. |
|
|
344
|
+
| `thickness` | `number` | The bright core line, CSS px. Default 10. |
|
|
345
|
+
| `glow` | `number` | How far and how strongly the light spreads; 0 for the bare line. Default 1. |
|
|
346
|
+
| `speed` | `number` | How fast the colour travels and the shape drifts; 0 holds it still. Default 1. |
|
|
347
|
+
| `background` | `string` | The ground. Default `#0d0c10`. |
|
|
348
|
+
| `interactive` | `boolean` | Whether the ring leans towards the pointer and lights up near it. Default true. |
|
|
349
|
+
| `quiet` | `{ x?: number; y?: number; radius?: number; depth?: number } \| null` | An area kept dim behind copy: centre (0–1 from the top left), radius (a share of the height), depth (0–1). Default none; `{}` for the middle. |
|
|
350
|
+
| `fixed` | `boolean` | Fill the viewport, behind the page (position: fixed, z-index -1). Default false. |
|
|
351
|
+
| `class` | `string` | Classes for the element. |
|
|
352
|
+
|
|
353
|
+
## `<HighlightSweep>`
|
|
354
|
+
|
|
355
|
+
HighlightSweep: a marker-pen underline that sweeps in under a word, once, after the page has drawn. For the one phrase a headline turns on. CSS only; with reduced motion the underline is simply there.
|
|
356
|
+
|
|
357
|
+
```astro
|
|
358
|
+
<h1>Sell <HighlightSweep color="#c084fc">beats</HighlightSweep> online.</h1>
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
| Prop | Type | |
|
|
362
|
+
|---|---|---|
|
|
363
|
+
| `color` | `string` | The underline's colour. Default the text colour. |
|
|
364
|
+
| `thickness` | `number` | How thick, em. Default 0.18. |
|
|
365
|
+
| `opacity` | `number` | How strong, 0–1. Default 0.45. |
|
|
366
|
+
| `delay` | `number` | Seconds before it starts. Default 0.4. |
|
|
367
|
+
| `duration` | `number` | Seconds the sweep takes. Default 1.6. |
|
|
368
|
+
| `class` | `string` | Classes for the element. |
|
|
369
|
+
|
|
370
|
+
## `<ImageRipple>`
|
|
371
|
+
|
|
372
|
+
ImageRipple: a photo under a skin of water. The pointer drags a wake through it and a click drops a ring; the waves bend the photo, part its colours a little at their fronts and catch the light on their crests, then settle back to the still, sharp photo. See src/runtime/image-ripple.js.
|
|
373
|
+
|
|
374
|
+
```astro
|
|
375
|
+
<section class="hero" style="position: relative">
|
|
376
|
+
<ImageRipple src="/photos/lake.jpg" alt="A misty lake at dawn" />
|
|
377
|
+
<h1>…</h1>
|
|
378
|
+
</section>
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
| Prop | Type | |
|
|
382
|
+
|---|---|---|
|
|
383
|
+
| `src` (required) | `string` | The photo's URL (same origin, or served with CORS). |
|
|
384
|
+
| `strength` | `number` | How far the ripples bend the photo, 0–3. Default 1. |
|
|
385
|
+
| `size` | `number` | How wide the ripples the pointer makes are, 0.3–3. Default 1. |
|
|
386
|
+
| `viscosity` | `number` | How thick the water is: more settles sooner, with smaller ripples, 0.25–4. Default 1. |
|
|
387
|
+
| `fringe` | `number` | How far the colours part at the wave fronts, 0–3; 0 for none. Default 1. |
|
|
388
|
+
| `interactive` | `boolean` | Whether the pointer ripples it; false leaves the plain photo. Default true. |
|
|
389
|
+
| `fit` | `'cover' \| 'contain'` | How the photo fills the element, as CSS `object-fit`. Default `cover`. |
|
|
390
|
+
| `alt` | `string` | The photo's text alternative. Default empty: decoration. |
|
|
391
|
+
| `class` | `string` | Classes for the element. |
|
|
392
|
+
|
|
393
|
+
## `<Ink>`
|
|
394
|
+
|
|
395
|
+
Ink: ink in water over whatever is behind it. The pointer stirs it and trails ink in the palette's colours; a click drops a bloom that bursts open and curls into eddies, then fades. Clear where there is no ink. See src/runtime/ink.js.
|
|
396
|
+
|
|
397
|
+
```astro
|
|
398
|
+
<section class="hero" style="position: relative">
|
|
399
|
+
<Ink colors={['#2216f7', '#55bdff', '#a702ff']} />
|
|
400
|
+
<h1>…</h1>
|
|
401
|
+
</section>
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
| Prop | Type | |
|
|
405
|
+
|---|---|---|
|
|
406
|
+
| `colors` | `string[]` | The ink's colours, as CSS hex, looped through as it is laid. Default the palette's, or Peacock's. |
|
|
407
|
+
| `palette` | `PaletteName \| (string & {})` | A shared palette by name (`PALETTES`, any case), when there are no `colors`. |
|
|
408
|
+
| `trail` | `number` | How much ink a stroke leaves, 0 for none (strokes still push). Default 0.35. |
|
|
409
|
+
| `drops` | `boolean` | Whether a click or tap drops a bloom of ink. Default true. |
|
|
410
|
+
| `force` | `number` | How hard the pointer pushes. Default 1. |
|
|
411
|
+
| `curl` | `number` | Swirl kept alive between strokes. Default 28. |
|
|
412
|
+
| `fade` | `number` | How fast the ink fades, per second. Default 0.55. |
|
|
413
|
+
| `diffusion` | `number` | How much the ink spreads and softens as it moves, 0–1. Default 0.35. |
|
|
414
|
+
| `radius` | `number` | The size of a stroke's splats and of a drop, 1 as standard. |
|
|
415
|
+
| `momentum` | `number` | How fast the motion dies away, per second (lower flows on longer). Default 0.25. |
|
|
416
|
+
| `opacity` | `number` | The ink's strongest cover, 0–1. Default 1. |
|
|
417
|
+
| `ignore` | `string` | Clicks on these are theirs, not the ink's. Default: links, buttons, form fields and `[data-effect-ignore]`. |
|
|
418
|
+
| `fixed` | `boolean` | Fill the viewport (position: fixed). Default false. |
|
|
419
|
+
| `class` | `string` | Classes for the element. |
|
|
420
|
+
|
|
421
|
+
## `<InkField>`
|
|
422
|
+
|
|
423
|
+
InkField: ink in water, lit by a lamp that follows the pointer. Slow emitters keep the ink moving across the whole field; moving the pointer pushes it aside and leaves a faint trail, and the lamp rests at the upper left when the pointer is away. The field dims in the middle, behind the copy. Twelve named palettes (Trirat's), or colours of your own. See src/runtime/ink-field.js.
|
|
424
|
+
|
|
425
|
+
```astro
|
|
426
|
+
<InkField fixed palette="Peacock" />
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
| Prop | Type | |
|
|
430
|
+
|---|---|---|
|
|
431
|
+
| `palette` | `PaletteName \| (string & {})` | One of the shared palettes (`PALETTES`, any case). Default `'Lumetri'`. |
|
|
432
|
+
| `colors` | `string[]` | Three colours as CSS hex, in place of the palette's (fewer are looped). Default the palette's. |
|
|
433
|
+
| `glint` | `string` | A glint colour, in place of the palette's (unused by the ink look). Default the palette's. |
|
|
434
|
+
| `interactive` | `boolean` | The pointer stirs the ink and the lamp follows it, on devices that hover. Default true. |
|
|
435
|
+
| `drops` | `boolean` | A press drops ink that blooms open (not on links, buttons or fields). Off by default: on a page-wide field, stray clicks would splash. Default false. |
|
|
436
|
+
| `lamp` | `{ x?: number; y?: number }` | Where the lamp rests when the pointer is away, 0–1 from the top left. Default `{ x: 0.14, y: 0.14 }`. |
|
|
437
|
+
| `still` | `boolean` | Hold one frame of settled ink and never animate, as with reduced motion: for a field behind body copy. Default false. |
|
|
438
|
+
| `scale` | `number` | Share of the pixel ratio drawn at. Default 0.5. |
|
|
439
|
+
| `audio` | `AudioSource` | Follow the sound playing: `'page'` for whatever plays, or a CSS selector for an `<audio>`/`<video>` or a player's container (a WaveformPlayer). Kicks stir the ink and it brightens with the beat; while nothing plays it keeps its own motion. Default none. |
|
|
440
|
+
| `fixed` | `boolean` | Fill the viewport, behind the page (position: fixed, z-index -1). Default false. |
|
|
441
|
+
| `class` | `string` | Classes for the element. |
|
|
442
|
+
|
|
443
|
+
## `<IsoCity>`
|
|
444
|
+
|
|
445
|
+
IsoCity: a small isometric city in flat-shaded low poly, with cars driving its streets and the brand's taxis among them, in its `accent`. Click a street and the nearest taxi comes: its route draws in, it pulls in at the pin, and it picks up with a hop. `night` lights the windows, lamps and headlights. See src/runtime/iso-city.js.
|
|
446
|
+
|
|
447
|
+
```astro
|
|
448
|
+
<section class="hero" style="position: relative">
|
|
449
|
+
<IsoCity accent="#f2a53a" side="right" quiet={{ x: 0.25, radius: 0.5 }} />
|
|
450
|
+
<h1>Your ride, <em>two streets away.</em></h1>
|
|
451
|
+
</section>
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
| Prop | Type | |
|
|
455
|
+
|---|---|---|
|
|
456
|
+
| `colors` | `string[]` | Buildings, parks, roads. Default warm off-white, sage and graphite (at night slate, deep green and near-black). |
|
|
457
|
+
| `palette` | `PaletteName \| (string & {})` | A shared palette by name (`PALETTES`, any case), softened into a city, when there are no `colors`; its first colour becomes the taxis'. |
|
|
458
|
+
| `accent` | `string` | The taxis' colour. Default `#f2a53a` (amber; `#ffb547` at night). |
|
|
459
|
+
| `background` | `string` | The ground the city fades into. Default `#e9e3d8` (`#0d1219` at night). |
|
|
460
|
+
| `cars` | `number` | How many cars, 0–60. Default 24. |
|
|
461
|
+
| `taxis` | `number` | How many of them are taxis: a share, 0–1, or a count, 1–60. Default 0.3. |
|
|
462
|
+
| `speed` | `number` | How fast they drive, 0–3; 0 holds them still. Default 1. |
|
|
463
|
+
| `seed` | `number` | Which city, 1–9999: the same seed always builds the same streets and buildings. Default 7. |
|
|
464
|
+
| `size` | `number` | Blocks across, 3–10. Default 6. |
|
|
465
|
+
| `night` | `boolean` | Night: lit windows, street lamps, headlight beams and glowing roof signs. Default false. |
|
|
466
|
+
| `interactive` | `boolean` | A click or tap on a street calls the nearest taxi by road, which drives there and picks up. Default true. |
|
|
467
|
+
| `drift` | `boolean` | Let the view drift very slowly. Default true. |
|
|
468
|
+
| `zoom` | `number` | How close the camera is, 0.5–2. Default 1. |
|
|
469
|
+
| `side` | `'center' \| 'left' \| 'right'` | Where the city sits on a wide screen (centred on a narrow one). Default `center`. |
|
|
470
|
+
| `quiet` | `{ x?: number; y?: number; radius?: number; depth?: number } \| null` | An area faded towards the background behind copy: centre (0–1 from the top left), radius (a share of the height), depth (0–1). Default none; `{}` for the middle. |
|
|
471
|
+
| `fixed` | `boolean` | Fill the viewport, behind the page (position: fixed, z-index -1). Default false. |
|
|
472
|
+
| `class` | `string` | Classes for the element. |
|
|
473
|
+
|
|
474
|
+
## `<LightField>`
|
|
475
|
+
|
|
476
|
+
LightField: liquid light in three colours, bending around the pointer, with a real fluid under it that the pointer stirs and a click drops ink into. See src/runtime/light-field.js for how it is drawn.
|
|
477
|
+
|
|
478
|
+
```astro
|
|
479
|
+
<LightField fixed colors={['#7c3aed', '#db2777', '#06b6d4']} quiet={{ y: 0.45 }} />
|
|
480
|
+
```
|
|
481
|
+
|
|
482
|
+
| Prop | Type | |
|
|
483
|
+
|---|---|---|
|
|
484
|
+
| `colors` | `string[]` | The light's three colours, as CSS hex. Default the palette's, or Lumetri's. |
|
|
485
|
+
| `palette` | `PaletteName \| (string & {})` | A shared palette by name (`PALETTES`, any case), when there are no `colors`. |
|
|
486
|
+
| `glint` | `string` | The caustic bands' colour. Default the palette's glint, or a warm white, `#fff3c4`. |
|
|
487
|
+
| `speed` | `number` | How fast the light moves. Default 1. |
|
|
488
|
+
| `lens` | `number` | How strongly the pointer bends the light; 0 for not at all. Default 1. |
|
|
489
|
+
| `prism` | `boolean` | Split the colours at the edges. Default true; always off on phones. |
|
|
490
|
+
| `fluid` | `boolean \| { trail?: number; drops?: boolean; force?: number; fade?: number; diffusion?: number; radius?: number; curl?: number; ignore?: string }` | The fluid under the light: false for none, or its settings. Default true. |
|
|
491
|
+
| `quiet` | `{ x?: number; y?: number; radius?: number; depth?: number } \| null` | An area where the light dims: centre (0–1 from the top left), radius (share of the height), depth (0–1). |
|
|
492
|
+
| `vignette` | `number` | How much the corners darken, 0–1. Default 0.45. |
|
|
493
|
+
| `grain` | `number` | Film grain. Default 0.035. |
|
|
494
|
+
| `scale` | `number` | Share of the pixel ratio drawn at. Default 0.5. |
|
|
495
|
+
| `fixed` | `boolean` | Fill the viewport, behind the page (position: fixed, z-index -1). Default false. |
|
|
496
|
+
| `background` | `string` | The colour under the light, and under the fallback gradient. Default `#08080a`. |
|
|
497
|
+
| `class` | `string` | Classes for the element. |
|
|
498
|
+
|
|
499
|
+
## `<LiquidMetal>`
|
|
500
|
+
|
|
501
|
+
LiquidMetal: a logo or a word made of liquid chrome. At rest it is a polished slab of metal reflecting a slowly turning studio; the pointer dents it and sends ripples across it, a stroke parts it, a click splashes it (a crater, a ring wave, droplets that fall and crawl back), and surface tension pulls it back into shape with a last wobble. See src/runtime/liquid-metal.js.
|
|
502
|
+
|
|
503
|
+
```astro
|
|
504
|
+
<section class="hero" style="position: relative; background: #0b0c0e">
|
|
505
|
+
<LiquidMetal src="/logo.svg" />
|
|
506
|
+
<h1>…</h1>
|
|
507
|
+
</section>
|
|
508
|
+
```
|
|
509
|
+
|
|
510
|
+
| Prop | Type | |
|
|
511
|
+
|---|---|---|
|
|
512
|
+
| `text` | `string` | A word to make of metal. |
|
|
513
|
+
| `font` | `string` | Its CSS font, without the size. Default: the page's, bold. |
|
|
514
|
+
| `src` | `string` | An image (an SVG logo) to make of metal instead. |
|
|
515
|
+
| `area` | `{ x: number; y: number; width: number; height: number }` | Where the logo sits, each 0–1 from the top left. Default the right half. |
|
|
516
|
+
| `size` | `number` | How much of its area the logo fills: 1 fits it, less shrinks it about the area's middle. Default 1. |
|
|
517
|
+
| `tint` | `MetalName \| (string & {})` | The metal: a name, or a CSS hex colour (its colour face on). Default `chrome`. |
|
|
518
|
+
| `colors` | `string[]` | The studio's colours, reflected in the metal: the sky, the horizon, the floor. Default a neutral studio. |
|
|
519
|
+
| `palette` | `PaletteName \| (string & {})` | A shared palette by name (`PALETTES`, any case), when there are no `colors`: it tints the studio. |
|
|
520
|
+
| `bevel` | `number` | How wide its rounded edges are. Default 1. |
|
|
521
|
+
| `viscosity` | `number` | How thick the metal is: more settles sooner, with smaller ripples. Default 1. |
|
|
522
|
+
| `tension` | `number` | How hard it pulls back into shape: more reforms sooner, with a quicker wobble. Default 1. |
|
|
523
|
+
| `ripple` | `number` | How hard the pointer pushes into it. Default 1. |
|
|
524
|
+
| `interactive` | `boolean` | Whether it reacts to the pointer at all. Default true. |
|
|
525
|
+
| `shadow` | `number` | The soft shadow under it; 0 for none. Default 1. |
|
|
526
|
+
| `background` | `string` | A ground behind the metal (any CSS background). Default none: transparent. |
|
|
527
|
+
| `fixed` | `boolean` | Fill the viewport, behind the page (position: fixed, z-index -1). Default false. |
|
|
528
|
+
| `class` | `string` | Classes for the element. |
|
|
529
|
+
|
|
530
|
+
## `<Magnetic>`
|
|
531
|
+
|
|
532
|
+
Magnetic: an element the pointer pulls on. As the pointer comes near it leans towards it, its contents a little further, and springs back when the pointer goes: a call to action that feels like a soft object. See src/runtime/magnetic.js. Still on touch screens and with reduced motion.
|
|
533
|
+
|
|
534
|
+
```astro
|
|
535
|
+
<Magnetic as="a" href="/start" class="button" strength={0.35}>Start selling</Magnetic>
|
|
536
|
+
```
|
|
537
|
+
|
|
538
|
+
| Prop | Type | |
|
|
539
|
+
|---|---|---|
|
|
540
|
+
| `strength` | `number` | How far it follows the pointer, a share of the pointer's distance from its centre. Default 0.3. |
|
|
541
|
+
| `reach` | `number` | How far outside the element the pull starts, CSS px. Default 40. |
|
|
542
|
+
| `as` | `HTMLTag` | The element to render. Default `span`. |
|
|
543
|
+
| `class` | `string` | Classes for the element. |
|
|
544
|
+
|
|
545
|
+
## `<Marquee>`
|
|
546
|
+
|
|
547
|
+
Marquee: an endless strip that scrolls sideways, for "as featured in" logos, artist names, a ticker of offers. Pass `items` (text), or anything as the slot (logos, images, cards).
|
|
548
|
+
|
|
549
|
+
```astro
|
|
550
|
+
<Marquee items={['Marcus Vane', 'Vivid Skye', 'Lunaire']} separator="✦" />
|
|
551
|
+
<Marquee speed={30} direction="right"><img src="/press/wire.svg" alt="Wire" />…</Marquee>
|
|
552
|
+
```
|
|
553
|
+
|
|
554
|
+
| Prop | Type | |
|
|
555
|
+
|---|---|---|
|
|
556
|
+
| `items` | `string[]` | Text items; or pass content as the slot. |
|
|
557
|
+
| `speed` | `number` | Seconds for one set to pass. Default 40. |
|
|
558
|
+
| `direction` | `'left' \| 'right'` | `left` scrolls right to left. Default `left`. |
|
|
559
|
+
| `separator` | `string` | Shown between items (text items only). |
|
|
560
|
+
| `gap` | `string` | Space between items, CSS length. Default `2.5rem`. |
|
|
561
|
+
| `pauseOnHover` | `boolean` | Pause while the pointer is over it. Default true. |
|
|
562
|
+
| `pauseButton` | `boolean` | Show a pause button. Default true. |
|
|
563
|
+
| `fade` | `number` | How wide the faded edges are, % of the strip. Default 8. |
|
|
564
|
+
| `labels` | `{ pause: string; resume: string }` | The pause button's labels, for other languages. Default English. |
|
|
565
|
+
| `label` | `string` | What the strip is, for screen readers. Default the items joined. |
|
|
566
|
+
| `class` | `string` | Classes for the element. |
|
|
567
|
+
|
|
568
|
+
## `<MosaicReveal>`
|
|
569
|
+
|
|
570
|
+
MosaicReveal: a slideshow of pictures that change through a GPU transition: tiles flipping over in a diagonal wave, a melt into sorted streaks, blocks coarsening and refining, or a dissolve with a glowing edge. For a product gallery or a portfolio hero. See src/runtime/mosaic-reveal.js.
|
|
571
|
+
|
|
572
|
+
```astro
|
|
573
|
+
<section class="hero" style="position: relative">
|
|
574
|
+
<MosaicReveal images={[{ src: '/work/1.jpg', alt: 'A walnut stool' }, { src: '/work/2.jpg', alt: 'An oak bench' }]} transition="dissolve" />
|
|
575
|
+
<h1>Furniture made <em>to outlive us.</em></h1>
|
|
576
|
+
</section>
|
|
577
|
+
```
|
|
578
|
+
|
|
579
|
+
| Prop | Type | |
|
|
580
|
+
|---|---|---|
|
|
581
|
+
| `transition` | `MosaicTransition` | How one picture becomes the next: tiles flipping in a diagonal wave, melting into sorted streaks, blocks coarsening and refining, or a noise dissolve with a glowing edge. Default `'tiles'`. |
|
|
582
|
+
| `interval` | `number` | Seconds each picture stays, 2–12. Default 5. |
|
|
583
|
+
| `duration` | `number` | Seconds a change takes, 0.4–3. Default 1.6. |
|
|
584
|
+
| `tiles` | `number` | Tiles across the longer side, 3–24; also the coarsest blocks for `pixelate`. Default 9. |
|
|
585
|
+
| `autoplay` | `boolean` | Move on by itself (held while hovered, focused or off screen). Default true. |
|
|
586
|
+
| `colors` | `string[]` | The dissolve's glowing edge: its outer colour, then its core. Default amber, cream. |
|
|
587
|
+
| `palette` | `PaletteName \| (string & {})` | A shared palette by name (`PALETTES`, any case), when there are no `colors`: its first colour round its glint. |
|
|
588
|
+
| `background` | `string` | What shows between the tiles as they flip. Default `#0c0b0a`. |
|
|
589
|
+
| `reducedMotion` | `'fade' \| 'swap'` | With prefers-reduced-motion: a short crossfade, or a swap at once. Default `'fade'`. |
|
|
590
|
+
| `images` (required) | `{ src: string; alt: string }[]` | The pictures, in order, each `{ src, alt }`: same origin, or served with CORS. |
|
|
591
|
+
| `controls` | `boolean` | Dots that pick a picture, the current one filling as it plays. Default true. |
|
|
592
|
+
| `label` | `string` | What the slideshow is called, for assistive technology. Default `'Gallery'`. |
|
|
593
|
+
| `class` | `string` | Classes for the element. |
|
|
594
|
+
| `style` | `string` | |
|
|
595
|
+
|
|
596
|
+
## `<NebulaLogo>`
|
|
597
|
+
|
|
598
|
+
NebulaLogo: a logo or a word filled with drifting nebula gas in the palette's colours, brightest towards its edges, with a glowing rim, a soft halo of gas leaking past the edge and faint stars twinkling inside. The pointer brightens the gas near it and stirs it as it moves. See src/runtime/nebula-logo.js.
|
|
599
|
+
|
|
600
|
+
```astro
|
|
601
|
+
<section class="hero" style="position: relative">
|
|
602
|
+
<NebulaLogo src="/logo.svg" />
|
|
603
|
+
<h1>…</h1>
|
|
604
|
+
</section>
|
|
605
|
+
```
|
|
606
|
+
|
|
607
|
+
| Prop | Type | |
|
|
608
|
+
|---|---|---|
|
|
609
|
+
| `text` | `string` | A word (or a character) to fill with gas. |
|
|
610
|
+
| `font` | `string` | Its CSS font, without the size. Default: the page's, bold. |
|
|
611
|
+
| `src` | `string` | An image (an SVG logo, a PNG) to fill instead. |
|
|
612
|
+
| `area` | `{ x: number; y: number; width: number; height: number }` | Where the shape sits, each 0–1 from the top left. Default the right half. |
|
|
613
|
+
| `colors` | `string[]` | The gas's palette, three colours; the first, darkened, is also the thin gas's. Default teal, amber, rose. |
|
|
614
|
+
| `palette` | `PaletteName \| (string & {})` | A shared palette by name (`PALETTES`, any case), when there are no `colors`. |
|
|
615
|
+
| `background` | `string` | The ground. Default `#05070a`. |
|
|
616
|
+
| `speed` | `number` | How fast the gas drifts. Default 1. |
|
|
617
|
+
| `glow` | `number` | The rim and the halo leaking past the edge; 0 for neither. Default 1. |
|
|
618
|
+
| `stars` | `number` | How many stars twinkle inside; 0 for none. Default 1. |
|
|
619
|
+
| `stir` | `number` | How much the pointer stirs and brightens the gas; 0 for not at all. Default 1. |
|
|
620
|
+
| `scale` | `number` | Share of the pixel ratio the gas is drawn at: it is soft, so a little below full costs nothing visible and saves most of the work. Default 0.6. |
|
|
621
|
+
| `fixed` | `boolean` | Fill the viewport, behind the page (position: fixed, z-index -1). Default false. |
|
|
622
|
+
| `class` | `string` | Classes for the element. |
|
|
623
|
+
|
|
624
|
+
## `<NeonSwarm>`
|
|
625
|
+
|
|
626
|
+
NeonSwarm: a logo or a word held by a swarm of glowing particles that flows like a flock round its shape, shimmering and breathing, with short neon trails in the palette's colours. The pointer scatters them and they stream back; on arrival they gather from a loose cloud. See src/runtime/neon-swarm.js.
|
|
627
|
+
|
|
628
|
+
```astro
|
|
629
|
+
<section class="hero" style="position: relative">
|
|
630
|
+
<NeonSwarm src="/logo.svg" />
|
|
631
|
+
<h1>…</h1>
|
|
632
|
+
</section>
|
|
633
|
+
```
|
|
634
|
+
|
|
635
|
+
| Prop | Type | |
|
|
636
|
+
|---|---|---|
|
|
637
|
+
| `text` | `string` | A word (or a character) to gather the swarm into. |
|
|
638
|
+
| `font` | `string` | Its CSS font, without the size. Default: the page's, bold. |
|
|
639
|
+
| `src` | `string` | An image (an SVG logo, a PNG) to gather it into instead. |
|
|
640
|
+
| `area` | `{ x: number; y: number; width: number; height: number }` | Where the shape sits, each 0–1 from the top left. Default the right half. |
|
|
641
|
+
| `colors` | `string[]` | The palette across the swarm, three colours. Default neon cyan, lime, magenta. |
|
|
642
|
+
| `palette` | `PaletteName \| (string & {})` | A shared palette by name (`PALETTES`, any case), when there are no `colors`. |
|
|
643
|
+
| `background` | `string` | The ground. Default `#030406`. |
|
|
644
|
+
| `count` | `number` | How many particles (half on phones). Default 6000. |
|
|
645
|
+
| `size` | `number` | A particle's glowing core, CSS px. Default 2.4. |
|
|
646
|
+
| `trail` | `number` | How long the trails are, 0 (none) to 0.95. Default 0.82. |
|
|
647
|
+
| `flow` | `number` | How far the swarm drifts and breathes round the shape; 0 holds it still. Default 1. |
|
|
648
|
+
| `scatter` | `number` | How hard the pointer scatters them; 0 for not at all. Default 1. |
|
|
649
|
+
| `fixed` | `boolean` | Fill the viewport, behind the page (position: fixed, z-index -1). Default false. |
|
|
650
|
+
| `class` | `string` | Classes for the element. |
|
|
651
|
+
|
|
652
|
+
## `<Ocean>`
|
|
653
|
+
|
|
654
|
+
Ocean: open sea to the horizon, photoreal, as a hero background. Waves at every scale run before the wind, sunlight glows through their thin crests, a glittering path runs out under the sun, whitecaps break on a rough sea and high cloud drifts in the sky and its reflection. `time` sets the hour (dawn, noon, sunset, a moonlit night); the camera drifts with the pointer. See src/runtime/ocean.js.
|
|
655
|
+
|
|
656
|
+
```astro
|
|
657
|
+
<section class="hero" style="position: relative">
|
|
658
|
+
<Ocean time="sunset" />
|
|
659
|
+
<h1>Out past the <em>break.</em></h1>
|
|
660
|
+
</section>
|
|
661
|
+
```
|
|
662
|
+
|
|
663
|
+
| Prop | Type | |
|
|
664
|
+
|---|---|---|
|
|
665
|
+
| `time` | `'dawn' \| 'noon' \| 'sunset' \| 'night'` | The time of day: the sun, the sky's colours and the water's (`night` has a moon and stars). Default `sunset`. |
|
|
666
|
+
| `waves` | `number` | The sea state: 0 glassy, 1 a fresh breeze, 2 rough with whitecaps. Default 1. |
|
|
667
|
+
| `wind` | `number` | Where the waves run, degrees 0–360: 0 straight towards the viewer, 90 from left to right. Default 30. |
|
|
668
|
+
| `speed` | `number` | How fast the sea moves; 0 holds it still. Default 1. |
|
|
669
|
+
| `height` | `number` | How high the camera is above the water, metres, 1–20 (raised as far as the waves need). Default 4. |
|
|
670
|
+
| `horizon` | `number` | Where the horizon sits, 0–1 up the frame. Default 0.3. |
|
|
671
|
+
| `clouds` | `boolean` | Soft high cloud in the sky and its reflection. Default true. |
|
|
672
|
+
| `sun` | `{ x?: number; y?: number } \| null` | Where the sun (or moon) sits instead of the time's place: 0–1 across and up the frame. Default none. |
|
|
673
|
+
| `colors` | `string[]` | Tints, kept to each part's lightness: the sky, the water and the light. |
|
|
674
|
+
| `palette` | `PaletteName \| (string & {})` | A shared palette by name (`PALETTES`, any case) to tint with, when there are no `colors`. |
|
|
675
|
+
| `interactive` | `boolean` | Whether the camera drifts with the pointer. Default true. |
|
|
676
|
+
| `quiet` | `{ x?: number; y?: number; radius?: number; depth?: number } \| null` | An area dimmed behind copy: centre (0–1 from the top left), radius (a share of the height), depth (0–1). Default none; `{}` for the middle. |
|
|
677
|
+
| `fixed` | `boolean` | Fill the viewport, behind the page (position: fixed, z-index -1). Default false. |
|
|
678
|
+
| `class` | `string` | Classes for the element. |
|
|
679
|
+
|
|
680
|
+
## `<OutlineWordmark>`
|
|
681
|
+
|
|
682
|
+
OutlineWordmark: a name at enormous scale, drawn as one outline, cropped so it sinks out of the bottom of the page, with a bright beam travelling through the letters. A page's closing mark: it ends on the brand rather than trailing off after the last link column, and as an outline it reads as texture rather than a second logo.
|
|
683
|
+
|
|
684
|
+
```astro
|
|
685
|
+
<OutlineWordmark text="ArrayPress" color="var(--accent)" />
|
|
686
|
+
```
|
|
687
|
+
|
|
688
|
+
| Prop | Type | |
|
|
689
|
+
|---|---|---|
|
|
690
|
+
| `text` (required) | `string` | The name. |
|
|
691
|
+
| `color` | `string` | The colour of the outline and the beam. Default `currentColor`. |
|
|
692
|
+
| `crop` | `number` | Share of the glyph height left showing, 0–1. Default 0.68. |
|
|
693
|
+
| `size` | `number` | Type size, as a share of the box's width (18 is 18% of it). Default 18. |
|
|
694
|
+
| `stroke` | `number` | The outline's width, px. Default 2. |
|
|
695
|
+
| `opacity` | `number` | How strong the resting outline is, 0–1. Default 0.42. |
|
|
696
|
+
| `beam` | `boolean` | The travelling beam. Default true. |
|
|
697
|
+
| `speed` | `number` | Seconds the beam takes to cross. Default 5.5. |
|
|
698
|
+
| `spotlight` | `boolean` | A light under the pointer that fills the letters. Default true. |
|
|
699
|
+
| `radius` | `number` | The light's radius, a share of the type size. Default 0.6. |
|
|
700
|
+
| `tracking` | `number` | Letter spacing, em. Default -0.02. |
|
|
701
|
+
| `font` | `string` | CSS font-family. Default inherited. |
|
|
702
|
+
| `weight` | `number \| string` | CSS font-weight. Default 700. |
|
|
703
|
+
| `class` | `string` | Classes for the element. |
|
|
704
|
+
|
|
705
|
+
## `<PaperShader>`
|
|
706
|
+
|
|
707
|
+
PaperShader: any of the thirty Paper Shaders (mesh and grain gradients, god rays, liquid metal, water, warp, dithering, halftones, metaballs, voronoi, smoke rings and more), with Paper's own presets, and no React. See src/runtime/paper.js; the shaders are vendored from Paper (Apache-2.0).
|
|
708
|
+
|
|
709
|
+
```astro
|
|
710
|
+
<PaperShader shader="mesh-gradient" preset="beach" />
|
|
711
|
+
<PaperShader shader="god-rays" colors={['#a78bfa', '#f0abfc']} params={{ density: 0.4 }} opacity={0.6} />
|
|
712
|
+
<PaperShader shader="liquid-metal" image="/logo.svg" />
|
|
713
|
+
```
|
|
714
|
+
|
|
715
|
+
| Prop | Type | |
|
|
716
|
+
|---|---|---|
|
|
717
|
+
| `shader` (required) | `PaperShaderName` | The shader, by its file name. |
|
|
718
|
+
| `preset` | `string` | One of the shader's presets, by name (any case). Default its first. |
|
|
719
|
+
| `params` | `Record<string, unknown>` | Paper's settings for the shader (`distortion`, `colorBack`…), over the preset's. |
|
|
720
|
+
| `colors` | `string[]` | The shader's colours, over the preset's. |
|
|
721
|
+
| `image` | `string` | A picture for the shaders that bend or trace one. |
|
|
722
|
+
| `gradient` | `string[]` | Colours to make a picture from, when there is no `image`. |
|
|
723
|
+
| `gradientAngle` | `number` | The made picture's angle, degrees. Default 135. |
|
|
724
|
+
| `speed` | `number` | How fast it moves, over the preset's (0 is still). |
|
|
725
|
+
| `scale` | `number` | Share of the pixel ratio drawn at. Default 1. |
|
|
726
|
+
| `fixed` | `boolean` | Fill the viewport, behind the page (position: fixed, z-index -1). Default false. |
|
|
727
|
+
| `background` | `string` | The colour shown before it draws, and without WebGL 2. Default transparent. |
|
|
728
|
+
| `opacity` | `number` | Its opacity, 0–1, for backdrops under copy. Default 1. |
|
|
729
|
+
| `class` | `string` | Classes for the element. |
|
|
730
|
+
|
|
731
|
+
## `<Parallax>`
|
|
732
|
+
|
|
733
|
+
Parallax: a layer that drifts with the pointer over its region, by its depth; give layers different depths (negative ones move against the pointer) and they separate into depth. Decorative blobs behind a hero, a floating product shot. See src/runtime/tilt.js.
|
|
734
|
+
|
|
735
|
+
```astro
|
|
736
|
+
<section class="hero" data-parallax-root style="position: relative">
|
|
737
|
+
<Parallax depth={18} class="blob one" />
|
|
738
|
+
<Parallax depth={-12} class="blob two" />
|
|
739
|
+
</section>
|
|
740
|
+
```
|
|
741
|
+
|
|
742
|
+
| Prop | Type | |
|
|
743
|
+
|---|---|---|
|
|
744
|
+
| `as` | `HTMLTag` | The element to render. Default `div`. |
|
|
745
|
+
| `depth` | `number` | How far it drifts at the region's edge, px; negative moves against the pointer. Default 18. |
|
|
746
|
+
| `within` | `string` | A selector for the region. Default the nearest `[data-parallax-root]`, or the parent. |
|
|
747
|
+
| `class` | `string` | Classes for the element. |
|
|
748
|
+
|
|
749
|
+
## `<ParticleLogo>`
|
|
750
|
+
|
|
751
|
+
ParticleLogo: a logo or a word in thousands of twinkling particles that scatter and swirl round the pointer and tilt towards it, each dot fringed red and blue, over two slow blooms of colour. See src/runtime/particle-logo.js.
|
|
752
|
+
|
|
753
|
+
```astro
|
|
754
|
+
<section class="hero" style="position: relative">
|
|
755
|
+
<ParticleLogo src="/logo.svg" />
|
|
756
|
+
<h1>Rewind <em>wild.</em></h1>
|
|
757
|
+
</section>
|
|
758
|
+
```
|
|
759
|
+
|
|
760
|
+
| Prop | Type | |
|
|
761
|
+
|---|---|---|
|
|
762
|
+
| `text` | `string` | A word (or a character, an emoji) to draw in particles. |
|
|
763
|
+
| `font` | `string` | Its CSS font, without the size. Default: the page's, bold. |
|
|
764
|
+
| `src` | `string` | An image (an SVG logo, a PNG) to draw in particles instead. |
|
|
765
|
+
| `area` | `{ x: number; y: number; width: number; height: number }` | Where the shape sits, each 0–1 from the top left. Default the middle. |
|
|
766
|
+
| `colors` | `string[]` | The dots' two colours, then the two blooms'. Default white, ice blue, deep teal, midnight blue. |
|
|
767
|
+
| `palette` | `PaletteName \| (string & {})` | A shared palette by name (`PALETTES`, any case), when there are no `colors`. |
|
|
768
|
+
| `background` | `string` | The ground. Default `#030305`. |
|
|
769
|
+
| `count` | `number` | How many particles (half on phones). Default 16000. |
|
|
770
|
+
| `size` | `number` | A particle's size, CSS px. Default 2.2. |
|
|
771
|
+
| `swarm` | `number` | How strongly they scatter round the pointer; 0 for not at all. Default 1. |
|
|
772
|
+
| `tilt` | `number` | How far the mark tilts towards the pointer. Default 1. |
|
|
773
|
+
| `aberration` | `number` | How far red and blue part, CSS px; 0 for none. Default 1.5. |
|
|
774
|
+
| `fixed` | `boolean` | Fill the viewport, behind the page (position: fixed, z-index -1). Default false. |
|
|
775
|
+
| `class` | `string` | Classes for the element. |
|
|
776
|
+
|
|
777
|
+
## `<PixelGlitchText>`
|
|
778
|
+
|
|
779
|
+
PixelGlitchText: one line of text that breaks into pixels under the pointer and knits back together behind it. With `stroke`, a hollow outline at rest that the pixels fill in. See src/runtime/pixel-glitch.js.
|
|
780
|
+
|
|
781
|
+
```astro
|
|
782
|
+
<footer>
|
|
783
|
+
<PixelGlitchText as="div" class="wordmark" fit stroke={1.5} aria-hidden="true">Northwave</PixelGlitchText>
|
|
784
|
+
</footer>
|
|
785
|
+
```
|
|
786
|
+
|
|
787
|
+
| Prop | Type | |
|
|
788
|
+
|---|---|---|
|
|
789
|
+
| `cell` | `number` | The heat grid's cell, CSS px. Default 14. |
|
|
790
|
+
| `reach` | `number` | How far the pointer's heat reaches, CSS px. Default 120. |
|
|
791
|
+
| `decay` | `number` | Heat kept each frame (0.9 is gone in about half a second). Default 0.9. |
|
|
792
|
+
| `block` | `number` | The pixel block size at full heat, CSS px. Default 22. |
|
|
793
|
+
| `shift` | `number` | How far the hottest rows slip sideways, CSS px. Default 16. |
|
|
794
|
+
| `stroke` | `number` | With a width (CSS px), the text at rest is an outline that the pixels fill. Default 0 (solid). |
|
|
795
|
+
| `as` | `HTMLTag` | The element to render. Default `span`. |
|
|
796
|
+
| `fit` | `boolean` | Size the text to span its parent's width. Default false. |
|
|
797
|
+
| `class` | `string` | Classes for the element. |
|
|
798
|
+
|
|
799
|
+
## `<PointCloud>`
|
|
800
|
+
|
|
801
|
+
PointCloud: a word drawn as a matrix of bright dots among rippling sheets of point cloud, the scene tilting towards the pointer. With `trackers`, boxes lock onto the word like a detector's debug view. See src/runtime/point-cloud.js.
|
|
802
|
+
|
|
803
|
+
```astro
|
|
804
|
+
<section class="hero" style="position: relative">
|
|
805
|
+
<PointCloud text="inference" />
|
|
806
|
+
</section>
|
|
807
|
+
```
|
|
808
|
+
|
|
809
|
+
| Prop | Type | |
|
|
810
|
+
|---|---|---|
|
|
811
|
+
| `text` | `string` | The word drawn in dots. |
|
|
812
|
+
| `font` | `string` | Its CSS font, without the size. Default: the page's, bold. |
|
|
813
|
+
| `src` | `string` | An image (an SVG logo) to draw in dots instead. |
|
|
814
|
+
| `area` | `{ x: number; y: number; width: number; height: number }` | Where the word sits, each 0–1 from the top left. Default across the middle. |
|
|
815
|
+
| `colors` | `string[]` | The word's dots, then the clouds' low and high colours. Default white, deep blue, sky blue. |
|
|
816
|
+
| `palette` | `PaletteName \| (string & {})` | A shared palette by name (`PALETTES`, any case), when there are no `colors`. |
|
|
817
|
+
| `background` | `string` | The ground. Default `#020205`. |
|
|
818
|
+
| `columns` | `number` | Dots across the word's grid. Default 110. |
|
|
819
|
+
| `dot` | `number` | A word dot's size, a share of the grid's spacing. Default 0.72. |
|
|
820
|
+
| `sheets` | `number` | How many sheets of point cloud. Default 9. |
|
|
821
|
+
| `pointSize` | `number` | A cloud point's size, CSS px. Default 2.2. |
|
|
822
|
+
| `trackers` | `number` | Tracker boxes locking onto the word, a detector's debug look (try 4); 0 for none. Default 0. |
|
|
823
|
+
| `tilt` | `number` | How far the scene tilts towards the pointer. Default 1. |
|
|
824
|
+
| `fixed` | `boolean` | Fill the viewport, behind the page (position: fixed, z-index -1). Default false. |
|
|
825
|
+
| `class` | `string` | Classes for the element. |
|
|
826
|
+
|
|
827
|
+
## `<ProductStack>`
|
|
828
|
+
|
|
829
|
+
ProductStack: a store's product covers floating in 3D, in a fan, a stack or a carousel arc, with depth of field, soft shadows and a gloss that sweeps across the cover in front. The stack leans towards the pointer; hovered, the covers fan apart and the one under the pointer lifts forward and comes into focus; left alone, they drift. See src/runtime/product-stack.js.
|
|
830
|
+
|
|
831
|
+
```astro
|
|
832
|
+
<ProductStack items={[{ src: '/covers/drums.webp', href: '/p/drums', alt: 'Night Drums, a sample pack' }, …]} />
|
|
833
|
+
<ProductStack layout="arc"><a href="/p/serif"><img src="/covers/serif.webp" alt="Halden Serif" /></a>…</ProductStack>
|
|
834
|
+
```
|
|
835
|
+
|
|
836
|
+
| Prop | Type | |
|
|
837
|
+
|---|---|---|
|
|
838
|
+
| `items` | `StackItem[]` | The covers. Without them, the children are the covers: each a link (or another element) holding one image. |
|
|
839
|
+
| `layout` | `'fan' \| 'stack' \| 'arc'` | How the covers are laid out: a hand of cards (`fan`, the middle cover in front), a deck seen at an angle (`stack`, the first in front) or a carousel arc (`arc`). Default `fan`. |
|
|
840
|
+
| `spread` | `number` | How far apart the covers sit, 0–2. Default 1. |
|
|
841
|
+
| `tilt` | `number` | How far the stack leans towards the pointer, degrees, 0–30. Default 12. |
|
|
842
|
+
| `float` | `number` | How far the covers drift when left alone, 0–1; 0 holds them still. Default 0.5. |
|
|
843
|
+
| `depth` | `number` | Depth of field: how much the covers behind dim and soften, 0–1. Default 0.6. |
|
|
844
|
+
| `interactive` | `boolean` | Lean towards the pointer, fan apart on hover and lift the cover under the pointer or in focus. Default true. |
|
|
845
|
+
| `size` | `string` | The widest a cover gets, a CSS length; covers shrink to fit the container. Default `280px`. |
|
|
846
|
+
| `ratio` | `number` | A cover's width over its height: 1 square, 0.75 a book. Default 1. |
|
|
847
|
+
| `radius` | `number` | The covers' corner radius, px, 0–40. Default 10. |
|
|
848
|
+
| `label` | `string` | The group's name for screen readers. Default `Products`. |
|
|
849
|
+
| `class` | `string` | Classes for the element. |
|
|
850
|
+
|
|
851
|
+
## `<PulseMark>`
|
|
852
|
+
|
|
853
|
+
PulseMark: a small animated mark for a logo, a loading state or a "live" badge, drawn in SVG and moved by CSS alone (no script).
|
|
854
|
+
|
|
855
|
+
```astro
|
|
856
|
+
<PulseMark variant="sonar" size={40} color="#00ff88" glow />
|
|
857
|
+
```
|
|
858
|
+
|
|
859
|
+
| Prop | Type | |
|
|
860
|
+
|---|---|---|
|
|
861
|
+
| `variant` | `'matrix' \| 'rings' \| 'sonar'` | The mark. Default `matrix`. |
|
|
862
|
+
| `size` | `number \| string` | Its width and height, px or any CSS length. Default `1em`. |
|
|
863
|
+
| `color` | `string` | Its colour. Default the text colour. |
|
|
864
|
+
| `glow` | `boolean` | A soft glow round it. Default false. |
|
|
865
|
+
| `cells` | `number` | Blocks along each side of the matrix. Default 6. |
|
|
866
|
+
| `speed` | `number` | Speed, as a multiple. Default 1. |
|
|
867
|
+
| `label` | `string` | Its accessible name; without one it is decorative. |
|
|
868
|
+
| `class` | `string` | Classes for the element. |
|
|
869
|
+
|
|
870
|
+
## `<RadiantGlass>`
|
|
871
|
+
|
|
872
|
+
RadiantGlass: a cluster of frosted glass tiles on a dark ground, lit from inside by big soft lights drifting behind them, which shift with the pointer. Each tile has a thin two-tone rim and a soft halo. See src/runtime/radiant-glass.js.
|
|
873
|
+
|
|
874
|
+
```astro
|
|
875
|
+
<section class="hero" style="position: relative">
|
|
876
|
+
<RadiantGlass side="left" />
|
|
877
|
+
<h1 style="text-align: right">…</h1>
|
|
878
|
+
</section>
|
|
879
|
+
```
|
|
880
|
+
|
|
881
|
+
| Prop | Type | |
|
|
882
|
+
|---|---|---|
|
|
883
|
+
| `colors` | `string[]` | The lights' colours, the last the hot colour where they gather. Default amber, blue, white. |
|
|
884
|
+
| `palette` | `PaletteName \| (string & {})` | A shared palette by name (`PALETTES`, any case), when there are no `colors`. Its colours light the glass; its glint is the hot colour. |
|
|
885
|
+
| `background` | `string` | The ground. Default `#060818`. |
|
|
886
|
+
| `layout` | `'cross' \| 'diagonal' \| 'single'` | The tiles: four in a plus, three on a slant, or one large. Default `cross`. |
|
|
887
|
+
| `shape` | `'diamond' \| 'square' \| 'circle'` | Each tile's shape: a rounded square on its corner, square on, or round. Default `diamond`. |
|
|
888
|
+
| `side` | `'left' \| 'right'` | Which side the cluster sits on, leaving the other for the copy. Default `left`. |
|
|
889
|
+
| `size` | `number` | The cluster's size; 1 fills the height. Default 1. |
|
|
890
|
+
| `frost` | `number` | How blurred the light through the glass is; 0 for clear. Default 1. |
|
|
891
|
+
| `glow` | `number` | How strong the halo round each tile is; 0 for none. Default 1. |
|
|
892
|
+
| `rim` | `number` | How bright the rim line is; 0 for none. Default 1. |
|
|
893
|
+
| `speed` | `number` | How fast the lights drift. Default 1. |
|
|
894
|
+
| `fixed` | `boolean` | Fill the viewport, behind the page (position: fixed, z-index -1). Default false. |
|
|
895
|
+
| `class` | `string` | Classes for the element. |
|
|
896
|
+
|
|
897
|
+
## `<RainOnGlass>`
|
|
898
|
+
|
|
899
|
+
RainOnGlass: rain on a window over a photo, like looking out of a café on a wet evening. Beads sit on the glass; larger drops run down it, leaving clear trails that fog over again; each drop holds the photo sharp and upside down, while the rest is soft behind the condensation, its lights opened into bokeh. The pointer wipes a clear patch. See src/runtime/rain-on-glass.js.
|
|
900
|
+
|
|
901
|
+
```astro
|
|
902
|
+
<section class="hero" style="position: relative">
|
|
903
|
+
<RainOnGlass src="/photos/street-at-night.jpg" alt="A wet street of neon signs at night" />
|
|
904
|
+
<h1>Come in out of the rain.</h1>
|
|
905
|
+
</section>
|
|
906
|
+
```
|
|
907
|
+
|
|
908
|
+
| Prop | Type | |
|
|
909
|
+
|---|---|---|
|
|
910
|
+
| `src` (required) | `string` | The photo behind the glass (same origin, or served with CORS). |
|
|
911
|
+
| `rain` | `number` | How much rain, 0–1: beads on the glass and drops running down it. Default 0.6. |
|
|
912
|
+
| `blur` | `number` | How soft the photo is behind the glass, 0–1. Default 0.6. |
|
|
913
|
+
| `fog` | `number` | How thick the condensation is, 0–1. Default 0.5. |
|
|
914
|
+
| `speed` | `number` | How fast the drops run and the beads come and go, 0–3. Default 1. |
|
|
915
|
+
| `interactive` | `boolean` | The pointer wipes a clear patch that fogs back over. Default true. |
|
|
916
|
+
| `tint` | `string` | The colour of the fog. Default `#a3b8cc`. |
|
|
917
|
+
| `bokeh` | `number` | How strongly the photo's lights open into bokeh discs, 0–1. Default 0.6. |
|
|
918
|
+
| `colors` | `string[]` | Colours for the bokeh discs. Default: each light's own colour. |
|
|
919
|
+
| `palette` | `PaletteName \| (string & {})` | A shared palette by name (`PALETTES`, any case), when there are no `colors`. |
|
|
920
|
+
| `alt` | `string` | What the photo shows, for the `<img>` under the glass. Default empty (decorative). |
|
|
921
|
+
| `fixed` | `boolean` | Fill the viewport, behind the page (position: fixed, z-index -1). Default false. |
|
|
922
|
+
| `class` | `string` | Classes for the element. |
|
|
923
|
+
|
|
924
|
+
## `<Reveal>`
|
|
925
|
+
|
|
926
|
+
Reveal: content that rises, slides, zooms or un-blurs into place as it scrolls into view; with `words` and `text`, each word on its own, one after another. Visible without JavaScript (only once the script runs is it hidden to be revealed) and with reduced motion. See src/runtime/text-motion.js.
|
|
927
|
+
|
|
928
|
+
```astro
|
|
929
|
+
<Reveal from="up"><h2>Made for one kind of business</h2></Reveal>
|
|
930
|
+
<Reveal as="h1" words text="Skip the build. Start selling." />
|
|
931
|
+
```
|
|
932
|
+
|
|
933
|
+
| Prop | Type | |
|
|
934
|
+
|---|---|---|
|
|
935
|
+
| `from` | `'up' \| 'down' \| 'left' \| 'right' \| 'fade' \| 'zoom' \| 'blur'` | How it arrives. Default `up`. |
|
|
936
|
+
| `words` | `boolean` | Each word arrives on its own, one after another. Default false. |
|
|
937
|
+
| `stagger` | `number` | Seconds between words. Default 0.06. |
|
|
938
|
+
| `delay` | `number` | Seconds before it starts. Default 0. |
|
|
939
|
+
| `once` | `boolean` | Only the first time it comes into view. Default true. |
|
|
940
|
+
| `as` | `HTMLTag` | The element to render. Default `div`. |
|
|
941
|
+
| `text` | `string` | With `words`: the text, split into words. |
|
|
942
|
+
| `duration` | `number` | Seconds the arrival takes. Default 0.7. |
|
|
943
|
+
| `distance` | `number` | How far it travels, px. Default 24. |
|
|
944
|
+
| `class` | `string` | Classes for the element. |
|
|
945
|
+
|
|
946
|
+
## `<ScrambleText>`
|
|
947
|
+
|
|
948
|
+
ScrambleText: text that resolves out of random characters, left to right, when it scrolls into view, and again on hover if asked. For a label, a stat, a short headline. Screen readers and search get the real text; the scramble is drawn over it. See src/runtime/text-motion.js.
|
|
949
|
+
|
|
950
|
+
```astro
|
|
951
|
+
<h2><ScrambleText text="Inference at the edge" hover /></h2>
|
|
952
|
+
```
|
|
953
|
+
|
|
954
|
+
| Prop | Type | |
|
|
955
|
+
|---|---|---|
|
|
956
|
+
| `characters` | `string` | What it scrambles through. Default letters, digits and a few symbols. |
|
|
957
|
+
| `duration` | `number` | Seconds to resolve. Default 0.9. |
|
|
958
|
+
| `hover` | `boolean` | Scramble again when the pointer comes over it. Default false. |
|
|
959
|
+
| `text` (required) | `string` | The text. |
|
|
960
|
+
| `as` | `HTMLTag` | The element to render. Default `span`. |
|
|
961
|
+
| `class` | `string` | Classes for the element. |
|
|
962
|
+
|
|
963
|
+
## `<ScrollReveal>`
|
|
964
|
+
|
|
965
|
+
ScrollReveal: scroll reveal for a whole site by class. Put it once in the layout, then `class="fade-in-up"` (or any reveal.css class: fades, slides, zooms, flips, `blur-in`) on anything that should arrive as it scrolls into view. Survives view transitions; everything shows without JavaScript and with reduced motion. For one element, or word by word, use `<Reveal>`. See src/runtime/scroll-reveal.js.
|
|
966
|
+
|
|
967
|
+
```astro
|
|
968
|
+
<ScrollReveal />
|
|
969
|
+
<section class="fade-in-up">…</section>
|
|
970
|
+
<div class="zoom-in" style="--reveal-delay: 0.1s">…</div>
|
|
971
|
+
```
|
|
972
|
+
|
|
973
|
+
| Prop | Type | |
|
|
974
|
+
|---|---|---|
|
|
975
|
+
| `selector` | `string` | What to reveal. Default the reveal.css classes. |
|
|
976
|
+
| `visibleClass` | `string` | The class added on arrival. Default `is-visible`. |
|
|
977
|
+
| `threshold` | `number` | How much must be in view, 0–1. Default 0.08. |
|
|
978
|
+
| `rootMargin` | `string` | The observer's margin. Default `0px 0px -10% 0px`. |
|
|
979
|
+
| `once` | `boolean` | Reveal once; false hides it again when it leaves, to replay. Default true. |
|
|
980
|
+
|
|
981
|
+
## `<ShaderBackground>`
|
|
982
|
+
|
|
983
|
+
ShaderBackground: six animated shader backgrounds for a hero or section, tinted from `--color-accent` with no settings (the page's, or a section's own): mesh-gradient, grain-gradient, silk, band-lens, grid and waves. See src/runtime/shader-background.js.
|
|
984
|
+
|
|
985
|
+
```astro
|
|
986
|
+
<section style="position: relative">
|
|
987
|
+
<ShaderBackground effect="silk" speed={0.6} intensity={0.7} />
|
|
988
|
+
<h1>Your hero</h1>
|
|
989
|
+
</section>
|
|
990
|
+
<ShaderBackground effect="mesh-gradient" static frame={14} intensity={0.45} fade="none" fixed />
|
|
991
|
+
```
|
|
992
|
+
|
|
993
|
+
| Prop | Type | |
|
|
994
|
+
|---|---|---|
|
|
995
|
+
| `effect` (required) | `ShaderBackgroundName` | Which shader background. |
|
|
996
|
+
| `colors` | `string[]` | Up to four colours (hex or `rgb()`); those missing come from `--color-accent` where it sits: the accent, the accent towards `--color-bg`, its hue turned 30° towards yellow and lifted, its hue turned 45° away from yellow (in Oklab). Only mesh-gradient, grain-gradient and silk use the fourth. Default all four from the accent. |
|
|
997
|
+
| `palette` | `PaletteName \| (string & {})` | A shared palette by name (`PALETTES`, any case), when there are no `colors`. |
|
|
998
|
+
| `speed` | `number` | How fast it moves, 0–4. Default 1. |
|
|
999
|
+
| `intensity` | `number` | How strong it is (brightness and contrast, not opacity), 0–2. Default 1. |
|
|
1000
|
+
| `static` | `boolean` | One frame, never the loop: for a shader background that is wallpaper. Default false. |
|
|
1001
|
+
| `frame` | `number` | With `static`, the moment drawn, in seconds. Default 12. |
|
|
1002
|
+
| `interactive` | `boolean` | Lean towards the pointer, on devices that hover. Default false. |
|
|
1003
|
+
| `opacity` | `number` | Its opacity, 0–1, to fade it against the section without changing the shader. Default 1. |
|
|
1004
|
+
| `blend` | `string` | CSS `mix-blend-mode` with what is behind it (`screen`, `lighten`, `plus-lighter`…), for layering over imagery. Default normal. |
|
|
1005
|
+
| `fade` | `'none' \| 'bottom' \| 'top' \| 'both'` | Fade it out towards an edge, so it melts into the page: 'bottom', 'top', 'both' (top and bottom) or 'none'. Default 'bottom'. |
|
|
1006
|
+
| `fixed` | `boolean` | Fill the viewport, behind the page (position: fixed, z-index -1). Default false. |
|
|
1007
|
+
| `class` | `string` | Classes for the element. |
|
|
1008
|
+
|
|
1009
|
+
## `<SignalLines>`
|
|
1010
|
+
|
|
1011
|
+
SignalLines: layered waveform lines drawn as light, with a drifting loudness: sharp bright lines in front, soft out-of-focus ones behind, a shimmer where they cross, pulses of light running along them, and the pointer as a lens they part round. A quiet audio motif for behind a hero's copy. See src/runtime/waves.js.
|
|
1012
|
+
|
|
1013
|
+
```astro
|
|
1014
|
+
<section class="hero" style="position: relative">
|
|
1015
|
+
<SignalLines />
|
|
1016
|
+
<h1>…</h1>
|
|
1017
|
+
</section>
|
|
1018
|
+
```
|
|
1019
|
+
|
|
1020
|
+
| Prop | Type | |
|
|
1021
|
+
|---|---|---|
|
|
1022
|
+
| `color` | `string` | One colour for every line. Default: the `colors` gradient. |
|
|
1023
|
+
| `colors` | `string[]` | Colours the lines run through from left to right, blended in Oklab. Default sea-glass, ice and pale gold. |
|
|
1024
|
+
| `palette` | `PaletteName \| (string & {})` | A shared palette by name (`PALETTES`, any case), when there are no `colors` or `color`. |
|
|
1025
|
+
| `pulse` | `string` | The pulses' colour. Default `#fafafa`. |
|
|
1026
|
+
| `lines` | `number` | How many lines, 2–12. Default 7. |
|
|
1027
|
+
| `amplitude` | `number` | How tall the waves are. Default 1. |
|
|
1028
|
+
| `speed` | `number` | How fast they move. Default 1. |
|
|
1029
|
+
| `pulses` | `number` | How often pulses run; 0 for none. Default 1. |
|
|
1030
|
+
| `glow` | `number` | How much light the lines and pulses give off, 0–2. Default 1. |
|
|
1031
|
+
| `grain` | `number` | Film grain in the light, 0–1. Default 0.5. |
|
|
1032
|
+
| `depth` | `number` | How far out of focus the back lines are, and how much their colours fringe; 0 for all sharp. Default 1. |
|
|
1033
|
+
| `bend` | `number` | How far the lines part round the pointer and how much it lights them; 0 for not at all. Default 1. |
|
|
1034
|
+
| `audio` | `AudioSource` | Follow the sound playing: `'page'` for whatever plays, or a CSS selector for an `<audio>`/`<video>` or a player's container (a WaveformPlayer). The lines carry its waveform, as tall as it is loud, and kicks send pulses; while nothing plays they keep their own motion. Default none. |
|
|
1035
|
+
| `quiet` | `{ x?: number; y?: number; radius?: number; depth?: number } \| null` | An area where the light dims (behind a headline): centre x/y (0–1, from the top left), radius (a share of the height) and depth (0 none, 1 dark). Default none. |
|
|
1036
|
+
| `fade` | `boolean` | Fade the left and right edges out. Default true. |
|
|
1037
|
+
| `class` | `string` | Classes for the element. |
|
|
1038
|
+
|
|
1039
|
+
## `<SilkRibbon>`
|
|
1040
|
+
|
|
1041
|
+
SilkRibbon: a wide ribbon of satin twisting across a light ground, soft folds gathering where it turns and a sheen along each one, with an out-of-focus glow of the same colours behind it. The folds undulate slowly and lean towards the pointer. See src/runtime/silk-ribbon.js.
|
|
1042
|
+
|
|
1043
|
+
```astro
|
|
1044
|
+
<section class="hero" style="position: relative">
|
|
1045
|
+
<SilkRibbon side="right" />
|
|
1046
|
+
<h1>Soft to the touch.</h1>
|
|
1047
|
+
</section>
|
|
1048
|
+
```
|
|
1049
|
+
|
|
1050
|
+
| Prop | Type | |
|
|
1051
|
+
|---|---|---|
|
|
1052
|
+
| `colors` | `string[]` | The satin's colours, shaded from the darkest to the lightest whatever their order. Default hot pink, coral, peach. |
|
|
1053
|
+
| `palette` | `PaletteName \| (string & {})` | A shared palette by name (`PALETTES`, any case), when there are no `colors`. |
|
|
1054
|
+
| `background` | `string` | The ground around the ribbon. Default `#f6f4f1`. |
|
|
1055
|
+
| `side` | `'right' \| 'left' \| 'center'` | Where the ribbon runs. Default `right`. |
|
|
1056
|
+
| `twist` | `number` | How tightly it turns along its length; 0 lies flat. Default 1. |
|
|
1057
|
+
| `folds` | `number` | How deep the folds along it are; 0 for flat satin. Default 1. |
|
|
1058
|
+
| `glow` | `number` | The soft out-of-focus glow behind it; 0 for none. Default 1. |
|
|
1059
|
+
| `speed` | `number` | How fast the folds move. Default 1. |
|
|
1060
|
+
| `fixed` | `boolean` | Fill the viewport, behind the page (position: fixed, z-index -1). Default false. |
|
|
1061
|
+
| `class` | `string` | Classes for the element. |
|
|
1062
|
+
|
|
1063
|
+
## `<SpotlightText>`
|
|
1064
|
+
|
|
1065
|
+
SpotlightText: one line of text as a faint outline that a light under the pointer fills in, falling off as light does: bright for a short way, then a long soft tail. See src/runtime/spotlight.js.
|
|
1066
|
+
|
|
1067
|
+
```astro
|
|
1068
|
+
<SpotlightText as="div" class="wordmark" aria-hidden="true">LumiThemes</SpotlightText>
|
|
1069
|
+
```
|
|
1070
|
+
|
|
1071
|
+
| Prop | Type | |
|
|
1072
|
+
|---|---|---|
|
|
1073
|
+
| `radius` | `number` | The light's radius, a share of the font size. Default 0.85. |
|
|
1074
|
+
| `reach` | `number` | How far outside the text (CSS px) the pointer still lights it. Default 40. |
|
|
1075
|
+
| `as` | `HTMLTag` | The element to render. Default `span`. |
|
|
1076
|
+
| `stroke` | `string` | The outline's width. Default `1.5px`. |
|
|
1077
|
+
| `fill` | `'dodge' \| 'solid'` | How the lit letters fill. Default `dodge`. |
|
|
1078
|
+
| `fit` | `boolean` | Size the text to span its parent's width. Default false. |
|
|
1079
|
+
| `class` | `string` | Classes for the element. |
|
|
1080
|
+
|
|
1081
|
+
## `<Tilt>`
|
|
1082
|
+
|
|
1083
|
+
Tilt: a card, an image or an object that leans towards the pointer in perspective while it is over it, with a soft glare that follows, and settles back when it leaves. See src/runtime/tilt.js.
|
|
1084
|
+
|
|
1085
|
+
```astro
|
|
1086
|
+
<Tilt as="a" href="/release" class="card" max={6} glare>…</Tilt>
|
|
1087
|
+
```
|
|
1088
|
+
|
|
1089
|
+
| Prop | Type | |
|
|
1090
|
+
|---|---|---|
|
|
1091
|
+
| `as` | `HTMLTag` | The element to render. Default `div`. |
|
|
1092
|
+
| `max` | `number` | The most it leans, degrees. Default 8. |
|
|
1093
|
+
| `perspective` | `number` | The perspective's distance, px; smaller is more dramatic. Default 900. |
|
|
1094
|
+
| `glare` | `boolean` | A light glare that follows the pointer. Default false. |
|
|
1095
|
+
| `lift` | `number` | How far it lifts towards the viewer while tilted, px. Default 0. |
|
|
1096
|
+
| `within` | `string` | A selector for a larger region to follow the pointer over. Default the element. |
|
|
1097
|
+
| `class` | `string` | Classes for the element. |
|
|
1098
|
+
|
|
1099
|
+
## `<Topography>`
|
|
1100
|
+
|
|
1101
|
+
Topography: a survey map that never sits still. The contour lines of a slowly drifting landscape, every fifth an index line drawn heavier, at a constant pixel width. Under the pointer the ground swells and its lines glow; `labels` sets small elevation numbers on a few index lines. See src/runtime/topography.js.
|
|
1102
|
+
|
|
1103
|
+
```astro
|
|
1104
|
+
<section class="hero" style="position: relative">
|
|
1105
|
+
<Topography colors={['#8a5a33']} background="#f3ead6" labels />
|
|
1106
|
+
<h1>Every trail, <em>walked first.</em></h1>
|
|
1107
|
+
</section>
|
|
1108
|
+
```
|
|
1109
|
+
|
|
1110
|
+
| Prop | Type | |
|
|
1111
|
+
|---|---|---|
|
|
1112
|
+
| `colors` | `string[]` | The lines' colour, or a gradient by elevation from the valleys to the peaks (up to five), blended in Oklab. Default a pale blue. |
|
|
1113
|
+
| `palette` | `PaletteName \| (string & {})` | A shared palette by name (`PALETTES`, any case), as a gradient by elevation, when there are no `colors`. |
|
|
1114
|
+
| `background` | `string` | The ground the lines are drawn on. Default `#0c1a2b`. |
|
|
1115
|
+
| `density` | `number` | About how many lines cross the screen from top to bottom, 6–60. Default 24. |
|
|
1116
|
+
| `thickness` | `number` | The lines' width, CSS px, 0.5–3; index lines are twice as wide. Default 1. |
|
|
1117
|
+
| `major` | `number` | Every n-th line is an index line, drawn heavier, 0–10; 0 for none. Default 5. |
|
|
1118
|
+
| `scale` | `number` | How large the hills are, 0.4–3. Default 1. |
|
|
1119
|
+
| `speed` | `number` | How fast the land drifts, 0–4; 0 holds it still. Default 1. |
|
|
1120
|
+
| `glow` | `number` | How strongly the lines glow under the pointer, 0–2; 0 for none. Default 1. |
|
|
1121
|
+
| `interactive` | `boolean` | Whether the pointer raises the ground and lights its lines. Default true. |
|
|
1122
|
+
| `labels` | `boolean` | Small elevation numbers on a few index lines. Default false. |
|
|
1123
|
+
| `quiet` | `{ x?: number; y?: number; radius?: number; depth?: number } \| null` | An area kept dim behind copy: centre (0–1 from the top left), radius (a share of the height), depth (0–1). Default none; `{}` for the middle. |
|
|
1124
|
+
| `fixed` | `boolean` | Fill the viewport, behind the page (position: fixed, z-index -1). Default false. |
|
|
1125
|
+
| `class` | `string` | Classes for the element. |
|
|
1126
|
+
|
|
1127
|
+
## `<Typewriter>`
|
|
1128
|
+
|
|
1129
|
+
Typewriter: types phrases one after another behind a blinking caret, deleting each before the next. "Sell beats / sample packs / presets." Screen readers get the phrases as a list once, not a stream of letters; with reduced motion the first phrase simply shows. See src/runtime/text-motion.js.
|
|
1130
|
+
|
|
1131
|
+
```astro
|
|
1132
|
+
<h1>Sell <Typewriter phrases={['beats', 'sample packs', 'presets']} /> online.</h1>
|
|
1133
|
+
```
|
|
1134
|
+
|
|
1135
|
+
| Prop | Type | |
|
|
1136
|
+
|---|---|---|
|
|
1137
|
+
| `phrases` (required) | `string[]` | What it types, in turn. |
|
|
1138
|
+
| `speed` | `number` | Milliseconds a character when typing. Default 55. |
|
|
1139
|
+
| `pause` | `number` | Milliseconds a finished phrase stays. Default 1600. |
|
|
1140
|
+
| `loop` | `boolean` | Start again after the last. Default true. |
|
|
1141
|
+
| `caret` | `string` | The caret's colour. Default the text colour. |
|
|
1142
|
+
| `class` | `string` | Classes for the element. |
|
|
1143
|
+
|
|
1144
|
+
## `<VariableType>`
|
|
1145
|
+
|
|
1146
|
+
VariableType: a headline in a variable font whose letters swell under the pointer, heavier and wider in a smooth wave, and ease back when it leaves; with nothing over it, a gentle swell travels along the line. For a type foundry, or any bold brand. The text stays real text. See src/runtime/variable-type.js.
|
|
1147
|
+
|
|
1148
|
+
```astro
|
|
1149
|
+
<VariableType as="h1" fit>Torsion</VariableType>
|
|
1150
|
+
<VariableType as="h2" axes={{ wght: [300, 1000], wdth: [100, 151], slnt: [0, -10] }}>Bend</VariableType>
|
|
1151
|
+
```
|
|
1152
|
+
|
|
1153
|
+
| Prop | Type | |
|
|
1154
|
+
|---|---|---|
|
|
1155
|
+
| `axes` | `Axes` | The axes that swell, `{ tag: [rest, peak] }`. Axes the font lacks do nothing. Default `{ wght: [100, 900], wdth: [75, 125] }`. |
|
|
1156
|
+
| `radius` | `number` | How far a swell reaches from the pointer, in ems (0.3–4). Default 1.1. |
|
|
1157
|
+
| `falloff` | `number` | How it drops off: 0 a broad hill, 1 a sharp peak (0–1). Default 0.5. |
|
|
1158
|
+
| `idle` | `number` | How far the travelling swell rises with nothing over the text: 0 none, 1 to the peak (0–1). Default 0.35. |
|
|
1159
|
+
| `fit` | `boolean` | Size the line so that at its widest swell it spans its parent's width. Default false. |
|
|
1160
|
+
| `as` | `HTMLTag` | The element to render. Default `div`. |
|
|
1161
|
+
| `class` | `string` | Classes for the element. |
|
|
1162
|
+
|
|
1163
|
+
## `<VoxelLogo>`
|
|
1164
|
+
|
|
1165
|
+
VoxelLogo: a logo or character built of cubes, rocking slowly in perspective and turning towards the pointer, outlined where cubes meet and dithered down to two inks. With `markers`, tracking markers ring it. See src/runtime/voxel-logo.js.
|
|
1166
|
+
|
|
1167
|
+
```astro
|
|
1168
|
+
<section class="cta" style="position: relative">
|
|
1169
|
+
<VoxelLogo text="✳" colors={['#a7f3d0', '#08090a']} />
|
|
1170
|
+
<h2>Your next release starts here.</h2>
|
|
1171
|
+
</section>
|
|
1172
|
+
```
|
|
1173
|
+
|
|
1174
|
+
| Prop | Type | |
|
|
1175
|
+
|---|---|---|
|
|
1176
|
+
| `text` | `string` | A character or word to build in cubes. |
|
|
1177
|
+
| `font` | `string` | Its CSS font, without the size. Default: the page's, bold. |
|
|
1178
|
+
| `src` | `string` | An image (an SVG logo) to build instead. |
|
|
1179
|
+
| `area` | `{ x: number; y: number; width: number; height: number }` | Where the solid sits, each 0–1 from the top left. Default the right half. |
|
|
1180
|
+
| `colors` | `string[]` | The ink, then the paper. Default mint on near-black. |
|
|
1181
|
+
| `palette` | `PaletteName \| (string & {})` | A shared palette by name (`PALETTES`, any case), when there are no `colors`. |
|
|
1182
|
+
| `size` | `number` | How large the solid is in its area (1 just fits when face-on). Default 1.3. |
|
|
1183
|
+
| `cells` | `number` | Cubes across the shape. Default 28. |
|
|
1184
|
+
| `depth` | `number` | Cubes deep. Default 4. |
|
|
1185
|
+
| `dither` | `number` | The dither's pixel size, CSS px; 0 for smooth shading. Default 2. |
|
|
1186
|
+
| `markers` | `number` | Tracking markers ringing the solid (try 6); 0 for none. Default 0. |
|
|
1187
|
+
| `rock` | `number` | How far it rocks and turns towards the pointer. Default 1. |
|
|
1188
|
+
| `fixed` | `boolean` | Fill the viewport, behind the page (position: fixed, z-index -1). Default false. |
|
|
1189
|
+
| `class` | `string` | Classes for the element. |
|
|
1190
|
+
|
|
1191
|
+
## `<WaveBars>`
|
|
1192
|
+
|
|
1193
|
+
WaveBars: a glowing bar waveform over its reflection, retuning every couple of seconds like a meter (peak marks that hold and drop), with a playhead sweeping across that lights and kicks the bars it plays, and the pointer scrubbing. A quiet audio motif for behind a hero's copy. See src/runtime/waves.js.
|
|
1194
|
+
|
|
1195
|
+
```astro
|
|
1196
|
+
<section class="hero" style="position: relative">
|
|
1197
|
+
<WaveBars />
|
|
1198
|
+
<h1>…</h1>
|
|
1199
|
+
</section>
|
|
1200
|
+
```
|
|
1201
|
+
|
|
1202
|
+
| Prop | Type | |
|
|
1203
|
+
|---|---|---|
|
|
1204
|
+
| `color` | `string` | One colour for every bar. Default: the `colors` gradient. |
|
|
1205
|
+
| `colors` | `string[]` | Colours the bars run through from left to right, blended in Oklab. Default teal, ice and apricot. |
|
|
1206
|
+
| `palette` | `PaletteName \| (string & {})` | A shared palette by name (`PALETTES`, any case), when there are no `colors` or `color`. |
|
|
1207
|
+
| `step` | `number` | Space between bars, CSS px. Default 8. |
|
|
1208
|
+
| `bar` | `number` | A bar's width, CSS px. Default 3. |
|
|
1209
|
+
| `height` | `number` | The tallest bar, a share of the height either side of the middle. Default 0.34. |
|
|
1210
|
+
| `every` | `number` | Seconds between retunes. Default 2. |
|
|
1211
|
+
| `sweep` | `boolean` | The playhead sweeping across, lighting the bars it plays. Default true. |
|
|
1212
|
+
| `grain` | `number` | Film grain in the light, 0–1. Default 0.4. |
|
|
1213
|
+
| `peaks` | `boolean` | Peak marks over the bars that hold, then drop, as a meter's do. Default true. |
|
|
1214
|
+
| `glow` | `number` | How much light the bars and playhead give off, 0–2. Default 1. |
|
|
1215
|
+
| `scrub` | `number` | How much the bars under the pointer rise and light; 0 for not at all. Default 1. |
|
|
1216
|
+
| `audio` | `AudioSource` | Follow the sound playing: `'page'` for whatever plays, or a CSS selector for an `<audio>`/`<video>` or a player's container (a WaveformPlayer). The bars show its spectrum (bass in the middle) and the playhead follows the track; while nothing plays they keep their own motion. Default none. |
|
|
1217
|
+
| `quiet` | `{ x?: number; y?: number; radius?: number; depth?: number } \| null` | An area where the light dims (behind a headline): centre x/y (0–1, from the top left), radius (a share of the height) and depth (0 none, 1 dark). Default none. |
|
|
1218
|
+
| `fade` | `boolean` | Fade the left and right edges out. Default true. |
|
|
1219
|
+
| `class` | `string` | Classes for the element. |
|
|
1220
|
+
|
|
1221
|
+
## `<WorldRoutes>`
|
|
1222
|
+
|
|
1223
|
+
WorldRoutes: a dotted world map with routes arcing between cities, a comet of light running along each and pinging the city it lands on. For "sell worldwide" and "customers in 40 countries" sections, or with `home`, "shipped from our studio to everywhere". Name cities (`london`, `tokyo`… see CITIES in src/runtime/world-plan.js) or give [latitude, longitude] or `{ name, lat, lon }`. Routes take their own colour, label, speed, width and dash; `colors` gives each city a colour of a palette, and `gradient` blends each route between its two. The map shows the world or a `region` (`europe`, `routes`, a box), fitted to its box; hovering a city or a route picks it out and names it.
|
|
1224
|
+
|
|
1225
|
+
```astro
|
|
1226
|
+
<WorldRoutes home="london" routes={['new-york', 'tokyo', { to: 'sydney', color: '#f97316' }]} colors={['#e0f2fe', '#38bdf8', '#2dd4bf']} gradient labels />
|
|
1227
|
+
```
|
|
1228
|
+
|
|
1229
|
+
| Prop | Type | |
|
|
1230
|
+
|---|---|---|
|
|
1231
|
+
| `routes` | `RouteSpec[]` | The routes: `[from, to]`, a place alone (from `home`), or `{ from, to, color, label, speed, width, dashed }`. A place is a key of CITIES, [degrees north, degrees east], or `{ name, lat, lon }`. Default ten routes round the world, or, with a `home`, routes from it to ten cities round the world. |
|
|
1232
|
+
| `home` | `Place` | A hub: routes with no `from` start here, and it is marked out with a ring and a halo. Default none. |
|
|
1233
|
+
| `color` | `string` | The routes' colour. Default `#38bdf8`. |
|
|
1234
|
+
| `colors` | `string[]` | A palette in place of `color`: each city takes the next colour in the order they appear (a home city takes the first and keeps it), and each route the colour of the city it runs to. Default none. |
|
|
1235
|
+
| `palette` | `PaletteName \| (string & {})` | A shared palette by name (`PALETTES`, any case), when there are no `colors`. |
|
|
1236
|
+
| `gradient` | `boolean` | Blend each route from its origin's colour to its destination's, in Oklab (with `colors`). Default false. |
|
|
1237
|
+
| `land` | `string` | The land dots' colour, and the names'. Default `#ffffff`. |
|
|
1238
|
+
| `landOpacity` | `number` | The land dots' opacity. Default 0.18. |
|
|
1239
|
+
| `pitch` | `number` | Space between land dots, CSS px. Default 7. |
|
|
1240
|
+
| `dot` | `number` | A land dot's radius, CSS px. Default 1.4. |
|
|
1241
|
+
| `dotShape` | `'round' \| 'square'` | The land dots' shape: `round` or `square`. Default `round`. |
|
|
1242
|
+
| `graticule` | `boolean \| number` | Faint lines of latitude and longitude, in dots: true for every 30°, or the degrees between them. Default false. |
|
|
1243
|
+
| `region` | `RegionName \| 'routes' \| Bounds` | What the map shows: `world`, `europe`, `north-america`, `south-america`, `africa`, `middle-east`, `asia`, `oceania`, `routes` (fitted round the cities and the arcs between them), or [[south, west], [north, east]]. Default `world`. |
|
|
1244
|
+
| `fit` | `'contain' \| 'cover'` | `contain` shows all of the region; `cover` fills the box with it. Default `contain`. |
|
|
1245
|
+
| `drift` | `number` | Pan the map east this many degrees a second (negative for west), round and round the world. Default 0. |
|
|
1246
|
+
| `lap` | `number` | Seconds a comet takes along a route. Default 3.2. |
|
|
1247
|
+
| `lift` | `number` | How high the arcs bow, a share of their length. Default 0.3, or 0.08 with a great-circle `curve`. |
|
|
1248
|
+
| `curve` | `'bow' \| 'great-circle'` | `bow`: arcs bow up between the cities. `great-circle`: they follow the shortest way over the globe, over the date line where that is shorter. Default `bow`. |
|
|
1249
|
+
| `arcOpacity` | `number` | The faint arcs' opacity. Default 0.14. |
|
|
1250
|
+
| `dashed` | `boolean` | Dash the faint arcs, the dashes running from origin to destination. Default false. |
|
|
1251
|
+
| `width` | `number` | The comets' width, CSS px; the faint arcs are a line half as wide. Default 2.2. |
|
|
1252
|
+
| `tail` | `number` | A comet's length, a share of its route. Default 0.28. |
|
|
1253
|
+
| `glow` | `number` | The glow round a comet's head, CSS px; 0 for none. Default 10. |
|
|
1254
|
+
| `comets` | `number` | Comets on each route at once. Default 1. |
|
|
1255
|
+
| `ping` | `number` | How wide the ring a landing comet opens grows, CSS px; 0 for none. Default 17. |
|
|
1256
|
+
| `markers` | `boolean` | Mark the cities with a dot. Default true. |
|
|
1257
|
+
| `markerSize` | `number` | A city dot's radius, CSS px. Default 2.2. |
|
|
1258
|
+
| `halo` | `boolean` | A soft halo breathing round every city (the home city always has one). Default false. |
|
|
1259
|
+
| `labels` | `boolean` | Name the cities, leaving out names that would overlap (hovering a city names it either way). Default false. |
|
|
1260
|
+
| `font` | `string` | The names' CSS font. Default `500 11px system-ui, sans-serif`. |
|
|
1261
|
+
| `interactive` | `boolean` | Hovering a city or a route (not through a link or button) brightens it and names it. Default true. |
|
|
1262
|
+
| `fixed` | `boolean` | Fill the viewport, behind the page (position: fixed, z-index -1). Default false. |
|
|
1263
|
+
| `fade` | `boolean \| 'top' \| 'bottom' \| 'both'` | Fade the edges out, for a cropped map: true for the left and right, or 'top', 'bottom' or 'both'. Default false. |
|
|
1264
|
+
| `class` | `string` | Classes for the element. |
|