A production-ready boilerplate for creating logo animations with GSAP (GreenSock Animation Platform) and seamless video export capabilities.
This repository is designed to be reused for multiple logo animation projects. See TEMPLATE.md for complete instructions on:
- Creating new projects from this template
- Maintaining connection to template for updates
- Pulling template improvements into existing projects
- Managing project-specific vs template-managed files
Quick Start:
- Click "Use this template" button on GitHub
- Name your new project (e.g.,
your-logo-animation) - Clone and add template as upstream remote
- Customize logo and animation
For detailed workflow, see TEMPLATE.md.
- GSAP (100% Free) - Includes all plugins: DrawSVG, MorphSVG, CustomBounce, SplitText, and more
- Vite - Fast development with hot module replacement
- TailwindCSS v3 - Utility-first CSS framework
- Easy Export - One-command export to video and GIF
- Clean Structure - Simple, modular, and well-documented
- Template Workflow - Reusable for multiple projects with update propagation
- Node.js (v14 or higher)
- npm or yarn
- gsap-video-export - Install globally for exporting animations:
npm install -g gsap-video-export
- FFmpeg - Required for video/GIF generation:
# macOS brew install ffmpeg # Ubuntu/Debian sudo apt install ffmpeg # Windows (Chocolatey) choco install ffmpeg
npm install
# or
yarnnpm run dev
# or
yarn devThe dev server runs on http://localhost:5000
Edit src/main.js to create your animation:
- Replace
public/logo.svgwith your logo - Adjust timeline animations and timing
- Modify colors, easing, and effects
Important: Keep the dev server running in one terminal, then run export commands in another terminal.
See EXPORT.md for detailed export instructions.
Quick export:
npm run export:video # Standard resolution
npm run export:video:hd # 1080p HD
npm run export:video:4k # 4K resolution
npm run export:gif # Convert to GIFNote: Export scripts use http://localhost:5000. If Vite uses a different port, manually run:
gsap-video-export http://localhost:PORT --output ./exports/animation.mp4 --fps 60.
├── public/
│ └── logo.svg # Your logo SVG file
├── src/
│ ├── main.js # Main animation logic
│ └── index.scss # Styling
├── exports/ # Generated export files (gitignored)
├── index.html # HTML entry point
├── TEMPLATE.md # Template usage and workflow guide
├── EXPORT.md # Detailed export guide
├── CLAUDE.md # AI assistant context
└── example-export.* # Example outputs
| Command | Description |
|---|---|
npm run dev |
Start development server on port 5000 |
npm run build |
Build for production |
npm run serve |
Preview production build |
npm run export:video |
Export animation as MP4 (60fps) |
npm run export:video:hd |
Export as 1080p HD video |
npm run export:video:4k |
Export as 4K video |
npm run export:gif |
Convert exported video to optimized GIF |
- Replace
public/logo.svgwith your logo - Ensure your SVG has proper mask IDs for animation
- Update mask selectors in
src/main.jsif needed
In src/main.js, modify the timeline:
mainTimeline
.from(element1, {
drawSVG: 0,
duration: 2, // ← Change duration
})
.from(element2, {
drawSVG: 1,
duration: 1,
}, "-=1.25") // ← Adjust overlapUpdate fill colors in your SVG file or dynamically in src/main.js:
gsap.to(element, {
fill: "#your-color",
duration: 1
})GSAP includes premium easing functions:
CustomBounce.create("myBounce", {
strength: 0.7,
squash: 3
});
gsap.to(element, {
y: 100,
ease: "myBounce"
});As of 2025, GSAP and all its plugins are completely free for all uses, including commercial projects. This template includes:
- DrawSVGPlugin - Animate SVG strokes (draw on/off effect)
- MorphSVGPlugin - Morph between SVG shapes
- CustomBounce/CustomEase/CustomWiggle - Custom easing functions
- SplitText - Advanced text animation
- ScrollTrigger/ScrollSmoother - Scroll-based animations
- GSDevTools - Timeline debugging tool
All plugins are installed via the standard npm package gsap - no special setup required!
This template is optimized for exporting animations using gsap-video-export.
The main timeline is exposed globally for export:
window.gsap = gsap;
window.tl = mainTimeline;For detailed export instructions, see EXPORT.md.
- Use
GSDevToolsfor debugging timelines (uncomment insrc/main.js) - Comment out
repeat: -1when exporting to prevent infinite loops - Export at higher resolutions (HD/4K) for better quality
- Test animation in browser before exporting
- Keep animation duration reasonable (3-10 seconds is ideal)
Check example-export.mp4 and example-export.gif to see the expected output quality.
npm run buildOutput will be in the dist/ directory.
- Check browser console for errors
- Ensure GSAP plugins are registered
- Verify SVG elements exist before animating
- Make sure dev server is running (
npm run dev) - Install
gsap-video-exportglobally - Check EXPORT.md troubleshooting section
- Verify
public/logo.svgexists - Check fetch URL in
loadSVGs()function - Ensure SVG is valid XML
GPL-3.0
Happy animating! For questions or issues, check the documentation links above.