huseyinfiliz / theme-transitions
Smooth, customizable View Transition animations for Flarum 2 theme switching.
Package info
github.com/huseyinfiliz/theme-transitions
Language:TypeScript
Type:flarum-extension
pkg:composer/huseyinfiliz/theme-transitions
Requires
- flarum/core: ^2.0
Requires (Dev)
- flarum/testing: ^2.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Smooth, customizable View Transition animations for Flarum 2 theme switching.
Theme Transitions enhances Flarum 2's built-in color scheme switcher, user settings page, and companion toggle extensions such as Simple Dark Mode with hardware-accelerated animations powered by the View Transitions API and Web Animations API.
Features
- 14 Customizable Transition Effects:
- Radial Reveals: Circle Reveal (Telegram), Circle Shrink, Circle Blur
- Geometric & Mask Wipes: Directional Wipe, Diagonal Sweep, Split Curtain, Diamond Burst, Camera Iris, Venetian Blinds
- Cinematic & Motion: Smooth Crossfade, Blur Dissolve, Focal Zoom, Parallax Slide, 3D Card Flip
- True Code-Splitting & Lazy Loading: Each effect is compiled into its own separate JS chunk (
js/dist/common/transitions/effects/*.js). Visitors only download the single active effect configured by the administrator. - Full Customization: Duration (
100–2000 ms), 6 built-in easing curves plus customcubic-bezier(...), origin point (trigger,center, corners), sweep direction, polarity-based reverse modes, slat count, and blur intensity. - Live Admin Preview: Test any combination of effect and timing settings directly in the admin dashboard without overwriting your saved user preference.
- Zero-Conflict Architecture: Intercepts
Application#setColorSchemeon genuine user interactions while keeping initial page load, boot synchronization, and OSprefers-color-schemechanges instant. - Progressive Enhancement & Accessibility: Automatically respects
prefers-reduced-motion, offers an optional mobile toggle, and falls back gracefully to instant switching on unsupported browsers.
Compatibility
Works seamlessly with:
- Flarum 2.x built-in
ThemeSwitcherand User Appearance Settings - Simple Dark Mode (
huseyinfiliz/simple-dark-mode) - Any Flarum 2 extension that switches themes via
app.setColorScheme()
Installation
composer require huseyinfiliz/theme-transitions:"*"
php flarum cache:clear
Then enable Theme Transitions in your Flarum Admin Panel and choose your preferred transition style.
Updating
composer update huseyinfiliz/theme-transitions:"*"
php flarum cache:clear
Removing
composer remove huseyinfiliz/theme-transitions php flarum cache:clear