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",
"version": "23.7.15",
"version": "23.7.17",
"private": true,
"scripts": {
"dev": "vite dev",
+3 -1
View File
@@ -17,6 +17,7 @@
Link,
Trash,
} from 'svelte-hero-icons'
import { userSettings } from '$lib/settings.js'
let postRes: PostView
export { postRes as post }
@@ -74,7 +75,8 @@
</span>
<a
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}
</a>
+2
View File
@@ -4,12 +4,14 @@ import { writable } from 'svelte/store'
interface Settings {
newComments: boolean
expandableImages: boolean
markReadPosts: boolean
instance?: string
}
const defaultSettings: Settings = {
newComments: true,
expandableImages: true,
markReadPosts: true,
}
export const userSettings = writable(defaultSettings)
+5
View File
@@ -67,4 +67,9 @@
</div>
</div>
</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>