🤖
diff --git a/frontend/src/components/Piece.vue b/frontend/src/components/Piece.vue
index aef7d3d..accb2e3 100644
--- a/frontend/src/components/Piece.vue
+++ b/frontend/src/components/Piece.vue
@@ -4,10 +4,13 @@
import divmod from '@/utils/divmod'
const props = defineProps({
- piece: Object
+ piece: Object,
+ cellSize: Number
})
const emit = defineEmits(['pieceTouch'])
+ const cell_width = `${props.cellSize - 2}px`
+
const hovering = ref(false)
const rotationIndex = ref(0)
@@ -18,6 +21,7 @@
const minX = computed(() => Math.min(...points.value.map((point) => point[1])))
const maxY = computed(() => Math.max(...points.value.map((point) => point[0])))
const diameter = computed(() => (1 + Math.max(maxX.value - minX.value, maxY.value)))
+ const box_width = computed(() => `${diameter.value*(props.cellSize)}px`)
const grid = computed(make_grid)
const width = computed(() => maxX.value - minX.value + 1)
const canFlip = computed(() => props.piece.rotations.length > 4)
@@ -118,7 +122,7 @@
}
.piece-cell {
aspect-ratio: 1/ 1;
- width: 18px;
+ width: v-bind(cell_width);
display: flex;
/* justify-content: center; */
margin: 1px;
@@ -134,8 +138,8 @@
display: flex;
align-items: center;
justify-content: center;
- width: v-bind(18*diameter + "px");
- height: 100px;
+ width: v-bind(box_width);
+ height: v-bind(box_width);
}
.invisible {
visibility: hidden;
diff --git a/frontend/src/components/PiecePalette.vue b/frontend/src/components/PiecePalette.vue
index 87d8e43..95fdec4 100644
--- a/frontend/src/components/PiecePalette.vue
+++ b/frontend/src/components/PiecePalette.vue
@@ -2,7 +2,8 @@
import Piece from '@/components/Piece.vue';
const props = defineProps({
- availablePieces: Array
+ availablePieces: Array,
+ cellSize: Number
})
const emit = defineEmits(["pieceTouch"])
@@ -15,7 +16,7 @@
diff --git a/frontend/src/views/GameView.vue b/frontend/src/views/GameView.vue
index 5717c9d..954fffe 100644
--- a/frontend/src/views/GameView.vue
+++ b/frontend/src/views/GameView.vue
@@ -11,7 +11,7 @@
const props = defineProps({
id: String
})
-
+ const cellSize = 30
const loading = ref(false)
const error = ref(null)
const game = ref(null)
@@ -219,8 +219,8 @@
Доска заполнена!
-