diff --git a/Week-2/Task-3/r3f/src/App.css b/Week-2/Task-3/r3f/src/App.css index a83e564..dc48fc7 100644 --- a/Week-2/Task-3/r3f/src/App.css +++ b/Week-2/Task-3/r3f/src/App.css @@ -1,10 +1,12 @@ -* { - margin: 0; - padding: 0; - box-sizing: border-box; +.app-container { + width: 100vw; + height: 100vh; + position: relative; + background-color: white; + overflow: hidden; } -body { - overflow: hidden; - background-color: #111; - font-family: sans-serif; \ No newline at end of file +.canvas-wrapper { + width: 100%; + height: 100%; +} \ No newline at end of file diff --git a/Week-2/Task-3/r3f/src/App.jsx b/Week-2/Task-3/r3f/src/App.jsx index 71ffef9..893cc1e 100644 --- a/Week-2/Task-3/r3f/src/App.jsx +++ b/Week-2/Task-3/r3f/src/App.jsx @@ -1,5 +1,64 @@ +import React, { useState } from 'react'; +import { Canvas } from '@react-three/fiber'; +import { OrbitControls, PerspectiveCamera } from '@react-three/drei'; +import './App.css'; + +const variants = { + black: { + geometry: , + material: { color: "black", roughness: 1, metalness: 0 } + }, + silver: { + geometry: , + material: { color: "#C0C0C0", roughness: 0.3, metalness: 1 } + }, + gold: { + geometry: , + material: { color: "#FFD700", roughness: 0.4, metalness: 1 } + } +}; + +function Product({ variant }) { + const { geometry, material } = variants[variant]; + + return ( + + {geometry} + + + ); +} + export default function App() { - return ( - <> - ) + const [activeVariant, setActiveVariant] = useState('black'); + + return ( +
+
+ {Object.keys(variants).map((variant) => ( + + ))} +
+ +
+ + + + + + + + + + + +
+
+ ); } \ No newline at end of file