my website at ewancroft.uk
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

remove Reddit and Facebook icons

Ewan Croft 1f582f6a add22568

+2 -81
-2
src/lib/components/icons/index.ts
··· 1 1 export { default as BlueskyIcon } from "./social/BlueskyIcon.svelte"; 2 - export { default as FacebookIcon } from "./social/FacebookIcon.svelte"; 3 2 export { default as MastodonIcon } from './social/MastodonIcon.svelte'; 4 - export { default as RedditIcon } from './social/RedditIcon.svelte'; 5 3 export { default as RssIcon } from './social/RssIcon.svelte'; 6 4 export { default as AtomIcon } from "./social/AtomIcon.svelte"; 7 5 export { default as ShareIcons } from './social/ShareIcons.svelte';
-17
src/lib/components/icons/social/FacebookIcon.svelte
··· 1 - <script> 2 - export let size = "18"; 3 - export let fill = "currentColor"; 4 - </script> 5 - 6 - <svg 7 - role="img" 8 - viewBox="0 0 24 24" 9 - xmlns="http://www.w3.org/2000/svg" 10 - width={size} 11 - height={size} 12 - {fill} 13 - > 14 - <path 15 - d="M9.101 23.691v-7.98H6.627v-3.667h2.474v-1.58c0-4.085 1.848-5.978 5.858-5.978.401 0 .955.042 1.468.103a8.68 8.68 0 0 1 1.141.195v3.325a8.623 8.623 0 0 0-.653-.036 26.805 26.805 0 0 0-.733-.009c-.707 0-1.259.096-1.675.309a1.686 1.686 0 0 0-.679.622c-.258.42-.374.995-.374 1.752v1.297h3.919l-.386 2.103-.287 1.564h-3.246v8.245C19.396 23.238 24 18.179 24 12.044c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.628 3.874 10.35 9.101 11.647Z" 16 - /> 17 - </svg>
-17
src/lib/components/icons/social/RedditIcon.svelte
··· 1 - <script> 2 - export let size = "18"; 3 - export let fill = "currentColor"; 4 - </script> 5 - 6 - <svg 7 - role="img" 8 - viewBox="0 0 24 24" 9 - xmlns="http://www.w3.org/2000/svg" 10 - width={size} 11 - height={size} 12 - {fill} 13 - > 14 - <path 15 - d="M12 0C5.373 0 0 5.373 0 12c0 3.314 1.343 6.314 3.515 8.485l-2.286 2.286C.775 23.225 1.097 24 1.738 24H12c6.627 0 12-5.373 12-12S18.627 0 12 0Zm4.388 3.199c1.104 0 1.999.895 1.999 1.999 0 1.105-.895 2-1.999 2-.946 0-1.739-.657-1.947-1.539v.002c-1.147.162-2.032 1.15-2.032 2.341v.007c1.776.067 3.4.567 4.686 1.363.473-.363 1.064-.58 1.707-.58 1.547 0 2.802 1.254 2.802 2.802 0 1.117-.655 2.081-1.601 2.531-.088 3.256-3.637 5.876-7.997 5.876-4.361 0-7.905-2.617-7.998-5.87-.954-.447-1.614-1.415-1.614-2.538 0-1.548 1.255-2.802 2.803-2.802.645 0 1.239.218 1.712.585 1.275-.79 2.881-1.291 4.64-1.365v-.01c0-1.663 1.263-3.034 2.88-3.207.188-.911.993-1.595 1.959-1.595Zm-8.085 8.376c-.784 0-1.459.78-1.506 1.797-.047 1.016.64 1.429 1.426 1.429.786 0 1.371-.369 1.418-1.385.047-1.017-.553-1.841-1.338-1.841Zm7.406 0c-.786 0-1.385.824-1.338 1.841.047 1.017.634 1.385 1.418 1.385.785 0 1.473-.413 1.426-1.429-.046-1.017-.721-1.797-1.506-1.797Zm-3.703 4.013c-.974 0-1.907.048-2.77.135-.147.015-.241.168-.183.305.483 1.154 1.622 1.964 2.953 1.964 1.33 0 2.47-.81 2.953-1.964.057-.137-.037-.29-.184-.305-.863-.087-1.795-.135-2.769-.135Z" 16 - /> 17 - </svg>
+2 -45
src/lib/components/icons/social/ShareIcons.svelte
··· 4 4 import { env } from '$env/dynamic/public'; 5 5 6 6 // Icons 7 - import { BlueskyIcon, FacebookIcon, RedditIcon, MastodonIcon, CopyLinkIcon } from "$components/icons"; 7 + import { BlueskyIcon, MastodonIcon, CopyLinkIcon } from "$components/icons"; 8 8 9 9 // Props 10 10 export let title: string; ··· 32 32 ? `${title} by ${mastodonUserTag} - ${$page.url.href}` 33 33 : `${title} by ${mastodonUserTag} - ${$page.url.href}` 34 34 : `${title} - ${$page.url.href}`; 35 - $: facebookShareText = `${title} - ${$page.url.href}`; 36 - $: redditShareText = `${title} - ${$page.url.href}`; 37 35 38 36 // Truncate for character limits 39 37 $: truncatedBlueskyText = ··· 45 43 (mastodonShareText.length > 500 46 44 ? mastodonShareText.substring(0, 497) + "..." 47 45 : mastodonShareText); 48 - $: truncatedFacebookText = 49 - facebookShareText.length > 280 50 - ? facebookShareText.substring(0, 277) + "..." 51 - : facebookShareText; 52 - $: truncatedRedditText = 53 - redditShareText.length > 300 54 - ? redditShareText.substring(0, 297) + "..." 55 - : redditShareText; 46 + 56 47 57 48 // Encode the share texts for use in URLs 58 49 $: encodedBlueskyText = encodeURIComponent(truncatedBlueskyText); 59 50 $: encodedMastodonText = 60 51 mastodonShareText && encodeURIComponent(truncatedMastodonText); 61 - $: encodedFacebookText = encodeURIComponent(truncatedFacebookText); 62 - $: encodedRedditText = encodeURIComponent(truncatedRedditText); 63 52 64 53 // Construct the Bluesky share URL 65 54 $: blueskyShareUrl = `https://bsky.app/intent/compose?text=${encodedBlueskyText}`; 66 - 67 - // Construct the Reddit share URL 68 - $: redditShareUrl = `https://www.reddit.com/submit?url=${encodeURIComponent($page.url.href)}&title=${encodedRedditText}`; 69 - 70 - // Construct the Facebook share URL 71 - $: facebookShareUrl = `https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent($page.url.href)}&quote=${encodedFacebookText}`; 72 55 73 56 // Construct the Mastodon share URL 74 57 $: mastodonShareUrl = ··· 121 104 title="Share on Bluesky" 122 105 > 123 106 <BlueskyIcon /> 124 - </a> 125 - 126 - <!-- Facebook Share Button --> 127 - <a 128 - href={facebookShareUrl} 129 - target="_blank" 130 - rel="noopener noreferrer" 131 - class="icon-button p-2 rounded-full transition-all duration-300 hover:scale-110" 132 - style="background-color: var(--card-bg);" 133 - aria-label="Share on Facebook" 134 - title="Share on Facebook" 135 - > 136 - <FacebookIcon /> 137 - </a> 138 - 139 - <!-- Reddit Share Button --> 140 - <a 141 - href={redditShareUrl} 142 - target="_blank" 143 - rel="noopener noreferrer" 144 - class="icon-button p-2 rounded-full transition-all duration-300 hover:scale-110" 145 - style="background-color: var(--card-bg);" 146 - aria-label="Share on Reddit" 147 - title="Share on Reddit" 148 - > 149 - <RedditIcon /> 150 107 </a> 151 108 152 109 {#if env.PUBLIC_ACTIVITYPUB_USER && env.PUBLIC_ACTIVITYPUB_USER.length > 0}