Skip to content
Astro Lumetric
Start free

Docs · The theme

Effects and animations

The page's background, the cards and the light on them, the drawn covers, the closing band and the animations.

All docs pages
On this page
  1. The page and the cards
  2. The drawn covers
  3. The closing band
  4. Numbers that count up
  5. The animations

The theme’s effects are in src/components/fx/. Each explains itself at the top of its file.

The page and the cards

Behind the page is its own plain background (LightField.astro). Nothing moves or glows behind the sections; the only glows are the soft lime ones behind the stage heroes and the sign-in page. In stage some sections take the second background; in grid the page has one background, ruled into columns by fine lines. Designs and colours compares the two.

Cards and tiles (elements with data-spot) are the card colour with a fine border: rounded in stage, square and sharing their borders in grid. A card inside a card takes the second background. Spotlight.astro adds a soft light that follows the pointer across them, with a thin lit edge where the pointer is; only with a mouse, and not under reduced motion.

A post’s card ends in “Read the post” and a customer story’s card in “Read the story”, with an arrow. The whole card is one link.

The drawn covers

ProjectCover.astro draws the cover of a post or a customer story that has no picture: a near-black ground with a soft lime glow, a fine grid of lines and four corner marks, the icon in lime and the word in large type, the same in light and dark mode. The icon and the word scale with the cover’s width. tone only moves the glow, so a row of covers doesn’t repeat itself. See Posts and Customer stories.

The closing band

ClosingCta.astro is the call to action at the foot of most pages. In stage it’s a rounded near-black card, the same in light and dark mode, with a lime glow rising from its foot and everything centred. In grid it’s a ruled block inside the page’s column: the label numbered as the next section, the heading on the left, the line, the buttons and the points on the right, and a lime square in the corner. Pages and words says where its words are.

Numbers that count up

CountUp.astro counts a number up from 0 when it scrolls into view, once, as the figures on the About page do. Without the script, or under reduced motion, the number simply shows.

The animations

The animations are in Motion.astro, with motion on in the settings:

  • when a page loads, the hero’s label, heading, line and buttons slide up one after another, and the header drops in when a visitor arrives from elsewhere (not when moving between the site’s own pages);
  • below the hero, every piece of a page rises into view as it’s scrolled to, once: each section heading, each card and tile, each piece of a post’s or story’s text, and every other part of a section. Pieces that come into view together, such as cards side by side, follow one another 100ms apart. What’s already on the first screen rises in just after the hero.

The script marks most of this itself. In your own markup:

Attribute What it does
data-reveal Rises into view. left, right, down or scale set the direction.
data-reveal-delay="1" to "4" Comes in 100ms to 400ms later, for tiles in a row
data-reveal-children Its children come in one after another
data-no-reveal Never hidden or moved

Rows of tags, in the blog’s and the customer stories’ heroes, on the search page and under a post, stay still. Under reduced motion nothing is hidden or moved, and a link to a section shows that section at once. motion: false in the settings turns the animations off.

Moving between pages, the browser cross-fades the old page into the new one.