feat: Add ripple effect to login/logout transitions

Add three-layer expanding ripple animation during fadeOut phase:
- Ripples expand from screen center using primary theme color
- Each layer has staggered delay (0ms, 150ms, 300ms) for wave effect
- Ripples fade out as they expand to create elegant visual feedback
- Uses pure CSS keyframe animation, no external libraries

Total animation: 800ms ripple + 300ms screen fade
This commit is contained in:
ZacharyZcR
2025-11-09 08:19:42 +08:00
parent 28406d060c
commit f1bf12bb98

View File

@@ -229,7 +229,46 @@ function AppContent() {
className={`fixed inset-0 bg-background z-[20000] transition-opacity duration-300 ${
transitionPhase === 'fadeOut' ? 'opacity-100' : 'opacity-0'
}`}
/>
>
{transitionPhase === 'fadeOut' && (
<>
<div className="absolute inset-0 flex items-center justify-center">
<div className="absolute w-0 h-0 bg-primary/20 rounded-full animate-[ping_1s_ease-out]"
style={{
animation: 'ripple 0.8s ease-out forwards',
animationDelay: '0ms'
}}
/>
<div className="absolute w-0 h-0 bg-primary/15 rounded-full"
style={{
animation: 'ripple 0.8s ease-out forwards',
animationDelay: '150ms'
}}
/>
<div className="absolute w-0 h-0 bg-primary/10 rounded-full"
style={{
animation: 'ripple 0.8s ease-out forwards',
animationDelay: '300ms'
}}
/>
</div>
<style>{`
@keyframes ripple {
0% {
width: 0;
height: 0;
opacity: 1;
}
100% {
width: 200vmax;
height: 200vmax;
opacity: 0;
}
}
`}</style>
</>
)}
</div>
)}
<Toaster