4242 --fallback-border : # ffecb5 ;
4343
4444 /* Theme transition timing for smooth switching */
45- --theme-transition-duration : 0.4s ;
46- --theme-transition-timing : cubic-bezier (0.4 , 0.0 , 0.2 , 1 );
45+ --theme-transition-duration : 0.3s ;
46+ --theme-transition-timing : ease-out;
47+ --theme-transition-timing-smooth : ease-out;
4748
4849 /* Liquid Glass Effect Variables */
4950 --liquid-glass-edge-size : 20px ;
9293 scroll-behavior : smooth;
9394 scroll-padding-top : calc (var (--nav-height ) + 20px ); /* Match the offset in smoothScrollTo function */
9495 transition :
95- background-color var (--theme-transition-duration ) var (--theme-transition-timing )}
96+ background-color var (--theme-transition-duration ) var (--theme-transition-timing-smooth ),
97+ color-scheme var (--theme-transition-duration ) var (--theme-transition-timing-smooth )}
9698
9799body {
98100 font-family : var (--font-body );
@@ -103,8 +105,8 @@ body {
103105 -moz-osx-font-smoothing : grayscale;
104106 min-height : 100vh ;
105107 transition :
106- background-color var (--theme-transition-duration ) var (--theme-transition-timing ),
107- color var (--theme-transition-duration ) var (--theme-transition-timing );
108+ background-color var (--theme-transition-duration ) var (--theme-transition-timing-smooth ),
109+ color var (--theme-transition-duration ) var (--theme-transition-timing-smooth );
108110 overflow-x : hidden;
109111 position : relative}
110112body .mobile-menu-open {
@@ -247,8 +249,8 @@ html[data-theme="light"] .btn-outline:hover, html[data-theme="light"] .btn-outli
247249
248250.navbar { position : fixed; top : 0 ; left : 0 ; width : 100% ; height : var (--nav-height ); background-color : var (--nav-bg ); backdrop-filter : blur (var (--blur-strength )); -webkit-backdrop-filter : blur (var (--blur-strength )); display : flex; align-items : center; padding : 0 20px ; z-index : 1000 ; border-bottom : 1px solid var (--glass-border-color ); transition :
249251 top 0.3s ease,
250- background-color var (--theme-transition-duration ) var (--theme-transition-timing ),
251- border-color var (--theme-transition-duration ) var (--theme-transition-timing ),
252+ background-color var (--theme-transition-duration ) var (--theme-transition-timing-smooth ),
253+ border-color var (--theme-transition-duration ) var (--theme-transition-timing-smooth ),
252254 box-shadow var (--transition-speed );
253255 box-shadow : 0 2px 10px rgba (0 , 0 , 0 , 0.1 )}
254256
@@ -2707,6 +2709,40 @@ section {
27072709}
27082710
27092711/* Theme transition overlay for ultra-smooth experience */
2712+ /* View Transition API Support for ultra-smooth theme switching */
2713+ ::view-transition-old (root ),
2714+ ::view-transition-new (root ) {
2715+ animation-duration : 0.35s ;
2716+ animation-timing-function : cubic-bezier (0.32 , 0.08 , 0.24 , 1 );
2717+ }
2718+
2719+ ::view-transition-old (root ) {
2720+ animation-name : theme-fade-out;
2721+ }
2722+
2723+ ::view-transition-new (root ) {
2724+ animation-name : theme-fade-in;
2725+ }
2726+
2727+ @keyframes theme-fade-out {
2728+ from {
2729+ opacity : 1 ;
2730+ }
2731+ to {
2732+ opacity : 0 ;
2733+ }
2734+ }
2735+
2736+ @keyframes theme-fade-in {
2737+ from {
2738+ opacity : 0 ;
2739+ }
2740+ to {
2741+ opacity : 1 ;
2742+ }
2743+ }
2744+
2745+ /* Smooth overlay for theme transitions */
27102746body ::after {
27112747 content : '' ;
27122748 position : fixed;
@@ -2718,35 +2754,39 @@ body::after {
27182754 opacity : 0 ;
27192755 z-index : 9999 ;
27202756 pointer-events : none;
2721- transition :
2722- opacity 0.2s ease-out,
2723- background-color var (--theme-transition-duration ) var (--theme-transition-timing );
2724- will-change : opacity;
2757+ transition : opacity 0.15s ease-in-out;
27252758}
27262759
27272760body .theme-transitioning ::after {
2728- opacity : 0.08 ;
2761+ opacity : 0.2 ;
27292762}
27302763
2731- /* Prevent layout shift during theme transition */
2764+ /* Prevent layout shift and optimize during theme transition */
27322765body .theme-transitioning {
27332766 overflow-x : hidden;
27342767}
27352768
2736- /* Smooth color transitions for all themed elements */
2737- * {
2738- transition-property : background-color, border-color, color, fill, stroke;
2739- transition-duration : var (--theme-transition-duration );
2740- transition-timing-function : var (--theme-transition-timing );
2769+ body .theme-transitioning * {
2770+ animation-play-state : paused !important ;
27412771}
27422772
2743- /* Exclude specific elements from theme transitions */
2744- .animate-in ,
2745- .glass-panel ,
2746- .modal-overlay ,
2747- .modal-content ,
2748- canvas {
2749- transition-property : background-color, border-color, color, fill, stroke, transform, opacity, box-shadow !important ;
2773+ /* Smooth color transitions for themed elements */
2774+ body ,
2775+ .navbar ,
2776+ .section ,
2777+ .glass-card ,
2778+ .btn ,
2779+ p ,
2780+ h1 , h2 , h3 , h4 , h5 , h6 ,
2781+ .nav-logo ,
2782+ .nav-links a ,
2783+ .project-card ,
2784+ .skill-item ,
2785+ footer {
2786+ transition : background-color var (--theme-transition-duration ) ease-out,
2787+ color var (--theme-transition-duration ) ease-out,
2788+ border-color var (--theme-transition-duration ) ease-out,
2789+ box-shadow var (--theme-transition-duration ) ease-out;
27502790}
27512791
27522792/* Global scrollbar transitions moved to scrollbar.css */
@@ -2765,8 +2805,13 @@ canvas {
27652805
27662806/* Theme toggle enhanced animations */
27672807.theme-toggle-btn , .theme-toggle {
2768- transition : all 0.3s cubic-bezier (0.4 , 0.0 , 0.2 , 1 );
2769- transform-origin : center}
2808+ transition : transform 0.2s ease-out;
2809+ transform-origin : center;
2810+ }
2811+
2812+ .theme-toggle-btn : active {
2813+ transform : scale (0.95 );
2814+ }
27702815
27712816.theme-toggle : hover {
27722817 transform : scale (1.1 ) rotate (10deg )}
@@ -2831,9 +2876,25 @@ canvas {
28312876 .theme-toggle : hover {
28322877 transform : none}
28332878
2879+ .theme-toggle-btn : active {
2880+ transform : none !important }
2881+
2882+ .theme-toggle-btn svg {
2883+ transition : none !important }
2884+
2885+ .theme-transitioning .theme-toggle-btn svg {
2886+ transform : none !important }
2887+
28342888 .btn : hover {
28352889 transform : none}
28362890
2891+ body ::after {
2892+ display : none !important }
2893+
2894+ ::view-transition-old (root ),
2895+ ::view-transition-new (root ) {
2896+ animation : none !important }
2897+
28372898 .nav-links a {
28382899 filter : none !important ;
28392900 backdrop-filter : blur (10px ) !important }
0 commit comments