feat: add premium wave and bounce entrance animations#5948
Conversation
Add two new visually engaging SVG/CSS entrance animations for the 3D isometric monolith blocks: - wave: blocks grow upward with a sweeping overshoot crest (scaleY 0 -> 1.15 -> 1), creating a left-to-right wave motion via staggered animation-delay - bounce: blocks drop from above with a multi-step elastic bounce (translateY -40px -> 0 -> -10px -> 0 -> -4px -> 0), simulating a natural physics bounce Changes: - lib/svg/animations.ts: added wave-up and bounce-in keyframe branches - lib/svg/generator.ts: widened renderStyle entrance union type - lib/validations.ts: added wave and bounce to Zod enum - types/index.ts: extended BadgeParams.entrance union - types/index.test-d.ts: updated type assertion - lib/svg/animations.test.ts: added unit tests for both animations Usage: &entrance=wave or &entrance=bounce Signed-off-by: Vivek Arya <vivekaryaa369@gmail.com>
|
@vivek0369 is attempting to deploy a commit to the jhasourav07's projects Team on Vercel. A member of the Team first needs to authorize it. |
📦 Next.js Bundle Size Report (Gzipped Sizes)✨ No significant bundle size changes detected. 📊 Summary of Totals
|
Aamod-Dev
left a comment
There was a problem hiding this comment.
Difficulty: intermediate – Adds wave/bounce entrance animations to animations.ts with keyframes, updates generator.ts and validations.ts enum, includes tests.
Quality: clean – Complete implementation with cubic-bezier easing, transform-origin handling.
Type: feature – New premium animation options for SVG towers.
Nice animations!
|
🎉 Congratulations @vivek0369! Your PR has been successfully merged. 🚀 Thank you for contributing to CommitPulse. Your work helps us build a better tool for the community.
Keep building! 💻✨ |
feat: add premium
waveandbounceentrance animations🎯 Summary
This PR introduces two new premium SVG/CSS entrance animations —
waveandbounce— for CommitPulse's 3D isometric monolith visualization. These animations extend the existing&entrance=customization parameter, giving users more visually engaging ways to showcase their GitHub contribution activity.Closes #<ISSUE_NUMBER>
✨ New Animations
🌊
&entrance=waveBlocks grow upward with a sweeping overshoot crest (
scaleY: 0 → 1.15 → 1).Since towers already use staggered animation delays based on grid position (
(row + col) * 0.015s), the animation naturally propagates across the monolith, creating a smooth left-to-right wave effect.Keyframe:
wave-upEasing:
cubic-bezier(0.16, 1, 0.3, 1)Result
Smooth cascading motion
Premium visual appearance
Maintains existing rendering performance
🏀
&entrance=bounceBlocks enter from above (
translateY: -40px → 0) and settle using a multi-step elastic bounce:The decreasing bounce amplitude simulates natural physics and provides a playful, dynamic entrance effect.
Keyframe:
bounce-inEasing:
cubic-bezier(0.28, 0.84, 0.42, 1)Result
Physics-inspired motion
Improved visual engagement
Smooth landing animation
🔧 Changes Made
File | Description -- | -- lib/svg/animations.ts | Added wave-up and bounce-in keyframes to getTowerAnimationCSS() lib/svg/generator.ts | Extended renderStyle() entrance union to support 'wave' and 'bounce' lib/validations.ts | Added new values to Zod .enum() validation types/index.ts | Updated BadgeParams.entrance type definitions types/index.test-d.ts | Updated compile-time type assertions lib/svg/animations.test.ts | Added unit tests for both new animations🧪 Testing
Added Tests
✅ Wave animation keyframe generation
✅ Bounce animation keyframe generation
✅ Correct CSS output generation
✅ Type validation coverage
✅ Schema validation coverage
Accessibility
✅ Fully respects
@media (prefers-reduced-motion: reduce)✅ Animations disabled when reduced motion is requested
✅ Static rendering fallback maintained
Scaling Verification
✅ Scale factor (
sf) applied correctly to:translateYoffsetsbounce amplitudes
transform origins
animation transforms
Validation
✅ Unknown entrance values continue to fall back to
'rise'✅ Existing behavior preserved through Zod
.catch('rise')📖 Usage
Wave Entrance
Bounce Entrance
🔄 Backward Compatibility
This change is fully backward compatible.
Existing entrance values continue to function exactly as before:
risefadeslidenoneNo breaking changes were introduced.
🚀 Benefits
Adds premium visual customization options
Improves GitHub profile presentation
Enhances user personalization
Demonstrates advanced SVG/CSS animation capabilities
Maintains performance and accessibility standards
📋 Checklist
Feature implemented
Unit tests added
Type definitions updated
Validation schema updated
Accessibility support included
Existing functionality preserved
Documentation updated
Lint checks passed
Tests passing
DCO sign-off completed
Related Issue
Fixes #5790