summaryrefslogtreecommitdiff
path: root/layouts/fiction/view_item.html
blob: 30c050517eacc7a92650ad0d5f0de7bdb877ed05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
{{ $rotationDeg := add (math.Floor (mul (math.Rand) 7)) -4 }}
{{- $deg := int $rotationDeg -}}

{{ $steps := slice 60 70 80 90 100 }}
{{ $opacity := index $steps (int (math.Floor (mul (math.Rand) 5))) }}
{{ $opacityClass := printf "opacity-%d" $opacity }}

<div class="xerox text-center text-2xl font-extrabold
    {{ $opacityClass }}
    transition hover:opacity-100 hover:scale-110"
     style="view-transition-name: post-{{ .File.UniqueID }}; {{ if ne $deg 0 }}--rotation-deg: {{ $deg }}deg; transform: rotate({{ $deg }}deg);{{ end }}">
    <a class="hover:no-underline" href="{{ .Permalink }}">《{{ .Title }}》</a>
</div>