# Falling Leaves Generator > Free falling leaves animation generator that runs in the browser: type the background colour of a website section > (or pick a look) and leaves, petals or soft snow fall over it on a canvas. Tune it live, then copy the HTML, CSS and > JavaScript (no library) or download a demo page. > https://falling-leaves-generator.skillsafe.ai/ ## What it does - Shapes: maple, oak, birch, ginkgo, blossom petal, soft snowflake. Looks: autumn maple, oak brown, cherry blossom, ginkgo gold, summer green, snow, ash and embers; each is a small colour ramp sampled per leaf. - Motion model (from the agent skill): each leaf tumbles about its own long axis - a horizontal scale cos(spin) that crosses zero, so it goes edge-on - and rolls in the picture plane at its own rate. Sideways slip is driven by the same tumble angle (sin(spin) * slip), not an independent sine. Front and back faces are baked once per colour; the underside is duller and paler. Fall speed, tumble, roll, slip, scale, opacity and colour all vary per leaf. - Depth: up to three layers. Far (scale 0.3-0.5, opacity 0.22-0.40, slow), mid (0.5-0.85, 0.46-0.78) and near (1.05-1.9, 0.50-0.82, fast, at most three leaves, optionally softened) on a second canvas in front of the text. - Count is authored for 1440 x 900 and scaled by sqrt(area / (1440 x 900)) clamped to 0.5-1.3, so a phone does not get a blizzard. The page reports how many leaves were built. - Cost: one drawImage per leaf; dt clamped to 1/30 s; device pixel ratio capped at 2; sized from a ResizeObserver; nothing is built for a 0 x 0 box; paused while the tab is hidden or the section is off screen. - Reduced motion: visitors with prefers-reduced-motion get one composed still frame instead of the animation. - Controls: leaf, colours, number (5-200), size (8-64 px), fall speed, wind, tumble, slip, depth layers, strength, near leaves in front of the text, soften near leaves, one section or the whole window, page colour, class name, Shuffle, Pause. - Checks: leaf colours against the page colour (contrast), tumble 0 (reads as confetti), slip 0, heavy counts, large-and-many curtains, strong wind, leaves per desktop and per phone. - Exports: Copy the code (HTML + CSS + script), Download demo page (.html), Download .js, Download .json settings. The preview runs the very function that is exported. - Free, no sign-up; nothing is uploaded on the free path. ## Optional AI step After sign-in (metered, model llm-default), the visitor describes the scene. AI returns settings: name, shape, colors (2-6 #rrggbb), bg, count, size, speed, wind, tumble, slip, layers, opacity, front and notes. The page refuses any number that is not a whole number in range, any colour that is not a #rrggbb code, and a page colour on which the leaves would vanish; it checks that hex codes in the description were used and keeps every leaf behind the text when the description asks for that. API: https://falling-leaves-generator.skillsafe.ai/api.html (task "design"). ## Sources - Adapted from the agent skill @mengto/falling-leaves (mengto/skills, MIT): https://skillsafe.ai/skill/@mengto/falling-leaves