generated from TryGhost/Starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tag.hbs
86 lines (80 loc) · 2.87 KB
/
tag.hbs
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
{{!< default}}
<div class="relative pt-4 pb-20 gh-page lg:pb-28">
<div class="relative mx-auto max-w-7xl">
{{#tag}}
{{#if feature_image}}
<div class="max-w-full mx-auto">
<div class="relative shadow-xl sm:rounded-2xl sm:overflow-hidden">
<div class="absolute inset-0">
<img
loading="lazy"
class="object-cover w-full h-full"
src="{{img_url feature_image size="xl"}}"
alt="{{name}}"
/>
<div class="absolute inset-0 bg-grayPrimary mix-blend-hard-light"></div>
</div>
<div class="relative px-4 py-16 sm:px-6 sm:py-24 lg:py-32 lg:px-8">
<h1
class="py-4 text-4xl font-extrabold tracking-tight text-center text-transparent sm:text-5xl lg:text-6xl bg-clip-text bg-gradient-to-r from-pink-500 to-violet-500"
>
{{name}}
</h1>
<p class="max-w-2xl mx-auto mt-3 text-xl text-graySecondary sm:mt-4">
{{#if description}}
{{description}}
{{else}}
A collection of {{plural ../pagination.total empty='posts' singular='% post' plural='% posts'}}
{{/if}}
</p>
</div>
</div>
</div>
{{else}}
<div class="text-center">
<h1 class="text-3xl font-extrabold tracking-tight text-white gh-title sm:text-4xl">{{name}}</h1>
<p class="max-w-2xl mx-auto mt-3 text-xl text-graySecondary sm:mt-4">
{{#if description}}
{{description}}
{{else}}
A collection of {{plural ../pagination.total empty='posts' singular='% post' plural='% posts'}}
{{/if}}
</p>
</div>
{{/if}}
{{> featured}}
{{/tag}}
<div class="grid max-w-lg gap-5 mx-auto mt-12 lg:grid-cols-3 lg:max-w-none">
{{#foreach posts}}
{{> "card"}} {{!-- partials/card.hbs --}}
{{/foreach}}
</div>
{{pagination}}
</div>
</div>
<script>
document.addEventListener("DOMContentLoaded", function () {
const fadeInPoints = document.querySelectorAll(".fade-in-point");
console.log(fadeInPoints);
const options = {
rootMargin: "-100px 0px -70px 0px",
threshold: 0,
};
const observer = new IntersectionObserver((entries, observer) => {
entries.forEach((entry) => {
if (entry.isIntersecting) {
// Fade in when entering viewport
entry.target.style.opacity = "1";
entry.target.style.transform = "translateY(0)";
} else {
// Fade out when exiting viewport
entry.target.style.opacity = "0";
entry.target.style.transform = "translateY(20px)";
}
});
}, options);
fadeInPoints.forEach((point) => {
observer.observe(point);
});
});
</script>