6 Commits

7 changed files with 71 additions and 8 deletions

View File

@@ -2,9 +2,9 @@
<html lang="pl">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/pwa-192x192.svg" />
<link rel="apple-touch-icon" href="/pwa-192x192.svg" />
<link rel="mask-icon" href="/pwa-192x192.svg" color="#00f2fe" />
<link rel="icon" type="image/svg+xml" href="/nonograms.svg" />
<link rel="apple-touch-icon" href="/nonograms.svg" />
<link rel="mask-icon" href="/nonograms.svg" color="#00f2fe" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Nonograms Pro - Vue 3 SOLID</title>
</head>

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "vue-nonograms-solid",
"version": "1.9.7",
"version": "1.9.10",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "vue-nonograms-solid",
"version": "1.9.7",
"version": "1.9.10",
"dependencies": {
"fireworks-js": "^2.10.8",
"flag-icons": "^7.5.0",

View File

@@ -1,6 +1,6 @@
{
"name": "vue-nonograms-solid",
"version": "1.9.7",
"version": "1.9.10",
"type": "module",
"scripts": {
"dev": "vite",

28
public/nonograms.svg Normal file
View File

@@ -0,0 +1,28 @@
<svg xmlns="http://www.w3.org/2000/svg" width="192" height="192" viewBox="0 0 192 192">
<rect width="192" height="192" fill="#0b0f1f"/>
<g transform="translate(24,24)">
<rect x="0" y="0" width="144" height="144" rx="16" fill="#121639" stroke="#00f2fe" stroke-width="4"/>
<g stroke="#00f2fe" stroke-width="2">
<line x1="24" y1="0" x2="24" y2="144"/>
<line x1="48" y1="0" x2="48" y2="144"/>
<line x1="72" y1="0" x2="72" y2="144"/>
<line x1="96" y1="0" x2="96" y2="144"/>
<line x1="120" y1="0" x2="120" y2="144"/>
<line x1="0" y1="24" x2="144" y2="24"/>
<line x1="0" y1="48" x2="144" y2="48"/>
<line x1="0" y1="72" x2="144" y2="72"/>
<line x1="0" y1="96" x2="144" y2="96"/>
<line x1="0" y1="120" x2="144" y2="120"/>
</g>
<g fill="#00f2fe">
<rect x="6" y="6" width="18" height="18" rx="3"/>
<rect x="54" y="30" width="18" height="18" rx="3"/>
<rect x="102" y="78" width="18" height="18" rx="3"/>
<rect x="30" y="126" width="18" height="18" rx="3"/>
</g>
<g fill="#ffffff">
<path d="M36 40 h16 v64 h-16 z"/>
<path d="M52 40 h16 l32 48 v-48 h16 v64 h-16 l-32 -48 v48 h-16 z"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -28,6 +28,21 @@ const appVersion = __APP_VERSION__;
let displayModeMedia = null;
let prefersColorSchemeMedia = null;
const onKeyDownGlobal = (e) => {
if (e.key !== 'Escape') return;
if (showSimulation.value) {
showSimulation.value = false;
return;
}
if (showCustomModal.value) {
showCustomModal.value = false;
return;
}
if (store.isGameWon) {
store.closeWinModal();
}
};
const installLabel = computed(() => {
return isCoarsePointer.value ? t('pwa.installMobile') : t('pwa.installDesktop');
});
@@ -114,6 +129,7 @@ onMounted(() => {
} else if (displayModeMedia?.addListener) {
displayModeMedia.addListener(updateStandalone);
}
window.addEventListener('keydown', onKeyDownGlobal);
}
});
@@ -131,6 +147,7 @@ onUnmounted(() => {
} else if (displayModeMedia?.removeListener) {
displayModeMedia.removeListener(updateStandalone);
}
window.removeEventListener('keydown', onKeyDownGlobal);
});
</script>

View File

@@ -1,6 +1,6 @@
<script setup>
import { ref, computed } from 'vue';
import { ref, computed, onMounted, onUnmounted } from 'vue';
import { generateRandomGrid, calculateHints } from '@/utils/puzzleUtils';
import { solvePuzzle } from '@/utils/solver';
import { useI18n } from '@/composables/useI18n';
@@ -21,6 +21,22 @@ const simulationSpeed = ref(1); // 1 = Normal, 2 = Fast (less render updates)
let stopRequested = false;
const onKeyDown = (e) => {
if (e.key === 'Escape') {
e.stopImmediatePropagation?.();
e.preventDefault?.();
emit('close');
}
};
onMounted(() => {
window.addEventListener('keydown', onKeyDown);
});
onUnmounted(() => {
window.removeEventListener('keydown', onKeyDown);
});
const displayStatus = computed(() => {
if (!currentStatus.value) return t('simulation.status.ready');
return currentStatus.value;

View File

@@ -28,6 +28,8 @@ const handleClose = () => {
const handleKeyDown = (e) => {
if (e.key === 'Escape') {
e.stopImmediatePropagation?.();
e.preventDefault?.();
handleClose();
}
};