Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 69 additions & 32 deletions src/lib/components/app-sidebar.svelte
Original file line number Diff line number Diff line change
@@ -1,45 +1,61 @@
<script lang="ts">
import LayoutGrid from '@lucide/svelte/icons/layout-grid';
import Terminal from '@lucide/svelte/icons/terminal';
import Users from '@lucide/svelte/icons/users';
import Settings from '@lucide/svelte/icons/settings';
import Zap from '@lucide/svelte/icons/zap';
import * as Sidebar from '$lib/components/ui/sidebar/index.js';
import { page } from '$app/state';
import LayoutGrid from "@lucide/svelte/icons/layout-grid";
import Terminal from "@lucide/svelte/icons/terminal";
import Users from "@lucide/svelte/icons/users";
import Settings from "@lucide/svelte/icons/settings";
import Zap from "@lucide/svelte/icons/zap";
import * as Sidebar from "$lib/components/ui/sidebar/index.js";
import { page } from "$app/state";

interface NavItem {
href: string;
label: string;
icon: typeof LayoutGrid;
comingSoon?: boolean;
}

const navItems: NavItem[] = [
{ href: '/', label: 'Overview', icon: LayoutGrid },
{ href: '/console', label: 'Console', icon: Terminal },
{ href: '/players', label: 'Players', icon: Users },
{ href: '/config', label: 'Config', icon: Settings }
{ href: "/", label: "Overview", icon: LayoutGrid },
{
href: "/console",
label: "Console",
icon: Terminal,
comingSoon: true,
},
{ href: "/players", label: "Players", icon: Users, comingSoon: true },
{ href: "/config", label: "Config", icon: Settings, comingSoon: true },
];

let {
onPowerClick,
open = $bindable()
}: { onPowerClick?: () => void, open?: boolean } = $props();
let {
onPowerClick,
open = $bindable(),
}: { onPowerClick?: () => void; open?: boolean } = $props();
</script>

<Sidebar.Root collapsible="icon" class="border-r border-border">
<!-- Header -->
<Sidebar.Header class="h-20 border-b border-border">
<div class="flex items-center gap-3 {open ? 'px-2' : ''} transition-all duration-200">
<div
class="flex items-center gap-3 {open
? 'px-2'
: ''} transition-all duration-200"
>
<img
src="https://raw.githubusercontent.com/ferrumc-rs/ferrumc/refs/heads/master/assets/data/icon.png"
alt="FerrumC"
class="size-8 rounded-lg shadow-lg shadow-primary/20 mt-4"
/>
<div class="group-data-[collapsible=icon]:hidden">
<h1 class="font-bold text-white tracking-tight text-lg">FerrumC</h1>
<h1 class="font-bold text-white tracking-tight text-lg">
FerrumC
</h1>
<div class="flex items-center gap-1.5">
<span class="w-2 h-2 rounded-full bg-success animate-pulse"></span>
<span class="text-[10px] uppercase tracking-wider text-muted-foreground font-mono">Online</span>
<span class="w-2 h-2 rounded-full bg-success animate-pulse"
></span>
<span
class="text-[10px] uppercase tracking-wider text-muted-foreground font-mono"
>Online</span
>
</div>
</div>
</div>
Expand All @@ -52,17 +68,34 @@
<Sidebar.Menu>
{#each navItems as item (item.href)}
<Sidebar.MenuItem>
<Sidebar.MenuButton
isActive={page.url.pathname === item.href}
class="h-12"
>
{#snippet child({ props })}
<a href={item.href} {...props}>
<item.icon class="w-5 h-5" />
<span class="font-medium">{item.label}</span>
</a>
{/snippet}
</Sidebar.MenuButton>
{#if item.comingSoon}
<Sidebar.MenuButton
isActive={false}
class="h-12 opacity-50 cursor-not-allowed pointer-events-none"
>
<item.icon class="w-5 h-5" />
<span class="font-medium">{item.label}</span>
<span
class="ml-auto text-[0.625rem] font-semibold uppercase tracking-wider px-2 py-0.5 rounded-full bg-muted text-muted-foreground group-data-[collapsible=icon]:hidden"
>
Coming Soon
</span>
</Sidebar.MenuButton>
{:else}
<Sidebar.MenuButton
isActive={page.url.pathname === item.href}
class="h-12"
>
{#snippet child({ props })}
<a href={item.href} {...props}>
<item.icon class="w-5 h-5" />
<span class="font-medium"
>{item.label}</span
>
</a>
{/snippet}
</Sidebar.MenuButton>
{/if}
</Sidebar.MenuItem>
{/each}
</Sidebar.Menu>
Expand All @@ -75,11 +108,15 @@
<Sidebar.Menu>
<Sidebar.MenuItem>
<Sidebar.MenuButton
onclick={onPowerClick}
class="h-12 text-destructive hover:bg-destructive hover:text-white transition-all duration-200"
class="h-12 text-destructive/50 cursor-not-allowed pointer-events-none"
>
<Zap class="w-5 h-5" />
<span class="font-medium">Power Options</span>
<span
class="ml-auto text-[0.625rem] font-semibold uppercase tracking-wider px-2 py-0.5 rounded-full bg-muted text-muted-foreground group-data-[collapsible=icon]:hidden"
>
Soon
</span>
</Sidebar.MenuButton>
</Sidebar.MenuItem>
</Sidebar.Menu>
Expand Down
16 changes: 9 additions & 7 deletions src/lib/components/ui/tooltip/tooltip-content.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,23 @@
{sideOffset}
{side}
class={cn(
"bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-end-2 data-[side=right]:slide-in-from-start-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--bits-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",
"text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-end-2 data-[side=right]:slide-in-from-start-2 data-[side=top]:slide-in-from-bottom-2 z-60 w-fit origin-(--bits-tooltip-content-transform-origin) text-xs text-balance",
className
)}
{...restProps}
>
{@render children?.()}
<div class="relative z-10 bg-foreground rounded-md px-3 py-1.5">
{@render children?.()}
</div>
<TooltipPrimitive.Arrow>
{#snippet child({ props })}
<div
class={cn(
"bg-primary z-50 size-2.5 rotate-45 rounded-[2px]",
"data-[side=top]:translate-x-1/2 data-[side=top]:translate-y-[calc(-50%_+_2px)]",
"data-[side=bottom]:-translate-x-1/2 data-[side=bottom]:-translate-y-[calc(-50%_+_1px)]",
"data-[side=right]:translate-x-[calc(50%_+_2px)] data-[side=right]:translate-y-1/2",
"data-[side=left]:-translate-y-[calc(50%_-_3px)]",
"bg-primary size-2.5 rotate-45 rounded-[2px]",
"data-[side=top]:translate-x-1/2 data-[side=top]:translate-y-[calc(-50%+2px)]",
"data-[side=bottom]:-translate-x-1/2 data-[side=bottom]:-translate-y-[calc(-50%+1px)]",
"data-[side=right]:translate-x-[calc(50%+2px)] data-[side=right]:translate-y-1/2",
"data-[side=left]:-translate-y-[calc(50%-3px)]",
arrowClasses
)}
{...props}
Expand Down
19 changes: 12 additions & 7 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -263,15 +263,20 @@
</div>

<!-- Recent Console Activity -->
<div class="glass rounded-2xl border border-border overflow-hidden">
<div class="glass rounded-2xl border border-border overflow-hidden opacity-60">
<div class="px-6 py-4 border-b border-border flex justify-between items-center bg-secondary/50">
<h3 class="text-sm font-semibold text-foreground">Recent Console Activity</h3>
<a
href="/console"
class="text-xs text-primary hover:text-primary-glow transition"
>
<div class="flex items-center gap-3">
<h3 class="text-sm font-semibold text-foreground">Recent Console Activity</h3>
<span class="text-[0.625rem] font-semibold uppercase tracking-wider px-2 py-0.5 rounded-full bg-muted text-muted-foreground">
Placeholder
</span>
</div>
<span class="text-xs text-muted-foreground/50 cursor-not-allowed flex items-center gap-2">
View Full Console
</a>
<span class="text-[0.625rem] font-semibold uppercase tracking-wider px-2 py-0.5 rounded-full bg-muted text-muted-foreground">
Soon
</span>
</span>
</div>
<div class="p-4 font-mono text-xs space-y-2 text-muted-foreground">
<div class="flex gap-3">
Expand Down