pull/1168/head
lyswhut 2023-02-01 16:50:13 +08:00
parent ef7033cac0
commit fdd19068a8
3 changed files with 5 additions and 6 deletions

View File

@ -62,7 +62,7 @@ const defaultSetting: LX.AppSetting = {
'desktopLyric.style.lineGap': 15, 'desktopLyric.style.lineGap': 15,
'desktopLyric.style.lyricUnplayColor': 'rgba(255, 255, 255, 1)', 'desktopLyric.style.lyricUnplayColor': 'rgba(255, 255, 255, 1)',
'desktopLyric.style.lyricPlayedColor': 'rgba(7, 197, 86, 1)', 'desktopLyric.style.lyricPlayedColor': 'rgba(7, 197, 86, 1)',
'desktopLyric.style.lyricShadowColor': 'rgba(0, 0, 0, 0.15)', 'desktopLyric.style.lyricShadowColor': 'rgba(0, 0, 0, 0.18)',
// 'desktopLyric.style.fontWeight': false, // 'desktopLyric.style.fontWeight': false,
'desktopLyric.style.opacity': 95, 'desktopLyric.style.opacity': 95,
'desktopLyric.style.ellipsis': false, 'desktopLyric.style.ellipsis': false,

View File

@ -4,7 +4,7 @@ import '@simonwep/pickr/dist/themes/classic.min.css'
export interface PickrTools { export interface PickrTools {
pickr: Pickr | null pickr: Pickr | null
create: (dom: HTMLElement, color: string, swatches: string[] | null, change: (color: string) => void, reset: () => void) => PickrTools create: (dom: HTMLElement, color: string, swatches: string[] | null, change: (color: string) => void, reset?: () => void) => PickrTools
destroy: () => void destroy: () => void
setColor: (color: string) => void setColor: (color: string) => void
} }
@ -72,10 +72,9 @@ export const pickrTools: PickrTools = {
pickrTools.pickr.on('swatchselect', (color: any) => { pickrTools.pickr.on('swatchselect', (color: any) => {
swatchselectColor = color swatchselectColor = color
}).on('change', throttleChange).on('cancel', () => { }).on('change', throttleChange).on('cancel', () => {
change(color)
console.log('cancel') console.log('cancel')
}).on('cancel', () => { change(color)
reset() reset?.()
}) })
return pickrTools return pickrTools

View File

@ -215,7 +215,7 @@ const useLyricColor = () => {
const defaultSetting = { const defaultSetting = {
'desktopLyric.style.lyricUnplayColor': 'rgba(255, 255, 255, 1)', 'desktopLyric.style.lyricUnplayColor': 'rgba(255, 255, 255, 1)',
'desktopLyric.style.lyricPlayedColor': 'rgba(7, 197, 86, 1)', 'desktopLyric.style.lyricPlayedColor': 'rgba(7, 197, 86, 1)',
'desktopLyric.style.lyricShadowColor': 'rgba(0, 0, 0, 0.15)', 'desktopLyric.style.lyricShadowColor': 'rgba(0, 0, 0, 0.18)',
} }
updateSetting(defaultSetting) updateSetting(defaultSetting)
setLyricUnplayColor(defaultSetting['desktopLyric.style.lyricUnplayColor']) setLyricUnplayColor(defaultSetting['desktopLyric.style.lyricUnplayColor'])