-
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.
Redesign the entire fucking thing with PicoCSS
- Loading branch information
Showing
18 changed files
with
615 additions
and
191 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,3 +22,6 @@ dist-ssr | |
*.njsproj | ||
*.sln | ||
*.sw? | ||
|
||
.env.local | ||
.env.production |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,39 +1,24 @@ | ||
import "./App.css"; | ||
|
||
function genState() { | ||
const alphabet = | ||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; | ||
let state = ""; | ||
for (let i = 0; i < 32; i++) { | ||
state += alphabet[Math.floor(Math.random() * alphabet.length)]; | ||
} | ||
return state; | ||
} | ||
export default function App() { | ||
const state = genState(); | ||
localStorage.setItem("state", state); | ||
|
||
const redirectUri = new URL("https://discord.com/api/oauth2/authorize"); | ||
const query = new URLSearchParams({ | ||
client_id: import.meta.env.VITE_DISCORD_CLIENT_ID, | ||
redirect_uri: import.meta.env.VITE_DISCORD_REDIRECT_URI, | ||
response_type: "code", | ||
scope: "identify", | ||
state | ||
}); | ||
redirectUri.search = query.toString(); | ||
import { Link, Outlet } from "react-router-dom"; | ||
import CurrentAccount from "./components/CurrentAccount"; | ||
|
||
export default function Root() { | ||
return ( | ||
<> | ||
<h1>SlopNet</h1> | ||
<p> | ||
This website will let you connect your Discord account to Slop Crew. | ||
While this is a currently unused feature, it will be used in the future. | ||
</p> | ||
<p>Click the button below to sign in:</p> | ||
<a href={redirectUri.toString()}> | ||
<button>Sign in with Discord</button> | ||
</a> | ||
<nav> | ||
<ul> | ||
<li> | ||
<Link to="/" className="contrast"> | ||
<strong>SlopNet</strong> | ||
</Link> | ||
</li> | ||
</ul> | ||
|
||
<ul> | ||
<CurrentAccount /> | ||
</ul> | ||
</nav> | ||
|
||
<Outlet /> | ||
</> | ||
); | ||
} |
Oops, something went wrong.