diff --git a/package-lock.json b/package-lock.json index 98f7a85..30c173b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31,7 +31,8 @@ "react-use-measure": "^2.1.7", "slick-carousel": "^1.8.1", "swiper": "^11.1.7", - "tailwindcss": "^3.4.6" + "tailwindcss": "^3.4.6", + "typewriter-effect": "^2.22.0" }, "devDependencies": { "eslint": "^8.56.0", @@ -27468,6 +27469,20 @@ "node": ">=4.2.0" } }, + "node_modules/typewriter-effect": { + "version": "2.22.0", + "resolved": "https://registry.npmjs.org/typewriter-effect/-/typewriter-effect-2.22.0.tgz", + "integrity": "sha512-01HCRYY462wT8Fxps/epwGCioZd/GMXY0aLKhFKrfJ5Xhgf54/SiDx7Oq7PoES5kGqOEAdW8FS8HYVM2WSvfhQ==", + "license": "MIT", + "dependencies": { + "prop-types": "^15.8.1", + "raf": "^3.4.1" + }, + "peerDependencies": { + "react": ">=17.0.0", + "react-dom": ">=17.0.0" + } + }, "node_modules/unbox-primitive": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", diff --git a/package.json b/package.json index a30ae87..67a6f06 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,8 @@ "react-use-measure": "^2.1.7", "slick-carousel": "^1.8.1", "swiper": "^11.1.7", - "tailwindcss": "^3.4.6" + "tailwindcss": "^3.4.6", + "typewriter-effect": "^2.22.0" }, "devDependencies": { "eslint": "^8.56.0", diff --git a/src/components/Hero.jsx b/src/components/Hero.jsx index 9858142..e438ddd 100644 --- a/src/components/Hero.jsx +++ b/src/components/Hero.jsx @@ -1,9 +1,19 @@ +'use client' + import Image from 'next/image' +import { useState, useEffect } from 'react' +import Typewriter from 'typewriter-effect' import { Button } from '@/components/Button' import { Container } from '@/components/Container' import BgNoise from '@/components/BgNoise' export function Hero() { + const [isClient, setIsClient] = useState(false) + + useEffect(() => { + setIsClient(true) + }, []) + return ( <>
Mon cher,
-
- If you find yourself here, you’ve survived the noise.
- Sit, let the glass sweat a little.
- The band will start soon, and perhaps someone will meet your eyes before the chorus ends.
- If not, the night still owes you a dance.
+
+ Mon cher,
+ {isClient && (
+
+
+ Sit, let the glass sweat a little.
The band will start soon, and perhaps someone will meet your eyes before the chorus ends.
If not, the night still owes you a dance.' }} />
+ {isClient && (
+
+
',
+ )
+ .pauseFor(500)
+ .typeString('Sit, let the glass sweat a little.
')
+ .pauseFor(500)
+ .typeString(
+ 'The band will start soon, and perhaps someone will meet your eyes before the chorus ends.
',
+ )
+ .pauseFor(500)
+ .typeString('If not, the night still owes you a dance.')
+ .start()
+ }}
+ />
+
+ — M.N.
+ {isClient && (
+
+
— M.N.