src/assets/. This guide covers how to replace each category of asset and what else needs to change in the code when you do.
Replacing the 3D model
The scene is driven by a single GLTF binary file:src/assets/3d/bedroom.glb. It is loaded in src/models/Computer.jsx via useGLTF from @react-three/drei.
src/models/Computer.jsx
.glb file is imported as a module (not fetched by URL string). Vite hashes and bundles it into the dist/ output automatically.
Export a GLTF from Blender
In Blender, go to File → Export → glTF 2.0 (.glb/.gltf).Recommended export settings:
- Format: glTF Binary (.glb) — single file, easier to manage.
- Include: check Meshes, Materials, and Textures.
- Compression: enable Draco mesh compression if file size is a concern (requires the
three/examples/jsm/loaders/DRACOLoadersetup). - Transform: apply any pending rotations/scales before export so the scene loads in the correct orientation.
Replace the file
Copy your new
.glb into src/assets/3d/ and name it bedroom.glb, or update the import in Computer.jsx:src/models/Computer.jsx
Update mesh and material references
Node and material names in the destructured To find the correct names for your new model, add a temporary Replace each
nodes and materials objects are taken directly from your Blender scene. When you swap the model these names will change.In Computer.jsx the scene is built with JSX like:src/models/Computer.jsx
console.log after the useGLTF call:src/models/Computer.jsx
nodes.OldName and materials['OldMaterial'] reference with the names logged for your new model.The
.glb file must live under src/assets/ (not public/) so Vite processes it through the module graph. Importing it with import gives you the hashed, bundled URL that useGLTF fetches at runtime.Swapping icons
Icons are used in two places: the 2D overlay inHome.jsx and the loader screen in Loader.jsx.
| File | Purpose |
|---|---|
clock.gif | Animated clock shown in the ChangingTimeOverlay (the 2-second black transition when switching time of day) |
home.gif | Animated icon shown on the loader screen above the loading text |
home2.gif | Alternative home icon (not actively imported in current source) |
github.png / github.svg | GitHub link icon in the HUD overlay |
linkedin.png / linkedin.svg | LinkedIn link icon in the HUD overlay |
src/assets/icons/ using the same filename. Vite will pick it up automatically.
If you need to use a different filename, update the corresponding import in Home.jsx or Loader.jsx:
Swapping loader background images
The full-screen loading background uses responsive images imported insrc/components/Loader.jsx.
| File | Shown when | Recommended size |
|---|---|---|
loader.jpg | Viewport width > 768 px | 1920 × 1080 px (16:9), < 500 KB |
loader-mobile.jpg | Viewport width ≤ 768 px | 750 × 1334 px (9:16), < 300 KB |
resize event listener in Loader.jsx:
src/components/Loader.jsx
src/assets/images/ using the same filenames. If you prefer WebP for better compression:
src/components/Loader.jsx
Font replacement
The retro font is declared once insrc/pages/Home.css and referenced by name throughout Home.jsx.
src/pages/Home.css
- Add the new font file to
src/assets/fonts/. - Update the
srcpath (and optionally theformat) in the@font-faceblock. - Keep
font-family: 'retro'unchanged so that allstyle={{ fontFamily: 'retro' }}usages inHome.jsxcontinue to work — or do a global rename if you prefer a different family name.
src/pages/Home.css
Public assets and favicons
Favicons and web-app manifest icons are stored in thepublic/favicon/ folder and referenced in index.html. These are served at the root URL without going through Vite’s module bundler.
To regenerate favicons:
Generate favicon files
Use a favicon generator such as realfavicongenerator.net or favicon.io. Download the generated package.
Replace the files in public/favicon/
Drop all generated files into
public/favicon/, overwriting the existing ones. Common files include: