summaryrefslogtreecommitdiffci
path: root/views/partials/catalogue-blog-cards.html
blob: 6466262abcecb3f34996b93062ad8402056cb084 (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
38
39
{{- range .BlogPages }}
<hr class="first-of-type:hidden border-t-[0.375rem] my-1 w-24 mx-auto border-dotted border-main-hard">
<div {{ if .ToHighlight }}id="blog-page-highlighted"{{ end }} class="w-full flex flex-row items-stretch mask-t-from-[calc(100%-0.5rem)] mask-t-to-100% mask-b-from-[calc(100%-0.5rem)] mask-b-to-100% {{ if .ToHighlight }}bg-accent-light bg-paper{{ end }}">
    <div class="relative min-h-24 flex flex-col w-32 overflow-hidden shrink-0 mask-r-from-[calc(100%-1rem)] mask-r-to-100%">
        <img onclick="return changeUrl('{{ .ArticleLink }}');" class="h-full min-h-24 w-full cursor-pointer select-none object-cover block absolute" src="{{ printf $.PhotoStorage.Thumbnail320p.BaseUrl .Thumbnail }}">
        <div class="w-full h-6 flex flex-row mt-auto relative">
            <div class="flex-1/2 flex flex-row justify-center select-none bg-linear-180 {{ if .Liked }}from-accent-deep/40 to-accent-deep/80 text-background-dark{{ else }}from-accent-light/40 to-accent-light/80 text-main-hard{{ end }}">
                <svg viewBox="0 0 24 24"><use href="#icon-like"/></svg>
                <span>{{ .LikeCount }}</span>
            </div>
            <div class="flex-1/2 flex flex-row justify-center select-none bg-linear-180 {{ if .Viewed }}from-accent-deep/40 to-accent-deep/80 text-background-dark{{ else }}from-accent-light/40 to-accent-light/80 text-main-hard{{ end }}">
                <svg viewBox="0 0 24 24"><use href="#icon-view"/></svg>
                <span>{{ .ViewCount }}</span>
            </div>
        </div>
    </div>
    <div class="grow w-full h-fit flex flex-col justify-center my-auto py-1 px-2">
        <div class="flex flex-row gap-2 max-w-full">
            <a href="{{ .ArticleLink }}" onclick="return changeUrl('{{ .ArticleLink }}');" class="grow-2 text-base cursor-pointer font-m-plus">
                <span class="font-extrabold">{{ .Title }}</span>
                <span class="italic">[{{ .ActionDate }}]</span>
            </a>
            {{- if not $.HidePublishedTime }}
            <p class="basis-56 grow text-base italic text-secondary text-right">{{ .PublishedTime }}</p>
            {{- end }}
        </div>
        <p class="font-m-plus">{{ .ShortDescription }}</p>
        {{- if not $.HideTags }}
        <p class="font-m-plus text-sm">{{ $.L.TagsLabel }} {{ template "catalogue-blog-card-tags.html" . }}</p>
        {{- end }}
    </div>
</div>
{{- if .ToHighlight }}
<script>
    element = document.getElementById("blog-page-highlighted");
    element.scrollIntoView({ behavior: "smooth", block: "center" });
</script>
{{- end }}
{{- end }}