misc: add option to span whole screen

This commit is contained in:
Xyphyn committed 2023-07-30 14:56:35 -07:00
1 parent 45296b60d2
commit cfbf0570d3
5 files changed
+18 -4

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "photon-lemmy",
"version": "0.4.8",
"version": "0.4.9",
"private": true,
"scripts": {
"dev": "vite dev",
+3 -1
View File
@@ -12,6 +12,7 @@ interface Settings {
sort: 'Hot' | 'TopAll' | 'Active' | 'New'
feed: 'All' | 'Subscribed' | 'Local'
}
fullWidthLayout: boolean
}
const defaultSettings: Settings = {
@@ -25,6 +26,7 @@ const defaultSettings: Settings = {
sort: 'Active',
feed: 'Local',
},
fullWidthLayout: false,
}
export const userSettings = writable(defaultSettings)
@@ -34,7 +36,7 @@ if (typeof window != 'undefined') {
localStorage.getItem('settings') ?? JSON.stringify(defaultSettings)
)
userSettings.set({...defaultSettings, ...oldUserSettings})
userSettings.set({ ...defaultSettings, ...oldUserSettings })
}
userSettings.subscribe((settings) => {
+6 -1
View File
@@ -6,6 +6,7 @@
import 'nprogress/nprogress.css'
import ToastContainer from '$lib/components/ui/toasts/ToastContainer.svelte'
import Moderation from '$lib/components/lemmy/moderation/Moderation.svelte'
import { userSettings } from '$lib/settings.js'
nProgress.configure({
minimum: 0.4,
@@ -32,7 +33,11 @@
<Navbar />
<ToastContainer />
<Moderation />
<div class="flex flex-row w-full mx-auto max-w-6xl">
<div
class="flex flex-row w-full mx-auto"
class:max-w-full={$userSettings.fullWidthLayout}
class:max-w-5xl={!$userSettings.fullWidthLayout}
>
<main class="p-4 flex-[3] max-w-full">
<slot />
</main>
+7
View File
@@ -100,6 +100,13 @@
</div>
</div>
</Setting>
<Setting>
<span slot="title">Full-width layout</span>
<span slot="description">
(Not recommended) make the layout span the whole screen.
</span>
<Switch bind:enabled={$userSettings.fullWidthLayout} />
</Setting>
<h2 class="uppercase font-bold opacity-80 text-sm mt-4">UI</h2>
<Setting>
<span slot="title">Mark read posts</span>
+1 -1
View File
@@ -3,7 +3,7 @@
// @ts-ignore
import { build, files } from '$service-worker'
const version = '0.4.8'
const version = '0.4.9'
const timestamp = new Date().toLocaleString('en')
const worker = self as unknown as ServiceWorkerGlobalScope
const FILES = `cache${timestamp}`