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">
|
||||
import { goto } from '$app/navigation'
|
||||
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 PostMediaCompact from '$lib/components/lemmy/post/media/PostMediaCompact.svelte'
|
||||
import PostActions from '$lib/components/lemmy/post/PostActions.svelte'
|
||||
@@ -28,15 +27,6 @@
|
||||
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 {
|
||||
post: PostView
|
||||
actions?: boolean
|
||||
@@ -86,8 +76,6 @@
|
||||
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.
|
||||
-->
|
||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
||||
<!-- svelte-ignore a11y_no_noninteractive_tabindex -->
|
||||
<div
|
||||
class={[
|
||||
'post relative max-w-full min-w-0 w-full cursor-pointer outline-hidden group',
|
||||
@@ -97,13 +85,6 @@
|
||||
clazz,
|
||||
]}
|
||||
id={post.post.id.toString()}
|
||||
onclick={e => {
|
||||
onClick(e)
|
||||
}}
|
||||
onkeydown={e => {
|
||||
if (e.key == 'Enter') onClick(e)
|
||||
}}
|
||||
tabindex="0"
|
||||
{style}
|
||||
>
|
||||
<PostMeta
|
||||
|
||||
@@ -186,7 +186,7 @@
|
||||
style={row < 7 ? `--anim-delay: ${row * 50}ms` : ''}
|
||||
class={[
|
||||
'relative post-container px-3 sm:px-6',
|
||||
row < 7 && 'pop-in opacity-0',
|
||||
row < 9 && 'pop-in opacity-0',
|
||||
]}
|
||||
>
|
||||
<Post
|
||||
@@ -219,12 +219,7 @@
|
||||
<Icon src={ExclamationTriangle} size="24" solid></Icon>
|
||||
</div>
|
||||
<pre class="py-0.5">{error}</pre>
|
||||
<Button
|
||||
color="primary"
|
||||
{loading}
|
||||
disabled={loading}
|
||||
onclick={() => loadMore()}
|
||||
>
|
||||
<Button color="primary" {loading} onclick={loadMore}>
|
||||
{$t('message.retry')}
|
||||
</Button>
|
||||
</div>
|
||||
@@ -256,14 +251,7 @@
|
||||
</EndPlaceholder>
|
||||
</div>
|
||||
{/if}
|
||||
<InfiniteScroll
|
||||
window
|
||||
threshold={600}
|
||||
on:loadMore={() => {
|
||||
console.log('loadMore triggered')
|
||||
loadMore()
|
||||
}}
|
||||
/>
|
||||
<InfiniteScroll window threshold={600} on:loadMore={loadMore} />
|
||||
{/if}
|
||||
{@render children?.()}
|
||||
</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">
|
||||
import {
|
||||
flip,
|
||||
@@ -68,11 +55,7 @@
|
||||
middleware: middleware,
|
||||
})
|
||||
|
||||
const customFloatingContent = (node: HTMLDivElement) => {
|
||||
// if (!canUseContents) return
|
||||
|
||||
floatingContent(node)
|
||||
}
|
||||
const customFloatingContent = (node: HTMLDivElement) => floatingContent(node)
|
||||
|
||||
const customFloatingRef = (node: HTMLDivElement) => {
|
||||
const n = node.children.item(0)
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
import { browser } from '$app/environment'
|
||||
import { navigating, page } from '$app/state'
|
||||
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 Shell from '$lib/components/ui/layout/Shell.svelte'
|
||||
import Navbar from '$lib/components/ui/navbar/Navbar.svelte'
|
||||
@@ -139,12 +138,14 @@
|
||||
{@const SvelteComponent = page.data.slots.sidebar.component}
|
||||
<SvelteComponent {...page.data.slots.sidebar.props} class="pt-0!" />
|
||||
{:else if site.data}
|
||||
<SiteCard
|
||||
site={site.data.site_view}
|
||||
taglines={site.data.taglines}
|
||||
admins={site.data.admins}
|
||||
version={site.data.version}
|
||||
/>
|
||||
{#await import('$lib/components/lemmy/SiteCard.svelte') then { default: SiteCard }}
|
||||
<SiteCard
|
||||
site={site.data.site_view}
|
||||
taglines={site.data.taglines}
|
||||
admins={site.data.admins}
|
||||
version={site.data.version}
|
||||
/>
|
||||
{/await}
|
||||
{:else}
|
||||
<div class="h-64 w-full grid place-items-center">
|
||||
<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