feat: always render prev/next buttons with aria and data attrs
This commit is contained in:
@@ -42,19 +42,17 @@
|
|||||||
<div class="mt-3 flex flex-wrap items-center justify-between gap-3">
|
<div class="mt-3 flex flex-wrap items-center justify-between gap-3">
|
||||||
<div class="flex gap-2">
|
<div class="flex gap-2">
|
||||||
{{$prevEp := sub (int $currentEpID) 1}}
|
{{$prevEp := sub (int $currentEpID) 1}}
|
||||||
{{if ge $prevEp 1}}
|
{{$prevTarget := $prevEp}}{{if lt $prevTarget 1}}{{$prevTarget = 1}}{{end}}
|
||||||
<a href="/anime/{{$anime.MalID}}/watch?ep={{$prevEp}}" class=" inline-flex items-center gap-2 bg-background-button px-4 py-2 text-sm font-normal leading-none text-foreground-muted transition-colors hover:bg-background-button-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent">
|
<a href="/anime/{{$anime.MalID}}/watch?ep={{$prevTarget}}" data-episode-prev data-episode-id="{{$prevTarget}}" aria-hidden="{{if ge $prevEp 1}}false{{else}}true{{end}}" tabindex="{{if ge $prevEp 1}}0{{else}}-1{{end}}" class="{{if ge $prevEp 1}}inline-flex{{else}}hidden{{end}} items-center gap-2 bg-background-button px-4 py-2 text-sm font-normal leading-none text-foreground-muted transition-colors hover:bg-background-button-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent">
|
||||||
<svg class="block h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.8"><path stroke-linecap="round" stroke-linejoin="round" d="M15 19l-7-7 7-7" /></svg>
|
<svg class="block h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.8"><path stroke-linecap="round" stroke-linejoin="round" d="M15 19l-7-7 7-7" /></svg>
|
||||||
Prev
|
Prev
|
||||||
</a>
|
</a>
|
||||||
{{end}}
|
|
||||||
{{$nextEp := add (int $currentEpID) 1}}
|
{{$nextEp := add (int $currentEpID) 1}}
|
||||||
{{if le $nextEp $totalEpisodes}}
|
{{$nextTarget := $nextEp}}{{if gt $nextTarget $totalEpisodes}}{{$nextTarget = $totalEpisodes}}{{end}}
|
||||||
<a href="/anime/{{$anime.MalID}}/watch?ep={{$nextEp}}" class=" inline-flex items-center gap-2 bg-background-button px-4 py-2 text-sm font-normal leading-none text-foreground-muted transition-colors hover:bg-background-button-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent">
|
<a href="/anime/{{$anime.MalID}}/watch?ep={{$nextTarget}}" data-episode-next data-episode-id="{{$nextTarget}}" aria-hidden="{{if le $nextEp $totalEpisodes}}false{{else}}true{{end}}" tabindex="{{if le $nextEp $totalEpisodes}}0{{else}}-1{{end}}" class="{{if le $nextEp $totalEpisodes}}inline-flex{{else}}hidden{{end}} items-center gap-2 bg-background-button px-4 py-2 text-sm font-normal leading-none text-foreground-muted transition-colors hover:bg-background-button-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent">
|
||||||
Next
|
Next
|
||||||
<svg class="block h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.8"><path stroke-linecap="round" stroke-linejoin="round" d="M9 5l7 7-7 7" /></svg>
|
<svg class="block h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.8"><path stroke-linecap="round" stroke-linejoin="round" d="M9 5l7 7-7 7" /></svg>
|
||||||
</a>
|
</a>
|
||||||
{{end}}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex items-center justify-end gap-2" data-segment-editor-root>
|
<div class="flex items-center justify-end gap-2" data-segment-editor-root>
|
||||||
|
|||||||
Reference in New Issue
Block a user