Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fc25246594 | |||
| d7e104c17a | |||
| c197445f35 | |||
| 57ae54d716 | |||
| 82a3717689 | |||
| d4c93af2c2 |
@@ -2,9 +2,9 @@
|
|||||||
<html lang="pl">
|
<html lang="pl">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<link rel="icon" type="image/svg+xml" href="/pwa-192x192.svg" />
|
<link rel="icon" type="image/svg+xml" href="/nonograms.svg" />
|
||||||
<link rel="apple-touch-icon" href="/pwa-192x192.svg" />
|
<link rel="apple-touch-icon" href="/nonograms.svg" />
|
||||||
<link rel="mask-icon" href="/pwa-192x192.svg" color="#00f2fe" />
|
<link rel="mask-icon" href="/nonograms.svg" color="#00f2fe" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Nonograms Pro - Vue 3 SOLID</title>
|
<title>Nonograms Pro - Vue 3 SOLID</title>
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "vue-nonograms-solid",
|
"name": "vue-nonograms-solid",
|
||||||
"version": "1.9.7",
|
"version": "1.9.10",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "vue-nonograms-solid",
|
"name": "vue-nonograms-solid",
|
||||||
"version": "1.9.7",
|
"version": "1.9.10",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"fireworks-js": "^2.10.8",
|
"fireworks-js": "^2.10.8",
|
||||||
"flag-icons": "^7.5.0",
|
"flag-icons": "^7.5.0",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "vue-nonograms-solid",
|
"name": "vue-nonograms-solid",
|
||||||
"version": "1.9.7",
|
"version": "1.9.10",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
28
public/nonograms.svg
Normal file
28
public/nonograms.svg
Normal 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 |
17
src/App.vue
17
src/App.vue
@@ -28,6 +28,21 @@ const appVersion = __APP_VERSION__;
|
|||||||
let displayModeMedia = null;
|
let displayModeMedia = null;
|
||||||
let prefersColorSchemeMedia = 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(() => {
|
const installLabel = computed(() => {
|
||||||
return isCoarsePointer.value ? t('pwa.installMobile') : t('pwa.installDesktop');
|
return isCoarsePointer.value ? t('pwa.installMobile') : t('pwa.installDesktop');
|
||||||
});
|
});
|
||||||
@@ -114,6 +129,7 @@ onMounted(() => {
|
|||||||
} else if (displayModeMedia?.addListener) {
|
} else if (displayModeMedia?.addListener) {
|
||||||
displayModeMedia.addListener(updateStandalone);
|
displayModeMedia.addListener(updateStandalone);
|
||||||
}
|
}
|
||||||
|
window.addEventListener('keydown', onKeyDownGlobal);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -131,6 +147,7 @@ onUnmounted(() => {
|
|||||||
} else if (displayModeMedia?.removeListener) {
|
} else if (displayModeMedia?.removeListener) {
|
||||||
displayModeMedia.removeListener(updateStandalone);
|
displayModeMedia.removeListener(updateStandalone);
|
||||||
}
|
}
|
||||||
|
window.removeEventListener('keydown', onKeyDownGlobal);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed } from 'vue';
|
import { ref, computed, onMounted, onUnmounted } from 'vue';
|
||||||
import { generateRandomGrid, calculateHints } from '@/utils/puzzleUtils';
|
import { generateRandomGrid, calculateHints } from '@/utils/puzzleUtils';
|
||||||
import { solvePuzzle } from '@/utils/solver';
|
import { solvePuzzle } from '@/utils/solver';
|
||||||
import { useI18n } from '@/composables/useI18n';
|
import { useI18n } from '@/composables/useI18n';
|
||||||
@@ -21,6 +21,22 @@ const simulationSpeed = ref(1); // 1 = Normal, 2 = Fast (less render updates)
|
|||||||
|
|
||||||
let stopRequested = false;
|
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(() => {
|
const displayStatus = computed(() => {
|
||||||
if (!currentStatus.value) return t('simulation.status.ready');
|
if (!currentStatus.value) return t('simulation.status.ready');
|
||||||
return currentStatus.value;
|
return currentStatus.value;
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ const handleClose = () => {
|
|||||||
|
|
||||||
const handleKeyDown = (e) => {
|
const handleKeyDown = (e) => {
|
||||||
if (e.key === 'Escape') {
|
if (e.key === 'Escape') {
|
||||||
|
e.stopImmediatePropagation?.();
|
||||||
|
e.preventDefault?.();
|
||||||
handleClose();
|
handleClose();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user