WelcomeCard.astro component creates an engaging welcome message with animated text. It displays a greeting, name with letter-by-letter animation, and a description, making it perfect for hero sections and personal introductions.
Props
The name to display in the hero title. Each letter will be individually animated.
A description or tagline displayed below the greeting. This provides context about the person or role.
Usage
Import and use the WelcomeCard component with name and description:Example
From the hero section of CV Staff Web:src/sections/hero.astro
Features
Animated Text Structure
The component creates a multi-line heading with:- Line 1: “Hola,” (Hello)
- Line 2: “soy” (I am) + animated name + waving hand emoji
Letter-by-Letter Animation
The name is split into individual letters, each wrapped in a span with an index:--i custom property.
Emoji Animation
Includes a waving hand emoji (👋) with its own animation class.HTML Structure
Styling Details
Hero Title
- Font size: 3rem
- Font weight: 300 (light)
- Line height: 1.1
- Color:
var(--color-dark) - Bottom margin: 2rem
Name Styling
- Font weight: Bold
- Font size: 2.5rem (slightly smaller than main title)
- Color:
var(--color-primary)(accent color) - Display: Inline-flex for proper letter spacing
Individual Letters
- Display: Inline-block (allows for transforms)
- Transform origin: Bottom center (for scaling/rotating animations)
Wave Emoji
- Font size: 2.5rem (matches name size)
- Transform origin: 70% 70% (enables natural wave animation)
Description
- Font size: 1rem
- Color:
var(--color-text) - Line height: 1.5
- Bottom margin: 2rem
Animation Hooks
The component includes data attributes for animation targeting:data-animate="word"- Animate the greeting wordsdata-animate="name"- Animate the name containerdata-animate="wave"- Animate the wave emoji
Responsive Considerations
Line 2 Layout
Accessibility
- Uses semantic
<h1>heading for the main title - Preserves spaces in the name using
\u00A0(non-breaking space) - Maintains readable text hierarchy with
<p>for description
Customization Examples
Different Language
Longer Names
The component handles long names gracefully due to flex-wrap:Multilingual Support
To support different languages, you could enhance the component:Performance Notes
- Name splitting happens at build time (server-side)
- Each letter is a separate DOM element, consider performance with very long names
- Animation can be added via CSS or JavaScript without impacting initial render