diff --git a/src/App.vue b/src/App.vue index 12d75d5..99ea966 100644 --- a/src/App.vue +++ b/src/App.vue @@ -8,8 +8,8 @@ - + + @@ -98,93 +98,10 @@ export default { diff --git a/src/assets/css/global.scss b/src/assets/css/global.scss new file mode 100644 index 0000000..00c3915 --- /dev/null +++ b/src/assets/css/global.scss @@ -0,0 +1,135 @@ +@font-face { + font-family: 'Barlow'; + font-weight: normal; + src: url('~@/assets/fonts/Barlow-Regular.woff2') format('woff2'), + url('~@/assets/fonts/Barlow-Regular.ttf') format('truetype'); +} +@font-face { + font-family: 'Barlow'; + font-weight: medium; + src: url('~@/assets/fonts/Barlow-Medium.woff2') format('woff2'), + url('~@/assets/fonts/Barlow-Medium.ttf') format('truetype'); +} +@font-face { + font-family: 'Barlow'; + font-weight: 600; + src: url('~@/assets/fonts/Barlow-SemiBold.woff2') format('woff2'), + url('~@/assets/fonts/Barlow-SemiBold.ttf') format('truetype'); +} +@font-face { + font-family: 'Barlow'; + font-weight: bold; + src: url('~@/assets/fonts/Barlow-Bold.woff2') format('woff2'), + url('~@/assets/fonts/Barlow-Bold.ttf') format('truetype'); +} +@font-face { + font-family: 'Barlow'; + font-weight: 800; + src: url('~@/assets/fonts/Barlow-ExtraBold.woff2') format('woff2'), + url('~@/assets/fonts/Barlow-ExtraBold.ttf') format('truetype'); +} +@font-face { + font-family: 'Barlow'; + font-weight: 900; + src: url('~@/assets/fonts/Barlow-Black.woff2') format('woff2'), + url('~@/assets/fonts/Barlow-Black.ttf') format('truetype'); +} + +:root { + --color-body-bg: #ffffff; + --color-text: #000; + --color-primary: #335eea; + --color-primary-bg: #eaeffd; + --color-secondary: #7a7a7b; + --color-secondary-bg: #f5f5f7; + --color-navbar-bg: rgba(255, 255, 255, 0.86); + --color-primary-bg-for-transparent: rgba(189, 207, 255, 0.28); + --color-secondary-bg-for-transparent: rgba(209, 209, 214, 0.28); + --html-overflow-y: overlay; +} + +[data-theme='dark'] { + --color-body-bg: #222222; + --color-text: #ffffff; + --color-primary: #335eea; + --color-primary-bg: #bbcdff; + --color-secondary: #7a7a7b; + --color-secondary-bg: #323232; + --color-navbar-bg: rgba(34, 34, 34, 0.86); + --color-primary-bg-for-transparent: rgba(255, 255, 255, 0.12); + --color-secondary-bg-for-transparent: rgba(255, 255, 255, 0.08); +} + +#app, +input { + font-family: 'Barlow', ui-sans-serif, system-ui, -apple-system, + BlinkMacSystemFont, Helvetica Neue, PingFang SC, Microsoft YaHei, + Source Han Sans SC, Noto Sans CJK SC, WenQuanYi Micro Hei, sans-serif, + microsoft uighur; +} +body { + background-color: var(--color-body-bg); +} + +html { + overflow-y: var(--html-overflow-y); + min-width: 768px; + overscroll-behavior: none; +} + +select, +button { + font-family: inherit; +} +button { + background: none; + border: none; + cursor: pointer; + user-select: none; +} +input, +button { + &:focus { + outline: none; + } +} +a { + color: inherit; + text-decoration: none; + cursor: pointer; + &:hover { + text-decoration: underline; + } +} + +[data-electron='yes'] { + button, + .navigation-links a, + .playlist-info .description { + cursor: default !important; + } +} + +::-webkit-scrollbar { + width: 8px; +} + +::-webkit-scrollbar-track { + background: transparent; + border-left: 1px solid rgba(128, 128, 128, 0.18); + background: var(--color-body-bg); +} + +::-webkit-scrollbar-thumb { + -webkit-border-radius: 10px; + border-radius: 10px; + background: rgba(128, 128, 128, 0.38); +} + +[data-theme='dark'] ::-webkit-scrollbar-thumb { + background: var(--color-secondary-bg); +} + +.user-select-none { + user-select: none; +} diff --git a/src/components/ArtistsInLine.vue b/src/components/ArtistsInLine.vue index b4374b3..cc13384 100644 --- a/src/components/ArtistsInLine.vue +++ b/src/components/ArtistsInLine.vue @@ -1,7 +1,7 @@ {{ computedPrefix }} - + {{ ar.name }} diff --git a/src/components/ContextMenu.vue b/src/components/ContextMenu.vue index ea5563b..5311627 100644 --- a/src/components/ContextMenu.vue +++ b/src/components/ContextMenu.vue @@ -65,7 +65,6 @@ export default { width: 100%; height: 100%; user-select: none; - -webkit-app-region: no-drag; } .menu { @@ -81,6 +80,7 @@ export default { box-sizing: border-box; padding: 6px; z-index: 1000; + -webkit-app-region: no-drag; &:focus { outline: none; diff --git a/src/components/Navbar.vue b/src/components/Navbar.vue index a329281..ac6429d 100644 --- a/src/components/Navbar.vue +++ b/src/components/Navbar.vue @@ -31,17 +31,17 @@ /> - {{ + {{ $t('nav.home') }} {{ $t('nav.explore') }} {{ $t('nav.library') }} diff --git a/src/components/TrackListItem.vue b/src/components/TrackListItem.vue index ae57383..67406e2 100644 --- a/src/components/TrackListItem.vue +++ b/src/components/TrackListItem.vue @@ -116,8 +116,8 @@ export default { }, translate() { let t; - if (this.track.tns?.length > 0) t = this.track.tns[0]; - else if (this.track.al.tns?.length > 0) t = this.track.al.tns[0]; + if (this.track?.tns?.length > 0) t = this.track.tns[0]; + else if (this.track.al?.tns?.length > 0) t = this.track.al.tns[0]; else t = this.track.alia[0]; return t; }, @@ -129,8 +129,8 @@ export default { }, isTranslate() { return ( - this.track.tns?.length > 0 || - this.track.al.tns?.length > 0 || + this.track?.tns?.length > 0 || + this.track.al?.tns?.length > 0 || this.track.alia?.length > 0 ); }, diff --git a/src/main.js b/src/main.js index e23175e..2030c95 100644 --- a/src/main.js +++ b/src/main.js @@ -8,6 +8,7 @@ import '@/assets/icons'; import '@/utils/filters'; import './registerServiceWorker'; import { dailyTask } from '@/utils/common'; +import '@/assets/css/global.scss'; window.resetApp = () => { localStorage.clear(); diff --git a/src/views/settings.vue b/src/views/settings.vue index 4f83a2c..b0bab73 100644 --- a/src/views/settings.vue +++ b/src/views/settings.vue @@ -223,7 +223,7 @@ 授权连接 - + 启用 @@ -318,22 +318,6 @@ - - - {{ $t('settings.enableGlobalShortcut') }} - - - - - - - - 🐈️ 🏳️🌈 @@ -385,6 +369,26 @@ + + 快捷键 + + + {{ $t('settings.enableGlobalShortcut') }} + + + + + + + + + +