Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
43c0290fac
|
|||
|
fa5fa12157
|
4
package-lock.json
generated
4
package-lock.json
generated
@@ -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",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "vue-nonograms-solid",
|
||||
"version": "1.14.0",
|
||||
"version": "1.14.1",
|
||||
"homepage": "https://nonograms.7u.pl/",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user