Compare commits
2 Commits
7c139791f4
...
f5b4340daa
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f5b4340daa | ||
| c196ffc265 |
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,2 +1,4 @@
|
||||
target/
|
||||
cache/
|
||||
tokens.bin
|
||||
.auth_key
|
||||
52
frontend/pnpm-lock.yaml
generated
52
frontend/pnpm-lock.yaml
generated
@ -16,13 +16,13 @@ importers:
|
||||
version: 2.10.1
|
||||
react:
|
||||
specifier: ^19.2.1
|
||||
version: 19.2.1
|
||||
version: 19.2.3
|
||||
react-dom:
|
||||
specifier: ^19.2.1
|
||||
version: 19.2.1(react@19.2.1)
|
||||
version: 19.2.3(react@19.2.3)
|
||||
react-router-dom:
|
||||
specifier: ^7.10.1
|
||||
version: 7.10.1(react-dom@19.2.1(react@19.2.1))(react@19.2.1)
|
||||
version: 7.10.1(react-dom@19.2.3(react@19.2.3))(react@19.2.3)
|
||||
devDependencies:
|
||||
'@eslint/js':
|
||||
specifier: ^9.39.1
|
||||
@ -32,10 +32,10 @@ importers:
|
||||
version: 24.10.1
|
||||
'@types/react':
|
||||
specifier: ^19.2.7
|
||||
version: 19.2.7
|
||||
version: 19.2.8
|
||||
'@types/react-dom':
|
||||
specifier: ^19.2.3
|
||||
version: 19.2.3(@types/react@19.2.7)
|
||||
version: 19.2.3(@types/react@19.2.8)
|
||||
'@vitejs/plugin-react':
|
||||
specifier: ^5.1.2
|
||||
version: 5.1.2(rolldown-vite@7.2.5(@types/node@24.10.1))
|
||||
@ -359,8 +359,8 @@ packages:
|
||||
peerDependencies:
|
||||
'@types/react': ^19.2.0
|
||||
|
||||
'@types/react@19.2.7':
|
||||
resolution: {integrity: sha512-MWtvHrGZLFttgeEj28VXHxpmwYbor/ATPYbBfSFZEIRK0ecCFLl2Qo55z52Hss+UV9CRN7trSeq1zbgx7YDWWg==}
|
||||
'@types/react@19.2.8':
|
||||
resolution: {integrity: sha512-3MbSL37jEchWZz2p2mjntRZtPt837ij10ApxKfgmXCTuHWagYg7iA5bqPw6C8BMPfwidlvfPI/fxOc42HLhcyg==}
|
||||
|
||||
'@typescript-eslint/eslint-plugin@8.48.1':
|
||||
resolution: {integrity: sha512-X63hI1bxl5ohelzr0LY5coufyl0LJNthld+abwxpCoo6Gq+hSqhKwci7MUWkXo67mzgUK6YFByhmaHmUcuBJmA==}
|
||||
@ -425,7 +425,7 @@ packages:
|
||||
resolution: {integrity: sha512-EcA07pHJouywpzsoTUqNh5NwGayl2PPVEJKUSinGGSxFGYn+shYbqMGBg6FXDqgXum9Ou/ecb+411ssw8HImJQ==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
peerDependencies:
|
||||
vite: ^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0
|
||||
vite: npm:rolldown-vite@7.2.5
|
||||
|
||||
acorn-jsx@5.3.2:
|
||||
resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==}
|
||||
@ -863,10 +863,10 @@ packages:
|
||||
resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==}
|
||||
engines: {node: '>=6'}
|
||||
|
||||
react-dom@19.2.1:
|
||||
resolution: {integrity: sha512-ibrK8llX2a4eOskq1mXKu/TGZj9qzomO+sNfO98M6d9zIPOEhlBkMkBUBLd1vgS0gQsLDBzA+8jJBVXDnfHmJg==}
|
||||
react-dom@19.2.3:
|
||||
resolution: {integrity: sha512-yELu4WmLPw5Mr/lmeEpox5rw3RETacE++JgHqQzd2dg+YbJuat3jH4ingc+WPZhxaoFzdv9y33G+F7Nl5O0GBg==}
|
||||
peerDependencies:
|
||||
react: ^19.2.1
|
||||
react: ^19.2.3
|
||||
|
||||
react-refresh@0.18.0:
|
||||
resolution: {integrity: sha512-QgT5//D3jfjJb6Gsjxv0Slpj23ip+HtOpnNgnb2S5zU3CB26G/IDPGoy4RJB42wzFE46DRsstbW6tKHoKbhAxw==}
|
||||
@ -889,8 +889,8 @@ packages:
|
||||
react-dom:
|
||||
optional: true
|
||||
|
||||
react@19.2.1:
|
||||
resolution: {integrity: sha512-DGrYcCWK7tvYMnWh79yrPHt+vdx9tY+1gPZa7nJQtO/p8bLTDaHp4dzwEhQB7pZ4Xe3ok4XKuEPrVuc+wlpkmw==}
|
||||
react@19.2.3:
|
||||
resolution: {integrity: sha512-Ku/hhYbVjOQnXDZFv2+RibmLFGwFdeeKHFcOTlrt7xplBnya5OGn/hIRDsqDiSUcfORsDC7MPxwork8jBwsIWA==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
|
||||
resolve-from@4.0.0:
|
||||
@ -1354,11 +1354,11 @@ snapshots:
|
||||
dependencies:
|
||||
undici-types: 7.16.0
|
||||
|
||||
'@types/react-dom@19.2.3(@types/react@19.2.7)':
|
||||
'@types/react-dom@19.2.3(@types/react@19.2.8)':
|
||||
dependencies:
|
||||
'@types/react': 19.2.7
|
||||
'@types/react': 19.2.8
|
||||
|
||||
'@types/react@19.2.7':
|
||||
'@types/react@19.2.8':
|
||||
dependencies:
|
||||
csstype: 3.2.3
|
||||
|
||||
@ -1845,28 +1845,28 @@ snapshots:
|
||||
|
||||
punycode@2.3.1: {}
|
||||
|
||||
react-dom@19.2.1(react@19.2.1):
|
||||
react-dom@19.2.3(react@19.2.3):
|
||||
dependencies:
|
||||
react: 19.2.1
|
||||
react: 19.2.3
|
||||
scheduler: 0.27.0
|
||||
|
||||
react-refresh@0.18.0: {}
|
||||
|
||||
react-router-dom@7.10.1(react-dom@19.2.1(react@19.2.1))(react@19.2.1):
|
||||
react-router-dom@7.10.1(react-dom@19.2.3(react@19.2.3))(react@19.2.3):
|
||||
dependencies:
|
||||
react: 19.2.1
|
||||
react-dom: 19.2.1(react@19.2.1)
|
||||
react-router: 7.10.1(react-dom@19.2.1(react@19.2.1))(react@19.2.1)
|
||||
react: 19.2.3
|
||||
react-dom: 19.2.3(react@19.2.3)
|
||||
react-router: 7.10.1(react-dom@19.2.3(react@19.2.3))(react@19.2.3)
|
||||
|
||||
react-router@7.10.1(react-dom@19.2.1(react@19.2.1))(react@19.2.1):
|
||||
react-router@7.10.1(react-dom@19.2.3(react@19.2.3))(react@19.2.3):
|
||||
dependencies:
|
||||
cookie: 1.1.1
|
||||
react: 19.2.1
|
||||
react: 19.2.3
|
||||
set-cookie-parser: 2.7.2
|
||||
optionalDependencies:
|
||||
react-dom: 19.2.1(react@19.2.1)
|
||||
react-dom: 19.2.3(react@19.2.3)
|
||||
|
||||
react@19.2.1: {}
|
||||
react@19.2.3: {}
|
||||
|
||||
resolve-from@4.0.0: {}
|
||||
|
||||
|
||||
@ -41,6 +41,15 @@ function App() {
|
||||
_setTheme(ev.data as string);
|
||||
};
|
||||
|
||||
const addToast = useCallback((message: string, type: ToastType = "info") => {
|
||||
const id = Date.now();
|
||||
setToasts((prev) => [...prev, { id, message, type }]);
|
||||
}, []);
|
||||
|
||||
const removeToast = (id: number) => {
|
||||
setToasts((prev) => prev.filter((t) => t.id !== id));
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (theme !== "default" && theme !== "sakura") {
|
||||
document.body.classList.remove("sakura-theme");
|
||||
@ -73,15 +82,6 @@ function App() {
|
||||
return () => window.removeEventListener("unauthorized", handleUnauthorized);
|
||||
}, [addToast]);
|
||||
|
||||
const addToast = useCallback((message: string, type: ToastType = "info") => {
|
||||
const id = Date.now();
|
||||
setToasts((prev) => [...prev, { id, message, type }]);
|
||||
}, []);
|
||||
|
||||
const removeToast = (id: number) => {
|
||||
setToasts((prev) => prev.filter((t) => t.id !== id));
|
||||
};
|
||||
|
||||
const fetchPeople = () => {
|
||||
if (!token) return;
|
||||
setIsLoading(true);
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { useState } from "react";
|
||||
import { useState, useRef, useEffect } from "react";
|
||||
import { LoginRequest, LoginResponse } from "../items";
|
||||
|
||||
interface LoginProps {
|
||||
@ -6,11 +6,18 @@ interface LoginProps {
|
||||
}
|
||||
|
||||
export function Login({ onLogin }: LoginProps) {
|
||||
const usernameInputRef = useRef<HTMLInputElement>(null);
|
||||
const [username, setUsername] = useState("");
|
||||
const [password, setPassword] = useState("");
|
||||
const [error, setError] = useState("");
|
||||
const [isSubmitting, setIsSubmitting] = useState(false);
|
||||
const [fieldErrors, setFieldErrors] = useState<{ username?: string, password?: string }>({});
|
||||
const [isSuccess, setIsSuccess] = useState(false);
|
||||
const [shakeCard, setShakeCard] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
usernameInputRef.current?.focus();
|
||||
}, []);
|
||||
|
||||
const validateForm = () => {
|
||||
const errors: { username?: string, password?: string } = {};
|
||||
@ -24,7 +31,11 @@ export function Login({ onLogin }: LoginProps) {
|
||||
e.preventDefault();
|
||||
setError("");
|
||||
|
||||
if (!validateForm()) return;
|
||||
if (!validateForm()) {
|
||||
setShakeCard(true);
|
||||
setTimeout(() => setShakeCard(false), 500);
|
||||
return;
|
||||
}
|
||||
|
||||
setIsSubmitting(true);
|
||||
|
||||
@ -44,45 +55,232 @@ export function Login({ onLogin }: LoginProps) {
|
||||
const response = LoginResponse.decode(new Uint8Array(buffer));
|
||||
|
||||
if (response.success) {
|
||||
setIsSuccess(true);
|
||||
onLogin(response.token);
|
||||
} else {
|
||||
setError(response.message || "Login failed");
|
||||
setShakeCard(true);
|
||||
setTimeout(() => setShakeCard(false), 500);
|
||||
}
|
||||
} catch (err) {
|
||||
console.error("Login error:", err);
|
||||
setError("An unexpected error occurred. Please try again.");
|
||||
setShakeCard(true);
|
||||
setTimeout(() => setShakeCard(false), 500);
|
||||
} finally {
|
||||
setIsSubmitting(false);
|
||||
}
|
||||
};
|
||||
|
||||
const handleKeyDown = (e: React.KeyboardEvent) => {
|
||||
if (e.key === "Enter") {
|
||||
handleSubmit(e);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="card" style={{ maxWidth: "400px", margin: "4rem auto" }}>
|
||||
<h2 style={{ textAlign: "center", marginBottom: "2rem" }}>🎮 Login</h2>
|
||||
<div
|
||||
className="card login-card"
|
||||
style={{
|
||||
maxWidth: "420px",
|
||||
margin: "6rem auto",
|
||||
padding: "2.5rem",
|
||||
background: "linear-gradient(135deg, var(--secondary-bg) 0%, var(--secondary-alt-bg) 100%)",
|
||||
position: "relative"
|
||||
}}
|
||||
>
|
||||
{isSubmitting && (
|
||||
<div
|
||||
style={{
|
||||
position: "absolute",
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
||||
borderRadius: "16px",
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
zIndex: 10,
|
||||
backdropFilter: "blur(2px)"
|
||||
}}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
width: "48px",
|
||||
height: "48px",
|
||||
border: "4px solid rgba(255, 255, 255, 0.2)",
|
||||
borderTopColor: "white",
|
||||
borderRadius: "50%",
|
||||
animation: "spin 0.8s linear infinite"
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{isSuccess && (
|
||||
<div
|
||||
style={{
|
||||
position: "absolute",
|
||||
top: "50%",
|
||||
left: "50%",
|
||||
transform: "translate(-50%, -50%)",
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
alignItems: "center",
|
||||
gap: "1rem",
|
||||
animation: "fadeInScale 0.5s ease forwards",
|
||||
zIndex: 10
|
||||
}}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
width: "64px",
|
||||
height: "64px",
|
||||
borderRadius: "50%",
|
||||
backgroundColor: "#4caf50",
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
fontSize: "2rem",
|
||||
color: "white",
|
||||
boxShadow: "0 0 20px rgba(76, 175, 80, 0.5)"
|
||||
}}
|
||||
>
|
||||
✓
|
||||
</div>
|
||||
<span style={{ color: "#4caf50", fontWeight: 600, fontSize: "1.1rem" }}>
|
||||
Success!
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<h2
|
||||
style={{
|
||||
textAlign: "center",
|
||||
marginBottom: "0.5rem",
|
||||
fontSize: "2rem",
|
||||
fontWeight: 700
|
||||
}}
|
||||
>
|
||||
🎮 Login
|
||||
</h2>
|
||||
<p
|
||||
style={{
|
||||
textAlign: "center",
|
||||
color: "var(--text-muted)",
|
||||
marginBottom: "2rem",
|
||||
fontSize: "0.95rem"
|
||||
}}
|
||||
>
|
||||
Welcome back! Please sign in to continue.
|
||||
</p>
|
||||
|
||||
<form onSubmit={handleSubmit} className="form-group">
|
||||
<div className="form-group">
|
||||
<label>Username</label>
|
||||
<div className="form-group" style={{ marginBottom: "1.5rem" }}>
|
||||
<label
|
||||
style={{
|
||||
display: "block",
|
||||
marginBottom: "0.5rem",
|
||||
fontWeight: 500,
|
||||
color: "var(--text-color)",
|
||||
fontSize: "0.95rem"
|
||||
}}
|
||||
>
|
||||
Username
|
||||
</label>
|
||||
<div
|
||||
style={{
|
||||
position: "relative",
|
||||
display: "flex",
|
||||
alignItems: "center"
|
||||
}}
|
||||
>
|
||||
<span
|
||||
style={{
|
||||
position: "absolute",
|
||||
left: "0.75rem",
|
||||
color: "var(--text-muted)",
|
||||
pointerEvents: "none",
|
||||
fontSize: "1.1rem"
|
||||
}}
|
||||
>
|
||||
👤
|
||||
</span>
|
||||
<input
|
||||
ref={usernameInputRef}
|
||||
type="text"
|
||||
value={username}
|
||||
onChange={(e) => {
|
||||
setUsername(e.target.value);
|
||||
if (fieldErrors.username) setFieldErrors({ ...fieldErrors, username: undefined });
|
||||
}}
|
||||
onKeyDown={handleKeyDown}
|
||||
placeholder="Enter your username"
|
||||
aria-label="Username"
|
||||
aria-invalid={!!fieldErrors.username}
|
||||
aria-describedby={fieldErrors.username ? "username-error" : undefined}
|
||||
style={{
|
||||
width: "100%",
|
||||
paddingLeft: "2.75rem",
|
||||
paddingRight: "0.75rem",
|
||||
paddingTop: "0.75rem",
|
||||
paddingBottom: "0.75rem",
|
||||
borderColor: fieldErrors.username ? "#f44336" : undefined,
|
||||
borderWidth: fieldErrors.username ? "2px" : undefined
|
||||
borderWidth: fieldErrors.username ? "2px" : "1px",
|
||||
fontSize: "1rem"
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
{fieldErrors.username && (
|
||||
<span style={{ color: "#f44336", fontSize: "0.85rem", marginTop: "0.25rem", display: "block" }}>
|
||||
{fieldErrors.username}
|
||||
<span
|
||||
id="username-error"
|
||||
role="alert"
|
||||
style={{
|
||||
color: "#ff6b6b",
|
||||
fontSize: "0.85rem",
|
||||
marginTop: "0.5rem",
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
gap: "0.25rem"
|
||||
}}
|
||||
>
|
||||
⚠️ {fieldErrors.username}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
<div className="form-group">
|
||||
<label>Password</label>
|
||||
|
||||
<div className="form-group" style={{ marginBottom: "2rem" }}>
|
||||
<label
|
||||
style={{
|
||||
display: "block",
|
||||
marginBottom: "0.5rem",
|
||||
fontWeight: 500,
|
||||
color: "var(--text-color)",
|
||||
fontSize: "0.95rem"
|
||||
}}
|
||||
>
|
||||
Password
|
||||
</label>
|
||||
<div
|
||||
style={{
|
||||
position: "relative",
|
||||
display: "flex",
|
||||
alignItems: "center"
|
||||
}}
|
||||
>
|
||||
<span
|
||||
style={{
|
||||
position: "absolute",
|
||||
left: "0.75rem",
|
||||
color: "var(--text-muted)",
|
||||
pointerEvents: "none",
|
||||
fontSize: "1.1rem"
|
||||
}}
|
||||
>
|
||||
🔒
|
||||
</span>
|
||||
<input
|
||||
type="password"
|
||||
value={password}
|
||||
@ -90,64 +288,131 @@ export function Login({ onLogin }: LoginProps) {
|
||||
setPassword(e.target.value);
|
||||
if (fieldErrors.password) setFieldErrors({ ...fieldErrors, password: undefined });
|
||||
}}
|
||||
onKeyDown={handleKeyDown}
|
||||
placeholder="Enter your password"
|
||||
aria-label="Password"
|
||||
aria-invalid={!!fieldErrors.password}
|
||||
aria-describedby={fieldErrors.password ? "password-error" : undefined}
|
||||
style={{
|
||||
width: "100%",
|
||||
paddingLeft: "2.75rem",
|
||||
paddingRight: "0.75rem",
|
||||
paddingTop: "0.75rem",
|
||||
paddingBottom: "0.75rem",
|
||||
borderColor: fieldErrors.password ? "#f44336" : undefined,
|
||||
borderWidth: fieldErrors.password ? "2px" : undefined
|
||||
borderWidth: fieldErrors.password ? "2px" : "1px",
|
||||
fontSize: "1rem"
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
{fieldErrors.password && (
|
||||
<span style={{ color: "#f44336", fontSize: "0.85rem", marginTop: "0.25rem", display: "block" }}>
|
||||
{fieldErrors.password}
|
||||
<span
|
||||
id="password-error"
|
||||
role="alert"
|
||||
style={{
|
||||
color: "#ff6b6b",
|
||||
fontSize: "0.85rem",
|
||||
marginTop: "0.5rem",
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
gap: "0.25rem"
|
||||
}}
|
||||
>
|
||||
⚠️ {fieldErrors.password}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
style={{ marginTop: "1rem", width: "100%", opacity: isSubmitting ? 0.7 : 1, cursor: isSubmitting ? "not-allowed" : "pointer" }}
|
||||
disabled={isSubmitting}
|
||||
>
|
||||
{isSubmitting ? (
|
||||
<>
|
||||
<span
|
||||
style={{
|
||||
width: "14px",
|
||||
height: "14px",
|
||||
border: "2px solid rgba(255,255,255,0.3)",
|
||||
borderTopColor: "white",
|
||||
borderRadius: "50%",
|
||||
animation: "spin 0.8s linear infinite",
|
||||
display: "inline-block",
|
||||
marginRight: "0.5rem"
|
||||
marginTop: "0.5rem",
|
||||
width: "100%",
|
||||
padding: "0.875rem",
|
||||
fontSize: "1rem",
|
||||
fontWeight: 600,
|
||||
opacity: isSubmitting ? 0.7 : 1,
|
||||
cursor: isSubmitting ? "not-allowed" : "pointer",
|
||||
background: "linear-gradient(135deg, var(--accent-color) 0%, var(--secondary-accent) 100%)",
|
||||
border: "none",
|
||||
transition: "transform 0.1s, box-shadow 0.2s"
|
||||
}}
|
||||
></span>
|
||||
Logging in...
|
||||
</>
|
||||
) : (
|
||||
"Login"
|
||||
)}
|
||||
disabled={isSubmitting}
|
||||
onMouseEnter={(e) => {
|
||||
if (!isSubmitting) {
|
||||
e.currentTarget.style.transform = "translateY(-1px)";
|
||||
e.currentTarget.style.boxShadow = "0 4px 12px rgba(9, 109, 192, 0.4)";
|
||||
}
|
||||
}}
|
||||
onMouseLeave={(e) => {
|
||||
if (!isSubmitting) {
|
||||
e.currentTarget.style.transform = "translateY(0)";
|
||||
e.currentTarget.style.boxShadow = "none";
|
||||
}
|
||||
}}
|
||||
onMouseDown={(e) => {
|
||||
if (!isSubmitting) {
|
||||
e.currentTarget.style.transform = "translateY(0)";
|
||||
}
|
||||
}}
|
||||
>
|
||||
Login
|
||||
</button>
|
||||
</form>
|
||||
|
||||
{error && (
|
||||
<div
|
||||
role="alert"
|
||||
style={{
|
||||
backgroundColor: "rgba(244, 67, 54, 0.1)",
|
||||
border: "1px solid rgba(244, 67, 54, 0.3)",
|
||||
backgroundColor: "rgba(244, 67, 54, 0.15)",
|
||||
border: "1px solid rgba(244, 67, 54, 0.4)",
|
||||
color: "#ff6b6b",
|
||||
padding: "1rem",
|
||||
padding: "0.875rem 1rem",
|
||||
borderRadius: "8px",
|
||||
marginTop: "1rem",
|
||||
marginTop: "1.5rem",
|
||||
textAlign: "center",
|
||||
fontSize: "0.9rem"
|
||||
fontSize: "0.9rem",
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
gap: "0.5rem"
|
||||
}}
|
||||
>
|
||||
⚠️ {error}
|
||||
</div>
|
||||
)}
|
||||
|
||||
<style>{`
|
||||
@keyframes spin {
|
||||
to { transform: rotate(360deg); }
|
||||
}
|
||||
|
||||
@keyframes fadeInScale {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translate(-50%, -40%) scale(0.8);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translate(-50%, -50%) scale(1);
|
||||
}
|
||||
}
|
||||
|
||||
.login-card {
|
||||
animation: ${shakeCard ? "shake 0.5s ease" : "none"};
|
||||
}
|
||||
|
||||
@keyframes shake {
|
||||
0%, 100% {
|
||||
transform: translateX(0);
|
||||
}
|
||||
20%, 60% {
|
||||
transform: translateX(-8px);
|
||||
}
|
||||
40%, 80% {
|
||||
transform: translateX(8px);
|
||||
}
|
||||
}
|
||||
`}</style>
|
||||
</div>
|
||||
);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user