Skip to content

A lightweight , interactive theme switcher featuring a smooth circular transition effect

Notifications You must be signed in to change notification settings

chadikoder/sky-transition-animation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌌 Sky Transition Animation

An interactive, cinematic theme switcher that simulates a day-to-night transition using CSS clip-path logic. Instead of a simple color swap, this project features a "moving shadow" effect that expands from the top of the screen.

πŸš€ The "Magic" Behind the Move

This project uses a unique approach to dark mode:

  • Circular Clip-Path: The night layer is hidden as a 0% circle at the top-middle of the screen.
  • Transition Logic: When the sun is clicked, JavaScript toggles an .active class, causing the circle to grow to 150% over 5 seconds.
  • Layered Stacking: Uses ::after pseudo-elements and z-index management to ensure the Sun/Moon icons remain interactive and visible during the transition.

πŸ› οΈ Technical Stack

  • HTML5: Structured for layered overlays.
  • CSS3: Advanced clip-path, transition effects, and rgba transparency.
  • JavaScript: DOM manipulation and class-list toggling for state control.

πŸ’‘ Key Learnings

  • Mastering the coordinate system of clip-path: circle(radius at x y).
  • Managing pointer-events: none to prevent invisible layers from blocking user interaction.
  • Coordinating CSS transitions with JavaScript event listeners.

About

A lightweight , interactive theme switcher featuring a smooth circular transition effect

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors