STUDY 01 / MOTION PATHS
Glass Circuit.
A miniature railway in motion. A locomotive, two coaches, a tiny station.
- offset-path
- offset-rotate
- glass
- animation-delay
Showcase
Studies, and real uses for designers, creative coders and developers.
Every scene on this page is live: drag it, hover it, open it in the
playground. And every use case is embedded with
<gss-scene>, the same tag you can put on your own
site.
Eight longer scenes, one at a time: motion paths, carved geometry, gradients, two Zdog models rebuilt, a camera cut open, the film that announces 0.0.5. Each one opens in the playground.
STUDY 01 / MOTION PATHS
A miniature railway in motion. A locomotive, two coaches, a tiny station.
Your logo, your icons, your tokens: the things you already draw in 2D, in 3D, written like a stylesheet.
Paste the d attribute of your logo into path(): the same drawing becomes a tube you can light, turn and animate. No modelling tool, no export.
#brace-left {
d: path("M12.5 4.5C9.5 4.5 9 6 9 8.5v4…");
view-box: 0 0 32 32;
stroke-width: 2.4;
}
One stylesheet for the whole set. Change --accent or --finish and every icon follows, like tokens in a design system.
scene {
--accent: #ff5a36;
--finish: jelly(0.55);
}
.icon {
color: var(--accent);
material: var(--finish);
}
Rules instead of loops, and a readable way into the shader: every scene becomes GLSL you can read, and export.
* 36 makes 36 objects; sibling-index() gives each its own angle, height and hue. The rule is the algorithm.
.bead {
--i: sibling-index();
translate: calc(-1 * cos(var(--i) * 30deg) * var(--r))
calc(var(--i) * 0.09)
calc(sin(var(--i) * 30deg) * var(--r));
color: hsl(calc(var(--i) * 10) 85% 60%);
}
open in playground ↗usessibling-index()calc()sin(), cos()hsl()
The playground turns any scene into a shader Shadertoy runs as is. Start in CSS, then keep going in GLSL: the GLSL tab shows every line GSS wrote.
#ring {
material: gold;
animation: tumble 7s linear;
}
@keyframes tumble {
to { rotate-x: 1turn; rotate-z: -0.5turn; }
}
A 3D scene is a stylesheet: small enough to ship, simple enough for an LLM to write.
Compile the scene at build time with the Vite plugin: the page ships a 10 kB runtime and one shader. :hover works out of the box.
import { mount } from "gss-lang/runtime";
import hero from "./hero.gss"; // compiled by gss-lang/vite
mount(document.querySelector("canvas"), hero);
Every LLM already knows CSS by heart, so it writes GSS without any training; the compiler writes the GLSL. This scene came from a one-line prompt.
<script type="module" src="https://www.gss-lang.dev/embed.js"></script>
<gss-scene>
<script type="text/gss">
/* what the model wrote */
</script>
</gss-scene>
Three ways to put a scene on a page, from a tag you paste to a build step that keeps the compiler out of the page.
<script type="module" src="https://cdn.jsdelivr.net/npm/gss-lang@0.0.8/lib/embed.js"></script>
<gss-scene src="logo.gss"></gss-scene>
<gss-scene controls="none">
<script type="text/gss"> @scene { sphere; } </script>
</gss-scene>
import { mount } from "gss-lang";
const scene = mount(canvas, "@scene { sphere; }");
scene.update(otherSource);
scene.destroy();
// vite.config.ts
import gss from "gss-lang/vite";
export default { plugins: [gss()] };
// main.ts: the compiler stays out of the page
import { mount } from "gss-lang/runtime";
import logo from "./logo.gss";
mount(canvas, logo);
noteA scene paints its whole canvas, and a transparent object
shows the scene behind it, not the page: give the scene the
background of your page. A browser keeps about 16 WebGL
contexts; a scene only starts when it comes into view, and sleeps when
it leaves it.
Every scene of this page, newest first: what it is, the version of GSS it came with, and what it uses. Each one opens in the playground, where you can change it and share it with a link; a study opens in the viewer above.
A lathe body and lid, a cone spout, a path handle. Hover lifts the lid; a click sends the teapot over a speed bump.
An orange coin with the P of the flat logo pushed out of it, floating under two sweeping lights.
A miniature railway in motion. A locomotive, two coaches, a tiny station.
Seven carved bronze fins. A golden star suspended in the aperture.
Striped lollipops, wrapped sweets. A miniature confectioner’s garden.
Twelve metallic petals. The slider unfolds the sculpture.
The original Zdog character. Same palette, proportions and articulated pose.
Four layers. Five sesame seeds. The slider takes the original construction apart.
The 1959 Nikon F exterior. The slider opens an illustrative exploded lens.
A 30-second film, written as a stylesheet. The word types itself, then eight features take the stage.
64 tufts of blades, each a prism, blowing in the wind.
An extruded star in a golden collar, twelve fins and satellites on SVG tracks. Press the star: the whole crown opens.
A blocky character walking on a strip of grass blocks.
The walk on a wider island, with an oak and flowers, laid out again by @media on a narrow screen.
A village on an island of grass blocks: a house, trees, a fence and a pond around the walking character.
A floating island with a portal and a crystal carved by CSG. Hover the switch, press it: the circuit and the lamps light up.
A product hero in one stylesheet: keys that press, a knob and its level meter, an underglow that breathes.
A breathing instrument: petals open and close around a rising pearl, and a marker laps once per breath.
A grid of 25 cells: the one under the mouse rises, and :has() wakes the rim, the stem and the core.
A row of fourteen cells: the one under the mouse grows most, its neighbours less and less.
A watch as a product shot: a steel case, a dial with its ticks, hands that turn in steps.
Sixteen keys around a planet: hover a key and it pops out, its neighbours react and the inner orbit contracts.
A perfume configurator: hover a swatch to fill the glass bottle with another fragrance.
The d attribute of an SVG logo pasted into path(): its two braces become tubes around a glossy dot.
Five shapes styled as one set. Two variables, an accent and a finish, theme them all, like the tokens of a design system.
36 beads from one rule: sibling-index() gives each its own angle, height and hue.
A gold ring tumbling around an orange core, ready to export as a Shadertoy shader.
Seven pillars that answer the mouse: a page hero with :hover, compiled at build time.
A snowman an LLM wrote from a one-line prompt, unedited.
The scene of the first page of the docs: a glass ball that floats up and down.
{ ● } drawn in GSS: both braces come from the same SVG, and the dot is a sphere.
One zone per feature: transforms, operations, animations, materials, shapes, paths and textures.
A block of earth with grass on top: its top face has a texture of its own, with ::top.