mirror of
https://github.com/luckfox-eng29/kvm.git
synced 2026-01-20 10:14:18 +01:00
* chore(ui): Patch bump in tailwind related packages and framer-motion tailwind: [4.1.6 -> 4.1.7](https://github.com/tailwindlabs/tailwindcss/compare/v4.1.6...v4.1.7) @tailwindcss/postcss: 4.1.6 -> 4.1.7 @tailwindcss/vite: 4.1.6 -> 4.1.7 Also patch-bump of: framer-motion: [12.11.0 -> 12.11.4](https://github.com/motiondivision/motion/compare/v12.11.0...v12.11.4) No source changes seemingly needed, have not rerun the migrate. * chore(ui): Run tailwind upgrade and review changes Ran the `npx @tailwindcss/upgrade` and accepted the changes that seemed safe. They're things like: - `data-[closed]:translate-y-9` -> `data-closed:translate-y-8` ()swaps the square bracket syntax to a `-` modifier) - `bg-gradient-to-*` -> `bg-linear-to-*` - `/[*%]` -> `/*` (swap square bracket syntax for inline) - `theme(*.*)` -> `var(--*-*)` (theme styles are exposed as variables with hyphens for dots now) - `[background-size:*]` -> `bg-size[*]` (move the square brackets inside tag) - `[.active_&]:` -> `in[.active]:` (new syntax for parent query) - `!class` -> `class!` (e.g. _!overflow-visible_ to _overflow-visible!_, for [important flag](https://tailwindcss.com/docs/styling-with-utility-classes#using-the-important-flag style) - `w-[1px]` -> `w-px` (that's a new syntax for a 1px width) - `h-[1px]` -> `h-px` (that's a new syntax for a 1px height) - moved `html` and `html, body` global settings in the _index.css_ Also killed off an unused `import` and blank css class. Also picked up the two `flex-grow` -> `grow` that I missed last pass, oops.
110 lines
3.9 KiB
TypeScript
110 lines
3.9 KiB
TypeScript
import { useEffect, useState } from "react";
|
|
import { cx } from "cva";
|
|
import { redirect } from "react-router-dom";
|
|
|
|
import GridBackground from "@components/GridBackground";
|
|
import Container from "@components/Container";
|
|
import { LinkButton } from "@components/Button";
|
|
import LogoBlueIcon from "@/assets/logo-blue.png";
|
|
import LogoWhiteIcon from "@/assets/logo-white.svg";
|
|
import DeviceImage from "@/assets/jetkvm-device-still.png";
|
|
import LogoMark from "@/assets/logo-mark.png";
|
|
import { DEVICE_API } from "@/ui.config";
|
|
|
|
import api from "../api";
|
|
|
|
export interface DeviceStatus {
|
|
isSetup: boolean;
|
|
}
|
|
|
|
const loader = async () => {
|
|
const res = await api
|
|
.GET(`${DEVICE_API}/device/status`)
|
|
.then(res => res.json() as Promise<DeviceStatus>);
|
|
|
|
if (res.isSetup) return redirect("/login-local");
|
|
return null;
|
|
};
|
|
|
|
export default function WelcomeRoute() {
|
|
const [imageLoaded, setImageLoaded] = useState(false);
|
|
|
|
useEffect(() => {
|
|
const img = new Image();
|
|
img.src = DeviceImage;
|
|
img.onload = () => setImageLoaded(true);
|
|
}, []);
|
|
|
|
return (
|
|
<>
|
|
<GridBackground />
|
|
<div className="grid min-h-screen">
|
|
{imageLoaded && (
|
|
<Container>
|
|
<div className="isolate flex h-full w-full items-center justify-center">
|
|
<div className="max-w-3xl text-center">
|
|
<div className="space-y-8">
|
|
<div className="space-y-4">
|
|
<div className="animate-fadeIn animation-delay-1000 flex items-center justify-center opacity-0">
|
|
<img
|
|
src={LogoWhiteIcon}
|
|
alt="JetKVM Logo"
|
|
className="hidden h-[32px] dark:block"
|
|
/>
|
|
<img
|
|
src={LogoBlueIcon}
|
|
alt="JetKVM Logo"
|
|
className="h-[32px] dark:hidden"
|
|
/>
|
|
</div>
|
|
|
|
<div className="animate-fadeIn animation-delay-1500 space-y-1 opacity-0">
|
|
<h1 className="text-4xl font-semibold text-black dark:text-white">
|
|
Welcome to JetKVM
|
|
</h1>
|
|
<p className="text-lg font-medium text-slate-600 dark:text-slate-400">
|
|
Control any computer remotely
|
|
</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div className="-mt-2! -ml-6 flex items-center justify-center">
|
|
<img
|
|
src={DeviceImage}
|
|
alt="JetKVM Device"
|
|
className="animation-delay-300 animate-fadeInScaleFloat max-w-md scale-[0.98] opacity-0 transition-all duration-1000 ease-out"
|
|
/>
|
|
</div>
|
|
</div>
|
|
<div className="-mt-8 space-y-4">
|
|
<p
|
|
style={{ animationDelay: "2000ms" }}
|
|
className="animate-fadeIn mx-auto max-w-lg text-lg text-slate-700 opacity-0 dark:text-slate-300"
|
|
>
|
|
JetKVM combines powerful hardware with intuitive software to provide a
|
|
seamless remote control experience.
|
|
</p>
|
|
<div className="animate-fadeIn animation-delay-2300 opacity-0">
|
|
<LinkButton
|
|
size="LG"
|
|
theme="light"
|
|
text="Set up your JetKVM"
|
|
LeadingIcon={({ className }) => (
|
|
<img src={LogoMark} className={cx(className, "mr-1.5 h-5!")} />
|
|
)}
|
|
textAlign="center"
|
|
to="/welcome/mode"
|
|
/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</Container>
|
|
)}
|
|
</div>
|
|
</>
|
|
);
|
|
}
|
|
|
|
WelcomeRoute.loader = loader;
|