Cleanup and zip handling

This commit is contained in:
ZXY101
2023-08-11 12:35:17 +02:00
parent 416b832f63
commit 1e943ea74e
11 changed files with 92 additions and 53 deletions

View File

@@ -1,5 +1,5 @@
<script lang="ts">
import { catalog } from '$lib/catalog/test';
import { catalog } from '$lib/catalog';
import CatalogItem from './CatalogItem.svelte';
</script>

View File

@@ -1,6 +1,6 @@
<script lang="ts">
import { currentManga } from '$lib/catalog';
import type { Volume } from '$lib/upload';
import type { Volume } from '$lib/types';
export let manga: Volume[];
const { volumeName, files, mokuroData } = manga[0];

View File

@@ -1,18 +1,5 @@
<script lang="ts">
type Block = {
box: number[];
vertical: boolean;
fontSize: number;
lines: string[];
};
type Page = {
version?: string;
img_width: number;
img_height: number;
blocks: Block[];
imgPath: string;
};
import type { Page } from '$lib/types';
export let page: Page;
@@ -28,7 +15,7 @@
$: textBoxes = page.blocks.map((block) => {
const { img_height, img_width } = page;
const { box, fontSize, lines, vertical } = block;
const { box, font_size, lines, vertical } = block;
let [_xmin, _ymin, _xmax, _ymax] = box;
@@ -46,7 +33,7 @@
top: `${ymin}px`,
width: `${width}px`,
height: `${height}px`,
fontSize: `${fontSize}px`,
fontSize: `${font_size}px`,
writingMode: vertical ? 'vertical-rl' : 'horizontal-tb',
lines
};

View File

@@ -1,7 +1,7 @@
<script lang="ts">
import { page } from '$app/stores';
import { currentVolume } from '$lib/catalog';
import type { Volume } from '$lib/upload';
import type { Volume } from '$lib/types';
export let volume: Volume;
const { volumeName, files } = volume;