I will start by exploring the existing files in the project to understand its structure and see what we are starting with. Let's list the files.
I will inspect the contents of index.html and src/App.tsx to understand the existing setup. Let's read these files.
I will now read the contents of src/App.tsx to understand the current entry point.
I will read package.json to inspect the available dependencies and see if we need to install any helper libraries (such as lucide-react for icons). Let's read package.json.
I will install the lucide-react package to use beautiful, responsive SVG icons in our user interface.
I will now create the src/components/Presets.ts file. This file will define several gorgeous natural themes and lighting presets (such as Sunrise Mist, Golden Sunset, Cyber Oasis, and Zen Solitude) that users can instantly apply. Each preset will configure the light colors, angles, plant type, wind, and wall color. Let's create this file.
I will now create the src/components/ShadowCanvas.tsx component. This component renders the WebGL canvas, compiles the procedural plant and light shader, handles wind sways, sines, double chromatic shadows, and responsive window resizing without stretching. Let's create this component.
I will correct the shader compiler type constants in ShadowCanvas.tsx from VERTEX_SHADER_TYPE to VERTEX_SHADER and from FRAGMENT_SHADER_TYPE to FRAGMENT_SHADER to match WebGL specification standards. Let's apply this fix.
I will now create src/components/AudioGenerator.ts using the Web Audio API. This will build a completely local, procedural sound synthesizer that generates organic forest bird chirps, gentle wind rustling, soothing rainfall, and bubbling mountain streams. Because it is computed procedurally, it requires no external assets and works flawlessly offline. Let's create this file.
I will now create src/components/Articles.ts containing beautiful, high-quality, nature-themed articles, essays, and zen poems in Chinese and English. This will power the Reading Sub-page, enabling users to immerse themselves in peaceful, reflective nature readings while the soothing shadow play moves in the background. Let's create this file.
I will read the contents of src/index.css to understand how the styles are set up in this Vite + Tailwind project. Let's read it.
I will now create the src/components/BreathingBubble.tsx component. This component acts as a visual guide for mindfulness deep-breathing exercises. It uses a state-driven approach to cycle through the classic 4-4-4-4 Box Breathing technique (Inhale, Hold, Exhale, Hold) with clean text cues and an organic pulsing circle, perfectly synchronizing with the slow shadow swaying of the background. Let's create this file.
I will now create the control panel component src/components/ControlPanel.tsx. It provides intuitive sliders, color pickers, and toggles for full-scale personalization of the plant shadows, light positions, colored double light sources, wind movement, and wall roughness. It also has a preset selector and an automatic "Day Cycle Simulation" that sweeps light colors and angles smoothly. Let's write this component.
I will remove the unused imports EyeOff, Eye, and ShaderPreset from src/components/ControlPanel.tsx to fix TypeScript compilation warning messages and satisfy the React/Vite linter. Let's make this small edit.
I will now create the reading panel component src/components/ReadingPane.tsx. It displays the selection of zen articles and nature poetry on a beautiful frosted-glass page. It provides adjustment buttons for typography, page opacity, text modes (Light Paper/Dark Charcoal for perfect contrast on any wall background), a mini-breathing bubble toggle, and sound controls. Let's create this file.
I will make a quick edit to src/components/ReadingPane.tsx to remove the unused NatureArticle type import. This prevents TypeScript compiler warnings during build time. Let's make this correction.
I will now replace src/App.tsx with the complete, functional application. It brings together the shader canvas, sidebar editor, zen reading panels, procedural soundscapes, real-time daylight cycle simulation, interactive mouse flashlight tracking, and multi-language support. I will write the complete implementation.
I will clean up the imports in src/App.tsx by removing the unused icons (Sun, Settings, Github, Play, HelpCircle) and the unused React import. This will make the file compile perfectly with zero linter errors. Let's make this correction.
I will now update the HTML page title in index.html to match the natural zen aesthetic of the project: "光影之境 · Whispering Shadows - 植物白墙光影模拟与正念阅读" (Nature Plant Shadows & Zen Reading). Let's edit the file.
I will now trigger a build check using the build_project tool to verify that all React components, procedural Web Audio generators, TypeScript types, and GLSL shaders compile perfectly. Let's run it.
I have created a fully complete, elegant, and highly interactive React + Vite + Tailwind CSS application themed around nature, focusing on realistic plant shadow projections on a plaster/washi-paper white wall.
Here is a summary of the core features and architectural details implemented:
1. 🌿 High-Fidelity Procedural Shadow Shader (ShadowCanvas.tsx)
Rather than using heavy static images or bulky external three.js bundles, I engineered a highly optimized WebGL fragment shader that procedurally renders realistic plant structures using Signed Distance Fields (SDFs):
- 5 Plant Species: Includes 湘竹 (Elegant Bamboo), 龟背竹 (Broad Monstera), 深林羽蕨 (Pinnate Fern), 醉枫秋影 (Lobed Maple), and 疏影寒梅 (Minimal Zen Twig).
- Realistic Penumbra (Shadow Softness): Simulates the depth-of-field effect where leaf tips higher/further from the wall cast softer, blurrier shadows, while the rooted stems closer to the wall remain sharp.
- Dual Light Chromatic Overlaps: Users can activate a secondary ambient light with a different color and angle, casting stunning chromatic double shadows where warm and cool colors mix or mask each other (e.g., golden orange and twilight blue).
- Organic Height-Scaled Wind: Applied multi-octave wave noise to simulate gentle swaying and leaf flutters, anchored firmly at the plant bases.
- Plaster/Washi Wall Grain: Generates fine, tactile micro-shadows dynamically to simulate a plaster or paper wall texture.
2. ☀️ Subpage 1: Background Configuration Sub-page (背景配置子页)
Provides a beautifully responsive, collapsible, glassmorphic Control Panel:
- Interactive Torch/Flashlight Mode: Users can click the cursor icon to let the light projection angle and intensity dynamically track their mouse movements in real-time.
- Daylight Simulation Cycle: An automatic cycle mode that sweeps the sun's angle, brightness, and color temperature continuously over time, capturing sunrise warmth, noon clarity, and sunset glow.
- Fine-tuned Customization: Sliders for plant scale, leaf density, X/Y placement, wind speed/strength, wall roughness, and individual light settings.
- Aesthetic Presets: Quick preset cards like 湘竹晨曦 (Zen Bamboo Sunrise), 落日晚风 (Sunset Maple Glow), and 赛博绿洲 (Cyberpunk Neon Oasis).
3. 📖 Subpage 2: Zen Reading Sub-page (林间阅读子页)
A calm, peaceful sanctuary for contemplation:
- Curated Nature Articles & Poetry: Features classical Zen poems by Wang Wei, Henry David Thoreau's Walden, Rabindranath Tagore's Stray Birds, and a dedicated mindfulness breathing guide, supported in both Chinese and English.
- Immersive Interface Controls: Users can adjust the card's frosted-glass opacity (from 20% to 95%) to blend the reading text directly into the moving tree shadow background.
- Paper contrast themes: Switch between "Paper (白宣)" and "Slate (玄黑)" text configurations, along with dynamic font resizing to ensure perfect contrast against any custom wall background color.
- Guided Breathing Bubble: A companion box-breathing widget (Inhale, Hold, Exhale, Hold) that visually pulses to guide peaceful meditation during reading.
4. 🔊 Procedural Nature Soundscape Generator (AudioGenerator.ts)
Built entirely from scratch using the Web Audio API:
- Synthesizes organic forest wind rustle, mountain streams, valley rain splatters, and randomized bird chirping sequences purely through oscillators and white noise buffers.
- Works 100% locally with zero external network request assets, assuring instant loading, zero 404 errors, and full offline functionality.
Files built: src/components/Presets.ts, src/components/ShadowCanvas.tsx, src/components/AudioGenerator.ts, src/components/Articles.ts, src/components/BreathingBubble.tsx, src/components/ControlPanel.tsx, src/components/ReadingPane.tsx, src/App.tsx, index.html