diff --git a/src/components/media.jsx b/src/components/media.jsx
index f8e2ead3..943db1e0 100644
--- a/src/components/media.jsx
+++ b/src/components/media.jsx
@@ -1,4 +1,5 @@
import { getBlurHashAverageColor } from 'fast-blurhash';
+import { Fragment } from 'preact';
import {
useCallback,
useLayoutEffect,
@@ -251,90 +252,104 @@ function Media({ media, to, showOriginal, autoAnimate, onClick = () => {} }) {
>
`;
+ const showInlineDesc = !showOriginal && !isGIF && !!description;
+ const Container = showInlineDesc ? 'figure' : Fragment;
+
return (
- {
- if (hoverAnimate) {
- try {
- videoRef.current.pause();
- } catch (e) {}
- }
- onClick(e);
- }}
- onMouseEnter={() => {
- if (hoverAnimate) {
- try {
- videoRef.current.play();
- } catch (e) {}
- }
- }}
- onMouseLeave={() => {
- if (hoverAnimate) {
- try {
- videoRef.current.pause();
- } catch (e) {}
- }
- }}
- >
- {showOriginal || autoGIFAnimate ? (
- isGIF && showOriginal ? (
-
+
+ {
+ if (hoverAnimate) {
+ try {
+ videoRef.current.pause();
+ } catch (e) {}
+ }
+ onClick(e);
+ }}
+ onMouseEnter={() => {
+ if (hoverAnimate) {
+ try {
+ videoRef.current.play();
+ } catch (e) {}
+ }
+ }}
+ onMouseLeave={() => {
+ if (hoverAnimate) {
+ try {
+ videoRef.current.pause();
+ } catch (e) {}
+ }
+ }}
+ >
+ {showOriginal || autoGIFAnimate ? (
+ isGIF && showOriginal ? (
+
+
+
+ ) : (
-
- ) : (
-
- )
- ) : isGIF ? (
-
- ) : (
- <>
-
-
-
-
- >
+ ) : (
+ <>
+
+
+
+
+ >
+ )}
+
+ {showInlineDesc && (
+ {
+ location.hash = to;
+ }}
+ >
+ {description}
+
)}
-
+
);
} else if (type === 'audio') {
const formattedDuration = formatDuration(original.duration);
diff --git a/src/components/status.css b/src/components/status.css
index 8d336993..6a1975fe 100644
--- a/src/components/status.css
+++ b/src/components/status.css
@@ -654,6 +654,31 @@
width: auto !important;
max-width: 100%;
display: block;
+
+ figure {
+ margin: 0;
+ padding: 0;
+
+ figcaption {
+ margin: -2px 0 0;
+ padding: 0 4px;
+ font-size: 90%;
+ color: var(--text-insignificant-color);
+ overflow: hidden;
+ white-space: normal;
+ display: -webkit-box;
+ display: box;
+ -webkit-box-orient: vertical;
+ box-orient: vertical;
+ -webkit-line-clamp: 2;
+ line-clamp: 2;
+ line-height: 1.2;
+ }
+ }
+
+ &:hover figure figcaption {
+ color: var(--text-color);
+ }
}
.status .media-container.media-eq1 .media {
display: inline-block;