diff --git a/src/assets/main.css b/src/assets/main.css index 6be1eab..d2cb3f4 100644 --- a/src/assets/main.css +++ b/src/assets/main.css @@ -8,6 +8,21 @@ font-display: swap; } +::-webkit-scrollbar { + width: 0.5rem; + height: 6px; + background: transparent; +} + +::-webkit-scrollbar-thumb { + background: hsla(var(--overlay1) / 1); + border-radius: 3px; +} + +::-webkit-scrollbar-track { + background: transparent; +} + *, *::before, *::after { @@ -16,6 +31,9 @@ padding: 0; font-weight: normal; + scrollbar-width: thin; + scrollbar-color: hsla(var(--overlay1) / 1) transparent; + --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1); -webkit-tap-highlight-color: transparent; outline: 2px solid transparent; diff --git a/src/components/Feed/Embeds/ImageEmbed.vue b/src/components/Feed/Embeds/ImageEmbed.vue index a517665..4369861 100644 --- a/src/components/Feed/Embeds/ImageEmbed.vue +++ b/src/components/Feed/Embeds/ImageEmbed.vue @@ -8,7 +8,6 @@ const props = defineProps<{ const imageCount = computed(() => props.embed.images.length) -// TODO)) lightbox. const lightboxOpen = ref(false) const activeImageIndex = ref(0) @@ -16,111 +15,120 @@ const openLightbox = (index: number) => { activeImageIndex.value = index lightboxOpen.value = true } + +const getImageStyle = (image: AppBskyEmbedImages.ViewImage) => { + if (image.aspectRatio) { + return { + aspectRatio: `${image.aspectRatio.width} / ${image.aspectRatio.height}`, + } + } + return {} +} diff --git a/src/components/Feed/FeedItem.vue b/src/components/Feed/FeedItem.vue index 8f09e1e..d32bcb4 100644 --- a/src/components/Feed/FeedItem.vue +++ b/src/components/Feed/FeedItem.vue @@ -8,10 +8,13 @@ import { IconFavoriteOutlineRounded, IconFavoriteRounded, IconMoreVert, - IconSendRounded, IconBookmarkRounded, IconBookmarkAddedRounded, IconFormatQuoteRounded, + IconContentCopyRounded, + IconLinkRounded, + IconOpenInNewRounded, + IconForwardRounded, } from '@iconify-prerendered/vue-material-symbols' import { useNavigationStore } from '@/stores/navigation' @@ -108,6 +111,72 @@ const handleBookmark = () => { } } +const handleShare = () => { + if (displayPost.value) { + const url = `${window.location.origin}/profile/${displayPost.value.author.handle}/post/${rkey.value}` + if (navigator.share) { + navigator + .share({ + title: 'Check out this post on Bluesky', + url, + }) + .then(() => tap()) + .catch((error) => console.error('Error sharing', error)) + return + } + tap() + } +} + +const share = { + systemShare: () => { + if (displayPost.value) { + const url = `${window.location.origin}/profile/${displayPost.value.author.handle}/post/${rkey.value}` + if (navigator.share) { + navigator + .share({ + title: 'Check out this post on Bluesky', + url, + }) + .then(() => tap()) + .catch((error) => console.error('Error sharing', error)) + } + } + }, + copyLink: () => { + if (displayPost.value) { + const url = `${window.location.origin}/profile/${displayPost.value.author.handle}/post/${rkey.value}` + navigator.clipboard.writeText(url) + tap() + } + }, + copyBlueskyLink: () => { + if (displayPost.value) { + const bskyUrl = `https://bsky.app/profile/${displayPost.value.author.did}/post/${rkey.value}` + navigator.clipboard.writeText(bskyUrl) + tap() + } + }, + copyATUri: () => { + if (displayPost.value) { + navigator.clipboard.writeText(displayPost.value.uri) + tap() + } + }, + copyDid: () => { + if (displayPost.value) { + navigator.clipboard.writeText(displayPost.value.author.did) + tap() + } + }, + openInPDSls: () => { + if (displayPost.value) { + const url = `https://pds.ls/${displayPost.value.uri}` + window.open(url, '_blank') + } + }, +} + const handleClick = (e: MouseEvent) => { if (window.getSelection()?.toString().length) return if (props.rootPost) return @@ -207,166 +276,207 @@ onUnmounted(() => {
- - avatar -
-
- -
-
-
- - {{ displayPost.author.displayName || displayPost.author.handle }} - - -

- {{ displayPost.author.pronouns }} -

-
-
-

- {{ formatTime(displayPost.indexedAt) }} -

+
+ + avatar +
+
+ +
+
+
+ + {{ displayPost.author.displayName || displayPost.author.handle }} + + +

+ {{ displayPost.author.pronouns }} +

+
+
+

+ {{ formatTime(displayPost.indexedAt) }} +

+
-
-
- {{ displayPost.record.text }} +
+
+ {{ displayPost.record.text }} +
+
+
-
- - + + + + + +
- @@ -375,10 +485,11 @@ onUnmounted(() => {