-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #451 from organization/feature/styling
feat(renderer): improve styling
- Loading branch information
Showing
21 changed files
with
483 additions
and
226 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"font": "Pretendard Variable", | ||
"fontWeight": "400", | ||
"animation": "pretty", | ||
"animationAtOnce": false, | ||
"maxHeight": 400, | ||
"proximityOpacity": 0, | ||
"proximitySensitivity": 2, | ||
"rowGap": 2, | ||
"nowPlaying": { | ||
"color": "#FFFFFF", | ||
"background": "rgba(29, 29, 29, .50)", | ||
"backgroundProgress": "rgba(29, 29, 29, .80)", | ||
"fontSize": 13, | ||
"maxWidth": 300, | ||
"visible": true, | ||
"stoppedOpacity": 0.5 | ||
}, | ||
"lyric": { | ||
"color": "#FFFFFF", | ||
"background": "rgba(29, 29, 29, .70)", | ||
"fontSize": 13, | ||
"maxWidth": 700, | ||
"stoppedOpacity": 0.5, | ||
"containerRowGap": 0.25, | ||
"multipleContainerRowGap": 0.75, | ||
"direction": "column", | ||
"nextLyric": 1, | ||
"previousLyric": 1, | ||
"nextLyricScale": 0.9, | ||
"previousLyricScale": 0.9, | ||
"nextLyricOpacity": 0.5, | ||
"previousLyricOpacity": 0.5 | ||
}, | ||
"userCSS": "alspotron-wrapper {\n min-height: 400px;\n\n flex-flow: row !important;\n gap: 32px;\n \n background: linear-gradient(\n 315deg,\n rgba(0, 0, 0, 0.5) 0%,\n rgba(0, 0, 0, 0) 25%\n );\n\n padding: 32px;\n}\n\nalspotron-lyrics-item {\n border-radius: 8px;\n padding: 4px 8px;\n}\n\n\nalspotron-nowplaying {\n width: 150px;\n height: 150px;\n max-width: 150px;\n\n border-radius: 12px;\n flex-shrink: 0;\n\n position: relative;\n display: inline-flex;\n flex-flow: column;\n justify-content: flex-end;\n align-items: flex-start;\n\n padding: 0;\n}\nalspotron-nowplaying::after {\n content: '';\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n\n background-image: linear-gradient(\n 0deg,\n rgba(0, 0, 0, 0.75) 0%,\n rgba(0, 0, 0, 0.5) 24px,\n rgba(0, 0, 0, 0) 48px\n );\n z-index: 20;\n}\n\n\nalspotron-nowplaying-progress-bar {\n background: none !important;\n z-index: 21;\n}\nalspotron-nowplaying-progress {\n --color: 29, 29, 29;\n\n opacity: 0.75;\n \n background-image: linear-gradient(\n 135deg,\n rgba(var(--color), 1) 0%,\n rgba(var(--color), 1) 25%,\n rgba(var(--color), 0) 25%,\n rgba(var(--color), 0) 50%,\n rgba(var(--color), 1) 50%,\n rgba(var(--color), 1) 75%,\n rgba(var(--color), 0) 75%,\n rgba(var(--color), 0) 100%\n );\n background-size: 24px 24px;\n\n animation: progress 1.5s linear infinite;\n}\n\n@keyframes progress {\n 0% {\n background-position-x: 0;\n }\n 100% {\n background-position-x: 24px;\n }\n}\n\nalspotron-nowplaying-cover {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n z-index: -1;\n\n object-fit: cover;\n border-radius: 12px;\n padding: 4px;\n\n}\n\nalspotron-wrapper--stopped alspotron-nowplaying-cover {\n transform: scale(0.9);\n}\n\nalspotron-nowplaying-playing-text {\n position: relative;\n z-index: 50;\n margin-top: auto;\n padding: 12px 16px;\n overflow: visible !important;\n}\n\nalspotron-marquee {\n z-index: 50;\n}\n" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import albumCover from './album-cover.json'; | ||
import multipleLyric from './multiple-lyric.json'; | ||
|
||
import { DEFAULT_STYLE } from '../constants'; | ||
import { StyleConfig } from '../schema'; | ||
|
||
export default { | ||
'default': DEFAULT_STYLE, | ||
'album-cover': albumCover, | ||
'multiple-lyric': multipleLyric, | ||
} as Record<string, StyleConfig>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"font": "Pretendard Variable", | ||
"fontWeight": "400", | ||
"animation": "fade", | ||
"animationAtOnce": true, | ||
"maxHeight": 400, | ||
"proximityOpacity": 0, | ||
"proximitySensitivity": 2, | ||
"rowGap": 1, | ||
"nowPlaying": { | ||
"color": "#FFFFFF", | ||
"background": "rgba(29, 29, 29, .50)", | ||
"backgroundProgress": "rgba(29, 29, 29, .80)", | ||
"fontSize": 15, | ||
"maxWidth": 600, | ||
"visible": true, | ||
"stoppedOpacity": 0.5 | ||
}, | ||
"lyric": { | ||
"color": "#FFFFFF", | ||
"background": "rgba(29, 29, 29, .70)", | ||
"fontSize": 12, | ||
"maxWidth": 700, | ||
"stoppedOpacity": 0.5, | ||
"containerRowGap": 0.25, | ||
"multipleContainerRowGap": 1, | ||
"direction": "column", | ||
"nextLyric": 1, | ||
"previousLyric": 1, | ||
"nextLyricScale": 0.9, | ||
"previousLyricScale": 0.9, | ||
"nextLyricOpacity": 0.5, | ||
"previousLyricOpacity": 0.5 | ||
}, | ||
"userCSS": "" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { Accessor, createEffect, on, onCleanup, onMount } from 'solid-js'; | ||
|
||
export const useClassStyle = (className: string, style: Accessor<string>) => { | ||
const stylesheet = new CSSStyleSheet(); | ||
|
||
|
||
onMount(() => { | ||
const isExist = Array.from(document.adoptedStyleSheets).some((adoptedStyleSheet) => adoptedStyleSheet === stylesheet); | ||
if (isExist) return; | ||
|
||
document.adoptedStyleSheets = [...document.adoptedStyleSheets, stylesheet]; | ||
}) | ||
|
||
createEffect(on(style, () => { | ||
stylesheet.replaceSync(`*:is(.${className}) {\n${style()}\n}`); | ||
})); | ||
|
||
onCleanup(() => { | ||
document.adoptedStyleSheets = Array.from(document.adoptedStyleSheets).filter((adoptedStyleSheet) => adoptedStyleSheet !== stylesheet); | ||
}); | ||
|
||
return stylesheet; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.