diff --git a/src/lib/components/kurosearch/post/MosaicPost.svelte b/src/lib/components/kurosearch/post/MosaicPost.svelte index d3cdafe..36a25ae 100644 --- a/src/lib/components/kurosearch/post/MosaicPost.svelte +++ b/src/lib/components/kurosearch/post/MosaicPost.svelte @@ -3,6 +3,7 @@ import { getPostId } from '$lib/logic/id-utils'; import { isEnter } from '$lib/logic/keyboard-utils'; import { calculateAspectRatio } from './ratio'; + import highResolutionMultiColEnabled from "$lib/store/high-resolution-multi-col-enabled.js" export let post: kurosearch.Post; @@ -14,7 +15,11 @@ const isImage = (src: string) => src.endsWith('.jpg') || src.endsWith('.jpeg') || src.endsWith('.png') || src.endsWith('.webp'); - $: previewSrc = isImage(post.sample_url) ? post.sample_url : post.preview_url; + $: previewSrc = highResolutionMultiColEnabled + ? post.file_url + : isImage(post.sample_url) + ? post.sample_url + : post.preview_url; diff --git a/src/lib/store/high-resolution-multi-col-enabled.ts b/src/lib/store/high-resolution-multi-col-enabled.ts new file mode 100644 index 0000000..49d3cd7 --- /dev/null +++ b/src/lib/store/high-resolution-multi-col-enabled.ts @@ -0,0 +1,15 @@ +import { boolParser, boolSerializer, persistentWritable } from './persistent-store'; +import { StoreKey } from './store-keys'; + +const createHighResolutionMultiColEnabledStore = () => { + const initial = false; + const { subscribe, set } = persistentWritable( + StoreKey.HighResolutionMultiColEnabled, + initial, + boolSerializer, + boolParser + ); + return { subscribe, set, reset: () => set(initial) }; +}; + +export default createHighResolutionMultiColEnabledStore(); diff --git a/src/lib/store/store-keys.ts b/src/lib/store/store-keys.ts index 0058984..cf62b70 100644 --- a/src/lib/store/store-keys.ts +++ b/src/lib/store/store-keys.ts @@ -12,6 +12,7 @@ export enum StoreKey { AlwaysLoop = 'kurosearch:always-loop', CookiesAccepted = 'kurosearch:cookies-accepted', HighResolutionEnabled = 'kurosearch:high-resolution-enabled', + HighResolutionMultiColEnabled = 'kurosearch:high-resolution-multi-col-enabled', WideLayoutEnabled = 'kurosearch:wide-layout-enabled', FullscreenHintDone = 'kurosearch:fullscreen-hint-done', AutoplayFullscreenEnabled = 'kurosearch:autoplay-fullscreen-enabled-done', diff --git a/src/routes/preferences/+page.svelte b/src/routes/preferences/+page.svelte index 833fea3..897f1e7 100644 --- a/src/routes/preferences/+page.svelte +++ b/src/routes/preferences/+page.svelte @@ -38,6 +38,7 @@ import { addHistory } from '$lib/logic/use/onpopstate'; import NumberInput from '$lib/components/kurosearch/dialog-sort-filter/NumberInput.svelte'; import openTagsOnPostClick from '$lib/store/tags-shortcut-store'; + import highResolutionMultiColEnabled from "$lib/store/high-resolution-multi-col-enabled" let resetDialog: HTMLDialogElement; @@ -122,7 +123,7 @@ - +