Thanks so much for the help Zach!
So I broke the HTML file down into a JS file and it worked for about 30 seconds and when I went to make a change it gave me the error message "TypeError: Cannot read property '_gsap' of null" and is talking about harness. Any idea on how to fix this? This is how I have my JS set up:
const textTitle = document.querySelector('.hero-text-title');
const textSubtitle = document.querySelector('.hero-text-subtitle');
const textBtn = document.querySelector('.hero button');
const textBottom = document.querySelector('.hero-text-bottom');
const heartSVG = document.querySelector('.heart-svg');
const heartPath = document.querySelector('.heart-line');
let tl = gsap
.timeline({ paused: false })
.to(
textTitle,
{
duration: 0.3,
opacity: 1,
},
0
)
.from(
textTitle,
{
duration: 0.5,
yPercent: 50,
},
0
)
.to(
textSubtitle,
{
duration: 0.5,
opacity: 1,
},
0.4
)
.from(
textSubtitle,
{
duration: 1,
yPercent: 150,
},
0.4
)
.to(
heartPath,
{
duration: 1.5,
attr: { 'stroke-dashoffset': 0 },
ease: 'power1.in',
},
0.6
)
.to(
heartPath,
{
duration: 0.2,
opacity: 1,
},
0.7
)
.to(
[textBtn, textBottom],
{
duration: 0.6,
opacity: 1,
},
2
)
.to(
heartSVG,
{
duration: 0.15,
scale: 1.2,
transformOrigin: 'center center',
ease: 'power1.in',
},
2.8
)
.to(
heartSVG,
{
duration: 0.3,
scale: 1,
},
'>'
);
document.onclick = function () {
tl.play(0);
};