design: declutter site card
This commit is contained in:
1 parent
2a254a5a87
commit
9d1ce19549
5 files changed
+67
-73
No files matched your search
@@ -5,10 +5,6 @@
|
|||||||
<link rel="icon" href="%sveltekit.assets%/img/logo-background.svg" />
|
<link rel="icon" href="%sveltekit.assets%/img/logo-background.svg" />
|
||||||
<link rel="manifest" href="/manifest.json" />
|
<link rel="manifest" href="/manifest.json" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<meta
|
|
||||||
name="description"
|
|
||||||
content="Photon: An alternative lemmy client with a sleek design."
|
|
||||||
/>
|
|
||||||
<meta name="keywords" content="lemmy, client" />
|
<meta name="keywords" content="lemmy, client" />
|
||||||
<script defer type="">
|
<script defer type="">
|
||||||
const dark = () =>
|
const dark = () =>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
import { publishedToDate } from '$lib/components/util/date.js'
|
import { publishedToDate } from '$lib/components/util/date.js'
|
||||||
import { getClient } from '$lib/lemmy.js'
|
import { getClient } from '$lib/lemmy.js'
|
||||||
import type { PersonView, SiteView, Tagline } from 'lemmy-js-client'
|
import type { PersonView, SiteView, Tagline } from 'lemmy-js-client'
|
||||||
import { Button, Popover } from 'mono-svelte'
|
import { Button, Disclosure, Popover } from 'mono-svelte'
|
||||||
import {
|
import {
|
||||||
BuildingOffice,
|
BuildingOffice,
|
||||||
Calendar,
|
Calendar,
|
||||||
@@ -18,6 +18,7 @@
|
|||||||
ServerStack,
|
ServerStack,
|
||||||
UserGroup,
|
UserGroup,
|
||||||
} from 'svelte-hero-icons'
|
} from 'svelte-hero-icons'
|
||||||
|
import Expandable from '../ui/Expandable.svelte'
|
||||||
|
|
||||||
export let site: SiteView
|
export let site: SiteView
|
||||||
export let taglines: Tagline[] | undefined = undefined
|
export let taglines: Tagline[] | undefined = undefined
|
||||||
@@ -28,7 +29,7 @@
|
|||||||
<StickyCard class="w-full {$$props.class}">
|
<StickyCard class="w-full {$$props.class}">
|
||||||
<div class="flex flex-row gap-3 items-center">
|
<div class="flex flex-row gap-3 items-center">
|
||||||
{#if site.site.icon}
|
{#if site.site.icon}
|
||||||
<Avatar width={42} url={site.site.icon} alt={site.site.name} />
|
<Avatar width={32} url={site.site.icon} alt={site.site.name} />
|
||||||
{/if}
|
{/if}
|
||||||
<div class="flex flex-col">
|
<div class="flex flex-col">
|
||||||
<h1 class="font-bold text-base">{site.site.name}</h1>
|
<h1 class="font-bold text-base">{site.site.name}</h1>
|
||||||
@@ -37,83 +38,62 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<span class="flex flex-row items-center gap-1 text-sm" title="Created">
|
<div class="flex flex-row gap-1 !border-0">
|
||||||
<Icon src={Calendar} width={16} height={16} mini />
|
<Button href="/modlog" title="Modlog" color="ghost" size="square-md">
|
||||||
<RelativeDate date={publishedToDate(site.site.published)} />
|
|
||||||
</span>
|
|
||||||
<div class="text-sm flex flex-row flex-wrap gap-3" title="Users">
|
|
||||||
<span class="flex flex-row items-center gap-1">
|
|
||||||
<Icon src={UserGroup} width={16} height={16} mini />
|
|
||||||
<FormattedNumber number={site.counts.users} />
|
|
||||||
</span>
|
|
||||||
<span class="flex flex-row items-center gap-1" title="Posts">
|
|
||||||
<Icon src={PencilSquare} width={16} height={16} mini />
|
|
||||||
<FormattedNumber number={site.counts.posts} />
|
|
||||||
</span>
|
|
||||||
<span class="flex flex-row items-center gap-1" title="Comments">
|
|
||||||
<Icon src={ChatBubbleOvalLeftEllipsis} width={16} height={16} mini />
|
|
||||||
<FormattedNumber number={site.counts.comments} />
|
|
||||||
</span>
|
|
||||||
<span class="flex flex-row items-center gap-1" title="Communities">
|
|
||||||
<Icon src={Newspaper} width={16} height={16} mini />
|
|
||||||
<FormattedNumber number={site.counts.communities} />
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div class="flex flex-col 3xl:flex-row 3xl:items-center gap-2 3xl:gap-0">
|
|
||||||
<Button href="/modlog" class="3xl:rounded-r-none">
|
|
||||||
<Icon src={Newspaper} size="16" mini />
|
<Icon src={Newspaper} size="16" mini />
|
||||||
Modlog
|
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button href="/legal" title="Legal" color="ghost" size="square-md">
|
||||||
href="/legal"
|
|
||||||
class="3xl:rounded-l-none 3xl:rounded-r-none 3xl:border-x-0"
|
|
||||||
>
|
|
||||||
<Icon src={BuildingOffice} size="16" mini />
|
<Icon src={BuildingOffice} size="16" mini />
|
||||||
Legal
|
|
||||||
</Button>
|
</Button>
|
||||||
<Button href="/instances" class="3xl:rounded-l-none">
|
<Button href="/instances" title="Instances" class="3xl:rounded-l-none" color="ghost" size="square-md">
|
||||||
<Icon src={ServerStack} size="16" mini />
|
<Icon src={ServerStack} size="16" mini />
|
||||||
Instances
|
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{#if admins}
|
|
||||||
<span class="font-bold">Admins</span>
|
<div class="flex flex-col [&>*]:py-3 divide-y divide-slate-200 dark:divide-zinc-800">
|
||||||
<div
|
|
||||||
class="flex items-center flex-wrap group transition-all
|
|
||||||
cursor-pointer"
|
|
||||||
>
|
|
||||||
{#each admins as admin}
|
|
||||||
<Popover openOnHover placement="top">
|
|
||||||
<a
|
|
||||||
class="block ring rounded-full ring-slate-50 dark:ring-zinc-950 transition-all -mx-0.5 group-hover:mx-0.5"
|
|
||||||
href="/u/{admin.person.name}@{new URL(admin.person.actor_id)
|
|
||||||
.hostname}"
|
|
||||||
slot="target"
|
|
||||||
>
|
|
||||||
<Avatar
|
|
||||||
width={28}
|
|
||||||
url={admin.person.avatar}
|
|
||||||
alt={admin.person.name}
|
|
||||||
/>
|
|
||||||
</a>
|
|
||||||
<span class="font-bold">{admin.person.name}</span>
|
|
||||||
</Popover>
|
|
||||||
{/each}
|
|
||||||
</div>
|
|
||||||
{/if}
|
|
||||||
<hr class="border-slate-300 dark:border-zinc-700" />
|
|
||||||
{#if taglines && taglines.length > 0}
|
{#if taglines && taglines.length > 0}
|
||||||
<Markdown
|
<Markdown class="!pt-0"
|
||||||
source={taglines[Math.floor(Math.random() * taglines.length)].content}
|
source={taglines[Math.floor(Math.random() * taglines.length)].content}
|
||||||
/>
|
/>
|
||||||
<hr class="border-slate-300 dark:border-zinc-700" />
|
|
||||||
{/if}
|
{/if}
|
||||||
<Markdown source={site.site.description} />
|
|
||||||
<hr class="border-slate-300 dark:border-zinc-700" />
|
<Expandable>
|
||||||
<Markdown source={site.site.sidebar} />
|
<div slot="title" class="font-medium w-full text-left">About</div>
|
||||||
|
<Markdown source={site.site.description} />
|
||||||
|
<div class="my-4" />
|
||||||
|
<Markdown source={site.site.sidebar} />
|
||||||
|
</Expandable>
|
||||||
|
|
||||||
|
{#if admins}
|
||||||
|
<Expandable>
|
||||||
|
<div slot="title" class="font-medium w-full text-left">Admins</div>
|
||||||
|
<div
|
||||||
|
class="flex items-center flex-wrap group transition-all
|
||||||
|
cursor-pointer"
|
||||||
|
>
|
||||||
|
{#each admins as admin}
|
||||||
|
<Popover openOnHover placement="top">
|
||||||
|
<a
|
||||||
|
class="block ring rounded-full ring-slate-50 dark:ring-zinc-950 transition-all -mx-0.5 group-hover:mx-0.5"
|
||||||
|
href="/u/{admin.person.name}@{new URL(admin.person.actor_id)
|
||||||
|
.hostname}"
|
||||||
|
slot="target"
|
||||||
|
>
|
||||||
|
<Avatar
|
||||||
|
width={28}
|
||||||
|
url={admin.person.avatar}
|
||||||
|
alt={admin.person.name}
|
||||||
|
/>
|
||||||
|
</a>
|
||||||
|
<span class="font-bold">{admin.person.name}</span>
|
||||||
|
</Popover>
|
||||||
|
{/each}
|
||||||
|
</div>
|
||||||
|
</Expandable>
|
||||||
|
{/if}
|
||||||
|
|
||||||
{#if version}
|
{#if version}
|
||||||
<hr class="border-slate-300 dark:border-zinc-700" />
|
|
||||||
<span
|
<span
|
||||||
class="text-slate-600 flex flex-row items-center gap-1 dark:text-zinc-400"
|
class="text-slate-600 flex flex-row items-center gap-1 dark:text-zinc-400"
|
||||||
title="Lemmy version"
|
title="Lemmy version"
|
||||||
@@ -122,4 +102,5 @@
|
|||||||
{version}
|
{version}
|
||||||
</span>
|
</span>
|
||||||
{/if}
|
{/if}
|
||||||
|
</div>
|
||||||
</StickyCard>
|
</StickyCard>
|
||||||
@@ -52,7 +52,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] {$$props.class}"
|
||||||
>
|
>
|
||||||
{@html rendered}
|
{@html rendered}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
<script>
|
||||||
|
|
||||||
|
import { Disclosure } from "mono-svelte"
|
||||||
|
import { ChevronDown, Icon } from "svelte-hero-icons"
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<Disclosure buttonClass="text-red-500" class="items-start justify-items-start gap-2">
|
||||||
|
<div slot="summary" class="font-medium w-full text-left flex flex-row items-center justify-between">
|
||||||
|
<slot name="title" />
|
||||||
|
<Icon src={ChevronDown} size="20" mini />
|
||||||
|
</div>
|
||||||
|
<div class="pt-2">
|
||||||
|
<slot /></div>
|
||||||
|
</Disclosure>
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
import { searchParam } from '$lib/util.js'
|
import { searchParam } from '$lib/util.js'
|
||||||
import PostFeed from '$lib/components/lemmy/post/PostFeed.svelte'
|
import PostFeed from '$lib/components/lemmy/post/PostFeed.svelte'
|
||||||
import { Button, Modal, Select, Spinner } from 'mono-svelte'
|
import { Button, Modal, Select, Spinner } from 'mono-svelte'
|
||||||
import { ChartBar, GlobeAmericas, Icon } from 'svelte-hero-icons'
|
import { ChartBar, GlobeAmericas, Icon, ServerStack } from 'svelte-hero-icons'
|
||||||
import { profile } from '$lib/auth.js'
|
import { profile } from '$lib/auth.js'
|
||||||
import ViewSelect from '$lib/components/lemmy/ViewSelect.svelte'
|
import ViewSelect from '$lib/components/lemmy/ViewSelect.svelte'
|
||||||
import { site } from '$lib/lemmy.js'
|
import { site } from '$lib/lemmy.js'
|
||||||
@@ -44,7 +44,9 @@
|
|||||||
>
|
>
|
||||||
Frontpage
|
Frontpage
|
||||||
<span class="xl:hidden">
|
<span class="xl:hidden">
|
||||||
<Button on:click={() => (sidebar = !sidebar)}>About</Button>
|
<Button on:click={() => (sidebar = !sidebar)} size="square-md">
|
||||||
|
<Icon src={ServerStack} size="16" mini />
|
||||||
|
</Button>
|
||||||
</span>
|
</span>
|
||||||
</h1>
|
</h1>
|
||||||
</header>
|
</header>
|
||||||
|
|||||||
Reference in new issue
Block a user