This commit is contained in:
Jon Staab
2024-10-17 16:03:50 -07:00
parent 2f561149fa
commit fd5b0a9af3
33 changed files with 129 additions and 140 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
<script lang="ts">
import {sleep} from '@welshman/lib'
import {sleep} from "@welshman/lib"
export let delay = 1
</script>
+4 -3
View File
@@ -1,11 +1,12 @@
<script lang="ts">
import {noop} from '@welshman/lib'
import {noop} from "@welshman/lib"
import {fade, fly} from "@lib/transition"
export let onClose: any = noop
export let fullscreen = false
$: extraClass = !fullscreen && "card2 bg-alt max-h-[90vh] w-[90vw] overflow-auto text-base-content sm:w-[520px]"
$: extraClass =
!fullscreen && "card2 bg-alt max-h-[90vh] w-[90vw] overflow-auto text-base-content sm:w-[520px]"
</script>
<div class="center fixed inset-0 z-modal">
@@ -13,7 +14,7 @@
class="absolute inset-0 cursor-pointer bg-black opacity-75"
transition:fade={{duration: 300}}
on:click={onClose} />
<div class="relative scroll-container {extraClass}" transition:fly={{duration: 300}}>
<div class="scroll-container relative {extraClass}" transition:fly={{duration: 300}}>
<slot />
</div>
</div>
+1 -1
View File
@@ -1,3 +1,3 @@
<div class="max-h-screen flex-grow overflow-auto bg-base-200 pb-14 sm:pb-0 scroll-container">
<div class="scroll-container max-h-screen flex-grow overflow-auto bg-base-200 pb-14 sm:pb-0">
<slot />
</div>
+1 -1
View File
@@ -22,7 +22,7 @@
popover = tippy(element, {
content: target,
animation: "shift-away",
appendTo: document.querySelector('.tippy-target')!,
appendTo: document.querySelector(".tippy-target")!,
...params,
})
-2
View File
@@ -10,8 +10,6 @@
} from "@welshman/app"
import Avatar from "@lib/components/Avatar.svelte"
import WotScore from "@lib/components/WotScore.svelte"
import ProfileDetail from "@app/components/ProfileDetail.svelte"
import {pushDrawer} from "@app/modal"
export let value
+1 -1
View File
@@ -34,7 +34,7 @@ export const createScroller = ({
let done = false
const check = async () => {
const container = element.closest('.scroll-container')
const container = element.closest(".scroll-container")
if (container) {
// While we have empty space, fill it
+7 -6
View File
@@ -9,8 +9,8 @@ export const fly = (node: Element, params?: FlyParams | undefined) =>
baseFly(node, {y: 20, ...params})
export type TranslateParams = {
delay?: number,
duration?: number,
delay?: number
duration?: number
easing?: (t: number) => number
axis?: "x" | "y"
reverse?: boolean
@@ -18,7 +18,7 @@ export type TranslateParams = {
export const translate = (
node: Element,
{delay = 0, duration = 400, easing = cubicOut, axis = "y", reverse = false}: TranslateParams = {}
{delay = 0, duration = 400, easing = cubicOut, axis = "y", reverse = false}: TranslateParams = {},
) => {
return {
delay,
@@ -32,7 +32,7 @@ export const translate = (
} else {
return `transform: translateY(${p})`
}
}
},
}
}
@@ -75,5 +75,6 @@ export function slideAndFade(
}
}
export const conditionalTransition = (condition: any, transition: any) =>
(node: any, args?: any) => condition ? transtion(node, args) : null
export const conditionalTransition =
(condition: any, transition: any) => (node: any, args?: any) =>
condition ? transtion(node, args) : null