Webflow Page Transitions
Status: โ
Production Ready
Implemented: January 2025
First Site: reformer.la
๐ฏ Overviewโ
Page transitions create smooth, app-like navigation between pages on Webflow sites. This implementation uses Barba.js for page routing and GSAP for animations, following industry best practices inspired by Osmo Supply's upcoming course.
Why Page Transitions Matterโ
- Enhanced UX - Smooth navigation feels more intuitive and less jarring
- Brand Identity - Unique transitions reinforce brand personality
- Performance Perception - Well-designed transitions mask loading times
- Competitive Advantage - Industry standard for award-winning sites
๐ Quick Startโ
Step 1: Add Dependencies to Head Codeโ
In Webflow Designer โ Settings โ Custom Code โ Head Code:
<script defer src="https://cdn.jsdelivr.net/npm/@barba/core@2.9.7/dist/barba.umd.js"></script>
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/gsap.min.js"></script>
Important: Use defer attribute for performance (prevents blocking page load).
Step 2: Add Transition Code to Footerโ
Copy the complete code from reformer-platform/webflow-embeds/reformer-la-transitions-complete.html and paste into Webflow โ Settings โ Custom Code โ Footer Code.
Step 3: Publish & Testโ
- Publish your site
- Navigate between pages
- You should see smooth fade transitions!
๐ Implementation Detailsโ
Architectureโ
- Barba.js - Handles page routing and content swapping
- GSAP - Handles smooth animations
- Automatic Setup - Creates wrapper/container elements automatically
- Performance Optimized - GPU accelerated, mobile optimized
Transition Typesโ
Fade (Default)
- Simple opacity fade
- Fast, universal, safe
- Best for: General use
Slide
- Content slides in from direction
- More dynamic, directional
- Best for: Navigation menus, directional flows
Scale
- Content scales in/out
- Modern, app-like feel
- Best for: Product pages, galleries
Configurationโ
window.initPageTransitions({
transitionType: 'fade', // 'fade' | 'slide' | 'scale'
duration: 0.4, // seconds
restoreScrollPosition: true, // Restore scroll on back button
scrollToTop: false, // Always scroll to top on new page
usePrefersReducedMotion: true, // Respect accessibility
mobileOptimized: true, // Faster on mobile
debug: false // Enable console logs
});
๐งช Testingโ
Automated Testingโ
Run the verification script:
node reformer-platform/scripts/verify-transitions-reformer-la.js
Manual Testingโ
- Navigate between pages - should see smooth fade
- Test back button - scroll position should restore
- Test on mobile - transitions should be faster
- Check console - no errors
Browser Console Testโ
Paste this in browser console on your site:
console.log('Barba:', typeof barba !== 'undefined' ? 'โ
' : 'โ');
console.log('GSAP:', typeof gsap !== 'undefined' ? 'โ
' : 'โ');
console.log('initPageTransitions:', typeof window.initPageTransitions === 'function' ? 'โ
' : 'โ');
All three should show โ .
๐ง Troubleshootingโ
"Barba.js not loaded"โ
โ Check Head Code has Barba.js script with defer
"GSAP not loaded"โ
โ Check Head Code has GSAP script with defer
"No Barba wrapper found"โ
โ Code automatically creates wrapper - check console for errors
Transitions not working visuallyโ
โ Check browser console for errors โ Verify scripts loaded (Network tab)
๐ Performanceโ
Optimizationsโ
- โ
Scripts load with
defer(non-blocking) - โ GPU accelerated animations (transform/opacity only)
- โ Mobile optimized (shorter durations)
- โ
Respects
prefers-reduced-motion
Benchmarksโ
- Page Load: < 2s (first load)
- Transition: ~400ms (desktop), ~280ms (mobile)
- FPS: 60fps during transitions
- Script Load: < 100ms (with defer)
๐ Files & Documentationโ
Code Filesโ
reformer-platform/webflow-embeds/reformer-la-transitions-complete.html- Production codereformer-platform/lib/transitions/page-transitions.js- Core libraryreformer-platform/webflow-embeds/page-transitions.html- Generic embed
Documentationโ
reformer-platform/docs/PAGE-TRANSITIONS-IMPLEMENTATION.md- Complete guidereformer-platform/docs/WEBFLOW-PAGE-TRANSITIONS-SETUP.md- Setup instructions
Scriptsโ
reformer-platform/scripts/verify-transitions-reformer-la.js- Verificationreformer-platform/scripts/test-transitions-reformer-la.js- Comprehensive testreformer-platform/scripts/browser-console-test.js- Browser test
๐จ Customizationโ
Change Transition Typeโ
window.updateTransitionConfig({
transitionType: 'slide',
slideDirection: 'right'
});
Adjust Durationโ
window.updateTransitionConfig({
duration: 0.5 // Slower fade
});
Enable Debug Modeโ
window.updateTransitionConfig({
debug: true // See console logs
});
โ Success Criteriaโ
Transitions are working correctly if:
- โ Smooth fade between pages
- โ No page reload/flash
- โ Scroll position restores on back button
- โ Works on mobile
- โ Respects reduced motion
- โ 60fps performance
- โ No console errors
๐ Multi-Site Rolloutโ
Current Statusโ
- โ reformer.la - Implemented and tested
- ๐ Other sites - Ready for rollout
Rollout Processโ
- Add dependencies to Head Code
- Add transition code to Footer Code
- Publish site
- Test transitions
- Monitor performance
Per-Client Configurationโ
Use webflow-configs/_template-transitions.js to configure transitions per client:
transitions: {
enabled: true,
type: 'fade',
duration: 0.4,
restoreScrollPosition: true
}
๐ Related Documentationโ
- Figma Integration - Design-to-code automation
- MCP Servers - AI assistant integrations
๐ External Resourcesโ
- Osmo Supply - Inspiration & upcoming course
- Barba.js Docs - Official documentation
- GSAP Docs - Animation library
Last Updated: January 2025
Status: โ
Production Ready
Next: Rollout to additional Reformer client sites