2 Commits

Author SHA1 Message Date
43c0290fac 1.14.1
All checks were successful
Deploy to Production / deploy (push) Successful in 18s
2026-02-13 06:14:56 +01:00
fa5fa12157 fix: resetGrid visibility in puzzle store and hide camera switch on single-cam devices 2026-02-13 06:14:51 +01:00
4 changed files with 14 additions and 5 deletions

4
package-lock.json generated
View File

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

View File

@@ -1,6 +1,6 @@
{
"name": "vue-nonograms-solid",
"version": "1.14.0",
"version": "1.14.1",
"homepage": "https://nonograms.7u.pl/",
"type": "module",
"scripts": {

View File

@@ -18,6 +18,7 @@ const imageLoaded = ref(false);
const processing = ref(false);
const processingProgress = ref(0);
const isCameraOpen = ref(false);
const hasMultipleCameras = ref(false);
const stream = ref(null);
const facingMode = ref('environment');
@@ -319,6 +320,12 @@ const startCamera = async () => {
}
};
stream.value = await navigator.mediaDevices.getUserMedia(constraints);
// Check available devices
const devices = await navigator.mediaDevices.enumerateDevices();
const videoDevices = devices.filter(device => device.kind === 'videoinput');
hasMultipleCameras.value = videoDevices.length > 1;
// Wait for next tick or ensure videoRef is available
setTimeout(() => {
if (videoRef.value) {
@@ -401,7 +408,7 @@ onUnmounted(() => {
<button class="camera-btn capture" @click="capturePhoto">
<div class="shutter"></div>
</button>
<button class="camera-btn secondary" @click="switchCamera">
<button v-if="hasMultipleCameras" class="camera-btn secondary" @click="switchCamera">
<RefreshCw :size="24" />
</button>
</div>

View File

@@ -118,13 +118,15 @@ export const usePuzzleStore = defineStore('puzzle', () => {
elapsedTime.value = 0;
startTimer();
saveState();
}
function resetGrid() {
const rows = solution.value.length;
const cols = solution.value[0].length;
playerGrid.value = Array(rows).fill().map(() => Array(cols).fill(0));
history.value = [];
moves.value = 0;
} currentTransaction.value = null;
currentTransaction.value = null;
}
function startInteraction() {