Skip to content

Commit 3d8c43a

Browse files
committed
feat: add current time display and update functionality in layout and guardian panel
1 parent 7c15f0f commit 3d8c43a

File tree

3 files changed

+189
-133
lines changed

3 files changed

+189
-133
lines changed

omarchy-theme-builder

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 6d5f14b0cb234514f09e18961ddb291be712245b

src/lib/components/Layout.svelte

Lines changed: 71 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,44 @@
66
import Viewport from './panels/Viewport.svelte';
77
88
let layoutRef: HTMLDivElement;
9+
let currentTime = '';
10+
11+
function updateTime() {
12+
const now = new Date();
13+
const days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
14+
const dayName = days[now.getDay()];
15+
const hours = now.getHours().toString().padStart(2, '0');
16+
const minutes = now.getMinutes().toString().padStart(2, '0');
17+
currentTime = `${dayName} ${hours}:${minutes}`;
18+
}
919
1020
onMount(() => {
11-
// Apply theme variables to layout (from omarchy-theme-builder)
21+
// Apply theme variables to layout
1222
cssVariables.subscribe((variables) => {
1323
if (layoutRef) {
1424
Object.entries(variables).forEach(([key, value]) => {
1525
layoutRef.style.setProperty(key, value);
1626
});
1727
}
1828
});
29+
30+
// Update time immediately and then every second
31+
updateTime();
32+
const timeInterval = setInterval(updateTime, 1000);
33+
34+
return () => {
35+
clearInterval(timeInterval);
36+
};
1937
});
2038
</script>
2139

2240
<div
2341
bind:this={layoutRef}
24-
class="layout-container w-screen h-screen overflow-hidden relative"
25-
style="font-family: 'Inter', sans-serif;"
42+
class="desktop-container w-screen h-screen overflow-hidden relative"
43+
style="font-family: 'JetBrains Mono', 'SF Mono', 'Cascadia Code', monospace;"
2644
>
27-
<!-- Background (adapted from omarchy-theme-builder) -->
28-
<div class="layout-background absolute inset-0">
45+
<!-- Desktop Background -->
46+
<div class="desktop-background absolute inset-0">
2947
<div
3048
class="absolute inset-0"
3149
style="
@@ -39,34 +57,58 @@
3957
></div>
4058
</div>
4159

42-
<!-- Top Bar -->
60+
<!-- Top Bar (Waybar-style) -->
4361
<div
44-
class="top-bar h-12 flex items-center justify-between px-6 border-b relative z-20"
62+
class="top-bar h-8 flex items-center justify-between px-4 text-xs border-b frosted-glass relative z-20"
4563
style="
46-
background: var(--petalytics-surface);
64+
background: rgba(31, 29, 46, 0.8);
4765
border-color: var(--petalytics-border);
4866
color: var(--petalytics-text);
67+
backdrop-filter: blur(12px);
68+
-webkit-backdrop-filter: blur(12px);
4969
"
5070
>
51-
<div class="flex items-center space-x-3">
71+
<!-- Left: Workspaces / Logo -->
72+
<div class="flex items-center space-x-4">
5273
<div
53-
class="w-8 h-8 rounded-full bg-gradient-to-r from-green-400 to-blue-500 flex items-center justify-center"
74+
class="px-2 h-5 flex items-center justify-center text-xs font-mono"
75+
style="background: var(--petalytics-pine); color: var(--petalytics-bg);"
5476
>
55-
<span class="text-white font-bold text-sm">🐾</span>
77+
🐾
5678
</div>
57-
<h1 class="text-lg font-semibold" style="color: var(--petalytics-text);">Petalytics</h1>
79+
<span class="font-mono" style="color: var(--petalytics-foam);">petalytics@desktop</span>
5880
</div>
5981

60-
<div class="text-sm" style="color: var(--petalytics-subtle);">Pet Journal & AI Insights</div>
82+
<!-- Center: Current Time -->
83+
<div class="font-mono font-medium" style="color: var(--petalytics-subtle);">
84+
{currentTime}
85+
</div>
86+
87+
<!-- Right: System Status -->
88+
<div class="flex items-center space-x-3 text-xs font-mono">
89+
<div class="flex items-center space-x-1">
90+
<span style="color: var(--petalytics-foam);">●</span>
91+
<span style="color: var(--petalytics-subtle);">journal</span>
92+
</div>
93+
<div class="flex items-center space-x-1">
94+
<span style="color: var(--petalytics-gold);">●</span>
95+
<span style="color: var(--petalytics-subtle);">ai</span>
96+
</div>
97+
</div>
6198
</div>
6299

63-
<!-- Main 3-Panel Layout -->
64-
<div class="main-layout flex h-full gap-4 p-4 relative z-10" style="height: calc(100vh - 3rem);">
100+
<!-- Main Layout -->
101+
<div
102+
class="main-layout flex h-full gap-2 p-2 relative z-10"
103+
style="height: calc(100vh - 2rem);"
104+
>
65105
<!-- Left Column: Stacked Panels -->
66-
<div class="left-column flex flex-col gap-4 w-1/2 lg:w-2/5">
106+
<div class="left-column flex flex-col gap-2 flex-1">
107+
<!-- Guardian Panel -->
67108
<div class="guardian-panel flex-1 frosted-panel">
68109
<GuardianPanel />
69110
</div>
111+
<!-- Pet Panel -->
70112
<div class="pet-panel flex-1 frosted-panel">
71113
<PetPanel />
72114
</div>
@@ -81,17 +123,18 @@
81123

82124
<style>
83125
.frosted-panel {
84-
background: var(--petalytics-surface);
85-
border: 1px solid var(--petalytics-border);
86-
border-radius: 12px;
87-
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
88-
overflow: hidden;
126+
background: rgba(25, 23, 36, 0.9);
127+
border: 1px solid rgba(38, 35, 58, 0.5);
89128
backdrop-filter: blur(16px);
90129
-webkit-backdrop-filter: blur(16px);
130+
border-radius: 0;
131+
overflow: hidden;
91132
}
92133
93134
.left-column {
94135
min-height: 0;
136+
width: 400px;
137+
flex-shrink: 0;
95138
}
96139
97140
.left-column .guardian-panel,
@@ -100,19 +143,23 @@
100143
max-height: 55%;
101144
}
102145
146+
.viewport-column {
147+
flex: 1;
148+
min-width: 0;
149+
}
150+
103151
@media (max-width: 768px) {
104152
.main-layout {
105153
flex-direction: column;
106-
gap: 16px;
154+
gap: 8px;
107155
}
108156
.left-column {
109157
width: 100%;
110158
flex-direction: row;
111159
height: 40%;
112-
gap: 16px;
160+
gap: 8px;
113161
}
114162
.viewport-column {
115-
width: 100%;
116163
height: 60%;
117164
}
118165
}

0 commit comments

Comments
 (0)