27 files changed
+470
-200
No files matched your search
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "photon-lemmy",
|
"name": "photon-lemmy",
|
||||||
"version": "1.28.5",
|
"version": "1.29.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite dev",
|
"dev": "vite dev",
|
||||||
|
|||||||
+2
-1
@@ -16,6 +16,7 @@ import { get, writable } from 'svelte/store'
|
|||||||
import { MINIMUM_VERSION, versionIsSupported } from '$lib/version.js'
|
import { MINIMUM_VERSION, versionIsSupported } from '$lib/version.js'
|
||||||
import { browser } from '$app/environment'
|
import { browser } from '$app/environment'
|
||||||
import { env } from '$env/dynamic/public'
|
import { env } from '$env/dynamic/public'
|
||||||
|
import type { ResumableItem } from './lemmy/item'
|
||||||
|
|
||||||
const getDefaultProfile = (): Profile => ({
|
const getDefaultProfile = (): Profile => ({
|
||||||
id: -1,
|
id: -1,
|
||||||
@@ -42,7 +43,7 @@ export interface Profile {
|
|||||||
user?: PersonData
|
user?: PersonData
|
||||||
username?: string
|
username?: string
|
||||||
avatar?: string
|
avatar?: string
|
||||||
favorites?: number[]
|
favorites?: ResumableItem[]
|
||||||
color?: string
|
color?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
import { vote as voteItem } from '$lib/lemmy/contentview'
|
import { vote as voteItem } from '$lib/lemmy/contentview'
|
||||||
import { shouldShowVoteColor } from '../post/PostVote.svelte'
|
import { shouldShowVoteColor } from '../post/PostVote.svelte'
|
||||||
import { fly } from 'svelte/transition'
|
import { fly } from 'svelte/transition'
|
||||||
|
import { backOut } from 'svelte/easing'
|
||||||
|
|
||||||
export let vote: number = 0
|
export let vote: number = 0
|
||||||
export let upvotes: number
|
export let upvotes: number
|
||||||
@@ -48,8 +49,8 @@
|
|||||||
{#key upvotes}
|
{#key upvotes}
|
||||||
<span
|
<span
|
||||||
style="grid-column: 1; grid-row: 1;"
|
style="grid-column: 1; grid-row: 1;"
|
||||||
in:fly={{ duration: 200, y: -6 }}
|
in:fly={{ duration: 400, y: -10, easing: backOut }}
|
||||||
out:fly={{ duration: 200, y: 6 }}
|
out:fly={{ duration: 400, y: 10, easing: backOut }}
|
||||||
>
|
>
|
||||||
<FormattedNumber number={upvotes} />
|
<FormattedNumber number={upvotes} />
|
||||||
</span>
|
</span>
|
||||||
@@ -69,8 +70,8 @@
|
|||||||
{#key downvotes}
|
{#key downvotes}
|
||||||
<span
|
<span
|
||||||
style="grid-column: 1; grid-row: 1;"
|
style="grid-column: 1; grid-row: 1;"
|
||||||
in:fly={{ duration: 200, y: -6 }}
|
in:fly={{ duration: 400, y: -10, easing: backOut }}
|
||||||
out:fly={{ duration: 200, y: 6 }}
|
out:fly={{ duration: 400, y: 10, easing: backOut }}
|
||||||
>
|
>
|
||||||
<FormattedNumber number={downvotes} />
|
<FormattedNumber number={downvotes} />
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
import { profile } from '$lib/auth.js'
|
import { profile } from '$lib/auth.js'
|
||||||
import { Button } from 'mono-svelte'
|
import { Button } from 'mono-svelte'
|
||||||
import { afterNavigate } from '$app/navigation'
|
import { afterNavigate } from '$app/navigation'
|
||||||
|
import { backOut } from 'svelte/easing'
|
||||||
|
|
||||||
export let nodes: CommentNodeI[]
|
export let nodes: CommentNodeI[]
|
||||||
export let isParent: boolean
|
export let isParent: boolean
|
||||||
@@ -106,7 +107,7 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<ul
|
<ul
|
||||||
in:fly={{ opacity: 0, y: -4 }}
|
in:fly={{ opacity: 0, y: -4, duration: 400, easing: backOut }}
|
||||||
class={isParent
|
class={isParent
|
||||||
? 'divide-y dark:divide-zinc-800 divide-slate-100'
|
? 'divide-y dark:divide-zinc-800 divide-slate-100'
|
||||||
: 'pl-3.5 border-l border-slate-200 dark:border-zinc-800 my-1'}
|
: 'pl-3.5 border-l border-slate-200 dark:border-zinc-800 my-1'}
|
||||||
|
|||||||
@@ -29,6 +29,13 @@
|
|||||||
export let view = $userSettings.view
|
export let view = $userSettings.view
|
||||||
|
|
||||||
$: type = mediaType(post.post.url, view)
|
$: type = mediaType(post.post.url, view)
|
||||||
|
$: hideTitle =
|
||||||
|
$userSettings.posts.deduplicateEmbed &&
|
||||||
|
post.post.embed_title == post.post.name
|
||||||
|
|
||||||
|
$: hideBody =
|
||||||
|
$userSettings.posts.deduplicateEmbed &&
|
||||||
|
post.post.embed_description == post.post.body
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Material
|
<Material
|
||||||
@@ -62,7 +69,7 @@
|
|||||||
? 'Subscribed'
|
? 'Subscribed'
|
||||||
: 'NotSubscribed'}
|
: 'NotSubscribed'}
|
||||||
id={post.post.id}
|
id={post.post.id}
|
||||||
title={post.post.name}
|
title={hideTitle ? undefined : post.post.name}
|
||||||
read={post.read}
|
read={post.read}
|
||||||
style="grid-area: meta;"
|
style="grid-area: meta;"
|
||||||
>
|
>
|
||||||
@@ -77,7 +84,7 @@
|
|||||||
{#if view == 'list' || view == 'compact'}
|
{#if view == 'list' || view == 'compact'}
|
||||||
<PostMediaCompact {view} bind:post={post.post} style="grid-area: media;" />
|
<PostMediaCompact {view} bind:post={post.post} style="grid-area: media;" />
|
||||||
{/if}
|
{/if}
|
||||||
{#if post.post.body && !post.post.nsfw && view != 'compact'}
|
{#if post.post.body && !post.post.nsfw && view != 'compact' && !hideBody}
|
||||||
<PostBody body={post.post.body} {view} style="grid-area: body" />
|
<PostBody body={post.post.body} {view} style="grid-area: body" />
|
||||||
{/if}
|
{/if}
|
||||||
{#if actions}
|
{#if actions}
|
||||||
|
|||||||
@@ -43,7 +43,9 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="grid w-full meta {community ? 'grid-rows-2' : 'grid-rows-1'} text-xs"
|
class="grid w-full meta {community
|
||||||
|
? 'grid-rows-2'
|
||||||
|
: 'grid-rows-1'} text-xs min-w-0 max-w-full"
|
||||||
style={$$props.style ?? ''}
|
style={$$props.style ?? ''}
|
||||||
>
|
>
|
||||||
{#if community}
|
{#if community}
|
||||||
@@ -148,7 +150,7 @@
|
|||||||
{#if title && id}
|
{#if title && id}
|
||||||
<a
|
<a
|
||||||
href="/post/{getInstance()}/{id}"
|
href="/post/{getInstance()}/{id}"
|
||||||
class="font-medium text-base"
|
class="font-medium text-base w-full"
|
||||||
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;"
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
import { Button, Popover, buttonColor, toast } from 'mono-svelte'
|
import { Button, Popover, buttonColor, toast } from 'mono-svelte'
|
||||||
import { site } from '$lib/lemmy.js'
|
import { site } from '$lib/lemmy.js'
|
||||||
import { fly } from 'svelte/transition'
|
import { fly } from 'svelte/transition'
|
||||||
|
import { backOut } from 'svelte/easing'
|
||||||
|
|
||||||
export let post: Post
|
export let post: Post
|
||||||
export let vote: number = 0
|
export let vote: number = 0
|
||||||
@@ -69,8 +70,8 @@
|
|||||||
{#key upvotes}
|
{#key upvotes}
|
||||||
<span
|
<span
|
||||||
style="grid-column: 1; grid-row: 1;"
|
style="grid-column: 1; grid-row: 1;"
|
||||||
in:fly={{ duration: 200, y: -6 }}
|
in:fly={{ duration: 400, y: -10, easing: backOut }}
|
||||||
out:fly={{ duration: 200, y: 6 }}
|
out:fly={{ duration: 400, y: 10, easing: backOut }}
|
||||||
>
|
>
|
||||||
<FormattedNumber number={upvotes} />
|
<FormattedNumber number={upvotes} />
|
||||||
</span>
|
</span>
|
||||||
@@ -91,8 +92,8 @@
|
|||||||
{#key downvotes}
|
{#key downvotes}
|
||||||
<span
|
<span
|
||||||
style="grid-column: 1; grid-row: 1;"
|
style="grid-column: 1; grid-row: 1;"
|
||||||
in:fly={{ duration: 200, y: -6 }}
|
in:fly={{ duration: 400, y: -10, easing: backOut }}
|
||||||
out:fly={{ duration: 200, y: 6 }}
|
out:fly={{ duration: 400, y: 10, easing: backOut }}
|
||||||
>
|
>
|
||||||
<FormattedNumber number={downvotes} />
|
<FormattedNumber number={downvotes} />
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import { goto } from '$app/navigation'
|
||||||
|
import { TextInput } from 'mono-svelte'
|
||||||
|
|
||||||
|
let query: string = ''
|
||||||
|
let loading = false
|
||||||
|
|
||||||
|
function search() {
|
||||||
|
loading = true
|
||||||
|
goto(`/search?q=${query}`).then(() => (loading = false))
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<form on:submit|preventDefault={search} class="w-full h-full {$$props.class}">
|
||||||
|
<TextInput
|
||||||
|
bind:value={query}
|
||||||
|
class="w-full h-full {$$props.class}"
|
||||||
|
placeholder="Search"
|
||||||
|
/>
|
||||||
|
</form>
|
||||||
|
<slot {search} {loading} />
|
||||||
@@ -112,10 +112,14 @@
|
|||||||
@apply m-0 leading-[1.5] !important;
|
@apply m-0 leading-[1.5] !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.markdown :global(li > *) {
|
.markdown :global(li > p) {
|
||||||
@apply m-0 leading-[1.5] !important;
|
@apply m-0 leading-[1.5] !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.markdown :global(li > p) {
|
||||||
|
@apply contents !important;
|
||||||
|
}
|
||||||
|
|
||||||
.markdown :global(blockquote) {
|
.markdown :global(blockquote) {
|
||||||
@apply leading-[1px] border-l-2 border-slate-400 dark:border-zinc-600 pl-2 my-1 h-max;
|
@apply leading-[1px] border-l-2 border-slate-400 dark:border-zinc-600 pl-2 my-1 h-max;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<aside
|
<aside
|
||||||
class="sticky top-16 left-0 break-words flex flex-shrink
|
class="sticky top-0 left-0 break-words flex flex-shrink
|
||||||
flex-col gap-4 p-6 max-w-full w-full h-full
|
flex-col gap-4 px-6 pt-4 max-w-full w-full h-full
|
||||||
overflow-auto text-sm border-slate-200 dark:border-zinc-800 {$$props.class}"
|
overflow-auto text-sm border-slate-200 dark:border-zinc-800 {$$props.class}"
|
||||||
>
|
>
|
||||||
<slot />
|
<slot />
|
||||||
|
|||||||
@@ -6,38 +6,85 @@
|
|||||||
export let route: { id: string | null } | undefined = undefined
|
export let route: { id: string | null } | undefined = undefined
|
||||||
|
|
||||||
$: title = route ? routes[(route.id as keyof typeof routes) ?? ''] : ''
|
$: title = route ? routes[(route.id as keyof typeof routes) ?? ''] : ''
|
||||||
|
|
||||||
|
const calculatePadding = (
|
||||||
|
panel: boolean,
|
||||||
|
top: boolean,
|
||||||
|
content: boolean
|
||||||
|
): string => {
|
||||||
|
if (panel) {
|
||||||
|
if (top) return '!pt-22'
|
||||||
|
else return '!pb-22'
|
||||||
|
} else {
|
||||||
|
if (!content) return ''
|
||||||
|
|
||||||
|
if (top) return '!pt-24'
|
||||||
|
else return '!pb-24'
|
||||||
|
}
|
||||||
|
|
||||||
|
return 'hi this is easter egg, my code broke'
|
||||||
|
}
|
||||||
|
|
||||||
|
$: contentPadding = calculatePadding(
|
||||||
|
$userSettings.dock.noGap,
|
||||||
|
$userSettings.dock.top,
|
||||||
|
true
|
||||||
|
)
|
||||||
|
$: sidePadding = calculatePadding(
|
||||||
|
$userSettings.dock.noGap,
|
||||||
|
$userSettings.dock.top,
|
||||||
|
false
|
||||||
|
)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="shell {$$props.class}" style={colorsToVars($colors)}>
|
<div class="shell {$$props.class}" style={colorsToVars($colors)}>
|
||||||
<slot />
|
<slot />
|
||||||
<slot
|
|
||||||
name="navbar"
|
|
||||||
class="sticky top-0 border-b border-slate-200 dark:border-zinc-900
|
|
||||||
bg-slate-50 dark:bg-zinc-950 transition-colors duration-500"
|
|
||||||
style="grid-area: navbar"
|
|
||||||
{title}
|
|
||||||
/>
|
|
||||||
<div
|
<div
|
||||||
class="content md:divide-x divide-slate-200 dark:divide-zinc-900 {$userSettings.newWidth
|
class="content md:divide-x divide-slate-200 dark:divide-zinc-900 min-h-screen {$userSettings.newWidth
|
||||||
? 'limit-width'
|
? 'limit-width'
|
||||||
: ''}"
|
: ''}"
|
||||||
>
|
>
|
||||||
<slot
|
<slot
|
||||||
name="sidebar"
|
name="sidebar"
|
||||||
class="hidden md:flex sticky top-16 left-0 w-full max-w-full bg-slate-50 dark:bg-zinc-950"
|
class="hidden md:flex sticky top-0 left-0 w-full max-w-full bg-slate-50 dark:bg-zinc-950
|
||||||
|
{sidePadding}"
|
||||||
style="grid-area: sidebar; width: 100% !important;"
|
style="grid-area: sidebar; width: 100% !important;"
|
||||||
/>
|
/>
|
||||||
<slot
|
<slot
|
||||||
name="main"
|
name="main"
|
||||||
class="w-full bg-slate-25 dark:bg-zinc-925 justify-self-center shadow-sm"
|
class="w-full bg-slate-25 dark:bg-zinc-925 justify-self-center shadow-sm
|
||||||
|
{contentPadding}"
|
||||||
style="grid-area: main"
|
style="grid-area: main"
|
||||||
/>
|
/>
|
||||||
<slot
|
<slot
|
||||||
name="suffix"
|
name="suffix"
|
||||||
class="max-xl:hidden w-full sticky top-16 left-0 h-full max-h-[calc(100svh-4rem)] bg-slate-50 dark:bg-zinc-950"
|
class="max-xl:hidden w-full sticky top-0 left-0 h-max bg-slate-50 dark:bg-zinc-950
|
||||||
|
{sidePadding}"
|
||||||
style="grid-area: suffix;"
|
style="grid-area: suffix;"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
<div
|
||||||
|
class="
|
||||||
|
{$userSettings.dock.noGap ? '' : 'p-4 max-w-3xl left-1/2 -translate-x-1/2'}
|
||||||
|
{$userSettings.dock.top ? 'top-0' : 'bottom-0'}
|
||||||
|
w-full fixed z-50 pointer-events-none"
|
||||||
|
style="grid-area: navbar;"
|
||||||
|
>
|
||||||
|
<slot
|
||||||
|
name="navbar"
|
||||||
|
class="
|
||||||
|
{$userSettings.dock.noGap
|
||||||
|
? $userSettings.dock.top
|
||||||
|
? 'border-b shadow-none'
|
||||||
|
: 'border-t'
|
||||||
|
: 'border rounded-full'}
|
||||||
|
border-slate-200 dark:border-zinc-800 shadow-2xl
|
||||||
|
backdrop-blur-xl dark:backdrop-brightness-[25%] bg-[#ffffff]/75 dark:bg-transparent transition-colors duration-500
|
||||||
|
pointer-events-auto"
|
||||||
|
style="grid-area: navbar"
|
||||||
|
{title}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
@@ -46,8 +93,8 @@
|
|||||||
grid-template-columns: 1fr;
|
grid-template-columns: 1fr;
|
||||||
grid-template-rows: auto 1fr;
|
grid-template-rows: auto 1fr;
|
||||||
grid-template-areas:
|
grid-template-areas:
|
||||||
'navbar'
|
'content'
|
||||||
'content';
|
'navbar';
|
||||||
}
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
|
|||||||
@@ -1,23 +1,33 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { page } from '$app/stores'
|
||||||
import { Button } from 'mono-svelte'
|
import { Button } from 'mono-svelte'
|
||||||
import { Icon, type IconSource } from 'svelte-hero-icons'
|
import { Icon, type IconSource } from 'svelte-hero-icons'
|
||||||
|
|
||||||
export let label: string
|
export let label: string
|
||||||
export let icon: IconSource | undefined = undefined
|
export let icon: IconSource | undefined = undefined
|
||||||
|
export let href: string | undefined = undefined
|
||||||
|
|
||||||
|
$: isSelected = href != undefined && $page.url.pathname == href
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
|
color="tertiary"
|
||||||
{...$$restProps}
|
{...$$restProps}
|
||||||
class="px-3 py-1.5 max-md:py-0 max-md:px-0 max-md:h-8 max-md:w-8 {$$props.class ??
|
on:click
|
||||||
''}"
|
class="rounded-full w-10 h-10 flex-shrink-0 {isSelected
|
||||||
|
? 'bg-slate-200 dark:bg-zinc-900 text-primary-900 dark:!text-primary-100'
|
||||||
|
: ''} {$$props.class ?? ''}"
|
||||||
size="custom"
|
size="custom"
|
||||||
|
{href}
|
||||||
|
rounding="pill"
|
||||||
title={label}
|
title={label}
|
||||||
|
style="transition-property: background-color, filter;"
|
||||||
>
|
>
|
||||||
{#if icon}
|
{#if icon}
|
||||||
<Icon src={icon} mini size="16" />
|
<Icon src={icon} solid={isSelected} size="18" />
|
||||||
{:else}
|
{:else}
|
||||||
<slot name="icon" />
|
<slot {isSelected} name="icon" />
|
||||||
{/if}
|
{/if}
|
||||||
<span class="max-md:hidden">{label}</span>
|
<!-- <span class="max-md:hidden">{label}</span> -->
|
||||||
<slot />
|
<slot />
|
||||||
</Button>
|
</Button>
|
||||||
@@ -7,77 +7,156 @@
|
|||||||
isAdmin,
|
isAdmin,
|
||||||
} from '$lib/components/lemmy/moderation/moderation.js'
|
} from '$lib/components/lemmy/moderation/moderation.js'
|
||||||
import Avatar from '$lib/components/ui/Avatar.svelte'
|
import Avatar from '$lib/components/ui/Avatar.svelte'
|
||||||
import Logo from '$lib/components/ui/Logo.svelte'
|
|
||||||
import { LINKED_INSTANCE_URL, instance } from '$lib/instance.js'
|
|
||||||
import { site } from '$lib/lemmy.js'
|
import { site } from '$lib/lemmy.js'
|
||||||
import { Menu, MenuButton, MenuDivider, Spinner } from 'mono-svelte'
|
import { Button, Menu, MenuButton, MenuDivider, Spinner } from 'mono-svelte'
|
||||||
import {
|
import {
|
||||||
GlobeAlt,
|
GlobeAlt,
|
||||||
|
Home,
|
||||||
Icon,
|
Icon,
|
||||||
MagnifyingGlass,
|
MagnifyingGlass,
|
||||||
Newspaper,
|
Newspaper,
|
||||||
PencilSquare,
|
PencilSquare,
|
||||||
Plus,
|
Plus,
|
||||||
ServerStack,
|
ServerStack,
|
||||||
|
XMark,
|
||||||
} from 'svelte-hero-icons'
|
} from 'svelte-hero-icons'
|
||||||
import { fly } from 'svelte/transition'
|
|
||||||
import Profile from './Profile.svelte'
|
import Profile from './Profile.svelte'
|
||||||
import NavButton from './NavButton.svelte'
|
import NavButton from './NavButton.svelte'
|
||||||
|
import { scale } from 'svelte/transition'
|
||||||
|
import { expoOut, backOut } from 'svelte/easing'
|
||||||
|
import { flip } from 'svelte/animate'
|
||||||
|
import SearchBar from '$lib/components/lemmy/util/SearchBar.svelte'
|
||||||
|
|
||||||
export let title: string | undefined = ''
|
let searching = false
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<nav
|
<nav
|
||||||
class="flex flex-row gap-2 items-center
|
class="flex flex-row gap-2 items-center w-full mx-auto z-50 box-border h-16
|
||||||
backdrop-blur-lg w-full mx-auto px-4 py-2 z-50 box-border h-16
|
duration-150
|
||||||
{$$props.class}
|
{$$props.class}
|
||||||
"
|
"
|
||||||
style={$$props.style}
|
style={$$props.style}
|
||||||
>
|
>
|
||||||
<div class="flex flex-row gap-2 items-center mr-auto">
|
{#if searching}
|
||||||
<a
|
<div
|
||||||
href="/"
|
class="w-full h-full absolute z-20 p-2 flex items-center gap-2 bg-white dark:bg-zinc-950
|
||||||
class="flex flex-row items-center gap-2 logo group"
|
rounded-full"
|
||||||
title="Home"
|
transition:scale={{
|
||||||
|
start: 0.96,
|
||||||
|
duration: 250,
|
||||||
|
easing: backOut,
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
{#if LINKED_INSTANCE_URL}
|
<Button
|
||||||
{#if $site}
|
size="custom"
|
||||||
|
rounding="pill"
|
||||||
|
class="w-11 h-11 flex-shrink-0"
|
||||||
|
on:click={() => (searching = false)}
|
||||||
|
>
|
||||||
|
<Icon src={XMark} size="18" mini />
|
||||||
|
</Button>
|
||||||
|
<SearchBar let:search let:loading class="!rounded-full z-20">
|
||||||
|
<Button
|
||||||
|
size="custom"
|
||||||
|
rounding="pill"
|
||||||
|
class="w-11 h-11 flex-shrink-0"
|
||||||
|
on:click={search}
|
||||||
|
color="primary"
|
||||||
|
type="submit"
|
||||||
|
{loading}
|
||||||
|
>
|
||||||
|
<Icon src={MagnifyingGlass} size="18" mini slot="prefix" />
|
||||||
|
</Button>
|
||||||
|
</SearchBar>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
<div class="flex flex-row gap-2 py-2 px-2 items-center w-full">
|
||||||
|
<Profile
|
||||||
|
placement="top"
|
||||||
|
itemsClass="h-8 md:h-8 z-10"
|
||||||
|
targetClass="z-10 h-10"
|
||||||
|
containerClass="!max-h-[28rem] z-10"
|
||||||
|
buttonClass=""
|
||||||
|
/>
|
||||||
|
{#if $profile}
|
||||||
|
<div
|
||||||
|
class="px-2 border-r border-l border-slate-200 dark:border-zinc-900
|
||||||
|
flex flex-row items-center gap-2 [&>*]:flex-shrink-0 overflow-x-auto overflow-y-hidden
|
||||||
|
md:max-w-64 sm:max-w-48 max-w-36 w-full max-[424px]:hidden"
|
||||||
|
>
|
||||||
|
{#each $profile.favorites ?? [] as favorite (favorite.id)}
|
||||||
|
<div
|
||||||
|
class="h-10 w-10 flex"
|
||||||
|
transition:scale={{
|
||||||
|
start: 0.7,
|
||||||
|
easing: backOut,
|
||||||
|
duration: 400,
|
||||||
|
delay: 0,
|
||||||
|
}}
|
||||||
|
animate:flip={{
|
||||||
|
easing: backOut,
|
||||||
|
duration: 400,
|
||||||
|
delay: 0,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<NavButton
|
||||||
|
class="w-full h-full bg-slate-100 dark:bg-zinc-900 relative"
|
||||||
|
title={favorite.name}
|
||||||
|
href={favorite.url.toString()}
|
||||||
|
label={favorite.name}
|
||||||
|
>
|
||||||
|
{#if favorite.type == 'post'}
|
||||||
|
<div
|
||||||
|
class="relative w-full h-full grid place-items-center overflow-visible"
|
||||||
|
>
|
||||||
|
{#if favorite.subdivision}
|
||||||
<Avatar
|
<Avatar
|
||||||
url={$site.site_view.site.icon}
|
alt={favorite.subdivision.name}
|
||||||
alt={$site.site_view.site.name}
|
url={favorite.subdivision.avatar}
|
||||||
width={32}
|
width={32}
|
||||||
res={64}
|
res={64}
|
||||||
circle={false}
|
class=""
|
||||||
class="rounded-md"
|
|
||||||
/>
|
/>
|
||||||
<div class="flex flex-row items-center gap-2 max-[500px]:hidden">
|
<Icon
|
||||||
<span class="opacity-30 text-xl">/</span>
|
src={PencilSquare}
|
||||||
{$site.site_view.site.name}
|
mini
|
||||||
|
size="20"
|
||||||
|
class="absolute -bottom-1 -right-1 rounded-full bg-slate-100 dark:bg-zinc-900 p-0.5"
|
||||||
|
/>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
{:else}
|
{:else}
|
||||||
<Spinner width={32} />
|
<Avatar
|
||||||
|
alt={favorite.name}
|
||||||
|
url={favorite.avatar}
|
||||||
|
res={64}
|
||||||
|
width={32}
|
||||||
|
class="w-full"
|
||||||
|
/>
|
||||||
|
<Icon
|
||||||
|
src={Newspaper}
|
||||||
|
mini
|
||||||
|
size="20"
|
||||||
|
class="absolute -bottom-1 -right-1 rounded-full bg-slate-100 dark:bg-zinc-900 p-0.5"
|
||||||
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
{:else}
|
</NavButton>
|
||||||
<Logo width={40} />
|
</div>
|
||||||
<div class="flex flex-row items-center gap-2 max-[1000px]:hidden">
|
{/each}
|
||||||
<span class="opacity-30 text-xl">/</span>
|
|
||||||
<span class="text-sm font-bold grid place-items-start">
|
|
||||||
{#key title || $instance}
|
|
||||||
<span
|
|
||||||
in:fly={{ y: -12 }}
|
|
||||||
out:fly={{ y: 12 }}
|
|
||||||
style="grid-row: 1; grid-column: 1; max-width: 24ch;"
|
|
||||||
class="overflow-hidden break-words overflow-ellipsis whitespace-nowrap"
|
|
||||||
>
|
|
||||||
{title || $instance}
|
|
||||||
</span>
|
|
||||||
{/key}
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</a>
|
<div class="ml-auto" />
|
||||||
</div>
|
{#if amModOfAny($profile?.user)}
|
||||||
<div class="flex flex-row gap-2 py-2 px-2 items-center">
|
<NavButton href="/moderation" label="Moderation" class="relative">
|
||||||
|
{#if ($profile?.user?.notifications.reports ?? 0) > 0}
|
||||||
|
<div
|
||||||
|
class="rounded-full w-2 h-2 bg-red-500 absolute -top-1 -left-1"
|
||||||
|
/>
|
||||||
|
{/if}
|
||||||
|
<ShieldIcon let:isSelected slot="icon" filled={isSelected} width={18} />
|
||||||
|
</NavButton>
|
||||||
|
{/if}
|
||||||
|
<NavButton href="/communities" label="Explore" icon={GlobeAlt} />
|
||||||
{#if $profile?.user && isAdmin($profile.user)}
|
{#if $profile?.user && isAdmin($profile.user)}
|
||||||
<NavButton
|
<NavButton
|
||||||
href="/admin"
|
href="/admin"
|
||||||
@@ -92,19 +171,13 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</NavButton>
|
</NavButton>
|
||||||
{/if}
|
{/if}
|
||||||
{#if amModOfAny($profile?.user)}
|
<NavButton
|
||||||
<NavButton href="/moderation" label="Moderation" class="relative">
|
on:click={() => (searching = true)}
|
||||||
{#if ($profile?.user?.notifications.reports ?? 0) > 0}
|
label="Search"
|
||||||
<div
|
icon={MagnifyingGlass}
|
||||||
class="rounded-full w-2 h-2 bg-red-500 absolute -top-1 -left-1"
|
|
||||||
/>
|
/>
|
||||||
{/if}
|
<NavButton href="/" label="Home" icon={Home} />
|
||||||
<ShieldIcon slot="icon" filled width={15} />
|
<Menu placement="top">
|
||||||
</NavButton>
|
|
||||||
{/if}
|
|
||||||
<NavButton href="/search" label="Search" icon={MagnifyingGlass} />
|
|
||||||
<NavButton href="/communities" label="Explore" icon={GlobeAlt} />
|
|
||||||
<Menu placement="bottom-end" targetClass="h-8">
|
|
||||||
<NavButton
|
<NavButton
|
||||||
class="relative"
|
class="relative"
|
||||||
color="primary"
|
color="primary"
|
||||||
@@ -138,11 +211,5 @@
|
|||||||
</span>
|
</span>
|
||||||
{/if}
|
{/if}
|
||||||
</Menu>
|
</Menu>
|
||||||
<Profile
|
|
||||||
placement="bottom-end"
|
|
||||||
itemsClass="h-8 md:h-8 z-10"
|
|
||||||
targetClass="z-10 h-8"
|
|
||||||
containerClass="!max-h-[28rem] z-10"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -34,17 +34,19 @@
|
|||||||
|
|
||||||
<Menu {...$$restProps}>
|
<Menu {...$$restProps}>
|
||||||
<button
|
<button
|
||||||
class="w-8 h-8 rounded-full ring-1 ring-slate-200 dark:ring-zinc-700
|
class="w-10 h-10 rounded-full ring-1 ring-slate-200 dark:ring-zinc-700
|
||||||
transition-all bg-slate-50 dark:bg-zinc-900 relative
|
transition-all bg-slate-50 dark:bg-zinc-900 relative
|
||||||
hover:dark:brightness-125 hover:brightness-95"
|
hover:dark:brightness-125 hover:brightness {$$props.buttonClass}"
|
||||||
aria-label="Profile"
|
aria-label="Profile"
|
||||||
slot="target"
|
slot="target"
|
||||||
>
|
>
|
||||||
{#if $profile?.user}
|
{#if $profile?.user}
|
||||||
<div class="w-8 h-8 aspect-square object-cover rounded-full">
|
<div
|
||||||
|
class="w-10 h-10 aspect-square object-cover rounded-full grid place-items-center"
|
||||||
|
>
|
||||||
<Avatar
|
<Avatar
|
||||||
url={$profile.user.local_user_view.person.avatar}
|
url={$profile.user.local_user_view.person.avatar}
|
||||||
width={32}
|
width={38}
|
||||||
alt={$profile.user.local_user_view.person.name}
|
alt={$profile.user.local_user_view.person.name}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
{index}
|
{index}
|
||||||
{guest}
|
{guest}
|
||||||
selected={$profile?.id == prof.id}
|
selected={$profile?.id == prof.id}
|
||||||
slot="prefix"
|
slot="icon"
|
||||||
/>
|
/>
|
||||||
<span
|
<span
|
||||||
class="flex flex-col gap-0 {$profile?.id == prof.id ? 'font-semibold' : ''}"
|
class="flex flex-col gap-0 {$profile?.id == prof.id ? 'font-semibold' : ''}"
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {
|
import {
|
||||||
ArrowLeftOnRectangle,
|
ArrowLeftOnRectangle,
|
||||||
|
Bookmark,
|
||||||
ChevronDoubleRight,
|
ChevronDoubleRight,
|
||||||
Cog6Tooth,
|
Cog6Tooth,
|
||||||
GlobeAlt,
|
GlobeAlt,
|
||||||
@@ -10,6 +11,7 @@
|
|||||||
Inbox,
|
Inbox,
|
||||||
MagnifyingGlass,
|
MagnifyingGlass,
|
||||||
ServerStack,
|
ServerStack,
|
||||||
|
UserCircle,
|
||||||
UserGroup,
|
UserGroup,
|
||||||
} from 'svelte-hero-icons'
|
} from 'svelte-hero-icons'
|
||||||
import { profile, profileData } from '$lib/auth.js'
|
import { profile, profileData } from '$lib/auth.js'
|
||||||
@@ -23,59 +25,29 @@
|
|||||||
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'
|
||||||
|
|
||||||
export let route = ''
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<nav
|
<nav
|
||||||
class="flex flex-col pl-4 pr-4 py-4 overflow-auto
|
class="flex flex-col p-4 overflow-auto
|
||||||
gap-1 max-h-[calc(100svh-4rem)] {$$props.class}"
|
gap-1 h-screen {$$props.class}"
|
||||||
style={$$props.style}
|
style={$$props.style}
|
||||||
>
|
>
|
||||||
<Button
|
{#if $profile}
|
||||||
on:click={() =>
|
<SidebarButton icon={UserCircle} href="/profile/user">
|
||||||
($userSettings.expandSidebar = !$userSettings.expandSidebar)}
|
Profile
|
||||||
size="square-md"
|
|
||||||
class="flex-shrink-0 lg:hidden"
|
|
||||||
>
|
|
||||||
<Icon src={ChevronDoubleRight} size="16" mini />
|
|
||||||
</Button>
|
|
||||||
<SidebarButton href="/" selected={route == '/'}>
|
|
||||||
<Icon src={Home} solid={route == '/'} size="20" title="Frontpage" />
|
|
||||||
<span slot="label">Frontpage</span>
|
|
||||||
</SidebarButton>
|
</SidebarButton>
|
||||||
<SidebarButton href="/settings" selected={route == '/settings'}>
|
<SidebarButton icon={Inbox} href="/inbox">
|
||||||
<Icon
|
Inbox
|
||||||
src={Cog6Tooth}
|
{#if $profile?.user?.notifications.inbox}
|
||||||
solid={route == '/settings'}
|
|
||||||
size="20"
|
|
||||||
title="Settings"
|
|
||||||
/>
|
|
||||||
<span slot="label">Settings</span>
|
|
||||||
</SidebarButton>
|
|
||||||
<SidebarButton href="/search" selected={route == '/search'}>
|
|
||||||
<Icon solid={route == '/search'} src={MagnifyingGlass} size="20" />
|
|
||||||
<span slot="label">Search</span>
|
|
||||||
</SidebarButton>
|
|
||||||
<SidebarButton href="/communities" selected={route == '/communities'}>
|
|
||||||
<Icon solid={route == '/communities'} src={GlobeAlt} size="20" />
|
|
||||||
<span slot="label">Communities</span>
|
|
||||||
</SidebarButton>
|
|
||||||
{#if $profile?.jwt}
|
|
||||||
<SidebarButton href="/inbox" selected={route == '/inbox'}>
|
|
||||||
<Icon solid={route == '/inbox'} src={Inbox} size="20" />
|
|
||||||
<span slot="label" class="inline-flex items-center flex-1">
|
|
||||||
<span class="flex-shrink-0 flex-1">Inbox</span>
|
|
||||||
{#if ($profile?.user?.notifications.inbox ?? 0) > 0}
|
|
||||||
<Badge
|
<Badge
|
||||||
|
class="w-5 h-5 !p-0 grid place-items-center ml-auto"
|
||||||
color="red-subtle"
|
color="red-subtle"
|
||||||
class="w-5 h-5 !p-0 grid place-items-center"
|
|
||||||
>
|
>
|
||||||
{$profile?.user?.notifications.inbox}
|
{$profile?.user?.notifications.inbox}
|
||||||
</Badge>
|
</Badge>
|
||||||
{/if}
|
{/if}
|
||||||
</span>
|
|
||||||
</SidebarButton>
|
</SidebarButton>
|
||||||
|
<SidebarButton icon={Bookmark} href="/saved">Saved</SidebarButton>
|
||||||
{/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" />
|
||||||
@@ -93,8 +65,7 @@
|
|||||||
}}
|
}}
|
||||||
guest
|
guest
|
||||||
/>
|
/>
|
||||||
<SidebarButton href="/accounts" selected={route == '/accounts'}>
|
<SidebarButton href="/accounts" icon={UserGroup}>
|
||||||
<Icon src={UserGroup} mini={route == '/accounts'} size="20" />
|
|
||||||
<span slot="label">Accounts</span>
|
<span slot="label">Accounts</span>
|
||||||
</SidebarButton>
|
</SidebarButton>
|
||||||
{/if}
|
{/if}
|
||||||
@@ -122,17 +93,18 @@
|
|||||||
<CommunityList items={$profile.user.follows.map((i) => i.community)} />
|
<CommunityList items={$profile.user.follows.map((i) => i.community)} />
|
||||||
</Expandable>
|
</Expandable>
|
||||||
{:else}
|
{:else}
|
||||||
<SidebarButton href="/login" title="Log In">
|
<SidebarButton href="/login" title="Log In" icon={ArrowLeftOnRectangle}>
|
||||||
<Icon mini src={ArrowLeftOnRectangle} size="20" />
|
|
||||||
<span slot="label">Log In</span>
|
<span slot="label">Log In</span>
|
||||||
</SidebarButton>
|
</SidebarButton>
|
||||||
<SidebarButton href="/signup" title="Sign Up">
|
<SidebarButton href="/signup" title="Sign Up" icon={Identification}>
|
||||||
<Icon mini src={Identification} size="20" />
|
|
||||||
<span slot="label">Sign Up</span>
|
<span slot="label">Sign Up</span>
|
||||||
</SidebarButton>
|
</SidebarButton>
|
||||||
{#if LINKED_INSTANCE_URL === undefined}
|
{#if LINKED_INSTANCE_URL === undefined}
|
||||||
<SidebarButton href="/accounts" title="Change Instance">
|
<SidebarButton
|
||||||
<Icon mini src={ServerStack} size="20" />
|
href="/accounts"
|
||||||
|
title="Change Instance"
|
||||||
|
icon={ServerStack}
|
||||||
|
>
|
||||||
<span slot="label">Change Instance</span>
|
<span slot="label">Change Instance</span>
|
||||||
</SidebarButton>
|
</SidebarButton>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -1,12 +1,22 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { page } from '$app/stores'
|
||||||
import { userSettings } from '$lib/settings.js'
|
import { userSettings } from '$lib/settings.js'
|
||||||
import { Button } from 'mono-svelte'
|
import { Button } from 'mono-svelte'
|
||||||
|
import { Icon, type IconSource } from 'svelte-hero-icons'
|
||||||
|
|
||||||
export let selected: boolean = false
|
export let href: string | undefined = undefined
|
||||||
|
export let icon: IconSource | undefined = undefined
|
||||||
|
export let selected = false
|
||||||
|
$: {
|
||||||
|
if (href != undefined) {
|
||||||
|
selected = $page.url.pathname == href
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
{...$$restProps}
|
{...$$restProps}
|
||||||
|
{href}
|
||||||
color="tertiary"
|
color="tertiary"
|
||||||
alignment="left"
|
alignment="left"
|
||||||
on:click
|
on:click
|
||||||
@@ -16,7 +26,11 @@
|
|||||||
? ''
|
? ''
|
||||||
: 'max-lg:!p-1 [&>*]:max-lg:!justify-center'} {$$props.class}"
|
: 'max-lg:!p-1 [&>*]:max-lg:!justify-center'} {$$props.class}"
|
||||||
>
|
>
|
||||||
<slot name="prefix" slot="prefix" />
|
<slot {selected} name="icon" slot="prefix">
|
||||||
|
{#if icon}
|
||||||
|
<Icon src={icon} solid={selected} size="20" />
|
||||||
|
{/if}
|
||||||
|
</slot>
|
||||||
<slot />
|
<slot />
|
||||||
<div class={$userSettings.expandSidebar ? 'contents' : 'max-lg:hidden'}>
|
<div class={$userSettings.expandSidebar ? 'contents' : 'max-lg:hidden'}>
|
||||||
<slot name="label" />
|
<slot name="label" />
|
||||||
|
|||||||
@@ -6,6 +6,6 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<span>
|
<span class={$$props.class ?? ''}>
|
||||||
{Intl.NumberFormat(locale, options).format(number)}
|
{Intl.NumberFormat(locale, options).format(number)}
|
||||||
</span>
|
</span>
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { profile } from '$lib/auth'
|
||||||
import type {
|
import type {
|
||||||
CommentReportView,
|
CommentReportView,
|
||||||
CommentView,
|
CommentView,
|
||||||
@@ -10,6 +11,7 @@ import type {
|
|||||||
PrivateMessageReportView,
|
PrivateMessageReportView,
|
||||||
PrivateMessageView,
|
PrivateMessageView,
|
||||||
} from 'lemmy-js-client'
|
} from 'lemmy-js-client'
|
||||||
|
import { get } from 'svelte/store'
|
||||||
|
|
||||||
export type Result =
|
export type Result =
|
||||||
| PostView
|
| PostView
|
||||||
@@ -66,3 +68,30 @@ export const isCommentReport = (item: Result): item is CommentReportView =>
|
|||||||
export const isPrivateMessageReport = (
|
export const isPrivateMessageReport = (
|
||||||
item: Result
|
item: Result
|
||||||
): item is PrivateMessageReportView => 'private_message_report' in item
|
): item is PrivateMessageReportView => 'private_message_report' in item
|
||||||
|
|
||||||
|
export interface ResumableItem {
|
||||||
|
url: URL
|
||||||
|
id: number
|
||||||
|
name: string
|
||||||
|
avatar?: string
|
||||||
|
type: 'community' | 'post'
|
||||||
|
subdivision?: {
|
||||||
|
avatar?: string
|
||||||
|
name: string
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function addResumable(item: ResumableItem) {
|
||||||
|
const p = get(profile)
|
||||||
|
if (!p) return
|
||||||
|
|
||||||
|
let favs = p.favorites ?? []
|
||||||
|
if (favs.map((fav) => fav.url.toString()).includes(item.url.toString()))
|
||||||
|
return
|
||||||
|
if (favs.length >= 5) favs.pop()
|
||||||
|
favs.unshift(item)
|
||||||
|
profile.update(() => ({
|
||||||
|
...p,
|
||||||
|
favorites: favs
|
||||||
|
}))
|
||||||
|
}
|
||||||
@@ -81,6 +81,13 @@ interface Settings {
|
|||||||
clickToView: boolean
|
clickToView: boolean
|
||||||
youtube: 'youtube' | 'invidious' | 'piped'
|
youtube: 'youtube' | 'invidious' | 'piped'
|
||||||
}
|
}
|
||||||
|
dock: {
|
||||||
|
noGap: boolean
|
||||||
|
top: boolean
|
||||||
|
}
|
||||||
|
posts: {
|
||||||
|
deduplicateEmbed: boolean
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const defaultSettings: Settings = {
|
export const defaultSettings: Settings = {
|
||||||
@@ -135,6 +142,13 @@ export const defaultSettings: Settings = {
|
|||||||
embeds: {
|
embeds: {
|
||||||
clickToView: true,
|
clickToView: true,
|
||||||
youtube: 'youtube',
|
youtube: 'youtube',
|
||||||
|
},
|
||||||
|
dock: {
|
||||||
|
noGap: false,
|
||||||
|
top: false
|
||||||
|
},
|
||||||
|
posts: {
|
||||||
|
deduplicateEmbed: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+13
-11
@@ -11,6 +11,7 @@
|
|||||||
import {
|
import {
|
||||||
colors,
|
colors,
|
||||||
colorsToVars,
|
colorsToVars,
|
||||||
|
defaultColors,
|
||||||
inDarkLegacyTheme,
|
inDarkLegacyTheme,
|
||||||
legacyTheme,
|
legacyTheme,
|
||||||
} from '$lib/ui/colors.js'
|
} from '$lib/ui/colors.js'
|
||||||
@@ -73,8 +74,8 @@
|
|||||||
<meta
|
<meta
|
||||||
name="theme-color"
|
name="theme-color"
|
||||||
content={darklegacyTheme
|
content={darklegacyTheme
|
||||||
? $colors?.zinc?.[950] ?? '#09090b'
|
? $colors?.zinc?.[925] ?? defaultColors.zinc[925]
|
||||||
: $colors?.slate?.[50] ?? '#f8fafc'}
|
: $colors?.slate?.[25] ?? defaultColors.slate[25]}
|
||||||
/>
|
/>
|
||||||
{#if $site}
|
{#if $site}
|
||||||
<title>{$site.site_view.site.name}</title>
|
<title>{$site.site_view.site.name}</title>
|
||||||
@@ -108,14 +109,6 @@
|
|||||||
<ExpandableImage />
|
<ExpandableImage />
|
||||||
<ModalContainer />
|
<ModalContainer />
|
||||||
|
|
||||||
<Navbar
|
|
||||||
slot="navbar"
|
|
||||||
let:style={s}
|
|
||||||
let:class={c}
|
|
||||||
class={c}
|
|
||||||
style={s}
|
|
||||||
{title}
|
|
||||||
/>
|
|
||||||
<Sidebar
|
<Sidebar
|
||||||
route={$page.route.id ?? ''}
|
route={$page.route.id ?? ''}
|
||||||
slot="sidebar"
|
slot="sidebar"
|
||||||
@@ -128,13 +121,21 @@
|
|||||||
slot="main"
|
slot="main"
|
||||||
let:style={s}
|
let:style={s}
|
||||||
let:class={c}
|
let:class={c}
|
||||||
class="p-3 sm:p-6 min-w-0 w-full flex flex-col min-h-full relative {c}"
|
class="p-4 sm:p-6 min-w-0 w-full flex flex-col min-h-full relative {c}"
|
||||||
style={s}
|
style={s}
|
||||||
class:max-w-6xl={$userSettings.newWidth}
|
class:max-w-6xl={$userSettings.newWidth}
|
||||||
id="main"
|
id="main"
|
||||||
>
|
>
|
||||||
<slot />
|
<slot />
|
||||||
</main>
|
</main>
|
||||||
|
<Navbar
|
||||||
|
slot="navbar"
|
||||||
|
let:style={s}
|
||||||
|
let:class={c}
|
||||||
|
class={c}
|
||||||
|
style={s}
|
||||||
|
{title}
|
||||||
|
/>
|
||||||
<div slot="suffix" let:class={c} let:style={s} class={c} style={s}>
|
<div slot="suffix" let:class={c} let:style={s} class={c} style={s}>
|
||||||
{#if $page.data.slots?.sidebar?.component}
|
{#if $page.data.slots?.sidebar?.component}
|
||||||
<svelte:component
|
<svelte:component
|
||||||
@@ -148,6 +149,7 @@
|
|||||||
taglines={$site.taglines}
|
taglines={$site.taglines}
|
||||||
admins={$site.admins}
|
admins={$site.admins}
|
||||||
version={$site.version}
|
version={$site.version}
|
||||||
|
class="pt-4"
|
||||||
/>
|
/>
|
||||||
{:else}
|
{:else}
|
||||||
<div class="h-64 w-full grid place-items-center">
|
<div class="h-64 w-full grid place-items-center">
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
import { amModOfAny } from '$lib/components/lemmy/moderation/moderation.js'
|
import { amModOfAny } from '$lib/components/lemmy/moderation/moderation.js'
|
||||||
import { feature } from '$lib/version.js'
|
import { feature } from '$lib/version.js'
|
||||||
import { userSettings } from '$lib/settings.js'
|
import { userSettings } from '$lib/settings.js'
|
||||||
|
import FormattedNumber from '$lib/components/util/FormattedNumber.svelte'
|
||||||
|
|
||||||
export let data
|
export let data
|
||||||
|
|
||||||
@@ -91,10 +92,11 @@
|
|||||||
>
|
>
|
||||||
<span class="flex flex-row items-center gap-1">
|
<span class="flex flex-row items-center gap-1">
|
||||||
<Icon src={ChartBar} size="16" mini />
|
<Icon src={ChartBar} size="16" mini />
|
||||||
<span class="font-medium text-black dark:text-white">
|
<FormattedNumber
|
||||||
{$site?.site_view.counts.users_active_day}
|
number={$site?.site_view.counts.users_active_day ?? 0}
|
||||||
</span>
|
class="text-black dark:text-white font-medium"
|
||||||
<span class="font-normal">Active users</span>
|
/>
|
||||||
|
<span class="font-normal">active users</span>
|
||||||
</span>
|
</span>
|
||||||
</Pageination>
|
</Pageination>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
import { Button, TextInput } from 'mono-svelte'
|
import { Button, TextInput } from 'mono-svelte'
|
||||||
import {
|
import {
|
||||||
ArrowLeftOnRectangle,
|
ArrowLeftOnRectangle,
|
||||||
|
ArrowRightOnRectangle,
|
||||||
ArrowUturnLeft,
|
ArrowUturnLeft,
|
||||||
BugAnt,
|
BugAnt,
|
||||||
Check,
|
Check,
|
||||||
@@ -251,14 +252,22 @@
|
|||||||
<Button size="square-md" slot="target">
|
<Button size="square-md" slot="target">
|
||||||
<Icon src={EllipsisHorizontal} mini size="16" slot="prefix" />
|
<Icon src={EllipsisHorizontal} mini size="16" slot="prefix" />
|
||||||
</Button>
|
</Button>
|
||||||
<MenuButton on:click={() => moveProfile(profile.id, true)}>
|
<div class="px-4 py-2 flex items-center gap-2">
|
||||||
|
<Button
|
||||||
|
size="square-md"
|
||||||
|
color="secondary"
|
||||||
|
on:click={() => moveProfile(profile.id, true)}
|
||||||
|
>
|
||||||
<Icon src={ChevronUp} size="16" mini slot="prefix" />
|
<Icon src={ChevronUp} size="16" mini slot="prefix" />
|
||||||
Move Up
|
</Button>
|
||||||
</MenuButton>
|
<Button
|
||||||
<MenuButton on:click={() => moveProfile(profile.id, false)}>
|
size="square-md"
|
||||||
|
color="secondary"
|
||||||
|
on:click={() => moveProfile(profile.id, false)}
|
||||||
|
>
|
||||||
<Icon src={ChevronDown} size="16" mini slot="prefix" />
|
<Icon src={ChevronDown} size="16" mini slot="prefix" />
|
||||||
Move Down
|
</Button>
|
||||||
</MenuButton>
|
</div>
|
||||||
<MenuButton
|
<MenuButton
|
||||||
disabled={!profile.color}
|
disabled={!profile.color}
|
||||||
on:click={() => (profile.color = undefined)}
|
on:click={() => (profile.color = undefined)}
|
||||||
@@ -278,8 +287,8 @@
|
|||||||
</MenuButton>
|
</MenuButton>
|
||||||
{/if}
|
{/if}
|
||||||
<MenuButton on:click={() => action(profile)} color="danger-subtle">
|
<MenuButton on:click={() => action(profile)} color="danger-subtle">
|
||||||
<Icon slot="prefix" src={Trash} size="16" mini />
|
<Icon slot="prefix" src={ArrowRightOnRectangle} size="16" mini />
|
||||||
Delete
|
Log Out
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
</Menu>
|
</Menu>
|
||||||
</div>
|
</div>
|
||||||
@@ -324,8 +333,8 @@
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
<Button href="/login" size="lg">
|
<Button href="/login" size="lg">
|
||||||
<Icon slot="prefix" src={Plus} size="16" mini />
|
<Icon slot="prefix" src={ArrowLeftOnRectangle} size="16" mini />
|
||||||
Add more
|
Log In
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
@@ -21,6 +21,7 @@
|
|||||||
} from 'svelte-hero-icons'
|
} from 'svelte-hero-icons'
|
||||||
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
||||||
import { profile } from '$lib/auth'
|
import { profile } from '$lib/auth'
|
||||||
|
import { addResumable } from '$lib/lemmy/item.js'
|
||||||
|
|
||||||
export let data
|
export let data
|
||||||
|
|
||||||
@@ -34,6 +35,18 @@
|
|||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
afterNavigate(() => {
|
||||||
|
if ($profile) {
|
||||||
|
addResumable({
|
||||||
|
avatar: data.community.community_view.community.icon,
|
||||||
|
id: data.community.community_view.community.id,
|
||||||
|
url: $page.url,
|
||||||
|
name: data.community.community_view.community.title,
|
||||||
|
type: 'community',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
onDestroy(() => {
|
onDestroy(() => {
|
||||||
if (browser) {
|
if (browser) {
|
||||||
if ($navigating?.to?.route?.id == '/create/post') return
|
if ($navigating?.to?.route?.id == '/create/post') return
|
||||||
|
|||||||
@@ -46,9 +46,14 @@
|
|||||||
import { feature } from '$lib/version.js'
|
import { feature } from '$lib/version.js'
|
||||||
import { publishedToDate } from '$lib/components/util/date.js'
|
import { publishedToDate } from '$lib/components/util/date.js'
|
||||||
import PostMedia from '$lib/components/lemmy/post/media/PostMedia.svelte'
|
import PostMedia from '$lib/components/lemmy/post/media/PostMedia.svelte'
|
||||||
import { mediaType } from '$lib/components/lemmy/post/helpers.js'
|
import {
|
||||||
|
bestImageURL,
|
||||||
|
mediaType,
|
||||||
|
optimizeImageURL,
|
||||||
|
} from '$lib/components/lemmy/post/helpers.js'
|
||||||
import Post from '$lib/components/lemmy/post/Post.svelte'
|
import Post from '$lib/components/lemmy/post/Post.svelte'
|
||||||
import Expandable from '$lib/components/ui/Expandable.svelte'
|
import Expandable from '$lib/components/ui/Expandable.svelte'
|
||||||
|
import { addResumable } from '$lib/lemmy/item.js'
|
||||||
|
|
||||||
export let data
|
export let data
|
||||||
|
|
||||||
@@ -80,6 +85,21 @@
|
|||||||
duration: 9999 * 1000,
|
duration: 9999 * 1000,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
if ($profile) {
|
||||||
|
addResumable({
|
||||||
|
avatar: post.post_view.post.thumbnail_url
|
||||||
|
? optimizeImageURL(post.post_view.post.thumbnail_url, 64)
|
||||||
|
: undefined,
|
||||||
|
id: post.post_view.post.id,
|
||||||
|
url: $page.url,
|
||||||
|
name: post.post_view.post.name,
|
||||||
|
type: 'post',
|
||||||
|
subdivision: {
|
||||||
|
name: post.post_view.community.name,
|
||||||
|
avatar: post.post_view.community.icon,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const fetchOnHome = async (jwt: string) => {
|
const fetchOnHome = async (jwt: string) => {
|
||||||
|
|||||||
@@ -47,9 +47,39 @@
|
|||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<div class="flex flex-col gap-4" style="scroll-behavior: smooth;">
|
<div class="flex flex-col gap-4" style="scroll-behavior: smooth;">
|
||||||
|
<Section title="Navigation">
|
||||||
|
<div>
|
||||||
|
<Button
|
||||||
|
color="ghost"
|
||||||
|
on:click={() => {
|
||||||
|
$userSettings.dock.noGap = true
|
||||||
|
$userSettings.dock.top = true
|
||||||
|
}}
|
||||||
|
disabled={$userSettings.dock.noGap && $userSettings.dock.top}
|
||||||
|
>
|
||||||
|
Legacy Navigation Style
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
<Setting>
|
||||||
|
<span slot="title">Dock alignment</span>
|
||||||
|
<span slot="description">Where the dock should be put</span>
|
||||||
|
<MultiSelect
|
||||||
|
options={[true, false]}
|
||||||
|
optionNames={['Top', 'Bottom']}
|
||||||
|
bind:selected={$userSettings.dock.top}
|
||||||
|
/>
|
||||||
|
</Setting>
|
||||||
|
<ToggleSetting
|
||||||
|
bind:checked={$userSettings.dock.noGap}
|
||||||
|
title="Panel mode"
|
||||||
|
description="Extend the dock to screen edges, similar to a panel."
|
||||||
|
/>
|
||||||
|
</Section>
|
||||||
|
|
||||||
<Section title="Photon">
|
<Section title="Photon">
|
||||||
<Setting>
|
<Setting>
|
||||||
<span slot="title">Theming</span>
|
<span slot="title">Theming</span>
|
||||||
|
<span slot="description">Customize Photon's colors.</span>
|
||||||
<Button href="/theme">
|
<Button href="/theme">
|
||||||
Go to themes <Icon src={ArrowRight} size="16" mini slot="suffix" />
|
Go to themes <Icon src={ArrowRight} size="16" mini slot="suffix" />
|
||||||
</Button>
|
</Button>
|
||||||
@@ -126,12 +156,17 @@
|
|||||||
/>
|
/>
|
||||||
<ToggleSetting
|
<ToggleSetting
|
||||||
bind:checked={$userSettings.expandImages}
|
bind:checked={$userSettings.expandImages}
|
||||||
title="Expand Images"
|
title="Expand images"
|
||||||
description="Clicking on a post's image brings you to an expanded view rather than
|
description="Clicking on a post's image brings you to an expanded view rather than
|
||||||
sending you to the post page."
|
sending you to the post page."
|
||||||
/>
|
/>
|
||||||
|
<ToggleSetting
|
||||||
|
bind:checked={$userSettings.posts.deduplicateEmbed}
|
||||||
|
title="Hide duplicate titles/bodies"
|
||||||
|
description="Hides the post title and body if they're the same as the embed."
|
||||||
|
/>
|
||||||
<Setting>
|
<Setting>
|
||||||
<span slot="title">Thumbnail Alignment</span>
|
<span slot="title">Thumbnail alignment</span>
|
||||||
<span slot="description">
|
<span slot="description">
|
||||||
Where thumbnails should be on the post in list/compact view.
|
Where thumbnails should be on the post in list/compact view.
|
||||||
</span>
|
</span>
|
||||||
@@ -141,19 +176,12 @@
|
|||||||
bind:selected={$userSettings.leftAlign}
|
bind:selected={$userSettings.leftAlign}
|
||||||
/>
|
/>
|
||||||
</Setting>
|
</Setting>
|
||||||
{#if LINKED_INSTANCE_URL}
|
|
||||||
<ToggleSetting
|
|
||||||
title={'Remove "Powered by Photon"'}
|
|
||||||
description="Remove the massive 120x16 div in the top left corner."
|
|
||||||
bind:checked={$userSettings.hidePhoton}
|
|
||||||
/>
|
|
||||||
{/if}
|
|
||||||
</Section>
|
</Section>
|
||||||
|
|
||||||
<Section title="Embeds">
|
<Section title="Embeds">
|
||||||
<ToggleSetting
|
<ToggleSetting
|
||||||
title="Click to view"
|
title="Click to view"
|
||||||
description="Before loading embeds, click. (It is recommended to leave this on, to not load a video you don't want to load.)"
|
description="Don't load an embed until you click it. (It is recommended to leave this on, to not load a video you don't want to load.)"
|
||||||
bind:checked={$userSettings.embeds.clickToView}
|
bind:checked={$userSettings.embeds.clickToView}
|
||||||
/>
|
/>
|
||||||
<Setting>
|
<Setting>
|
||||||
@@ -167,6 +195,15 @@
|
|||||||
<option value="piped">Piped</option>
|
<option value="piped">Piped</option>
|
||||||
</Select>
|
</Select>
|
||||||
</Setting>
|
</Setting>
|
||||||
|
<Setting>
|
||||||
|
<span slot="title">Font</span>
|
||||||
|
<span slot="description">What font Photon should use.</span>
|
||||||
|
<MultiSelect
|
||||||
|
options={['inter', 'system', 'browser']}
|
||||||
|
optionNames={['Inter', 'System UI', 'Browser Font']}
|
||||||
|
bind:selected={$userSettings.font}
|
||||||
|
/>
|
||||||
|
</Setting>
|
||||||
</Section>
|
</Section>
|
||||||
|
|
||||||
<Section title="Lemmy">
|
<Section title="Lemmy">
|
||||||
@@ -185,11 +222,6 @@
|
|||||||
title="'Crossposted from' when crossposting"
|
title="'Crossposted from' when crossposting"
|
||||||
description="If enabled, crossposts will include a link to the original post."
|
description="If enabled, crossposts will include a link to the original post."
|
||||||
/>
|
/>
|
||||||
<ToggleSetting
|
|
||||||
bind:checked={$userSettings.nsfwBlur}
|
|
||||||
title="NSFW blur"
|
|
||||||
description="Blur images and remove post bodies of NSFW content."
|
|
||||||
/>
|
|
||||||
<Setting>
|
<Setting>
|
||||||
<span slot="title">Hide Submissions</span>
|
<span slot="title">Hide Submissions</span>
|
||||||
<span slot="description">
|
<span slot="description">
|
||||||
@@ -212,15 +244,11 @@
|
|||||||
</Checkbox>
|
</Checkbox>
|
||||||
</div>
|
</div>
|
||||||
</Setting>
|
</Setting>
|
||||||
<Setting>
|
<ToggleSetting
|
||||||
<span slot="title">Font</span>
|
bind:checked={$userSettings.nsfwBlur}
|
||||||
<span slot="description">What font Photon should use.</span>
|
title="NSFW blur"
|
||||||
<MultiSelect
|
description="Blur images and remove post bodies of content tagged NSFW."
|
||||||
options={['inter', 'system', 'browser']}
|
|
||||||
optionNames={['Inter', 'System UI', 'Browser Font']}
|
|
||||||
bind:selected={$userSettings.font}
|
|
||||||
/>
|
/>
|
||||||
</Setting>
|
|
||||||
<Setting>
|
<Setting>
|
||||||
<span slot="title">Show instances</span>
|
<span slot="title">Show instances</span>
|
||||||
<span slot="description">Show items' instances.</span>
|
<span slot="description">Show items' instances.</span>
|
||||||
|
|||||||
@@ -18,6 +18,9 @@ export default {
|
|||||||
animation: {
|
animation: {
|
||||||
'pop-in': 'pop-in 0.25s ease-out forwards',
|
'pop-in': 'pop-in 0.25s ease-out forwards',
|
||||||
},
|
},
|
||||||
|
spacing: {
|
||||||
|
'22': '88px'
|
||||||
|
},
|
||||||
keyframes: {
|
keyframes: {
|
||||||
'pop-in': {
|
'pop-in': {
|
||||||
'0%, 100%': { transform: 'translateX(8px)', opacity: 0 },
|
'0%, 100%': { transform: 'translateX(8px)', opacity: 0 },
|
||||||
|
|||||||
Reference in new issue
Block a user