@@ -182,23 +182,70 @@ window.notifyFontLoadingComplete = function() {
182182 progressText . textContent = '字体加载完成!' ;
183183 }
184184
185- // Optimized fade-out with better performance
185+ // Enhanced exit animation sequence
186186 if ( loadingContainer ) {
187- requestAnimationFrame ( ( ) => {
188- loadingContainer . style . transition = 'opacity 0.5s ease-out' ;
189- loadingContainer . style . opacity = '0' ;
190-
191- setTimeout ( ( ) => {
192- loadingContainer . style . display = 'none' ;
193- loadingContainer . remove ( ) ;
194-
195- // Clear references for garbage collection
196- window . loadingIntervals = null ;
197- } , 500 ) ;
198- } ) ;
187+ performExitAnimation ( loadingContainer ) ;
199188 }
200189} ;
201190
191+ // Enhanced exit animation function with modern tech effects
192+ function performExitAnimation ( loadingContainer ) {
193+ console . log ( "Starting enhanced tech-style exit animation" ) ;
194+
195+ requestAnimationFrame ( ( ) => {
196+ // Get all animated elements including new tech elements
197+ const loader = loadingContainer . querySelector ( '.loader' ) ;
198+ const progressContainer = loadingContainer . querySelector ( '.progress-container' ) ;
199+ const progressText = loadingContainer . querySelector ( '.progress-text' ) ;
200+ const codeAnimation = loadingContainer . querySelector ( '.code-animation' ) ;
201+ const tags = loadingContainer . querySelector ( '.tags' ) ;
202+ const tagElements = loadingContainer . querySelectorAll ( '.tag' ) ;
203+ const infoText = loadingContainer . querySelector ( '.info-text' ) ;
204+ const pulse = loadingContainer . querySelector ( '.pulse' ) ;
205+ const core = loadingContainer . querySelector ( '.core' ) ;
206+ const ripples = loadingContainer . querySelectorAll ( '.ripple' ) ;
207+ const orbitParticles = loadingContainer . querySelectorAll ( '.orbit-particle' ) ;
208+ const particles = loadingContainer . querySelectorAll ( '.float-particle' ) ;
209+
210+ // Simple staggered exit animations - elegant and restrained
211+ setTimeout ( ( ) => {
212+ // Stage 1: Core elements (100ms delay)
213+ if ( core ) core . classList . add ( 'exiting' ) ;
214+ if ( pulse ) pulse . classList . add ( 'exiting' ) ;
215+ ripples . forEach ( ripple => ripple . classList . add ( 'exiting' ) ) ;
216+ if ( loader ) loader . classList . add ( 'exiting' ) ;
217+ } , 100 ) ;
218+
219+ setTimeout ( ( ) => {
220+ // Stage 2: UI elements (200ms total delay)
221+ if ( progressContainer ) progressContainer . classList . add ( 'exiting' ) ;
222+ if ( progressText ) progressText . classList . add ( 'exiting' ) ;
223+ if ( codeAnimation ) codeAnimation . classList . add ( 'exiting' ) ;
224+ if ( tags ) tags . classList . add ( 'exiting' ) ;
225+ tagElements . forEach ( tag => tag . classList . add ( 'exiting' ) ) ;
226+ if ( infoText ) infoText . classList . add ( 'exiting' ) ;
227+ } , 200 ) ;
228+
229+ setTimeout ( ( ) => {
230+ // Stage 3: Particles and final container (400ms total delay)
231+ particles . forEach ( particle => particle . classList . add ( 'exiting' ) ) ;
232+ orbitParticles . forEach ( particle => particle . classList . add ( 'exiting' ) ) ;
233+ loadingContainer . classList . add ( 'exiting' ) ;
234+ } , 400 ) ;
235+
236+ // Clean and efficient cleanup
237+ setTimeout ( ( ) => {
238+ loadingContainer . style . display = 'none' ;
239+ loadingContainer . remove ( ) ;
240+
241+ // Clear references for garbage collection
242+ window . loadingIntervals = null ;
243+
244+ console . log ( "Loading animation completed - subtle and elegant" ) ;
245+ } , 800 ) ; // Reduced duration: 800ms
246+ } ) ;
247+ }
248+
202249// Initialize when DOM is ready
203250if ( document . readyState === 'loading' ) {
204251 document . addEventListener ( 'DOMContentLoaded' , initializeLoadingScreen ) ;
0 commit comments