diff --git a/app/components/Common/Bars.vue b/app/components/Common/Bars.vue new file mode 100644 index 0000000..e8e5925 --- /dev/null +++ b/app/components/Common/Bars.vue @@ -0,0 +1,63 @@ + diff --git a/app/components/Common/ButtonSelector.vue b/app/components/Common/ButtonSelector.vue index 3f18870..d7e4422 100644 --- a/app/components/Common/ButtonSelector.vue +++ b/app/components/Common/ButtonSelector.vue @@ -9,9 +9,11 @@ const props = withDefaults( }, ); +const app = useAppStore(); const { assets } = useAssets(); const ANIMATION_SPEED = 0.25; +const CORNER_SIZE = 11; let [currentX, currentY, currentWidth, currentHeight] = props.rect; @@ -43,21 +45,67 @@ useRender((ctx) => { ctx.globalAlpha = props.opacity; - ctx.drawImage(assets.common.selectorCorner, x, y); + const spriteY = (app.color.row * 4 + app.color.col) * CORNER_SIZE; + // Top-left corner + ctx.drawImage( + assets.common.selectorCornersSheet, + 0, + spriteY, + CORNER_SIZE, + CORNER_SIZE, + x, + y, + CORNER_SIZE, + CORNER_SIZE, + ); + + // Top-right corner ctx.save(); ctx.scale(-1, 1); - ctx.drawImage(assets.common.selectorCorner, -(x + w), y); + ctx.drawImage( + assets.common.selectorCornersSheet, + 0, + spriteY, + CORNER_SIZE, + CORNER_SIZE, + -(x + w), + y, + CORNER_SIZE, + CORNER_SIZE, + ); ctx.restore(); + // Bottom-left corner ctx.save(); ctx.scale(1, -1); - ctx.drawImage(assets.common.selectorCorner, x, -(y + h)); + ctx.drawImage( + assets.common.selectorCornersSheet, + 0, + spriteY, + CORNER_SIZE, + CORNER_SIZE, + x, + -(y + h), + CORNER_SIZE, + CORNER_SIZE, + ); ctx.restore(); + // Bottom-right corner ctx.save(); ctx.scale(-1, -1); - ctx.drawImage(assets.common.selectorCorner, -(x + w), -(y + h)); + ctx.drawImage( + assets.common.selectorCornersSheet, + 0, + spriteY, + CORNER_SIZE, + CORNER_SIZE, + -(x + w), + -(y + h), + CORNER_SIZE, + CORNER_SIZE, + ); ctx.restore(); }); diff --git a/app/components/Contact/BottomScreen/BottomScreen.vue b/app/components/Contact/BottomScreen/BottomScreen.vue index c44f38c..9cb60ae 100644 --- a/app/components/Contact/BottomScreen/BottomScreen.vue +++ b/app/components/Contact/BottomScreen/BottomScreen.vue @@ -4,7 +4,6 @@ import Background from "./Background.vue"; import Buttons from "./Buttons.vue"; import ButtonSelector from "~/components/Common/ButtonSelector.vue"; -import Bars from "./Bars.vue"; const store = useContactStore(); const { open: openModal, state: modalState } = useConfirmationModal(); @@ -105,16 +104,24 @@ useKeyDown((key) => { " /> - + // NOTE: calendar background is handled by TopScreenBackground +const app = useAppStore(); const store = useHomeStore(); const { assets } = useAssets(); @@ -12,6 +13,7 @@ useRender((ctx) => { const CALENDAR_ROWS = 5; const CALENDAR_LEFT = 128; const CALENDAR_TOP = 64; + const SELECTOR_SIZE = 13; ctx.fillStyle = "#343434"; @@ -61,9 +63,15 @@ useRender((ctx) => { if (now.getDate() === day) { ctx.drawImage( - assets.home.topScreen.calendar.daySelector, - cellLeft, - cellTop, + assets.home.topScreen.calendar.daySelectorsSheet, + 0, + (app.color.row * 4 + app.color.col) * SELECTOR_SIZE, + SELECTOR_SIZE, + SELECTOR_SIZE, + cellLeft + 1, + cellTop + 1, + SELECTOR_SIZE, + SELECTOR_SIZE, ); } diff --git a/app/components/Home/TopScreen/Clock.vue b/app/components/Home/TopScreen/Clock.vue index 6312de6..e95c6e3 100644 --- a/app/components/Home/TopScreen/Clock.vue +++ b/app/components/Home/TopScreen/Clock.vue @@ -2,6 +2,7 @@ const CENTER_X = 63; const CENTER_Y = 95; +const app = useAppStore(); const store = useHomeStore(); const { assets } = useAssets(); @@ -86,7 +87,7 @@ useRender((ctx) => { 23, 2, ); - renderHand(now.getSeconds() / 60, "#49db8a", 35, 2); + renderHand(now.getSeconds() / 60, app.color.hex, 35, 2); ctx.fillStyle = "#494949"; ctx.fillRect(CENTER_X - 2, CENTER_Y - 2, 5, 5); diff --git a/app/components/Home/TopScreen/StatusBar.vue b/app/components/Home/TopScreen/StatusBar.vue index d8a1439..914dca3 100644 --- a/app/components/Home/TopScreen/StatusBar.vue +++ b/app/components/Home/TopScreen/StatusBar.vue @@ -1,8 +1,12 @@