diff --git a/bun.lockb b/bun.lockb index 5cc1c4a..545166e 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 3322dfa..6a5f5de 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "preview": "vite preview" }, "dependencies": { + "@dnd-kit/core": "^6.3.1", "react": "^18.3.1", "react-dom": "^18.3.1" }, diff --git a/src/App.css b/src/App.css index b9d355d..e69de29 100644 --- a/src/App.css +++ b/src/App.css @@ -1,42 +0,0 @@ -#root { - max-width: 1280px; - margin: 0 auto; - padding: 2rem; - text-align: center; -} - -.logo { - height: 6em; - padding: 1.5em; - will-change: filter; - transition: filter 300ms; -} -.logo:hover { - filter: drop-shadow(0 0 2em #646cffaa); -} -.logo.react:hover { - filter: drop-shadow(0 0 2em #61dafbaa); -} - -@keyframes logo-spin { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } -} - -@media (prefers-reduced-motion: no-preference) { - a:nth-of-type(2) .logo { - animation: logo-spin infinite 20s linear; - } -} - -.card { - padding: 2em; -} - -.read-the-docs { - color: #888; -} diff --git a/src/App.tsx b/src/App.tsx index 3d7ded3..f8be86c 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,35 +1,48 @@ -import { useState } from 'react' -import reactLogo from './assets/react.svg' -import viteLogo from '/vite.svg' -import './App.css' +import { useEffect, useRef, useState } from 'react'; +import './App.css'; +import { TierImage } from './components/Image'; function App() { - const [count, setCount] = useState(0) + const [images, setImages] = useState([]); + useEffect(() => { + console.log(images); + }, [images]); + const uploadBtn = useRef(null); + + const clickUpload = () => { + if (uploadBtn.current) uploadBtn.current.click(); + }; return ( <> -
- - Vite logo - - - React logo - +
+ {images.map((image, index) => ( + + ))}
-

Vite + React

-
- -

- Edit src/App.tsx and save to test HMR -

+
+ Upload + { + console.log(event.target.files); + if (event.target.files) { + const upload_images: string[] = []; + for (let i = 0; i < event.target.files.length; i++) { + const url = URL.createObjectURL(event.target.files[i]); + upload_images.push(url); + } + setImages(prev => [...prev, ...upload_images]); + } + }} + />
-

- Click on the Vite and React logos to learn more -

- ) + ); } -export default App +export default App; diff --git a/src/components/Image.tsx b/src/components/Image.tsx new file mode 100644 index 0000000..3a518cf --- /dev/null +++ b/src/components/Image.tsx @@ -0,0 +1,15 @@ +interface ImageProps { + image: string; + name: string; +} + +export const TierImage = ({ image, name }: ImageProps) => { + return ( +
+
+ {name} +
{name}
+
+
+ ); +}; diff --git a/src/components/Tier.tsx b/src/components/Tier.tsx new file mode 100644 index 0000000..e69de29 diff --git a/src/index.css b/src/index.css index 6119ad9..b5c61c9 100644 --- a/src/index.css +++ b/src/index.css @@ -1,68 +1,3 @@ -:root { - font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif; - line-height: 1.5; - font-weight: 400; - - color-scheme: light dark; - color: rgba(255, 255, 255, 0.87); - background-color: #242424; - - font-synthesis: none; - text-rendering: optimizeLegibility; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - -a { - font-weight: 500; - color: #646cff; - text-decoration: inherit; -} -a:hover { - color: #535bf2; -} - -body { - margin: 0; - display: flex; - place-items: center; - min-width: 320px; - min-height: 100vh; -} - -h1 { - font-size: 3.2em; - line-height: 1.1; -} - -button { - border-radius: 8px; - border: 1px solid transparent; - padding: 0.6em 1.2em; - font-size: 1em; - font-weight: 500; - font-family: inherit; - background-color: #1a1a1a; - cursor: pointer; - transition: border-color 0.25s; -} -button:hover { - border-color: #646cff; -} -button:focus, -button:focus-visible { - outline: 4px auto -webkit-focus-ring-color; -} - -@media (prefers-color-scheme: light) { - :root { - color: #213547; - background-color: #ffffff; - } - a:hover { - color: #747bff; - } - button { - background-color: #f9f9f9; - } -} +@tailwind base; +@tailwind components; +@tailwind utilities;