update ui
This commit is contained in:
1 parent
7674f12c5e
commit
d3a5df6387
9 files changed
+1476
-1317
No files matched your search
Generated
+807
-915
File diff suppressed because it is too large.
Load diff
@@ -9,7 +9,12 @@
|
|||||||
"lint": "next lint"
|
"lint": "next lint"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"lucide-react": "^0.474.0",
|
"@emotion/cache": "^11.14.0",
|
||||||
|
"@emotion/react": "^11.14.0",
|
||||||
|
"@emotion/styled": "^11.14.1",
|
||||||
|
"@mui/icons-material": "^7.3.9",
|
||||||
|
"@mui/material": "^7.3.9",
|
||||||
|
"@mui/material-nextjs": "^7.3.9",
|
||||||
"next": "^16.1.6",
|
"next": "^16.1.6",
|
||||||
"react": "^19.2.4",
|
"react": "^19.2.4",
|
||||||
"react-dom": "^19.2.4"
|
"react-dom": "^19.2.4"
|
||||||
@@ -18,9 +23,6 @@
|
|||||||
"@types/node": "^20",
|
"@types/node": "^20",
|
||||||
"@types/react": "^19",
|
"@types/react": "^19",
|
||||||
"@types/react-dom": "^19",
|
"@types/react-dom": "^19",
|
||||||
"autoprefixer": "^10.0.1",
|
|
||||||
"postcss": "^8",
|
|
||||||
"tailwindcss": "^3.4.1",
|
|
||||||
"typescript": "^5"
|
"typescript": "^5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
/** @type {import('postcss-load-config').Config} */
|
|
||||||
const config = {
|
|
||||||
plugins: {
|
|
||||||
tailwindcss: {},
|
|
||||||
autoprefixer: {},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export default config;
|
|
||||||
@@ -1,19 +1,21 @@
|
|||||||
@tailwind base;
|
|
||||||
@tailwind components;
|
|
||||||
@tailwind utilities;
|
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
--background: #282828;
|
color-scheme: dark;
|
||||||
--foreground: #ebdbb2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
* {
|
* {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
html,
|
||||||
body {
|
body {
|
||||||
background: var(--background);
|
height: 100%;
|
||||||
color: var(--foreground);
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
background: #282828;
|
||||||
|
color: #ebdbb2;
|
||||||
-webkit-font-smoothing: antialiased;
|
-webkit-font-smoothing: antialiased;
|
||||||
-moz-osx-font-smoothing: grayscale;
|
-moz-osx-font-smoothing: grayscale;
|
||||||
}
|
}
|
||||||
@@ -23,19 +25,7 @@ body {
|
|||||||
color: #ebdbb2;
|
color: #ebdbb2;
|
||||||
}
|
}
|
||||||
|
|
||||||
::-webkit-scrollbar {
|
a {
|
||||||
width: 6px;
|
color: inherit;
|
||||||
}
|
text-decoration: none;
|
||||||
|
|
||||||
::-webkit-scrollbar-track {
|
|
||||||
background: #1d2021;
|
|
||||||
}
|
|
||||||
|
|
||||||
::-webkit-scrollbar-thumb {
|
|
||||||
background: #504945;
|
|
||||||
border-radius: 3px;
|
|
||||||
}
|
|
||||||
|
|
||||||
::-webkit-scrollbar-thumb:hover {
|
|
||||||
background: #665c54;
|
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,14 @@
|
|||||||
import type { Metadata } from "next";
|
import type { Metadata } from "next";
|
||||||
import { Geist } from "next/font/google";
|
import { Roboto } from "next/font/google";
|
||||||
import "./globals.css";
|
import "./globals.css";
|
||||||
|
|
||||||
const geist = Geist({ subsets: ["latin"] });
|
import Providers from "./providers";
|
||||||
|
|
||||||
|
const roboto = Roboto({
|
||||||
|
subsets: ["latin"],
|
||||||
|
weight: ["300", "400", "500", "700"],
|
||||||
|
variable: "--font-roboto",
|
||||||
|
});
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: "File Host",
|
title: "File Host",
|
||||||
@@ -16,7 +22,9 @@ export default function RootLayout({
|
|||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<body className={geist.className}>{children}</body>
|
<body className={roboto.variable}>
|
||||||
|
<Providers>{children}</Providers>
|
||||||
|
</body>
|
||||||
</html>
|
</html>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
+410
-342
@@ -1,15 +1,26 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
|
import CheckCircleIcon from "@mui/icons-material/CheckCircle";
|
||||||
|
import CloudUploadIcon from "@mui/icons-material/CloudUpload";
|
||||||
|
import ContentCopyIcon from "@mui/icons-material/ContentCopy";
|
||||||
|
import ErrorOutlineIcon from "@mui/icons-material/ErrorOutline";
|
||||||
|
import LockIcon from "@mui/icons-material/Lock";
|
||||||
|
import OpenInNewIcon from "@mui/icons-material/OpenInNew";
|
||||||
|
import ReplayIcon from "@mui/icons-material/Replay";
|
||||||
import {
|
import {
|
||||||
AlertCircle,
|
Alert,
|
||||||
CheckCircle2,
|
Box,
|
||||||
Copy,
|
Button,
|
||||||
ExternalLink,
|
Card,
|
||||||
Lock,
|
Chip,
|
||||||
RotateCcw,
|
Divider,
|
||||||
Upload,
|
LinearProgress,
|
||||||
} from "lucide-react";
|
Stack,
|
||||||
import { ChangeEvent, DragEvent, useCallback, useRef, useState } from "react";
|
TextField,
|
||||||
|
Typography,
|
||||||
|
} from "@mui/material";
|
||||||
|
import type { ChangeEvent, DragEvent } from "react";
|
||||||
|
import { useCallback, useEffect, useRef, useState } from "react";
|
||||||
|
|
||||||
type Status = "idle" | "authenticated" | "uploading" | "done";
|
type Status = "idle" | "authenticated" | "uploading" | "done";
|
||||||
|
|
||||||
@@ -23,12 +34,16 @@ export default function Home() {
|
|||||||
const [errorMessage, setErrorMessage] = useState("");
|
const [errorMessage, setErrorMessage] = useState("");
|
||||||
const [copied, setCopied] = useState(false);
|
const [copied, setCopied] = useState(false);
|
||||||
const [pendingFileName, setPendingFileName] = useState("");
|
const [pendingFileName, setPendingFileName] = useState("");
|
||||||
|
const [uploadedFile, setUploadedFile] = useState<{
|
||||||
|
name: string;
|
||||||
|
type: string;
|
||||||
|
size: number;
|
||||||
|
previewUrl?: string;
|
||||||
|
} | null>(null);
|
||||||
|
|
||||||
const fileInputRef = useRef<HTMLInputElement>(null);
|
const fileInputRef = useRef<HTMLInputElement>(null);
|
||||||
const preUploadStatus = useRef<"idle" | "authenticated">("idle");
|
const preUploadStatus = useRef<"idle" | "authenticated">("idle");
|
||||||
|
|
||||||
// ── Auth ──────────────────────────────────────────────────────────────────
|
|
||||||
|
|
||||||
const handleUnlock = async () => {
|
const handleUnlock = async () => {
|
||||||
if (!password.trim()) return;
|
if (!password.trim()) return;
|
||||||
const body = new URLSearchParams({ password });
|
const body = new URLSearchParams({ password });
|
||||||
@@ -41,8 +56,6 @@ export default function Home() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// ── Upload ────────────────────────────────────────────────────────────────
|
|
||||||
|
|
||||||
const uploadFile = useCallback(
|
const uploadFile = useCallback(
|
||||||
(file: File) => {
|
(file: File) => {
|
||||||
preUploadStatus.current =
|
preUploadStatus.current =
|
||||||
@@ -53,6 +66,16 @@ export default function Home() {
|
|||||||
setErrorMessage("");
|
setErrorMessage("");
|
||||||
setPendingFileName(file.name);
|
setPendingFileName(file.name);
|
||||||
|
|
||||||
|
const isPreviewable =
|
||||||
|
file.type.startsWith("image/") || file.type.startsWith("video/");
|
||||||
|
const previewUrl = isPreviewable ? URL.createObjectURL(file) : undefined;
|
||||||
|
setUploadedFile({
|
||||||
|
name: file.name,
|
||||||
|
type: file.type || "application/octet-stream",
|
||||||
|
size: file.size,
|
||||||
|
previewUrl,
|
||||||
|
});
|
||||||
|
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
formData.append("file", file);
|
formData.append("file", file);
|
||||||
if (status === "authenticated") {
|
if (status === "authenticated") {
|
||||||
@@ -63,9 +86,6 @@ export default function Home() {
|
|||||||
|
|
||||||
xhr.upload.onprogress = (e) => {
|
xhr.upload.onprogress = (e) => {
|
||||||
if (e.lengthComputable) {
|
if (e.lengthComputable) {
|
||||||
// Cap at 99 — the final 100 is set only once the server responds,
|
|
||||||
// because the file is still being streamed to R2 after the browser
|
|
||||||
// finishes sending bytes.
|
|
||||||
setProgress(Math.min(99, Math.round((e.loaded / e.total) * 100)));
|
setProgress(Math.min(99, Math.round((e.loaded / e.total) * 100)));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -103,9 +123,6 @@ export default function Home() {
|
|||||||
setStatus(preUploadStatus.current);
|
setStatus(preUploadStatus.current);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Explicitly set responseType to "text" so Firefox does not attempt to
|
|
||||||
// parse the JSON response body as XML (which would log a benign but
|
|
||||||
// confusing "XML Parsing Error" in the console).
|
|
||||||
xhr.responseType = "text";
|
xhr.responseType = "text";
|
||||||
xhr.open("POST", "/api/upload");
|
xhr.open("POST", "/api/upload");
|
||||||
xhr.send(formData);
|
xhr.send(formData);
|
||||||
@@ -113,8 +130,6 @@ export default function Home() {
|
|||||||
[status, password],
|
[status, password],
|
||||||
);
|
);
|
||||||
|
|
||||||
// ── Drag and drop ─────────────────────────────────────────────────────────
|
|
||||||
|
|
||||||
const handleDragOver = useCallback(
|
const handleDragOver = useCallback(
|
||||||
(e: DragEvent<HTMLDivElement>) => {
|
(e: DragEvent<HTMLDivElement>) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@@ -149,28 +164,21 @@ export default function Home() {
|
|||||||
[uploadFile],
|
[uploadFile],
|
||||||
);
|
);
|
||||||
|
|
||||||
// ── Copy ──────────────────────────────────────────────────────────────────
|
|
||||||
|
|
||||||
const handleCopy = async () => {
|
const handleCopy = async () => {
|
||||||
await navigator.clipboard.writeText(resultUrl);
|
await navigator.clipboard.writeText(resultUrl);
|
||||||
setCopied(true);
|
setCopied(true);
|
||||||
setTimeout(() => setCopied(false), 2000);
|
setTimeout(() => setCopied(false), 2000);
|
||||||
};
|
};
|
||||||
|
|
||||||
// ── Helpers ───────────────────────────────────────────────────────────────
|
|
||||||
|
|
||||||
const isAuthenticated = status === "authenticated";
|
const isAuthenticated = status === "authenticated";
|
||||||
const isUploading = status === "uploading";
|
const isUploading = status === "uploading";
|
||||||
const isInteractable = status !== "uploading";
|
const isInteractable = status !== "uploading";
|
||||||
|
|
||||||
// Show the auth badge when authenticated, or when uploading/done from an
|
|
||||||
// authenticated session (preUploadStatus tells us what we came from).
|
|
||||||
const showAuthBadge =
|
const showAuthBadge =
|
||||||
status === "authenticated" ||
|
status === "authenticated" ||
|
||||||
((status === "uploading" || status === "done") &&
|
((status === "uploading" || status === "done") &&
|
||||||
preUploadStatus.current === "authenticated");
|
preUploadStatus.current === "authenticated");
|
||||||
|
|
||||||
// Show the auth row at all when there is something to render inside it.
|
|
||||||
const showAuthRow = status === "idle" || showAuthBadge;
|
const showAuthRow = status === "idle" || showAuthBadge;
|
||||||
|
|
||||||
const limitLabel =
|
const limitLabel =
|
||||||
@@ -178,337 +186,397 @@ export default function Home() {
|
|||||||
? "250 MB"
|
? "250 MB"
|
||||||
: "50 MB";
|
: "50 MB";
|
||||||
|
|
||||||
// ── Render ────────────────────────────────────────────────────────────────
|
const formatBytes = (bytes: number) => {
|
||||||
|
if (!Number.isFinite(bytes)) return "—";
|
||||||
|
if (bytes === 0) return "0 B";
|
||||||
|
const k = 1024;
|
||||||
|
const sizes = ["B", "KB", "MB", "GB", "TB"];
|
||||||
|
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
||||||
|
const value = bytes / Math.pow(k, i);
|
||||||
|
return `${value.toFixed(value >= 10 ? 0 : 1)} ${sizes[i]}`;
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
return () => {
|
||||||
|
if (uploadedFile?.previewUrl) {
|
||||||
|
URL.revokeObjectURL(uploadedFile.previewUrl);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}, [uploadedFile]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<main
|
<Box
|
||||||
className="min-h-screen flex flex-col items-center justify-center px-4 py-12"
|
component="main"
|
||||||
style={{
|
sx={{
|
||||||
background: "#282828",
|
minHeight: "100vh",
|
||||||
paddingTop: "max(3rem, env(safe-area-inset-top))",
|
display: "flex",
|
||||||
paddingBottom: "max(3rem, env(safe-area-inset-bottom))",
|
alignItems: "center",
|
||||||
|
justifyContent: "center",
|
||||||
|
px: { xs: 2, md: 4 },
|
||||||
|
py: { xs: 3, md: 6 },
|
||||||
|
backgroundColor: "background.default",
|
||||||
|
fontFamily:
|
||||||
|
"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div className="w-full max-w-sm">
|
<Box sx={{ width: "100%", maxWidth: 980 }}>
|
||||||
{/* ── Header ─────────────────────────────────────────────────────── */}
|
<Stack spacing={2.5}>
|
||||||
<div className="flex flex-col items-center text-center mb-8 gap-3">
|
<Stack
|
||||||
<div
|
direction={{ xs: "column", sm: "row" }}
|
||||||
className="w-12 h-12 rounded-[14px] flex items-center justify-center"
|
alignItems={{ xs: "flex-start", sm: "center" }}
|
||||||
style={{
|
justifyContent="space-between"
|
||||||
background: "#3c3836",
|
spacing={2}
|
||||||
border: "1px solid #504945",
|
sx={{
|
||||||
|
px: { xs: 1.5, sm: 2 },
|
||||||
|
py: { xs: 1, sm: 1.5 },
|
||||||
|
border: "1px solid",
|
||||||
|
borderColor: "divider",
|
||||||
|
borderRadius: 0,
|
||||||
|
backgroundColor: "background.paper",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Upload
|
<Stack direction="row" spacing={1.5} alignItems="center">
|
||||||
className="w-5 h-5"
|
<Box
|
||||||
style={{ color: "#d79921" }}
|
sx={{
|
||||||
strokeWidth={1.75}
|
width: 10,
|
||||||
/>
|
height: 10,
|
||||||
</div>
|
borderRadius: "50%",
|
||||||
<div>
|
backgroundColor: "success.main",
|
||||||
<h1
|
boxShadow: "0 0 10px rgba(34, 197, 94, 0.6)",
|
||||||
className="text-[22px] font-semibold tracking-tight leading-snug"
|
}}
|
||||||
style={{ color: "#ebdbb2" }}
|
/>
|
||||||
>
|
<Typography variant="body2" sx={{ letterSpacing: "0.08em" }}>
|
||||||
filehost
|
filehost
|
||||||
</h1>
|
</Typography>
|
||||||
<p className="text-[13px] mt-0.5" style={{ color: "#a89984" }}>
|
</Stack>
|
||||||
|
<Typography variant="caption" color="text.secondary">
|
||||||
{limitLabel} max · expires in 24 h
|
{limitLabel} max · expires in 24 h
|
||||||
</p>
|
</Typography>
|
||||||
</div>
|
</Stack>
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* ── Card ───────────────────────────────────────────────────────── */}
|
<Box
|
||||||
<div
|
sx={{
|
||||||
className="rounded-2xl overflow-hidden"
|
display: "grid",
|
||||||
style={{ background: "#32302f", border: "1px solid #504945" }}
|
gridTemplateColumns: { xs: "1fr", md: "1.3fr 0.9fr" },
|
||||||
>
|
gap: 2,
|
||||||
{/* Auth row */}
|
}}
|
||||||
{showAuthRow && (
|
>
|
||||||
<div
|
<Card>
|
||||||
className="px-5 pt-5 pb-5"
|
<Box
|
||||||
style={{ borderBottom: "1px solid #504945" }}
|
sx={{
|
||||||
>
|
px: 2.5,
|
||||||
{showAuthBadge ? (
|
py: 1.25,
|
||||||
<div className="flex items-center gap-2.5 py-0.5">
|
borderBottom: "1px solid",
|
||||||
<div
|
borderColor: "divider",
|
||||||
className="w-2 h-2 rounded-full shrink-0"
|
backgroundColor: "background.default",
|
||||||
style={{ background: "#b8bb26" }}
|
}}
|
||||||
/>
|
>
|
||||||
<span
|
<Typography
|
||||||
className="text-[14px] font-medium"
|
variant="caption"
|
||||||
style={{ color: "#b8bb26" }}
|
sx={{ letterSpacing: "0.2em", color: "text.secondary" }}
|
||||||
>
|
>
|
||||||
Authenticated · 250 MB limit
|
UPLOAD_BUFFER
|
||||||
</span>
|
</Typography>
|
||||||
</div>
|
</Box>
|
||||||
) : (
|
<Box sx={{ px: { xs: 2, md: 3 }, py: { xs: 2.5, md: 3 } }}>
|
||||||
/* status === "idle" — show the optional unlock form */
|
{isUploading ? (
|
||||||
<div className="flex flex-col gap-3">
|
<Stack spacing={2}>
|
||||||
<label
|
<Stack direction="row" spacing={2} alignItems="center">
|
||||||
className="text-[13px] font-medium"
|
<Box
|
||||||
style={{ color: "#a89984" }}
|
sx={{
|
||||||
>
|
width: 36,
|
||||||
Password{" "}
|
height: 36,
|
||||||
<span style={{ color: "#665c54" }} className="font-normal">
|
borderRadius: 2,
|
||||||
— optional, unlocks 250 MB
|
display: "grid",
|
||||||
</span>
|
placeItems: "center",
|
||||||
</label>
|
backgroundColor: "action.selected",
|
||||||
<input
|
}}
|
||||||
type="password"
|
>
|
||||||
value={password}
|
<CloudUploadIcon fontSize="small" />
|
||||||
onChange={(e) => {
|
</Box>
|
||||||
setPassword(e.target.value);
|
<Box sx={{ flex: 1, minWidth: 0 }}>
|
||||||
setPasswordError(false);
|
<Typography
|
||||||
}}
|
variant="body2"
|
||||||
onKeyDown={(e) => e.key === "Enter" && handleUnlock()}
|
sx={{ fontWeight: 600 }}
|
||||||
placeholder="Enter password"
|
noWrap
|
||||||
className={[
|
>
|
||||||
"w-full h-11 px-3.5 rounded-xl text-[15px] outline-none",
|
{pendingFileName}
|
||||||
"border transition-all duration-150",
|
</Typography>
|
||||||
passwordError ? "ring-2" : "",
|
</Box>
|
||||||
].join(" ")}
|
<Typography variant="caption" color="text.secondary">
|
||||||
style={{
|
{progress}%
|
||||||
background: "#1d2021",
|
</Typography>
|
||||||
color: "#ebdbb2",
|
</Stack>
|
||||||
caretColor: "#d79921",
|
<LinearProgress variant="determinate" value={progress} />
|
||||||
borderColor: passwordError ? "#fb4934" : "#504945",
|
</Stack>
|
||||||
boxShadow: passwordError
|
) : status === "done" && resultUrl ? (
|
||||||
? "0 0 0 2px rgba(251,73,52,0.2)"
|
<Stack spacing={2}>
|
||||||
: undefined,
|
<Stack direction="row" spacing={1} alignItems="center">
|
||||||
}}
|
<CheckCircleIcon color="success" fontSize="small" />
|
||||||
onFocus={(e) => {
|
<Typography variant="body2" sx={{ fontWeight: 600 }}>
|
||||||
if (!passwordError)
|
Transfer complete
|
||||||
(e.target as HTMLInputElement).style.borderColor =
|
</Typography>
|
||||||
"#d79921";
|
</Stack>
|
||||||
}}
|
<Button
|
||||||
onBlur={(e) => {
|
size="small"
|
||||||
if (!passwordError)
|
color="inherit"
|
||||||
(e.target as HTMLInputElement).style.borderColor =
|
startIcon={<ReplayIcon />}
|
||||||
"#504945";
|
onClick={() => {
|
||||||
}}
|
setResultUrl("");
|
||||||
/>
|
setErrorMessage("");
|
||||||
{passwordError && (
|
setUploadedFile(null);
|
||||||
<p
|
setStatus(isAuthenticated ? "authenticated" : "idle");
|
||||||
className="text-[12px] -mt-1"
|
}}
|
||||||
style={{ color: "#fb4934" }}
|
|
||||||
>
|
>
|
||||||
Incorrect password.
|
Upload another
|
||||||
</p>
|
</Button>
|
||||||
)}
|
</Stack>
|
||||||
<button
|
) : (
|
||||||
onClick={handleUnlock}
|
<Box
|
||||||
className="w-full h-11 rounded-xl text-[15px] font-semibold tracking-tight transition-opacity active:opacity-75 select-none flex items-center justify-center gap-2"
|
onDragOver={handleDragOver}
|
||||||
style={{ background: "#d79921", color: "#1d2021" }}
|
onDragLeave={handleDragLeave}
|
||||||
>
|
onDrop={handleDrop}
|
||||||
<Lock className="w-3.5 h-3.5" strokeWidth={2.5} />
|
onClick={() =>
|
||||||
Unlock 250 MB
|
isInteractable && fileInputRef.current?.click()
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{/* Upload / progress / result */}
|
|
||||||
<div className="px-5 py-5 flex flex-col gap-4">
|
|
||||||
{isUploading ? (
|
|
||||||
/* ── Uploading ─────────────────────────────────────────────── */
|
|
||||||
<div className="flex flex-col gap-3 py-1">
|
|
||||||
<div className="flex items-center gap-3">
|
|
||||||
<div
|
|
||||||
className="w-9 h-9 rounded-[10px] flex items-center justify-center shrink-0"
|
|
||||||
style={{ background: "#3c3836" }}
|
|
||||||
>
|
|
||||||
<Upload
|
|
||||||
className="w-4 h-4"
|
|
||||||
style={{ color: "#a89984" }}
|
|
||||||
strokeWidth={1.75}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<p
|
|
||||||
className="text-[14px] font-medium truncate flex-1 min-w-0"
|
|
||||||
style={{ color: "#ebdbb2" }}
|
|
||||||
>
|
|
||||||
{pendingFileName}
|
|
||||||
</p>
|
|
||||||
<span
|
|
||||||
className="text-[13px] tabular-nums shrink-0 ml-2"
|
|
||||||
style={{ color: "#a89984" }}
|
|
||||||
>
|
|
||||||
{progress}%
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
className="h-[3px] w-full rounded-full overflow-hidden"
|
|
||||||
style={{ background: "#3c3836" }}
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
className="h-full rounded-full transition-all duration-300 ease-out"
|
|
||||||
style={{ width: `${progress}%`, background: "#d79921" }}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
) : status === "done" && resultUrl ? (
|
|
||||||
/* ── Done ─────────────────────────────────────────────────── */
|
|
||||||
<div className="flex flex-col gap-3">
|
|
||||||
<div className="flex items-center gap-2">
|
|
||||||
<CheckCircle2
|
|
||||||
className="w-4 h-4 shrink-0"
|
|
||||||
style={{ color: "#b8bb26" }}
|
|
||||||
strokeWidth={2}
|
|
||||||
/>
|
|
||||||
<span
|
|
||||||
className="text-[14px] font-medium"
|
|
||||||
style={{ color: "#ebdbb2" }}
|
|
||||||
>
|
|
||||||
Upload complete
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<input
|
|
||||||
readOnly
|
|
||||||
value={resultUrl}
|
|
||||||
onClick={(e) => (e.target as HTMLInputElement).select()}
|
|
||||||
className="w-full h-10 px-3 rounded-xl text-[12px] font-mono outline-none cursor-text transition-colors"
|
|
||||||
style={{
|
|
||||||
background: "#1d2021",
|
|
||||||
border: "1px solid #504945",
|
|
||||||
color: "#d5c4a1",
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div className="flex gap-2">
|
|
||||||
<button
|
|
||||||
onClick={handleCopy}
|
|
||||||
className="flex-1 h-11 rounded-xl text-[14px] font-medium flex items-center justify-center gap-1.5 transition-all active:opacity-70 select-none"
|
|
||||||
style={
|
|
||||||
copied
|
|
||||||
? {
|
|
||||||
background: "rgba(184,187,38,0.12)",
|
|
||||||
color: "#b8bb26",
|
|
||||||
border: "1px solid rgba(184,187,38,0.25)",
|
|
||||||
}
|
|
||||||
: {
|
|
||||||
background: "#3c3836",
|
|
||||||
color: "#ebdbb2",
|
|
||||||
border: "1px solid #504945",
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
sx={{
|
||||||
|
border: "2px dashed",
|
||||||
|
borderColor: isDragging ? "info.main" : "divider",
|
||||||
|
borderRadius: 0,
|
||||||
|
px: { xs: 2.5, md: 4 },
|
||||||
|
py: { xs: 4, md: 6 },
|
||||||
|
textAlign: "center",
|
||||||
|
cursor: isUploading ? "default" : "pointer",
|
||||||
|
backgroundColor: isDragging
|
||||||
|
? "rgba(56, 189, 248, 0.08)"
|
||||||
|
: "transparent",
|
||||||
|
transition: "all 0.15s ease",
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<Copy className="w-3.5 h-3.5" strokeWidth={2} />
|
<input
|
||||||
{copied ? "Copied" : "Copy"}
|
ref={fileInputRef}
|
||||||
</button>
|
type="file"
|
||||||
|
hidden
|
||||||
|
onChange={handleFileChange}
|
||||||
|
/>
|
||||||
|
<Stack spacing={1.5} alignItems="center">
|
||||||
|
<Box
|
||||||
|
sx={{
|
||||||
|
width: 44,
|
||||||
|
height: 44,
|
||||||
|
borderRadius: 3,
|
||||||
|
display: "grid",
|
||||||
|
placeItems: "center",
|
||||||
|
backgroundColor: isDragging
|
||||||
|
? "rgba(56, 189, 248, 0.12)"
|
||||||
|
: "action.selected",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<CloudUploadIcon
|
||||||
|
fontSize="small"
|
||||||
|
color={isDragging ? "info" : "inherit"}
|
||||||
|
/>
|
||||||
|
</Box>
|
||||||
|
<Typography variant="body2" sx={{ fontWeight: 600 }}>
|
||||||
|
{isDragging
|
||||||
|
? "Drop to upload"
|
||||||
|
: "Drop file or tap to browse"}
|
||||||
|
</Typography>
|
||||||
|
<Typography variant="caption" color="text.secondary">
|
||||||
|
Any file type · up to {limitLabel}
|
||||||
|
</Typography>
|
||||||
|
</Stack>
|
||||||
|
</Box>
|
||||||
|
)}
|
||||||
|
</Box>
|
||||||
|
</Card>
|
||||||
|
|
||||||
<a
|
<Card>
|
||||||
href={resultUrl}
|
<Box
|
||||||
target="_blank"
|
sx={{
|
||||||
rel="noopener noreferrer"
|
px: 2.5,
|
||||||
className="flex-1 h-11 rounded-xl text-[14px] font-semibold flex items-center justify-center gap-1.5 transition-opacity active:opacity-80 select-none"
|
py: 1.25,
|
||||||
style={{ background: "#d79921", color: "#1d2021" }}
|
borderBottom: "1px solid",
|
||||||
>
|
borderColor: "divider",
|
||||||
<ExternalLink className="w-3.5 h-3.5" strokeWidth={2} />
|
backgroundColor: "background.default",
|
||||||
Open
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button
|
|
||||||
onClick={() => {
|
|
||||||
setResultUrl("");
|
|
||||||
setErrorMessage("");
|
|
||||||
setStatus(isAuthenticated ? "authenticated" : "idle");
|
|
||||||
}}
|
|
||||||
className="flex items-center justify-center gap-1.5 text-[13px] transition-colors active:opacity-80 select-none"
|
|
||||||
style={{ color: "#a89984" }}
|
|
||||||
>
|
|
||||||
<RotateCcw className="w-3 h-3" strokeWidth={2} />
|
|
||||||
Upload another
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
/* ── Drop zone ─────────────────────────────────────────────── */
|
|
||||||
<div
|
|
||||||
onDragOver={handleDragOver}
|
|
||||||
onDragLeave={handleDragLeave}
|
|
||||||
onDrop={handleDrop}
|
|
||||||
onClick={() => isInteractable && fileInputRef.current?.click()}
|
|
||||||
className="rounded-xl border-2 border-dashed flex flex-col items-center justify-center gap-2.5 py-10 px-4 text-center transition-all duration-150 select-none"
|
|
||||||
style={{
|
|
||||||
borderColor: isDragging ? "#83a598" : "#504945",
|
|
||||||
background: isDragging
|
|
||||||
? "rgba(131,165,152,0.06)"
|
|
||||||
: "transparent",
|
|
||||||
cursor: isUploading ? "default" : "pointer",
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<input
|
<Typography
|
||||||
ref={fileInputRef}
|
variant="caption"
|
||||||
type="file"
|
sx={{ letterSpacing: "0.2em", color: "text.secondary" }}
|
||||||
className="hidden"
|
|
||||||
onChange={handleFileChange}
|
|
||||||
/>
|
|
||||||
<div
|
|
||||||
className="w-10 h-10 rounded-[12px] flex items-center justify-center transition-colors"
|
|
||||||
style={{
|
|
||||||
background: isDragging
|
|
||||||
? "rgba(131,165,152,0.12)"
|
|
||||||
: "#3c3836",
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<Upload
|
SESSION
|
||||||
className="w-4.5 h-4.5 transition-colors"
|
</Typography>
|
||||||
style={{ color: isDragging ? "#83a598" : "#7c6f64" }}
|
</Box>
|
||||||
strokeWidth={1.75}
|
<Box sx={{ px: { xs: 2, md: 3 }, py: { xs: 2.5, md: 3 } }}>
|
||||||
/>
|
{showAuthRow && (
|
||||||
</div>
|
<Stack spacing={2} sx={{ mb: 2.5 }}>
|
||||||
<div>
|
{showAuthBadge ? (
|
||||||
<p
|
<Stack direction="row" spacing={1} alignItems="center">
|
||||||
className="text-[14px] font-medium transition-colors"
|
<Chip
|
||||||
style={{ color: isDragging ? "#83a598" : "#ebdbb2" }}
|
label="Authenticated · 250 MB limit"
|
||||||
|
color="success"
|
||||||
|
variant="outlined"
|
||||||
|
sx={{
|
||||||
|
color: "success.main",
|
||||||
|
borderColor: "rgba(34, 197, 94, 0.5)",
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Stack>
|
||||||
|
) : (
|
||||||
|
<Stack spacing={2}>
|
||||||
|
<Typography variant="body2" color="text.secondary">
|
||||||
|
Password{" "}
|
||||||
|
<Typography
|
||||||
|
component="span"
|
||||||
|
variant="body2"
|
||||||
|
color="text.disabled"
|
||||||
|
>
|
||||||
|
— optional, unlocks 250 MB
|
||||||
|
</Typography>
|
||||||
|
</Typography>
|
||||||
|
<TextField
|
||||||
|
type="password"
|
||||||
|
placeholder="Enter password"
|
||||||
|
value={password}
|
||||||
|
error={passwordError}
|
||||||
|
helperText={
|
||||||
|
passwordError ? "Incorrect password." : " "
|
||||||
|
}
|
||||||
|
onChange={(e) => {
|
||||||
|
setPassword(e.target.value);
|
||||||
|
setPasswordError(false);
|
||||||
|
}}
|
||||||
|
onKeyDown={(e) => e.key === "Enter" && handleUnlock()}
|
||||||
|
fullWidth
|
||||||
|
/>
|
||||||
|
<Button
|
||||||
|
variant="contained"
|
||||||
|
color="primary"
|
||||||
|
startIcon={<LockIcon />}
|
||||||
|
onClick={handleUnlock}
|
||||||
|
>
|
||||||
|
Unlock 250 MB
|
||||||
|
</Button>
|
||||||
|
</Stack>
|
||||||
|
)}
|
||||||
|
</Stack>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{uploadedFile?.previewUrl && (
|
||||||
|
<Box
|
||||||
|
sx={{
|
||||||
|
borderRadius: 3,
|
||||||
|
overflow: "hidden",
|
||||||
|
border: "1px solid",
|
||||||
|
borderColor: "divider",
|
||||||
|
backgroundColor: "background.default",
|
||||||
|
mb: 2,
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
{isDragging
|
{uploadedFile.type.startsWith("image/") ? (
|
||||||
? "Drop to upload"
|
<Box
|
||||||
: "Drop file or tap to browse"}
|
component="img"
|
||||||
</p>
|
src={uploadedFile.previewUrl}
|
||||||
<p className="text-[12px] mt-1" style={{ color: "#7c6f64" }}>
|
alt={uploadedFile.name}
|
||||||
Any file type · up to {limitLabel}
|
sx={{ display: "block", width: "100%", height: "auto" }}
|
||||||
</p>
|
/>
|
||||||
</div>
|
) : (
|
||||||
</div>
|
<Box
|
||||||
)}
|
component="video"
|
||||||
|
src={uploadedFile.previewUrl}
|
||||||
|
controls
|
||||||
|
sx={{ display: "block", width: "100%" }}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</Box>
|
||||||
|
)}
|
||||||
|
|
||||||
{/* ── Error ────────────────────────────────────────────────── */}
|
{uploadedFile && (
|
||||||
{errorMessage && (
|
<Stack
|
||||||
<div
|
spacing={0.5}
|
||||||
className="flex items-start gap-2.5 px-3.5 py-3 rounded-xl"
|
sx={{
|
||||||
style={{
|
px: 2,
|
||||||
background: "rgba(251,73,52,0.08)",
|
py: 1.5,
|
||||||
border: "1px solid rgba(251,73,52,0.2)",
|
borderRadius: 2,
|
||||||
}}
|
border: "1px solid",
|
||||||
>
|
borderColor: "divider",
|
||||||
<AlertCircle
|
backgroundColor: "background.default",
|
||||||
className="w-4 h-4 shrink-0 mt-px"
|
mb: 2,
|
||||||
style={{ color: "#fb4934" }}
|
}}
|
||||||
strokeWidth={2}
|
>
|
||||||
/>
|
<Typography variant="body2" sx={{ fontWeight: 600 }} noWrap>
|
||||||
<p
|
{uploadedFile.name}
|
||||||
className="text-[13px] break-all leading-relaxed"
|
</Typography>
|
||||||
style={{ color: "#fb4934" }}
|
<Stack
|
||||||
>
|
direction="row"
|
||||||
{errorMessage}
|
spacing={2}
|
||||||
</p>
|
sx={{ color: "text.secondary" }}
|
||||||
</div>
|
>
|
||||||
)}
|
<Typography variant="caption">
|
||||||
</div>
|
{formatBytes(uploadedFile.size)}
|
||||||
</div>
|
</Typography>
|
||||||
|
<Typography variant="caption">
|
||||||
|
{uploadedFile.type}
|
||||||
|
</Typography>
|
||||||
|
</Stack>
|
||||||
|
</Stack>
|
||||||
|
)}
|
||||||
|
|
||||||
{/* ── Footer ─────────────────────────────────────────────────────── */}
|
{resultUrl && (
|
||||||
<p
|
<Stack spacing={2}>
|
||||||
className="text-center text-[12px] mt-6"
|
<TextField
|
||||||
style={{ color: "#665c54" }}
|
value={resultUrl}
|
||||||
>
|
fullWidth
|
||||||
Files are automatically deleted after 24 hours
|
onClick={(e) => (e.target as HTMLInputElement).select()}
|
||||||
</p>
|
InputProps={{ readOnly: true }}
|
||||||
</div>
|
/>
|
||||||
</main>
|
<Stack direction={{ xs: "column", sm: "row" }} spacing={1}>
|
||||||
|
<Button
|
||||||
|
variant="outlined"
|
||||||
|
startIcon={<ContentCopyIcon />}
|
||||||
|
onClick={handleCopy}
|
||||||
|
color={copied ? "success" : "inherit"}
|
||||||
|
fullWidth
|
||||||
|
>
|
||||||
|
{copied ? "Copied" : "Copy"}
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
variant="contained"
|
||||||
|
endIcon={<OpenInNewIcon />}
|
||||||
|
href={resultUrl}
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
fullWidth
|
||||||
|
>
|
||||||
|
Open
|
||||||
|
</Button>
|
||||||
|
</Stack>
|
||||||
|
</Stack>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{errorMessage && (
|
||||||
|
<Alert
|
||||||
|
severity="error"
|
||||||
|
icon={<ErrorOutlineIcon />}
|
||||||
|
sx={{ mt: 2 }}
|
||||||
|
>
|
||||||
|
{errorMessage}
|
||||||
|
</Alert>
|
||||||
|
)}
|
||||||
|
</Box>
|
||||||
|
</Card>
|
||||||
|
</Box>
|
||||||
|
|
||||||
|
<Typography
|
||||||
|
variant="caption"
|
||||||
|
color="text.secondary"
|
||||||
|
sx={{ textAlign: "center" }}
|
||||||
|
>
|
||||||
|
Files are automatically deleted after 24 hours
|
||||||
|
</Typography>
|
||||||
|
</Stack>
|
||||||
|
</Box>
|
||||||
|
</Box>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { AppRouterCacheProvider } from "@mui/material-nextjs/v15-appRouter";
|
||||||
|
import CssBaseline from "@mui/material/CssBaseline";
|
||||||
|
import { ThemeProvider } from "@mui/material/styles";
|
||||||
|
import type { ReactNode } from "react";
|
||||||
|
|
||||||
|
import theme from "./theme";
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
children: ReactNode;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function Providers({ children }: Props) {
|
||||||
|
return (
|
||||||
|
<AppRouterCacheProvider options={{ enableCssLayer: true }}>
|
||||||
|
<ThemeProvider theme={theme}>
|
||||||
|
<CssBaseline />
|
||||||
|
{children}
|
||||||
|
</ThemeProvider>
|
||||||
|
</AppRouterCacheProvider>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,206 @@
|
|||||||
|
import { createTheme } from "@mui/material/styles";
|
||||||
|
|
||||||
|
const gruvbox = {
|
||||||
|
background: "#0b0e0b",
|
||||||
|
surface: "#0f1410",
|
||||||
|
surfaceAlt: "#121a13",
|
||||||
|
border: "#1f2a22",
|
||||||
|
textPrimary: "#d1fae5",
|
||||||
|
textSecondary: "#86efac",
|
||||||
|
textMuted: "#4ade80",
|
||||||
|
primary: "#22c55e",
|
||||||
|
success: "#22c55e",
|
||||||
|
info: "#22d3ee",
|
||||||
|
error: "#f87171",
|
||||||
|
};
|
||||||
|
|
||||||
|
const theme = createTheme({
|
||||||
|
palette: {
|
||||||
|
mode: "dark",
|
||||||
|
background: {
|
||||||
|
default: gruvbox.background,
|
||||||
|
paper: gruvbox.surface,
|
||||||
|
},
|
||||||
|
primary: {
|
||||||
|
main: gruvbox.primary,
|
||||||
|
contrastText: "#0b0f19",
|
||||||
|
},
|
||||||
|
success: {
|
||||||
|
main: gruvbox.success,
|
||||||
|
},
|
||||||
|
info: {
|
||||||
|
main: gruvbox.info,
|
||||||
|
},
|
||||||
|
error: {
|
||||||
|
main: gruvbox.error,
|
||||||
|
},
|
||||||
|
text: {
|
||||||
|
primary: gruvbox.textPrimary,
|
||||||
|
secondary: gruvbox.textSecondary,
|
||||||
|
disabled: gruvbox.textMuted,
|
||||||
|
},
|
||||||
|
divider: gruvbox.border,
|
||||||
|
},
|
||||||
|
typography: {
|
||||||
|
fontFamily:
|
||||||
|
'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',
|
||||||
|
h1: {
|
||||||
|
fontWeight: 600,
|
||||||
|
letterSpacing: "-0.01em",
|
||||||
|
},
|
||||||
|
h2: {
|
||||||
|
fontWeight: 600,
|
||||||
|
letterSpacing: "-0.01em",
|
||||||
|
},
|
||||||
|
h3: {
|
||||||
|
fontWeight: 600,
|
||||||
|
letterSpacing: "-0.01em",
|
||||||
|
},
|
||||||
|
h4: {
|
||||||
|
fontWeight: 600,
|
||||||
|
letterSpacing: "-0.01em",
|
||||||
|
},
|
||||||
|
h5: {
|
||||||
|
fontWeight: 600,
|
||||||
|
letterSpacing: "-0.01em",
|
||||||
|
},
|
||||||
|
h6: {
|
||||||
|
fontWeight: 600,
|
||||||
|
letterSpacing: "-0.01em",
|
||||||
|
},
|
||||||
|
button: {
|
||||||
|
textTransform: "none",
|
||||||
|
fontWeight: 600,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
shape: {
|
||||||
|
borderRadius: 0,
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
MuiCssBaseline: {
|
||||||
|
styleOverrides: {
|
||||||
|
body: {
|
||||||
|
backgroundColor: gruvbox.background,
|
||||||
|
color: gruvbox.textPrimary,
|
||||||
|
WebkitFontSmoothing: "antialiased",
|
||||||
|
MozOsxFontSmoothing: "grayscale",
|
||||||
|
},
|
||||||
|
"*": {
|
||||||
|
boxSizing: "border-box",
|
||||||
|
},
|
||||||
|
"::selection": {
|
||||||
|
background: "rgba(34, 197, 94, 0.3)",
|
||||||
|
color: gruvbox.textPrimary,
|
||||||
|
},
|
||||||
|
"::-webkit-scrollbar": {
|
||||||
|
width: "6px",
|
||||||
|
},
|
||||||
|
"::-webkit-scrollbar-track": {
|
||||||
|
background: "#0a0d0a",
|
||||||
|
},
|
||||||
|
"::-webkit-scrollbar-thumb": {
|
||||||
|
background: gruvbox.border,
|
||||||
|
borderRadius: "3px",
|
||||||
|
},
|
||||||
|
"::-webkit-scrollbar-thumb:hover": {
|
||||||
|
background: "#2f3b32",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
MuiCard: {
|
||||||
|
styleOverrides: {
|
||||||
|
root: {
|
||||||
|
backgroundColor: gruvbox.surface,
|
||||||
|
border: `1px solid ${gruvbox.border}`,
|
||||||
|
borderRadius: 0,
|
||||||
|
boxShadow: "0 0 0 1px rgba(34, 197, 94, 0.08)",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
MuiTextField: {
|
||||||
|
defaultProps: {
|
||||||
|
size: "small",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
MuiOutlinedInput: {
|
||||||
|
styleOverrides: {
|
||||||
|
root: {
|
||||||
|
backgroundColor: "#0b0e0b",
|
||||||
|
"& .MuiOutlinedInput-notchedOutline": {
|
||||||
|
borderColor: gruvbox.border,
|
||||||
|
},
|
||||||
|
"&:hover .MuiOutlinedInput-notchedOutline": {
|
||||||
|
borderColor: gruvbox.primary,
|
||||||
|
},
|
||||||
|
"&.Mui-focused .MuiOutlinedInput-notchedOutline": {
|
||||||
|
borderColor: gruvbox.primary,
|
||||||
|
boxShadow: "0 0 0 2px rgba(34, 197, 94, 0.25)",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
input: {
|
||||||
|
color: gruvbox.textPrimary,
|
||||||
|
caretColor: gruvbox.primary,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
MuiInputLabel: {
|
||||||
|
styleOverrides: {
|
||||||
|
root: {
|
||||||
|
color: gruvbox.textSecondary,
|
||||||
|
"&.Mui-focused": {
|
||||||
|
color: gruvbox.primary,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
MuiButton: {
|
||||||
|
styleOverrides: {
|
||||||
|
root: {
|
||||||
|
borderRadius: 0,
|
||||||
|
},
|
||||||
|
containedPrimary: {
|
||||||
|
color: "#0b0e0b",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
MuiLinearProgress: {
|
||||||
|
styleOverrides: {
|
||||||
|
root: {
|
||||||
|
height: 6,
|
||||||
|
borderRadius: 999,
|
||||||
|
backgroundColor: gruvbox.surfaceAlt,
|
||||||
|
},
|
||||||
|
bar: {
|
||||||
|
borderRadius: 999,
|
||||||
|
backgroundColor: gruvbox.primary,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
MuiAlert: {
|
||||||
|
styleOverrides: {
|
||||||
|
root: {
|
||||||
|
borderRadius: 0,
|
||||||
|
},
|
||||||
|
standardError: {
|
||||||
|
backgroundColor: "rgba(248, 113, 113, 0.12)",
|
||||||
|
border: "1px solid rgba(248, 113, 113, 0.35)",
|
||||||
|
color: gruvbox.error,
|
||||||
|
},
|
||||||
|
icon: {
|
||||||
|
color: gruvbox.error,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
MuiDivider: {
|
||||||
|
styleOverrides: {
|
||||||
|
root: {
|
||||||
|
borderColor: gruvbox.border,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
export type ThemeType = typeof theme;
|
||||||
|
|
||||||
|
export default theme;
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
import type { Config } from "tailwindcss";
|
|
||||||
|
|
||||||
const config: Config = {
|
|
||||||
content: [
|
|
||||||
"./src/pages/**/*.{js,ts,jsx,tsx,mdx}",
|
|
||||||
"./src/components/**/*.{js,ts,jsx,tsx,mdx}",
|
|
||||||
"./src/app/**/*.{js,ts,jsx,tsx,mdx}",
|
|
||||||
],
|
|
||||||
theme: {
|
|
||||||
extend: {
|
|
||||||
colors: {
|
|
||||||
slate: {
|
|
||||||
950: "#0f172a",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
plugins: [],
|
|
||||||
};
|
|
||||||
|
|
||||||
export default config;
|
|
||||||
Reference in new issue
Block a user