feat(chat): blur locked image previews
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
/* ImageBubble 图片气泡样式 */
|
/* ImageBubble 图片气泡样式 */
|
||||||
|
|
||||||
.bubble {
|
.bubble {
|
||||||
|
position: relative;
|
||||||
max-width: 220px;
|
max-width: 220px;
|
||||||
max-height: 220px;
|
max-height: 220px;
|
||||||
border-radius: var(--radius-lg, 12px);
|
border-radius: var(--radius-lg, 12px);
|
||||||
@@ -17,6 +18,23 @@
|
|||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.paywalled .image {
|
||||||
|
filter: blur(8px);
|
||||||
|
transform: scale(1.04);
|
||||||
|
}
|
||||||
|
|
||||||
|
.paywallOverlay {
|
||||||
|
position: absolute;
|
||||||
|
inset: 0;
|
||||||
|
background:
|
||||||
|
linear-gradient(
|
||||||
|
180deg,
|
||||||
|
rgba(255, 255, 255, 0.04) 0%,
|
||||||
|
rgba(255, 255, 255, 0.14) 100%
|
||||||
|
);
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
.errorFallback {
|
.errorFallback {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@@ -32,7 +32,9 @@ export function ImageBubble({
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div
|
<div
|
||||||
className={styles.bubble}
|
className={`${styles.bubble} ${
|
||||||
|
imagePaywalled ? styles.paywalled : ""
|
||||||
|
}`}
|
||||||
onClick={() => setOpen(true)}
|
onClick={() => setOpen(true)}
|
||||||
role="button"
|
role="button"
|
||||||
tabIndex={0}
|
tabIndex={0}
|
||||||
@@ -56,6 +58,9 @@ export function ImageBubble({
|
|||||||
onError={() => setError(true)}
|
onError={() => setError(true)}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
{!error && imagePaywalled ? (
|
||||||
|
<div className={styles.paywallOverlay} aria-hidden="true" />
|
||||||
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
{open && (
|
{open && (
|
||||||
<FullscreenImageViewer
|
<FullscreenImageViewer
|
||||||
|
|||||||
Reference in New Issue
Block a user