From c04a97ca3eecd3b21c0f12ab8c0bd175bcc68dcc Mon Sep 17 00:00:00 2001 From: clkim Date: Mon, 26 Jan 2026 15:11:47 +0900 Subject: [PATCH] =?UTF-8?q?feat.=20[SWV-807]=20=EC=BB=B4=ED=8F=AC=EB=84=8C?= =?UTF-8?q?=ED=8A=B8(BTN,=20TXT)=20=EB=8B=A8=EC=9C=84=EB=A1=9C=20=ED=8F=B0?= =?UTF-8?q?=ED=8A=B8=20=EC=84=A4=EC=A0=95=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/app.vue | 2 +- layers/components/atoms/Button/index.vue | 56 ++++++++++++++------ layers/components/blocks/Button/Launcher.vue | 25 ++++++--- layers/components/layouts/Header.vue | 3 ++ layers/components/widgets/ButtonList.vue | 2 + layers/stores/useGameDataStore.ts | 6 +-- layers/types/api/gameData.ts | 4 +- layers/types/api/pageData.ts | 6 +-- 8 files changed, 70 insertions(+), 34 deletions(-) diff --git a/app/app.vue b/app/app.vue index 91e3e28..37b0eab 100644 --- a/app/app.vue +++ b/app/app.vue @@ -96,7 +96,7 @@ const setupGameHead = (data: GameDataValue) => { const designTheme = data.design_theme === 1 ? 'light' : 'dark' const styleLinks = createStyleLinks( data.favicon_json, - data?.game_font_key_json?.font_path + data?.game_font_json?.font_path ) const styleCss = createStyleCss(data.key_color_json) diff --git a/layers/components/atoms/Button/index.vue b/layers/components/atoms/Button/index.vue index 6547678..c7452bf 100644 --- a/layers/components/atoms/Button/index.vue +++ b/layers/components/atoms/Button/index.vue @@ -11,6 +11,7 @@ interface props { textColor?: string disabled?: boolean gradient?: boolean + useGameFont?: boolean } const props = withDefaults(defineProps(), { @@ -21,8 +22,12 @@ const props = withDefaults(defineProps(), { textColor: 'var(--alternative-02)', disabled: false, gradient: false, + useGameFont: false, }) +const gameDataStore = useGameDataStore() +const { fontFamily } = storeToRefs(gameDataStore) + const componentTag = computed((): string => { switch (props.type) { case 'external': @@ -36,12 +41,6 @@ const componentTag = computed((): string => { return 'button' } }) -const backgroundColor = computed(() => { - if (props.backgroundColor) { - return props.backgroundColor - } - return props.variant === 'filled' ? 'var(--primary)' : 'white' -}) const componentProps = computed(() => { if (props.type === 'external' || props.type === 'link') { return { @@ -72,6 +71,30 @@ const componentProps = computed(() => { return {} }) +const textColor = computed(() => { + return props.textColor ? props.textColor : 'var(--text-secondary)' +}) +const buttonStyle = computed(() => { + const backgroundColor = + props.variant === 'filled' ? 'var(--primary)' : 'white' + const style: Record = { + backgroundColor: props.backgroundColor ?? backgroundColor, + '--disabled-color': textColor.value, + } + + return style +}) +const textStyle = computed(() => { + const style: Record = { + color: textColor.value, + } + + if (props.useGameFont && fontFamily.value) { + style.fontFamily = fontFamily.value + } + + return style +})