From 1c5715369878393f76cdfd3bcfce5673e59fb1e1 Mon Sep 17 00:00:00 2001 From: codepert Date: Fri, 14 Jun 2024 02:05:11 +0900 Subject: [PATCH] #6 Add imagePost component. --- package.json | 1 + src/lib/card/Card.svelte | 7 ++- src/lib/frame/frame.svelte | 2 +- src/lib/imagePoster/imageModal.svelte | 55 ++++++++++++++++++++++++ src/lib/imagePoster/imagePoster.svelte | 31 +++++++++++++ src/lib/yutubePoster/yutubePoster.svelte | 2 - src/routes/+page.svelte | 3 +- yarn.lock | 5 +++ 8 files changed, 98 insertions(+), 8 deletions(-) create mode 100644 src/lib/imagePoster/imageModal.svelte create mode 100644 src/lib/imagePoster/imagePoster.svelte diff --git a/package.json b/package.json index 58d261c..7b9869e 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,7 @@ "dependencies": { "@stellar/stellar-sdk": "^12.0.1", "flowbite-svelte": "^0.46.1", + "svelte-modals": "^1.3.0", "tailwind-merge": "^2.3.0" } } diff --git a/src/lib/card/Card.svelte b/src/lib/card/Card.svelte index 77a9f27..6e38523 100644 --- a/src/lib/card/Card.svelte +++ b/src/lib/card/Card.svelte @@ -31,9 +31,8 @@ $: imgCls = twMerge(reverse ? 'rounded-b-lg' : 'rounded-t-lg', horizontal && 'object-cover w-full h-96 md:h-auto md:w-48 md:rounded-none', horizontal && (reverse ? 'md:rounded-e-lg' : 'md:rounded-s-lg'), imgClass); - - - {#if img} + + {#if img}
@@ -41,4 +40,4 @@ {:else} {/if} - + diff --git a/src/lib/frame/frame.svelte b/src/lib/frame/frame.svelte index e5f9c42..57d16df 100644 --- a/src/lib/frame/frame.svelte +++ b/src/lib/frame/frame.svelte @@ -135,7 +135,7 @@
- +
diff --git a/src/lib/imagePoster/imageModal.svelte b/src/lib/imagePoster/imageModal.svelte new file mode 100644 index 0000000..d429a0f --- /dev/null +++ b/src/lib/imagePoster/imageModal.svelte @@ -0,0 +1,55 @@ + + + + (showModal = false)} + on:click|self={() => dialog.close()} +> + +
+ +
+
+ + diff --git a/src/lib/imagePoster/imagePoster.svelte b/src/lib/imagePoster/imagePoster.svelte new file mode 100644 index 0000000..79a59ab --- /dev/null +++ b/src/lib/imagePoster/imagePoster.svelte @@ -0,0 +1,31 @@ + + + (showModal = true)}> + + + + + \ No newline at end of file diff --git a/src/lib/yutubePoster/yutubePoster.svelte b/src/lib/yutubePoster/yutubePoster.svelte index e7e9a09..8b96d19 100644 --- a/src/lib/yutubePoster/yutubePoster.svelte +++ b/src/lib/yutubePoster/yutubePoster.svelte @@ -6,8 +6,6 @@ import {sizes, paddings} from '$lib/constants.js'; import type {SizeType} from '$lib/types.js' - - export let padding: SizeType | 'none' = 'lg'; export let size: SizeType | 'none' = 'sm'; export let horizontal: boolean = false; diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 0bae694..386dce3 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -1,6 +1,7 @@