A stunning text animation demo inspired by award-winning websites, featuring a smooth scroll-based opacity transition effect. This project demonstrates how to create an engaging text reveal animation that responds to user scroll, similar to effects seen on websites like matvoyce.tv and thirtysixstudio.com.
- Smooth text reveal animation on scroll
- Character-by-character opacity transition
- Responsive design
- Custom font integration
- Performant scroll-based animations using Framer Motion
- Modern React implementation with Next.js
As you scroll down the page, each character of the text gradually fades in, creating an elegant and engaging visual effect. The animation is precisely controlled by the scroll position, allowing users to control the reveal speed through their scroll behavior.
- Next.js 14.0.3 - React framework for production
- React 18 - JavaScript library for building user interfaces
- Framer Motion - Animation library for React
- SASS - CSS preprocessor for styling
- Custom Font - ClashDisplay Bold for typography
src/
├── app/
│ ├── globals.css # Global styles and font declarations
│ ├── layout.js # Root layout component
│ └── page.js # Main page component with demo text
├── components/
│ ├── Character.jsx # Core animation component
│ └── style.module.scss # Component-specific styles
The text animation is implemented through three main components working together:
-
Paragraph Component
- Splits the text into words
- Manages scroll progress tracking
- Calculates animation ranges for each word
-
Word Component
- Splits words into individual characters
- Calculates precise animation timing for each character
-
Char Component
- Handles the actual opacity animation
- Uses Framer Motion's useTransform for smooth transitions
const { scrollYProgress } = useScroll({
target: container,
offset: ["start 0.9", "start 0.25"]
})const opacity = useTransform(progress, range, [0,1])
return (
<span>
<span className={styles.shadow}>{children}</span>
<motion.span style={{opacity: opacity}}>{children}</motion.span>
</span>
)-
Clone the repository
git clone https://github.com/prashantkoirala465/Text-Scroll-Awwawards cd text-scroll-awwawards -
Install dependencies
npm install
-
Run the development server
npm run dev
-
Open in browser Navigate to http://localhost:3000
Edit the paragraph constant in src/app/page.js:
const paragraph = "Your custom text here"-
Scroll Trigger Points In
Character.jsx, modify the offset values:offset: ["start 0.9", "start 0.25"]
-
Text Styling Update the SCSS variables in
style.module.scss:.paragraph { font-size: 60px; // Adjust text size line-height: 1; // Modify line height padding: 40px; // Change padding }
Replace the font file in public/ directory and update the font-face declaration in globals.css:
@font-face {
font-family: 'Main';
src: url('../../public/YourFont.otf');
}- Uses Framer Motion's optimized animation system
- Implements efficient scroll-based tracking
- Minimizes re-renders through proper component structure
- Utilizes CSS modules for scoped styling
- Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by award-winning websites on Awwwards
- Built with modern web technologies
- Special thanks to the Framer Motion team for their excellent animation library
Prashant Koirala Contact: prashantkoirala465@gmail.com
If you have any questions or run into issues, please open an issue in the repository.