How at010303/room_portfolio works
1. This is a client-side React + Vite portfolio that renders a single interactive 3D room in the browser. There is no backend or API layer in the repository; the app is entirely driven by static assets, local state, and scene interactions.
2. The application bootstrap is standard Vite: index.html loads the React entry in src/main.jsx, which mounts the root experience. src/Experience.jsx appears to be the top-level scene composition layer, and src/style.css provides global styling around the WebGL canvas and UI overlays.
3. The core architectural boundary is the 3D scene rendered with react-three/fiber on top of Three.js. The room itself lives under src/RoomModel/, centered around roomModel.jsx and supporting components for sub-objects inside the room.
4. The static environment and props come from Blender-exported .glb models and media in public/assets/. Important scene assets include RoomModel.glb, chairtopDraco.glb, clock.glb, plus video and audio files used by embedded displays and interactive objects. These assets are loaded directly into the client and never pass through a server.
5. Interactivity is split into small room object components rather than one monolithic scene file. Files like DispFrame.jsx, Windows.jsx, clock.jsx, dispItem.jsx, photoFrame.jsx, and laptopDisp.jsx suggest each in-room object owns its own visual model and click behavior, which keeps the room assembly modular.
6. The app includes multiple “embedded screen” experiences under src/RoomModel/iframes/: desktopiFrame.jsx, smartphoneiFrame.jsx, and tvEmulator.jsx. These are likely the bridge between the 3D world and standard DOM content, letting a monitor/phone/TV in the room display a separate web experience or emulator UI.
7. A notable interactive subsystem is the game/media content embedded in the room. The presence of public/assets/SuperMarioAdvance4.gba and tvEmulator.jsx indicates an in-browser emulator experience; the audio files under public/assets/laptopDisp/audio/ and video wallpapers like desktopWallpaper.mp4 and marioWallpaper.mp4 support media playback on the room’s displays.
8. Camera behavior is isolated from the scene through src/CameraManager/CameraManager.jsx and shared camera state in src/helper/CameraStore.jsx. This separation suggests the camera can be switched or animated independently of the room objects, which is important in a portfolio where user focus moves between the room overview and close-up interactions.
9. Global UI toggles are also separated out. src/Switch/TheamSwitch.jsx (theme switch, misspelled in the filename) likely drives light/dark or stylistic mode changes, and the README mentions GSAP-based theme transitions, so visual changes are animated rather than instantaneous.
10. Visual fidelity is extended with custom shaders under src/RoomModel/shaders/Room/ and shared shader helpers in src/RoomModel/shaders/partials/. This indicates some room surfaces or lighting effects are custom-rendered beyond standard materials, probably for mood, reflections, or blending effects.
11. The app uses zustand for shared state and leva for tweakable controls, which fits a scene-driven architecture: object interactions update global state, and that state drives camera positions, lights, theme changes, media playback, and visibility of embedded experiences.
12. Overall data flow is: user input in the 3D scene or embedded screens updates shared state; state drives camera/theme/media changes; the scene renders with Three.js, custom shaders, and postprocessing; static assets from public/assets/ supply models, video, audio, and emulator content. The main architectural boundary is between the interactive 3D environment and the DOM-based embedded content inside certain room objects.
Main entry points: roomModel.jsx Room model · Experience.jsx Experience · main.jsx main · clock.jsx Clock
Components 23
App shell
Vite entry, global styles, and top-level React composition.
- main · Bootstraps the React app from index.html.
src/main.jsx - Experience · Top-level composition for the portfolio experience.
src/Experience.jsx - Global CSS · Styles for canvas layout and overlays.
src/style.css
3D room
Three.js scene, room objects, shaders, and scene-local interactions.
- Room model · Coordinates the room and its interactive objects.
src/RoomModel/roomModel.jsx - Disp frame · Interactive display/frame component in the room.
src/RoomModel/DispFrame.jsx - Windows · Window-related scene component and interactions.
src/RoomModel/Windows.jsx - Clock · Clock prop and its behavior.
src/RoomModel/clock.jsx - Display item · Selectable or animated in-room display element.
src/RoomModel/dispItem.jsx - Photo frame · Framed media object within the room.
src/RoomModel/photoFrame.jsx - Laptop display · Laptop-based media and audio display.
src/RoomModel/laptopDisp.jsx - Room shaders · Custom room shader programs and shared shader helpers.
src/RoomModel/shaders/Room/fragment.glsl - Texture material · Shared texture/material wrapper for scene assets.
src/RoomModel/textures/TextureMaterial.jsx
Embedded screens
DOM-based iframe/emulator experiences mounted inside room objects.
- Desktop iframe · Desktop-sized embedded experience shown in the room.
src/RoomModel/iframes/desktopiFrame.jsx - Phone iframe · Smartphone-sized embedded experience shown in the room.
src/RoomModel/iframes/smartphoneiFrame.jsx - TV emulator · TV-mounted emulator or screen bridge for game/media content.
src/RoomModel/iframes/tvEmulator.jsx
Shared state
Cross-cutting camera and theme coordination.
- Camera manager · Controls camera movement and framing.
src/CameraManager/CameraManager.jsx - Camera store · Shared camera state used across the experience.
src/helper/CameraStore.jsx - Theme switch · Theme or mood switching with animated transitions.
src/Switch/TheamSwitch.jsx
Static assets
Blender models and media loaded directly by the client.
- Room GLB · Main Blender-exported room model.
public/assets/RoomModel.glb - Chair GLB · Imported chair mesh asset.
public/assets/chairtopDraco.glb - Clock GLB · Imported clock mesh asset.
public/assets/clock.glb - Media assets · Wallpaper videos and laptop audio tracks used by room displays.
public/assets/desktopWallpaper.mp4 - Mario GBA · ROM used by the TV emulator experience.
public/assets/SuperMarioAdvance4.gba
Connections 23
- main → Experience: mounts · React entry mounts the main experience.
- main → Global CSS: loads · Global CSS is applied during boot.
- Experience → Room model: composes · Top-level experience includes the 3D room.
- Experience → Camera manager: uses camera · Experience coordinates scene framing.
- Experience → Theme switch: exposes theme · Theme control is part of the outer experience.
- Room model → Room GLB: loads model · Main room assembly consumes the exported room mesh.
- Room model → Disp frame: includes · Room assembly includes display-frame interaction.
- Room model → Windows: includes · Room assembly includes window components.
- Room model → Clock: includes · Room assembly includes clock prop.
- Room model → Display item: includes · Room assembly includes display items.
- Room model → Photo frame: includes · Room assembly includes photo frames.
- Room model → Laptop display: includes · Room assembly includes laptop display.
- Room model → Room shaders: styles · Custom shaders shape the room rendering.
- Room model → Texture material: materials · Shared texture/material helper supports scene surfaces.
- Room model → Desktop iframe: embeds · Room contains desktop screen content.
- Room model → Phone iframe: embeds · Room contains phone screen content.
- Room model → TV emulator: embeds · Room contains TV/emulator content.
- Display item → Chair GLB: loads · Display item may use the chair asset.
- Clock → Clock GLB: loads · Clock component uses the clock mesh asset.
- Laptop display → Media assets: plays · Laptop display consumes audio/video media.
- TV emulator → Mario GBA: emulates · TV emulator loads the game ROM.
- Camera manager → Camera store: reads/writes · Camera manager synchronizes with shared camera state.
- Theme switch → Camera store: shares state · Theme transitions likely coordinate through global state.