diff options
| author | eltrac <hi@eltr.ac> | 2026-03-30 17:45:24 +0800 |
|---|---|---|
| committer | eltrac <hi@eltr.ac> | 2026-03-30 17:45:24 +0800 |
| commit | a4d41717fb1fbf78107f50b1372d7bafff7c011a (patch) | |
| tree | 4e6bec745e304c544b1df8fac8c9f8121f55a89f /layouts/_partials/posts | |
| parent | f2ebe2503a20645b8c5cef459dda3d3b139b992e (diff) | |
perf: reduce rotate-* classes and use style attr instead
Diffstat (limited to 'layouts/_partials/posts')
| -rw-r--r-- | layouts/_partials/posts/webmention-summary.html | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/layouts/_partials/posts/webmention-summary.html b/layouts/_partials/posts/webmention-summary.html index 5dd6bb77..a3a7265d 100644 --- a/layouts/_partials/posts/webmention-summary.html +++ b/layouts/_partials/posts/webmention-summary.html @@ -18,12 +18,13 @@ {{ $author := index (index $authors 0) "properties" }} {{ $photo := or (index . "extra" "proxied-photo") (index $author.photo 0) }} - <a href="{{ index $author.url 0 }}" target="_blank" title="{{ index $author.name 0 }}" class="box-border hover:no-underline inline-block h-5 w-5 float-left -ml-1"> - {{ $value := math.Floor (mul math.Rand 80) }} - {{ $rotate := cond (lt $value 40) (sub 10 $value) (sub $value 30) }} - <img src="{{ $photo }}" alt="Profile Picture" - loading="lazy" - class="h-5 w-5 rd-full transition-transform {{ if lt $rotate 0 }}group-hover:-rotate-{{ mul -1 $rotate }}{{ else }}group-hover:rotate-{{ $rotate }}{{ end }} hover:scale-150" /> + <a href="{{ index $author.url 0 }}" target="_blank" title="{{ index $author.name 0 }}" class="box-border hover:no-underline inline-block h-5 w-5 float-left -ml-1 hover:scale-150 transition-transform"> + {{ $value := math.Floor (mul math.Rand 80) }} + {{ $rotate := cond (lt $value 40) (sub 10 $value) (sub $value 30) }} + <img src="{{ $photo }}" alt="Profile Picture" + loading="lazy" + class="h-5 w-5 rd-full transition-transform" + style="{{ if ne $rotate 0 }}--rotate-amount: {{ $rotate }}deg;{{ end }}" /> </a> {{ end }} <div class="text-secondary m-0 text-sm inline ml-2"> |
