New look (not finished)
This commit is contained in:
@@ -1,10 +1,22 @@
|
||||
<script lang="ts">
|
||||
let { username, theme, windowCount, version, hash } = $props();
|
||||
let {
|
||||
username = $bindable(),
|
||||
theme = $bindable(),
|
||||
windowCount = $bindable(),
|
||||
windowTitle = $bindable(),
|
||||
version,
|
||||
hash
|
||||
}: {
|
||||
username: string;
|
||||
theme: string;
|
||||
windowCount: number;
|
||||
windowTitle: string;
|
||||
version: string;
|
||||
hash: string;
|
||||
} = $props();
|
||||
|
||||
// Internal clock — ticked every 30s so it doesn't go stale if mounted long.
|
||||
let now = $state(new Date());
|
||||
let init = new Date().getTime();
|
||||
let ms = $state(new Date().getTime());
|
||||
|
||||
function formatUptime(ms: number): string {
|
||||
const totalSec = Math.floor(ms / 1000);
|
||||
@@ -31,7 +43,7 @@
|
||||
{#snippet sep(cls: string = '')}
|
||||
<span
|
||||
aria-hidden="true"
|
||||
class="text-bg3 text-[12px] leading-none {cls}"
|
||||
class="text-fg3 text-[9px] select-none {cls}"
|
||||
style="font-family:ui-monospace,monospace">·</span
|
||||
>
|
||||
{/snippet}
|
||||
@@ -47,18 +59,66 @@
|
||||
{/snippet}
|
||||
|
||||
<div
|
||||
class="bg-bg-soft text-fg3 border-bg3 grid w-full grid-cols-[auto_1fr_auto_auto_auto] gap-x-2 overflow-hidden rounded-b-lg border-t text-[11px]"
|
||||
class="bg-bg-soft text-fg3 border-bg3 font-system grid w-full grid-cols-[auto_1fr_auto] gap-x-3 rounded-b-lg border-t text-[11px] shadow-[inset_0_1px_0_rgba(255,255,255,0.04),0_-2px_0_0_rgba(0,0,0,0.1),0_-6px_20px_-4px_rgba(0,0,0,0.5)]"
|
||||
>
|
||||
<div
|
||||
class="col-span-full grid h-[22px] grid-cols-subgrid items-center px-[18px] shadow-[inset_0_-1px_0_var(--color-bg2)]"
|
||||
>
|
||||
<div class="flex items-center gap-1.5 justify-self-start">
|
||||
<button
|
||||
type="button"
|
||||
class="group hover:bg-bg1 -ml-1 flex h-[18px] items-center rounded px-1"
|
||||
aria-haspopup="menu"
|
||||
aria-expanded="false"
|
||||
>
|
||||
<span class="text-fg3 group-hover:text-fg2 text-[10.5px] font-medium whitespace-nowrap"
|
||||
>{username}</span
|
||||
>
|
||||
</button>
|
||||
{@render sep()}
|
||||
<span class="text-bg4 px-[3.5px] font-mono text-[9.5px] whitespace-nowrap">{uptime}</span>
|
||||
</div>
|
||||
|
||||
<span></span>
|
||||
|
||||
<time class="text-bg4 justify-self-end font-mono text-[9.5px] whitespace-nowrap">
|
||||
<span class="text-fg3 pr-2 font-medium">{weekday}</span><span>{time}</span>
|
||||
</time>
|
||||
</div>
|
||||
<div
|
||||
class="col-span-full grid h-[22px] grid-cols-subgrid items-center rounded-b-lg px-[18px] font-mono text-[9.5px] whitespace-nowrap"
|
||||
>
|
||||
<div class="flex items-center gap-1.5 justify-self-start">
|
||||
<span class="text-fg3">
|
||||
<span class="text-bg4">[</span><span class="font-medium">{windowCount.toString()}</span
|
||||
><span class="text-bg4">]</span>
|
||||
</span>
|
||||
{@render sep()}
|
||||
<span class="text-fg3">{windowTitle}</span>
|
||||
</div>
|
||||
|
||||
<span></span>
|
||||
|
||||
<span class="flex items-center gap-1.5 justify-self-end">
|
||||
<span class="text-fg3">{version}</span>
|
||||
{@render sep()}
|
||||
<span class="text-bg4">{hash}</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div
|
||||
class="bg-bg-soft text-fg3 border-bg3 grid w-full zoom-115 grid-cols-[auto_1fr_auto_auto_auto] gap-x-2 overflow-hidden rounded-b-lg border-t text-[11px]"
|
||||
style="font-family:-apple-system,BlinkMacSystemFont,system-ui,sans-serif; box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 -2px 0 0 rgba(0,0,0,0.1), 0 -6px 20px -4px rgba(0,0,0,0.5), 0 -16px 40px -12px rgba(0,0,0,0.65);"
|
||||
role="region"
|
||||
aria-label="System status bar"
|
||||
>
|
||||
<!-- Top row: user · theme · settings · time -->
|
||||
<div
|
||||
class="col-span-full grid h-[22px] grid-cols-subgrid items-center px-4.5 shadow-[inset_0_-1px_0_var(--bg2)]"
|
||||
>
|
||||
<div class="flex items-center gap-2 justify-self-end">
|
||||
<span aria-hidden="true" class="bg-tgreen h-1.25 w-1.25 shrink-0 rounded-full"></span>
|
||||
<span class="text-fg2 text-[10.5px] font-medium whitespace-nowrap">{username}</span>
|
||||
<span class="text-fg3 text-[10.5px] font-medium whitespace-nowrap">{username}</span>
|
||||
</div>
|
||||
|
||||
<div class="flex min-w-0 items-center gap-2">
|
||||
@@ -74,8 +134,9 @@
|
||||
type="button"
|
||||
aria-label="Settings"
|
||||
class="text-bg4 flex h-5 w-5 shrink-0 items-center justify-center justify-self-end rounded border-0 bg-transparent p-0 text-[12px]"
|
||||
>⚙</button
|
||||
>
|
||||
<Cog color={'var(--fg1)'} size={8} />
|
||||
</button>
|
||||
|
||||
{@render sep('justify-self-center')}
|
||||
|
||||
@@ -84,12 +145,10 @@
|
||||
class="text-bg4 justify-self-start text-[9.5px] whitespace-nowrap"
|
||||
style="font-family:ui-monospace,monospace"
|
||||
>
|
||||
<span class="text-fg3 font-medium">{weekday}</span>
|
||||
<span class="text-fg4 font-medium">{weekday}</span>
|
||||
{time}
|
||||
</time>
|
||||
</div>
|
||||
|
||||
<!-- Bottom row: windows · shortcuts · build · uptime -->
|
||||
<div
|
||||
class="col-span-full grid h-[22px] grid-cols-subgrid items-center rounded-b-lg px-4.5 text-[9.5px] whitespace-nowrap"
|
||||
style="font-family:ui-monospace,monospace"
|
||||
@@ -115,4 +174,4 @@
|
||||
|
||||
<span class="text-bg4 justify-self-start">{uptime}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
hostname = $bindable(),
|
||||
working_dir = $bindable(),
|
||||
mwin = $bindable(),
|
||||
|
||||
close
|
||||
}: {
|
||||
id: number;
|
||||
@@ -40,7 +41,7 @@
|
||||
<Movable
|
||||
{wrapper}
|
||||
{mwinoptions}
|
||||
class="shadow-subtle flex size-full h-256 w-420 flex-col rounded-lg"
|
||||
class="shadow-subtle flex size-full h-128 w-210 flex-col rounded-lg"
|
||||
>
|
||||
<div
|
||||
id="terminal-bar"
|
||||
|
||||
Reference in New Issue
Block a user