File tree Expand file tree Collapse file tree 7 files changed +3
-16
lines changed Expand file tree Collapse file tree 7 files changed +3
-16
lines changed Original file line number Diff line number Diff line change 1
- import { useState , useEffect } from 'react' ;
1
+ import { useState } from 'react' ;
2
2
import Image from 'next/image' ;
3
3
import Nav from './Nav' ;
4
4
import Container from './Container' ;
@@ -18,16 +18,7 @@ export default function Hero({
18
18
setTitleIndex ( titleIndex >= dynamicTitles . length - 1 ? 0 : titleIndex + 1 ) ;
19
19
} ;
20
20
21
- useEffect ( ( ) => {
22
- const dynamicTitleEl = document . getElementById ( 'dynamicTitle' ) ;
23
- if ( dynamicTitleEl . style . opacity === '1' ) {
24
- dynamicTitleEl . style . opacity = '0' ;
25
- } else {
26
- dynamicTitleEl . style . opacity = '1' ;
27
- }
28
- } , [ titleIndex ] ) ;
29
-
30
- setTimeout ( handleTitleIndex , 1350 ) ;
21
+ setTimeout ( handleTitleIndex , 1550 ) ;
31
22
32
23
return (
33
24
< div
@@ -47,9 +38,7 @@ export default function Hero({
47
38
< div className = { styles . header__content__upper } >
48
39
< h1 className = { titleClass ? `${ styles [ titleClass ] } ` : '' } >
49
40
{ title }
50
- { dynamicTitles && (
51
- < span id = "dynamicTitle" > { dynamicTitles [ titleIndex ] } </ span >
52
- ) }
41
+ { dynamicTitles && < span > { dynamicTitles [ titleIndex ] } </ span > }
53
42
</ h1 >
54
43
</ div >
55
44
< div className = { styles . header__content__bottom } >
Original file line number Diff line number Diff line change 27
27
font-style : italic ;
28
28
font-weight : bold ;
29
29
line-height : 3.5rem ;
30
- opacity : 0 ;
31
- @include transition (opacity 1.55s ease-in-out );
32
30
@include desktop {
33
31
font-size : 4.5rem ;
34
32
line-height : 5rem ;
You can’t perform that action at this time.
0 commit comments