This repository was archived by the owner on Jan 14, 2025. It is now read-only.
-
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.
The Spin … All hope … it’s all in the Spin! I want to know more … mo…
…re about the Steel Balls …
1 parent
204cfe7
commit 4308877
Showing
6 changed files
with
157 additions
and
32 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
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 |
---|---|---|
@@ -0,0 +1,71 @@ | ||
.frame{ | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
width: inherit; | ||
height: inherit; | ||
} | ||
|
||
.input { | ||
max-width: 250px; | ||
height: 50px; | ||
background-color: #05060f37; | ||
border-radius: .5rem; | ||
color: #ffffff; | ||
padding: 0 1rem; | ||
border: 2px solid transparent; | ||
font-size: 1rem; | ||
transition: border-color .3s cubic-bezier(.25,.01,.25,1) 0s, color .3s cubic-bezier(.25,.01,.25,1) 0s,background .2s cubic-bezier(.25,.01,.25,1) 0s; | ||
user-select: none; | ||
|
||
} | ||
|
||
.label { | ||
display: block; | ||
margin-bottom: .60rem; | ||
font-size: 1.1rem; | ||
font-weight: bold; | ||
color: #ffffffc9; | ||
transition: color .3s cubic-bezier(.25,.01,.25,1) 0s; | ||
margin-top: 20px; | ||
user-select: none; | ||
|
||
} | ||
|
||
.input:hover, .input:focus, .input-group:hover .input { | ||
outline: none; | ||
border-color: #ffffff94; | ||
} | ||
|
||
.input-group:hover .label, .input:focus { | ||
color: #ffffffc2; | ||
user-select: none; | ||
|
||
} | ||
|
||
::placeholder { | ||
|
||
font-size: 1em; | ||
color: #e7e7e9; | ||
user-select: none; | ||
|
||
} | ||
|
||
.login:focus{ | ||
background-color: #000000ac; | ||
} | ||
|
||
|
||
#error{ | ||
color: #FF0000; | ||
font-size: 2svh; | ||
user-select: none; | ||
} | ||
|
||
|
||
#error[aria-current=true]{ | ||
color: #027d00; | ||
font-size: 2svh; | ||
user-select: none; | ||
|
||
} |
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 @@ | ||
import { useEffect, useState } from "react"; | ||
import App, { AppInterface } from "../../App"; | ||
import { invoke } from "@tauri-apps/api"; | ||
import { useNavigate } from "react-router-dom"; | ||
import './sudo.css'; | ||
|
||
|
||
export default function sudo(text: string) : AppInterface{ | ||
const [name, setname] = useState(""); | ||
const [password, setpassword] = useState(""); | ||
const [error, seterror] = useState(""); | ||
const [succsess, set_succsess] = useState(false); | ||
const navigate = useNavigate(); | ||
let authenticate = async () => { | ||
let current_user = await invoke('authenticate_user', {name, password}); | ||
if (current_user){navigate("/loading", {state: {name, password}});seterror('successfully logged in!');set_succsess(true);} | ||
else{seterror('failed to authenticate user');set_succsess(false);} | ||
} | ||
let update = async () => {}; | ||
let html = <div className="frame"> | ||
<h1>{text}</h1> | ||
<label className="label">Name</label> | ||
<input type="text" onChange={e => setname(e.target.value)} className="input"/> | ||
<label className="label">Password</label> | ||
<input type="password" onKeyDown={async e => {if (e.key == 'Enter') {await authenticate()}}} | ||
onChange={e => setpassword(e.target.value)} className="input"/> | ||
<button className="learn-more" onClick={authenticate}> | ||
<span className="circle" aria-hidden="true"> | ||
<span className="icon arrow"></span> | ||
</span> | ||
<span className="button-text" onClick={authenticate}>Login</span> | ||
</button> | ||
<br></br> | ||
<p id="error" aria-current={succsess}>{error}</p> | ||
</div> | ||
let [screen, set_display, fullscreen] = App(html, 'sudo access'); | ||
return {screen, set_display, fullscreen, context_menu: <div></div>, update}; | ||
} |
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