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",
|
"name": "vue-nonograms-solid",
|
||||||
"version": "1.14.0",
|
"version": "1.14.1",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "vue-nonograms-solid",
|
"name": "vue-nonograms-solid",
|
||||||
"version": "1.14.0",
|
"version": "1.14.1",
|
||||||
"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.14.0",
|
"version": "1.14.1",
|
||||||
"homepage": "https://nonograms.7u.pl/",
|
"homepage": "https://nonograms.7u.pl/",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ const imageLoaded = ref(false);
|
|||||||
const processing = ref(false);
|
const processing = ref(false);
|
||||||
const processingProgress = ref(0);
|
const processingProgress = ref(0);
|
||||||
const isCameraOpen = ref(false);
|
const isCameraOpen = ref(false);
|
||||||
|
const hasMultipleCameras = ref(false);
|
||||||
const stream = ref(null);
|
const stream = ref(null);
|
||||||
const facingMode = ref('environment');
|
const facingMode = ref('environment');
|
||||||
|
|
||||||
@@ -319,6 +320,12 @@ const startCamera = async () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
stream.value = await navigator.mediaDevices.getUserMedia(constraints);
|
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
|
// Wait for next tick or ensure videoRef is available
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (videoRef.value) {
|
if (videoRef.value) {
|
||||||
@@ -401,7 +408,7 @@ onUnmounted(() => {
|
|||||||
<button class="camera-btn capture" @click="capturePhoto">
|
<button class="camera-btn capture" @click="capturePhoto">
|
||||||
<div class="shutter"></div>
|
<div class="shutter"></div>
|
||||||
</button>
|
</button>
|
||||||
<button class="camera-btn secondary" @click="switchCamera">
|
<button v-if="hasMultipleCameras" class="camera-btn secondary" @click="switchCamera">
|
||||||
<RefreshCw :size="24" />
|
<RefreshCw :size="24" />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -118,13 +118,15 @@ export const usePuzzleStore = defineStore('puzzle', () => {
|
|||||||
elapsedTime.value = 0;
|
elapsedTime.value = 0;
|
||||||
startTimer();
|
startTimer();
|
||||||
saveState();
|
saveState();
|
||||||
|
}
|
||||||
|
|
||||||
function resetGrid() {
|
function resetGrid() {
|
||||||
const rows = solution.value.length;
|
const rows = solution.value.length;
|
||||||
const cols = solution.value[0].length;
|
const cols = solution.value[0].length;
|
||||||
playerGrid.value = Array(rows).fill().map(() => Array(cols).fill(0));
|
playerGrid.value = Array(rows).fill().map(() => Array(cols).fill(0));
|
||||||
history.value = [];
|
history.value = [];
|
||||||
moves.value = 0;
|
moves.value = 0;
|
||||||
} currentTransaction.value = null;
|
currentTransaction.value = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function startInteraction() {
|
function startInteraction() {
|
||||||
|
|||||||
Reference in New Issue
Block a user