mirror of
https://codeberg.org/VnPower/PixivFE
synced 2024-12-06 19:16:23 +01:00
lazy load comment author avatars and stamps
This commit is contained in:
@@ -46,10 +46,10 @@
|
||||
{* checks whether .AuthorName is empty, indicating a deleted user *}
|
||||
{{- if .AuthorName != "" }}
|
||||
<a href="/users/{{ .AuthorID }}/bookmarks">
|
||||
<img class="img-fluid rounded-circle object-fit-cover" src="{{ .Avatar }}" alt="{{ .AuthorName }}" style="width: 40px; height: 40px" />
|
||||
<img class="img-fluid rounded-circle object-fit-cover" src="{{ .Avatar }}" alt="{{ .AuthorName }}" loading="lazy" style="width: 40px; height: 40px" />
|
||||
</a>
|
||||
{{- else }}
|
||||
<img class="img-fluid rounded-circle object-fit-cover" src="{{ .Avatar }}" alt="{{ .AuthorName }}" style="width: 40px; height: 40px" />
|
||||
<img class="img-fluid rounded-circle object-fit-cover" src="{{ .Avatar }}" alt="{{ .AuthorName }}" loading="lazy" style="width: 40px; height: 40px" />
|
||||
{{- end }}
|
||||
</div>
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
<!-- Stamp or emoji -->
|
||||
<!-- TODO: .Stamp occasionally templates in text (which should be part of the main comment text) instead of an image, causing breakage in the layout. See the comment by "Unknown417" on /artworks/107442519 for an example -->
|
||||
{{- if .Stamp }}
|
||||
<img class="stamp img-fluid rounded object-fit-cover me-2" src="/proxy/s.pximg.net/common/images/stamp/generated-stamps/{{ .Stamp }}_s.jpg" alt="/proxy/s.pximg.net/common/images/stamp/generated-stamps/{{ .Stamp }}_s.jpg"/>
|
||||
<img class="stamp img-fluid rounded object-fit-cover me-2" src="/proxy/s.pximg.net/common/images/stamp/generated-stamps/{{ .Stamp }}_s.jpg" alt="/proxy/s.pximg.net/common/images/stamp/generated-stamps/{{ .Stamp }}_s.jpg" loading="lazy" />
|
||||
{{- else }}
|
||||
<!-- Comment with emojis -->
|
||||
<p class="d-flex flex-wrap align-items-center m-0">{{ raw: parseEmojis(.Context) }}</p>
|
||||
|
||||
Reference in New Issue
Block a user