@@ -10,167 +10,24 @@ function initFooterDelay() {
1010
1111 if ( ! isMobile ) {
1212 // Show desktop indicator
13- const desktopIndicator = document . createElement ( 'div' ) ;
14- desktopIndicator . innerHTML = '🖥️ Desktop - no delay' ;
15- desktopIndicator . style . cssText = `
16- position: fixed;
17- top: 10px;
18- right: 10px;
19- background: rgba(0,100,0,0.8);
20- color: white;
21- padding: 8px 12px;
22- border-radius: 4px;
23- font-size: 12px;
24- z-index: 9999;
25- font-family: monospace;
26- ` ;
27- document . body . appendChild ( desktopIndicator ) ;
28- setTimeout ( ( ) => {
29- if ( desktopIndicator . parentNode ) {
30- desktopIndicator . parentNode . removeChild ( desktopIndicator ) ;
31- }
32- } , 2000 ) ;
3313 return ;
3414 }
3515
36- // Add visual debug indicator for mobile
37- const debugIndicator = document . createElement ( 'div' ) ;
38- debugIndicator . innerHTML = '📱 Mobile delay active' ;
39- debugIndicator . style . cssText = `
40- position: fixed;
41- top: 10px;
42- right: 10px;
43- background: rgba(0,0,0,0.8);
44- color: white;
45- padding: 8px 12px;
46- border-radius: 4px;
47- font-size: 12px;
48- z-index: 9999;
49- font-family: monospace;
50- ` ;
51- document . body . appendChild ( debugIndicator ) ;
52-
53- // Add touch capability indicator
54- const touchIndicator = document . createElement ( 'div' ) ;
55- touchIndicator . innerHTML = '👆 Touch events enabled' ;
56- touchIndicator . style . cssText = `
57- position: fixed;
58- top: 10px;
59- left: 10px;
60- background: rgba(0,100,100,0.8);
61- color: white;
62- padding: 8px 12px;
63- border-radius: 4px;
64- font-size: 12px;
65- z-index: 9999;
66- font-family: monospace;
67- ` ;
68- document . body . appendChild ( touchIndicator ) ;
69-
70- // Remove debug indicators after 3 seconds
71- setTimeout ( ( ) => {
72- if ( debugIndicator . parentNode ) {
73- debugIndicator . parentNode . removeChild ( debugIndicator ) ;
74- }
75- if ( touchIndicator . parentNode ) {
76- touchIndicator . parentNode . removeChild ( touchIndicator ) ;
77- }
78- } , 3000 ) ;
7916
8017 const footerLinks = document . querySelectorAll ( '.footer a[href]' ) ;
8118
82- // Show footer links count
83- const linksIndicator = document . createElement ( 'div' ) ;
84- linksIndicator . innerHTML = `🔗 Found ${ footerLinks . length } footer links` ;
85- linksIndicator . style . cssText = `
86- position: fixed;
87- top: 50px;
88- right: 10px;
89- background: rgba(0,0,100,0.8);
90- color: white;
91- padding: 8px 12px;
92- border-radius: 4px;
93- font-size: 12px;
94- z-index: 9999;
95- font-family: monospace;
96- ` ;
97- document . body . appendChild ( linksIndicator ) ;
98- setTimeout ( ( ) => {
99- if ( linksIndicator . parentNode ) {
100- linksIndicator . parentNode . removeChild ( linksIndicator ) ;
101- }
102- } , 2000 ) ;
103-
10419 footerLinks . forEach ( link => {
10520 // Add both click and touchstart events for mobile
10621 const handleInteraction = function ( e ) {
107- // Show click indicator
108- const clickIndicator = document . createElement ( 'div' ) ;
109- clickIndicator . innerHTML = `👆 Clicked: ${ this . getAttribute ( 'href' ) } ` ;
110- clickIndicator . style . cssText = `
111- position: fixed;
112- top: 90px;
113- right: 10px;
114- background: rgba(100,0,0,0.8);
115- color: white;
116- padding: 8px 12px;
117- border-radius: 4px;
118- font-size: 12px;
119- z-index: 9999;
120- font-family: monospace;
121- ` ;
122- document . body . appendChild ( clickIndicator ) ;
123- setTimeout ( ( ) => {
124- if ( clickIndicator . parentNode ) {
125- clickIndicator . parentNode . removeChild ( clickIndicator ) ;
126- }
127- } , 1000 ) ;
128-
12922 // Don't delay if it's the same page or a hash link
13023 if ( this . getAttribute ( 'href' ) . startsWith ( '#' ) ||
13124 this . getAttribute ( 'href' ) === window . location . pathname ) {
132- const samePageIndicator = document . createElement ( 'div' ) ;
133- samePageIndicator . innerHTML = '🚫 Same page - no delay' ;
134- samePageIndicator . style . cssText = `
135- position: fixed;
136- top: 130px;
137- right: 10px;
138- background: rgba(100,100,0,0.8);
139- color: white;
140- padding: 8px 12px;
141- border-radius: 4px;
142- font-size: 12px;
143- z-index: 9999;
144- font-family: monospace;
145- ` ;
146- document . body . appendChild ( samePageIndicator ) ;
147- setTimeout ( ( ) => {
148- if ( samePageIndicator . parentNode ) {
149- samePageIndicator . parentNode . removeChild ( samePageIndicator ) ;
150- }
151- } , 1000 ) ;
15225 return ;
15326 }
15427
15528 e . preventDefault ( ) ;
15629 const href = this . getAttribute ( 'href' ) ;
15730
158- // Show delay indicator
159- const delayIndicator = document . createElement ( 'div' ) ;
160- delayIndicator . innerHTML = `⏳ Delaying to: ${ href } ` ;
161- delayIndicator . style . cssText = `
162- position: fixed;
163- top: 130px;
164- right: 10px;
165- background: rgba(0,100,100,0.8);
166- color: white;
167- padding: 8px 12px;
168- border-radius: 4px;
169- font-size: 12px;
170- z-index: 9999;
171- font-family: monospace;
172- ` ;
173- document . body . appendChild ( delayIndicator ) ;
17431
17532 // Trigger crumple animation manually
17633 const crumple = document . querySelector ( '.crumple' ) ;
@@ -231,56 +88,13 @@ function initFooterDelay() {
23188 this . classList . remove ( 'mobile-trigger' ) ;
23289 } , 1500 ) ;
23390
234- // Show animation indicator
235- const animationIndicator = document . createElement ( 'div' ) ;
236- animationIndicator . innerHTML = `🎨 Animation: ${ animationName } ` ;
237- animationIndicator . style . cssText = `
238- position: fixed;
239- top: 170px;
240- right: 10px;
241- background: rgba(100,0,100,0.8);
242- color: white;
243- padding: 8px 12px;
244- border-radius: 4px;
245- font-size: 12px;
246- z-index: 9999;
247- font-family: monospace;
248- ` ;
249- document . body . appendChild ( animationIndicator ) ;
250- setTimeout ( ( ) => {
251- if ( animationIndicator . parentNode ) {
252- animationIndicator . parentNode . removeChild ( animationIndicator ) ;
253- }
254- } , 1000 ) ;
25591 }
25692 }
25793
258- // Add a small delay to show the crumple animation
94+ // Delay navigation to match crumple animation duration
25995 setTimeout ( ( ) => {
260- // Show navigation indicator
261- const navIndicator = document . createElement ( 'div' ) ;
262- navIndicator . innerHTML = `🚀 Navigating to: ${ href } ` ;
263- navIndicator . style . cssText = `
264- position: fixed;
265- top: 210px;
266- right: 10px;
267- background: rgba(0,100,0,0.8);
268- color: white;
269- padding: 8px 12px;
270- border-radius: 4px;
271- font-size: 12px;
272- z-index: 9999;
273- font-family: monospace;
274- ` ;
275- document . body . appendChild ( navIndicator ) ;
276- setTimeout ( ( ) => {
277- if ( navIndicator . parentNode ) {
278- navIndicator . parentNode . removeChild ( navIndicator ) ;
279- }
280- } , 500 ) ;
281-
28296 window . location . href = href ;
283- } , 800 ) ; // 800ms delay
97+ } , 1500 ) ; // 1.5 second delay to match crumple animation
28498 } ;
28599
286100 // Add both click and touch events
0 commit comments