summaryrefslogtreecommitdiff
path: root/layouts/_partials/posts/webmention-summary.html
blob: 6c330e3927d7ba61e9ff4aaf68fe6926f30be78f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{{ $likes := .likes }}
{{ $page := .page }}
{{ $othercount := .othercount }}

<section class="md:flex md:justify-between w-full">
    <section class="group relative mb-6 vertical-middle">
      <!-- Likes -->
       {{ range $likes }}
           {{ $author := .microformats.author }}
           {{ $photo := or (index .extra "proxied-photo") $author.photo }}
           <a href="{{ if $author.url }}{{ $author.url }}{{ else }}#{{ end }}"
               target="_blank"
               title="{{ $author.name }}"
               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) }}
            {{ if $photo }}
            <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 }}" />
            {{ else }}
            <div class="h-5 w-5 rd-full bg-neutral-300"></div>
            {{ end }}
         </a>
    {{ end }}
     <div class="text-secondary m-0 text-sm inline ml-2">
        {{ printf (T "webmention.likedBy") (len $likes) }}
        {{ if gt $othercount 0 }}
            {{ printf (T "webmention.repliedAndMentionedBy") $othercount }}
        {{ end }}
     </div>
     <div class="clear-left"></div>
    </section>
</section>