impr: use Fixate component

This commit is contained in:
James Xylight committed 2025-08-30 15:11:35 -07:00
1 parent d93d29a8b1
commit e4c8d667f7
23 files changed
+66 -63

No files matched your search

@@ -14,7 +14,6 @@
listing_type?: ListingType
showWhenEmpty?: boolean
placeholder?: string
// eslint-disable-next-line
onselect?: (item: any) => void
}
@@ -22,8 +22,6 @@
Sun,
Trophy,
} from 'svelte-hero-icons'
import { backOut } from 'svelte/easing'
import { fly } from 'svelte/transition'
interface Props extends SelectProps<string> {
selected: string
@@ -36,7 +36,6 @@
marked.use(linkify, {
extensions: [
// @ts-expect-error hell with marked
// eslint-disable-next-line
containerExtension((params: any) => {
if (params.type == 'spoiler') {
return {
@@ -49,7 +48,6 @@
return null
}),
// @ts-expect-error hell with marked
// eslint-disable-next-line
subSupscriptExtension((params: any) => {
if (params.type == 'subscript') {
return {
-1
View File
@@ -28,7 +28,6 @@
{#if icon}
<div
class={[
,
iconClass
? iconClass
: 'bg-slate-100 dark:bg-zinc-900 p-3 rounded-2xl text-primary-900 dark:text-primary-100',
@@ -0,0 +1,19 @@
<script lang="ts">
import type { Snippet } from 'svelte'
const placements = {
top: 'top-6 lg:top-22',
bottom: 'bottom-22 lg:bottom-6',
}
interface Props {
placement: keyof typeof placements
children?: Snippet
}
let { placement, children }: Props = $props()
</script>
<div class={['sticky z-30 mb-0', placements[placement]]}>
{@render children?.()}
</div>
+1 -1
View File
@@ -40,7 +40,7 @@
class={[
'fixed lg:sticky bottom-0 lg:top-0',
!dockVisible && 'max-lg:-bottom-24',
'max-w-3xl p-4 left-1/2 -translate-x-1/2 lg:max-w-full lg:p-0 lg:left-0 lg:translate-x-0',
'max-w-3xl p-3 left-1/2 -translate-x-1/2 lg:max-w-full lg:p-0 lg:left-0 lg:translate-x-0',
'w-full z-50 pointer-events-none',
]}
style="transition: bottom .4s cubic-bezier(0.075, 0.82, 0.165, 1);"
@@ -56,7 +56,7 @@
{#snippet prefix()}
<div class={(icon || customIcon) && adaptive ? 'lg:hidden' : ''}>
{#if icon}
<Icon src={icon} size="18" micro />
<Icon src={icon} size="20" mini />
{:else}
{@render customIcon?.({ size: 16, isSelected })}
{/if}
@@ -42,7 +42,6 @@
const debounce = (fn: Function, ms = 300) => {
let timeoutId: ReturnType<typeof setTimeout>
// eslint-disable-next-line
return function (this: any, ...args: any[]) {
clearTimeout(timeoutId)
timeoutId = setTimeout(() => fn.apply(this, args), ms)
@@ -3,7 +3,6 @@
import { Modal } from 'mono-svelte'
interface Props {
// eslint-disable-next-line
object: any
open?: boolean
title?: import('svelte').Snippet
@@ -1,7 +1,6 @@
<script lang="ts">
import DebugTree from './DebugTree.svelte'
interface Props {
// eslint-disable-next-line
object: any
isParent?: boolean
}
+1 -1
View File
@@ -127,7 +127,7 @@ export const aliases = new Map([
])
export const { t, locale, locales, loading, loadTranslations } = new i18n<
Parser.Params<any, object>, // eslint-disable-line
Parser.Params<any, object>,
object,
object
>(config)
-1
View File
@@ -14,7 +14,6 @@ export function errorMessage(error: any, instance?: string): string {
return t.get(`error.${error}`)
} catch {
// eslint-disable-next-line
return error as any
}
}
-1
View File
@@ -1,6 +1,5 @@
export const debounce = (fn: Function, ms = 300) => {
let timeoutId: ReturnType<typeof setTimeout>
// eslint-disable-next-line
return function (this: any, ...args: any[]) {
clearTimeout(timeoutId)
timeoutId = setTimeout(() => fn.apply(this, args), ms)