feat: add new font options

This commit is contained in:
Xylight committed 2024-04-21 14:41:58 -07:00
1 parent 01372c790c
commit f161e75bcf
12 files changed
+43 -24

No files matched your search

BIN
View File
Binary file not shown.
+1 -1
View File
@@ -47,7 +47,7 @@
"@dicebear/core": "^6.0.4", "@dicebear/core": "^6.0.4",
"@dicebear/initials": "^6.0.4", "@dicebear/initials": "^6.0.4",
"markdown-it": "^13.0.1", "markdown-it": "^13.0.1",
"mono-svelte": "1.5.6" "mono-svelte": "1.5.8"
}, },
"overrides": { "overrides": {
"@rollup/plugin-node-resolve": "^15.2.3", "@rollup/plugin-node-resolve": "^15.2.3",
@@ -150,7 +150,9 @@
{#if title && id} {#if title && id}
<a <a
href="/post/{getInstance()}/{id}" href="/post/{getInstance()}/{id}"
class="font-medium text-base w-full" class="text-lg leading-6 w-full {$userSettings.font == 'satoshi/nunito'
? 'font-display font-semibold'
: 'font-medium'}"
class:text-slate-600={$userSettings.markReadPosts && read} class:text-slate-600={$userSettings.markReadPosts && read}
class:dark:text-zinc-400={$userSettings.markReadPosts && read} class:dark:text-zinc-400={$userSettings.markReadPosts && read}
style="grid-area: title;" style="grid-area: title;"
+18 -17
View File
@@ -25,6 +25,7 @@
import { DEFAULT_INSTANCE_URL, LINKED_INSTANCE_URL } from '$lib/instance.js' import { DEFAULT_INSTANCE_URL, LINKED_INSTANCE_URL } from '$lib/instance.js'
import Expandable from '$lib/components/ui/Expandable.svelte' import Expandable from '$lib/components/ui/Expandable.svelte'
import EndPlaceholder from '../EndPlaceholder.svelte' import EndPlaceholder from '../EndPlaceholder.svelte'
import Application from '../../../../routes/admin/applications/Application.svelte'
</script> </script>
<nav <nav
@@ -32,7 +33,7 @@
gap-1 h-screen {$$props.class}" gap-1 h-screen {$$props.class}"
style={$$props.style} style={$$props.style}
> >
{#if $profile} {#if $profile?.jwt}
<SidebarButton icon={UserCircle} href="/profile/user"> <SidebarButton icon={UserCircle} href="/profile/user">
Profile Profile
</SidebarButton> </SidebarButton>
@@ -48,6 +49,22 @@
{/if} {/if}
</SidebarButton> </SidebarButton>
<SidebarButton icon={Bookmark} href="/saved">Saved</SidebarButton> <SidebarButton icon={Bookmark} href="/saved">Saved</SidebarButton>
{:else}
<SidebarButton href="/login" title="Log In" icon={ArrowLeftOnRectangle}>
<span slot="label">Log In</span>
</SidebarButton>
<SidebarButton href="/signup" title="Sign Up" icon={Identification}>
<span slot="label">Sign Up</span>
</SidebarButton>
{#if LINKED_INSTANCE_URL === undefined}
<SidebarButton
href="/accounts"
title="Change Instance"
icon={ServerStack}
>
<span slot="label">Change Instance</span>
</SidebarButton>
{/if}
{/if} {/if}
{#if $profileData.profiles.length >= 1} {#if $profileData.profiles.length >= 1}
<hr class="border-slate-200 dark:border-zinc-900 my-1" /> <hr class="border-slate-200 dark:border-zinc-900 my-1" />
@@ -92,21 +109,5 @@
</span> </span>
<CommunityList items={$profile.user.follows.map((i) => i.community)} /> <CommunityList items={$profile.user.follows.map((i) => i.community)} />
</Expandable> </Expandable>
{:else}
<SidebarButton href="/login" title="Log In" icon={ArrowLeftOnRectangle}>
<span slot="label">Log In</span>
</SidebarButton>
<SidebarButton href="/signup" title="Sign Up" icon={Identification}>
<span slot="label">Sign Up</span>
</SidebarButton>
{#if LINKED_INSTANCE_URL === undefined}
<SidebarButton
href="/accounts"
title="Change Instance"
icon={ServerStack}
>
<span slot="label">Change Instance</span>
</SidebarButton>
{/if}
{/if} {/if}
</nav> </nav>
+1 -1
View File
@@ -66,7 +66,7 @@ interface Settings {
debugInfo: boolean debugInfo: boolean
expandImages: boolean expandImages: boolean
font: 'inter' | 'system' | 'browser' font: 'inter' | 'satoshi/nunito' | 'system' | 'browser'
leftAlign: boolean leftAlign: boolean
hidePhoton: boolean hidePhoton: boolean
+3 -1
View File
@@ -101,7 +101,9 @@
? 'font-inter' ? 'font-inter'
: $userSettings.font == 'system' : $userSettings.font == 'system'
? 'font-system' ? 'font-system'
: 'font-sans'}" : $userSettings.font == 'satoshi/nunito'
? 'font-nunito'
: 'font-sans'}"
route={$page.route} route={$page.route}
> >
<Moderation /> <Moderation />
@@ -208,7 +208,7 @@
<Icon src={ArrowLeft} mini size="16" slot="prefix" /> <Icon src={ArrowLeft} mini size="16" slot="prefix" />
</Button> </Button>
</div> </div>
<h1 class="font-bold text-lg"> <h1 class="font-bold text-lg font-display leading-5">
<Markdown source={post.post_view.post.name} inline /> <Markdown source={post.post_view.post.name} inline />
</h1> </h1>
<PostMedia <PostMedia
+2 -2
View File
@@ -199,8 +199,8 @@
<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={['inter', 'system', 'browser']} options={['inter', 'satoshi/nunito', 'system', 'browser']}
optionNames={['Inter', 'System UI', 'Browser Font']} optionNames={['Inter', 'Satoshi/Nunito', 'System UI', 'Browser Font']}
bind:selected={$userSettings.font} bind:selected={$userSettings.font}
/> />
</Setting> </Setting>
+12
View File
@@ -24,6 +24,18 @@
font-display: swap; font-display: swap;
} }
@font-face {
font-family: 'Satoshi';
src: url('/font/Satoshi.woff2') format('woff2');
font-display: swap;
}
@font-face {
font-family: 'Nunito';
src: url('/font/Nunito.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-50 text-slate-900 dark:bg-zinc-950 dark:text-zinc-100 accent-slate-950 dark:accent-zinc-50;
} }
Binary file not shown.
Binary file not shown.
+2
View File
@@ -13,6 +13,8 @@ export default {
system: ['system-ui'], system: ['system-ui'],
serif: ['serif'], serif: ['serif'],
inter: ['Inter', 'system-ui', 'sans-serif'], inter: ['Inter', 'system-ui', 'sans-serif'],
nunito: ['Nunito', 'system-ui', 'sans-serif'],
display: ['Satoshi', 'system-ui', 'sans-serif']
}, },
extend: { extend: {
animation: { animation: {