Experiment different card preview style
This commit is contained in:
parent
d0bb0c04db
commit
88e36183c6
2 changed files with 30 additions and 1 deletions
|
@ -1899,6 +1899,26 @@ a.card:is(:hover, :focus):visited {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
.card.card-post {
|
||||||
|
flex-direction: row-reverse;
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.meta {
|
||||||
|
-webkit-line-clamp: 5;
|
||||||
|
line-clamp: 5;
|
||||||
|
opacity: 1;
|
||||||
|
font-size: inherit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.status.large .card.large.card-post,
|
||||||
|
.status-carousel
|
||||||
|
.content-container[data-content-text-weight='1']
|
||||||
|
.card.large.card-post {
|
||||||
|
flex-direction: column-reverse;
|
||||||
|
}
|
||||||
|
|
||||||
/* POLLS */
|
/* POLLS */
|
||||||
|
|
||||||
|
|
|
@ -2532,12 +2532,21 @@ function Card({ card, selfReferential, instance }) {
|
||||||
ctx.putImageData(imageData, 0, 0);
|
ctx.putImageData(imageData, 0, 0);
|
||||||
blurhashImage = canvas.toDataURL();
|
blurhashImage = canvas.toDataURL();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// "Post": Quote post + card link preview combo
|
||||||
|
// Assume all links from these domains are "posts"
|
||||||
|
// Mastodon links are "posts" too but they are converted to real quote posts and there's too many domains to check
|
||||||
|
// This is just "Progressive Enhancement"
|
||||||
|
const isPost = ['x.com', 'twitter.com', 'threads.net'].includes(domain);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<a
|
<a
|
||||||
href={cardStatusURL || url}
|
href={cardStatusURL || url}
|
||||||
target={cardStatusURL ? null : '_blank'}
|
target={cardStatusURL ? null : '_blank'}
|
||||||
rel="nofollow noopener noreferrer"
|
rel="nofollow noopener noreferrer"
|
||||||
class={`card link ${blurhashImage ? '' : size}`}
|
class={`card link ${isPost ? 'card-post' : ''} ${
|
||||||
|
blurhashImage ? '' : size
|
||||||
|
}`}
|
||||||
lang={language}
|
lang={language}
|
||||||
dir="auto"
|
dir="auto"
|
||||||
style={{
|
style={{
|
||||||
|
|
Loading…
Add table
Reference in a new issue