A Svelte-based 3D face model viewer that allows you to view and interact with 3D face models in your browser. Built with Three.js and Vite.
- Interactive 3D face model viewing
- Smooth animations and transitions
- Built with modern web technologies (Svelte, Three.js, Vite)
- Responsive design that works on desktop and mobile
- Node.js (v16 or later)
- npm (v7 or later) or yarn
-
Clone the repository:
git clone https://github.com/yourusername/danBot.git cd danBot -
Install dependencies:
npm install
To start the development server:
npm run devThen open http://localhost:5173 in your browser.
To create a production build:
npm run buildThe built files will be in the dist directory.
src/- Source fileslib/- Reusable componentsFaceViewer.svelte- 3D face viewer componentQA.svelte- Question/Answer componentCounter.svelte- Example counter component
App.svelte- Main application componentmain.js- Application entry point
public/- Static assets (place your 3D models and screenshots here)
To add new 3D face models:
- Place your
.glbor.gltffiles in thepublic/directory - Update the
FaceViewer.sveltecomponent to reference your new models
- Svelte - Frontend framework
- Three.js - 3D library
- Vite - Build tool and dev server
- GLTF Transform - For working with 3D models
This project is licensed under the MIT License - see the LICENSE file for details.
Should you later need the extended capabilities and extensibility provided by SvelteKit, the template has been structured similarly to SvelteKit so that it is easy to migrate.
Why include .vscode/extensions.json?
Other templates indirectly recommend extensions via the README, but this file allows VS Code to prompt the user to install the recommended extension upon opening the project.
Why enable checkJs in the JS template?
It is likely that most cases of changing variable types in runtime are likely to be accidental, rather than deliberate. This provides advanced typechecking out of the box. Should you like to take advantage of the dynamically-typed nature of JavaScript, it is trivial to change the configuration.
Why is HMR not preserving my local component state?
HMR state preservation comes with a number of gotchas! It has been disabled by default in both svelte-hmr and @sveltejs/vite-plugin-svelte due to its often surprising behavior. You can read the details here.
If you have state that's important to retain within a component, consider creating an external store which would not be replaced by HMR.
// store.js
// An extremely simple external store
import { writable } from 'svelte/store'
export default writable(0)