From 4f7b9224280725c688d6f68469ec1b697e3aef8b Mon Sep 17 00:00:00 2001 From: adb-sh Date: Thu, 20 Oct 2022 23:29:32 +0200 Subject: [PATCH] add darkmode and progress bar --- src/App.vue | 16 ++++-- src/components/CurrentlyPlaying.vue | 61 ++++++++++++---------- src/components/CurrentlyPlayingCompact.vue | 6 +++ src/components/DarkmodeToggle.vue | 23 ++++++++ src/components/PromiseResolver.vue | 3 +- src/components/TimeFormatter.vue | 30 +++++++++++ src/components/TrackProgressBar.vue | 52 ++++++++++++++++++ src/main.scss | 5 +- src/main.ts | 6 +++ src/views/UserPage.vue | 10 ++-- 10 files changed, 168 insertions(+), 44 deletions(-) create mode 100644 src/components/DarkmodeToggle.vue create mode 100644 src/components/TimeFormatter.vue create mode 100644 src/components/TrackProgressBar.vue diff --git a/src/App.vue b/src/App.vue index beadaf7..e475119 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,9 +1,13 @@ + + diff --git a/src/main.scss b/src/main.scss index ba37eea..2abf11c 100644 --- a/src/main.scss +++ b/src/main.scss @@ -1,8 +1,7 @@ -@import "bootstrap/scss/bootstrap.scss"; -//@import "bootstrap-darkmode/scss/darktheme.scss"; +@import "../node_modules/bootstrap/scss/bootstrap.scss"; +@import "../node_modules/bootstrap-darkmode/scss/darktheme.scss"; html, body { - //background-color: $dark-body-bg; line-break: loose; word-break: break-word; } diff --git a/src/main.ts b/src/main.ts index 4bb0f5b..ce56991 100644 --- a/src/main.ts +++ b/src/main.ts @@ -3,6 +3,12 @@ import App from "./App.vue"; import "./registerServiceWorker"; import router from "./router"; import { createApi } from "@/Api"; +import 'bootstrap-icons/font/bootstrap-icons.scss'; +import './main.scss'; +import { ThemeConfig } from 'bootstrap-darkmode'; + +export const themeConfig = new ThemeConfig(); +themeConfig.initTheme(); createApp(App) .use(router) diff --git a/src/views/UserPage.vue b/src/views/UserPage.vue index 1d1e496..2af7062 100644 --- a/src/views/UserPage.vue +++ b/src/views/UserPage.vue @@ -13,7 +13,7 @@ const userInfo = ref(api?.getUserInfo(route.params.id as string)); let refreshUserInfo = setInterval(() => { userInfo.value = api?.getUserInfo(route.params.id as string); -}, 20000); +}, 10000); onBeforeUnmount(() => { clearInterval(refreshUserInfo); @@ -43,10 +43,7 @@ onBeforeUnmount(() => { v-slot="{ data: { user, currentlyPlaying } }" class="row" > -
- -
-
+
{{ user.displayName }} @@ -80,6 +77,9 @@ onBeforeUnmount(() => {

Currently listening to:

+

+ {{ user.displayName }} is not listening to music. +