2017-11-07 16:46:39 +00:00
|
|
|
import { AnimeNotifier } from "../AnimeNotifier"
|
2017-12-02 20:06:15 +00:00
|
|
|
import { findAll } from "scripts/Utils";
|
2017-11-07 16:46:39 +00:00
|
|
|
|
|
|
|
// Filter anime on explore page
|
|
|
|
export function filterAnime(arn: AnimeNotifier, input: HTMLInputElement) {
|
|
|
|
let year = arn.app.find("filter-year") as HTMLSelectElement
|
|
|
|
let status = arn.app.find("filter-status") as HTMLSelectElement
|
|
|
|
let type = arn.app.find("filter-type") as HTMLSelectElement
|
|
|
|
|
2018-03-14 03:18:57 +00:00
|
|
|
for(let element of findAll("anime-grid-image")) {
|
|
|
|
let img = element as HTMLImageElement
|
2018-03-20 22:58:37 +00:00
|
|
|
img.src = arn.emptyPixel()
|
2018-03-14 03:18:57 +00:00
|
|
|
img.classList.remove("element-found")
|
2018-03-20 22:58:37 +00:00
|
|
|
img.classList.remove("element-color-preview")
|
2018-03-14 02:50:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
arn.diff(`/explore/anime/${year.value}/${status.value}/${type.value}`)
|
2017-12-02 20:06:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Hides anime that are already in your list.
|
|
|
|
export function hideAddedAnime() {
|
|
|
|
for(let anime of findAll("anime-grid-cell")) {
|
|
|
|
if(anime.dataset.added === "true") {
|
|
|
|
anime.classList.toggle("anime-grid-cell-hide")
|
|
|
|
}
|
|
|
|
}
|
2017-12-03 18:08:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Hides anime that are not in your list.
|
|
|
|
export function calendarShowAddedAnimeOnly() {
|
|
|
|
for(let anime of findAll("calendar-entry")) {
|
|
|
|
if(anime.dataset.added === "false") {
|
|
|
|
anime.classList.toggle("hidden")
|
|
|
|
}
|
|
|
|
}
|
2017-11-07 16:46:39 +00:00
|
|
|
}
|