Skip to content

Commit 3f35050

Browse files
authored
Merge pull request #92 from celenium-io/dev
v1.15.0
2 parents e7c6c23 + 90c1653 commit 3f35050

34 files changed

+10037
-6524
lines changed

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/ActionBar.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ import Button from "@/components/ui/Button.vue"
77
/** Components */
88
import Search from "@/components/modules/navigation/Search.vue"
99
10+
/** Utils */
11+
import { isMobile } from "@/services/utils"
12+
1013
/** Store */
1114
import { useAppStore } from "@/store/app"
1215
const appStore = useAppStore()
@@ -15,7 +18,7 @@ const appStore = useAppStore()
1518
<template>
1619
<Flex wide align="center" justify="between" gap="24" :class="$style.wrapper">
1720
<Flex wide align="center" gap="12">
18-
<Button @click="appStore.showSidebar = !appStore.showSidebar" type="secondary" size="medium" :class="$style.menu_btn">
21+
<Button v-if="isMobile()" @click="appStore.showSidebar = !appStore.showSidebar" type="secondary" size="medium" :class="$style.menu_btn">
1922
<Icon name="menu" size="16" color="primary" />
2023
</Button>
2124

components/LeftSidebar.vue

Lines changed: 67 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,20 @@ import Button from "@/components/ui/Button.vue"
44
import { Dropdown, DropdownItem, DropdownTitle, DropdownDivider } from "@/components/ui/Dropdown"
55
66
/** Components */
7+
import AdvBanner from "@/components/shared/AdvBanner.vue"
78
import NavLink from "@/components/modules/navigation/NavLink.vue"
89
910
/** Utils */
1011
import { getNetworkName } from "@/services/utils/general"
12+
import { StatusMap } from "@/services/constants/node"
13+
import { isMobile } from "@/services/utils"
1114
1215
/** Store */
1316
import { useAppStore } from "~/store/app"
17+
import { useNodeStore } from "~/store/node"
1418
import { useModalsStore } from "~/store/modals"
1519
const appStore = useAppStore()
20+
const nodeStore = useNodeStore()
1621
const modalsStore = useModalsStore()
1722
1823
const head = computed(() => appStore.lastHead)
@@ -171,7 +176,7 @@ const handleNavigate = (url) => {
171176
</Flex>
172177
</NuxtLink>
173178

174-
<Button @click="appStore.showSidebar = !appStore.showSidebar" type="secondary" size="mini" :class="$style.close_btn">
179+
<Button v-if="isMobile()" @click="appStore.showSidebar = !appStore.showSidebar" type="secondary" size="mini" :class="$style.close_btn">
175180
<Icon name="close" size="14" color="primary" />
176181
</Button>
177182
</Flex>
@@ -212,7 +217,7 @@ const handleNavigate = (url) => {
212217
</Flex>
213218
</Flex>
214219

215-
<Flex direction="column" gap="8">
220+
<!-- <Flex direction="column" gap="8">
216221
<Flex align="center" gap="8" style="padding: 0 8px">
217222
<Icon name="stars" size="12" color="tertiary" />
218223
<Text size="12" weight="500" color="tertiary">New things</Text>
@@ -221,18 +226,30 @@ const handleNavigate = (url) => {
221226
<Flex direction="column" gap="2">
222227
<NavLink v-for="link in newLinks" :link="link" @onClose="appStore.showSidebar = false" />
223228
</Flex>
224-
</Flex>
229+
</Flex> -->
230+
231+
<AdvBanner />
225232
</Flex>
226233

227-
<Flex direction="column" gap="12" style="margin-right: 20px">
228-
<!-- <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> -->
234+
<Flex direction="column" gap="16" style="margin-right: 20px">
235+
<Flex @click="modalsStore.open('lightNode')" align="center" gap="8" justify="between" :class="$style.light_node_btn">
236+
<Flex align="center" gap="8">
237+
<Icon
238+
v-if="nodeStore.status === StatusMap.Started"
239+
name="lumina"
240+
size="14"
241+
color="brand"
242+
:class="$style.light_node_running_icon"
243+
/>
244+
<Icon v-else name="lumina" size="14" color="secondary" />
245+
246+
<Text v-if="nodeStore.status === StatusMap.Started" size="13" weight="600" color="primary">Running</Text>
247+
<Text size="13" weight="600" color="secondary">Node</Text>
248+
</Flex>
249+
250+
<Icon v-if="nodeStore.status !== StatusMap.Started" name="arrow-narrow-right" size="14" color="secondary" />
251+
<Text v-else size="12" weight="600" color="tertiary">{{ nodeStore.percentage.toFixed(0) }}%</Text>
252+
</Flex>
236253

237254
<Dropdown position="end" fullWidth>
238255
<Flex align="center" gap="8" justify="between" :class="$style.network_selector">
@@ -292,6 +309,7 @@ const handleNavigate = (url) => {
292309
display: flex;
293310
294311
background: var(--app-background);
312+
overflow: auto;
295313
296314
z-index: 100;
297315
}
@@ -332,6 +350,22 @@ const handleNavigate = (url) => {
332350
}
333351
}
334352
353+
.light_node_btn {
354+
height: 32px;
355+
356+
cursor: pointer;
357+
border-radius: 6px;
358+
background: var(--op-5);
359+
360+
padding: 0 8px;
361+
362+
transition: all 0.2s ease;
363+
364+
&:hover {
365+
background: var(--op-8);
366+
}
367+
}
368+
335369
.network_selector {
336370
height: 32px;
337371
@@ -360,6 +394,27 @@ const handleNavigate = (url) => {
360394
margin-right: 20px;
361395
}
362396
397+
.light_node_running_icon {
398+
animation: lightNodeIcon 2s ease infinite;
399+
}
400+
401+
@keyframes lightNodeIcon {
402+
0% {
403+
opacity: 1;
404+
filter: drop-shadow(0 0 8px var(--brand));
405+
}
406+
407+
50% {
408+
opacity: 0.3;
409+
filter: drop-shadow(0 0 2px var(--brand));
410+
}
411+
412+
100% {
413+
opacity: 1;
414+
filter: drop-shadow(0 0 8px var(--brand));
415+
}
416+
}
417+
363418
@media (max-width: 1300px) {
364419
.close_btn {
365420
display: flex;

0 commit comments

Comments
 (0)