summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--layouts/_partials/term/term-header.html20
-rw-r--r--layouts/_partials/term/term-scripts.html73
-rw-r--r--layouts/term.html2
3 files changed, 0 insertions, 95 deletions
diff --git a/layouts/_partials/term/term-header.html b/layouts/_partials/term/term-header.html
deleted file mode 100644
index 26bf7999..00000000
--- a/layouts/_partials/term/term-header.html
+++ /dev/null
@@ -1,20 +0,0 @@
-<div class="term-header">
- <div class="my-4 flex items-center">
- <span class="text-secondary">筛选:</span>
- {{ if eq .Data.Singular "tag" }}
- <button class="bg-transparent dark:invert" id="hide-weekly"
- data-tooltip='{{ T "termFilterButton.hideWeekly" . }}'>
- <img src="/img/crow.svg" alt="Hide Weekly"
- class="w-6 h-6 block hover:animate-swing" />
- </button>
- {{ end }}
- <button class="bg-transparent dark:invert" id="reverse-order"
- data-tooltip='{{ T "termFilterButton.reverseOrder" . }}'>
- <img src="/img/clockwork.svg" alt="Reverse Order"
- class="w-6 h-6 block hover:rotate-180 transition-transform" />
- </button>
- </div>
- {{ with .Params.description | markdownify }}
- <p class="term-description">{{ . }}</p>
- {{ end }}
-</div>
diff --git a/layouts/_partials/term/term-scripts.html b/layouts/_partials/term/term-scripts.html
deleted file mode 100644
index 45ac9ac6..00000000
--- a/layouts/_partials/term/term-scripts.html
+++ /dev/null
@@ -1,73 +0,0 @@
-<script>
- const postList = document.getElementById("term-posts")
- const reverseButton = document.getElementById("reverse-order")
- const reverseOrder = () => {
- // play exit animation
- postList.classList.remove("animate-fade-in")
- postList.classList.add("animate-fade-out")
- setTimeout(() => {
- // reverse order
- postList.classList.toggle("flex-col")
- postList.classList.toggle("flex-col-reverse")
-
- // play entrance animation
- postList.classList.remove("animate-fade-out")
- postList.classList.add("animate-fade-in")
- }, 100)
- }
- reverseButton.addEventListener('click', reverseOrder)
-</script>
-
-{{ if eq .Data.Singular "tag" }}
-<script>
- const hideWeeklyButton = document.getElementById("hide-weekly")
- const weeklies = postList.querySelectorAll(".weekly")
-
- if (weeklies.length === 0) {
- hideWeeklyButton.classList.add("hidden")
- }
-
- const entranceAnimation = "animate-flip-in-x"
- const exitAnimation = "animate-flip-out-x"
- const animationDuration = 500
-
- const toggleWeekly = () => {
- if (postList.classList.contains("weekly-hidden")) {
- // show weekly posts
- postList.classList.remove("weekly-hidden")
- weeklies.forEach(weekly => {
- weekly.classList.remove("hidden!")
- weekly.classList.add(entranceAnimation)
- setTimeout(() => {
- weekly.classList.remove(entranceAnimation)
- }, animationDuration)
- })
- } else {
- // hide weekly posts
- postList.classList.add("weekly-hidden")
- weeklies.forEach(weekly => {
- weekly.classList.add(exitAnimation)
- setTimeout(() => {
- weekly.classList.add("hidden!")
- weekly.classList.remove(exitAnimation)
- }, animationDuration)
- })
- }
- }
-
- const highlightClasses = ["animate-flash", "opacity-50"]
-
- const highlightWeekly = () => {
- if (weeklies[0].classList.contains(highlightClasses[0])) return;
- weeklies.forEach(e => e.classList.add(...highlightClasses))
- }
-
- const unhighlightWeekly = () => {
- weeklies.forEach(e => e.classList.remove(...highlightClasses))
- }
-
- hideWeeklyButton.addEventListener("click", toggleWeekly)
- hideWeeklyButton.addEventListener("mouseover", highlightWeekly)
- hideWeeklyButton.addEventListener("mouseout", unhighlightWeekly)
-</script>
-{{ end }}
diff --git a/layouts/term.html b/layouts/term.html
index 130dea01..216f4d12 100644
--- a/layouts/term.html
+++ b/layouts/term.html
@@ -1,7 +1,6 @@
{{ define "main" }}
<article>
{{ partial "header" . }}
- {{ partial "term/term-header" . }}
<section>
{{ with .Content }}
<div class="markdown-body text-size-lg md:text-size-xl">
@@ -14,6 +13,5 @@
{{ partial "term/term-books" . }}
</section>
</article>
- {{ partial "term/term-scripts" . }}
{{ partial "footer" . }}
{{ end }}