Skip to content

Commit

Permalink
button animation updates
Browse files Browse the repository at this point in the history
  • Loading branch information
dsmooot committed Sep 27, 2024
1 parent fa8a8af commit d630384
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 11 deletions.
43 changes: 33 additions & 10 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,39 @@ const Home = () => {
useGSAP(() => {
if (!containerRef.current) return
tlRef.current = gsap.timeline()
tlRef.current.to(containerRef.current, {
opacity: 1,
duration: 1,
ease: 'power1.inOut',
onStart: () => {
triggerEvent({
type: 'home-transition-in',
})
},
})
tlRef.current
.to(containerRef.current, {
opacity: 1,
duration: 1,
ease: 'power1.inOut',
onStart: () => {
triggerEvent({
type: 'home-transition-in',
})
},
})
.set('#buttons', { opacity: 1 })
.to(
'.cta',
{
width: isMobile ? '200px' : '250px',
// borderRadius: '100px',
opacity: 1,
duration: 0.5,
ease: 'power3.inOut',
stagger: 0.1,
},
1.1,
)
.to(
'.cta',
{
color: 'white',
duration: 0.5,
ease: 'power1.inOut',
},
1.2,
)

if (!loaded) return

Expand Down
2 changes: 1 addition & 1 deletion src/components/dom/common/LoadingScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ const LoadingScreen = () => {
triggerEvent({ type: 'loaded' })
},
onComplete: () => {
containerRef.current.style.display = 'none'
setVisible(false)
if (containerRef.current) containerRef.current.style.display = 'none'
},
})
return
Expand Down

0 comments on commit d630384

Please sign in to comment.