How tomasgonzalez/3d-portfolio works
Main Components
a. Frontend Application: This is a single-page application built with React.
• Entry Point: src/index.js and src/App.js, which bootstrap the application.
• Styling: Managed via CSS files (e.g., src/App.css, src/index.css) and scss (see src/components/scrollReminderPage/index.scss).
b. 3D Components: Specialized modules under the src/3d-components directory include:
• “Cube”, “Hologram”, “Logo”, “StarObject”, “StarsField”, and “Track” – these indicate various 3D elements that compose the dynamic visual presentation.
• Each subfolder contains logic, helper hooks, textures, and paths (e.g., src/3d-components/cube and its subdirectories).
c. UI Components: Found in src/components (e.g., navBar, scroll reminder, and uiControls) which handle the standard UI interactions.
d. Scene & Rendering: The directory src/mainScene (with files such as Camera.js and index.js) that likely sets up the Three.js camera, scene, and perhaps the render loop for the 3D visuals.
e. Configuration & Theming: Critical files for easy customization:
• src/configs.js – for portfolio settings.
• src/constants/pageData.js – holds page content/settings.
• src/theme.js – defines styling and theme.
f. Assets and Public Files:
• Assets: In src/assets for models (e.g., cube.glb) and fonts.
Interactions and Flow
• The application starts at the React entry point and renders the main App component.
• The App likely integrates the Main Scene (from src/mainScene) and incorporates several 3D elements defined in src/3d-components.
• UI components (navBar, scroll reminder, etc.) overlay or interact with the 3D scene.
• The configuration files feed into every application layer – from scene setup to UI display – to drive customization.
• Assets and static files (in public and src/assets) are loaded as required by both the UI and 3D scenes.
• The structure shows a clear separation between visual 3D elements and traditional React components.
Architectural Patterns and Principles
• Component-Based Architecture: React components are modularized (e.g., individual 3D components, UI components) allowing for independent development and reuse.
• Separation of Concerns: Distinct folders for business logic (configs, constants), visual rendering (3d-components, mainScene), and presentation (components).
Relevant Technologies
• React – for the core UI and state management.
• Three.js / react-three-fiber / @react-three/drei – for 3D scene management and rendering.
• WebGL – underlying technology powering the 3D graphics.
• Yarn – as the package manager for dependency installation and deployment.
• GitHub Pages – for deployment (with instructions in the README).
– “Main Scene” (camera, scene setup from src/mainScene).
– “UI Components” (navBar, scroll reminder, etc.).
c. In the “3D Rendering Engine” section, break it down into various 3D component modules (cube, hologram, logo, etc.) that are orchestrated by react-three-fiber.
Details
• Clearly separate the “presentation layer” (React components, UI) from the “rendering engine” (3D components and scene setup).
• Inclusion of external assets (audio, video, fonts, 3D models) that contribute to the overall visual and interactive experience.