fix. page api 수정된 구조에 맞춰 코드 수정

This commit is contained in:
clkim
2025-09-18 10:18:54 +09:00
parent 61022fb972
commit a9c5cc6bb0
19 changed files with 178 additions and 267 deletions

View File

@@ -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,
}
}