A React-powered interactive trading card collection featuring hybrid 3D tilt tracking, click-to-flip animations, holographic effects, and 100% original artwork.
- Node.js (v14 or higher)
- npm
-
Install dependencies:
npm install
-
Run the development server:
npm start
Or simply double-click
START.bat(Windows) -
Open your browser:
- Navigate to
http://localhost:3000 - Hover over cards to see dynamic 3D tilt tracking
- Click cards to flip and reveal stats!
- Navigate to
npm run buildThe static site will be in the build/ folder, ready to deploy or turn in.
TradingCards/
βββ public/
β βββ assets/ # Original artwork (9 PNG files)
β β βββ bunny-hoodie.png
β β βββ galaxy-girl.png
β β βββ mechanic-crew.png
β β βββ dog-love.png
β β βββ stitch-cute.png
β β βββ dragon-rider.png
β β βββ viking-chicken.png
β β βββ fear-loathing.png
β β βββ glow-sticks.png
β βββ index.html
βββ src/
β βββ App.js # Main app + design justification
β βββ App.css # Global styles
β βββ Card.js # Card component with tilt/flip
β βββ Card.css # Card-specific styles
β βββ data.js # All 9 card data
β βββ index.js # React entry point
βββ assets/ # Duplicate for static deployment
βββ build/ # Production build output
βββ README.md
-
Original Artwork (100% Tier)
- All 9 character illustrations are 100% original
- Hand-drawn in Procreate with unique artistic style
- Exceeds 5-6 card requirement
-
Vector Graphics (SVG)
- Custom IDE-themed frames built inline with
<rect>,<circle>,<path> - Scalable borders that remain crisp at any resolution
- Pastel color palette dynamically injected per character
- Custom IDE-themed frames built inline with
-
Raster Graphics (PNG)
- Complex character art with organic shading and brush textures
- Millions of color variations and photographic detail
- Efficient file compression for web performance
-
Hybrid 3D Interaction System
- Tilt Tracking on Hover: 5Γ5 invisible grid (25 zones) detects mouse position for real-time 3D tilt using
rotateXandrotateY - Click-to-Flip: Four different flip directions based on character personality:
rotateY(180deg)- Standard horizontal fliprotateX(180deg)- Vertical fliprotate3d(1,1,0,180deg)- Diagonal spinrotate3d(-1,1,0,180deg)- Inverted diagonal chaos
- Tilt Tracking on Hover: 5Γ5 invisible grid (25 zones) detects mouse position for real-time 3D tilt using
-
Mouse-Tracking Holographic Foil Effect
- Rainbow shimmer overlay using
mix-blend-mode: color-dodge - Radial gradient spotlight follows mouse cursor in real-time
- React
onMouseMovehandler tracks position and updates inline styles - Dual-gradient system: moving spotlight + animated rainbow sweep
- Smooth
0.1stransitions for responsive tracking - Z-index layered between art and frame for premium TCG aesthetic
- Rainbow shimmer overlay using
-
Additional Enhancements
- Staggered floating animations across all 9 cards
- Dynamic glow effects on hover
- Responsive grid layout
- Pastel color-coded frames by role
Layer 1 (z-index: 1) β CSS Gradient Background
Layer 2 (z-index: 2) β Raster Character Art (PNG)
Layer 2.5 (z-index: 2.5) β Holographic Foil Overlay
Layer 3 (z-index: 3) β Vector Frame (SVG)
- Vectors on Top: Ensures crisp UI elements (borders, text) never blur
- Holo Foil Between: Creates premium card effect with blend mode magic
- Rasters in Middle: Complex artwork benefits from compressed PNG format
- Gradients on Bottom: Provides depth without additional HTTP requests
Each card has a 5Γ5 grid of invisible zones. The CSS :has() pseudo-class detects which zone is being hovered and applies the corresponding 3D transform:
.card-container:has(.tilt-zone.tilt-1:hover) .card-inner {
transform: rotateX(20deg) rotateY(-10deg);
}This creates a realistic "holding a physical card" effect with smooth transitions.
The holographic shine follows your cursor using React state management:
const [holoPosition, setHoloPosition] = useState({ x: 50, y: 50 });
const handleMouseMove = (e) => {
const rect = e.currentTarget.getBoundingClientRect();
const x = ((e.clientX - rect.left) / rect.width) * 100;
const y = ((e.clientY - rect.top) / rect.height) * 100;
setHoloPosition({ x, y });
};The position is then used to update a radial gradient in real-time:
radial-gradient(circle at 50% 50%, ...) /* follows mouse */This creates a dynamic light spot that moves with your cursor, simulating real holographic card reflection.
Each card has a unique pastel frame color:
- #a8e6ff - Pastel Sky Blue (The Founder - Innovation)
- #d4a5ff - Pastel Lavender (The Architect - Cosmic Vision)
- #b0c4d4 - Pastel Steel Blue (The Crew - Industrial)
- #ffb3d9 - Pastel Rose Pink (Brindle Buddy - Loyalty)
- #ff99cc - Pastel Hot Pink (Experiment 626 - Chaos)
- #ffb399 - Pastel Coral (Dragon Rider - Power)
- #ffe5a3 - Pastel Golden Yellow (Chicken Keeper - Reliability)
- #a8e6b3 - Pastel Mint Green (The Gonzo Devs - Debugging)
- #e0b3ff - Pastel Lilac (Neon Raver - UI/UX)
- Add your PNG artwork to
public/assets/ - Open
src/data.jsand add a new card object:
{
id: 10,
name: "Your Character",
role: "Your Role",
image: "./assets/your-image.png",
frameColor: "#yourColor",
flipType: "flip-standard", // or flip-vertical, flip-diagonal, flip-invert
stats: { stat1: 100, stat2: "Value" },
desc: "Your character's lore text"
}Edit the flipType property in data.js:
flip-standard- Classic horizontal door flipflip-vertical- Heavy garage door flipflip-diagonal- Disorienting diagonal spinflip-invert- Chaotic inverted flip
In Card.css, modify the tilt transform values:
.card-container:has(.tilt-zone.tilt-1:hover) .card-inner {
transform: rotateX(20deg) rotateY(-10deg); /* Adjust these degrees */
}| Requirement | Implementation | Location |
|---|---|---|
| 5-6 Cards | 9 unique characters | src/data.js |
| Original Artwork | 100% custom illustrations | public/assets/ |
| Vector Graphics | Inline SVG with <rect>, <circle>, <path> |
src/Card.js lines 48-99 |
| Raster Graphics | PNG character art | public/assets/*.png |
| 3D Animation | Hybrid tilt + flip system | src/Card.css lines 50-400 |
| Design Justification | Technical defense in user's voice | src/App.js lines 28-185 |
| Legendary Features | Mouse-tracking holo, varied flips, tilt tracking | Entire project |
Before submission, verify:
- All 9 images are in
public/assets/folder - File names match paths in
data.js(relative paths./assets/) -
npm startruns without errors - Cards tilt on hover (test mouse movement)
- Cards flip on click
- Holographic effect follows mouse cursor
- Justification section is visible at bottom
- No React errors (check browser DevTools)
- Responsive on mobile
- Static build works (
build/index.htmlopens correctly)
The project is configured for static deployment with relative paths:
-
Build the project:
npm run build
-
Test the build locally:
- Open
build/index.htmldirectly in a browser - All assets should load correctly
- Open
-
Deploy:
- Upload the entire
build/folder to any web server - Or turn in the
build/folder as a ZIP file
- Upload the entire
- GitHub Pages: Upload
build/folder contents - Netlify/Vercel: Drag and drop
build/folder - Local Server: Turn in
build/folder for grading
Design & Development: MavScript.blu Artwork: 100% Original Illustrations (Procreate) Tech Stack: React 18, CSS3 3D Transforms, SVG, :has() Pseudo-class License: Educational Project Β© 2025
- Verify file names match exactly (case-sensitive)
- Images must be in
public/assets/for dev server - Build process copies them to
build/assets/ - Clear browser cache and hard refresh (Ctrl+Shift+R)
- Tilt requires
:has()pseudo-class (modern browsers only) - Works in Chrome/Edge 105+, Firefox 121+, Safari 15.4+
- Hover slowly across card to see effect
- Click anywhere on the card surface
- Check that
Card.jshasonClick={handleClick} - Verify
.flippedclass is toggling in DevTools
- Check
package.jsonhas"homepage": "." - All image paths in
data.jsshould use./assets/not/assets/ - Rebuild with
npm run build
Ready to deploy your Legendary collection! π΄β¨