@@ -40,42 +40,6 @@ function typePlaceholder() {
4040}
4141typePlaceholder ( ) ;
4242
43- // Heading text typewriter animation
44- const headingText = document . querySelector ( '.heading-text' ) ;
45- const headingPhrases = [
46- 'Weather Forecast' ,
47- 'Live Weather Updates' ,
48- 'Your City Weather' ,
49- 'Forecast & Temperature' ,
50- 'Check Weather Instantly'
51- ] ;
52- let headingWordIndex = 0 ;
53- let headingCharIndex = 0 ;
54- let headingTypingForward = true ;
55-
56- function typeHeading ( ) {
57- const currentPhrase = headingPhrases [ headingWordIndex ] ;
58- if ( headingTypingForward ) {
59- headingCharIndex ++ ;
60- if ( headingCharIndex > currentPhrase . length ) {
61- headingTypingForward = false ;
62- setTimeout ( typeHeading , 1200 ) ;
63- return ;
64- }
65- } else {
66- headingCharIndex -- ;
67- if ( headingCharIndex < 0 ) {
68- headingTypingForward = true ;
69- headingWordIndex = ( headingWordIndex + 1 ) % headingPhrases . length ;
70- setTimeout ( typeHeading , 600 ) ;
71- return ;
72- }
73- }
74- headingText . textContent = currentPhrase . slice ( 0 , headingCharIndex ) ;
75- setTimeout ( typeHeading , 90 ) ;
76- }
77- typeHeading ( ) ;
78-
7943weatherForm . addEventListener ( 'submit' , async ( e ) => {
8044 e . preventDefault ( ) ;
8145 const city = cityInput . value . trim ( ) ;
0 commit comments