fix. page api 수정된 구조에 맞춰 코드 수정
This commit is contained in:
@@ -1,28 +0,0 @@
|
||||
import type { GameDataKeyCodeCodes } from '#layers/types/api/gameData'
|
||||
|
||||
/**
|
||||
* 게임 데이터의 key_code_codes를 CSS 커스텀 프로퍼티로 적용하는 기능을 제공합니다.
|
||||
*/
|
||||
export const useGameKeyCodeColors = () => {
|
||||
/**
|
||||
* @param keyColorCodes
|
||||
*/
|
||||
const applyGameKeyCodeColors = (
|
||||
keyColorCodes: GameDataKeyCodeCodes | null
|
||||
) => {
|
||||
if (!keyColorCodes || import.meta.server) {
|
||||
return
|
||||
}
|
||||
|
||||
const root = document.documentElement
|
||||
|
||||
Object.entries(keyColorCodes).forEach(([key, value]) => {
|
||||
const cssVarName = `--${key}`
|
||||
root.style.setProperty(cssVarName, String(value))
|
||||
})
|
||||
}
|
||||
|
||||
return {
|
||||
applyGameKeyCodeColors,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user