Imporve emoji style
- Increase emoji size - Add colons to emoji alt text and title
This commit is contained in:
parent
fd2a353770
commit
f3367d920d
|
@ -40,7 +40,7 @@ func emojiFilter(content string, emojis []mastodon.Emoji) string {
|
||||||
var replacements []string
|
var replacements []string
|
||||||
var r string
|
var r string
|
||||||
for _, e := range emojis {
|
for _, e := range emojis {
|
||||||
r = fmt.Sprintf("<img class=\"status-emoji\" src=\"%s\" alt=\"%s\" title=\"%s\" />",
|
r = fmt.Sprintf("<img class=\"emoji\" src=\"%s\" alt=\":%s:\" title=\":%s:\" />",
|
||||||
e.URL, e.ShortCode, e.ShortCode)
|
e.URL, e.ShortCode, e.ShortCode)
|
||||||
replacements = append(replacements, ":"+e.ShortCode+":", r)
|
replacements = append(replacements, ":"+e.ShortCode+":", r)
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@ func statusContentFilter(spoiler string, content string,
|
||||||
content = spoiler + "<br />" + content
|
content = spoiler + "<br />" + content
|
||||||
}
|
}
|
||||||
for _, e := range emojis {
|
for _, e := range emojis {
|
||||||
r = fmt.Sprintf("<img class=\"status-emoji\" src=\"%s\" alt=\"%s\" title=\"%s\" />",
|
r = fmt.Sprintf("<img class=\"emoji\" src=\"%s\" alt=\":%s:\" title=\":%s:\" />",
|
||||||
e.URL, e.ShortCode, e.ShortCode)
|
e.URL, e.ShortCode, e.ShortCode)
|
||||||
replacements = append(replacements, ":"+e.ShortCode+":", r)
|
replacements = append(replacements, ":"+e.ShortCode+":", r)
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,13 +63,6 @@
|
||||||
font-size: 10pt;
|
font-size: 10pt;
|
||||||
}
|
}
|
||||||
|
|
||||||
.status-emoji {
|
|
||||||
height: 20px;
|
|
||||||
margin-bottom: -4px;
|
|
||||||
width: auto;
|
|
||||||
vertical-align: unset !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.name-emoji {
|
.name-emoji {
|
||||||
height: 20px;
|
height: 20px;
|
||||||
width: auto;
|
width: auto;
|
||||||
|
@ -324,18 +317,20 @@ a:hover,
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
.emoji {
|
.emoji-item {
|
||||||
min-width: 220px;
|
min-width: 220px;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-bottom: 2px;
|
margin: 4px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.emoji-img {
|
img.emoji {
|
||||||
height: 24px;
|
height: 32px;
|
||||||
width: 24px;
|
|
||||||
object-fit: contain;
|
object-fit: contain;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-dname img.emoji {
|
||||||
|
height: 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.emoji-shortcode {
|
.emoji-shortcode {
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
|
|
||||||
<div class="emoji-list-container">
|
<div class="emoji-list-container">
|
||||||
{{range .Emojis}}
|
{{range .Emojis}}
|
||||||
<div class="emoji">
|
<div class="emoji-item">
|
||||||
<img class="emoji-img" src="{{.URL}}" alt="{{.ShortCode}}" />
|
<img class="emoji" src="{{.URL}}" alt="{{.ShortCode}}" />
|
||||||
<div class="emoji-shortcode">:{{.ShortCode}}:</div>
|
<div class="emoji-shortcode">:{{.ShortCode}}:</div>
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
Loading…
Reference in New Issue