From 4637aa626220a1c22e3ec294ca98ed6a7b932905 Mon Sep 17 00:00:00 2001 From: Drew Ansbacher Date: Sat, 26 Feb 2022 10:56:13 -0700 Subject: [PATCH] snek height fix (#1284) * snek height fix * close button to od welcome plus snek reposition * remove console logs Co-authored-by: Drew Ansbacher Co-authored-by: Matt Hill --- frontend/projects/ui/src/app/app.component.html | 4 ++-- frontend/projects/ui/src/app/app.component.ts | 1 + .../ui/src/app/modals/os-welcome/os-welcome.page.html | 5 +++++ frontend/projects/ui/src/app/modals/snake/snake.page.html | 2 +- frontend/projects/ui/src/app/modals/snake/snake.page.ts | 5 ++++- .../src/app/pages/marketplace-routes/marketplace.service.ts | 1 - 6 files changed, 13 insertions(+), 5 deletions(-) diff --git a/frontend/projects/ui/src/app/app.component.html b/frontend/projects/ui/src/app/app.component.html index dfdc85b72..e3796e034 100644 --- a/frontend/projects/ui/src/app/app.component.html +++ b/frontend/projects/ui/src/app/app.component.html @@ -68,8 +68,8 @@ cursor: pointer; position: absolute; bottom: 90px; - right: 20px; - width: 25px; + left: 20px; + width: 20px; " src="assets/img/icons/snek.png" /> diff --git a/frontend/projects/ui/src/app/app.component.ts b/frontend/projects/ui/src/app/app.component.ts index 8b4eeaf1e..ce08a3566 100644 --- a/frontend/projects/ui/src/app/app.component.ts +++ b/frontend/projects/ui/src/app/app.component.ts @@ -257,6 +257,7 @@ export class AppComponent { const modal = await this.modalCtrl.create({ component: OSWelcomePage, presentingElement: await this.modalCtrl.getTop(), + backdropDismiss: false, componentProps: { version: this.config.version, }, diff --git a/frontend/projects/ui/src/app/modals/os-welcome/os-welcome.page.html b/frontend/projects/ui/src/app/modals/os-welcome/os-welcome.page.html index 443a01149..457c353f2 100644 --- a/frontend/projects/ui/src/app/modals/os-welcome/os-welcome.page.html +++ b/frontend/projects/ui/src/app/modals/os-welcome/os-welcome.page.html @@ -1,6 +1,11 @@ {{ version }} Release Notes + + + + + diff --git a/frontend/projects/ui/src/app/modals/snake/snake.page.html b/frontend/projects/ui/src/app/modals/snake/snake.page.html index 456044db3..fbe8988f6 100644 --- a/frontend/projects/ui/src/app/modals/snake/snake.page.html +++ b/frontend/projects/ui/src/app/modals/snake/snake.page.html @@ -6,7 +6,7 @@ -
+
diff --git a/frontend/projects/ui/src/app/modals/snake/snake.page.ts b/frontend/projects/ui/src/app/modals/snake/snake.page.ts index 07b1d2650..416c4e614 100644 --- a/frontend/projects/ui/src/app/modals/snake/snake.page.ts +++ b/frontend/projects/ui/src/app/modals/snake/snake.page.ts @@ -80,7 +80,10 @@ export class SnakePage { this.canvas.style.border = '1px solid #e0e0e0' this.context = this.canvas.getContext('2d') const container = document.getElementsByClassName('canvas-center')[0] - this.grid = Math.floor(container.clientWidth / this.width) + this.grid = Math.min( + Math.floor(container.clientWidth / this.width), + Math.floor(container.clientHeight / this.height), + ) this.snake = { x: this.grid * (Math.floor(this.width / 2) - this.startingLength), y: this.grid * Math.floor(this.height / 2), diff --git a/frontend/projects/ui/src/app/pages/marketplace-routes/marketplace.service.ts b/frontend/projects/ui/src/app/pages/marketplace-routes/marketplace.service.ts index f86f8d471..b05c57631 100644 --- a/frontend/projects/ui/src/app/pages/marketplace-routes/marketplace.service.ts +++ b/frontend/projects/ui/src/app/pages/marketplace-routes/marketplace.service.ts @@ -37,7 +37,6 @@ export class MarketplaceService { init(): Subscription { return this.patch.watch$('ui', 'marketplace').subscribe(marketplace => { if (!marketplace || !marketplace['selected-id']) { - console.log('**MARKETPLACE', this.config) this.marketplace = this.config.marketplace } else { this.marketplace =