Block 279 of 297
Starfield Section
Heading, body and key figures over a slow parallax starfield with twinkle and a soft nebula.
- Puck key
- StarfieldSectionBlock
- Export
- starfieldSectionBlock
- React component
- <StarfieldSection />
- Files
- components/puck/starfield-section-block.tsx
- components/puck/starfield-section.client.tsx
- Dependencies
- vgpu
- License
- MIT
About this block
When to use it, how to write for it, and what to change in the code.
What it's for
A dark section with heading, body, a pill link and up to four large figures over layered, drifting stars and a soft two-color nebula. The nebula pools toward the upper right, away from the copy. Figures run one column on phones, two on tablets and four across on desktop, under a thin divider.
- Observatory, planetarium or science center pages
- STEM education program overviews with headline numbers
- Night-sky events or dark-sky park information
Writing the content
- Figures allows zero to four items; values like 41,000 or 16-inch fit best, and text such as "Free" works too.
- Keep Sky color very dark. The nebula colors blend into it, and all copy is white.
- Nebula color (core) shows in the brightest areas, so give it the stronger accent.
- Link text and Source note each hide when left blank.
Accessibility
- Figures use a description list so each value stays paired with its label (WCAG 1.3.1).
- A dark scrim sits behind the copy: a flat overlay on small screens and a left-to-right gradient on large ones.
- The star canvas is aria-hidden; reduced motion shows one still frame and animation stops off screen or in a hidden tab.
Customizing the code
- Needs vgpu and starfield-section.client.tsx. The four stars() calls in fs_main set layer scale, density and drift; raise the 0.16 to 0.18 density values for a busier sky.
- Move the nebula by editing vec2f(0.82, 0.22) in the toward calculation.
Editor fields
What content editors see in the P1 sidebar when they select this block.
- Eyebrowtext
- Headingtextarea
- Heading levelselect
- Bodytextarea
- Link texttext
- Linktext
- Figuresarray
- Source notetext
- Sky colortext
- Nebula color (outer)text
- Nebula color (core)text
- Motionradio