Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3379056
D5601.id18334.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D5601.id18334.diff
View Options
diff --git a/web/markdown/markdown-spoiler.react.js b/web/markdown/markdown-spoiler.react.js
--- a/web/markdown/markdown-spoiler.react.js
+++ b/web/markdown/markdown-spoiler.react.js
@@ -14,7 +14,16 @@
function MarkdownSpoiler(props: MarkdownSpoilerProps): React.Node {
const { text } = props;
- return <span className={css.spoiler}>{text}</span>;
+ const onSpoilerClick = (event: SyntheticEvent<HTMLAnchorElement>) => {
+ event.currentTarget.classList.remove(css.spoiler);
+ event.currentTarget.classList.add(css.revealSpoilerAnimation);
+ };
+
+ return (
+ <span className={css.spoiler} onClick={onSpoilerClick}>
+ {text}
+ </span>
+ );
},
);
diff --git a/web/markdown/markdown.css b/web/markdown/markdown.css
--- a/web/markdown/markdown.css
+++ b/web/markdown/markdown.css
@@ -44,6 +44,19 @@
color: #33332c;
cursor: pointer;
}
+span.revealSpoilerAnimation {
+ animation: revealSpoiler 1s;
+}
+@keyframes revealSpoiler {
+ from {
+ background: #33332c;
+ color: #33332c;
+ }
+ to {
+ background: transparent;
+ color: white;
+ }
+}
div.markdown pre {
padding: 0.5em 10px;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 28, 2:57 PM (21 h, 8 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2594271
Default Alt Text
D5601.id18334.diff (1 KB)
Attached To
Mode
D5601: [web] Reveal the spoiler content on click within a message
Attached
Detach File
Event Timeline
Log In to Comment