diff --git a/back/src/lib/nextcloud.ts b/back/src/lib/nextcloud.ts index 5fd1527..298bd99 100644 --- a/back/src/lib/nextcloud.ts +++ b/back/src/lib/nextcloud.ts @@ -1,4 +1,4 @@ -import { createClient, type BufferLike } from "webdav"; +import { createClient } from "webdav"; import fs from "fs/promises"; import path from "path"; diff --git a/back/src/middleware/auth.ts b/back/src/middleware/auth.ts index 0588a49..36fe633 100644 --- a/back/src/middleware/auth.ts +++ b/back/src/middleware/auth.ts @@ -4,13 +4,9 @@ import type { Request, Response, NextFunction } from "express"; export function authMiddleware(req: Request, res: Response, next: NextFunction) { try { const token = req.cookies.token; - if (!token) { return res.sendStatus(401); } - console.log("Token: ", token) - console.log("Secret: ", process.env.JWT_SECRET) jwt.verify(token, process.env.JWT_SECRET!) - next(); } catch { diff --git a/back/src/routes/protected.ts b/back/src/routes/protected.ts index 4d757f1..3ed369b 100644 --- a/back/src/routes/protected.ts +++ b/back/src/routes/protected.ts @@ -25,10 +25,10 @@ router.get("/video", async (req, res) => { router.post("/createclip", async (req, res) => { try { - encodeFrames({ + await encodeFrames({ inputPattern: `${LOCAL_DIR}/*.jpg`, output: path.resolve("./out.mp4"), - fps: 12, + fps: 8, }); res.status(200).end(); } catch { diff --git a/front/public/kapitan_papryk_dark.png b/front/public/kapitan_papryk_dark.png new file mode 100644 index 0000000..0479eea Binary files /dev/null and b/front/public/kapitan_papryk_dark.png differ diff --git a/front/public/kapitan_papryk_light.png b/front/public/kapitan_papryk_light.png new file mode 100644 index 0000000..b750edc Binary files /dev/null and b/front/public/kapitan_papryk_light.png differ diff --git a/front/src/components/ThemeToggle.tsx b/front/src/components/ThemeToggle.tsx new file mode 100644 index 0000000..aefc979 --- /dev/null +++ b/front/src/components/ThemeToggle.tsx @@ -0,0 +1,26 @@ +import { Moon, Sun } from "lucide-react" + +import { Button } from "@/components/ui/button" +import { useTheme } from "./theme-provider" + +export function ThemeToggle() { + const { theme, setTheme } = useTheme() + + return ( + + ) +} diff --git a/front/src/components/ui/bubble.tsx b/front/src/components/ui/bubble.tsx new file mode 100644 index 0000000..2448ad1 --- /dev/null +++ b/front/src/components/ui/bubble.tsx @@ -0,0 +1,125 @@ +import * as React from "react" +import { cva, type VariantProps } from "class-variance-authority" +import { Slot } from "radix-ui" + +import { cn } from "@/lib/utils" + +function BubbleGroup({ className, ...props }: React.ComponentProps<"div">) { + return ( +
+ ) +} + +const bubbleVariants = cva( + "group/bubble relative flex w-fit max-w-[80%] min-w-0 flex-col gap-1 group-data-[align=end]/message:self-end data-[align=end]:self-end data-[variant=ghost]:max-w-full", + { + variants: { + variant: { + default: + "*:data-[slot=bubble-content]:bg-primary *:data-[slot=bubble-content]:text-primary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-primary/80", + secondary: + "*:data-[slot=bubble-content]:bg-secondary *:data-[slot=bubble-content]:text-secondary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]", + muted: + "*:data-[slot=bubble-content]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--muted),var(--foreground)_5%)]", + tinted: + "*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.93_calc(c*0.4)_h)] *:data-[slot=bubble-content]:text-foreground dark:*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.3_calc(c*0.4)_h)] [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.88_calc(c*0.5)_h)] dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.35_calc(c*0.5)_h)]", + outline: + "*:data-[slot=bubble-content]:border-border *:data-[slot=bubble-content]:bg-background [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-input/30", + ghost: + "border-none *:data-[slot=bubble-content]:rounded-none *:data-[slot=bubble-content]:bg-transparent *:data-[slot=bubble-content]:p-0 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted/50", + destructive: + "*:data-[slot=bubble-content]:bg-destructive/10 *:data-[slot=bubble-content]:text-destructive dark:*:data-[slot=bubble-content]:bg-destructive/20 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/20 dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/30", + }, + }, + defaultVariants: { + variant: "default", + }, + } +) + +function Bubble({ + variant = "default", + align = "start", + className, + ...props +}: React.ComponentProps<"div"> & + VariantProps & { + align?: "start" | "end" + }) { + return ( +
+ ) +} + +function BubbleContent({ + asChild = false, + className, + ...props +}: React.ComponentProps<"div"> & { + asChild?: boolean +}) { + const Comp = asChild ? Slot.Root : "div" + + return ( + + ) +} + +const bubbleReactionsVariants = cva( + "absolute z-10 flex w-fit shrink-0 items-center justify-center gap-1 rounded-full bg-muted px-1.5 py-0.5 text-xs ring-2 ring-card has-[button]:p-0", + { + variants: { + side: { + top: "top-0 -translate-y-3/4", + bottom: "bottom-0 translate-y-3/4", + }, + align: { + start: "left-3", + end: "right-3", + }, + }, + defaultVariants: { + side: "bottom", + align: "end", + }, + } +) + +function BubbleReactions({ + side = "bottom", + align = "end", + className, + ...props +}: React.ComponentProps<"div"> & { + align?: "start" | "end" + side?: "top" | "bottom" +}) { + return ( +
+ ) +} + +export { BubbleGroup, Bubble, BubbleContent, BubbleReactions } diff --git a/front/src/layouts/AuthLayout.tsx b/front/src/layouts/AuthLayout.tsx index 1778da1..8954eed 100644 --- a/front/src/layouts/AuthLayout.tsx +++ b/front/src/layouts/AuthLayout.tsx @@ -3,7 +3,10 @@ import { Outlet } from "react-router"; export default function AuthLayout() { return ( -
+
PAPRYK.COM diff --git a/front/src/layouts/MainLayout.tsx b/front/src/layouts/MainLayout.tsx index 704152a..82fff74 100644 --- a/front/src/layouts/MainLayout.tsx +++ b/front/src/layouts/MainLayout.tsx @@ -1,3 +1,5 @@ +import { useTheme } from "@/components/theme-provider"; +import { ThemeToggle } from "@/components/ThemeToggle"; import { Button } from "@/components/ui/button"; import { Separator } from "@/components/ui/separator"; import { useLogout } from "@/hooks/useLogout"; @@ -22,13 +24,19 @@ export function MainLayout() { const { data: user } = useMe(); const isAuthenticated = !!user; const logout = useLogout(); + const { theme } = useTheme(); return ( -
+
{/* Header */} -
-
+
+
{/* Logo */} }
+
@@ -83,7 +92,7 @@ export function MainLayout() { {/* Footer */} -
) }