Live Demos:
An interactive product showcase for Spot’s dog-inspired apparel brand, built with Vite, React, TypeScript, Tailwind CSS, and shadcn-ui.
The app focuses on smooth animations, performant scrolling, and a premium “style lookbook” experience for browsing products, saving favorites, and exploring different styles.
Language Composition:
- TypeScript: 96.1%
- CSS: 3.1%
- Other: 0.8%
Project page: gitguy268.github.io/BlackLabSpotsShop
-
Install Node.js 22 or newer.
-
Get the code:
git clone https://github.com/Gitguy268/BlackLabSpotsShop.git cd BlackLabSpotsShop -
Install the dependencies:
npm install
-
Start it:
npm run dev
-
Open http://localhost:8080/ in your browser. Press
Ctrl+Cin the terminal to stop.
-
Product cards & quick view
Browse products with rich cards, then open a Quick View modal for more details, sizing, and styling info. -
Wishlist
Add/remove items from a wishlist and see how many favourites you’ve saved. Uses a dedicated Wishlist context and memoized logic to keep the UI snappy. -
Rating display
SharedRatingDisplaycomponent for consistent star ratings and review counts across product cards and quick view. -
Smart badges
Centralized badge logic (e.g. “New”) so visual variants stay consistent across the app. -
Scroll-driven UI
- Scroll progress bar
- Back‑to‑top button
- Floating “Shop” button
All powered by shared scroll hooks with throttling and passive listeners for smooth performance.
-
Minecraft mode
A playful “Minecraft mode” toggle that changes the visual style/theme via its own context. -
Animated particle background
A Three.js‑style particle background (inParticleBackground) optimized to reduce CPU usage by sorting less frequently. -
Performance‑focused refactor
- ~135 lines of duplicated code removed
- Context values and heavy components memoized
- Scroll handlers throttled and made passive
- Animation constants centralized for easier tuning
- Frontend: React, TypeScript, Vite
- Styling: Tailwind CSS, custom CSS, shadcn-ui
- State & Context: React Context API with memoized providers
- Utilities & Hooks:
useScrollUtils(scroll progress & visibility)useLocalStorage(reusable localStorage state)badgeUtils&animationConfigfor UI consistency
- Backend / Data: Supabase (project scaffolding present in
/supabase)
Key directories and files:
-
src/assets/— Images and static assetscomponents/ProductCard.tsx— Main product tile componentProductQuickView.tsx— Modal for detailed product viewWishlistButton.tsx— “Add to wishlist” / toggle buttonRatingDisplay.tsx— Shared rating UIScrollProgress.tsx,BackToTop.tsx,FloatingShopButton.tsx— Scroll‑based UI elementsParticleBackground.tsx— Animated background
contexts/CurrencyContext.tsx— Currency & price formattingWishlistContext.tsx— Wishlist state and actionsMinecraftModeContext.tsx— Minecraft mode toggle
hooks/useScrollUtils.ts—useScrollProgress&useScrollVisibilityuseLocalStorage.ts— Generic localStorage hook
lib/animationConfig.ts— Durations, easings, and transition presets
types/product.ts— SharedProductandWishlistProducttypes
utils/badgeUtils.ts—getBadgeVarianthelper for badges
pages/— Top‑level page componentsmain.tsx,App.tsx— App entry and root layout
-
supabase/— Supabase configuration & SQL (if used) -
SUMMARY.md— High‑level summary of the refactoring work -
REFACTORING_REPORT.md— Detailed technical report of all refactors and optimizations
- Node.js installed (Node 18+ recommended)
- Bun installed (the project uses a
bun.lockbfile) or npm.
git clone <YOUR_GIT_URL>
cd remix-of-spot-s-style-showcasebun install
# or if using npm:
npm installbun run dev
# or:
npm run devThen open the URL shown in your terminal (typically http://localhost:5173) in your browser.
In the project directory, you can run:
-
bun run dev(ornpm run dev)
Start the Vite dev server with hot reload. -
bun run build(ornpm run build)
Create a production build. -
bun run preview(ornpm run preview)
Preview the production build locally. -
bun run lint(ornpm run lint)
Run ESLint over the codebase (if configured inpackage.json).
Exact scripts may vary slightly depending on package.json.
You can work with the project in several ways:
-
Lovable UI
Open the project in Lovable and use AI‑powered prompts to modify the app. Changes are automatically committed back to this repo. -
Local IDE (VS Code, WebStorm, etc.)
Edit the code locally after cloning. Push commits, and Lovable will pick them up. -
GitHub web editor / Codespaces
- Edit files directly via the GitHub web editor, or
- Open a Codespace for a full cloud dev environment.
This repo includes a dedicated refactor focused on:
- Removing duplicated scroll logic via
useScrollProgressanduseScrollVisibility - Centralising product types in
src/types/product.ts - Sharing rating UI with
RatingDisplay - Memoising:
- Currency, wishlist, and Minecraft mode context values
- Wishlist actions and computed helpers
WishlistButtonviaReact.memo
- Reducing scroll events from ~60/sec to ~7/sec using throttling and passive listeners
- Cutting ParticleBackground sorting frequency by ~90% to reduce CPU usage
For the full breakdown, see:
SUMMARY.md— Executive summaryREFACTORING_REPORT.md— Detailed before/after code examples and measurements
Some recommended next steps (also listed in the refactor docs):
- Use
useLocalStorageinside Currency/Wishlist/Minecraft contexts for persistent state - Add a
useScrollFadeInhook wired toanimationConfigfor reusable scroll animations - Code‑split heavy visual components (like the particle background and any 3D/Three.js code)
- Optimise large images and use responsive formats (e.g. WebP +
srcset)
[MIT]