feat: color overhaul

This commit is contained in:
Xyphyn committed 2023-09-14 16:44:00 -07:00
1 parent 8fc452951b
commit e5fbf7493c
22 files changed
+211 -220

No files matched your search

+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "photon-lemmy", "name": "photon-lemmy",
"version": "1.5.0", "version": "1.6.0",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "vite dev", "dev": "vite dev",
@@ -42,7 +42,7 @@
"@dicebear/initials": "^6.0.4", "@dicebear/initials": "^6.0.4",
"lemmy-js-client": "^0.18.0-rc.2", "lemmy-js-client": "^0.18.0-rc.2",
"markdown-it": "^13.0.1", "markdown-it": "^13.0.1",
"mono-svelte": "^0.2.20" "mono-svelte": "^0.3.2"
}, },
"type": "module" "type": "module"
} }
-5
View File
@@ -92,11 +92,6 @@ profile.subscribe(async (p) => {
username: user?.user.local_user_view.person.name, username: user?.user.local_user_view.person.name,
avatar: user?.user.local_user_view.person.avatar, avatar: user?.user.local_user_view.person.avatar,
})) }))
profile.update((pro) => {
console.log(pro)
return pro
})
}) })
export async function setUser(jwt: string, inst: string, username: string) { export async function setUser(jwt: string, inst: string, username: string) {
+2 -2
View File
@@ -23,7 +23,7 @@
}} }}
> >
<span slot="label" class="flex items-center gap-1"> <span slot="label" class="flex items-center gap-1">
<Icon src={Clock} size="16" mini /> <Icon src={Clock} size="15" mini />
Time Time
</span> </span>
<option value="TopAll">All</option> <option value="TopAll">All</option>
@@ -47,7 +47,7 @@
}} }}
> >
<span slot="label" class="flex items-center gap-1"> <span slot="label" class="flex items-center gap-1">
<Icon src={ChartBar} size="14" mini /> <Icon src={ChartBar} size="13" mini />
Sort Sort
</span> </span>
<option value="Active">Active</option> <option value="Active">Active</option>
@@ -4,12 +4,15 @@
import Subscribe from '../../../../routes/communities/Subscribe.svelte' import Subscribe from '../../../../routes/communities/Subscribe.svelte'
import { import {
ChatBubbleOvalLeftEllipsis, ChatBubbleOvalLeftEllipsis,
Check,
Icon, Icon,
PencilSquare, PencilSquare,
Plus,
UserGroup, UserGroup,
} from 'svelte-hero-icons' } from 'svelte-hero-icons'
import FormattedNumber from '$lib/components/util/FormattedNumber.svelte' import FormattedNumber from '$lib/components/util/FormattedNumber.svelte'
import { Button } from 'mono-svelte' import { Button } from 'mono-svelte'
import { isSubscribed } from '$lib/util.js'
export let community: CommunityView export let community: CommunityView
</script> </script>
@@ -17,7 +20,7 @@
<div class="py-4 flex flex-col gap-1 text-sm max-w-full"> <div class="py-4 flex flex-col gap-1 text-sm max-w-full">
<div class="flex flex-row items-center"> <div class="flex flex-row items-center">
<span <span
class="break-words max-w-full w-max text-base font-bold text-sky-400 hover:underline" class="break-words max-w-full w-max text-base font-bold hover:underline"
> >
<CommunityLink <CommunityLink
showInstance={false} showInstance={false}
@@ -40,9 +43,22 @@
: 'NotSubscribed' : 'NotSubscribed'
} }
}} }}
color={community.subscribed == 'Subscribed' ? 'primary' : 'ghost'} color={isSubscribed(community.subscribed) ? 'elevatedLow' : 'primary'}
class={isSubscribed(community.subscribed)
? 'text-slate-600 dark:text-zinc-400'
: ''}
> >
{community.subscribed == 'Subscribed' ? 'Subscribed' : 'Subscribe'} <Icon
src={isSubscribed(community.subscribed) ? Check : Plus}
size="16"
mini
slot="prefix"
/>
{#if isSubscribed(community.subscribed)}
Subscribed
{:else}
Subscribe
{/if}
</Button> </Button>
</Subscribe> </Subscribe>
</div> </div>
+2 -2
View File
@@ -49,10 +49,10 @@
{#if view == 'list' || view == 'compact'} {#if view == 'list' || view == 'compact'}
<div <div
class="absolute -inset-0.5 group-hover:-inset-2 group-hover:-inset-y-3 group-hover:md:-inset-4 class="absolute -inset-0.5 group-hover:-inset-2 group-hover:-inset-y-3 group-hover:md:-inset-4
transition-all -z-[5] rounded-xl group-hover:bg-slate-100 group-hover:dark:bg-zinc-900" transition-all rounded-xl group-hover:bg-slate-50 group-hover:dark:bg-zinc-900"
/> />
{/if} {/if}
<div class="flex flex-row gap-2 max-w-full w-full"> <div class="flex flex-row gap-2 max-w-full w-full z-10">
<div class="flex flex-col w-full gap-2"> <div class="flex flex-col w-full gap-2">
<div class="flex flex-col w-full gap-2"> <div class="flex flex-col w-full gap-2">
<PostMeta <PostMeta
@@ -75,7 +75,7 @@
</Modal> </Modal>
{/if} {/if}
<div class="flex flex-row gap-2 items-center h-8"> <div class="flex flex-row gap-2 items-center h-8 [&>*]:z-10">
<PostVote <PostVote
post={post.post} post={post.post}
bind:vote={post.my_vote} bind:vote={post.my_vote}
+1 -1
View File
@@ -22,7 +22,7 @@
<div <div
bind:this={div} bind:this={div}
class="break-words flex flex-col markdown gap-2 leading-[1.5]" class="break-words flex flex-col markdown gap-2 leading-[1.5] font-sans"
> >
{#if inline} {#if inline}
{@html mdInline.render(source)} {@html mdInline.render(source)}
+5 -11
View File
@@ -41,7 +41,7 @@
</script> </script>
<nav <nav
class="flex flex-row gap-2 items-center sticky top-0 bg-slate-100/80 class="flex flex-row gap-2 items-center sticky top-0 bg-slate-50/80
dark:bg-black/80 backdrop-blur-3xl w-full mx-auto px-4 py-2 z-50 box-border h-16" dark:bg-black/80 backdrop-blur-3xl w-full mx-auto px-4 py-2 z-50 box-border h-16"
> >
<div class="flex flex-row gap-2 items-center mr-auto"> <div class="flex flex-row gap-2 items-center mr-auto">
@@ -92,9 +92,7 @@
<Button <Button
href="/admin" href="/admin"
aria-label="Admin" aria-label="Admin"
class="max-md:w-9 max-md:h-8 max-md:!p-0 class="max-md:w-9 max-md:h-8 max-md:!p-0 relative"
dark:text-zinc-300 text-slate-700 hover:text-inherit hover:dark:text-inherit
hover:bg-slate-200 relative hover:border-slate-300"
> >
<Icon src={CommandLine} mini size="16" slot="prefix" /> <Icon src={CommandLine} mini size="16" slot="prefix" />
<span class="hidden md:inline">Admin</span> <span class="hidden md:inline">Admin</span>
@@ -104,8 +102,7 @@
<Button <Button
href="/moderation" href="/moderation"
aria-label="Moderation" aria-label="Moderation"
class="max-md:w-9 max-md:h-8 max-md:!p-0 dark:text-zinc-300 text-slate-700 class="max-md:w-9 max-md:h-8 max-md:!p-0 dark:text-zinc-300 text-slate-700 relative"
hover:text-inherit hover:bg-slate-200 hover:dark:text-inherit relative hover:border-slate-300"
> >
{#if $profile?.user?.reports ?? 0 > 0} {#if $profile?.user?.reports ?? 0 > 0}
<div <div
@@ -119,8 +116,7 @@
<Button <Button
href="/search" href="/search"
aria-label="Search" aria-label="Search"
class="max-md:w-9 max-md:h-8 max-md:!p-0 class="max-md:w-9 max-md:h-8 max-md:!p-0"
dark:text-zinc-300 text-slate-700 hover:text-inherit hover:dark:text-inherit hover:bg-slate-200 hover:border-slate-300"
> >
<Icon mini src={MagnifyingGlass} width={16} slot="prefix" /> <Icon mini src={MagnifyingGlass} width={16} slot="prefix" />
<span class="hidden md:inline">Search</span> <span class="hidden md:inline">Search</span>
@@ -128,9 +124,7 @@
<Button <Button
href="/communities" href="/communities"
aria-label="Communities" aria-label="Communities"
class="max-md:w-9 max-md:h-8 max-md:!p-0 class="max-md:w-9 max-md:h-8 max-md:!p-0"
dark:text-zinc-300 text-slate-700 hover:text-inherit
hover:dark:text-inherit hover:bg-slate-200 hover:border-slate-300"
> >
<Icon mini src={GlobeAlt} size="16" slot="prefix" /> <Icon mini src={GlobeAlt} size="16" slot="prefix" />
<span class="hidden md:inline">Explore</span> <span class="hidden md:inline">Explore</span>
@@ -16,7 +16,7 @@
animate:flip={{ duration: 500, easing: expoOut }} animate:flip={{ duration: 500, easing: expoOut }}
> >
<Button <Button
class="hover:bg-slate-200 w-full h-max {expanded ? '' : '!p-1.5'}" class="font-normal w-full h-max {expanded ? '' : '!p-1.5'}"
color="tertiary" color="tertiary"
alignment="left" alignment="left"
href="/c/{follow.name}@{new URL(follow.actor_id).hostname}" href="/c/{follow.name}@{new URL(follow.actor_id).hostname}"
@@ -32,7 +32,7 @@
switching = false switching = false
}} }}
class="w-full hover:bg-slate-200 {expanded ? '' : '!p-1.5'}" class="w-full {expanded ? '' : '!p-1.5'}"
> >
<ProfileAvatar <ProfileAvatar
profile={prof} profile={prof}
+2 -2
View File
@@ -20,7 +20,7 @@
<nav <nav
class="hidden sm:flex flex-col pl-4 pr-4 py-4 overflow-auto sticky top-16 bottom-0 class="hidden sm:flex flex-col pl-4 pr-4 py-4 overflow-auto sticky top-16 bottom-0
gap-1 max-h-[calc(100svh-4rem)] w-full bg-slate-100 dark:bg-black gap-1 max-h-[calc(100svh-4rem)] w-full bg-slate-50 dark:bg-black
{$userSettings.expandSidebar {$userSettings.expandSidebar
? 'max-w-[25%] resize-x min-w-[12rem]' ? 'max-w-[25%] resize-x min-w-[12rem]'
: 'w-max max-w-max min-w-max'}" : 'w-max max-w-max min-w-max'}"
@@ -28,7 +28,7 @@
<Button <Button
on:click={() => on:click={() =>
($userSettings.expandSidebar = !$userSettings.expandSidebar)} ($userSettings.expandSidebar = !$userSettings.expandSidebar)}
class="w-max !p-2 hover:bg-slate-200" class="w-max !p-2"
aria-label="Collapse sidebar" aria-label="Collapse sidebar"
> >
<Icon <Icon
@@ -9,7 +9,9 @@
color="tertiary" color="tertiary"
alignment="left" alignment="left"
on:click on:click
class="hover:bg-slate-200 {expanded ? '' : '!p-1.5'} {$$props.class}" class="hover:bg-slate-100 font-normal {expanded
? ''
: '!p-1.5'} {$$props.class}"
> >
<slot /> <slot />
</Button> </Button>
+3 -2
View File
@@ -56,8 +56,9 @@ interface Settings {
randomPlaceholders: boolean randomPlaceholders: boolean
modlogCardView: boolean | undefined modlogCardView: boolean | undefined
debugInfo: boolean debugInfo: boolean
systemUI: boolean
expandImages: boolean expandImages: boolean
font: 'inter' | 'system' | 'browser'
} }
export const defaultSettings: Settings = { export const defaultSettings: Settings = {
@@ -93,9 +94,9 @@ export const defaultSettings: Settings = {
randomPlaceholders: toBool(env.PUBLIC_RANDOM_PLACEHOLDERS) ?? true, randomPlaceholders: toBool(env.PUBLIC_RANDOM_PLACEHOLDERS) ?? true,
modlogCardView: toBool(env.PUBLIC_MODLOG_CARD_VIEW) ?? undefined, modlogCardView: toBool(env.PUBLIC_MODLOG_CARD_VIEW) ?? undefined,
debugInfo: false, debugInfo: false,
systemUI: true,
expandImages: true, expandImages: true,
view: 'list', view: 'list',
font: 'system',
} }
export const userSettings = writable(defaultSettings) export const userSettings = writable(defaultSettings)
+7
View File
@@ -2,6 +2,7 @@ import { goto } from '$app/navigation'
import { toast } from 'mono-svelte' import { toast } from 'mono-svelte'
import { userSettings } from '$lib/settings.js' import { userSettings } from '$lib/settings.js'
import { get } from 'svelte/store' import { get } from 'svelte/store'
import type { SubscribedType } from 'lemmy-js-client'
export const findClosestNumber = (numbers: number[], target: number): number => export const findClosestNumber = (numbers: number[], target: number): number =>
numbers.reduce((prev, curr) => numbers.reduce((prev, curr) =>
@@ -98,3 +99,9 @@ export const trycatch = <T>(func: () => T): Maybe<T> => {
export const removeItem = <T>(array: T[], predicate: (item: T) => boolean) => { export const removeItem = <T>(array: T[], predicate: (item: T) => boolean) => {
array.splice(array.findIndex(predicate), 1) array.splice(array.findIndex(predicate), 1)
} }
export const DOMAIN_REGEX = /^((?!-)[A-Za-z0-9-]{1,63}\.)+[A-Za-z]{2,63}/gi
export const DOMAIN_REGEX_FORMS = '^((?!-)[A-Za-z0-9-]{1,63}.)+[A-Za-z]{2,63}'
export const isSubscribed = (subscribed: SubscribedType) =>
subscribed == 'Pending' || subscribed == 'Subscribed'
+8 -3
View File
@@ -42,9 +42,14 @@
</svelte:head> </svelte:head>
<div <div
class="flex flex-col min-h-screen {$userSettings.systemUI class="flex flex-col min-h-screen
font-inter
{$userSettings.font == 'inter'
? 'font-inter'
: $userSettings.font == 'system'
? 'font-system' ? 'font-system'
: 'font-sans'}" : 'font-sans'}
"
> >
<Navbar /> <Navbar />
<ToastContainer /> <ToastContainer />
@@ -53,7 +58,7 @@
<Sidebar /> <Sidebar />
<main <main
class="p-3 sm:p-6 min-w-0 w-full flex-[3] sm:rounded-tl-lg class="p-3 sm:p-6 min-w-0 w-full flex-[3] sm:rounded-tl-lg
border-slate-200 dark:border-zinc-900 sm:border-l border-t" border-slate-200 dark:border-zinc-900 sm:border-l border-t bg-slate-25 dark:bg-zinc-950"
> >
<slot /> <slot />
</main> </main>
+51 -113
View File
@@ -4,33 +4,59 @@
import { page } from '$app/stores' import { page } from '$app/stores'
import { import {
ChatBubbleOvalLeftEllipsis, ChatBubbleOvalLeftEllipsis,
Check,
GlobeAmericas, GlobeAmericas,
Icon, Icon,
InformationCircle,
PencilSquare, PencilSquare,
Plus,
QuestionMarkCircle, QuestionMarkCircle,
UserGroup, UserGroup,
} from 'svelte-hero-icons' } from 'svelte-hero-icons'
import CommunityLink from '$lib/components/lemmy/community/CommunityLink.svelte' import CommunityLink from '$lib/components/lemmy/community/CommunityLink.svelte'
import Subscribe from './Subscribe.svelte' import Subscribe from './Subscribe.svelte'
import Pageination from '$lib/components/ui/Pageination.svelte' import Pageination from '$lib/components/ui/Pageination.svelte'
import { searchParam } from '$lib/util.js' import {
DOMAIN_REGEX,
DOMAIN_REGEX_FORMS,
isSubscribed,
searchParam,
} from '$lib/util.js'
import { addSubscription } from '$lib/lemmy/user.js' import { addSubscription } from '$lib/lemmy/user.js'
import { LINKED_INSTANCE_URL } from '$lib/instance.js'
import { profile } from '$lib/auth.js' import { profile } from '$lib/auth.js'
import { Button, Select, TextInput } from 'mono-svelte' import { Button, Material, Popover, Select, TextInput } from 'mono-svelte'
import Sort from '$lib/components/lemmy/Sort.svelte' import Sort from '$lib/components/lemmy/Sort.svelte'
import Placeholder from '$lib/components/ui/Placeholder.svelte'
import FormattedNumber from '$lib/components/util/FormattedNumber.svelte'
import CommunityItem from '$lib/components/lemmy/community/CommunityItem.svelte'
export let data export let data
let search = '' let search = data.query || ''
let instance = ''
</script> </script>
<svelte:head> <svelte:head>
<title>Communities</title> <title>Communities</title>
</svelte:head> </svelte:head>
<h1 class="text-2xl font-bold">Communities</h1> <h1 class="text-2xl font-bold">
<p class="text-slate-600 dark:text-zinc-400 mt-2"> <span>Communities</span>
<Popover
openOnHover
class="!inline-flex"
targetClass="inline"
origin="bottom-center"
>
<Icon
src={InformationCircle}
size="20"
mini
slot="target"
class="!inline"
/>
<Material slot="popover" color="distinct" class="w-72">
<p class="font-normal">
Can't find a community on your home instance? Go to the <a Can't find a community on your home instance? Go to the <a
href="/search" href="/search"
class="text-blue-500 hover:underline" class="text-blue-500 hover:underline"
@@ -39,7 +65,10 @@
</a> </a>
page, and search with this syntax: page, and search with this syntax:
<code>!community@instance.com</code> <code>!community@instance.com</code>
</p> </p>
</Material>
</Popover>
</h1>
<div class="flex flex-row flex-wrap gap-4 mt-4"> <div class="flex flex-row flex-wrap gap-4 mt-4">
<Select <Select
bind:value={data.type} bind:value={data.type}
@@ -54,124 +83,33 @@
<option value="Subscribed">Subscribed</option> <option value="Subscribed">Subscribed</option>
</Select> </Select>
<Sort selected={data.sort} /> <Sort selected={data.sort} />
<div class="flex flex-col sm:flex-row gap-2 sm:ml-auto items-center"> <form
<TextInput on:submit|preventDefault={() =>
bind:value={search} goto(`/search?q=${search}&type=Communities`)}
on:change={() => () => searchParam($page.url, 'q', search, 'page')} class="flex flex-col sm:flex-row gap-2 sm:ml-auto items-center"
/>
<Button
on:click={() => searchParam($page.url, 'q', search, 'page')}
color="ghost"
class="h-max"
> >
Search <TextInput bind:value={search} />
</Button> <Button submit color="ghost" class="h-max">Search</Button>
</div> </form>
</div> </div>
<ul class="flex flex-col divide-y dark:divide-zinc-800"> <ul class="flex flex-col divide-y dark:divide-zinc-800">
{#if data.communities.length == 0} {#if data.communities.length == 0}
<div <Placeholder
class="text-slate-600 dark:text-zinc-400 flex flex-col justify-center items-center py-8" icon={QuestionMarkCircle}
> title="No communities"
<Icon src={QuestionMarkCircle} size="32" solid /> description="There are no communities that match this filter. Try refining your
<h1 class="font-bold text-2xl">No communities</h1> search."
<p class="mt-2 text-center"> />
There are no communities with that name. Try refining your search.
</p>
</div>
{/if} {/if}
{#each data.communities as community} {#each data.communities as community}
<li class="py-3"> <CommunityItem {community} />
<div
class="
flex flex-col gap-1 text-sm max-w-full"
>
<div class="flex flex-row items-center">
<span
class="break-words max-w-full w-max text-base font-bold text-sky-400 hover:underline"
>
<CommunityLink
showInstance={false}
avatar
community={community.community}
/>
</span>
<div class="ml-auto">
<Subscribe {community} let:subscribe let:subscribing>
<Button
disabled={subscribing || !$profile?.jwt}
loading={subscribing}
on:click={async () => {
const res = await subscribe()
if (res) {
community.subscribed =
res.community_view.subscribed != 'NotSubscribed'
? 'Subscribed'
: 'NotSubscribed'
addSubscription(
community.community,
res.community_view.subscribed == 'Subscribed' ||
res.community_view.subscribed == 'Pending'
)
}
}}
color={community.subscribed == 'Subscribed'
? 'primary'
: 'ghost'}
>
{community.subscribed == 'Subscribed'
? 'Subscribed'
: 'Subscribe'}
</Button>
</Subscribe>
</div>
</div>
<span class="opacity-80 mb-2">
{new URL(community.community.actor_id).hostname}
</span>
<div class="flex flex-row gap-3 items-center">
<div class="flex flex-row gap-1 items-center">
<Icon src={UserGroup} width={16} mini />
<span>
{Intl.NumberFormat('en', { notation: 'compact' }).format(
community.counts.subscribers
)}
</span>
</div>
<div class="flex flex-row gap-1 items-center">
<Icon src={PencilSquare} mini width={16} />
<span>
{Intl.NumberFormat('en', { notation: 'compact' }).format(
community.counts.posts
)}
</span>
</div>
<div class="flex flex-row gap-1 items-center">
<Icon src={ChatBubbleOvalLeftEllipsis} mini width={16} />
<span>
{Intl.NumberFormat('en', { notation: 'compact' }).format(
community.counts.comments
)}
</span>
</div>
</div>
</div>
</li>
{/each} {/each}
</ul> </ul>
{#if data.communities.length > 0} {#if data.communities.length > 0}
<div class="mt-2 w-full"> <div class="mt-2 w-full">
<Pageination <Pageination
page={Number($page.url.searchParams.get('page')) || 1} page={Number($page.url.searchParams.get('page')) || 1}
on:change={(p) => { on:change={(p) => searchParam($page.url, 'page', p.detail.toString())}
$page.url.searchParams.set('page', p.detail.toString())
goto($page.url.toString(), {
invalidateAll: true,
})
}}
/> />
</div> </div>
{/if} {/if}
+4
View File
@@ -25,6 +25,8 @@ export async function load({ url, fetch }) {
})), })),
type: type, type: type,
sort: sort, sort: sort,
query: query,
page: page,
} }
} else { } else {
return { return {
@@ -37,6 +39,8 @@ export async function load({ url, fetch }) {
})), })),
type: type, type: type,
sort: sort, sort: sort,
query: query,
page: page,
} }
} }
} }
+73 -62
View File
@@ -26,13 +26,11 @@
<title>Settings</title> <title>Settings</title>
</svelte:head> </svelte:head>
<div class="flex flex-col"> <h1 class="text-3xl font-bold flex justify-between">
<h1 class="text-3xl font-bold flex justify-between">
Settings <Button Settings <Button
on:click={() => { on:click={() => {
toast({ toast({
content: content: 'Are you sure you want to reset your settings to the default?',
'Are you sure you want to reset your settings to the default?',
action: () => ($userSettings = defaultSettings), action: () => ($userSettings = defaultSettings),
}) })
}} }}
@@ -41,8 +39,33 @@
<Icon src={ArrowPath} mini size="16" slot="prefix" /> <Icon src={ArrowPath} mini size="16" slot="prefix" />
Reset to default Reset to default
</Button> </Button>
</h1> </h1>
<SectionTitle class="mt-4">General</SectionTitle>
<div class="flex flex-col max-w-4xl mx-auto">
<SectionTitle class="mt-4">UI</SectionTitle>
<Setting>
<span slot="title">Post style</span>
<ViewSelect />
<p slot="description">
{#if $userSettings.view == 'list'}
Show posts in a list, with post bodies and compact images.
{:else if $userSettings.view == 'compact'}
Show posts in a list, without post bodies and with tighter spacing.
{:else if $userSettings.view == 'card'}
Show posts in cards, with large images.
{/if}
</p>
</Setting>
<Setting>
<span slot="title">Random placeholders</span>
<span slot="description">
Show a random placeholder for forms for comments, posts, etc.
</span>
<Checkbox bind:checked={$userSettings.randomPlaceholders}>
{$userSettings.randomPlaceholders ? 'Enabled' : 'Disabled'}
</Checkbox>
</Setting>
<Setting> <Setting>
<span slot="title">Default sort</span> <span slot="title">Default sort</span>
<span slot="description">The default sort to use for feeds.</span> <span slot="description">The default sort to use for feeds.</span>
@@ -76,17 +99,42 @@
</div> </div>
</Setting> </Setting>
<Setting> <Setting>
<span slot="title">Post style</span> <span slot="title">Use display name</span>
<ViewSelect /> <span slot="description">
<p> Show a user's display name instead of their account username.
{#if $userSettings.view == 'list'} </span>
Show posts in a list, with post bodies and compact images.
{:else if $userSettings.view == 'compact'} <Checkbox bind:checked={$userSettings.displayNames}>
Show posts in a list, without post bodies and with tighter spacing. {$userSettings.displayNames ? 'Enabled' : 'Disabled'}
{:else if $userSettings.view == 'card'} </Checkbox>
Show posts in cards, with large images. </Setting>
{/if}
</p> <SectionTitle class="mt-4">Posts</SectionTitle>
<Setting>
<span slot="title">Fade read posts</span>
<span slot="description">Fade the title of posts you've already read.</span>
<Checkbox bind:checked={$userSettings.markReadPosts}>
{$userSettings.markReadPosts ? 'Enabled' : 'Disabled'}
</Checkbox>
</Setting>
<Setting>
<span slot="title">NSFW blur</span>
<span slot="description">
Blur images and remove post bodies of NSFW content.
</span>
<Checkbox bind:checked={$userSettings.nsfwBlur}>
{$userSettings.nsfwBlur ? 'Enabled' : 'Disabled'}
</Checkbox>
</Setting>
<Setting>
<span slot="title">Expand Images</span>
<span slot="description">
Clicking on an image brings you to an expanded view rather than sending
you to the post page.
</span>
<Checkbox bind:checked={$userSettings.expandImages}>
{$userSettings.expandImages ? 'Enabled' : 'Disabled'}
</Checkbox>
</Setting> </Setting>
<Setting> <Setting>
<span slot="title">Hide Posts</span> <span slot="title">Hide Posts</span>
@@ -110,45 +158,6 @@
</Checkbox> </Checkbox>
</div> </div>
</Setting> </Setting>
<Setting>
<Checkbox slot="title" bind:checked={$userSettings.displayNames}>
Use display name
</Checkbox>
<span slot="description">
Show a user's display name instead of their account username.
</span>
</Setting>
<Setting>
<Checkbox slot="title" bind:checked={$userSettings.randomPlaceholders}>
Random placeholders
</Checkbox>
<span slot="description">
Show a random placeholder for forms for comments, posts, etc.
</span>
</Setting>
<SectionTitle class="mt-4">UI</SectionTitle>
<Setting>
<Checkbox bind:checked={$userSettings.markReadPosts} slot="title">
Fade read posts
</Checkbox>
<span slot="description">Fade the title of posts you've already read.</span>
</Setting>
<Setting>
<Checkbox bind:checked={$userSettings.nsfwBlur} slot="title">
NSFW blur
</Checkbox>
<span slot="description">Blur images of NSFW content.</span>
</Setting>
<Setting>
<Checkbox bind:checked={$userSettings.expandImages} slot="title">
Expand Images
</Checkbox>
<span slot="description">
Clicking on an image brings you to an expanded view rather than sending
you to the post page.
</span>
</Setting>
<SectionTitle class="mt-4">Instances</SectionTitle> <SectionTitle class="mt-4">Instances</SectionTitle>
<Setting> <Setting>
@@ -215,17 +224,19 @@
<span slot="title">Font</span> <span slot="title">Font</span>
<span slot="description">What font Photon should use.</span> <span slot="description">What font Photon should use.</span>
<MultiSelect <MultiSelect
options={[true, false]} options={['inter', 'system', 'browser']}
optionNames={['System UI', 'Browser Font']} optionNames={['Inter', 'System UI', 'Browser Font']}
bind:selected={$userSettings.systemUI} bind:selected={$userSettings.font}
/> />
</Setting> </Setting>
<Setting> <Setting>
<Checkbox bind:checked={$userSettings.debugInfo} slot="title"> <span slot="title">Debug Info</span>
Debug Info
</Checkbox>
<span slot="description"> <span slot="description">
Show an option to show debug information. (in posts and such) Show an option to show debug information. (in posts and such)
</span> </span>
<Checkbox bind:checked={$userSettings.debugInfo}>
{$userSettings.debugInfo ? 'Enabled' : 'Disabled'}
</Checkbox>
</Setting> </Setting>
</div> </div>
+11 -3
View File
@@ -2,12 +2,20 @@
import { Material } from 'mono-svelte' import { Material } from 'mono-svelte'
</script> </script>
<Material padding="lg" class="flex flex-col gap-3 my-2"> <Material color="distinct" padding="none" class="my-2">
<h1 class="font-bold"><slot name="title" /></h1> <div class="px-5 pt-5 flex flex-col gap-3" class:pb-5={!$$slots.default}>
<h1 class="font-bold text-lg"><slot name="title" /></h1>
{#if $$slots.description} {#if $$slots.description}
<p class="text-slate-700 dark:text-zinc-300"> <p class="text-slate-800 dark:text-zinc-200">
<slot name="description" /> <slot name="description" />
</p> </p>
{/if} {/if}
</div>
{#if $$slots.default}
<div
class="w-full px-5 py-3 bg-slate-50 dark:bg-zinc-950 border-t dark:border-zinc-800 mt-4"
>
<slot /> <slot />
</div>
{/if}
</Material> </Material>
+7 -1
View File
@@ -18,8 +18,14 @@
} }
} }
@font-face {
font-family: 'Inter';
src: url('/font/Inter.woff2') format('woff2');
font-display: swap;
}
body { body {
@apply bg-slate-50 text-slate-900 dark:bg-zinc-950 dark:text-zinc-100 accent-slate-950 dark:accent-zinc-50; @apply bg-slate-100 text-slate-900 dark:bg-zinc-950 dark:text-zinc-100 accent-slate-950 dark:accent-zinc-50;
} }
.dark { .dark {
+4
View File
@@ -10,6 +10,7 @@ export default {
sans: ['sans-serif'], sans: ['sans-serif'],
system: ['system-ui'], system: ['system-ui'],
serif: ['serif'], serif: ['serif'],
inter: ['Inter'],
}, },
extend: { extend: {
animation: { animation: {
@@ -21,6 +22,9 @@ export default {
}, },
}, },
colors: { colors: {
slate: {
25: 'rgb(252,253,254)',
},
zinc: { zinc: {
700: '#34343b', 700: '#34343b',
800: '#1f1f24', 800: '#1f1f24',
+4 -4
View File
@@ -2977,10 +2977,10 @@ mlly@^1.2.0, mlly@^1.4.0:
pkg-types "^1.0.3" pkg-types "^1.0.3"
ufo "^1.1.2" ufo "^1.1.2"
mono-svelte@^0.2.20: mono-svelte@^0.3.2:
version "0.2.20" version "0.3.2"
resolved "https://registry.yarnpkg.com/mono-svelte/-/mono-svelte-0.2.20.tgz#561e8f3c3d516e68da44c01a8f122f13efeeabfd" resolved "https://registry.yarnpkg.com/mono-svelte/-/mono-svelte-0.3.2.tgz#646a247698b7aac4cd8c6c0d03ad448081e6b310"
integrity sha512-JeB1TCTm6JysEjIjRprG8S+o/VTlcQQp2zkQ3daF/QotDO+rF2n18KEsbtFFestt0dpIVzE14A4oLNowFmNClA== integrity sha512-CiJzyCtQ6xM8XXhowyqIqCp8R4Q7IVDHbg7Ly+W5QSjfaBRYFbv2L/qhi0FkvBzQ6WOSoCK8Lz0vN81WbaPbyA==
mri@^1.1.0: mri@^1.1.0:
version "1.2.0" version "1.2.0"