From: PhiTux
Date: Thu, 3 Apr 2025 16:03:18 +0000 (+0200)
Subject: added imageViewer
X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=8366a739bc6a5247ad93de81aa6a03ef8f4c2798;p=DailyTxT.git
added imageViewer
---
diff --git a/frontend/src/lib/ImageViewer.svelte b/frontend/src/lib/ImageViewer.svelte
new file mode 100644
index 0000000..2ea5106
--- /dev/null
+++ b/frontend/src/lib/ImageViewer.svelte
@@ -0,0 +1,324 @@
+
+
+
+{#if fullscreen}
+
+
+ {
+ if (
+ event.target.classList.contains('fullscreen-image-container') ||
+ event.target.classList.contains('fullscreen-overlay')
+ ) {
+ closeFullscreen();
+ }
+ }}
+ ontouchstart={handleTouchStart}
+ ontouchmove={handleTouchMove}
+ ontouchend={handleTouchEnd}
+ >
+
+
+
+ {#key images[currentIndex].uuid_filename}
+
![{images[currentIndex].filename}]({images[currentIndex].src})
+ {/key}
+
+
+
+
+
+{/if}
+
+
+
+
diff --git a/frontend/src/routes/read/+page.svelte b/frontend/src/routes/read/+page.svelte
index f599d69..a37e7c8 100644
--- a/frontend/src/routes/read/+page.svelte
+++ b/frontend/src/routes/read/+page.svelte
@@ -13,6 +13,7 @@
import { faCloudArrowDown } from '@fortawesome/free-solid-svg-icons';
import { Fa } from 'svelte-fa';
import { fade, slide } from 'svelte/transition';
+ import ImageViewer from '$lib/ImageViewer.svelte';
marked.use({
breaks: true,
@@ -63,6 +64,9 @@
$effect(() => {
if ($selectedDate) {
+ $cal.currentYear = $selectedDate.getFullYear();
+ $cal.currentMonth = $selectedDate.getMonth();
+
let el = document.querySelector(`.log[data-log-day="${$selectedDate.getDate()}"]`);
if (el) {
el.scrollIntoView({ behavior: 'smooth', block: 'start' });
@@ -345,7 +349,7 @@
-
+
{#if log.text && log.text !== ''}
{@html marked.parse(log.text)}
@@ -367,32 +371,13 @@
{:else}
-
- {#each log.images as image (image.uuid_filename)}
-
- {/each}
-
+
{/if}
{/if}
{#if log.files && log.files.length > 0}
-
+
{/if}
@@ -402,6 +387,14 @@