Added new theme (again), updated some homepage stuff
This commit is contained in:
parent
ec5ee847e0
commit
9deffbb099
17 changed files with 349 additions and 423 deletions
|
|
@ -17,7 +17,7 @@ export default function Sidebar() {
|
|||
}, [load]);
|
||||
|
||||
return (
|
||||
<div className="w-75 h-full flex flex-col gap-3 p-2">
|
||||
<div className="w-65 h-full flex flex-col gap-3 p-2">
|
||||
<Wrapper
|
||||
loading={<Loading />}
|
||||
userId={userId}
|
||||
|
|
|
|||
|
|
@ -8,107 +8,63 @@
|
|||
@source "../../../packages/**/src/**/*.{ts,tsx}";
|
||||
|
||||
:root {
|
||||
--background: oklch(1 0 0);
|
||||
--foreground: oklch(0.148 0.004 228.8);
|
||||
--card: oklch(1 0 0);
|
||||
--card-foreground: oklch(0.148 0.004 228.8);
|
||||
--popover: oklch(1 0 0);
|
||||
--popover-foreground: oklch(0.148 0.004 228.8);
|
||||
--primary: oklch(0.511 0.096 186.391);
|
||||
--primary-foreground: oklch(0.984 0.014 180.72);
|
||||
--secondary: oklch(0.967 0.001 286.375);
|
||||
--secondary-foreground: oklch(0.21 0.006 285.885);
|
||||
--muted: oklch(0.963 0.002 197.1);
|
||||
--muted-foreground: oklch(0.56 0.021 213.5);
|
||||
--accent: oklch(0.963 0.002 197.1);
|
||||
--accent-foreground: oklch(0.218 0.008 223.9);
|
||||
--destructive: oklch(0.577 0.245 27.325);
|
||||
--border: oklch(0.925 0.005 214.3);
|
||||
--input: oklch(0.925 0.005 214.3);
|
||||
--ring: oklch(0.723 0.014 214.4);
|
||||
--chart-1: oklch(0.855 0.138 181.071);
|
||||
--chart-2: oklch(0.704 0.14 182.503);
|
||||
--chart-3: oklch(0.6 0.118 184.704);
|
||||
--chart-4: oklch(0.511 0.096 186.391);
|
||||
--chart-5: oklch(0.437 0.078 188.216);
|
||||
--text: #121212;
|
||||
--background: #f2f2f2;
|
||||
--primary: #00786f;
|
||||
--secondary: #338788;
|
||||
--accent: #13b9a0;
|
||||
--radius: 0.625rem;
|
||||
--sidebar: oklch(0.987 0.002 197.1);
|
||||
--sidebar-foreground: oklch(0.148 0.004 228.8);
|
||||
--sidebar-primary: oklch(0.6 0.118 184.704);
|
||||
--sidebar-primary-foreground: oklch(0.984 0.014 180.72);
|
||||
--sidebar-accent: oklch(0.963 0.002 197.1);
|
||||
--sidebar-accent-foreground: oklch(0.218 0.008 223.9);
|
||||
--sidebar-border: oklch(0.925 0.005 214.3);
|
||||
--sidebar-ring: oklch(0.723 0.014 214.4);
|
||||
}
|
||||
|
||||
.dark {
|
||||
--background: oklch(0.148 0.004 228.8);
|
||||
--foreground: oklch(0.987 0.002 197.1);
|
||||
--card: oklch(0.218 0.008 223.9);
|
||||
--card-foreground: oklch(0.987 0.002 197.1);
|
||||
--popover: oklch(0.218 0.008 223.9);
|
||||
--popover-foreground: oklch(0.987 0.002 197.1);
|
||||
--primary: oklch(0.437 0.078 188.216);
|
||||
--primary-foreground: oklch(0.984 0.014 180.72);
|
||||
--secondary: oklch(0.274 0.006 286.033);
|
||||
--secondary-foreground: oklch(0.985 0 0);
|
||||
--muted: oklch(0.275 0.011 216.9);
|
||||
--muted-foreground: oklch(0.723 0.014 214.4);
|
||||
--accent: oklch(0.275 0.011 216.9);
|
||||
--accent-foreground: oklch(0.987 0.002 197.1);
|
||||
--destructive: oklch(0.704 0.191 22.216);
|
||||
--border: oklch(1 0 0 / 10%);
|
||||
--input: oklch(1 0 0 / 15%);
|
||||
--ring: oklch(0.56 0.021 213.5);
|
||||
--chart-1: oklch(0.855 0.138 181.071);
|
||||
--chart-2: oklch(0.704 0.14 182.503);
|
||||
--chart-3: oklch(0.6 0.118 184.704);
|
||||
--chart-4: oklch(0.511 0.096 186.391);
|
||||
--chart-5: oklch(0.437 0.078 188.216);
|
||||
--sidebar: oklch(0.218 0.008 223.9);
|
||||
--sidebar-foreground: oklch(0.987 0.002 197.1);
|
||||
--sidebar-primary: oklch(0.704 0.14 182.503);
|
||||
--sidebar-primary-foreground: oklch(0.277 0.046 192.524);
|
||||
--sidebar-accent: oklch(0.275 0.011 216.9);
|
||||
--sidebar-accent-foreground: oklch(0.987 0.002 197.1);
|
||||
--sidebar-border: oklch(1 0 0 / 10%);
|
||||
--sidebar-ring: oklch(0.56 0.021 213.5);
|
||||
--text: #eeeeee;
|
||||
--background: #0c0c0c;
|
||||
--primary: #005f5a;
|
||||
--secondary: #0b3134;
|
||||
--accent: #46ecd4;
|
||||
--radius: 0.625rem;
|
||||
}
|
||||
|
||||
@theme inline {
|
||||
--font-sans: "Inter Variable", sans-serif;
|
||||
--color-sidebar-ring: var(--sidebar-ring);
|
||||
--color-sidebar-border: var(--sidebar-border);
|
||||
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
||||
--color-sidebar-accent: var(--sidebar-accent);
|
||||
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
||||
--color-sidebar-primary: var(--sidebar-primary);
|
||||
--color-sidebar-foreground: var(--sidebar-foreground);
|
||||
--color-sidebar: var(--sidebar);
|
||||
--color-chart-5: var(--chart-5);
|
||||
--color-chart-4: var(--chart-4);
|
||||
--color-chart-3: var(--chart-3);
|
||||
--color-chart-2: var(--chart-2);
|
||||
--color-chart-1: var(--chart-1);
|
||||
--color-ring: var(--ring);
|
||||
--color-input: var(--input);
|
||||
--color-border: var(--border);
|
||||
--color-destructive: var(--destructive);
|
||||
--color-accent-foreground: var(--accent-foreground);
|
||||
--color-accent: var(--accent);
|
||||
--color-muted-foreground: var(--muted-foreground);
|
||||
--color-muted: var(--muted);
|
||||
--color-secondary-foreground: var(--secondary-foreground);
|
||||
--color-secondary: var(--secondary);
|
||||
--color-primary-foreground: var(--primary-foreground);
|
||||
--color-primary: var(--primary);
|
||||
--color-popover-foreground: var(--popover-foreground);
|
||||
--color-popover: var(--popover);
|
||||
--color-card-foreground: var(--card-foreground);
|
||||
--color-card: var(--card);
|
||||
--color-foreground: var(--foreground);
|
||||
|
||||
--color-background: var(--background);
|
||||
--color-foreground: var(--text);
|
||||
|
||||
--color-primary: var(--primary);
|
||||
--color-primary-foreground: var(--text);
|
||||
--color-secondary: var(--secondary);
|
||||
--color-secondary-foreground: var(--background);
|
||||
--color-accent: var(--accent);
|
||||
--color-accent-foreground: var(--background);
|
||||
|
||||
--color-muted: color-mix(in srgb, var(--text) 20%, var(--background));
|
||||
--color-muted-foreground: var(--text);
|
||||
--color-border: color-mix(in srgb, var(--text) 13%, var(--background));
|
||||
--color-input: color-mix(in srgb, var(--text) 15%, var(--background));
|
||||
--color-ring: color-mix(in srgb, var(--text) 45%, var(--background));
|
||||
--color-destructive: hsl(0 84% 60%);
|
||||
|
||||
--color-card: color-mix(in srgb, var(--text) 6%, var(--background));
|
||||
--color-card-foreground: var(--text);
|
||||
--color-popover: color-mix(in srgb, var(--text) 5%, var(--background));
|
||||
--color-popover-foreground: var(--text);
|
||||
|
||||
--color-sidebar: color-mix(in srgb, var(--text) 3%, var(--background));
|
||||
--color-sidebar-foreground: var(--text);
|
||||
--color-sidebar-primary: var(--primary);
|
||||
--color-sidebar-primary-foreground: var(--background);
|
||||
--color-sidebar-accent: var(--accent);
|
||||
--color-sidebar-accent-foreground: var(--background);
|
||||
--color-sidebar-border: var(--border);
|
||||
--color-sidebar-ring: var(--primary);
|
||||
|
||||
--color-chart-1: var(--primary);
|
||||
--color-chart-2: var(--secondary);
|
||||
--color-chart-3: var(--accent);
|
||||
--color-chart-4: color-mix(in srgb, var(--primary) 70%, white);
|
||||
--color-chart-5: color-mix(in srgb, var(--secondary) 70%, white);
|
||||
|
||||
--radius-sm: calc(var(--radius) * 0.6);
|
||||
--radius-md: calc(var(--radius) * 0.8);
|
||||
--radius-lg: var(--radius);
|
||||
|
|
|
|||
|
|
@ -1,8 +1,81 @@
|
|||
import { Input } from "@tensamin/ui/cmp/input";
|
||||
import { Button } from "@tensamin/ui/cmp/button";
|
||||
import {
|
||||
Dialog,
|
||||
DialogClose,
|
||||
DialogContent,
|
||||
DialogDescription,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
DialogTrigger,
|
||||
} from "@tensamin/ui/cmp/dialog";
|
||||
import z from "zod";
|
||||
import { toast } from "@tensamin/shared/log";
|
||||
import { useSocket } from "@tensamin/ttp/context";
|
||||
|
||||
/**
|
||||
* Executes Page.
|
||||
* @param none This function has no parameters.
|
||||
* @returns unknown.
|
||||
*/
|
||||
export default function Page() {
|
||||
return <div>Home</div>;
|
||||
const { send } = useSocket();
|
||||
|
||||
function submit(username: string | null) {
|
||||
const schema = z
|
||||
.string()
|
||||
.min(1, "Username is too short")
|
||||
.max(15, "Username is too long");
|
||||
|
||||
const result = schema.safeParse(username?.toLowerCase().trim());
|
||||
|
||||
if (!result.success) {
|
||||
toast("error", result.error.issues[0].message);
|
||||
return;
|
||||
}
|
||||
|
||||
send("add_conversation", {
|
||||
chat_partner_name: result.data,
|
||||
})
|
||||
.then(() => toast("success", "Conversation added"))
|
||||
.catch(() => toast("error", "Failed to add conversation"));
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="p-3 flex gap-2">
|
||||
<Dialog>
|
||||
<DialogTrigger render={<Button>Add Conversation</Button>} />
|
||||
<DialogContent>
|
||||
<DialogHeader>
|
||||
<DialogTitle>New Conversation</DialogTitle>
|
||||
</DialogHeader>
|
||||
<DialogDescription>
|
||||
Add a new conversation. Just enter the username of the person you
|
||||
want to add as a conversation.
|
||||
</DialogDescription>
|
||||
<form
|
||||
className="flex flex-col gap-5"
|
||||
onSubmit={(event) => {
|
||||
event.preventDefault();
|
||||
const form = new FormData(event.currentTarget);
|
||||
const username = form.get("username") as string | null;
|
||||
submit(username);
|
||||
}}
|
||||
>
|
||||
<Input
|
||||
type="text"
|
||||
id="username"
|
||||
name="username"
|
||||
placeholder="Enter username..."
|
||||
/>
|
||||
<div className="flex w-full justify-end gap-1">
|
||||
<DialogClose render={<Button variant="outline">Cancel</Button>} />
|
||||
<Button type="submit">Continue</Button>
|
||||
</div>
|
||||
</form>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
<Button disabled>Add Community</Button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import type { ReactNode } from "react";
|
||||
import { useEffect, useState, type ReactNode } from "react";
|
||||
|
||||
import Storage from "@tensamin/storage/context";
|
||||
import Crypto from "@tensamin/crypto/context";
|
||||
|
|
@ -13,8 +13,34 @@ import { Toaster } from "@tensamin/ui/cmp/sonner";
|
|||
* @returns unknown.
|
||||
*/
|
||||
export default function Layout(props: { children: ReactNode }) {
|
||||
const [pixelRatio, setPixelRatio] = useState(devicePixelRatio);
|
||||
const [visible, setVisible] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
const handleResize = () => {
|
||||
setPixelRatio(devicePixelRatio);
|
||||
setVisible(true);
|
||||
setTimeout(() => setVisible(false), 1000);
|
||||
};
|
||||
|
||||
window.addEventListener("resize", handleResize);
|
||||
return () => window.removeEventListener("resize", handleResize);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="fixed top-0 left-0 z-100 w-screen h-screen flex flex-col justify-center items-center pointer-events-none select-none">
|
||||
{visible && (
|
||||
<div className="bg-card border p-1 text-xs">{pixelRatio}</div>
|
||||
)}
|
||||
|
||||
{/* Todo: Make this nicer */}
|
||||
{pixelRatio !== 1 && (
|
||||
<div className="fixed bottom-0 right-0 m-3 text-xs text-red-500">
|
||||
Hey! You're zoomed in.
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<Toaster />
|
||||
<Storage>
|
||||
<LegalWrapper>
|
||||
|
|
|
|||
Loading…
Reference in a new issue