add object-fit-cover to img elements

This commit is contained in:
perennial
2024-09-28 21:06:51 +10:00
parent 9a4bbc7936
commit 68c83d2f5f
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -12,7 +12,7 @@
<div class="card-header px-4 py-3">
<div class="d-flex justify-content-between align-items-center">
<a class="text-decoration-none text-light d-flex align-items-center" href="/users/{{ .Illust.User.ID }}">
<img src="{{ .Illust.User.Avatar }}" alt="{{ .Illust.User.Name }}" class="rounded-circle me-2" style="width: 48px; height: 48px;">
<img src="{{ .Illust.User.Avatar }}" alt="{{ .Illust.User.Name }}" class="rounded-circle object-fit-cover me-2" style="width: 48px; height: 48px;">
<h2 class="h5 m-0">Other works by {{ .Illust.User.Name }}</h2>
</a>
{{- combinedUrl := "/artworks-multi/" + joinArtworkIds(.Illust.RecentWorks) }}
@@ -53,7 +53,7 @@
<!-- Comment author avatar image -->
<div class="col-auto">
<a href="/users/{{ .AuthorID }}">
<img class="rounded-circle img-fluid" src="{{ .Avatar }}" alt="{{ .AuthorName }}" style="width: 40px; height: 40px;" />
<img class="img-fluid rounded-circle object-fit-cover" src="{{ .Avatar }}" alt="{{ .AuthorName }}" style="width: 40px; height: 40px;" />
</a>
</div>
<div class="col">
@@ -73,7 +73,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="img-fluid rounded me-2" src="/proxy/s.pximg.net/common/images/stamp/generated-stamps/{{ .Stamp }}_s.jpg"
<img class="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" style="width: 96px; height: 96px;" />
{{- else }}
<!-- Comment with emojis -->
+1 -1
View File
@@ -10,7 +10,7 @@
{{- if .Tag.Metadata.ID }}
<div class="col-md-3">
<a href="/artworks/{{ .Tag.Metadata.ID }}">
<img src="{{ .Tag.Metadata.Image }}" alt="{{ .Tag.Name }}" class="img-fluid rounded" />
<img src="{{ .Tag.Metadata.Image }}" alt="{{ .Tag.Name }}" class="img-fluid object-fit-cover rounded" />
</a>
</div>
{{- end }}