2024-02-21 13:49:39 -08:00
|
|
|
<script lang="ts">
|
2024-02-25 21:51:33 -08:00
|
|
|
import '@fontsource/roboto/latin.css'
|
|
|
|
import 'material-icons/iconfont/material-icons.css'
|
|
|
|
import Dashboard from './lib/Dashboard/Dashboard.svelte'
|
|
|
|
import 'material-symbols'
|
|
|
|
import AppBar from './lib/Apps/AppBar.svelte'
|
|
|
|
import { appList } from './lib/Apps/appList'
|
|
|
|
import { initializeTelemetry } from './lib/utils/initializeTelemetry'
|
2024-02-28 22:15:04 -08:00
|
|
|
import { onDestroy, onMount } from 'svelte'
|
2024-02-25 21:51:33 -08:00
|
|
|
import { Toaster } from 'svelte-french-toast'
|
|
|
|
import { initializationSequence } from './lib/Sequences/sequences'
|
|
|
|
import Loading from './lib/Loading/Loading.svelte'
|
|
|
|
import { settingsStore } from './lib/stores/settingsStore'
|
|
|
|
import getSettings from './lib/utils/getSettings'
|
2024-02-21 20:10:42 -08:00
|
|
|
|
2024-02-25 21:51:33 -08:00
|
|
|
let activeApp: App = 'camera'
|
2024-02-23 14:56:35 -08:00
|
|
|
|
2024-02-28 22:15:04 -08:00
|
|
|
let unlistenAll: () => void
|
2024-02-24 17:40:47 -08:00
|
|
|
|
2024-02-23 14:56:35 -08:00
|
|
|
onMount(() => {
|
2024-02-25 21:51:33 -08:00
|
|
|
let savedSettings = getSettings()
|
2024-02-24 17:40:47 -08:00
|
|
|
if (savedSettings !== false) {
|
2024-02-25 21:51:33 -08:00
|
|
|
settingsStore.set(savedSettings)
|
2024-02-24 17:40:47 -08:00
|
|
|
}
|
2024-02-25 21:51:33 -08:00
|
|
|
window.ResizeObserver = ResizeObserver
|
2024-02-25 01:29:59 -08:00
|
|
|
// disabled while migrating away from python
|
2024-03-06 23:55:35 -08:00
|
|
|
initializeTelemetry().then((unsubFunction: () => void) => {
|
2024-02-28 22:15:04 -08:00
|
|
|
unlistenAll = unsubFunction
|
|
|
|
})
|
2024-03-10 23:35:27 -07:00
|
|
|
setTimeout(initializationSequence, 3000)
|
2024-02-28 22:15:04 -08:00
|
|
|
|
2024-03-06 23:55:35 -08:00
|
|
|
settingsStore.subscribe((value) => {
|
2024-02-28 22:15:04 -08:00
|
|
|
localStorage.setItem('settings', JSON.stringify(value))
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
onDestroy(() => {
|
|
|
|
unlistenAll && unlistenAll()
|
2024-02-25 21:51:33 -08:00
|
|
|
})
|
2024-02-21 13:49:39 -08:00
|
|
|
</script>
|
|
|
|
|
2024-03-10 23:35:27 -07:00
|
|
|
<main class="select-none transition-opacity duration-300">
|
2024-02-21 20:10:42 -08:00
|
|
|
<!-- driver dashboard -->
|
|
|
|
<div class="h-screen w-[35vw] fixed shadow-lg shadow-slate-800 z-10">
|
|
|
|
<Dashboard />
|
|
|
|
</div>
|
|
|
|
<!-- the infotainment system -->
|
2024-02-25 01:44:35 -08:00
|
|
|
<div class="min-h-screen w-[65vw] right-0 absolute infotainment-container">
|
2024-02-21 20:10:42 -08:00
|
|
|
<!-- dynamic app system (edit appList.ts to add new apps) -->
|
2024-02-25 01:44:35 -08:00
|
|
|
<div class="mx-10 mt-10 overflow-hidden">
|
2024-02-21 20:10:42 -08:00
|
|
|
<svelte:component this={appList[activeApp].component} />
|
|
|
|
</div>
|
2024-02-25 01:44:35 -08:00
|
|
|
<div class="fixed w-[65vw] flex justify-center right-0 bottom-0 mb-4">
|
2024-02-21 20:10:42 -08:00
|
|
|
<AppBar bind:activeApp {appList} />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</main>
|
2024-02-21 13:49:39 -08:00
|
|
|
|
2024-02-25 01:44:35 -08:00
|
|
|
<!-- toast service -->
|
2024-02-24 17:40:47 -08:00
|
|
|
<Toaster />
|
|
|
|
|
2024-02-21 14:19:36 -08:00
|
|
|
<style lang="postcss">
|
|
|
|
main {
|
2024-02-25 21:51:33 -08:00
|
|
|
font-family: 'Roboto', sans-serif;
|
2024-02-21 14:19:36 -08:00
|
|
|
}
|
2024-02-21 20:10:42 -08:00
|
|
|
|
|
|
|
.infotainment-container {
|
2024-03-08 11:44:39 -08:00
|
|
|
background-image: url('./assets/wallpaper.jpg');
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
background-size: cover;
|
2024-02-25 01:05:44 -08:00
|
|
|
/* hide scrollbar */
|
|
|
|
-ms-overflow-style: none;
|
|
|
|
scrollbar-width: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.infotainment-container::-webkit-scrollbar {
|
|
|
|
/* hide scrollbar */
|
|
|
|
display: none;
|
2024-02-21 20:10:42 -08:00
|
|
|
}
|
2024-02-21 13:49:39 -08:00
|
|
|
</style>
|