Skip to main content

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).

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โ€‹

  1. Publish your site
  2. Navigate between pages
  3. 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โ€‹

  1. Navigate between pages - should see smooth fade
  2. Test back button - scroll position should restore
  3. Test on mobile - transitions should be faster
  4. 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 code
  • reformer-platform/lib/transitions/page-transitions.js - Core library
  • reformer-platform/webflow-embeds/page-transitions.html - Generic embed

Documentationโ€‹

  • reformer-platform/docs/PAGE-TRANSITIONS-IMPLEMENTATION.md - Complete guide
  • reformer-platform/docs/WEBFLOW-PAGE-TRANSITIONS-SETUP.md - Setup instructions

Scriptsโ€‹

  • reformer-platform/scripts/verify-transitions-reformer-la.js - Verification
  • reformer-platform/scripts/test-transitions-reformer-la.js - Comprehensive test
  • reformer-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โ€‹

  1. Add dependencies to Head Code
  2. Add transition code to Footer Code
  3. Publish site
  4. Test transitions
  5. 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
}


๐Ÿ”— External Resourcesโ€‹


Last Updated: January 2025
Status: โœ… Production Ready
Next: Rollout to additional Reformer client sites