impr: remove dead code
This commit is contained in:
7 files changed
+13
-108
No files matched your search
@@ -1,7 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { goto } from '$app/navigation'
|
|
||||||
import { profile } from '$lib/auth.svelte'
|
import { profile } from '$lib/auth.svelte'
|
||||||
import { mediaType, postLink } from '$lib/components/lemmy/post/helpers.js'
|
import { mediaType } from '$lib/components/lemmy/post/helpers.js'
|
||||||
import PostMedia from '$lib/components/lemmy/post/media/PostMedia.svelte'
|
import PostMedia from '$lib/components/lemmy/post/media/PostMedia.svelte'
|
||||||
import PostMediaCompact from '$lib/components/lemmy/post/media/PostMediaCompact.svelte'
|
import PostMediaCompact from '$lib/components/lemmy/post/media/PostMediaCompact.svelte'
|
||||||
import PostActions from '$lib/components/lemmy/post/PostActions.svelte'
|
import PostActions from '$lib/components/lemmy/post/PostActions.svelte'
|
||||||
@@ -28,15 +27,6 @@
|
|||||||
return rule
|
return rule
|
||||||
}
|
}
|
||||||
|
|
||||||
function onClick(e: Event) {
|
|
||||||
const event = e as Event
|
|
||||||
const parent = document.getElementById(post.post.id.toString())
|
|
||||||
|
|
||||||
if (event.target == parent) {
|
|
||||||
goto(postLink(post.post))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
post: PostView
|
post: PostView
|
||||||
actions?: boolean
|
actions?: boolean
|
||||||
@@ -86,8 +76,6 @@
|
|||||||
This is the sole component for displaying posts.
|
This is the sole component for displaying posts.
|
||||||
It adapts to all kinds of form factors for different contexts, such as feeds, full post view, and crosspost list.
|
It adapts to all kinds of form factors for different contexts, such as feeds, full post view, and crosspost list.
|
||||||
-->
|
-->
|
||||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
||||||
<!-- svelte-ignore a11y_no_noninteractive_tabindex -->
|
|
||||||
<div
|
<div
|
||||||
class={[
|
class={[
|
||||||
'post relative max-w-full min-w-0 w-full cursor-pointer outline-hidden group',
|
'post relative max-w-full min-w-0 w-full cursor-pointer outline-hidden group',
|
||||||
@@ -97,13 +85,6 @@
|
|||||||
clazz,
|
clazz,
|
||||||
]}
|
]}
|
||||||
id={post.post.id.toString()}
|
id={post.post.id.toString()}
|
||||||
onclick={e => {
|
|
||||||
onClick(e)
|
|
||||||
}}
|
|
||||||
onkeydown={e => {
|
|
||||||
if (e.key == 'Enter') onClick(e)
|
|
||||||
}}
|
|
||||||
tabindex="0"
|
|
||||||
{style}
|
{style}
|
||||||
>
|
>
|
||||||
<PostMeta
|
<PostMeta
|
||||||
|
|||||||
@@ -186,7 +186,7 @@
|
|||||||
style={row < 7 ? `--anim-delay: ${row * 50}ms` : ''}
|
style={row < 7 ? `--anim-delay: ${row * 50}ms` : ''}
|
||||||
class={[
|
class={[
|
||||||
'relative post-container px-3 sm:px-6',
|
'relative post-container px-3 sm:px-6',
|
||||||
row < 7 && 'pop-in opacity-0',
|
row < 9 && 'pop-in opacity-0',
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<Post
|
<Post
|
||||||
@@ -219,12 +219,7 @@
|
|||||||
<Icon src={ExclamationTriangle} size="24" solid></Icon>
|
<Icon src={ExclamationTriangle} size="24" solid></Icon>
|
||||||
</div>
|
</div>
|
||||||
<pre class="py-0.5">{error}</pre>
|
<pre class="py-0.5">{error}</pre>
|
||||||
<Button
|
<Button color="primary" {loading} onclick={loadMore}>
|
||||||
color="primary"
|
|
||||||
{loading}
|
|
||||||
disabled={loading}
|
|
||||||
onclick={() => loadMore()}
|
|
||||||
>
|
|
||||||
{$t('message.retry')}
|
{$t('message.retry')}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
@@ -256,14 +251,7 @@
|
|||||||
</EndPlaceholder>
|
</EndPlaceholder>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
<InfiniteScroll
|
<InfiniteScroll window threshold={600} on:loadMore={loadMore} />
|
||||||
window
|
|
||||||
threshold={600}
|
|
||||||
on:loadMore={() => {
|
|
||||||
console.log('loadMore triggered')
|
|
||||||
loadMore()
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
{/if}
|
{/if}
|
||||||
{@render children?.()}
|
{@render children?.()}
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -1,16 +1,3 @@
|
|||||||
<script module lang="ts">
|
|
||||||
export type Origin = keyof typeof popoverOrigins
|
|
||||||
|
|
||||||
export const popoverOrigins = {
|
|
||||||
'top-right': 'bottom-full right-0 origin-bottom-right',
|
|
||||||
'bottom-left': 'top-full origin-top-left',
|
|
||||||
'top-left': 'bottom-full left-0 origin-bottom-left',
|
|
||||||
'bottom-right': 'top-full right-0 origin-top-right',
|
|
||||||
'top-center': 'bottom-full -left-[450%] origin-bottom',
|
|
||||||
'bottom-center': 'top-full -left-[450%] origin-top',
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {
|
import {
|
||||||
flip,
|
flip,
|
||||||
@@ -68,11 +55,7 @@
|
|||||||
middleware: middleware,
|
middleware: middleware,
|
||||||
})
|
})
|
||||||
|
|
||||||
const customFloatingContent = (node: HTMLDivElement) => {
|
const customFloatingContent = (node: HTMLDivElement) => floatingContent(node)
|
||||||
// if (!canUseContents) return
|
|
||||||
|
|
||||||
floatingContent(node)
|
|
||||||
}
|
|
||||||
|
|
||||||
const customFloatingRef = (node: HTMLDivElement) => {
|
const customFloatingRef = (node: HTMLDivElement) => {
|
||||||
const n = node.children.item(0)
|
const n = node.children.item(0)
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
import { browser } from '$app/environment'
|
import { browser } from '$app/environment'
|
||||||
import { navigating, page } from '$app/state'
|
import { navigating, page } from '$app/state'
|
||||||
import Moderation from '$lib/components/lemmy/moderation/Moderation.svelte'
|
import Moderation from '$lib/components/lemmy/moderation/Moderation.svelte'
|
||||||
import SiteCard from '$lib/components/lemmy/SiteCard.svelte'
|
|
||||||
import ExpandableImage from '$lib/components/ui/ExpandableImage.svelte'
|
import ExpandableImage from '$lib/components/ui/ExpandableImage.svelte'
|
||||||
import Shell from '$lib/components/ui/layout/Shell.svelte'
|
import Shell from '$lib/components/ui/layout/Shell.svelte'
|
||||||
import Navbar from '$lib/components/ui/navbar/Navbar.svelte'
|
import Navbar from '$lib/components/ui/navbar/Navbar.svelte'
|
||||||
@@ -139,12 +138,14 @@
|
|||||||
{@const SvelteComponent = page.data.slots.sidebar.component}
|
{@const SvelteComponent = page.data.slots.sidebar.component}
|
||||||
<SvelteComponent {...page.data.slots.sidebar.props} class="pt-0!" />
|
<SvelteComponent {...page.data.slots.sidebar.props} class="pt-0!" />
|
||||||
{:else if site.data}
|
{:else if site.data}
|
||||||
<SiteCard
|
{#await import('$lib/components/lemmy/SiteCard.svelte') then { default: SiteCard }}
|
||||||
site={site.data.site_view}
|
<SiteCard
|
||||||
taglines={site.data.taglines}
|
site={site.data.site_view}
|
||||||
admins={site.data.admins}
|
taglines={site.data.taglines}
|
||||||
version={site.data.version}
|
admins={site.data.admins}
|
||||||
/>
|
version={site.data.version}
|
||||||
|
/>
|
||||||
|
{/await}
|
||||||
{:else}
|
{:else}
|
||||||
<div class="h-64 w-full grid place-items-center">
|
<div class="h-64 w-full grid place-items-center">
|
||||||
<Spinner width={32} />
|
<Spinner width={32} />
|
||||||
|
|||||||
@@ -1,48 +0,0 @@
|
|||||||
<script lang="ts">
|
|
||||||
import { profile } from '$lib/auth.svelte'
|
|
||||||
import Portal from 'mono-svelte/popover/Portal.svelte'
|
|
||||||
import { onDestroy, onMount } from 'svelte'
|
|
||||||
|
|
||||||
let audio = $state<HTMLAudioElement>()
|
|
||||||
|
|
||||||
onMount(() => {
|
|
||||||
audio?.play()
|
|
||||||
|
|
||||||
document.body.style.rotate = `5deg`
|
|
||||||
document.body.style.transition = 'rotate 1s linear'
|
|
||||||
})
|
|
||||||
|
|
||||||
onDestroy(() => {
|
|
||||||
document.body.style.rotate = ''
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<audio bind:this={audio}>
|
|
||||||
<source src="/other/mc.mp3" type="audio/mpeg" />
|
|
||||||
</audio>
|
|
||||||
<Portal class="z-50 fixed inset-0">
|
|
||||||
<div
|
|
||||||
class="inset-0 bg-red-500/20 w-screen h-screen flex flex-col gap-4 items-center p-16 z-50"
|
|
||||||
style="rotate: -5deg; transition: rotate 1s linear;"
|
|
||||||
>
|
|
||||||
<div class="bg-black/20 font-mono fixed left-1/2 -translate-x-1/2">
|
|
||||||
<p>{profile.current.username ?? 'You'} was slain by Command Palette</p>
|
|
||||||
</div>
|
|
||||||
<img
|
|
||||||
src="/other/mc.png"
|
|
||||||
class="object-contain w-full h-full"
|
|
||||||
alt="Minecraft 'you died'"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</Portal>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
@font-face {
|
|
||||||
font-family: 'mc';
|
|
||||||
src: url('/other/mc.otf') format('opentype');
|
|
||||||
}
|
|
||||||
|
|
||||||
.main {
|
|
||||||
font-family: 'mc';
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 88 KiB |
Reference in new issue
Block a user