diff --git a/src/components/library/BodyBlog.svelte b/src/components/library/BodyBlog.svelte new file mode 100644 index 00000000..5dc34601 --- /dev/null +++ b/src/components/library/BodyBlog.svelte @@ -0,0 +1,196 @@ + + +
+
+

{post.title}

+

+ {post.description} +

+ + {#if post.cover} + {post.title} + {/if} + +
+
+ {post.author?.name} +
+

{post.author?.name}

+

{post.date}

+
+
+ + +
+ +
+ {@html parsedBody} +
+
+
+ + diff --git a/src/components/library/Share/CopyUrl.svelte b/src/components/library/Share/CopyUrl.svelte new file mode 100644 index 00000000..2ff1fcd7 --- /dev/null +++ b/src/components/library/Share/CopyUrl.svelte @@ -0,0 +1,24 @@ + + + + + diff --git a/src/components/library/Share/Facebook.svelte b/src/components/library/Share/Facebook.svelte new file mode 100644 index 00000000..8aaeca36 --- /dev/null +++ b/src/components/library/Share/Facebook.svelte @@ -0,0 +1,41 @@ + + + diff --git a/src/components/library/Share/Iframe.svelte b/src/components/library/Share/Iframe.svelte new file mode 100644 index 00000000..7a6c3040 --- /dev/null +++ b/src/components/library/Share/Iframe.svelte @@ -0,0 +1,85 @@ + + + + + +

{$t("project.share.iframe-modal.description")}

+ +
+
+ {#if !iframeLoaded} + + {/if} + +
+
+ +
+
+ + +
diff --git a/src/components/library/Share/ShareButton.svelte b/src/components/library/Share/ShareButton.svelte new file mode 100644 index 00000000..5d1977f4 --- /dev/null +++ b/src/components/library/Share/ShareButton.svelte @@ -0,0 +1,60 @@ + + + + + +

{modalDescription}

+ +
+ + + + {#if variant === "project"} + `; - - let { project }: { project: Project } = $props(); - - let currentUrl = $state(""); - let fbShareUrl = $state(""); - let openModal = $state(false); - let iframeModal = $state(false); - let iframeLoaded = $state(false); - let copied = $state(false); - - let fbWindow: Window | null = null; - - function openFbPopup() { - const width = 626; - const height = 436; - const left = window.screenX + (window.innerWidth - width) / 2; - const top = window.screenY + (window.innerHeight - height) / 2; - - if (fbWindow && !fbWindow.closed) { - fbWindow.close(); - } - - fbWindow = window.open( - fbShareUrl, - "facebook-share-dialog", - `width=${width},height=${height},top=${top},left=${left}`, - ); - } - - $effect(() => { - if (iframeModal) { - iframeLoaded = false; - } - }); - - onMount(() => { - currentUrl = encodeURIComponent(window.location.href); - // currentUrl = encodeURIComponent("https://developers.facebook.com/docs/"); - fbShareUrl = `https://www.facebook.com/dialog/share?app_id=${appId}&display=popup&href=${currentUrl}&redirect_uri=${currentUrl}`; - }); - - - - - -

{$t("project.share.modal.description")}

- -
- - - - - - - - - - - -
-
- - -

{$t("project.share.iframe-modal.description")}

- -
-
- {#if !iframeLoaded} - - {/if} - -
-
- -
-
- - -
diff --git a/src/components/project/SingleProject.svelte b/src/components/project/SingleProject.svelte index 18336b35..05e2ae8e 100644 --- a/src/components/project/SingleProject.svelte +++ b/src/components/project/SingleProject.svelte @@ -1,7 +1,6 @@