feat: Add the option to fade the title of read posts

This commit is contained in:
Xyphyn committed 2023-07-17 11:05:06 -07:00
1 parent 953c65021e
commit 108b744746
4 files changed
+11 -2

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "photon-lemmy", "name": "photon-lemmy",
"version": "23.7.15", "version": "23.7.17",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "vite dev", "dev": "vite dev",
+3 -1
View File
@@ -17,6 +17,7 @@
Link, Link,
Trash, Trash,
} from 'svelte-hero-icons' } from 'svelte-hero-icons'
import { userSettings } from '$lib/settings.js'
let postRes: PostView let postRes: PostView
export { postRes as post } export { postRes as post }
@@ -74,7 +75,8 @@
</span> </span>
<a <a
href="/post/{getInstance()}/{postRes.post.id}" href="/post/{getInstance()}/{postRes.post.id}"
class="font-bold {postRes.read ? 'opacity-50' : ''}" class="font-bold"
class:opacity-50={postRes.read && $userSettings.markReadPosts}
> >
{postRes.post.name} {postRes.post.name}
</a> </a>
+2
View File
@@ -4,12 +4,14 @@ import { writable } from 'svelte/store'
interface Settings { interface Settings {
newComments: boolean newComments: boolean
expandableImages: boolean expandableImages: boolean
markReadPosts: boolean
instance?: string instance?: string
} }
const defaultSettings: Settings = { const defaultSettings: Settings = {
newComments: true, newComments: true,
expandableImages: true, expandableImages: true,
markReadPosts: true,
} }
export const userSettings = writable(defaultSettings) export const userSettings = writable(defaultSettings)
+5
View File
@@ -67,4 +67,9 @@
</div> </div>
</div> </div>
</Card> </Card>
<Card class="flex flex-col gap-3 p-6 text-sm">
<h1 class="font-bold">Mark read posts</h1>
<p>Fade the title of posts you've already read.</p>
<Switch bind:enabled={$userSettings.markReadPosts} />
</Card>
</div> </div>