A sophisticated web application that generates beautiful mathematical art wallpapers using Clifford and de Jong attractors. Create stunning, mathematically-generated patterns perfect for wallpapers and digital art.
π Web App: https://cdw.jujiplay.com/
Deployed on Cloudflare
- Clifford Attractor: Generates chaotic attractors using the Clifford equations
- de Jong Attractor: Creates beautiful patterns using Peter de Jong's attractor formulas
- Real-time Parameter Control: Adjust mathematical coefficients (a, b, c, d) in real-time
- Color Customization: Full HSV color control (hue, saturation, brightness)
- Positioning & Scaling: Fine-tune scale, top, and left positioning
- Interactive Parameter Panel: Powered by lil-gui for intuitive control
- Download Functionality: High-quality wallpaper export with animated download button
- Full-Screen Mode: Optimized viewing experience
- Reset Controls: Quick parameter reset to defaults
- Responsive Design: Works seamlessly on desktop and mobile
- Service Worker: Offline functionality and caching
- Web Manifest: Full PWA capabilities
- Frontend: TypeScript + Vite
- UI Library: lil-gui for parameter controls
- Styling: CSS with custom animations and elastic effects
- State Management: Custom store with reactive subscription pattern
- Rendering: HTML5 Canvas with WebGL detection
- Build Tool: Vite with TypeScript configuration
- Package Manager: pnpm
- Modular Design: Organized into renderer, state, and UI modules
- Reactive State:
optionStorewith subscription-based updates - Color Management: HSV to RGB conversion utilities
- Cross-platform: Works in browsers and as PWA
- Node.js (16+ recommended)
- pnpm package manager
# Install dependencies
pnpm install
# Start development server
pnpm dev
# Build for production
pnpm build
# Preview production build
pnpm previewsrc/
βββ renderer/ # Core rendering engine
β βββ attractors.ts # Mathematical attractor implementations
β βββ context2d.ts # Canvas 2D rendering
β βββ detect-webgl.ts # WebGL capability detection
βββ state/ # State management
β βββ index.ts # optionStore and configuration
βββ ui/ # User interface components
β βββ lil-gui.ts # Parameter control panel
β βββ full-screen.ts # Full-screen functionality
β βββ download-button.ts # Download functionality
β βββ body.ts # Dynamic styling
βββ main.ts # Application entry point
The application uses a sophisticated state management system:
type Options = {
attractor: string; // 'clifford' or 'dejong'
a;
b;
c;
d: number; // Mathematical coefficients
hue;
saturation;
brightness: number; // Color controls
scale;
top;
left: number; // Positioning
background: [r, g, b]; // Background color
};Clifford attractors are generated using the equations:
x(n+1) = sin(a*y(n)) + c*cos(a*x(n))
y(n+1) = sin(b*x(n)) + d*cos(b*y(n))
de Jong attractors use:
x(n+1) = sin(a*y(n)) - cos(b*x(n))
y(n+1) = sin(c*x(n)) - cos(d*y(n))
These mathematical systems create beautiful, chaotic patterns that are perfect for wallpapers and digital art.
- Mathematical Coefficients: Adjust a, b, c, d parameters with immediate visual feedback
- Color System: HSV color space for intuitive color manipulation
- Positioning Controls: Fine-tune scale and positioning for perfect composition
- Background Customization: Dynamic background color adjustment
- Elastic Animations: Sophisticated CSS keyframe animations for smooth interactions
- Responsive Design: Optimized for both desktop and mobile experiences
- Full-screen Support: Native browser fullscreen with PWA compatibility
- WebGL Detection: Automatic fallback to Canvas 2D when needed
- Efficient Rendering: Optimized drawing loops for smooth real-time updates
- Memory Management: Careful resource management for long-running sessions
- Modern Browsers: Chrome, Firefox, Safari, Edge (latest versions)
- Mobile Browsers: iOS Safari, Chrome Mobile, Samsung Internet
- PWA Support: Full Progressive Web App capabilities
This project is licensed under the MIT License - see the LICENSE file for details.
Copyright (c) 2025 Tri Rahmat Gunadi
The MIT License allows you to:
- β Use the software for any purpose
- β Modify and create derivative works
- β Distribute original and modified versions
- β Private use and commercial use
- β Include in proprietary software
Requirements: Include the original copyright notice and license in any copies or substantial portions of the software.
- Mathematical concepts based on the work of Clifford Pickover and Peter de Jong
- UI components powered by lil-gui
- Built with Vite for optimal development experience
- See
doc/migration-plan.mdfor the migration plan. - See
doc/dev-log.mdfor the migration & development log.
We are planning to migrate this project to a monorepo structure using React, React Native, and Tamagui for cross-platform UI. See doc/migration-plan.md for details and progress.
The current working example is now preserved in the current/ directory.