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
8 changes: 7 additions & 1 deletion app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ import { fetchHead } from "@/services/api/main"
import { fetchLatestBlocks } from "@/services/api/block"

/** Store */
import { useNodeStore } from "@/store/node"
import { useAppStore } from "@/store/app"
import { useBookmarksStore } from "@/store/bookmarks"
import { useSettingsStore } from "@/store/settings"
const nodeStore = useNodeStore()
const appStore = useAppStore()
const bookmarksStore = useBookmarksStore()
const settingsStore = useSettingsStore()
Expand All @@ -31,6 +33,10 @@ onMounted(async () => {
bookmarksStore.bookmarks = JSON.parse(localStorage.bookmarks)
}

if (localStorage.nodeSettings) {
nodeStore.settings = JSON.parse(localStorage.nodeSettings)
}

const runtimeConfig = useRuntimeConfig()
amp.init(runtimeConfig.public.AMP)

Expand All @@ -55,7 +61,7 @@ onMounted(async () => {
<template>
<CommandMenu :show="appStore.showCmd" />

<NuxtLoadingIndicator height="2" color="#0ade71" />
<NuxtLoadingIndicator :height="2" color="#0ade71" />
<NuxtLayout>
<NuxtPage />

Expand Down
6 changes: 6 additions & 0 deletions assets/icons.json

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions assets/styles/base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,21 @@ $grayscale: (
--txt-tertiary: rgba(255, 255, 255, 35%);
--txt-support: rgba(255, 255, 255, 15%);
--txt-black: rgba(0, 0, 0, 95%);
--txt-semiblack: rgba(0, 0, 0, 45%);
--txt-white: rgba(255, 255, 255, 95%);

/* General */
--brand: #18d2a5;
--blue: #076acd;
--blue: #379bff;
--red: #eb5757;
--dark-red: #592121;
--orange: #ff5a17;
--light-orange: #ff8351;
--yellow: #ffd400;
--yellow: #e6c525;
--green: #0ade71;
--neutral-green: #33a853;
--purple: #5856de;
--mint: #18D2A5;
--mint: #18d2a5;
--neutral-mint: #109373;
--dark-mint: #1e473d;

Expand Down Expand Up @@ -110,7 +111,7 @@ $grayscale: (
--green: #0ade71;
--neutral-green: #33a853;
--purple: #5856de;
--mint: #18D2A5;
--mint: #18d2a5;
--neutral-mint: #109373;
--dark-mint: #1e473d;

Expand Down Expand Up @@ -171,7 +172,7 @@ $grayscale: (
--green: #26c071;
--neutral-green: #33a853;
--purple: #5856de;
--mint: #18D2A5;
--mint: #18d2a5;
--neutral-mint: #109373;
--dark-mint: #1e473d;

Expand Down
1 change: 1 addition & 0 deletions assets/styles/text.scss
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ $textColors: (
"tertiary": "--txt-tertiary",
"support": "--txt-support",
"black": "--txt-black",
"semiblack": "--txt-semiblack",
"white": "--txt-white",
"blue": "--blue",
"orange": "--orange",
Expand Down
22 changes: 22 additions & 0 deletions assets/workers/worker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import init, { run_worker } from "@/services/lumina-node-wasm/index.js"

async function worker_main() {
let queued = []
if (typeof SharedWorkerGlobalScope !== "undefined" && self instanceof SharedWorkerGlobalScope) {
onconnect = (event) => {
queued.push(event)
}
} else {
onmessage = (event) => {
queued.push(event)
}
}

await init()
await run_worker(queued)
}

if (typeof WorkerGlobalScope !== "undefined" && self instanceof WorkerGlobalScope) {
Error.stackTraceLimit = 99
worker_main()
}
5 changes: 4 additions & 1 deletion components/ActionBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import Button from "@/components/ui/Button.vue"
/** Components */
import Search from "@/components/modules/navigation/Search.vue"

/** Utils */
import { isMobile } from "@/services/utils"

/** Store */
import { useAppStore } from "@/store/app"
const appStore = useAppStore()
Expand All @@ -15,7 +18,7 @@ const appStore = useAppStore()
<template>
<Flex wide align="center" justify="between" gap="24" :class="$style.wrapper">
<Flex wide align="center" gap="12">
<Button @click="appStore.showSidebar = !appStore.showSidebar" type="secondary" size="medium" :class="$style.menu_btn">
<Button v-if="isMobile()" @click="appStore.showSidebar = !appStore.showSidebar" type="secondary" size="medium" :class="$style.menu_btn">
<Icon name="menu" size="16" color="primary" />
</Button>

Expand Down
79 changes: 67 additions & 12 deletions components/LeftSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,20 @@ import Button from "@/components/ui/Button.vue"
import { Dropdown, DropdownItem, DropdownTitle, DropdownDivider } from "@/components/ui/Dropdown"

/** Components */
import AdvBanner from "@/components/shared/AdvBanner.vue"
import NavLink from "@/components/modules/navigation/NavLink.vue"

/** Utils */
import { getNetworkName } from "@/services/utils/general"
import { StatusMap } from "@/services/constants/node"
import { isMobile } from "@/services/utils"

/** Store */
import { useAppStore } from "~/store/app"
import { useNodeStore } from "~/store/node"
import { useModalsStore } from "~/store/modals"
const appStore = useAppStore()
const nodeStore = useNodeStore()
const modalsStore = useModalsStore()

const head = computed(() => appStore.lastHead)
Expand Down Expand Up @@ -171,7 +176,7 @@ const handleNavigate = (url) => {
</Flex>
</NuxtLink>

<Button @click="appStore.showSidebar = !appStore.showSidebar" type="secondary" size="mini" :class="$style.close_btn">
<Button v-if="isMobile()" @click="appStore.showSidebar = !appStore.showSidebar" type="secondary" size="mini" :class="$style.close_btn">
<Icon name="close" size="14" color="primary" />
</Button>
</Flex>
Expand Down Expand Up @@ -212,7 +217,7 @@ const handleNavigate = (url) => {
</Flex>
</Flex>

<Flex direction="column" gap="8">
<!-- <Flex direction="column" gap="8">
<Flex align="center" gap="8" style="padding: 0 8px">
<Icon name="stars" size="12" color="tertiary" />
<Text size="12" weight="500" color="tertiary">New things</Text>
Expand All @@ -221,18 +226,30 @@ const handleNavigate = (url) => {
<Flex direction="column" gap="2">
<NavLink v-for="link in newLinks" :link="link" @onClose="appStore.showSidebar = false" />
</Flex>
</Flex>
</Flex> -->

<AdvBanner />
</Flex>

<Flex direction="column" gap="12" style="margin-right: 20px">
<!-- <Flex justify="end" :class="$style.ad">
<Flex justify="end" direction="column" gap="8">
<Text size="12" weight="500" color="brand">Introducing Celenium API</Text>
<Text size="12" weight="500" height="140" color="secondary">
Unlock the power of Celestia: Scalable, Secure and Modular.
</Text>
</Flex>
</Flex> -->
<Flex direction="column" gap="16" style="margin-right: 20px">
<Flex @click="modalsStore.open('lightNode')" align="center" gap="8" justify="between" :class="$style.light_node_btn">
<Flex align="center" gap="8">
<Icon
v-if="nodeStore.status === StatusMap.Started"
name="lumina"
size="14"
color="brand"
:class="$style.light_node_running_icon"
/>
<Icon v-else name="lumina" size="14" color="secondary" />

<Text v-if="nodeStore.status === StatusMap.Started" size="13" weight="600" color="primary">Running</Text>
<Text size="13" weight="600" color="secondary">Node</Text>
</Flex>

<Icon v-if="nodeStore.status !== StatusMap.Started" name="arrow-narrow-right" size="14" color="secondary" />
<Text v-else size="12" weight="600" color="tertiary">{{ nodeStore.percentage.toFixed(0) }}%</Text>
</Flex>

<Dropdown position="end" fullWidth>
<Flex align="center" gap="8" justify="between" :class="$style.network_selector">
Expand Down Expand Up @@ -292,6 +309,7 @@ const handleNavigate = (url) => {
display: flex;

background: var(--app-background);
overflow: auto;

z-index: 100;
}
Expand Down Expand Up @@ -332,6 +350,22 @@ const handleNavigate = (url) => {
}
}

.light_node_btn {
height: 32px;

cursor: pointer;
border-radius: 6px;
background: var(--op-5);

padding: 0 8px;

transition: all 0.2s ease;

&:hover {
background: var(--op-8);
}
}

.network_selector {
height: 32px;

Expand Down Expand Up @@ -360,6 +394,27 @@ const handleNavigate = (url) => {
margin-right: 20px;
}

.light_node_running_icon {
animation: lightNodeIcon 2s ease infinite;
}

@keyframes lightNodeIcon {
0% {
opacity: 1;
filter: drop-shadow(0 0 8px var(--brand));
}

50% {
opacity: 0.3;
filter: drop-shadow(0 0 2px var(--brand));
}

100% {
opacity: 1;
filter: drop-shadow(0 0 8px var(--brand));
}
}

@media (max-width: 1300px) {
.close_btn {
display: flex;
Expand Down
Loading