Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Accordion CSS Animation & Keyframe Library

## Description
This PR adds a comprehensive CSS Animation and Keyframe library to the `accordion` component. It provides five production-ready keyframe animations (fade-in-up, scale-in, pulse, spin, shimmer) with stagger delay utilities, all using only `transform` and `opacity` to remain on the GPU compositor thread.

All animations are fully accessible and automatically disable when users have `prefers-reduced-motion: reduce` enabled.

## Keyframe Animations
- `ease-fade-in-up`: Smooth entrance animation from below.
- `ease-scale-in`: Spring-physics scale-in entrance with overshoot.
- `ease-pulse`: Breathing pulse for loading or attention states.
- `ease-spin`: Continuous rotation for loaders/spinners.
- `ease-shimmer`: Horizontal shimmer for skeleton loading states.

## Changes
- `style.css`: 90+ lines with keyframes, utility classes, stagger delays, and reduced-motion override.
- `demo.html`: Six-panel demo showcasing all five animations.
- `README.md`: Describes the animation library and accessibility considerations.
\nFixes #55621\n
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Animation Library - EaseMotion CSS</title>
<link rel="stylesheet" href="style.css">
<style>
body {
font-family: system-ui, sans-serif;
padding: 2rem;
max-width: 800px;
margin: 0 auto;
background: #020617;
color: #f1f5f9;
line-height: 1.5;
}
.demo-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
gap: 1.5rem;
margin-block-start: 2rem;
}
.anim-card {
background: rgba(255,255,255,0.05);
border: 1px solid rgba(255,255,255,0.1);
border-radius: 10px;
padding: 1.5rem;
text-align: center;
}
.anim-card h3 { margin: 0 0 0.5rem; font-size: 0.875rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.08em; }
.anim-target {
width: 60px;
height: 60px;
background: linear-gradient(135deg, #2563eb, #7c3aed);
border-radius: 12px;
margin: 1rem auto 0;
display: flex;
align-items: center;
justify-content: center;
font-size: 1.5rem;
}
.instructions {
background: #1e293b;
padding: 1.25rem 1.5rem;
border-inline-start: 4px solid #3b82f6;
border-radius: 0 8px 8px 0;
color: #93c5fd;
margin-block-end: 2rem;
font-size: 0.9rem;
}
</style>
</head>
<body>
<main>
<h1>ease-accordion Animation Library</h1>

<div class="instructions">
All animations use only <code>transform</code> and <code>opacity</code> to stay on the GPU compositor thread. They automatically disable when the user has <strong>prefers-reduced-motion: reduce</strong> enabled.
</div>

<div class="ease-accordion-anim-harrshita">
<div class="demo-grid">

<div class="anim-card">
<h3>Fade Up</h3>
<div class="anim-target anim-fade-up">✨</div>
</div>

<div class="anim-card">
<h3>Scale In</h3>
<div class="anim-target anim-scale-in delay-1">🎯</div>
</div>

<div class="anim-card">
<h3>Pulse</h3>
<div class="anim-target anim-pulse">💓</div>
</div>

<div class="anim-card">
<h3>Spin</h3>
<div class="anim-target"><span class="anim-spin">⚙️</span></div>
</div>

<div class="anim-card">
<h3>Shimmer</h3>
<div class="anim-target anim-shimmer"></div>
</div>

<div class="anim-card">
<h3>Stagger</h3>
<div class="anim-target anim-fade-up delay-3">🚀</div>
</div>

</div>
</div>
</main>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
/*
* Feature: accordion CSS Animation & Keyframe Optimization
* Provides a rich, hardware-accelerated animation library using
* @keyframes and CSS custom properties for duration/easing control.
*
* All animations respect prefers-reduced-motion for accessibility.
* Uses will-change, transform, and opacity exclusively to remain
* on the GPU compositor thread (no layout/paint thrashing).
*
* WCAG 2.1 SC 2.3.3: Animation from Interactions (Level AAA)
*/

/* ===== Animation Token Definitions ===== */
.ease-accordion-anim-harrshita {
--anim-duration-fast: 200ms;
--anim-duration-base: 400ms;
--anim-duration-slow: 700ms;
--anim-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
--anim-ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
--anim-ease-decel: cubic-bezier(0, 0, 0.2, 1);
--anim-ease-accel: cubic-bezier(0.4, 0, 1, 1);

position: relative;
box-sizing: border-box;
background: linear-gradient(135deg, #2563eb, #4f46e5);
color: #ffffff;
border-radius: 12px;
padding: 2rem;
font-family: system-ui, sans-serif;
font-size: 1rem;
line-height: 1.5;
overflow: hidden;
}

/* ===== Keyframe: Fade In Up ===== */
@keyframes ease-fade-in-up {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}

/* ===== Keyframe: Scale In (Spring) ===== */
@keyframes ease-scale-in {
from {
opacity: 0;
transform: scale(0.85);
}
to {
opacity: 1;
transform: scale(1);
}
}

/* ===== Keyframe: Shimmer (Skeleton Loading) ===== */
@keyframes ease-shimmer {
0% { background-position: -200% center; }
100% { background-position: 200% center; }
}

/* ===== Keyframe: Pulse ===== */
@keyframes ease-pulse {
0%, 100% { opacity: 1; transform: scale(1); }
50% { opacity: 0.7; transform: scale(0.97); }
}

/* ===== Keyframe: Spin ===== */
@keyframes ease-spin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}

/* ===== Animation Utility Classes ===== */
.ease-accordion-anim-harrshita .anim-fade-up {
animation: ease-fade-in-up var(--anim-duration-base) var(--anim-ease-decel) both;
will-change: opacity, transform;
}

.ease-accordion-anim-harrshita .anim-scale-in {
animation: ease-scale-in var(--anim-duration-base) var(--anim-ease-spring) both;
will-change: opacity, transform;
}

.ease-accordion-anim-harrshita .anim-pulse {
animation: ease-pulse 2s var(--anim-ease-smooth) infinite;
will-change: opacity, transform;
}

.ease-accordion-anim-harrshita .anim-spin {
animation: ease-spin 1s linear infinite;
will-change: transform;
display: inline-block;
}

.ease-accordion-anim-harrshita .anim-shimmer {
background: linear-gradient(
90deg,
rgba(255,255,255,0.06) 25%,
rgba(255,255,255,0.18) 50%,
rgba(255,255,255,0.06) 75%
);
background-size: 200% 100%;
animation: ease-shimmer 1.5s linear infinite;
}

/* ===== Stagger delay utilities ===== */
.ease-accordion-anim-harrshita .delay-1 { animation-delay: 100ms; }
.ease-accordion-anim-harrshita .delay-2 { animation-delay: 200ms; }
.ease-accordion-anim-harrshita .delay-3 { animation-delay: 300ms; }

/* ===== ACCESSIBILITY: Respect prefers-reduced-motion ===== */
@media (prefers-reduced-motion: reduce) {
.ease-accordion-anim-harrshita *,
.ease-accordion-anim-harrshita *::before,
.ease-accordion-anim-harrshita *::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Alert CSS Animation & Keyframe Library

## Description
This PR adds a comprehensive CSS Animation and Keyframe library to the `alert` component. It provides five production-ready keyframe animations (fade-in-up, scale-in, pulse, spin, shimmer) with stagger delay utilities, all using only `transform` and `opacity` to remain on the GPU compositor thread.

All animations are fully accessible and automatically disable when users have `prefers-reduced-motion: reduce` enabled.

## Keyframe Animations
- `ease-fade-in-up`: Smooth entrance animation from below.
- `ease-scale-in`: Spring-physics scale-in entrance with overshoot.
- `ease-pulse`: Breathing pulse for loading or attention states.
- `ease-spin`: Continuous rotation for loaders/spinners.
- `ease-shimmer`: Horizontal shimmer for skeleton loading states.

## Changes
- `style.css`: 90+ lines with keyframes, utility classes, stagger delays, and reduced-motion override.
- `demo.html`: Six-panel demo showcasing all five animations.
- `README.md`: Describes the animation library and accessibility considerations.
\nFixes #55621\n
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Animation Library - EaseMotion CSS</title>
<link rel="stylesheet" href="style.css">
<style>
body {
font-family: system-ui, sans-serif;
padding: 2rem;
max-width: 800px;
margin: 0 auto;
background: #020617;
color: #f1f5f9;
line-height: 1.5;
}
.demo-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
gap: 1.5rem;
margin-block-start: 2rem;
}
.anim-card {
background: rgba(255,255,255,0.05);
border: 1px solid rgba(255,255,255,0.1);
border-radius: 10px;
padding: 1.5rem;
text-align: center;
}
.anim-card h3 { margin: 0 0 0.5rem; font-size: 0.875rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.08em; }
.anim-target {
width: 60px;
height: 60px;
background: linear-gradient(135deg, #2563eb, #7c3aed);
border-radius: 12px;
margin: 1rem auto 0;
display: flex;
align-items: center;
justify-content: center;
font-size: 1.5rem;
}
.instructions {
background: #1e293b;
padding: 1.25rem 1.5rem;
border-inline-start: 4px solid #3b82f6;
border-radius: 0 8px 8px 0;
color: #93c5fd;
margin-block-end: 2rem;
font-size: 0.9rem;
}
</style>
</head>
<body>
<main>
<h1>ease-alert Animation Library</h1>

<div class="instructions">
All animations use only <code>transform</code> and <code>opacity</code> to stay on the GPU compositor thread. They automatically disable when the user has <strong>prefers-reduced-motion: reduce</strong> enabled.
</div>

<div class="ease-alert-anim-harrshita">
<div class="demo-grid">

<div class="anim-card">
<h3>Fade Up</h3>
<div class="anim-target anim-fade-up">✨</div>
</div>

<div class="anim-card">
<h3>Scale In</h3>
<div class="anim-target anim-scale-in delay-1">🎯</div>
</div>

<div class="anim-card">
<h3>Pulse</h3>
<div class="anim-target anim-pulse">💓</div>
</div>

<div class="anim-card">
<h3>Spin</h3>
<div class="anim-target"><span class="anim-spin">⚙️</span></div>
</div>

<div class="anim-card">
<h3>Shimmer</h3>
<div class="anim-target anim-shimmer"></div>
</div>

<div class="anim-card">
<h3>Stagger</h3>
<div class="anim-target anim-fade-up delay-3">🚀</div>
</div>

</div>
</div>
</main>
</body>
</html>
Loading
Loading