How ektogamat/webgi-jewelry works
Project Type & Purpose
• This is a front-end, single-page, scroll-driven landing page template built in TypeScript using Parcel as a bundler. It leverages the WebGi 3D engine (a wrapper around Three.js), GSAP’s ScrollTrigger plugin for scroll-based animations, and SCSS for styling. There is no backend or database—everything is static and runs in the browser.
File Structure Analysis
• Top-level config and metadata:
• package.json / package-lock.json – dependency management and build scripts
• tsconfig.json / .sassrc – TypeScript and Sass configurations
• .gitignore / LICENSE.md / Readme.md
• Assets folder:
• GLB models (3D ring objects)
• Images, favicons, and audio files
• src folder:
• index.ts – application entry point, initializes WebGi scene and GSAP animations
• styles.scss / _variables.scss – global and variable-based styling
• index.html – the HTML scaffold that loads the JS bundle and stylesheet
a. Developer Machine & Build Pipeline
• Parcel Bundler (dev server and build step)
• TypeScript compiler + Babel (if used)
• Sass preprocessor
• Outputs: bundle.js, styles.css, asset copies
b. Runtime Environment (Browser)
• index.html loads bundle.js & styles.css
• WebGi Engine: sets up 3D WebGL context, loads .glb models from assets
• GSAP + ScrollTrigger: listens to scroll events, drives animations on the WebGi scene and DOM elements
• Audio module: loads and loops music
c. Static Asset Hosting
• Bundled files and assets served either by Parcel during dev or any static file server/CDN in production
Relationships & Data Flow
1. Developer writes TS and SCSS → Parcel
2. Parcel watches files (dev) or bundles (build) → emits JS/CSS + copies assets
3. Browser requests index.html → loads JS/CSS
4. JS initializes WebGi scene → fetches 3D models + textures/audio from /assets
5. GSAP ScrollTrigger listens for scroll → updates camera, object transforms, CSS properties
6. Browser renders frames continuously via WebGi’s Three.js loop
Architectural Patterns & Principles
• Modular code separation: rendering (WebGi), animation (GSAP), styling (SCSS)
• Build-time vs. runtime separation: bundling/preprocessing happens ahead of user interaction
• Single Responsibility: each TS module handles a distinct concern (scene setup, controls, UI)