TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/nicolasgrajaleshoyos/portafolio/llms.txt
Use this file to discover all available pages before exploring further.
Hero component is the first section a visitor sees, spanning the full viewport height (min-h-screen). It opens with an animated headline and a continuously cycling typing effect that highlights Nicolas’s roles, a circular profile photo wrapped in a gradient glow, and a colour-shifting gradient background. The entire section fades and slides into view once the browser’s IntersectionObserver confirms it is on screen.
Props
Hero accepts no external props. All data — typed words, profile photo URL, and gradient classes — is defined internally.
useTypingEffect Hook
The typing animation is powered by a custom hook defined at the top of Hero.tsx. It cycles through an array of strings, typing each character at typeSpeed ms/char, pausing for delay ms once the word is complete, then deleting at deleteSpeed ms/char before moving to the next word.
typeSpeed = 150, deleteSpeed = 100, delay = 1000) are the fallback values embedded in the function signature. The call site in Hero overrides all three with explicit arguments.
The hook is called in Hero with these arguments:
typedText string is rendered next to a blinking cursor element (animate-blink).
Behavior
Fade-in via IntersectionObserver
A useRef attaches to the <section> element. An IntersectionObserver with threshold: 0.1 watches it; as soon as 10 % of the section enters the viewport, isVisible flips to true and is never reset (the observer is disconnected after the first trigger). This drives two transitions:
| Element | Hidden state | Visible state |
|---|---|---|
| Section wrapper | opacity-0 | opacity-100 |
| Text column | translate-y-10 opacity-0 | translate-y-0 opacity-100 |
| Photo column | scale-90 opacity-0 | scale-100 opacity-100 (200 ms delay) |
Gradient background
An absolutely-positioned<div> fills the section with a dual-mode gradient that continuously animates position:
Profile photo and glow ring
The profile image is served from the GitHub avatar CDN:group container that drives two simultaneous animations:
animate-float— a gentle vertical bob on the outerdiv.animate-tilt— a subtle 3-D tilt on the gradient glow ring behind the photo.
group-hover:scale-110.
Usage Example
Hero is placed directly inside <main> in App.tsx, immediately after the fixed Header:
Customization
Changing the typed words
Changing the typed words
Edit the array passed to
useTypingEffect inside Hero.tsx. Each string will be typed, paused, and deleted in order, looping indefinitely:Replacing the profile photo
Replacing the profile photo
The
src attribute of the <img> tag points to the GitHub avatar CDN. Swap it for any publicly accessible URL or a local asset:Updating the gradient colors
Updating the gradient colors
The background gradient classes live on the absolutely-positioned overlay
<div>. Change from-*, via-*, and to-* Tailwind tokens to match your brand palette:Adjusting typing speeds
Adjusting typing speeds
Pass different millisecond values when calling the hook. Lower numbers type/delete faster; higher numbers are slower and more dramatic: