parent
d7c7db0ef9
commit
6646d3b075
15 changed files with 966 additions and 963 deletions
|
@ -20,6 +20,7 @@
|
|||
"@sveltejs/kit": "^2.0.0",
|
||||
"@sveltejs/vite-plugin-svelte": "^3.0.0",
|
||||
"@types/eslint": "8.56.0",
|
||||
"@types/sanitize-html": "^2.15.0",
|
||||
"@types/socket.io": "^3.0.2",
|
||||
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
||||
"@typescript-eslint/parser": "^6.0.0",
|
||||
|
@ -32,7 +33,7 @@
|
|||
"prettier": "^3.1.1",
|
||||
"prettier-plugin-svelte": "^3.1.2",
|
||||
"prettier-plugin-tailwindcss": "^0.5.9",
|
||||
"svelte": "^5.0.0-next.1",
|
||||
"svelte": "^5.0.0",
|
||||
"svelte-check": "^3.6.0",
|
||||
"tailwindcss": "^3.3.6",
|
||||
"tslib": "^2.4.1",
|
||||
|
@ -41,7 +42,7 @@
|
|||
},
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
"bits-ui": "^0.13.2",
|
||||
"bits-ui": "0.22.0",
|
||||
"clsx": "^2.1.0",
|
||||
"radix-icons-svelte": "^1.2.1",
|
||||
"sanitize-html": "^2.11.0",
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
<svelte:options runes={true} />
|
||||
|
||||
<script lang="ts">
|
||||
import { Clipboard, Copy, OpenInNewWindow } from 'radix-icons-svelte';
|
||||
import { Copy, OpenInNewWindow } from 'radix-icons-svelte';
|
||||
import { quintInOut } from 'svelte/easing';
|
||||
import { slide } from 'svelte/transition';
|
||||
import { IconType, type Server } from '$lib/types/data-types';
|
||||
import { Skeleton } from '$lib/components/ui/skeleton';
|
||||
import { Button } from '$lib/components/ui/button';
|
||||
|
||||
let { server, icons, monitor } = $props<{
|
||||
let { server, icons } = $props<{
|
||||
server: Server;
|
||||
icons: Array<string>;
|
||||
}>();
|
||||
|
@ -37,12 +37,6 @@
|
|||
}
|
||||
|
||||
$effect(() => {
|
||||
if (typeof server.id === 'undefined') {
|
||||
status = 99;
|
||||
}
|
||||
if (typeof monitor !== 'undefined') {
|
||||
status = monitor.status;
|
||||
}
|
||||
if (icons.length != 0 && typeof server.icon !== 'undefined') {
|
||||
const rootSplit = server.icon.split('/');
|
||||
const root = rootSplit[rootSplit.length - 1];
|
||||
|
@ -66,8 +60,9 @@
|
|||
<div class="flex flex-row justify-between">
|
||||
<div
|
||||
class="flex flex-row items-center gap-1"
|
||||
on:mouseover={() => (hover.title = true)}
|
||||
on:mouseleave={() => (hover.title = false)}
|
||||
onmouseover={() => (hover.title = true)}
|
||||
onfocus={() => (hover.title = true)}
|
||||
onmouseleave={() => (hover.title = false)}
|
||||
>
|
||||
{#if typeof server.icon !== 'undefined'}
|
||||
{#if img_source != ''}
|
||||
|
@ -119,8 +114,9 @@
|
|||
<a
|
||||
class="flex flex-row rounded-md border-x-2 px-2 text-sm hover:border-secondary hover:text-secondary"
|
||||
href={server.href}
|
||||
on:mouseover={() => (hover.link = true)}
|
||||
on:mouseleave={() => (hover.link = false)}
|
||||
onmouseover={() => (hover.link = true)}
|
||||
onfocus={() => (hover.title = true)}
|
||||
onmouseleave={() => (hover.link = false)}
|
||||
>
|
||||
Open
|
||||
{#if hover.link}
|
||||
|
@ -140,8 +136,9 @@
|
|||
<a
|
||||
class="flex flex-row rounded-md border-x-2 px-2 text-sm hover:border-secondary hover:text-secondary"
|
||||
href={server.extLink}
|
||||
on:mouseover={() => (hover.ext = true)}
|
||||
on:mouseleave={() => (hover.ext = false)}
|
||||
onmouseover={() => (hover.ext = true)}
|
||||
onfocus={() => (hover.title = true)}
|
||||
onmouseleave={() => (hover.ext = false)}
|
||||
>
|
||||
Official Site
|
||||
{#if hover.ext}
|
||||
|
|
|
@ -10,11 +10,8 @@
|
|||
let { service, icons, monitor } = $props<{
|
||||
service: Service;
|
||||
icons: Array<string>;
|
||||
monitor: Heartbeat;
|
||||
}>();
|
||||
|
||||
let status = $state(4);
|
||||
|
||||
let hover = $state({
|
||||
title: false,
|
||||
link: false,
|
||||
|
@ -35,9 +32,6 @@
|
|||
}
|
||||
|
||||
$effect(() => {
|
||||
if (typeof monitor !== 'undefined') {
|
||||
status = monitor.status;
|
||||
}
|
||||
if (icons.length != 0) {
|
||||
const rootSplit = service.icon.split('/');
|
||||
const root = rootSplit[rootSplit.length - 1];
|
||||
|
@ -61,8 +55,9 @@
|
|||
<div class="flex flex-row justify-between">
|
||||
<div
|
||||
class="flex flex-row items-center gap-1"
|
||||
on:mouseover={() => (hover.title = true)}
|
||||
on:mouseleave={() => (hover.title = false)}
|
||||
onmouseover={() => (hover.title = true)}
|
||||
onfocus={() => (hover.title = true)}
|
||||
onmouseleave={() => (hover.title = false)}
|
||||
>
|
||||
{#if service.icon}
|
||||
{#if img_source != ''}
|
||||
|
@ -96,8 +91,9 @@
|
|||
<a
|
||||
class="flex flex-row rounded-md border-x-2 px-2 text-sm hover:border-secondary hover:text-secondary"
|
||||
href={service.href}
|
||||
on:mouseover={() => (hover.link = true)}
|
||||
on:mouseleave={() => (hover.link = false)}
|
||||
onmouseover={() => (hover.link = true)}
|
||||
onfocus={() => (hover.title = true)}
|
||||
onmouseleave={() => (hover.link = false)}
|
||||
>
|
||||
Open
|
||||
{#if hover.link}
|
||||
|
@ -116,8 +112,9 @@
|
|||
<a
|
||||
class="flex flex-row rounded-md border-x-2 px-2 text-sm hover:border-secondary hover:text-secondary"
|
||||
href={service.extLink}
|
||||
on:mouseover={() => (hover.ext = true)}
|
||||
on:mouseleave={() => (hover.ext = false)}
|
||||
onmouseover={() => (hover.ext = true)}
|
||||
onfocus={() => (hover.title = true)}
|
||||
onmouseleave={() => (hover.ext = false)}
|
||||
>
|
||||
Official Site
|
||||
{#if hover.ext}
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
<script lang="ts">
|
||||
import { Button as ButtonPrimitive } from 'bits-ui';
|
||||
import { cn } from '$lib/utils';
|
||||
import { buttonVariants, type Props, type Events } from '.';
|
||||
import { Button as ButtonPrimitive } from "bits-ui";
|
||||
import { type Events, type Props, buttonVariants } from "./index.js";
|
||||
import { cn } from "$lib/utils.js";
|
||||
|
||||
type $$Props = Props;
|
||||
type $$Events = Events;
|
||||
|
||||
let className: $$Props['class'] = undefined;
|
||||
export let variant: $$Props['variant'] = 'default';
|
||||
export let size: $$Props['size'] = 'default';
|
||||
export let builders: $$Props['builders'] = [];
|
||||
let className: $$Props["class"] = undefined;
|
||||
export let variant: $$Props["variant"] = "default";
|
||||
export let size: $$Props["size"] = "default";
|
||||
export let builders: $$Props["builders"] = [];
|
||||
export { className as class };
|
||||
</script>
|
||||
|
||||
|
|
|
@ -1,34 +1,35 @@
|
|||
import type { Button as ButtonPrimitive } from 'bits-ui';
|
||||
import { tv, type VariantProps } from 'tailwind-variants';
|
||||
import Root from './button.svelte';
|
||||
import type { Button as ButtonPrimitive } from "bits-ui";
|
||||
import { type VariantProps, tv } from "tailwind-variants";
|
||||
import Root from "./button.svelte";
|
||||
|
||||
const buttonVariants = tv({
|
||||
base: 'inline-flex items-center justify-center rounded-md text-sm font-medium whitespace-nowrap transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50',
|
||||
base: "focus-visible:ring-ring inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 disabled:pointer-events-none disabled:opacity-50",
|
||||
variants: {
|
||||
variant: {
|
||||
default: 'bg-primary text-primary-foreground shadow hover:bg-primary/90',
|
||||
destructive: 'bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90',
|
||||
default: "bg-primary text-primary-foreground hover:bg-primary/90 shadow",
|
||||
destructive:
|
||||
"bg-destructive text-destructive-foreground hover:bg-destructive/90 shadow-sm",
|
||||
outline:
|
||||
'border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground',
|
||||
secondary: 'bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80',
|
||||
ghost: 'hover:bg-accent hover:text-accent-foreground',
|
||||
link: 'text-primary underline-offset-4 hover:underline'
|
||||
"border-input bg-background hover:bg-accent hover:text-accent-foreground border shadow-sm",
|
||||
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 shadow-sm",
|
||||
ghost: "hover:bg-accent hover:text-accent-foreground",
|
||||
link: "text-primary underline-offset-4 hover:underline",
|
||||
},
|
||||
size: {
|
||||
default: 'h-9 px-4 py-2',
|
||||
sm: 'h-8 rounded-md px-3 text-xs',
|
||||
lg: 'h-10 rounded-md px-8',
|
||||
icon: 'h-9 w-9'
|
||||
}
|
||||
default: "h-9 px-4 py-2",
|
||||
sm: "h-8 rounded-md px-3 text-xs",
|
||||
lg: "h-10 rounded-md px-8",
|
||||
icon: "h-9 w-9",
|
||||
},
|
||||
},
|
||||
defaultVariants: {
|
||||
variant: 'default',
|
||||
size: 'default'
|
||||
}
|
||||
variant: "default",
|
||||
size: "default",
|
||||
},
|
||||
});
|
||||
|
||||
type Variant = VariantProps<typeof buttonVariants>['variant'];
|
||||
type Size = VariantProps<typeof buttonVariants>['size'];
|
||||
type Variant = VariantProps<typeof buttonVariants>["variant"];
|
||||
type Size = VariantProps<typeof buttonVariants>["size"];
|
||||
|
||||
type Props = ButtonPrimitive.Props & {
|
||||
variant?: Variant;
|
||||
|
@ -45,5 +46,5 @@ export {
|
|||
Root as Button,
|
||||
type Props as ButtonProps,
|
||||
type Events as ButtonEvents,
|
||||
buttonVariants
|
||||
buttonVariants,
|
||||
};
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import Root from './separator.svelte';
|
||||
import Root from "./separator.svelte";
|
||||
|
||||
export {
|
||||
Root,
|
||||
//
|
||||
Root as Separator
|
||||
Root as Separator,
|
||||
};
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
<script lang="ts">
|
||||
import { Separator as SeparatorPrimitive } from 'bits-ui';
|
||||
import { cn } from '$lib/utils';
|
||||
import { Separator as SeparatorPrimitive } from "bits-ui";
|
||||
import { cn } from "$lib/utils.js";
|
||||
|
||||
type $$Props = SeparatorPrimitive.Props;
|
||||
|
||||
let className: $$Props['class'] = undefined;
|
||||
export let orientation: $$Props['orientation'] = 'horizontal';
|
||||
export let decorative: $$Props['decorative'] = undefined;
|
||||
let className: $$Props["class"] = undefined;
|
||||
export let orientation: $$Props["orientation"] = "horizontal";
|
||||
export let decorative: $$Props["decorative"] = undefined;
|
||||
export { className as class };
|
||||
</script>
|
||||
|
||||
<SeparatorPrimitive.Root
|
||||
class={cn(
|
||||
'shrink-0 bg-border',
|
||||
orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]',
|
||||
"bg-border shrink-0",
|
||||
orientation === "horizontal" ? "h-[1px] w-full" : "min-h-full w-[1px]",
|
||||
className
|
||||
)}
|
||||
{orientation}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import Root from './skeleton.svelte';
|
||||
import Root from "./skeleton.svelte";
|
||||
|
||||
export {
|
||||
Root,
|
||||
//
|
||||
Root as Skeleton
|
||||
Root as Skeleton,
|
||||
};
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<script lang="ts">
|
||||
import { cn } from '$lib/utils';
|
||||
import type { HTMLAttributes } from 'svelte/elements';
|
||||
import type { HTMLAttributes } from "svelte/elements";
|
||||
import { cn } from "$lib/utils.js";
|
||||
|
||||
type $$Props = HTMLAttributes<HTMLDivElement>;
|
||||
|
||||
let className: $$Props['class'] = undefined;
|
||||
let className: $$Props["class"] = undefined;
|
||||
export { className as class };
|
||||
</script>
|
||||
|
||||
<div class={cn('animate-pulse rounded-md bg-primary/10', className)} {...$$restProps} />
|
||||
<div class={cn("bg-primary/10 animate-pulse rounded-md", className)} {...$$restProps}></div>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { type ClassValue, clsx } from 'clsx';
|
||||
import { twMerge } from 'tailwind-merge';
|
||||
import { cubicOut } from 'svelte/easing';
|
||||
import type { TransitionConfig } from 'svelte/transition';
|
||||
import { type ClassValue, clsx } from "clsx";
|
||||
import { twMerge } from "tailwind-merge";
|
||||
import { cubicOut } from "svelte/easing";
|
||||
import type { TransitionConfig } from "svelte/transition";
|
||||
|
||||
export function cn(...inputs: ClassValue[]) {
|
||||
return twMerge(clsx(inputs));
|
||||
|
@ -19,9 +19,13 @@ export const flyAndScale = (
|
|||
params: FlyAndScaleParams = { y: -8, x: 0, start: 0.95, duration: 150 }
|
||||
): TransitionConfig => {
|
||||
const style = getComputedStyle(node);
|
||||
const transform = style.transform === 'none' ? '' : style.transform;
|
||||
const transform = style.transform === "none" ? "" : style.transform;
|
||||
|
||||
const scaleConversion = (valueA: number, scaleA: [number, number], scaleB: [number, number]) => {
|
||||
const scaleConversion = (
|
||||
valueA: number,
|
||||
scaleA: [number, number],
|
||||
scaleB: [number, number]
|
||||
) => {
|
||||
const [minA, maxA] = scaleA;
|
||||
const [minB, maxB] = scaleB;
|
||||
|
||||
|
@ -31,11 +35,13 @@ export const flyAndScale = (
|
|||
return valueB;
|
||||
};
|
||||
|
||||
const styleToString = (style: Record<string, number | string | undefined>): string => {
|
||||
const styleToString = (
|
||||
style: Record<string, number | string | undefined>
|
||||
): string => {
|
||||
return Object.keys(style).reduce((str, key) => {
|
||||
if (style[key] === undefined) return str;
|
||||
return str + `${key}:${style[key]};`;
|
||||
}, '');
|
||||
}, "");
|
||||
};
|
||||
|
||||
return {
|
||||
|
@ -53,4 +59,4 @@ export const flyAndScale = (
|
|||
},
|
||||
easing: cubicOut
|
||||
};
|
||||
};
|
||||
};
|
|
@ -5,12 +5,13 @@
|
|||
import Header from './Header.svelte';
|
||||
import Footer from './Footer.svelte';
|
||||
|
||||
let { children } = $props();
|
||||
</script>
|
||||
|
||||
<Header />
|
||||
|
||||
<div class="h-full pb-8 pt-16">
|
||||
<slot />
|
||||
{@render children()}
|
||||
</div>
|
||||
|
||||
<Footer />
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script lang="ts">
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { Button } from '$lib/components/ui/button';
|
||||
|
||||
const button = 'border-t-2 bg-black/55 hover:bg-black/70 hover:border-secondary w-28';
|
||||
|
@ -12,7 +12,7 @@
|
|||
<Button
|
||||
variant="ghost"
|
||||
href="/"
|
||||
class="{button} + {!($page.url.pathname === '/') || 'border-secondary text-secondary'}"
|
||||
class="{button} + {!(page.url.pathname === '/') || 'border-secondary text-secondary'}"
|
||||
>
|
||||
Home
|
||||
</Button>
|
||||
|
@ -21,7 +21,7 @@
|
|||
<Button
|
||||
variant="ghost"
|
||||
href="/servers"
|
||||
class="{button} + {!$page.url.pathname.startsWith('/servers') ||
|
||||
class="{button} + {!page.url.pathname.startsWith('/servers') ||
|
||||
'border-secondary text-secondary'}"
|
||||
>
|
||||
Servers
|
||||
|
@ -31,7 +31,7 @@
|
|||
<Button
|
||||
variant="ghost"
|
||||
href="/services"
|
||||
class="{button} + {!$page.url.pathname.startsWith('/services') ||
|
||||
class="{button} + {!page.url.pathname.startsWith('/services') ||
|
||||
'border-secondary text-secondary'}"
|
||||
>
|
||||
Services
|
||||
|
@ -41,7 +41,7 @@
|
|||
<Button
|
||||
variant="ghost"
|
||||
href="/about"
|
||||
class="{button} + {!$page.url.pathname.startsWith('/about') ||
|
||||
class="{button} + {!page.url.pathname.startsWith('/about') ||
|
||||
'border-secondary text-secondary'}"
|
||||
>
|
||||
About
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
import type { Server } from '$lib/types/data-types';
|
||||
import ServerCard from '$lib/components/ServerCard.svelte';
|
||||
|
||||
let servers: readonly Server[] = $state.frozen([]);
|
||||
let servers: readonly Server[] = $state.raw([]);
|
||||
|
||||
let icons: readonly string[] = $state.frozen([]);
|
||||
let icons: readonly string[] = $state.raw([]);
|
||||
|
||||
async function get(url: string): Promise<any> {
|
||||
let res = await fetch(url);
|
||||
|
|
|
@ -3,12 +3,10 @@
|
|||
<script lang="ts">
|
||||
import ServiceCard from '$lib/components/ServiceCard.svelte';
|
||||
import type { Service } from '$lib/types/data-types';
|
||||
import { io } from 'socket.io-client';
|
||||
import { onDestroy } from 'svelte';
|
||||
|
||||
let services: readonly Service[] = $state.frozen([]);
|
||||
let services: readonly Service[] = $state.raw([]);
|
||||
|
||||
let icons: readonly string[] = $state.frozen([]);
|
||||
let icons: readonly string[] = $state.raw([]);
|
||||
|
||||
async function get(url: string): Promise<any> {
|
||||
let res = await fetch(url);
|
||||
|
|
Loading…
Add table
Reference in a new issue