Skip to content

Commit 0b6b983

Browse files
authored
Merge pull request #91 from celenium-io/lumina
Lumina
2 parents 4e801ed + 44874fe commit 0b6b983

25 files changed

Lines changed: 9778 additions & 6512 deletions

app.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ import { fetchHead } from "@/services/api/main"
1313
import { fetchLatestBlocks } from "@/services/api/block"
1414
1515
/** Store */
16+
import { useNodeStore } from "@/store/node"
1617
import { useAppStore } from "@/store/app"
1718
import { useBookmarksStore } from "@/store/bookmarks"
1819
import { useSettingsStore } from "@/store/settings"
20+
const nodeStore = useNodeStore()
1921
const appStore = useAppStore()
2022
const bookmarksStore = useBookmarksStore()
2123
const settingsStore = useSettingsStore()
@@ -31,6 +33,10 @@ onMounted(async () => {
3133
bookmarksStore.bookmarks = JSON.parse(localStorage.bookmarks)
3234
}
3335
36+
if (localStorage.nodeSettings) {
37+
nodeStore.settings = JSON.parse(localStorage.nodeSettings)
38+
}
39+
3440
const runtimeConfig = useRuntimeConfig()
3541
amp.init(runtimeConfig.public.AMP)
3642
@@ -55,7 +61,7 @@ onMounted(async () => {
5561
<template>
5662
<CommandMenu :show="appStore.showCmd" />
5763

58-
<NuxtLoadingIndicator height="2" color="#0ade71" />
64+
<NuxtLoadingIndicator :height="2" color="#0ade71" />
5965
<NuxtLayout>
6066
<NuxtPage />
6167

assets/icons.json

Lines changed: 6 additions & 0 deletions
Large diffs are not rendered by default.

assets/styles/base.scss

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,21 @@ $grayscale: (
2828
--txt-tertiary: rgba(255, 255, 255, 35%);
2929
--txt-support: rgba(255, 255, 255, 15%);
3030
--txt-black: rgba(0, 0, 0, 95%);
31+
--txt-semiblack: rgba(0, 0, 0, 45%);
3132
--txt-white: rgba(255, 255, 255, 95%);
3233

3334
/* General */
3435
--brand: #18d2a5;
35-
--blue: #076acd;
36+
--blue: #379bff;
3637
--red: #eb5757;
3738
--dark-red: #592121;
3839
--orange: #ff5a17;
3940
--light-orange: #ff8351;
40-
--yellow: #ffd400;
41+
--yellow: #e6c525;
4142
--green: #0ade71;
4243
--neutral-green: #33a853;
4344
--purple: #5856de;
44-
--mint: #18D2A5;
45+
--mint: #18d2a5;
4546
--neutral-mint: #109373;
4647
--dark-mint: #1e473d;
4748

@@ -110,7 +111,7 @@ $grayscale: (
110111
--green: #0ade71;
111112
--neutral-green: #33a853;
112113
--purple: #5856de;
113-
--mint: #18D2A5;
114+
--mint: #18d2a5;
114115
--neutral-mint: #109373;
115116
--dark-mint: #1e473d;
116117

@@ -171,7 +172,7 @@ $grayscale: (
171172
--green: #26c071;
172173
--neutral-green: #33a853;
173174
--purple: #5856de;
174-
--mint: #18D2A5;
175+
--mint: #18d2a5;
175176
--neutral-mint: #109373;
176177
--dark-mint: #1e473d;
177178

assets/styles/text.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ $textColors: (
5555
"tertiary": "--txt-tertiary",
5656
"support": "--txt-support",
5757
"black": "--txt-black",
58+
"semiblack": "--txt-semiblack",
5859
"white": "--txt-white",
5960
"blue": "--blue",
6061
"orange": "--orange",

assets/workers/worker.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import init, { run_worker } from "@/services/lumina-node-wasm/index.js"
2+
3+
async function worker_main() {
4+
let queued = []
5+
if (typeof SharedWorkerGlobalScope !== "undefined" && self instanceof SharedWorkerGlobalScope) {
6+
onconnect = (event) => {
7+
queued.push(event)
8+
}
9+
} else {
10+
onmessage = (event) => {
11+
queued.push(event)
12+
}
13+
}
14+
15+
await init()
16+
await run_worker(queued)
17+
}
18+
19+
if (typeof WorkerGlobalScope !== "undefined" && self instanceof WorkerGlobalScope) {
20+
Error.stackTraceLimit = 99
21+
worker_main()
22+
}

components/LeftSidebar.vue

Lines changed: 68 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,14 @@ import NavLink from "@/components/modules/navigation/NavLink.vue"
88
99
/** Utils */
1010
import { getNetworkName } from "@/services/utils/general"
11+
import { StatusMap } from "@/services/constants/node"
1112
1213
/** Store */
1314
import { useAppStore } from "~/store/app"
15+
import { useNodeStore } from "~/store/node"
1416
import { useModalsStore } from "~/store/modals"
1517
const appStore = useAppStore()
18+
const nodeStore = useNodeStore()
1619
const modalsStore = useModalsStore()
1720
1821
const head = computed(() => appStore.lastHead)
@@ -224,15 +227,34 @@ const handleNavigate = (url) => {
224227
</Flex>
225228
</Flex>
226229

227-
<Flex direction="column" gap="12" style="margin-right: 20px">
230+
<Flex direction="column" gap="16" style="margin-right: 20px">
231+
<Flex @click="modalsStore.open('lightNode')" align="center" gap="8" justify="between" :class="$style.light_node_btn">
232+
<Flex align="center" gap="8">
233+
<Icon
234+
v-if="nodeStore.status === StatusMap.Started"
235+
name="lumina"
236+
size="14"
237+
color="brand"
238+
:class="$style.light_node_running_icon"
239+
/>
240+
<Icon v-else name="lumina" size="14" color="secondary" />
241+
242+
<Text v-if="nodeStore.status === StatusMap.Started" size="13" weight="600" color="primary">Running</Text>
243+
<Text size="13" weight="600" color="secondary">Node</Text>
244+
</Flex>
245+
246+
<Icon v-if="nodeStore.status !== StatusMap.Started" name="arrow-narrow-right" size="14" color="secondary" />
247+
<Text v-else size="12" weight="600" color="tertiary">{{ nodeStore.percentage.toFixed(0) }}%</Text>
248+
</Flex>
249+
228250
<!-- <Flex justify="end" :class="$style.ad">
229-
<Flex justify="end" direction="column" gap="8">
230-
<Text size="12" weight="500" color="brand">Introducing Celenium API</Text>
231-
<Text size="12" weight="500" height="140" color="secondary">
232-
Unlock the power of Celestia: Scalable, Secure and Modular.
233-
</Text>
234-
</Flex>
235-
</Flex> -->
251+
<Flex justify="end" direction="column" gap="8">
252+
<Text size="12" weight="500" color="brand">Introducing Celenium API</Text>
253+
<Text size="12" weight="500" height="140" color="secondary">
254+
Unlock the power of Celestia: Scalable, Secure and Modular.
255+
</Text>
256+
</Flex>
257+
</Flex> -->
236258

237259
<Dropdown position="end" fullWidth>
238260
<Flex align="center" gap="8" justify="between" :class="$style.network_selector">
@@ -292,6 +314,7 @@ const handleNavigate = (url) => {
292314
display: flex;
293315
294316
background: var(--app-background);
317+
overflow: auto;
295318
296319
z-index: 100;
297320
}
@@ -332,6 +355,22 @@ const handleNavigate = (url) => {
332355
}
333356
}
334357
358+
.light_node_btn {
359+
height: 32px;
360+
361+
cursor: pointer;
362+
border-radius: 6px;
363+
background: var(--op-5);
364+
365+
padding: 0 8px;
366+
367+
transition: all 0.2s ease;
368+
369+
&:hover {
370+
background: var(--op-8);
371+
}
372+
}
373+
335374
.network_selector {
336375
height: 32px;
337376
@@ -360,6 +399,27 @@ const handleNavigate = (url) => {
360399
margin-right: 20px;
361400
}
362401
402+
.light_node_running_icon {
403+
animation: lightNodeIcon 2s ease infinite;
404+
}
405+
406+
@keyframes lightNodeIcon {
407+
0% {
408+
opacity: 1;
409+
filter: drop-shadow(0 0 8px var(--brand));
410+
}
411+
412+
50% {
413+
opacity: 0.3;
414+
filter: drop-shadow(0 0 2px var(--brand));
415+
}
416+
417+
100% {
418+
opacity: 1;
419+
filter: drop-shadow(0 0 8px var(--brand));
420+
}
421+
}
422+
363423
@media (max-width: 1300px) {
364424
.close_btn {
365425
display: flex;

0 commit comments

Comments
 (0)