From 44c00a55479d5949d870e64175ea5b0b234fe955 Mon Sep 17 00:00:00 2001 From: Nick Kosarev Date: Sun, 1 Dec 2024 19:53:56 +0200 Subject: [PATCH] fix: fullscreen on viewport (#278) * fix: fullscreen on viewport * chore: padding top * chore: hide scroll --- apps/telegram-game/package.json | 2 +- apps/telegram-game/src/assets/main.css | 7 +++++++ apps/telegram-game/src/assets/telegram.css | 4 ++++ apps/telegram-game/src/components/Game.vue | 2 +- .../src/components/PageContainer.vue | 2 +- apps/telegram-game/src/init.ts | 2 -- pnpm-lock.yaml | 18 +++++++++--------- 7 files changed, 23 insertions(+), 14 deletions(-) diff --git a/apps/telegram-game/package.json b/apps/telegram-game/package.json index 5d42c00..ab4705e 100644 --- a/apps/telegram-game/package.json +++ b/apps/telegram-game/package.json @@ -15,7 +15,7 @@ "dependencies": { "@chat-game/game": "workspace:*", "@chat-game/types": "workspace:*", - "@telegram-apps/sdk-vue": "^1.0.5", + "@telegram-apps/sdk-vue": "^1.0.6", "vue": "^3.5.13", "vue-router": "^4.5.0" }, diff --git a/apps/telegram-game/src/assets/main.css b/apps/telegram-game/src/assets/main.css index 52b24b2..7292b97 100644 --- a/apps/telegram-game/src/assets/main.css +++ b/apps/telegram-game/src/assets/main.css @@ -19,6 +19,8 @@ --tg-theme-link-color: #168dcd; --tg-theme-accent-text-color: #168dcd; --tg-theme-destructive-text-color: #d14e4e; + + --tg-content-safe-area-inset-top: 100; } @utility tg-bg { @@ -64,4 +66,9 @@ } @utility tg-section-separator { color: var(--tg-theme-section-separator-color); +} + +@utility tg-content-safe-area { + padding-top: calc(var(--tg-content-safe-area-inset-top) * 1px); + padding-bottom: 200px; } \ No newline at end of file diff --git a/apps/telegram-game/src/assets/telegram.css b/apps/telegram-game/src/assets/telegram.css index f18f037..b0502e7 100644 --- a/apps/telegram-game/src/assets/telegram.css +++ b/apps/telegram-game/src/assets/telegram.css @@ -8,3 +8,7 @@ html, body, #app { /* Preserve scrolling behavior */ overflow-y: auto; } +#app::-webkit-scrollbar { + display: none; + width: 0; +} diff --git a/apps/telegram-game/src/components/Game.vue b/apps/telegram-game/src/components/Game.vue index bb99b82..35a4b6f 100644 --- a/apps/telegram-game/src/components/Game.vue +++ b/apps/telegram-game/src/components/Game.vue @@ -2,7 +2,7 @@
-
+
Монеты: 53
Энергия: 41
diff --git a/apps/telegram-game/src/components/PageContainer.vue b/apps/telegram-game/src/components/PageContainer.vue index b6709e1..5ff99e4 100644 --- a/apps/telegram-game/src/components/PageContainer.vue +++ b/apps/telegram-game/src/components/PageContainer.vue @@ -1,5 +1,5 @@