Add spoiler tag shortcode.

This commit is contained in:
Anna Rose 2023-11-15 03:33:50 +00:00
parent 24a51d18b2
commit 274285f48a
3 changed files with 28 additions and 1 deletions

View File

@ -9,7 +9,7 @@ googleAnalytics = "G-QFK0K7MGCJ"
[params] [params]
paginate = 10 paginate = 10
custom_css = ["/css/custom.css"] custom_css = ["/css/custom.css", "/css/spoiler.css"]
dateFormat = "2006-01-02" dateFormat = "2006-01-02"
# Disqus shortname # Disqus shortname
# disqus = "" # disqus = ""

View File

@ -0,0 +1 @@
<span class="inline-spoiler">{{- .Inner | safeHTML -}}</span>

26
static/css/spoiler.css Normal file
View File

@ -0,0 +1,26 @@
.inline-spoiler {
position: relative;
display: inline-block;
cursor: help;
}
.inline-spoiler::before {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border-radius: 1px;
color: white;
background: black;
opacity: 1;
transition: opacity 0.7s ease, transform 0.3s ease;
}
.inline-spoiler:hover::before {
opacity: 0;
transform: translateY(-50%) rotateX(80deg);
transition: opacity 1s ease, transform 0.5s ease;
transition-delay: 0.3s;
}