33/* eslint-disable @next/next/no-img-element */
44import Link from "next/link" ;
55import { motion } from "framer-motion" ;
6- import { useState , useEffect } from " react" ;
6+ import { TypeAnimation } from ' react-type-animation' ;
77
88/* eslint-disable react/jsx-no-undef */
99interface HeroSectionProps {
@@ -12,15 +12,8 @@ interface HeroSectionProps {
1212
1313export default function HeroSection ( props : HeroSectionProps ) {
1414 const { isMobile } = props ;
15- const [ words ] = useState ( [ "a hash." , "an ip." , "a malware." , "a domain." ] ) ;
16- const [ currentWordIndex , setCurrentWordIndex ] = useState ( 0 ) ;
15+ const words = [ "a hash." , 2000 , "an ip." , 2000 , "a malware." , 2000 , "a domain." , 2000 ] ;
1716
18- useEffect ( ( ) => {
19- const intervalId = setInterval ( ( ) => {
20- setCurrentWordIndex ( ( currentIndex ) => ( currentIndex + 1 ) % words . length ) ;
21- } , 3000 ) ;
22- return ( ) => clearInterval ( intervalId ) ;
23- } , [ words ] ) ;
2417 return (
2518 < >
2619 { isMobile ? (
@@ -31,7 +24,16 @@ export default function HeroSection(props: HeroSectionProps) {
3124 < div className = "bg-inherit w-full flex flex-col items-center justify-center px-5" >
3225 < h1 className = "text-white text-center text-3xl leading-snug lg:leading-snug xl:leading-snug font-SpaceGrotesk font-semibold " >
3326 Get Threat Intelligence data about { " " }
34- < span className = "text-[#00ADEF]" > { words [ currentWordIndex ] } </ span >
27+ < span className = "text-[#00ADEF]" >
28+ < TypeAnimation
29+ sequence = { words }
30+ preRenderFirstString = { false }
31+ wrapper = "span"
32+ speed = { 20 }
33+ style = { { fontSize : '1em' , display : 'inline-block' } }
34+ repeat = { Infinity }
35+ />
36+ </ span >
3537 </ h1 >
3638 < h2 className = " text-white text-center text-lg mt-8 font-SpaceGrotesk font-extralight px-4" >
3739 From multiple sources with just a{ " " }
@@ -69,7 +71,16 @@ export default function HeroSection(props: HeroSectionProps) {
6971 < div className = "bg-inherit w-4/6 flex flex-col items-left justify-center px-16" >
7072 < h1 className = "text-white text-left text-5xl lg:text-6xl xl:text-7xl leading-snug lg:leading-snug xl:leading-snug font-SpaceGrotesk font-semibold " >
7173 Get Threat Intelligence data about { " " }
72- < span className = "text-[#00ADEF]" > { words [ currentWordIndex ] } </ span >
74+ < span className = "text-[#00ADEF]" >
75+ < TypeAnimation
76+ sequence = { words }
77+ preRenderFirstString = { false }
78+ wrapper = "span"
79+ speed = { 20 }
80+ style = { { fontSize : '1em' , display : 'inline-block' } }
81+ repeat = { Infinity }
82+ />
83+ </ span >
7384 </ h1 >
7485 < h2 className = " text-white text-left text-3xl lg:text-3xl xl:text-4xl mt-8 font-SpaceGrotesk font-extralight" >
7586 From multiple sources with just a{ " " }
0 commit comments