-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
98 additions
and
8 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
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,55 @@ | ||
<script lang="ts"> | ||
export let showModal:boolean = false; | ||
let dialog:HTMLDialogElement; | ||
$: if (dialog && showModal) dialog.showModal(); | ||
</script> | ||
|
||
<!-- svelte-ignore a11y-click-events-have-key-events a11y-no-noninteractive-element-interactions --> | ||
<dialog | ||
bind:this={dialog} | ||
on:close={() => (showModal = false)} | ||
on:click|self={() => dialog.close()} | ||
> | ||
<!-- svelte-ignore a11y-no-static-element-interactions --> | ||
<div on:click|stopPropagation> | ||
<slot /> | ||
</div> | ||
</dialog> | ||
|
||
<style> | ||
dialog { | ||
max-width: 32em; | ||
border: none; | ||
padding: 0; | ||
} | ||
dialog::backdrop { | ||
background: rgba(21, 18, 18, 0.9); | ||
} | ||
dialog[open] { | ||
animation: zoom 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); | ||
} | ||
@keyframes zoom { | ||
from { | ||
transform: scale(0.95); | ||
} | ||
to { | ||
transform: scale(1); | ||
} | ||
} | ||
dialog[open]::backdrop { | ||
animation: fade 0.2s ease-out; | ||
} | ||
@keyframes fade { | ||
from { | ||
opacity: 0; | ||
} | ||
to { | ||
opacity: 1; | ||
} | ||
} | ||
button { | ||
display: block; | ||
} | ||
</style> |
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,31 @@ | ||
<script lang="ts"> | ||
import type { ComponentProps} from 'svelte'; | ||
import { twMerge } from 'tailwind-merge'; | ||
import Frame from "../frame/frame.svelte"; | ||
import type {SizeType} from '$lib/types.js' | ||
import {sizes} from '$lib/constants.js'; | ||
import Modal from './imageModal.svelte'; | ||
let showModal = false; | ||
export let img: string | undefined = undefined; | ||
export let size: SizeType | 'none' = 'sm'; | ||
interface $$Props extends ComponentProps<Frame> { | ||
img?: string; | ||
padding?: SizeType | 'none'; | ||
size?: SizeType | 'none'; | ||
} | ||
let cardClass: string; | ||
$: cardClass = twMerge('flex w-full', sizes[size], 'flex-col', $$props.class); | ||
</script> | ||
|
||
<Frame tag="div" {...$$restProps} border shadow class={cardClass} on:click={() => (showModal = true)}> | ||
<img class="rounded-lg hover:cursor-pointer" src={img} alt="" /> | ||
</Frame> | ||
<Modal bind:showModal> | ||
<img class="" src={img} alt="" /> | ||
</Modal> |
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