A dynamic, interactive 3D web application built with Astro, React, and Three.js, featuring a responsive split-panel layout and dynamic component loading.
- Interactive 3D cube interface with dynamic face content
- Responsive split-panel layout
- Dynamic component loading system
- Rich set of interactive components
- Real-time 3D controls and animations
- Modern, clean UI with Tailwind CSS
- Framework: Astro
- UI Library: React
- 3D Graphics: Three.js with @react-three/fiber
- Styling: Tailwind CSS
- Layout: react-split
- Build Tool: Vite
src/
├── components/
│ ├── CardContent/ # Content components for cube faces
│ │ ├── WebPageCube/ # 3D cube implementation
│ │ │ ├── WebPageCube.tsx
│ │ │ ├── CubeFace.tsx
│ │ │ ├── CubeControls.tsx
│ │ │ └── cubeConfig.ts
│ │ ├── AbstractSpec.tsx
│ │ ├── ConcreteImpl.tsx
│ │ ├── RealisticExpectations.tsx
│ │ ├── ThreeJsCube.tsx
│ │ ├── SpotifyPlayer.tsx
│ │ ├── YouTubePlayer.tsx
│ │ └── ... (other content components)
│ ├── SplitLayout/ # Layout components
│ │ ├── SplitPane.tsx
│ │ ├── SplitLayout.tsx
│ │ └── LeftPanel.tsx
│ ├── ui/ # UI components
│ │ ├── button.tsx
│ │ ├── slider.tsx
│ │ └── ... (other UI components)
│ └── MCard.tsx # Dynamic component loader inspired by Leibniz's Monadology
├── layouts/
│ └── Layout.astro # Main layout template
├── lib/
│ └── utils.ts # Utility functions
└── pages/
└── index.astro # Main entry point
Dynamic component loader inspired by Leibniz's concept of Monads from his work "Monadology". Like Monads, which are self-contained units that reflect the entire universe, MCard components encapsulate their own state and behavior while being part of a larger interconnected system. This architectural choice enables seamless dynamic loading and error management for components.
Interactive 3D cube interface with configurable faces and controls.
Responsive split-panel layout manager with resizable panels.
-
Install Dependencies
npm install
-
Development
npm run dev
-
Build
npm run build
The application provides an interactive 3D cube interface with:
- Drag controls for rotation
- Zoom controls
- Auto-rotation toggle
- Dynamic content loading for each face
- Resizable split panels
Components are loaded dynamically using the MCard component:
<MCard
importPath="WebPageCube/WebPageCube"
componentProps={{
title: "Interactive Web Cube",
frontComponent: "AbstractSpec",
backComponent: "RealisticExpectations",
// ... other face components
}}
/>Each cube face can be configured with different components:
- Front: Abstract Specifications
- Back: Realistic Expectations
- Right: Concrete Implementation
- Left: Spotify Player
- Top: YouTube Player
- Bottom: Interactive Counter
The system includes comprehensive error handling:
- Dynamic import error catching
- Component loading fallbacks
- Detailed error messages
- Debug logging system
- Tailwind CSS for utility-first styling
- Consistent design system
- Responsive layouts
- Modern UI components
- Create component in
src/components/CardContent - Register in WebPageCube configuration
- Import dynamically using MCard
Adjust cube parameters in cubeConfig.ts:
- Rotation speed
- Control sensitivity
- Animation parameters
- Dynamic Imports Design - Detailed explanation of the dynamic import system and its design decisions
MIT License - feel free to use this project for your own purposes.
Contributions are welcome! Please feel free to submit a Pull Request.