Misc changes

This commit is contained in:
ZXY101
2023-09-14 15:34:39 +02:00
parent ba488ab434
commit 7b44042505
5 changed files with 22 additions and 33 deletions

View File

@@ -10,25 +10,14 @@
</script>
<a href={volumeName} on:click={onClick}>
<div class="content">
<div class="flex flex-col gap-[5px] text-center">
{mokuroData.title}
{#if files}
<img src={URL.createObjectURL(Object.values(files)[0])} alt="img" />
<img
src={URL.createObjectURL(Object.values(files)[0])}
alt="img"
class="object-contain w-[250px] h-[350px] bg-black border-gray-900 border"
/>
{/if}
</div>
</a>
<style>
img {
width: 250px;
height: 350px;
object-fit: contain;
}
.content {
display: flex;
flex-direction: column;
gap: 5px;
text-align: center;
}
</style>

View File

@@ -1,5 +1,5 @@
<script lang="ts">
import { settingsStore } from '$lib/settings';
import { settings } from '$lib/settings';
import type { Page } from '$lib/types';
import { clamp } from '$lib/util';
@@ -7,7 +7,7 @@
export let left: () => void;
export let right: () => void;
$: fontWeight = $settingsStore.boldFont ? 'bold' : '400';
$: fontWeight = $settings.boldFont ? 'bold' : '400';
$: textBoxes = page.blocks.map((block) => {
const { img_height, img_width } = page;

View File

@@ -2,7 +2,7 @@
import { Drawer, CloseButton, Toggle, Select, Input, Label, Button } from 'flowbite-svelte';
import { UserSettingsSolid } from 'flowbite-svelte-icons';
import { sineIn } from 'svelte/easing';
import { resetSettings, settingsStore, updateSetting } from '$lib/settings';
import { resetSettings, settings, updateSetting } from '$lib/settings';
import { promptConfirmation } from '$lib/util';
let transitionParams = {
@@ -22,12 +22,12 @@
];
$: toggles = [
{ key: 'rightToLeft', text: 'Right to left', value: $settingsStore.rightToLeft },
{ key: 'singlePageView', text: 'Single page view', value: $settingsStore.singlePageView },
{ key: 'textEditable', text: 'Editable text', value: $settingsStore.textEditable },
{ key: 'textBoxBorders', text: 'Text box borders', value: $settingsStore.textBoxBorders },
{ key: 'displayOCR', text: 'OCR enabled', value: $settingsStore.displayOCR },
{ key: 'boldFont', text: 'Bold font', value: $settingsStore.boldFont }
{ key: 'rightToLeft', text: 'Right to left', value: $settings.rightToLeft },
{ key: 'singlePageView', text: 'Single page view', value: $settings.singlePageView },
{ key: 'textEditable', text: 'Editable text', value: $settings.textEditable },
{ key: 'textBoxBorders', text: 'Text box borders', value: $settings.textBoxBorders },
{ key: 'displayOCR', text: 'OCR enabled', value: $settings.displayOCR },
{ key: 'boldFont', text: 'Bold font', value: $settings.boldFont }
];
function onChange(event: Event) {
@@ -66,7 +66,7 @@
</div>
<div>
<Label>Background color:</Label>
<Input type="color" on:change={onChange} value={$settingsStore.backgroundColor} />
<Input type="color" on:change={onChange} value={$settings.backgroundColor} />
</div>
<Button outline on:click={onReset}>Reset</Button>
</div>