fix: remove inline onclick

This commit is contained in:
2026-05-26 22:35:02 +02:00
parent b63a5c48a2
commit 91bf399ebc
6 changed files with 102 additions and 52 deletions

View File

@@ -147,17 +147,7 @@
<h2 class="mb-4 mt-2 text-base font-normal text-foreground">Synopsis</h2>
<p id="synopsis-container" class="text-foreground-muted text-base leading-relaxed line-clamp-6 md:line-clamp-none whitespace-pre-line">{{if $anime.Synopsis}}{{$anime.Synopsis}}{{else}}No synopsis available.{{end}}</p>
{{if and $anime.Synopsis (gt (len $anime.Synopsis) 400)}}
<button id="synopsis-toggle" class="mt-2 text-sm font-normal text-foreground-muted transition-colors hover:text-foreground md:hidden" onclick="
const container = document.getElementById('synopsis-container');
const btn = document.getElementById('synopsis-toggle');
if (container.classList.contains('line-clamp-6')) {
container.classList.remove('line-clamp-6');
btn.textContent = 'Show less';
} else {
container.classList.add('line-clamp-6');
btn.textContent = 'Read more';
}
">
<button id="synopsis-toggle" data-synopsis-toggle class="mt-2 text-sm font-normal text-foreground-muted transition-colors hover:text-foreground md:hidden">
Read more
</button>
{{end}}