Skip to content

Commit c3dcd46

Browse files
committed
Fix: welcome to text animation
1 parent 4d8eea5 commit c3dcd46

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/components/hero/Welcome.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const Welcome: React.FC = () => {
2121
<div className="flex flex-col items-center justify-center py-8 ">
2222
{/* Scrapbook Letter Section */}
2323
<div className="max-w-4xl w-full px-4 pr-8 overflow-hidden">
24-
<ScrapbookText text="WELCOME TO" letterSize={112} mobileLetterSize={48} />
24+
<ScrapbookText text="WELCOME TO" letterSize={112} mobileLetterSize={48} playAnimationOnMount={true} />
2525
</div>
2626

2727
{/* Laurier Computing Society Text */}

src/components/universal/ScrapbookText.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ interface ScrapbookTextProps {
1616
mobileLetterSize?: number; // Size in pixels for mobile, default is letterSize * 0.5
1717
className?: string;
1818
letterClassName?: string;
19+
playAnimationOnMount?: boolean; // If true, animate even if element is already visible on page load
1920
}
2021

2122
// Supported letters - only these have assets
@@ -153,6 +154,7 @@ export const ScrapbookText: React.FC<ScrapbookTextProps> = ({
153154
mobileLetterSize,
154155
className = '',
155156
letterClassName = '',
157+
playAnimationOnMount = false,
156158
}) => {
157159
// Track window width for responsive sizing
158160
// Uses two breakpoints: sm (640px) and md (768px)
@@ -236,8 +238,8 @@ export const ScrapbookText: React.FC<ScrapbookTextProps> = ({
236238
scale={transform.scale}
237239
size={responsiveLetterSize}
238240
letterClassName={letterClassName}
239-
isVisible={isVisible}
240-
skipAnimation={skipAnimation}
241+
isVisible={playAnimationOnMount ? true : isVisible}
242+
skipAnimation={playAnimationOnMount ? false : skipAnimation}
241243
/>
242244
);
243245
})}

0 commit comments

Comments
 (0)