-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathFinalCTA.jsx
More file actions
58 lines (52 loc) · 1.65 KB
/
Copy pathFinalCTA.jsx
File metadata and controls
58 lines (52 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import { useRef } from 'react';
import { gsap } from 'gsap';
import { ScrollTrigger } from 'gsap/ScrollTrigger';
import { useGSAP } from '@gsap/react';
import { useRetroSound } from '../hooks/useRetroSound';
import './FinalCTA.css';
gsap.registerPlugin(ScrollTrigger);
export default function FinalCTA() {
const sectionRef = useRef(null);
const { playHover, playClick } = useRetroSound();
useGSAP(() => {
const headline = sectionRef.current.querySelector('.final-cta__headline');
const text = sectionRef.current.querySelector('.final-cta__text');
const actions = sectionRef.current.querySelector('.final-cta__actions');
gsap.from([headline, text, actions], {
opacity: 0,
y: 30,
duration: 0.8,
stagger: 0.12,
ease: 'power3.out',
scrollTrigger: {
trigger: sectionRef.current,
start: 'top 80%',
once: true,
},
});
}, { scope: sectionRef });
return (
<section id="register" className="section final-cta" ref={sectionRef}>
<div className="container">
<h2 className="final-cta__headline">
Ready To Enter The Arena?
</h2>
<p className="final-cta__text">
Registrations are now open. Form your team, sharpen your skills, and
compete against some of the brightest minds in cybersecurity.
</p>
<div className="final-cta__actions">
<a
href="/register"
className="btn btn--primary"
id="cta-register-now"
onMouseEnter={playHover}
onClick={playClick}
>
Register Now
</a>
</div>
</div>
</section>
);
}