-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
181 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,9 +2,10 @@ | |
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Vite + React + TS</title> | ||
<title>Yuuto</title> | ||
<link rel="preload" as="fetch" href="https://api.lanyard.rest/v1/users/269415459735076864"> | ||
<link href="https://fonts.googleapis.com/css2?family=Fira+Code:[email protected]&display=swap" rel="stylesheet"> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,26 @@ | ||
import { useState } from 'react' | ||
import reactLogo from './assets/react.svg' | ||
import viteLogo from '/vite.svg' | ||
import './App.css' | ||
import Header from './components/Header.tsx'; | ||
import MainSection from './components/MainSection.tsx'; | ||
import {useEffect, useState} from 'react'; | ||
import Loading from './components/Loading.tsx'; | ||
|
||
function App() { | ||
const [count, setCount] = useState(0) | ||
const [user, setUser] = useState(null); | ||
useEffect(() => { | ||
fetch('https://api.lanyard.rest/v1/users/269415459735076864') | ||
.then(res => res.json()) | ||
.then(data => { | ||
setUser(data.data); | ||
}); | ||
}, []); | ||
|
||
return ( | ||
<> | ||
<div> | ||
<a href="https://vite.dev" target="_blank"> | ||
<img src={viteLogo} className="logo" alt="Vite logo" /> | ||
</a> | ||
<a href="https://react.dev" target="_blank"> | ||
<img src={reactLogo} className="logo react" alt="React logo" /> | ||
</a> | ||
</div> | ||
<h1>Vite + React</h1> | ||
<div className="card"> | ||
<button onClick={() => setCount((count) => count + 1)}> | ||
count is {count} | ||
</button> | ||
<p> | ||
Edit <code>src/App.tsx</code> and save to test HMR | ||
</p> | ||
</div> | ||
<p className="read-the-docs"> | ||
Click on the Vite and React logos to learn more | ||
</p> | ||
{!user ? <Loading /> : <> | ||
<Header /> | ||
<MainSection user={user} /> | ||
</>} | ||
</> | ||
) | ||
); | ||
} | ||
|
||
export default App | ||
export default App; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
export default function Header() { | ||
const links = [ | ||
{ | ||
name: 'Projects', | ||
url: '#projects' | ||
}, | ||
{ | ||
name: 'Contact', | ||
url: '#contact' | ||
} | ||
]; | ||
|
||
return ( | ||
<header className="absolute inset-x-0 top-0 flex items-center justify-between px-8 py-4"> | ||
<div> | ||
<span role="link" className="cursor-pointer text-2xl font-bold" onClick={() => { | ||
scroll(0, 0); | ||
}}> | ||
Yuuto | ||
<span className="text-base text-gray-500">.dev</span> | ||
</span> | ||
</div> | ||
<div> | ||
<nav> | ||
<ul className="flex space-x-6"> | ||
{links.map(link => ( | ||
<li key={link.url}> | ||
<a href={link.url} className="text-gray-100 duration-150 hover:text-gray-400"> | ||
{link.name} | ||
</a> | ||
</li> | ||
))} | ||
</ul> | ||
</nav> | ||
</div> | ||
</header> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import {useEffect, useState} from 'react'; | ||
|
||
export default function Loading() { | ||
const [dots, setDots] = useState<number>(0); | ||
|
||
useEffect(() => { | ||
const interval = setInterval(() => { | ||
setDots(prev => { | ||
if (prev === 3) { | ||
return 1; | ||
} else { | ||
return prev + 1; | ||
} | ||
}); | ||
}, 500); | ||
|
||
return () => clearInterval(interval); | ||
}, []); | ||
|
||
return ( | ||
<div className="absolute inset-0 z-50 bg-black"> | ||
<div className="flex h-screen items-center justify-center"> | ||
<div className="text-4xl font-bold text-white"> | ||
{'.'.repeat(dots)} | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
export default function MainSection({ user }: { user: LanyardUser }) { | ||
return ( | ||
<section id="main"> | ||
<div className="flex h-screen flex-col items-center justify-center text-center"> | ||
<div className="max-w-lg space-y-4"> | ||
<img src={ | ||
`https://cdn.discordapp.com/avatars/${user.discord_user.id}/${user.discord_user.avatar}.png?size=256` | ||
} alt="Avatar" className="mx-auto mb-8 size-32 rounded-full" draggable={false} /> | ||
<h1 className="text-4xl font-bold">Hi! I'm Yuuto</h1> | ||
<p> | ||
I'm a 17 yo developer from France. | ||
</p> | ||
</div> | ||
</div> | ||
</section> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,16 @@ | ||
:root { | ||
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif; | ||
line-height: 1.5; | ||
font-weight: 400; | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; | ||
|
||
color-scheme: light dark; | ||
color: rgba(255, 255, 255, 0.87); | ||
background-color: #242424; | ||
@layer base { | ||
*, ::before, ::after { | ||
scroll-behavior: smooth; | ||
} | ||
|
||
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; | ||
} | ||
body { | ||
background-image: linear-gradient(45deg, #0A0F29 0%, #1B2A41 100%); | ||
background-repeat: no-repeat; | ||
background-attachment: fixed; | ||
color: theme(colors.white); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import { StrictMode } from 'react' | ||
import { createRoot } from 'react-dom/client' | ||
import './index.css' | ||
import App from './App.tsx' | ||
import { StrictMode } from 'react'; | ||
import { createRoot } from 'react-dom/client'; | ||
import './index.css'; | ||
import App from './App.tsx'; | ||
|
||
createRoot(document.getElementById('root')!).render( | ||
<StrictMode> | ||
<App /> | ||
</StrictMode>, | ||
) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,11 @@ | ||
/// <reference types="vite/client" /> | ||
|
||
interface LanyardUser { | ||
discord_user: { | ||
username: string; | ||
public_flags: number; | ||
id: string; | ||
discriminator: string; | ||
avatar: string; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,24 @@ | ||
/** @type {import('tailwindcss').Config} */ | ||
export default { | ||
content: [], | ||
content: [ | ||
'./index.html', | ||
'./src/**/*.{js,ts,jsx,tsx}', | ||
], | ||
theme: { | ||
extend: {}, | ||
extend: { | ||
fontFamily: { | ||
sans: '"Fira Code", sans-serif', | ||
}, | ||
animation: { | ||
blink: 'blink 1s linear infinite', | ||
}, | ||
keyframes: { | ||
blink: { | ||
'0%, 100%': { opacity: 1 }, | ||
'50%': { opacity: 0 }, | ||
}, | ||
}, | ||
}, | ||
}, | ||
plugins: [], | ||
} | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
import { defineConfig } from 'vite' | ||
import react from '@vitejs/plugin-react-swc' | ||
import { defineConfig } from 'vite'; | ||
import react from '@vitejs/plugin-react-swc'; | ||
|
||
// https://vite.dev/config/ | ||
export default defineConfig({ | ||
plugins: [react()], | ||
}) | ||
plugins: [ | ||
react(), | ||
], | ||
}); |
Oops, something went wrong.