diff --git a/src/App.vue b/src/App.vue
index 2675efa..46ef4ee 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -111,4 +111,22 @@ h1 {
justify-content: center;
margin-top: 10px;
}
+
+@media (max-width: 768px) {
+ .game-header {
+ margin-top: 20px;
+ margin-bottom: 20px;
+ }
+ h1 {
+ font-size: 2.4rem;
+ letter-spacing: 3px;
+ }
+}
+
+@media (max-width: 420px) {
+ h1 {
+ font-size: 2rem;
+ letter-spacing: 2px;
+ }
+}
diff --git a/src/components/Cell.vue b/src/components/Cell.vue
index 02fbf1e..6fbdfca 100644
--- a/src/components/Cell.vue
+++ b/src/components/Cell.vue
@@ -21,10 +21,22 @@ const cellClass = computed(() => {
}
});
-const handleMouseDown = (e) => {
- // 0 = left, 2 = right
+let lastTap = 0;
+
+const handlePointerDown = (e) => {
+ if (e.pointerType === 'mouse') {
if (e.button === 0) emit('start-drag', props.r, props.c, false);
if (e.button === 2) emit('start-drag', props.r, props.c, true);
+ return;
+ }
+ const now = Date.now();
+ const isDoubleTap = now - lastTap < 300;
+ lastTap = now;
+ if (isDoubleTap) {
+ emit('start-drag', props.r, props.c, true);
+ } else {
+ emit('start-drag', props.r, props.c, false);
+ }
};
@@ -32,7 +44,9 @@ const handleMouseDown = (e) => {
@@ -52,6 +66,7 @@ const handleMouseDown = (e) => {
align-items: center;
transition: background-color 0.1s ease, box-shadow 0.1s ease;
user-select: none;
+ touch-action: none;
}
.cell:hover {
diff --git a/src/components/GameBoard.vue b/src/components/GameBoard.vue
index 0ac7ed1..2ce2b75 100644
--- a/src/components/GameBoard.vue
+++ b/src/components/GameBoard.vue
@@ -1,5 +1,5 @@
-
+
-
+
-
+
{
gridTemplateColumns: `repeat(${store.size}, var(--cell-size))`,
gridTemplateRows: `repeat(${store.size}, var(--cell-size))`
}"
+ @pointermove.prevent="handlePointerMove"
@mouseleave="stopDrag"
>
@@ -84,14 +136,13 @@ onUnmounted(() => {
}
.corner-spacer {
- width: 100px; /* Must match Row Hints width */
height: auto; /* Adapts to Col Hints height */
}
.grid {
display: grid;
gap: var(--gap-size);
- padding: 5px;
+ padding: var(--grid-padding);
background: rgba(255, 255, 255, 0.05);
border-radius: 4px;
}
diff --git a/src/components/Hints.vue b/src/components/Hints.vue
index 94134b7..7a76823 100644
--- a/src/components/Hints.vue
+++ b/src/components/Hints.vue
@@ -8,12 +8,22 @@ defineProps({
type: String,
required: true,
validator: (v) => ['row', 'col'].includes(v)
+ },
+ size: {
+ type: Number,
+ required: true
}
});
-
+
.hints-container {
- display: flex;
+ display: grid;
gap: var(--gap-size);
}
.hints-container.col {
- flex-direction: row;
- margin-bottom: 5px;
+ padding-bottom: var(--grid-padding);
align-items: flex-end;
- padding: 0 5px; /* Match grid padding */
+ padding-left: var(--grid-padding);
+ padding-right: var(--grid-padding);
}
.hints-container.row {
- flex-direction: column;
- margin-right: 5px;
align-items: flex-end;
- padding: 5px 0; /* Match grid padding */
+ padding: var(--grid-padding) var(--grid-padding) var(--grid-padding) 0;
+ width: max-content;
}
.hint-group {
@@ -59,20 +68,19 @@ defineProps({
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 4px;
transition: all 0.3s ease;
+ width: 100%;
+ height: 100%;
}
.col .hint-group {
flex-direction: column;
- width: var(--cell-size);
padding: 4px 2px;
justify-content: flex-end;
}
.row .hint-group {
flex-direction: row;
- height: var(--cell-size);
padding: 2px 8px;
- width: 100px; /* Stała szerokość */
}
.hint-num {
diff --git a/src/styles/main.css b/src/styles/main.css
index 5970c44..43f206c 100644
--- a/src/styles/main.css
+++ b/src/styles/main.css
@@ -15,6 +15,8 @@
/* Rozmiary */
--cell-size: 30px;
--gap-size: 2px;
+ --hint-row-width: 100px;
+ --grid-padding: 5px;
}
* {
@@ -119,3 +121,30 @@ button.btn-neon.secondary {
.fade-leave-to {
opacity: 0;
}
+
+@media (max-width: 768px) {
+ :root {
+ --gap-size: 1px;
+ --hint-row-width: 72px;
+ }
+ body {
+ padding: 12px;
+ }
+ button.btn-neon {
+ padding: 10px 18px;
+ font-size: 0.9rem;
+ }
+}
+
+@media (max-width: 420px) {
+ :root {
+ --hint-row-width: 60px;
+ }
+ body {
+ padding: 8px;
+ }
+ button.btn-neon {
+ padding: 9px 16px;
+ font-size: 0.85rem;
+ }
+}