UI Enhancement + Staggered Animation Skill
This skill performs a full design upgrade of an existing website or component. It is NOT just about adding animations — it is a holistic visual refinement pass that touches typography, spacing, layout, depth, micro-interactions, and motion. The existing color palette is preserved; everything else can and should be improved.
Phase 1 — Audit & Understand Before Touching Anything
Before writing a single line of code, do a thorough read of the existing code. Extract and note:
- Color palette — all hex/hsl/rgb values, CSS variables, Tailwind color classes. These are sacred and must be preserved exactly.
- Font stack — what fonts are currently in use.
- Layout structure — is it CSS Grid, Flexbox, plain blocks? What's the overall page structure?
- Component inventory — list every distinct section/component: hero, navbar, cards, features, testimonials, CTA, footer, etc.
- Current weaknesses — visually identify what looks amateur or generic: flat cards, no spacing rhythm, weak typography hierarchy, no depth/shadow, boring hover states, no visual flow, walls of text, etc.
- Tech stack — React (use Framer Motion), plain HTML/CSS (use CSS animations + IntersectionObserver), Vue, etc.
Only after this audit should you begin making changes.
Phase 2 — Full Design Upgrade (Non-Animation)
Apply ALL of the following improvements that are relevant to the site. Be thorough — don't skip sections because they "look okay". Every part of the site should be elevated.
Typography
- Introduce a clear typographic hierarchy: display sizes (clamp-based fluid sizing), section headings, subheadings, body, caption — each with distinct weight and size.
- Replace generic system fonts (Arial, Helvetica, system-ui) with a distinctive pairing from Google Fonts or similar. A strong display/heading font paired with a clean readable body font.
- Use
letter-spacing for uppercase labels and overlines.
- Add
line-height rhythm: ~1.2 for headings, ~1.6–1.7 for body text.
- Tighten long text blocks with
max-width: 65ch for readability.
Spacing & Rhythm
- Introduce a consistent spacing scale (e.g., 4/8/16/24/32/48/64/96px).
- Increase section padding — most amateur sites are too cramped.
- Add generous whitespace between section components.
- Ensure consistent internal card/component padding.
Depth & Surfaces
- Add layered
box-shadow to cards, modals, and elevated surfaces. Use multi-layer soft shadows, not harsh single-layer ones.
- Use subtle
border with low-opacity color instead of hard outlines.
- Apply
backdrop-filter: blur() to glass-morphism elements like navbars or overlapping cards where appropriate.
- Use subtle
background differentiation between sections (slightly lighter/darker tint of existing colors).
Layout & Composition
- Break out of purely uniform grid layouts. Use asymmetric or offset compositions where they add interest.
- Add visual anchors: decorative elements, large background text/numbers, gradient blobs, or geometric shapes using the existing color palette (low opacity).
- Ensure the hero is impactful with generous sizing and a strong focal point.
- Use CSS Grid for complex layouts; avoid excessive nested divs.
Cards & Components
- Round all corners consistently (usually 8–16px for cards, 6–8px for buttons/inputs).
- Add hover states to all interactive elements: cards should lift (translateY + shadow), buttons should shift or glow.
- Ensure buttons have visible padding, strong contrast, and consider adding a subtle icon or arrow.
- Add
transition: all 0.2s ease baseline to interactive elements.
Visual Polish Details
- Add subtle gradient overlays to hero images or dark sections.
- Use
overflow: hidden on cards to clip child images and effects cleanly.
- Ensure images use
object-fit: cover and have defined aspect ratios.
- Add divider treatments between sections (subtle border, gradient fade, or decorative wave/angle).
- If there are icons, ensure they are consistently sized and optically aligned with text.
Phase 3 — Staggered Blur + Slide-Up Reveal Animations
Animation Philosophy
- Animations should feel natural and elegant — not flashy or distracting.
- Every major content section should animate in when it enters the viewport.
- Use a staggered pattern: child elements within a section animate in one by one with a delay offset (e.g., 0.1s apart).
- The animation: elements start
opacity: 0, filter: blur(8px), translateY(24px) and transition to opacity: 1, filter: blur(0px), translateY(0).
- Duration: 0.6s for most elements. Easing:
ease-out or a custom cubic-bezier like cubic-bezier(0.16, 1, 0.3, 1) (snappy spring).
- Respect
prefers-reduced-motion — disable animations for users who opt out.
React — Framer Motion Implementation
Install if not present:
npm install framer-motion
Core Animation Variants
// lib/animations.ts
import { Variants } from "framer-motion";
export const fadeUpBlur: Variants = {
hidden: {
opacity: 0,
y: 24,
filter: "blur(8px)",
},
visible: {
opacity: 1,
y: 0,
filter: "blur(0px)",
transition: {
duration: 0.6,
ease: [0.16, 1, 0.3, 1],
},
},
};
export const staggerContainer: Variants = {
hidden: {},
visible: {
transition: {
staggerChildren: 0.1,
delayChildren: 0.05,
},
},
};
// For heavier stagger (e.g., feature grids)
export const staggerContainerSlow: Variants = {
hidden: {},
visible: {
transition: {
staggerChildren: 0.15,
delayChildren: 0.1,
},
},
};
Reusable AnimateInView Wrapper
// components/AnimateInView.tsx
import { motion, useInView } from "framer-motion";
import { useRef } from "react";
import { staggerContainer, fadeUpBlur } from "@/lib/animations";
interface AnimateInViewProps {
children: React.ReactNode;
className?: string;
delay?: number;
stagger?: boolean;
}
export function AnimateInView({
children,
className,
delay = 0,
stagger = false,
}: AnimateInViewProps) {
const ref = useRef(null);
const isInView = useInView(ref, { once: true, margin: "-80px" });
if (stagger) {
return (
<motion.div
ref={ref}
className={className}
variants={staggerContainer}
initial="hidden"
animate={isInView ? "visible" : "hidden"}
>
{children}
</motion.div>
);
}
return (
<motion.div
ref={ref}
className={className}
variants={fadeUpBlur}
initial="hidden"
animate={isInView ? "visible" : "hidden"}
transition={{ delay }}
>
{children}
</motion.div>
);
}
// Individual animated child (use inside AnimateInView with stagger=true)
export function AnimatedItem({
children,
className,
}: {
children: React.ReactNode;
className?: string;
}) {
return (
<motion.div className={className} variants={fadeUpBlur}>
{children}
</motion.div>
);
}
Usage Pattern
// Hero section — single block fade
<AnimateInView>
<h1>Your Headline</h1>
<p>Subheadline text here</p>
<Button>CTA</Button>
</AnimateInView>
// Feature grid — staggered children
<AnimateInView stagger className="grid grid-cols-3 gap-6">
{features.map((f) => (
<AnimatedItem key={f.id}>
<FeatureCard {...f} />
</AnimatedItem>
))}
</AnimateInView>
// Section heading + body — slight delays
<div>
<AnimateInView delay={0}>
<h2>Section Title</h2>
</AnimateInView>
<AnimateInView delay={0.1}>
<p>Section description</p>
</AnimateInView>
</div>
Reduced Motion
// Wrap your app or layout:
import { LazyMotion, domAnimation, MotionConfig } from "framer-motion";
export function Providers({ children }: { children: React.ReactNode }) {
return (
<MotionConfig reducedMotion="user">
<LazyMotion features={domAnimation}>
{children}
</LazyMotion>
</MotionConfig>
);
}
Plain HTML/CSS/JS — CSS + IntersectionObserver Implementation
CSS Animation Classes
/* Add to your global stylesheet */
@media (prefers-reduced-motion: no-preference) {
.reveal {
opacity: 0;
transform: translateY(24px);
filter: blur(8px);
transition:
opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
filter 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.in-view {
opacity: 1;
transform: translateY(0);
filter: blur(0px);
}
/* Stagger delays for children */
.stagger-children .reveal:nth-child(1) { transition-delay: 0.0s; }
.stagger-children .reveal:nth-child(2) { transition-delay: 0.1s; }
.stagger-children .reveal:nth-child(3) { transition-delay: 0.2s; }
.stagger-children .reveal:nth-child(4) { transition-delay: 0.3s; }
.stagger-children .reveal:nth-child(5) { transition-delay: 0.4s; }
.stagger-children .reveal:nth-child(6) { transition-delay: 0.5s; }
/* Add more as needed */
}
IntersectionObserver Script
// Add before closing </body>
const observer = new IntersectionObserver(
(entries) => {
entries.forEach((entry) => {
if (entry.isIntersecting) {
entry.target.classList.add("in-view");
observer.unobserve(entry.target); // animate once
}
});
},
{ rootMargin: "-80px 0px", threshold: 0.1 }
);
document.querySelectorAll(".reveal").forEach((el) => observer.observe(el));
Usage Pattern
<!-- Single block -->
<section>
<div class="reveal">
<h2>Section Title</h2>
<p>Description text</p>
</div>
</section>
<!-- Staggered grid -->
<div class="stagger-children grid">
<div class="reveal card">Feature 1</div>
<div class="reveal card">Feature 2</div>
<div class="reveal card">Feature 3</div>
</div>
Phase 4 — Section-by-Section Application Guide
Apply improvements and animations to each section type as follows:
| Section |
Design Upgrades |
Animation Pattern |
| Navbar |
Glassmorphism backdrop-blur, subtle border-bottom, refined logo spacing |
Fade in on load (no scroll trigger) |
| Hero |
Large fluid type, strong hierarchy, gradient or decorative blob, CTA button polish |
Single block stagger: headline → subtext → CTA button (0.1s each) |
| Features/Grid |
Card depth (shadow + hover lift), icon refinement, consistent spacing |
Stagger grid items with 0.1–0.15s offset |
| Testimonials |
Quote styling, avatar polish, card surface differentiation |
Stagger cards left-to-right |
| Stats/Numbers |
Oversized numbers with accent color, label typography, divider lines |
Each stat fades in with offset |
| CTA Section |
Strong background treatment, button refinement, generous padding |
Single block reveal |
| Footer |
Column spacing, link hover states, subtle dividers |
Single reveal |
Phase 5 — Quality Checklist
Before delivering the result, verify:
Notes & Edge Cases
- If the site uses Tailwind: Use
motion.div from Framer Motion with Tailwind classes. Add arbitrary values for blur: [filter:blur(8px)] or inline styles for the animation initial state.
- If colors are defined as Tailwind config values: Reference them in the animation components but don't change them.
- If there are images: Ensure they have defined height/aspect-ratio +
object-fit: cover. Consider adding subtle scale-on-hover.
- For dark sites: Glassmorphism works especially well. Use
bg-white/5 or similar low-opacity whites for card surfaces.
- For light sites: Use soft, layered shadows (
shadow-sm + shadow-md combo). Use slight background tints to distinguish sections.
- Performance:
blur() filter animations can be GPU-intensive on low-end devices. If performance is a concern, drop the blur and use only opacity + translateY.
1---2name: ui-enhance-animate3description: Comprehensively upgrades and polishes an existing website's UI design — improving layout, typography, spacing, depth, visual hierarchy, and component refinement — while preserving the site's existing color palette. Also adds smooth, staggered blur+slide-up reveal animations using Framer Motion (or CSS if plain HTML) triggered when elements enter the viewport. Use this skill whenever the user wants to improve, modernize, polish, or animate an existing website or React/HTML page. Trigger even when the user only mentions "make it look better", "animate it", "improve the design", "upgrade the UI", "make it more modern", or "add scroll animations" — this skill handles all of those, not just animation.4---5# UI Enhancement + Staggered Animation Skill67This skill performs a **full design upgrade** of an existing website or component. It is NOT just about adding animations — it is a holistic visual refinement pass that touches typography, spacing, layout, depth, micro-interactions, and motion. The existing **color palette is preserved**; everything else can and should be improved.89---1011## Phase 1 — Audit & Understand Before Touching Anything1213Before writing a single line of code, do a thorough read of the existing code. Extract and note:14151. **Color palette** — all hex/hsl/rgb values, CSS variables, Tailwind color classes. These are **sacred and must be preserved exactly**.162. **Font stack** — what fonts are currently in use.173. **Layout structure** — is it CSS Grid, Flexbox, plain blocks? What's the overall page structure?184. **Component inventory** — list every distinct section/component: hero, navbar, cards, features, testimonials, CTA, footer, etc.195. **Current weaknesses** — visually identify what looks amateur or generic: flat cards, no spacing rhythm, weak typography hierarchy, no depth/shadow, boring hover states, no visual flow, walls of text, etc.206. **Tech stack** — React (use Framer Motion), plain HTML/CSS (use CSS animations + IntersectionObserver), Vue, etc.2122Only after this audit should you begin making changes.2324---2526## Phase 2 — Full Design Upgrade (Non-Animation)2728Apply ALL of the following improvements that are relevant to the site. Be thorough — don't skip sections because they "look okay". Every part of the site should be elevated.2930### Typography31- Introduce a **clear typographic hierarchy**: display sizes (clamp-based fluid sizing), section headings, subheadings, body, caption — each with distinct weight and size.32- Replace generic system fonts (Arial, Helvetica, system-ui) with a **distinctive pairing** from Google Fonts or similar. A strong display/heading font paired with a clean readable body font.33- Use `letter-spacing` for uppercase labels and overlines.34- Add `line-height` rhythm: ~1.2 for headings, ~1.6–1.7 for body text.35- Tighten long text blocks with `max-width: 65ch` for readability.3637### Spacing & Rhythm38- Introduce a consistent spacing scale (e.g., 4/8/16/24/32/48/64/96px).39- Increase section padding — most amateur sites are too cramped.40- Add generous whitespace between section components.41- Ensure consistent internal card/component padding.4243### Depth & Surfaces44- Add layered `box-shadow` to cards, modals, and elevated surfaces. Use multi-layer soft shadows, not harsh single-layer ones.45- Use subtle `border` with low-opacity color instead of hard outlines.46- Apply `backdrop-filter: blur()` to glass-morphism elements like navbars or overlapping cards where appropriate.47- Use subtle `background` differentiation between sections (slightly lighter/darker tint of existing colors).4849### Layout & Composition50- Break out of purely uniform grid layouts. Use asymmetric or offset compositions where they add interest.51- Add visual **anchors**: decorative elements, large background text/numbers, gradient blobs, or geometric shapes using the existing color palette (low opacity).52- Ensure the hero is impactful with generous sizing and a strong focal point.53- Use CSS Grid for complex layouts; avoid excessive nested divs.5455### Cards & Components56- Round all corners consistently (usually 8–16px for cards, 6–8px for buttons/inputs).57- Add hover states to all interactive elements: cards should lift (translateY + shadow), buttons should shift or glow.58- Ensure buttons have visible padding, strong contrast, and consider adding a subtle icon or arrow.59- Add `transition: all 0.2s ease` baseline to interactive elements.6061### Visual Polish Details62- Add subtle gradient overlays to hero images or dark sections.63- Use `overflow: hidden` on cards to clip child images and effects cleanly.64- Ensure images use `object-fit: cover` and have defined aspect ratios.65- Add divider treatments between sections (subtle border, gradient fade, or decorative wave/angle).66- If there are icons, ensure they are consistently sized and optically aligned with text.6768---6970## Phase 3 — Staggered Blur + Slide-Up Reveal Animations7172### Animation Philosophy73- Animations should feel **natural and elegant** — not flashy or distracting.74- **Every major content section** should animate in when it enters the viewport.75- Use a **staggered pattern**: child elements within a section animate in one by one with a delay offset (e.g., 0.1s apart).76- The animation: elements start `opacity: 0`, `filter: blur(8px)`, `translateY(24px)` and transition to `opacity: 1`, `filter: blur(0px)`, `translateY(0)`.77- Duration: **0.6s** for most elements. Easing: `ease-out` or a custom cubic-bezier like `cubic-bezier(0.16, 1, 0.3, 1)` (snappy spring).78- Respect `prefers-reduced-motion` — disable animations for users who opt out.7980---8182### React — Framer Motion Implementation8384Install if not present:85```bash86npm install framer-motion87```8889#### Core Animation Variants9091```tsx92// lib/animations.ts93import { Variants } from "framer-motion";9495export const fadeUpBlur: Variants = {96 hidden: {97 opacity: 0,98 y: 24,99 filter: "blur(8px)",100 },101 visible: {102 opacity: 1,103 y: 0,104 filter: "blur(0px)",105 transition: {106 duration: 0.6,107 ease: [0.16, 1, 0.3, 1],108 },109 },110};111112export const staggerContainer: Variants = {113 hidden: {},114 visible: {115 transition: {116 staggerChildren: 0.1,117 delayChildren: 0.05,118 },119 },120};121122// For heavier stagger (e.g., feature grids)123export const staggerContainerSlow: Variants = {124 hidden: {},125 visible: {126 transition: {127 staggerChildren: 0.15,128 delayChildren: 0.1,129 },130 },131};132```133134#### Reusable AnimateInView Wrapper135136```tsx137// components/AnimateInView.tsx138import { motion, useInView } from "framer-motion";139import { useRef } from "react";140import { staggerContainer, fadeUpBlur } from "@/lib/animations";141142interface AnimateInViewProps {143 children: React.ReactNode;144 className?: string;145 delay?: number;146 stagger?: boolean;147}148149export function AnimateInView({150 children,151 className,152 delay = 0,153 stagger = false,154}: AnimateInViewProps) {155 const ref = useRef(null);156 const isInView = useInView(ref, { once: true, margin: "-80px" });157158 if (stagger) {159 return (160 <motion.div161 ref={ref}162 className={className}163 variants={staggerContainer}164 initial="hidden"165 animate={isInView ? "visible" : "hidden"}166 >167 {children}168 </motion.div>169 );170 }171172 return (173 <motion.div174 ref={ref}175 className={className}176 variants={fadeUpBlur}177 initial="hidden"178 animate={isInView ? "visible" : "hidden"}179 transition={{ delay }}180 >181 {children}182 </motion.div>183 );184}185186// Individual animated child (use inside AnimateInView with stagger=true)187export function AnimatedItem({188 children,189 className,190}: {191 children: React.ReactNode;192 className?: string;193}) {194 return (195 <motion.div className={className} variants={fadeUpBlur}>196 {children}197 </motion.div>198 );199}200```201202#### Usage Pattern203204```tsx205// Hero section — single block fade206<AnimateInView>207 <h1>Your Headline</h1>208 <p>Subheadline text here</p>209 <Button>CTA</Button>210</AnimateInView>211212// Feature grid — staggered children213<AnimateInView stagger className="grid grid-cols-3 gap-6">214 {features.map((f) => (215 <AnimatedItem key={f.id}>216 <FeatureCard {...f} />217 </AnimatedItem>218 ))}219</AnimateInView>220221// Section heading + body — slight delays222<div>223 <AnimateInView delay={0}>224 <h2>Section Title</h2>225 </AnimateInView>226 <AnimateInView delay={0.1}>227 <p>Section description</p>228 </AnimateInView>229</div>230```231232#### Reduced Motion233234```tsx235// Wrap your app or layout:236import { LazyMotion, domAnimation, MotionConfig } from "framer-motion";237238export function Providers({ children }: { children: React.ReactNode }) {239 return (240 <MotionConfig reducedMotion="user">241 <LazyMotion features={domAnimation}>242 {children}243 </LazyMotion>244 </MotionConfig>245 );246}247```248249---250251### Plain HTML/CSS/JS — CSS + IntersectionObserver Implementation252253#### CSS Animation Classes254255```css256/* Add to your global stylesheet */257258@media (prefers-reduced-motion: no-preference) {259 .reveal {260 opacity: 0;261 transform: translateY(24px);262 filter: blur(8px);263 transition:264 opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),265 transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),266 filter 0.6s cubic-bezier(0.16, 1, 0.3, 1);267 }268269 .reveal.in-view {270 opacity: 1;271 transform: translateY(0);272 filter: blur(0px);273 }274275 /* Stagger delays for children */276 .stagger-children .reveal:nth-child(1) { transition-delay: 0.0s; }277 .stagger-children .reveal:nth-child(2) { transition-delay: 0.1s; }278 .stagger-children .reveal:nth-child(3) { transition-delay: 0.2s; }279 .stagger-children .reveal:nth-child(4) { transition-delay: 0.3s; }280 .stagger-children .reveal:nth-child(5) { transition-delay: 0.4s; }281 .stagger-children .reveal:nth-child(6) { transition-delay: 0.5s; }282 /* Add more as needed */283}284```285286#### IntersectionObserver Script287288```js289// Add before closing </body>290const observer = new IntersectionObserver(291 (entries) => {292 entries.forEach((entry) => {293 if (entry.isIntersecting) {294 entry.target.classList.add("in-view");295 observer.unobserve(entry.target); // animate once296 }297 });298 },299 { rootMargin: "-80px 0px", threshold: 0.1 }300);301302document.querySelectorAll(".reveal").forEach((el) => observer.observe(el));303```304305#### Usage Pattern306307```html308<!-- Single block -->309<section>310 <div class="reveal">311 <h2>Section Title</h2>312 <p>Description text</p>313 </div>314</section>315316<!-- Staggered grid -->317<div class="stagger-children grid">318 <div class="reveal card">Feature 1</div>319 <div class="reveal card">Feature 2</div>320 <div class="reveal card">Feature 3</div>321</div>322```323324---325326## Phase 4 — Section-by-Section Application Guide327328Apply improvements and animations to each section type as follows:329330| Section | Design Upgrades | Animation Pattern |331|---|---|---|332| **Navbar** | Glassmorphism `backdrop-blur`, subtle border-bottom, refined logo spacing | Fade in on load (no scroll trigger) |333| **Hero** | Large fluid type, strong hierarchy, gradient or decorative blob, CTA button polish | Single block stagger: headline → subtext → CTA button (0.1s each) |334| **Features/Grid** | Card depth (shadow + hover lift), icon refinement, consistent spacing | Stagger grid items with 0.1–0.15s offset |335| **Testimonials** | Quote styling, avatar polish, card surface differentiation | Stagger cards left-to-right |336| **Stats/Numbers** | Oversized numbers with accent color, label typography, divider lines | Each stat fades in with offset |337| **CTA Section** | Strong background treatment, button refinement, generous padding | Single block reveal |338| **Footer** | Column spacing, link hover states, subtle dividers | Single reveal |339340---341342## Phase 5 — Quality Checklist343344Before delivering the result, verify:345346- [ ] All original colors are preserved (no new palette colors introduced)347- [ ] Every section has at least one `.reveal` / `AnimateInView` wrapper348- [ ] Stagger is applied to all grid/list/card groups of 2+ items349- [ ] `prefers-reduced-motion` is respected350- [ ] Hover states exist on all interactive elements351- [ ] Typography has clear hierarchy (not all same size/weight)352- [ ] Cards/surfaces have depth (shadow, border, or background distinction)353- [ ] Spacing feels generous and rhythmic — not cramped354- [ ] No generic placeholder improvements — every change is intentional and visible355- [ ] The site feels noticeably more polished than before356357---358359## Notes & Edge Cases360361- **If the site uses Tailwind**: Use `motion.div` from Framer Motion with Tailwind classes. Add arbitrary values for blur: `[filter:blur(8px)]` or inline styles for the animation initial state.362- **If colors are defined as Tailwind config values**: Reference them in the animation components but don't change them.363- **If there are images**: Ensure they have defined height/aspect-ratio + `object-fit: cover`. Consider adding subtle scale-on-hover.364- **For dark sites**: Glassmorphism works especially well. Use `bg-white/5` or similar low-opacity whites for card surfaces.365- **For light sites**: Use soft, layered shadows (`shadow-sm` + `shadow-md` combo). Use slight background tints to distinguish sections.366- **Performance**: `blur()` filter animations can be GPU-intensive on low-end devices. If performance is a concern, drop the blur and use only `opacity` + `translateY`.