Skip to content

Commit 1388060

Browse files
committed
fix: adjust bottom bar positioning and game container alignment
1 parent 7190b17 commit 1388060

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

src/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const goToGameScene = () => {
5151

5252
<style scoped>
5353
.bottom-bar {
54-
position: absolute;
54+
position: fixed;
5555
display: flex;
5656
bottom: 0;
5757
height: 70px;

src/components/PhaserGame.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ watch([showPopup, popupData], async ([isOpen, data]) => {
261261
</script>
262262

263263
<template>
264-
<div id="game-container" />
264+
<div id="game-container" :style="{ bottom: `${GameData.bottomBarHeight}px` }" />
265265
<div class="popup-overlay" id="popup" v-if="showPopup">
266266
<div class="popup-content">
267267
<button class="popup-close" id="popupClose" @click="closePopup()">x</button>
@@ -309,8 +309,11 @@ watch([showPopup, popupData], async ([isOpen, data]) => {
309309

310310
<style scoped>
311311
#game-container {
312-
width: 100%;
313-
height: 100%;
312+
position: absolute;
313+
top: 0;
314+
left: 0;
315+
right: 0;
316+
z-index: 0;
314317
}
315318
316319
.popup-overlay {

src/game/scenes/Game.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export class Game extends Scene {
5959
const startY = GameData.screenHeight - spacingY * (rows + 1)
6060
const startX = 0
6161

62-
this.contentContainer = this.add.container(0, -GameData.bottomBarHeight)
62+
this.contentContainer = this.add.container(0, 0)
6363

6464
for (let row = 0; row < rows; row++) {
6565
for (let col = 0; col < cols; col++) {
@@ -95,7 +95,7 @@ export class Game extends Scene {
9595
const maxY = GameData.screenHeight * 0.5 - lastTile.centerY
9696
this.contentContainer.y = this.containerStartY + deltaY
9797

98-
this.contentContainer.y = Phaser.Math.Clamp(this.contentContainer.y, -GameData.bottomBarHeight , maxY)
98+
this.contentContainer.y = Phaser.Math.Clamp(this.contentContainer.y, 0, maxY)
9999
}
100100
})
101101

@@ -139,10 +139,10 @@ export class Game extends Scene {
139139
const tile = new HexTile(randomData(this, pos.x, pos.y))
140140
this.contentContainer.addAt(tile, 0)
141141
GameData.path.push(tile)
142-
this.contentContainer.y = Math.max(GameData.screenHeight * 0.5 - lastTile.y, -GameData.bottomBarHeight)
142+
this.contentContainer.y = Math.max(GameData.screenHeight * 0.5 - lastTile.y, 0)
143143
this.tweens.add({
144144
targets: this.contentContainer,
145-
y: Math.max(GameData.screenHeight * 0.5 - pos.y, -GameData.bottomBarHeight),
145+
y: Math.max(GameData.screenHeight * 0.5 - pos.y, 0),
146146
duration: 1000,
147147
ease: 'Sine.easeInOut',
148148
})

0 commit comments

Comments
 (0)