-
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: minor ui improvements * chore: formatted files
- Loading branch information
1 parent
fadab73
commit 8085f15
Showing
29 changed files
with
358 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<script lang="ts"> | ||
export let data: any; | ||
export let statesName; | ||
// https://images.metahub.space/poster/small/tt3083016/img | ||
const baseUrl = 'https://images.metahub.space/poster/small/'; | ||
const convertTo: Record<string, string> = { | ||
Movie: 'movie', | ||
Show: 'tv' | ||
}; | ||
</script> | ||
|
||
<a | ||
class="xl:w-1/7 group relative mb-2 flex w-1/2 flex-shrink-0 flex-col gap-2 rounded-lg p-[.5rem] sm:w-1/3 md:w-1/4 lg:w-1/6" | ||
href="/{convertTo[data.type]}/{data.imdb_id}" | ||
> | ||
<div class="relative aspect-[1/1.5] w-full overflow-hidden rounded-lg"> | ||
<span class="inline-block h-full w-full"> | ||
<img | ||
width="100%" | ||
alt={data.title} | ||
height="100%" | ||
src="{baseUrl}{data.imdb_id}/img" | ||
class="h-full w-full object-cover object-center transition-all duration-300 ease-in-out group-hover:scale-105" | ||
/> | ||
</span> | ||
<div | ||
class="absolute inset-0 z-10 flex h-full w-full flex-col justify-end gap-1 bg-gradient-to-t from-zinc-900 p-[.35rem] pb-2 tracking-wide lg:group-hover:opacity-100" | ||
> | ||
<div | ||
class="flex flex-wrap justify-center gap-1 text-xs font-normal tracking-wide text-gray-200 md:items-center 2xl:text-sm" | ||
> | ||
<span>{data.type}</span> | ||
• | ||
<span class="whitespace-nowrap"> | ||
<span>{data.state === 'PartiallyCompleted' ? 'Partial' : statesName[data.state]}</span> | ||
</span> | ||
</div> | ||
<div class="line-clamp-2 text-center text-sm font-medium leading-tight">{data.title}</div> | ||
</div> | ||
</div> | ||
</a> |
25 changes: 25 additions & 0 deletions
25
frontend/src/lib/components/ui/accordion/accordion-content.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<script lang="ts"> | ||
import { Accordion as AccordionPrimitive } from 'bits-ui'; | ||
import { slide } from 'svelte/transition'; | ||
import { cn } from '$lib/utils.js'; | ||
type $$Props = AccordionPrimitive.ContentProps; | ||
let className: $$Props['class'] = undefined; | ||
export let transition: $$Props['transition'] = slide; | ||
export let transitionConfig: $$Props['transitionConfig'] = { | ||
duration: 200 | ||
}; | ||
export { className as class }; | ||
</script> | ||
|
||
<AccordionPrimitive.Content | ||
class={cn('overflow-hidden text-sm transition-all', className)} | ||
{transition} | ||
{transitionConfig} | ||
{...$$restProps} | ||
> | ||
<div class="pb-4 pt-0"> | ||
<slot /> | ||
</div> | ||
</AccordionPrimitive.Content> |
14 changes: 14 additions & 0 deletions
14
frontend/src/lib/components/ui/accordion/accordion-item.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<script lang="ts"> | ||
import { Accordion as AccordionPrimitive } from 'bits-ui'; | ||
import { cn } from '$lib/utils.js'; | ||
type $$Props = AccordionPrimitive.ItemProps; | ||
let className: $$Props['class'] = undefined; | ||
export let value: $$Props['value']; | ||
export { className as class }; | ||
</script> | ||
|
||
<AccordionPrimitive.Item {value} class={cn('border-b', className)} {...$$restProps}> | ||
<slot /> | ||
</AccordionPrimitive.Item> |
26 changes: 26 additions & 0 deletions
26
frontend/src/lib/components/ui/accordion/accordion-trigger.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<script lang="ts"> | ||
import { Accordion as AccordionPrimitive } from 'bits-ui'; | ||
import ChevronDown from 'lucide-svelte/icons/chevron-down'; | ||
import { cn } from '$lib/utils.js'; | ||
type $$Props = AccordionPrimitive.TriggerProps; | ||
type $$Events = AccordionPrimitive.TriggerEvents; | ||
let className: $$Props['class'] = undefined; | ||
export let level: AccordionPrimitive.HeaderProps['level'] = 3; | ||
export { className as class }; | ||
</script> | ||
|
||
<AccordionPrimitive.Header {level} class="flex"> | ||
<AccordionPrimitive.Trigger | ||
class={cn( | ||
'flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180', | ||
className | ||
)} | ||
{...$$restProps} | ||
on:click | ||
> | ||
<slot /> | ||
<ChevronDown class="h-4 w-4 transition-transform duration-200" /> | ||
</AccordionPrimitive.Trigger> | ||
</AccordionPrimitive.Header> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { Accordion as AccordionPrimitive } from 'bits-ui'; | ||
import Content from './accordion-content.svelte'; | ||
import Item from './accordion-item.svelte'; | ||
import Trigger from './accordion-trigger.svelte'; | ||
const Root = AccordionPrimitive.Root; | ||
|
||
export { | ||
Root, | ||
Content, | ||
Item, | ||
Trigger, | ||
// | ||
Root as Accordion, | ||
Content as AccordionContent, | ||
Item as AccordionItem, | ||
Trigger as AccordionTrigger | ||
}; |
10 changes: 5 additions & 5 deletions
10
frontend/src/lib/components/ui/drawer/drawer-content.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
frontend/src/lib/components/ui/drawer/drawer-description.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
<script lang="ts"> | ||
import type { HTMLAttributes } from "svelte/elements"; | ||
import { cn } from "$lib/utils.js"; | ||
import type { HTMLAttributes } from 'svelte/elements'; | ||
import { cn } from '$lib/utils.js'; | ||
type $$Props = HTMLAttributes<HTMLDivElement> & { | ||
el?: HTMLDivElement; | ||
}; | ||
export let el: $$Props["el"] = undefined; | ||
let className: $$Props["class"] = undefined; | ||
export let el: $$Props['el'] = undefined; | ||
let className: $$Props['class'] = undefined; | ||
export { className as class }; | ||
</script> | ||
|
||
<div bind:this={el} class={cn("mt-auto flex flex-col gap-2 p-4", className)} {...$$restProps}> | ||
<div bind:this={el} class={cn('mt-auto flex flex-col gap-2 p-4', className)} {...$$restProps}> | ||
<slot /> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
frontend/src/lib/components/ui/drawer/drawer-overlay.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.