Skip to content

Commit e6c5156

Browse files
committed
Enhance Animation Card Interactions with Collapsible Details and Improved Accessibility
- Add collapsible animation card design with smooth expand/collapse transitions - Implement toggle functionality for animation card details - Improve accessibility with ARIA attributes and screen reader support - Refactor CSS to support new card interaction states - Add dark mode styling for collapsible animation cards - Enhance event handling for card interactions and details toggling
1 parent 72eb407 commit e6c5156

2 files changed

Lines changed: 450 additions & 345 deletions

File tree

css/animations.css

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,116 @@
239239
0 0 30px rgba(var(--accent-color-rgb), 0.2);
240240
}
241241

242+
/* Animation Card Collapsible States */
243+
.animation-header {
244+
position: relative;
245+
z-index: 2;
246+
}
247+
248+
.animation-title {
249+
display: flex;
250+
justify-content: space-between;
251+
align-items: center;
252+
padding: 1.25rem 2rem;
253+
border-top: 1px solid rgba(0, 0, 0, 0.06);
254+
background: rgba(255, 255, 255, 0.7);
255+
backdrop-filter: blur(5px);
256+
-webkit-backdrop-filter: blur(5px);
257+
transition: all 0.3s ease;
258+
}
259+
260+
.animation-title h3 {
261+
margin: 0;
262+
font-size: 1.25rem;
263+
font-weight: 700;
264+
cursor: pointer;
265+
color: var(--primary-color);
266+
transition: color 0.2s ease;
267+
}
268+
269+
.animation-title h3:hover {
270+
color: var(--accent-color);
271+
}
272+
273+
.toggle-details {
274+
background: rgba(0, 0, 0, 0.05);
275+
border: none;
276+
width: 32px;
277+
height: 32px;
278+
border-radius: 50%;
279+
display: flex;
280+
align-items: center;
281+
justify-content: center;
282+
cursor: pointer;
283+
transition: all 0.3s ease;
284+
color: var(--primary-color);
285+
}
286+
287+
.toggle-details:hover {
288+
background: rgba(0, 0, 0, 0.1);
289+
transform: translateY(-2px);
290+
}
291+
292+
.toggle-details i {
293+
transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
294+
}
295+
296+
/* Collapsed State */
297+
.animation-card.collapsed .animation-details {
298+
max-height: 0;
299+
opacity: 0;
300+
overflow: hidden;
301+
visibility: hidden;
302+
transform: translateY(-10px);
303+
transition:
304+
max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
305+
opacity 0.3s ease,
306+
visibility 0s linear 0.3s,
307+
transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
308+
}
309+
310+
/* Expanded State */
311+
.animation-card.expanded .animation-details {
312+
max-height: 2000px;
313+
opacity: 1;
314+
visibility: visible;
315+
transform: translateY(0);
316+
transition:
317+
max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
318+
opacity 0.3s ease,
319+
visibility 0s linear,
320+
transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
321+
}
322+
323+
.animation-card.expanded .toggle-details {
324+
background: rgba(var(--accent-color-rgb), 0.1);
325+
color: var(--accent-color);
326+
}
327+
328+
/* Dark Mode Styles for Collapsible Cards */
329+
[data-theme="dark"] .animation-title {
330+
border-top: 1px solid rgba(255, 255, 255, 0.1);
331+
background: rgba(30, 41, 59, 0.7);
332+
}
333+
334+
[data-theme="dark"] .animation-title h3 {
335+
color: var(--gray-100);
336+
}
337+
338+
[data-theme="dark"] .toggle-details {
339+
background: rgba(255, 255, 255, 0.1);
340+
color: var(--gray-300);
341+
}
342+
343+
[data-theme="dark"] .toggle-details:hover {
344+
background: rgba(255, 255, 255, 0.15);
345+
}
346+
347+
[data-theme="dark"] .animation-card.expanded .toggle-details {
348+
background: rgba(var(--accent-color-rgb), 0.2);
349+
color: var(--accent-color);
350+
}
351+
242352
/* Animation Preview */
243353
.animation-preview {
244354
min-height: 230px;

0 commit comments

Comments
 (0)