feat: 初步实现歌词界面

This commit is contained in:
qier222 2022-04-08 01:02:25 +08:00
parent 1eb38937fc
commit 530581ba82
No known key found for this signature in database
GPG key ID: 9C85007ED905F14D
15 changed files with 635 additions and 18 deletions

View file

@ -5,6 +5,7 @@ import { Player } from '@/utils/player'
interface Store {
uiStates: {
loginPhoneCountryCode: string
showLyricPanel: boolean
}
settings: {
showSidebar: boolean
@ -14,6 +15,7 @@ interface Store {
const initialState: Store = {
uiStates: {
loginPhoneCountryCode: '+86',
showLyricPanel: false,
},
settings: {
showSidebar: true,
@ -28,6 +30,7 @@ subscribe(state, () => {
localStorage.setItem('state', JSON.stringify(state))
})
// player
const playerInLocalStorage = localStorage.getItem('player')
export const player = proxy(new Player())
player.init((playerInLocalStorage && JSON.parse(playerInLocalStorage)) || {})