beta

Meteors <mv-meteors>

Lluvia de meteoros en diagonal con estelas brillantes: animación 100 % CSS; el JS solo distribuye las estrellas fugaces y cambia su carril en cada pasada.

CategoríaFondos
TipoWeb Component (<mv-meteors>)
Estadobeta
Keywordsmeteors, shooting-stars, night, card, hero, css

When to use

  • A card or small panel needs a night-sky accent with shooting stars behind its content
  • A dark hero wants diagonal motion from a CSS-only animation that stays cheap to run

Avoid when

  • Streaks should converge on a focal point or burst into sparks on impact → use Beams instead

Instalación

node scripts/add.mjs meteors --out ./src/marvelous

Agente de IA con el servidor MCP de Marvelous UI: install_components({ slugs: ["meteors"], target_dir: "<absolute path>/src/marvelous", framework: "react" }).

Archivos copiados (dependencias incluidas): tokens/tokens.css, core/base.css, core/dom.js, core/element.js, core/observe.js, components/meteors/meteors.css, components/meteors/meteors.js.

Uso

Marcado de referencia: parte de él y personalízalo con atributos, data-* y variables CSS:

<div style="display:grid;grid-template-columns:1.6fr 1fr;gap:1.5rem;align-items:center;min-height:320px;padding:1.5rem">
  <section style="position:relative;display:grid;place-items:center;text-align:center;overflow:hidden;min-height:272px;border-radius:var(--mv-radius-xl)">
    <mv-meteors data-fill count="24"></mv-meteors>
    <div style="position:relative">
      <p style="margin:0;font:700 clamp(1.6rem,4vw,2.6rem)/1.1 var(--mv-font-sans);letter-spacing:-.03em">Make a wish</p>
      <p style="margin:.6rem auto 1.2rem;max-width:28rem;color:var(--mv-fg-muted)">A shower of CSS shooting stars for your launch pages.</p>
      <a class="mv-button" href="#meteors">Join the waitlist</a>
    </div>
  </section>
  <mv-meteors count="12" angle="325" style="border:1px solid var(--mv-border);border-radius:var(--mv-radius-xl);background:var(--mv-surface);padding:1.5rem;min-height:220px;display:flex;flex-direction:column;justify-content:flex-end">
    <strong style="font-size:1.1rem">Version 2.0 is here</strong>
    <span style="font-size:.9rem;color:var(--mv-fg-muted);margin-top:.25rem">A card with its own meteors, heading left (angle="325").</span>
  </mv-meteors>
</div>

API

Attributes

NameTipoDefaultDescription
countnumber20Number of meteors (max 120).
anglenumber215Angle in degrees (215 = down and to the right, 325 = down and to the left).
speednumber1Speed multiplier.
data-fillbooleanFills the positioned parent (absolute, inset 0).

Content structure

NameDescription
childrenWithout data-fill, content placed inside the element sits on top (ideal for a card).

CSS classes

NameDescription
mv-meteorA single meteor (generated).

CSS variables

NameDefaultDescription
--mv-meteors-colorgray 500 / gray 200Head and trail color.
--mv-meteors-tail5remAverage trail length.
--mv-meteors-size2pxHead size.

Accessibility

Decorative: aria-hidden, pointer-events: none with data-fill. Reduced motion: meteors stay frozen mid-flight.

Esta página se tradujo con IA. Informar de un problema de traducción