From 80fbab446b4e19d2d3aec0c1311d9e952bed69da Mon Sep 17 00:00:00 2001 From: Pihkaal Date: Sat, 13 Dec 2025 19:18:15 +0100 Subject: [PATCH] feat(home): buttons navigation --- .../images/home/bottom-screen/background.webp | Bin 0 -> 132 bytes .../home/bottom-screen/buttons/alarm.webp | Bin 0 -> 66 bytes .../home/bottom-screen/buttons/contact.webp | Bin 0 -> 350 bytes .../bottom-screen/buttons/downloadPlay.webp | Bin 0 -> 470 bytes .../home/bottom-screen/buttons/game.webp | Bin 0 -> 296 bytes .../home/bottom-screen/buttons/settings.webp | Bin 0 -> 108 bytes .../home/bottom-screen/buttons/theme.webp | Bin 0 -> 68 bytes src/screens/home/bottom/index.ts | 73 ++++++++++++++++-- 8 files changed, 68 insertions(+), 5 deletions(-) create mode 100644 public/images/home/bottom-screen/background.webp create mode 100644 public/images/home/bottom-screen/buttons/alarm.webp create mode 100644 public/images/home/bottom-screen/buttons/contact.webp create mode 100644 public/images/home/bottom-screen/buttons/downloadPlay.webp create mode 100644 public/images/home/bottom-screen/buttons/game.webp create mode 100644 public/images/home/bottom-screen/buttons/settings.webp create mode 100644 public/images/home/bottom-screen/buttons/theme.webp diff --git a/public/images/home/bottom-screen/background.webp b/public/images/home/bottom-screen/background.webp new file mode 100644 index 0000000000000000000000000000000000000000..e4f0243b2322de7b256c16dc42ca8102534297d4 GIT binary patch literal 132 zcmV-~0DJ#ZNk&F|00012MM6+kP&iC*0000l|G+N*7a$Nw{K-<;Vhw>n;!l>!77GLt zf3j4zc>d#G0Vs`Rt9e6>yncu!;L()%=PQy*5&c)>wvnR3ZDy9?3(#;7jA;Wk3I$`@ ma12^C0LHYT4aaz+Mz$n7w_$wP{%!qz{|>P4|G(q=|L-7-(>y%@ literal 0 HcmV?d00001 diff --git a/public/images/home/bottom-screen/buttons/alarm.webp b/public/images/home/bottom-screen/buttons/alarm.webp new file mode 100644 index 0000000000000000000000000000000000000000..cdea916e8ed7d00336c58d1ffadb0ddac1143435 GIT binary patch literal 66 zcmWIYbaS&}U|>n|fU)XH)S0q{Wl97yy;17hC`U literal 0 HcmV?d00001 diff --git a/public/images/home/bottom-screen/buttons/contact.webp b/public/images/home/bottom-screen/buttons/contact.webp new file mode 100644 index 0000000000000000000000000000000000000000..776e02b63e1aefac94ef8a1509b655e8258aac7b GIT binary patch literal 350 zcmV-k0ipgk|tL2T1!(JEm^V7q-<3;T^b zf%Kf(i2gHj+cuH}xJf%pZZmI~gj*umNy)LM|A3EJHNHZP59K}7UqSa8s>WNW@u9Rv z02=_y~IExUMDgL!Co9n}d=3 zKJ}YLchC+1ksHb>G_{d*|G9o9s?)NmwKLmpDCcNgT}T{y*ys+2(;^$m?^DjH$qUnE zA~%$C2mp@&pe%;aaZaRXX5HsL=iKt z)Fhe-m^91Dxfq}(asERRN$*ZuN&G(m0AQOzj&0j*-H0>zkYucdmK|zU>KzA=SSnGA zrL#Q@Ku#F0`5qqmpF@3bME@bUZRALj0B_#a#=AG1xO)iB;?R6ezj^W4RpGOz&ji=g z>=~<^%A>*9L21f$o0_SjYEQPP8OM-o205;<$~}z=NvL@Pj0$E^w*i&vgbcSq-NC4+ zSQ(kI7gTl-n(jL0blLJk)gJ06V+^?B|Gxi`&*9fEt_q)B{Xg+Z8#>>9+8;u4Wx3au zrse(q5R&GUPce}40Ae&lHfPqBS-@OWMTCSjBnh$H&y@yq^rAQudjfeBY=8zUUC0rH z&N5#qjF8=9yv_3uHAcuL(<^O33?xv1IF&e=A(k?C+H&gPghP5B`+{V1v;PFo@I;z15+4$y$* zj!-T}$nG)TW^9IZvmRV3UTVL$&X@Z_^k{tS@5qs+btRDh6_Wmr3~v8dq)-BxI2?kP MNu4Nz`@cg204PM*#{d8T literal 0 HcmV?d00001 diff --git a/public/images/home/bottom-screen/buttons/game.webp b/public/images/home/bottom-screen/buttons/game.webp new file mode 100644 index 0000000000000000000000000000000000000000..5353b4b5047a0d243ad2fc3569e2a7d6cefb0628 GIT binary patch literal 296 zcmV+@0oVRgNk&E>0RRA3MM6+kP&iB!0RR9myZ{RTf1svqBdGidc03C2c)HL~)3y;* z{scQ7g?Bt%)U<5`l|R9bN8ue$m-!D#1(5td0O0QIE&u=k$V{0jBG_ht8(Z75=x+gc zmyn1K7&?FgTnm5>7&?F!$lO_peRF7G-6h<4zkmLBHG1BN{tHNw0>^0F4~BWK-0dZk z6YBMQMlZ`103D?=Sz}KpBVhnK>a?21-tI0w5r^GG9g5?T5qU9_hz|*Aqeg)Ne8Fgw~UVa|{ysN)tmJydj+cKoiZ%Yp91ZZIZ17d142pLkJB|~LT Oae3JHE7c_{$^ literal 0 HcmV?d00001 diff --git a/public/images/home/bottom-screen/buttons/theme.webp b/public/images/home/bottom-screen/buttons/theme.webp new file mode 100644 index 0000000000000000000000000000000000000000..2c6a88eea9d5965797e11791f7bd594a9588da92 GIT binary patch literal 68 zcmWIYbaS&|U|-QnNO7yfe^*sqmU XG|o({ + buttons: { + projects: [31, 23, 193, 49], + contact: [31, 71, 97, 49], + downloadPlay: [127, 71, 97, 49], + settings: [112, 167, 31, 26], + }, + initialButton: "projects", + navigation: { + projects: { + down: "last", + left: "contact", + right: "downloadPlay", + horizontalMode: "preview", + }, + contact: { + up: "projects", + right: "downloadPlay", + down: "settings", + }, + downloadPlay: { + up: "projects", + left: "contact", + down: "settings", + }, + settings: { + up: "last", + }, + }, + onButtonClick: () => { + // TODO: navigate to correct screen + }, + }); + + private selector = new ButtonSelector(this.navigation.getSelectorPosition()); + render(ctx: CanvasRenderingContext2D): void { - ctx.fillStyle = "#ffffff"; - ctx.font = "10px NDS10"; - ctx.textAlign = "right"; - ctx.textBaseline = "bottom"; - ctx.fillText("Contact >", 255, 191); + if (!this.images.isReady) return; + + ctx.drawImage(this.images.require("background"), 0, 0); + + ctx.drawImage(this.images.require("game"), 33, 25); + ctx.drawImage(this.images.require("contact"), 32, 72); + ctx.drawImage(this.images.require("downloadPlay"), 128, 72); + ctx.drawImage(this.images.require("settings"), 117, 170); + + this.selector.render(ctx, this.navigation.getSelectorPosition()); + } + + handleTouch(x: number, y: number): void { + this.navigation.handleTouch(x, y); + } + + destroy(): void { + this.navigation.destroy(); } }