lazy load common emoji

merge-requests/30/head
Bob Mottram 2022-04-19 12:42:25 +01:00
parent 9eced44d76
commit e6dec01bab
2 changed files with 5 additions and 4 deletions

View File

@ -1119,7 +1119,7 @@ h3 {
user-select: all; user-select: all;
white-space: nowrap; white-space: nowrap;
} }
.hashtagswarm img { .hashtagswarm img.commonemojilabel {
width: 5%; width: 5%;
min-width: 5%; min-width: 5%;
} }
@ -1906,7 +1906,7 @@ h3 {
user-select: all; user-select: all;
white-space: nowrap; white-space: nowrap;
} }
.hashtagswarm img { .hashtagswarm img.commonemojilabel {
width: 10%; width: 10%;
min-width: 10%; min-width: 10%;
} }
@ -2665,7 +2665,7 @@ h3 {
user-select: all; user-select: all;
white-space: nowrap; white-space: nowrap;
} }
.hashtagswarm img { .hashtagswarm img.commonemojilabel {
width: 10%; width: 10%;
min-width: 10%; min-width: 10%;
} }

View File

@ -1699,7 +1699,8 @@ def html_common_emoji(base_dir: str, no_of_emoji: int) -> str:
# NOTE: deliberately no alt text, so that without graphics only # NOTE: deliberately no alt text, so that without graphics only
# the emoji name shows # the emoji name shows
html_str += \ html_str += \
'<label class="hashtagswarm"><img ' + \ '<label class="hashtagswarm" id="commonemojilabel">' + \
'<img loading="lazy" decoding="async" ' + \
'src="/emoji/' + emoji_name + '.png" ' + \ 'src="/emoji/' + emoji_name + '.png" ' + \
'alt="" title="">' + \ 'alt="" title="">' + \
':' + emoji_name + ':</label>\n' ':' + emoji_name + ':</label>\n'