✦ Shader Slider Studio
React implementation of Shader Slider Studio, a WebGL image slider with live controls and eight shader transitions
Build a sequence of images, tune its transitions while they play, and save the result as a preset or a portable JSON file.
✨ Highlights
- Eight WebGL transitions with adjustable timing, easing, intensity, and shader parameters. Select a transition for the entire slider or override it for individual slides.
- A live preview alongside controls for typography, colors, indicators, autoplay, and interaction.
- Cinematic effects including Ken Burns zoom, depth parallax, ambient motion, chromatic aberration, film grain, and vignette.
- Slide editing with image uploads or URLs, editable captions and links, and drag-and-drop reordering.
- Four built-in presets, custom presets, and browser autosave. JSON export embeds uploaded images and preserves remote image URLs.
- Fullscreen preview, a responsive settings panel, reduced-motion support, and a CSS fallback when WebGL2 is unavailable.
🧭 Scope
The studio runs at /. The slider and settings share the same screen, with all editing and storage handled in the browser.
| Control |
Action |
H |
Show or hide the settings panel |
F |
Toggle fullscreen |
Esc |
Exit browser fullscreen |
← / → |
Previous or next slide when keyboard navigation is enabled |
| Drag or swipe |
Control transition progress when dragging is enabled |
| Mouse wheel or trackpad |
Navigate when wheel control is enabled |
🛠️ Tech Stack
| Layer |
Technology |
| Interface |
React 19, TypeScript 5.9, Lucide React |
| Styling |
Tailwind CSS 4 and custom CSS animations |
| Rendering |
Native WebGL2 and GLSL |
| Storage |
localStorage for settings and presets, IndexedDB for uploaded images |
| Build |
Vite 8 and npm |
| Hosting |
Cloudflare Pages for static assets, Wrangler for local Pages preview and manual uploads |
🧱 Architecture
React renders the slider chrome, captions, and live settings panel. SliderEngine manages navigation and animation timing. The WebGL renderer loads textures and draws each frame using the selected GLSL shader. The settings provider applies edits and saves the configuration in the browser.
The slider engine, WebGL renderer and shaders, and configuration types are independent of React. Other framework implementations can reuse them and keep the same JSON format.
Storage is tied to the current origin. Export a JSON file to move settings and uploaded images from localhost or a preview URL to production. The original demo photos load from Unsplash and fonts load from Google Fonts. Remote images must support cross-origin requests to work as WebGL textures.
JSON import limits each embedded image to 20 million characters in its data URL, roughly 15 MB before encoding. Larger images may be truncated even when the import reports success.
🗂️ Project Structure
react-webgl-slider-studio/
├── public/ # Favicon and crawler rules
├── src/
│ ├── admin/ # Inline settings panel and slide editor
│ ├── config/ # Defaults, presets, validation, and storage
│ ├── lib/ # Color helpers
│ ├── slider/ # Slider UI and animation engine
│ ├── webgl/ # Renderer, shaders, effects, and easing
│ ├── App.tsx
│ ├── index.css
│ └── main.tsx
├── .node-version # Node.js version for Pages builds
├── index.html
├── LICENSE
├── package.json
├── package-lock.json
├── README.md
├── tsconfig.json
├── vite.config.ts
└── wrangler.jsonc # Cloudflare Pages project and output directory
🚀 Local Development
Use Node.js 24.14.0, the version pinned in .node-version.
npm ci
npm run dev
Run npm run build to check TypeScript and generate dist/. Use npm run preview for a Vite preview, or npm run pages:preview to build and serve the same output locally through Wrangler.
🌐 Deployment
Cloudflare Pages
The button opens Workers & Pages in the Cloudflare dashboard. Choose Create application, then Continue to Pages below the app creation options and Connect to Git. Cloudflare's automatic deploy button supports Workers only.
- Push this project to GitHub or GitLab and select the repository in the Pages setup wizard. When installing the Cloudflare GitHub app, use Only select repositories and choose this repository.
- Use the settings below, then choose Save and Deploy.
- Open the production URL shown by Cloudflare. Subsequent pushes to the production branch trigger new builds, and other branches can create preview deployments.
| Cloudflare Pages setting |
Value |
| Project name |
react-webgl-slider-studio |
| Production branch |
main, or the repository's production branch |
| Framework preset |
React (Vite) |
| Build command |
npm run build |
| Build output directory |
dist |
| Root directory |
Leave blank in a standalone repo. Set react-webgl-slider-studio if it is a subdirectory of a larger repo. |
Pages reads the Node.js version from .node-version. The app runs entirely in the browser and requires no application environment variables, secrets, or Pages Functions. If you choose a different Pages project name, update name in wrangler.jsonc to match.
See the Cloudflare Pages Git integration guide and build configuration.
Direct Upload
For manual deployment, run npm run build, choose Continue to Pages in the dashboard, and upload dist/ through the Pages upload flow. Alternatively, create the Pages project once and upload through Wrangler.
npm ci
npx wrangler login
npx wrangler pages project create react-webgl-slider-studio --production-branch main
npm run deploy:pages -- --branch main
Choose Git integration at project creation if you want automatic deployments from repository pushes. Cloudflare requires a new Pages project to switch an existing Direct Upload project to Git integration. See the Direct Upload guide.
📄 License
MIT License. See LICENSE.