{#if $hasAccess}
@@ -61,27 +68,7 @@
{#if $connectionStatus == 'connected'}
{:else}
-
-
Welcome to MeshSense!
-
-
Available bluetooth devices will appear on the left
-
If your device is on the network, enter it's IP address in the Device IP field and click Connect.
-
- {#if !$hasAccess}
-
If you do not see the option to connect, you can get access by connecting via localhost or by setting your Access and User key.
- {/if}
-
-
-
-
-
MeshSense {$version}
-
newsVisible.set(true)}>📰
-
showPage('Settings')}>âš™
-
-
+
{/if}
{#if !$expandedMap}
diff --git a/ui/src/Map.svelte b/ui/src/Map.svelte
index 05979d5..4dfb313 100644
--- a/ui/src/Map.svelte
+++ b/ui/src/Map.svelte
@@ -7,7 +7,7 @@
export function getSvgUri(name: string) {
const hexId = parseInt(name).toString(16).padStart(8, '0')
const colorId = hexId.slice(-6)
- return 'data:image/svg+xml;utf8,' + encodeURIComponent(generateHexer({
+ return 'data:image/svg+xml;utf8,' + encodeURIComponent(generateHexer({
name,
borderColor: `#${colorId}`
}))
@@ -25,13 +25,14 @@
-
+
Map
-
-
-
($expandedMap = !$expandedMap)} class="btn font-normal text-xs">{$expandedMap ? 'Collapse' : 'Expand'}
+
+ {#if !isElectron}
+
+ {/if}
-
MeshSense {$version}
-
by Affirmatech
-
♥
-
newsVisible.set(true)}>📰
-
🌎
-
showPage('Settings')}>âš™
+ import { hasAccess } from './lib/util'
+ import Card from './lib/Card.svelte'
+ import ButtonBar from './lib/ButtonBar.svelte'
+ import { isElectron } from './lib/util'
+
+
+
+
+ Welcome
+
+ {#if !isElectron}
+
+ {/if}
+
+
+
+
+
+
+
Welcome to MeshSense!
+
Available bluetooth devices will appear on the left
+
If your device is on the network, enter it's IP address in the Device IP field and click Connect.
+
+ {#if !$hasAccess}
+
If you do not see the option to connect, you can get access by connecting via localhost or by setting your Access and User key.
+ {/if}
+
+
+
+
+
diff --git a/ui/src/app.css b/ui/src/app.css
index 5a957be..b553e44 100644
--- a/ui/src/app.css
+++ b/ui/src/app.css
@@ -48,6 +48,11 @@ h2 {
@apply select-none bg-gradient-to-br from-black to-blue-950 p-1 px-3 font-bold text-white;
}
+.titlebar {
+ @apply fixed flex top-0 left-0 right-0 z-0 select-none justify-center text-center p-2 px-3 font-bold text-white;
+ -webkit-app-region: drag;
+}
+
.header-t {
@apply select-none bg-gradient-to-br from-black to-blue-950 p-1 px-3 font-bold text-white rounded-t;
}
diff --git a/ui/src/lib/ButtonBar.svelte b/ui/src/lib/ButtonBar.svelte
new file mode 100644
index 0000000..faf78b3
--- /dev/null
+++ b/ui/src/lib/ButtonBar.svelte
@@ -0,0 +1,16 @@
+
+
+
+
MeshSense {$version}
+
by Affirmatech
+
♥
+
newsVisible.set(true)}>📰
+
🌎
+
showPage('Settings')}>âš™
+
\ No newline at end of file
diff --git a/ui/src/lib/CustomTitleBar.svelte b/ui/src/lib/CustomTitleBar.svelte
new file mode 100644
index 0000000..88c0ef6
--- /dev/null
+++ b/ui/src/lib/CustomTitleBar.svelte
@@ -0,0 +1,13 @@
+
+
+
+
{$$restProps.title}
+ {#if isElectron}
+
+
+
+ {/if}
+
diff --git a/ui/src/lib/util.ts b/ui/src/lib/util.ts
index 37a3d78..38d0824 100644
--- a/ui/src/lib/util.ts
+++ b/ui/src/lib/util.ts
@@ -6,7 +6,7 @@ import axios from 'axios'
export let blockUserKey = writable(false)
export const userKey = writable(localStorage.getItem('userKey') || '')
-
+export const isElectron = window?.api != null
export const hasAccess = derived([accessKey, userKey], ([$accessKey, $userKey]) => window.location.hostname == 'localhost' || ($accessKey != '' && $accessKey == $userKey))
let failedUserKeyAttempts = 0