This commit is contained in:
2024-06-04 06:57:54 +00:00
parent 015e813bc4
commit 16fab643ea
3 changed files with 10 additions and 3 deletions
+1 -1
View File
@@ -4,7 +4,7 @@
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> <link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + Svelte + TS</title> <title>Live Caputre Mode</title>
</head> </head>
<body> <body>
<div id="app"></div> <div id="app"></div>
+2 -2
View File
@@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
import { onMount } from "svelte"; import { onMount } from "svelte";
import type { IGalleryDb, IGalleryImage } from "./app"; import { intervalInSeconds, type IGalleryDb, type IGalleryImage } from "./app";
import CompGalleryImage from "./CompGalleryImage.svelte"; import CompGalleryImage from "./CompGalleryImage.svelte";
import CompDialogImage from "./CompDialogImage.svelte"; import CompDialogImage from "./CompDialogImage.svelte";
@@ -47,7 +47,7 @@ onMount(() => {
}); });
await queryPage.refresh(); await queryPage.refresh();
}, 5000); }, intervalInSeconds * 1000);
cleanup.push(() => { cleanup.push(() => {
clearInterval(intervalId); clearInterval(intervalId);
+7
View File
@@ -2,6 +2,13 @@ import { openDB, type IDBPDatabase } from "idb";
import type { Readable } from "svelte/motion"; import type { Readable } from "svelte/motion";
import { readable, writable } from "svelte/store"; import { readable, writable } from "svelte/store";
// #####################
// ###
export const intervalInSeconds = 15 * 60;
// ###
// #####################
export interface IGalleryImage { export interface IGalleryImage {
id: IDBValidKey; id: IDBValidKey;
when: Date; when: Date;