Skip to content
This repository was archived by the owner on Jun 19, 2025. It is now read-only.

Commit 1163391

Browse files
authored
Merge pull request #37 from vleerapp/dev/db-types-rewrite
2 parents 75e5d56 + 3d694d4 commit 1163391

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+3644
-2119
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ package.json
2828
src-tauri/gen/
2929
bun.lockb
3030
src-tauri/src/main copy.rs
31+
deno.lock

app.vue

Lines changed: 13 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -7,52 +7,24 @@
77

88
<script lang="ts" setup>
99
import { register, unregister, isRegistered } from '@tauri-apps/plugin-global-shortcut';
10-
const { $music, $settings } = useNuxtApp();
11-
await $music.init();
12-
13-
window.addEventListener('error', (e) => {
14-
if (e.target instanceof HTMLAudioElement) {
15-
const mediaError = e.target.error;
16-
if (mediaError) {
17-
console.error("Global error handler: Error with audio element:", mediaError);
18-
console.error("Global error handler: MediaError code:", mediaError.code);
19-
switch (mediaError.code) {
20-
case mediaError.MEDIA_ERR_ABORTED:
21-
console.error("Global error handler: The fetching process for the media resource was aborted by the user agent at the user's request.");
22-
break;
23-
case mediaError.MEDIA_ERR_NETWORK:
24-
console.error("Global error handler: A network error caused the user agent to stop fetching the media resource, after the resource was established to be usable.");
25-
break;
26-
case mediaError.MEDIA_ERR_DECODE:
27-
console.error("Global error handler: An error of some description occurred while decoding the media resource, after the resource was established to be usable.");
28-
break;
29-
case mediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:
30-
console.error("Global error handler: The media resource indicated by the src attribute or assigned media provider object was not suitable.");
31-
break;
32-
default:
33-
console.error("Global error handler: An unknown error occurred.");
34-
break;
35-
}
36-
}
37-
}
38-
}, true);
10+
import initializeSettings from '~/plugins/settings';
3911
40-
const isTextInputFocused = ref(false);
12+
const { $player, $settings } = useNuxtApp();
4113
4214
onMounted(async () => {
15+
await initializeSettings(useNuxtApp())
16+
4317
document.addEventListener('keydown', handleKeyDown);
4418
document.addEventListener('focusin', updateFocus);
4519
document.addEventListener('focusout', updateFocus);
4620
47-
await $settings.init();
48-
4921
if (await isRegistered("MediaPlayPause")) {
5022
await unregister("MediaPlayPause")
5123
}
5224
5325
await register('MediaPlayPause', (event) => {
5426
if (event.state === "Pressed") {
55-
$music.playPause()
27+
$player.playPause()
5628
}
5729
});
5830
@@ -62,7 +34,7 @@ onMounted(async () => {
6234
6335
await register('MediaTrackNext', (event) => {
6436
if (event.state === "Pressed") {
65-
$music.skip()
37+
$player.skip()
6638
}
6739
});
6840
@@ -72,7 +44,7 @@ onMounted(async () => {
7244
7345
await register('MediaTrackPrevious', (event) => {
7446
if (event.state === "Pressed") {
75-
$music.rewind();
47+
$player.rewind();
7648
}
7749
});
7850
});
@@ -90,14 +62,16 @@ onUnmounted(async () => {
9062
await unregister("MediaTrackNext")
9163
}
9264
93-
// if (await isRegistered("MediaTrackPrevious")) {
94-
// await unregister("MediaTrackPrevious")
95-
// }
65+
if (await isRegistered("MediaTrackPrevious")) {
66+
await unregister("MediaTrackPrevious")
67+
}
9668
});
9769
70+
const isTextInputFocused = ref(false);
71+
9872
function handleKeyDown(event: KeyboardEvent) {
9973
if (event.code === 'Space' && !isTextInputFocused.value) {
100-
$music.playPause();
74+
$player.playPause();
10175
event.preventDefault();
10276
}
10377
}

assets/styles/_variables.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ $transition-time: .1s;
33

44
$playersize: 100px;
55
$sidebar-width: 270px;
6-
$titlebar-height: 28px;
6+
$titlebar-height: 33px;
77

88
$accent: #A058FF;
99
$accent_hover: #7541BB;
@@ -17,4 +17,4 @@ $foreground: #535353;
1717
$element: #1A1A1A;
1818

1919
$titlebar-button-hover: #ffffff24;
20-
$titlebar-button-hover-red: #f23f42;
20+
$titlebar-button-hover-red: #f23f42;

assets/styles/components/library.scss

Lines changed: 34 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,6 @@
1414
padding: 16px;
1515
position: relative;
1616

17-
.top {
18-
display: flex;
19-
flex-direction: row;
20-
align-items: center;
21-
height: 18px;
22-
padding-inline: 12px;
23-
}
24-
25-
.create-playlist {
26-
text-decoration: none;
27-
background-color: transparent;
28-
outline: none;
29-
border: none;
30-
display: flex;
31-
color: v.$text;
32-
}
33-
34-
.create-playlist:hover {
35-
color: v.$text-bright;
36-
}
37-
3817
.link {
3918
display: flex;
4019
justify-content: left;
@@ -43,6 +22,7 @@
4322
transition: all 0.2s;
4423
color: v.$text;
4524
user-select: none;
25+
text-decoration: none;
4626
}
4727

4828
.link svg {
@@ -55,6 +35,38 @@
5535
transition: all 0.2s;
5636
}
5737

38+
.top {
39+
display: flex;
40+
flex-direction: column;
41+
padding-inline: 8px;
42+
gap: 14px;
43+
}
44+
45+
.playlist-icon {
46+
display: flex;
47+
align-items: center;
48+
gap: 12px;
49+
}
50+
51+
.playlists {
52+
justify-content: space-between;
53+
display: flex;
54+
width: 100%;
55+
}
56+
57+
.create-playlist {
58+
text-decoration: none;
59+
background-color: transparent;
60+
outline: none;
61+
border: none;
62+
display: flex;
63+
color: v.$text;
64+
}
65+
66+
.create-playlist:hover {
67+
color: v.$text-bright;
68+
}
69+
5870
.search-container {
5971
width: 100%;
6072
height: 32px;
@@ -106,4 +118,4 @@
106118
width: 32px;
107119
height: 32px;
108120
}
109-
}
121+
}

assets/styles/components/pages.scss renamed to assets/styles/components/navbar.scss

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
@use "~/assets/styles/variables" as v;
22

3-
.pages {
3+
.navbar {
44
display: flex;
5-
flex-direction: column;
5+
flex-direction: row;
66
text-decoration: none;
77
gap: 14px;
88
font-size: 14px;
9-
width: v.$sidebar-width;
10-
padding-left: 28px !important;
9+
padding: 16px;
10+
justify-content: space-between;
11+
12+
.links {
13+
display: flex;
14+
flex-direction: row;
15+
gap: 32px;
16+
}
1117

1218
.link {
1319
display: flex;
1420
align-items: center;
15-
gap: 12px;
21+
gap: 10px;
1622
transition: all 0.2s;
1723
color: v.$text;
1824
user-select: none;
@@ -47,3 +53,32 @@
4753
transition: all 0.2s;
4854
}
4955
}
56+
57+
.search-container {
58+
width: 268px;
59+
height: 32px;
60+
background-color: v.$element;
61+
outline: none;
62+
border: none;
63+
display: grid;
64+
grid-template-columns: 16px 1fr;
65+
padding-inline: 8px;
66+
gap: 9px;
67+
align-items: center;
68+
color: v.$text;
69+
margin-left: -8px;
70+
71+
.icon {
72+
width: 16px;
73+
height: 16px;
74+
}
75+
76+
.input {
77+
background-color: transparent;
78+
border: none;
79+
font-size: 14px;
80+
outline: none;
81+
color: #8b8b8b;
82+
height: 32px;
83+
}
84+
}

assets/styles/layouts/default_layout.scss

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
color: v.$text-muted;
1717
user-select: none;
1818
transition: color v.$transition-time;
19+
z-index: 10;
1920
}
2021

2122
&:hover {
@@ -36,28 +37,28 @@
3637
padding-top: v.$titlebar-height + 5px;
3738
position: relative;
3839

39-
.pages {
40+
.navbar {
4041
position: fixed;
41-
top: v.$titlebar-height + 5px;
42-
left: v.$spacing;
43-
width: v.$sidebar-width;
44-
height: 148px;
42+
top: v.$titlebar-height;
43+
left: v.$spacing * 2 + v.$sidebar-width;
44+
width: calc(100% - (v.$spacing * 3 + v.$sidebar-width));
45+
height: 50px;
4546
}
4647

4748
.library {
4849
position: fixed;
49-
top: v.$titlebar-height + 5px + 148px + v.$spacing;
50+
top: v.$titlebar-height;
5051
left: v.$spacing;
5152
width: v.$sidebar-width;
52-
height: calc(100vh - (v.$titlebar-height + 5px + (v.$spacing * 3) + v.$playersize + 148px));
53+
height: calc(100vh - (v.$titlebar-height + (v.$spacing * 2) + v.$playersize));
5354
}
5455

5556
.main {
5657
position: fixed;
57-
top: v.$titlebar-height + 5px;
58+
top: v.$titlebar-height + 50px + v.$spacing;
5859
left: v.$sidebar-width + (v.$spacing * 2);
5960
width: calc(100vw - (v.$spacing * 3 + v.$sidebar-width));
60-
height: calc(100vh - (v.$titlebar-height + 5px + (v.$spacing * 2) + v.$playersize));
61+
height: calc(100vh - (v.$titlebar-height + 50px + (v.$spacing * 3) + v.$playersize));
6162
}
6263

6364
.player {

0 commit comments

Comments
 (0)