diff --git a/app/components/Contact/BottomScreen/Background.vue b/app/components/Contact/BottomScreen/Background.vue index cfa8d2c..d5757f1 100644 --- a/app/components/Contact/BottomScreen/Background.vue +++ b/app/components/Contact/BottomScreen/Background.vue @@ -7,10 +7,10 @@ const contactBackgroundImage = useTemplateRef("contactBackgroundImage"); useRender((ctx) => { if (!homeBackgroundImage.value || !contactBackgroundImage.value) return; - if (store.isIntro) { - ctx.drawImage(homeBackgroundImage.value, 0, 0); - ctx.globalAlpha = store.intro.stage2Opacity; - } + ctx.drawImage(homeBackgroundImage.value, 0, 0); + ctx.globalAlpha = store.isIntro + ? store.intro.stage2Opacity + : store.outro.stage3Opacity; ctx.drawImage(contactBackgroundImage.value, 0, 0); }); diff --git a/app/components/Contact/BottomScreen/Bars.vue b/app/components/Contact/BottomScreen/Bars.vue index ca0d5cf..3525669 100644 --- a/app/components/Contact/BottomScreen/Bars.vue +++ b/app/components/Contact/BottomScreen/Bars.vue @@ -13,7 +13,9 @@ useRender((ctx) => { if (!topBarImage.value || !bottomBarImage.value || !bottomBarOkImage.value) return; - ctx.globalAlpha = store.isIntro ? store.intro.stage3Opacity : 1; + ctx.globalAlpha = store.isIntro + ? store.intro.stage3Opacity + : store.outro.stage2Opacity; // top bar ctx.drawImage(topBarImage.value, 0, store.isIntro ? store.intro.topBarY : 0); diff --git a/app/components/Contact/BottomScreen/BottomScreen.vue b/app/components/Contact/BottomScreen/BottomScreen.vue index b0a76e9..4e99456 100644 --- a/app/components/Contact/BottomScreen/BottomScreen.vue +++ b/app/components/Contact/BottomScreen/BottomScreen.vue @@ -41,20 +41,35 @@ const { selectedButton, selectorPosition } = useButtonNavigation({ }, initialButton: "github", onButtonClick: async (button) => { - const [action, verb, content] = ACTIONS[button]; - if (action === "Copy") { - try { - await navigator.clipboard.writeText(content); - store.pushNotification(`${verb} copied to clipboard`); - } catch (error) { - console.error("Failed to copy to clipboard:", error); - } - } else { - await navigateTo(content, { open: { target: "_blank " } }); - store.pushNotification(`${verb} opened`); - } + actionateButton(button); }, }); + +const actionateButton = async (button: (typeof selectedButton)["value"]) => { + const [action, verb, content] = ACTIONS[button]; + if (action === "Copy") { + try { + await navigator.clipboard.writeText(content); + store.pushNotification(`${verb} copied to clipboard`); + } catch (error) { + console.error("Failed to copy to clipboard:", error); + } + } else { + await navigateTo(content, { open: { target: "_blank " } }); + store.pushNotification(`${verb} opened`); + } +}; + +const QUIT_BUTTON: Rect = [31, 172, 80, 18]; +const OK_BUTTON: Rect = [144, 172, 80, 18]; + +useScreenClick((x, y) => { + if (rectContains(QUIT_BUTTON, [x, y])) { + store.animateOutro(); + } else if (rectContains(OK_BUTTON, [x, y])) { + actionateButton(selectedButton.value); + } +});