-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.svelte
More file actions
118 lines (102 loc) · 3.21 KB
/
App.svelte
File metadata and controls
118 lines (102 loc) · 3.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<!-- App.svelte -->
<script>
import { onMount, onDestroy } from "svelte";
import { initializeRouteService, pathName, navigateTo, component, componentParams } from "./lib/scripts/routeService.js";
import PlayerBarComponent from "./lib/components/PlayerBarComponent.svelte";
import Modals from "./lib/components/Modals.svelte";
import { initializePlaylistService } from "./lib/scripts/playlistService.js";
import { initializePlaybackService } from "./lib/scripts/playbackService.js";
import { initializeMediaSessionService } from "./lib/scripts/mediasessionService.js";
$: $pathName;
$: $component;
// @ts-ignore
const version = __APP_VERSION__;
onMount(() => {
async function initializeServices() {
initializeRouteService();
await initializePlaylistService();
initializePlaybackService();
initializeMediaSessionService();
}
initializeServices();
});
// This is a temporary function to handle refresh logic.
// It can be replaced with a more specific implementation later.
async function refresh() {}
</script>
<div class="app-layout bg-dark">
<!-- Sticky Top Bar -->
<header class="top-bar">
<div class="container-fluid h-100">{$pathName} <span style="font-size: 0.8rem;">(v{version})</span></div>
</header>
<!-- Scrollable Content -->
<main class="scrollable-content">
<div class="container-fluid">
<svelte:component this={$component} {...$componentParams} />
</div>
</main>
<!-- Sticky Player Bar -->
<PlayerBarComponent />
<!-- Sticky Bottom Bar -->
<footer class="bottom-bar">
<div class="row w-100">
<div class="col-6">
<button aria-label="empty storage" class="btn btn-dark w-100" on:click={refresh}><i class="fa-solid fa-trash"></i></button>
</div>
<div class="col-6">
<button aria-label="home" class="btn btn-dark w-100" on:click={() => navigateTo("/Home")}><i class="fa-solid fa-house"></i></button>
</div>
</div>
</footer>
</div>
<Modals />
<audio id="audio-player" preload="none" style="display: none;"></audio>
<style>
.app-layout {
display: flex;
flex-direction: column;
height: 100vh;
width: 100vw;
}
.bottom-bar button {
font-size: 1.2rem;
max-height: 3rem;
border: none !important;
}
.top-bar {
flex: 0 0 auto;
padding: 1rem;
position: sticky;
height: 3.5rem;
top: 0;
z-index: 10;
text-align: center;
border-bottom: 0.2rem solid #5bbd99;
border-bottom-left-radius: 1.5rem;
border-bottom-right-radius: 1.5rem;
}
.scrollable-content {
flex: 1 1 auto;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
padding: 1rem 1rem 3rem; /* 👈 Important: bottom padding to make space for bottom bar */
}
.bottom-bar {
flex: 0 0 auto;
padding: 0.5rem;
position: sticky;
bottom: 0;
z-index: 10;
display: flex;
justify-content: center;
border-top: 0.2rem solid #5bbd99;
border-top-left-radius: 1.5rem;
border-top-right-radius: 1.5rem;
height: 3.8rem; /* Optional: define fixed height if needed for padding calc */
}
.bottom-bar button {
font-weight: bolder;
border: 0.1rem solid #5bbd99 !important;
background-color: #343a40 !important;
}
</style>