Bluesky app fork with some witchin' additions 馃挮
0
fork

Configure Feed

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

[APP-2065] yassify app embed (#10210)

authored by

Spence Pope and committed by
GitHub
13b453e5 d8fdfddb

+82 -84
+9 -9
bskyembed/assets/logo_full_name.svg
··· 1 - <svg width="105" height="32" viewBox="0 0 105 32" fill="none" xmlns="http://www.w3.org/2000/svg"> 2 - <path d="M19.7901 9.77492C21.7947 11.2889 23.9508 14.3587 24.7425 16.0059C25.5342 14.3587 27.6903 11.2889 29.6949 9.77492C31.1413 8.68251 33.485 7.83725 33.485 10.5269C33.485 11.064 33.1789 15.0393 32.9993 15.6848C32.3752 17.9285 30.1009 18.5008 28.0778 18.1544C31.6141 18.7598 32.5136 20.7653 30.5709 22.7708C26.1996 27.2831 24.7425 20.3569 24.7425 20.3569C24.7425 20.3569 23.2854 27.2831 18.9142 22.7708C16.9714 20.7653 17.871 18.7598 21.4072 18.1544C19.3841 18.5008 17.1099 17.9285 16.4857 15.6848C16.3061 15.0393 16 11.064 16 10.5269C16 7.83725 18.3437 8.68251 19.7901 9.77492Z" fill="white"/> 3 - <path d="M44.3863 16.3646C45.5901 16.7932 46.2292 17.7837 46.2292 18.8924C46.2292 20.7698 44.9659 21.908 42.5434 21.908H37.5942V11.3828H42.3799C44.6835 11.3828 45.7982 12.5506 45.7982 14.1028C45.7982 15.1376 45.3226 15.8915 44.3863 16.3646ZM42.2313 13.0237H39.6006V15.7732H42.2313C43.2568 15.7732 43.8067 15.2411 43.8067 14.3541C43.8067 13.5411 43.2419 13.0237 42.2313 13.0237ZM39.6006 20.2524H42.4393C43.5689 20.2524 44.1782 19.735 44.1782 18.8037C44.1782 17.828 43.5986 17.3402 42.4393 17.3402H39.6006V20.2524Z" fill="white"/> 4 - <path d="M49.0111 21.908H47.1385V11.3828H49.0111V21.908Z" fill="white"/> 5 - <path d="M55.2202 18.5524V14.2802H57.0929V21.908H55.2797V20.7993C54.7 21.6567 53.8975 22.0854 52.872 22.0854C51.252 22.0854 50.1968 21.1098 50.1968 19.3359V14.2802H52.0694V19.0254C52.0694 19.9863 52.545 20.4741 53.5111 20.4741C54.4177 20.4741 55.2202 19.8089 55.2202 18.5524Z" fill="white"/> 6 - <path d="M65.6167 18.2272V18.6706H59.8799C60.0137 19.9863 60.7419 20.6367 61.8714 20.6367C62.7334 20.6367 63.3131 20.2672 63.6252 19.5428H65.4235C65.0222 21.095 63.6846 22.0854 61.8566 22.0854C60.7122 22.0854 59.7907 21.7159 59.0922 20.9915C58.3937 20.2672 58.037 19.3063 58.037 18.0941C58.037 16.8967 58.3788 15.9359 59.0773 15.1967C59.7759 14.4724 60.6825 14.1028 61.8269 14.1028C62.9861 14.1028 63.9076 14.4872 64.5912 15.2411C65.2749 15.995 65.6167 17.0002 65.6167 18.2272ZM61.812 15.5515C60.7865 15.5515 60.0731 16.1428 59.8948 17.3698H63.7441C63.5806 16.2611 62.8969 15.5515 61.812 15.5515Z" fill="white"/> 7 - <path d="M69.7673 22.115C67.5379 22.115 66.3638 21.2428 66.2598 19.4837H68.0878C68.1918 20.4298 68.6674 20.7846 69.797 20.7846C70.8076 20.7846 71.3129 20.4741 71.3129 19.868C71.3129 19.3211 70.9562 19.055 69.8118 18.8628L68.935 18.715C67.2555 18.4341 66.4232 17.6654 66.4232 16.4089C66.4232 14.975 67.5676 14.1028 69.6038 14.1028C71.7885 14.1028 72.9181 14.9602 72.9924 16.6898H71.2238C71.1792 15.7585 70.6293 15.4332 69.6038 15.4332C68.712 15.4332 68.2662 15.7289 68.2662 16.3202C68.2662 16.8524 68.6526 17.0889 69.5443 17.2515L70.5104 17.3993C72.3681 17.7393 73.1707 18.4193 73.1707 19.7202C73.1707 21.2576 71.9223 22.115 69.7673 22.115Z" fill="white"/> 8 - <path d="M81.3899 21.908H79.2497L77.0204 18.3602L75.8611 19.5132V21.908H74.0182V11.3828H75.8611V17.4437L78.9822 14.2802H81.2116L78.3134 17.1628L81.3899 21.908Z" fill="white"/> 9 - <path d="M86.2805 16.2019L86.9047 14.2802H88.8665L85.909 22.5289C85.5968 23.3715 85.2104 23.9776 84.72 24.3176C84.2295 24.6576 83.531 24.8202 82.6095 24.8202C82.2974 24.8202 82.0299 24.8054 81.7921 24.7759V23.3124H82.5055C83.3526 23.3124 83.7688 22.795 83.7688 22.0854C83.7688 21.7306 83.6499 21.2132 83.4121 20.548L81.1827 14.2802H83.204L83.8282 16.1872C84.289 17.6211 84.6902 19.0402 85.0469 20.4446C85.3739 19.2324 85.7901 17.8132 86.2805 16.2019Z" fill="white"/> 1 + <svg width="120" height="28" viewBox="0 0 120 28" fill="none" xmlns="http://www.w3.org/2000/svg"> 2 + <path d="M6.23031 1.75921C9.52558 4.31406 13.0698 9.49434 14.3713 12.2741C15.6727 9.49434 19.2169 4.31406 22.5122 1.75921C24.8899 -0.0842317 28.7425 -1.5106 28.7425 3.02818C28.7425 3.93462 28.2393 10.6429 27.9441 11.7321C26.9181 15.5183 23.1796 16.4841 19.8539 15.8995C25.667 16.9212 27.1457 20.3055 23.9521 23.6897C16.7665 31.3043 14.3713 19.6163 14.3713 19.6163C14.3713 19.6163 11.976 31.3043 4.79042 23.6897C1.59681 20.3055 3.07554 16.9212 8.88858 15.8995C5.56292 16.4841 1.82441 15.5183 0.798403 11.7321C0.503259 10.6429 0 3.93462 0 3.02818C0 -1.5106 3.85263 -0.0842317 6.23031 1.75921Z" fill="#006AFF"/> 3 + <path d="M46.662 12.8778C48.641 13.6012 49.6915 15.2726 49.6915 17.1435C49.6915 20.3116 47.6149 22.2324 43.6326 22.2324H35.497V4.47113H43.3638C47.1507 4.47113 48.983 6.44184 48.983 9.06113C48.983 10.8073 48.2012 12.0796 46.662 12.8778ZM43.1195 7.2401H38.7952V11.88H43.1195C44.8053 11.88 45.7092 10.9819 45.7092 9.48521C45.7092 8.1132 44.7808 7.2401 43.1195 7.2401ZM38.7952 19.4385H43.4616C45.3183 19.4385 46.32 18.5654 46.32 16.9938C46.32 15.3474 45.3672 14.5242 43.4616 14.5242H38.7952V19.4385Z" fill="#006AFF"/> 4 + <path d="M54.2645 22.2324H51.1862V4.47113H54.2645V22.2324Z" fill="#006AFF"/> 5 + <path d="M64.4712 16.5698V9.36048H67.5495V22.2324H64.5689V20.3615C63.6161 21.8084 62.2968 22.5318 60.6111 22.5318C57.9481 22.5318 56.2135 20.8854 56.2135 17.8919V9.36048H59.2918V17.368C59.2918 18.9895 60.0736 19.8127 61.6616 19.8127C63.1519 19.8127 64.4712 18.6902 64.4712 16.5698Z" fill="#006AFF"/> 6 + <path d="M81.5614 16.021V16.7693H72.131C72.3508 18.9895 73.548 20.0871 75.4047 20.0871C76.8217 20.0871 77.7746 19.4635 78.2876 18.2411H81.2438C80.5841 20.8604 78.3853 22.5318 75.3803 22.5318C73.4991 22.5318 71.9844 21.9081 70.8361 20.6858C69.6878 19.4635 69.1015 17.842 69.1015 15.7965C69.1015 13.7759 69.6634 12.1544 70.8117 10.9071C71.9599 9.68477 73.4502 9.06113 75.3314 9.06113C77.2371 9.06113 78.7518 9.70972 79.8756 10.9819C80.9995 12.2542 81.5614 13.9505 81.5614 16.021ZM75.307 11.5058C73.6213 11.5058 72.4486 12.5036 72.1554 14.5741H78.4831C78.2143 12.7032 77.0905 11.5058 75.307 11.5058Z" fill="#006AFF"/> 7 + <path d="M88.3842 22.5817C84.7195 22.5817 82.7894 21.1099 82.6184 18.1413H85.6234C85.7944 19.7379 86.5762 20.3366 88.433 20.3366C90.0943 20.3366 90.925 19.8127 90.925 18.7899C90.925 17.8669 90.3386 17.4179 88.4574 17.0936L87.016 16.8442C84.2553 16.3702 82.8871 15.073 82.8871 12.9527C82.8871 10.5329 84.7683 9.06113 88.1154 9.06113C91.7068 9.06113 93.5636 10.508 93.6857 13.4266H90.7784C90.7051 11.855 89.8012 11.3062 88.1154 11.3062C86.6495 11.3062 85.9166 11.8052 85.9166 12.803C85.9166 13.701 86.5518 14.1002 88.0177 14.3746L89.6057 14.624C92.6596 15.1978 93.9789 16.3453 93.9789 18.5405C93.9789 21.1348 91.9267 22.5817 88.3842 22.5817Z" fill="#006AFF"/> 8 + <path d="M107.49 22.2324H103.972L100.307 16.2455L98.4015 18.1912V22.2324H95.372V4.47113H98.4015V14.6988L103.532 9.36048H107.197L102.433 14.2249L107.49 22.2324Z" fill="#006AFF"/> 9 + <path d="M115.529 12.6034L116.555 9.36048H119.78L114.918 23.2802C114.405 24.7021 113.77 25.7248 112.964 26.2986C112.158 26.8723 111.009 27.1467 109.495 27.1467C108.982 27.1467 108.542 27.1218 108.151 27.0719V24.6023H109.324C110.716 24.6023 111.4 23.7292 111.4 22.5318C111.4 21.9331 111.205 21.06 110.814 19.9374L107.149 9.36048H110.472L111.498 12.5785C112.255 14.9982 112.915 17.393 113.501 19.7628C114.039 17.7173 114.723 15.3225 115.529 12.6034Z" fill="#006AFF"/> 10 10 </svg>
+3 -5
bskyembed/src/components/container.tsx
··· 20 20 if (!entry) return 21 21 22 22 let {height} = entry.contentRect 23 - height += 2 // border top and bottom 23 + height += 4 // border-2 = 2px top + 2px bottom 24 24 if (height !== prevHeight.current) { 25 25 prevHeight.current = height 26 26 window.parent.postMessage( ··· 37 37 return ( 38 38 <div 39 39 ref={ref} 40 - className="w-full bg-brand text-black dark:bg-brand relative transition-colors max-w-[600px] min-w-[300px] flex items-center dark:text-slate-200 rounded-[20px] cursor-pointer hover:bg-opacity-90" 40 + className="w-full border-2 border-brand text-black relative transition-colors max-w-[600px] min-w-[300px] flex items-center dark:text-slate-200 rounded-[32px] overflow-hidden cursor-pointer" 41 41 onClick={() => { 42 42 if (ref.current && href) { 43 43 // forwardRef requires preact/compat - let's keep it simple ··· 49 49 } 50 50 }}> 51 51 {href && <Link href={href} />} 52 - <div className="flex-1 px-[6px] pt-[6px] pb-2.5 max-w-full"> 53 - {children} 54 - </div> 52 + <div className="flex-1 max-w-full">{children}</div> 55 53 </div> 56 54 ) 57 55 }
+59 -63
bskyembed/src/components/post.tsx
··· 53 53 return ( 54 54 <Container href={href}> 55 55 <div 56 - className="flex-1 flex-col flex gap-2 bg-neutral-50 dark:bg-black dark:hover:bg-slate-900 hover:bg-blue-50 rounded-[14px] p-4" 56 + className="flex-1 flex-col flex gap-4 bg-white dark:bg-black hover:bg-brandHover dark:hover:bg-brandHoverDark rounded-[30px] p-5" 57 57 lang={record?.langs?.[0]}> 58 58 <div className="flex gap-2.5 items-center cursor-pointer w-full max-w-full "> 59 59 <Link ··· 70 70 <div className="flex flex-1 items-center"> 71 71 <Link 72 72 href={`/profile/${post.author.did}`} 73 - className="block font-bold text-[17px] leading-5 line-clamp-1 hover:underline underline-offset-2 text-ellipsis decoration-2"> 73 + className="block font-bold text-[15px] min-[400px]:text-[17px] leading-5 line-clamp-1 hover:underline underline-offset-2 text-ellipsis decoration-2"> 74 74 {post.author.displayName?.trim() || post.author.handle} 75 75 </Link> 76 76 {verification.isVerified && ( ··· 87 87 /> 88 88 )} 89 89 </div> 90 - <Link 91 - href={`/profile/${post.author.did}`} 92 - className="block text-[15px] text-textLight dark:text-textDimmed hover:underline line-clamp-1"> 93 - @{post.author.handle} 94 - </Link> 90 + <div className="flex items-center gap-1 text-[13px] min-[400px]:text-[15px] min-w-0"> 91 + <Link 92 + href={`/profile/${post.author.did}`} 93 + className="text-textNeutral hover:underline line-clamp-1"> 94 + @{post.author.handle} 95 + </Link> 96 + <span className="text-textNeutral shrink-0">路</span> 97 + <Link 98 + href={`/profile/${post.author.did}`} 99 + className="text-brand hover:underline shrink-0"> 100 + Follow 101 + </Link> 102 + </div> 95 103 </div> 96 104 </div> 105 + 97 106 <PostContent record={record} /> 98 107 <Embed content={post.embed} labels={post.labels} /> 99 108 100 - <div className="flex items-center justify-between w-full pt-2.5 text-sm"> 101 - <div className="flex items-center gap-3 text-sm cursor-pointer"> 102 - {!!post.likeCount && ( 103 - <div className="flex items-center gap-1 cursor-pointer group"> 104 - <LikeIcon 105 - width={20} 106 - height={20} 107 - className="text-slate-600 dark:text-slate-400 group-hover:text-neutral-800 dark:group-hover:text-white transition-colors" 108 - /> 109 - <p className="font-medium text-slate-600 text-neutral-600 dark:text-neutral-300 mb-px group-hover:text-neutral-800 dark:group-hover:text-white transition-colors dark:text-slate-400"> 110 - {prettyNumber(post.likeCount)} 111 - </p> 112 - </div> 113 - )} 114 - {!!post.replyCount && ( 115 - <div className="flex items-center gap-1 cursor-pointer group"> 116 - <ReplyIcon 117 - width={20} 118 - height={20} 119 - className="text-slate-600 dark:text-slate-400 group-hover:text-neutral-800 dark:group-hover:text-white transition-colors" 120 - /> 121 - <p className="font-medium text-slate-600 text-neutral-600 dark:text-neutral-300 mb-px group-hover:text-neutral-800 dark:group-hover:text-white transition-colors dark:text-slate-400"> 122 - {prettyNumber(post.replyCount)} 123 - </p> 124 - </div> 125 - )} 126 - 127 - {!!post.repostCount && ( 128 - <div className="flex items-center gap-1 cursor-pointer group"> 129 - <RepostIcon 130 - width={20} 131 - height={20} 132 - className="text-slate-600 dark:text-slate-400 group-hover:text-neutral-800 dark:group-hover:text-white transition-colors" 133 - /> 134 - <p className="font-medium text-slate-600 dark:text-slate-400 mb-px group-hover:text-neutral-800 dark:group-hover:text-white transition-colors"> 135 - {prettyNumber(post.repostCount)} 136 - </p> 137 - </div> 138 - )} 109 + <div className="flex items-end justify-between w-full"> 110 + <div className="flex flex-col min-[400px]:gap-0.5"> 111 + <div className="flex items-center gap-3 text-sm cursor-pointer ml-[-2px]"> 112 + {!!post.likeCount && ( 113 + <div className="flex items-center gap-0.5 min-[400px]:gap-1 cursor-pointer group"> 114 + <LikeIcon className="w-5 h-5 min-[400px]:w-[22px] min-[400px]:h-[22px] text-textLight dark:text-textDimmed group-hover:text-neutral-800 dark:group-hover:text-white transition-colors" /> 115 + <p className="text-[11px] min-[400px]:text-[15px] font-semibold text-textLight dark:text-textDimmed mb-px group-hover:text-neutral-800 dark:group-hover:text-white transition-colors"> 116 + {prettyNumber(post.likeCount)} 117 + </p> 118 + </div> 119 + )} 120 + {!!post.replyCount && ( 121 + <div className="flex items-center gap-0.5 min-[400px]:gap-1 cursor-pointer group"> 122 + <ReplyIcon className="w-5 h-5 min-[400px]:w-[22px] min-[400px]:h-[22px] text-textLight dark:text-textDimmed group-hover:text-neutral-800 dark:group-hover:text-white transition-colors" /> 123 + <p className="text-[11px] min-[400px]:text-[15px] font-semibold text-textLight dark:text-textDimmed mb-px group-hover:text-neutral-800 dark:group-hover:text-white transition-colors"> 124 + {prettyNumber(post.replyCount)} 125 + </p> 126 + </div> 127 + )} 128 + {!!post.repostCount && ( 129 + <div className="flex items-center gap-0.5 min-[400px]:gap-1 cursor-pointer group"> 130 + <RepostIcon className="w-5 h-5 min-[400px]:w-[22px] min-[400px]:h-[22px] text-textLight dark:text-textDimmed group-hover:text-neutral-800 dark:group-hover:text-white transition-colors" /> 131 + <p className="text-[11px] min-[400px]:text-[15px] font-semibold text-textLight dark:text-textDimmed mb-px group-hover:text-neutral-800 dark:group-hover:text-white transition-colors"> 132 + {prettyNumber(post.repostCount)} 133 + </p> 134 + </div> 135 + )} 136 + </div> 137 + <Link href={href}> 138 + <time 139 + datetime={new Date(post.indexedAt).toISOString()} 140 + className="text-[11px] min-[400px]:text-[15px] text-textNeutral hover:underline"> 141 + {niceDate(post.indexedAt)} 142 + </time> 143 + </Link> 139 144 </div> 140 - <Link href={href}> 141 - <time 142 - datetime={new Date(post.indexedAt).toISOString()} 143 - className="text-slate-500 dark:text-textDimmed text-sm hover:underline dark:text-slate-500"> 144 - {niceDate(post.indexedAt)} 145 - </time> 145 + <Link 146 + href={href} 147 + className="transition-transform hover:scale-110 shrink-0"> 148 + <img src={logo} className="h-5 min-[400px]:h-7" /> 146 149 </Link> 147 150 </div> 148 151 </div> 149 - <div className="flex items-center justify-end pt-2"> 150 - <Link 151 - href={href} 152 - className="transition-transform hover:scale-110 shrink-0"> 153 - <img src={logo} className="h-8" /> 154 - </Link> 155 - </div> 156 152 </Container> 157 153 ) 158 154 } ··· 177 173 <Link 178 174 key={counter} 179 175 href={segment.link.uri} 180 - className="text-blue-500 hover:underline" 176 + className="text-brand hover:underline" 181 177 disableTracking={ 182 178 !segment.link.uri.startsWith('https://bsky.app') && 183 179 !segment.link.uri.startsWith('https://go.bsky.app') ··· 193 189 <Link 194 190 key={counter} 195 191 href={`/profile/${segment.mention.did}`} 196 - className="text-blue-500 hover:underline"> 192 + className="text-brand hover:underline"> 197 193 {segment.text} 198 194 </Link>, 199 195 ) ··· 205 201 <Link 206 202 key={counter} 207 203 href={`/hashtag/${segment.tag.tag}`} 208 - className="text-blue-500 hover:underline"> 204 + className="text-brand hover:underline"> 209 205 {segment.text} 210 206 </Link>, 211 207 ) ··· 217 213 } 218 214 219 215 return ( 220 - <p className="min-[300px]:text-lg leading-6 min-[300px]:leading-6 break-word break-words whitespace-pre-wrap"> 216 + <p className="text-md min-[400px]:text-lg leading-6 min-[300px]:leading-6 break-word break-words whitespace-pre-wrap"> 221 217 {richText} 222 218 </p> 223 219 )
+1
bskyembed/src/screens/landing.tsx
··· 39 39 function LandingPage() { 40 40 const [uri, setUri] = useState('') 41 41 const [colorMode, setColorMode] = useState<ColorModeValues>('system') 42 + 42 43 const [error, setError] = useState<string | null>(null) 43 44 const [loading, setLoading] = useState(false) 44 45 const [thread, setThread] = useState<AppBskyFeedDefs.ThreadViewPost | null>(
+4 -4
bskyembed/src/util/nice-date.ts
··· 1 1 export function niceDate(date: number | string | Date) { 2 2 const d = new Date(date) 3 - return `${d.toLocaleDateString('en-us', { 3 + return `${d.toLocaleTimeString(undefined, { 4 + hour: 'numeric', 5 + minute: '2-digit', 6 + })} 路 ${d.toLocaleDateString('en-us', { 4 7 year: 'numeric', 5 8 month: 'short', 6 9 day: 'numeric', 7 - })} at ${d.toLocaleTimeString(undefined, { 8 - hour: 'numeric', 9 - minute: '2-digit', 10 10 })}` 11 11 }
+6 -3
bskyembed/tailwind.config.cjs
··· 5 5 theme: { 6 6 extend: { 7 7 colors: { 8 - brand: 'rgb(10,122,255)', 8 + brand: 'rgb(0,106,255)', 9 + brandHover: 'rgb(245,249,255)', 10 + brandHoverDark: 'rgb(17,24,34)', 9 11 brandLighten: 'rgb(32,139,254)', 10 - textLight: 'rgb(66,87,108)', 11 - textDimmed: 'rgb(174,187,201)', 12 + textLight: 'rgb(63,82,104)', 13 + textDimmed: 'rgb(164,179,197)', 14 + textNeutral: 'rgb(102,123,153)', 12 15 dimmedBgLighten: 'rgb(30,41,54)', 13 16 dimmedBg: 'rgb(22,30,39)', 14 17 dimmedBgDarken: 'rgb(18,25,32)',