notification fix, settings fix, ui work

This commit is contained in:
ThaUnknown 2021-08-15 18:18:43 +02:00
parent b0a6b96c41
commit 8ec316c859
7 changed files with 234 additions and 415 deletions

View file

@ -415,13 +415,11 @@ section:target:not(#player),
/* view */
#view,
#viewAnime .banner {
background: no-repeat center center;
background-size: cover;
}
#view>div,
#viewAnime .top {
backdrop-filter: blur(10px);
}
@ -456,12 +454,15 @@ section:target:not(#player),
border: none;
margin-right: 0.6rem;
}
#viewLabels.movie .duration {
display: flex !important;
}
#viewLabels.movie .episodes {
display: none !important;
}
#viewPlayback.hidden .btn-group {
display: none;
}

View file

@ -23,11 +23,158 @@
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="css/misc.css" rel="stylesheet">
<link href="css/torrent-player.css" rel="stylesheet">
<style id="substyles">
</style>
</head>
<body class="dark-mode with-custom-webkit-scrollbars with-custom-css-scrollbars" data-sidebar-shortcut-enabled="true">
<div class="modal modal-full" id="viewAnime" tabindex="-1" role="dialog">
<div class="h-full modal-content bg-very-dark p-0 overflow-y-auto">
<button class="close pointer z-30 bg-dark shadow-lg border" data-dismiss="modal" type="button" aria-label="Close">
<span>×</span>
</button>
<div class="h-md-half w-full position-relative z-20">
<div class="h-full w-full position-absolute bg-dark-light banner">
</div>
<div class="d-flex h-full top w-full">
<div class="container-xl w-full">
<div class="row d-flex justify-content-end flex-row h-full px-20 pt-20 px-xl-0">
<div class="col-md-3 col-4 d-flex h-full justify-content-end flex-column pb-15 align-items-center">
<img class="contain-img rounded mw-full mh-full shadow" src="">
</div>
<div class="col-md-9 col-8 row align-content-end pl-20">
<div class="col-md-8 col-12 d-flex justify-content-end flex-column">
<div class="px-md-20 d-flex flex-column font-size-12">
<span class="title font-weight-bold pb-sm-15 text-white"></span>
<div class="d-flex flex-row font-size-18 pb-sm-15">
<span class="material-icons mr-10 font-size-24">
trending_up
</span>
<span>Rating:
<span class="font-weight-bold mr-20">
</span>
</span>
<span class="material-icons mx-10 font-size-24">
monitor
</span>
<span>Format:
<span class="font-weight-bold mr-20 text-capitalize">
</span>
</span>
<div class="d-flex episodes">
<span class="material-icons mx-10 font-size-24">
theaters
</span>
<span>Episodes:
<span class="font-weight-bold mr-20">
</span>
</span>
</div>
<div class="d-none duration">
<span class="material-icons mx-10 font-size-24">
timer
</span>
<span>Length:
<span class="font-weight-bold mr-20">
</span>
</span>
</div>
</div>
<div class="pb-15 pt-5 overflow-x-auto text-nowrap font-weight-bold">
</div>
</div>
</div>
<div class="col-md-4 d-flex justify-content-end flex-column">
<div class="d-flex flex-column flex-wrap">
<div class="btn-group mb-5" role="group">
<button class="btn btn-primary d-flex align-items-center font-weight-bold font-size-24 h-50"
type="button">
<span class="material-icons mr-10 font-size-24 w-30">
play_arrow
</span>
<span>Play</span>
</button>
<div class="btn-group dropdown with-arrow" role="group">
<button class="btn btn-square btn-primary d-flex h-50 w-50 justify-content-center"
data-toggle="dropdown" type="button" aria-haspopup="true" id="dropdown-play"
aria-expanded="false">
<span class="material-icons">expand_more</span>
<span class="sr-only">Open dropdown</span>
</button>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdown-play">
<div class="input-group w-250 form-control-lg p-0">
<div class="input-group-prepend">
<span class="input-group-text">Episode</span>
</div>
<input type="number" value="1" min="1" max="30"
class="form-control text-right form-control-lg">
</div>
</div>
</div>
</div>
<div class="btn-group mb-5 border-0" role="group">
<button class="btn d-flex align-items-center font-weight-bold font-size-16 border-0" type="button">
<span class="material-icons mr-10 font-size-18 w-30">
get_app
</span>
Download
</button>
<div class="btn-group dropdown with-arrow" role="group">
<button class="btn btn-square d-flex w-50 justify-content-center border-0"
data-toggle="dropdown" type="button" id="dropdown-download" aria-haspopup="true"
aria-expanded="false">
<span class="material-icons">expand_more</span>
<span class="sr-only">Open dropdown</span>
</button>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdown-download">
<div class="input-group w-250 form-control-lg p-0">
<div class="input-group-prepend">
<span class="input-group-text">Episode</span>
</div>
<input type="number" value="1" min="1" max="30"
class="form-control text-right form-control-lg">
</div>
</div>
</div>
</div>
<button class="btn d-flex align-items-center mb-5 font-weight-bold font-size-16">
<span class="material-icons mr-10 font-size-18 w-30">
live_tv
</span>
Trailer
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="container-xl bg-very-dark z-10">
<div class="row p-20 px-xl-0 flex-column-reverse flex-md-row">
<div class="col-md-9 px-20">
<h1 class="title font-weight-bold text-white">Sypnosis</h1>
<div class="font-size-16 pr-15">
</div>
<h1 class="title font-weight-bold text-white pt-20">Episodes</h1>
<div class="d-flex flex-wrap justify-content-start">
<!-- <div class="position-relative w-250 rounded mr-10 mb-10 overflow-hidden pointer">
<img loading="lazy"
src="https://img1.ak.crunchyroll.com/i/spire1-tmb/b199406edeebc19a7f4e4412d6e1dfcc1365964779_full.jpg"
class="w-full h-full">
<div class="position-absolute ep-title w-full p-5 text-truncate bottom-0">Episode 1 - To You, 2,000
Years in the Future -The Fall of Zhiganshina (1)</div>
</div> -->
</div>
</div>
<div class="col-md-3 px-sm-0 px-20">
<h1 class="title font-weight-bold text-white">Details</h1>
<div class="card m-0 px-20 py-10 d-flex flex-md-column flex-row overflow-x-auto text-capitalize"
id='viewDetails'>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal" id="tsearch" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content w-auto">
@ -52,335 +199,6 @@
</div>
</div>
</div>
<div class="modal modal-full" id="viewAnime" tabindex="-1" role="dialog">
<div class="h-full modal-content bg-very-dark p-0 overflow-y-auto">
<button class="close pointer" data-dismiss="modal" type="button" aria-label="Close">
<span>×</span>
</button>
<div class="h-md-half w-full position-relative z-20">
<div class="h-full w-full position-absolute banner bg-dark-light" id="viewBanner"
style="background-image: linear-gradient(0deg, rgba(17,20,23,1) 0%, rgba(17,20,23,0.80) 25%, rgba(17,20,23,0.40) 50%, rgba(37,40,44,0) 100%)!important">
</div>
<div class="d-flex h-full top w-full">
<div class="container-xl w-full">
<div class="row d-flex justify-content-end flex-row h-full px-20 pt-20 px-xl-0">
<div class="col-md-3 col-4 d-flex h-full justify-content-end flex-column pb-15 align-items-center">
<img class="contain-img rounded mw-full mh-full shadow" id="viewImg"
src="">
</div>
<div class="col-md-9 col-8 row align-content-end pl-20">
<div class="col-md-8 col-12 d-flex justify-content-end flex-column">
<div class="px-md-20 d-flex flex-column font-size-12">
<span class="title font-weight-bold pb-sm-15 text-white" id="viewTitle"></span>
<div class="d-flex flex-row font-size-18 pb-sm-15" id="viewLabels">
<span class="material-icons mr-10 font-size-24">
trending_up
</span>
<span>Rating:
<span class="font-weight-bold mr-20" id="viewRating">
</span>
</span>
<span class="material-icons mx-10 font-size-24">
monitor
</span>
<span>Format:
<span class="font-weight-bold mr-20 text-capitalize" id="viewFormat">
</span>
</span>
<div class="d-flex episodes">
<span class="material-icons mx-10 font-size-24">
theaters
</span>
<span>Episodes:
<span class="font-weight-bold mr-20" id="viewEpisode">
</span>
</span>
</div>
<div class="d-none duration">
<span class="material-icons mx-10 font-size-24">
timer
</span>
<span>Length:
<span class="font-weight-bold mr-20" id="viewDuration">
</span>
</span>
</div>
</div>
<div class="pb-15 pt-5 overflow-x-auto text-nowrap font-weight-bold" id="viewBadges">
</div>
</div>
</div>
<div class="col-md-4 d-flex justify-content-end flex-column">
<div class="d-flex flex-column flex-wrap" id="viewPlayback">
<div class="btn-group mb-5" role="group">
<button class="btn btn-primary d-flex align-items-center font-weight-bold font-size-24 h-50"
type="button" id="viewPlay">
<span class="material-icons mr-10 font-size-24 w-30">
play_arrow
</span>
<span id="viewPlayText">Play</span>
</button>
<div class="btn-group dropdown with-arrow" role="group">
<button class="btn btn-square btn-primary d-flex h-50 w-50 justify-content-center"
data-toggle="dropdown" type="button" id="dropdown-play" aria-haspopup="true"
aria-expanded="false">
<span class="material-icons">expand_more</span>
<span class="sr-only">Open dropdown</span>
</button>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdown-play">
<div class="input-group w-250 form-control-lg p-0">
<div class="input-group-prepend">
<span class="input-group-text">Episode</span>
</div>
<input type="number" value="1" min="1" max="30"
class="form-control text-right form-control-lg" id="viewPlayEp">
</div>
</div>
</div>
</div>
<div class="btn-group mb-5 border-0" role="group">
<button class="btn d-flex align-items-center font-weight-bold font-size-16 border-0" type="button"
id="viewDownload">
<span class="material-icons mr-10 font-size-18 w-30">
get_app
</span>
Download
</button>
<div class="btn-group dropdown with-arrow" role="group">
<button class="btn btn-square d-flex w-50 justify-content-center border-0"
data-toggle="dropdown" type="button" id="dropdown-download" aria-haspopup="true"
aria-expanded="false">
<span class="material-icons">expand_more</span>
<span class="sr-only">Open dropdown</span>
</button>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdown-download">
<div class="input-group w-250 form-control-lg p-0">
<div class="input-group-prepend">
<span class="input-group-text">Episode</span>
</div>
<input type="number" value="1" min="1" max="30"
class="form-control text-right form-control-lg" id="viewDownloadEp">
</div>
</div>
</div>
</div>
<button class="btn d-flex align-items-center mb-5 font-weight-bold font-size-16" type="button"
id="viewTrailer">
<span class="material-icons mr-10 font-size-18 w-30">
live_tv
</span>
Trailer
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="container-xl bg-very-dark z-10">
<div class="row p-20 px-xl-0 flex-column-reverse flex-md-row">
<div class="col-md-9 px-20">
<h1 class="title font-weight-bold text-white">Sypnosis</h1>
<div class="font-size-16 pr-15" id="viewDescription">
</div>
<h1 class="title font-weight-bold text-white pt-20">Episodes</h1>
<div id="episodes" class="d-flex flex-wrap justify-content-start">
<div class="position-relative w-250 rounded mr-10 mb-10 overflow-hidden pointer">
<img loading="lazy"
src="https://img1.ak.crunchyroll.com/i/spire1-tmb/b199406edeebc19a7f4e4412d6e1dfcc1365964779_full.jpg"
class="w-full h-full">
<div class="position-absolute ep-title w-full p-5 text-truncate bottom-0">Episode 1 - To You, 2,000
Years in the Future -The Fall of Zhiganshina (1)</div>
</div>
<div class="position-relative w-250 rounded mr-10 mb-10 overflow-hidden pointer">
<img loading="lazy"
src="https://img1.ak.crunchyroll.com/i/spire3-tmb/b9fbee83c6c9a6353383a36b81d861211365965650_full.jpg"
class="w-full h-full">
<div class="position-absolute ep-title w-full p-5 text-truncate bottom-0">Episode 2 - That Day - The
Fall of Zhiganshina (2)</div>
</div>
<div class="position-relative w-250 rounded mr-10 mb-10 overflow-hidden pointer">
<img loading="lazy"
src="https://img1.ak.crunchyroll.com/i/spire3-tmb/c7b6627f8880562f34268096f9c55c051366564160_full.jpg"
class="w-full h-full">
<div class="position-absolute ep-title w-full p-5 text-truncate bottom-0">Episode 3 - A Dim Light in
the Darkness of Despair - Humanity Rises Again (1)</div>
</div>
<div class="position-relative w-250 rounded mr-10 mb-10 overflow-hidden pointer">
<img loading="lazy"
src="https://img1.ak.crunchyroll.com/i/spire2-tmb/941f10ee007bd7a2704d00dfb460c8fa1367145015_full.jpg"
class="w-full h-full">
<div class="position-absolute ep-title w-full p-10 text-truncate bottom-0">Episode 4 - Night of the
Graduation Ceremony - Humanity Rises Again (2)</div>
</div>
<div class="position-relative w-250 rounded mr-10 mb-10 overflow-hidden pointer">
<img loading="lazy"
src="https://img1.ak.crunchyroll.com/i/spire2-tmb/cc56e86eb68f3afde55d62e008fddb441367805554_full.jpg"
class="w-full h-full">
<div class="position-absolute ep-title w-full p-10 text-truncate bottom-0">Episode 5 - First Battle -
Battle of Trost (1)</div>
</div>
<div class="position-relative w-250 rounded mr-10 mb-10 overflow-hidden pointer">
<img loading="lazy"
src="https://img1.ak.crunchyroll.com/i/spire4-tmb/0b9d827f813bd0f5b934721b7cce37d31368457914_full.jpg"
class="w-full h-full">
<div class="position-absolute ep-title w-full p-10 text-truncate bottom-0">Episode 6 - The World the
Girl Saw - Battle for Trost (2)</div>
</div>
<div class="position-relative w-250 rounded mr-10 mb-10 overflow-hidden pointer">
<img loading="lazy"
src="https://img1.ak.crunchyroll.com/i/spire3-tmb/adea712fbf73a3096ace5c4bcfb94ab71368954327_full.jpg"
class="w-full h-full">
<div class="position-absolute ep-title w-full p-10 text-truncate bottom-0">Episode 7 - The Small Blade -
The Battle for Trost (3)</div>
</div>
<div class="position-relative w-250 rounded mr-10 mb-10 overflow-hidden pointer">
<img loading="lazy"
src="https://img1.ak.crunchyroll.com/i/spire2-tmb/35c4c2b8bb74d8ee888aeff5a90e911c1369526858_full.jpg"
class="w-full h-full">
<div class="position-absolute ep-title w-full p-10 text-truncate bottom-0">Episode 8 - Hearing the
Heartbeat - The Battle for Trost (4)</div>
</div>
<div class="position-relative w-250 rounded mr-10 mb-10 overflow-hidden pointer">
<img loading="lazy"
src="https://img1.ak.crunchyroll.com/i/spire1-tmb/dbe188f8378a1fbeb6bd75dca5f4833d1370123553_full.jpg"
class="w-full h-full">
<div class="position-absolute ep-title w-full p-10 text-truncate bottom-0">Episode 9 - Where the Left
Arm Went - The Battle for Trost (5)</div>
</div>
<div class="position-relative w-250 rounded mr-10 mb-10 overflow-hidden pointer">
<img loading="lazy"
src="https://img1.ak.crunchyroll.com/i/spire3-tmb/d817405dd8bb881c6cbea6bfaff591c21370729401_full.jpg"
class="w-full h-full">
<div class="position-absolute ep-title w-full p-10 text-truncate bottom-0">Episode 10 - Response - The
Battle for Trost (6)</div>
</div>
<div class="position-relative w-250 rounded mr-10 mb-10 overflow-hidden pointer">
<img loading="lazy"
src="https://img1.ak.crunchyroll.com/i/spire2-tmb/d178c066f3340c55c1f77f777f9082fd1371318103_full.jpg"
class="w-full h-full">
<div class="position-absolute ep-title w-full p-10 text-truncate bottom-0">Episode 11 - Icon - The
Battle for Trost (7)</div>
</div>
<div class="position-relative w-250 rounded mr-10 mb-10 overflow-hidden pointer">
<img loading="lazy"
src="https://img1.ak.crunchyroll.com/i/spire4-tmb/6401b828d7db85669e185d115fa102a41371935223_full.jpg"
class="w-full h-full">
<div class="position-absolute ep-title w-full p-10 text-truncate bottom-0">Episode 12 - Wound - The
Battle for Trost (8)</div>
</div>
<div class="position-relative w-250 rounded mr-10 mb-10 overflow-hidden pointer">
<img loading="lazy"
src="https://img1.ak.crunchyroll.com/i/spire1-tmb/69349336c3ef4817e40d7f4b99bee4e51372540942_full.jpg"
class="w-full h-full">
<div class="position-absolute ep-title w-full p-10 text-truncate bottom-0">Episode 13 - Primal Desires -
The Battle for Trost (9)</div>
</div>
<div class="position-relative w-250 rounded mr-10 mb-10 overflow-hidden pointer">
<img loading="lazy"
src="https://img1.ak.crunchyroll.com/i/spire4-tmb/220fb12b27221cc389ea48d4e1a478fd1373166901_full.jpg"
class="w-full h-full">
<div class="position-absolute ep-title w-full p-10 text-truncate bottom-0">Episode 13.5 - Since That Day
</div>
</div>
<div class="position-relative w-250 rounded mr-10 overflow-hidden pointer">
<img loading="lazy"
src="https://img1.ak.crunchyroll.com/i/spire1-tmb/94536ae32c4df9f96d8d8194c674c45d1373752009_full.jpg"
class="w-full h-full">
<div class="position-absolute ep-title w-full p-10 text-truncate bottom-0">Episode 14 - Still Can't See
- Night Before the Counteroffensive (1)</div>
</div>
<div class="position-relative w-250 rounded mr-10 mb-10 overflow-hidden pointer">
<img loading="lazy"
src="https://img1.ak.crunchyroll.com/i/spire1-tmb/745d6f6f240ffc99cc08f4f4d52f6e0b1374356790_full.jpg"
class="w-full h-full">
<div class="position-absolute ep-title w-full p-10 text-truncate bottom-0">Episode 15 - Special Ops
Squad - Night Before the Counteroffensive (2)</div>
</div>
<div class="position-relative w-250 rounded mr-10 mb-10 overflow-hidden pointer">
<img loading="lazy"
src="https://img1.ak.crunchyroll.com/i/spire4-tmb/91e17edd483923b330428ac5de39796d1374964414_full.jpg"
class="w-full h-full">
<div class="position-absolute ep-title w-full p-10 text-truncate bottom-0">Episode 16 - What Should Be
Done - Night Before the Counteroffensive (3)</div>
</div>
<div class="position-relative w-250 rounded mr-10 mb-10 overflow-hidden pointer">
<img loading="lazy"
src="https://img1.ak.crunchyroll.com/i/spire1-tmb/af666f0f1d7dac4aea8fd7b548419e001375570078_full.jpg"
class="w-full h-full">
<div class="position-absolute ep-title w-full p-10 text-truncate bottom-0">Episode 17 - Female Titan -
57th Expedition Beyond the Walls (1)</div>
</div>
<div class="position-relative w-250 rounded mr-10 mb-10 overflow-hidden pointer">
<img loading="lazy"
src="https://img1.ak.crunchyroll.com/i/spire2-tmb/96361bbd829a6ba6aa8d7e803b18ef3e1376169742_full.jpg"
class="w-full h-full">
<div class="position-absolute ep-title w-full p-10 text-truncate bottom-0">Episode 18 - Forest of Giant
Trees - 57th Expedition Beyond the Walls (2)</div>
</div>
<div class="position-relative w-250 rounded mr-10 mb-10 overflow-hidden pointer">
<img loading="lazy"
src="https://img1.ak.crunchyroll.com/i/spire4-tmb/fbb4f7f661b9fe2e169bde507c96df441376778966_full.jpg"
class="w-full h-full">
<div class="position-absolute ep-title w-full p-10 text-truncate bottom-0">Episode 19 - Bite - 57th
Expedition Beyond the Walls (3)</div>
</div>
<div class="position-relative w-250 rounded mr-10 mb-10 overflow-hidden pointer">
<img loading="lazy"
src="https://img1.ak.crunchyroll.com/i/spire2-tmb/d6f7322acdd63ccc27387feea0fd8a661377384263_full.jpg"
class="w-full h-full">
<div class="position-absolute ep-title w-full p-10 text-truncate bottom-0">Episode 20 - Erwin Smith -
57th Expedition Beyond the Walls (4)</div>
</div>
<div class="position-relative w-250 rounded mr-10 mb-10 overflow-hidden pointer">
<img loading="lazy"
src="https://img1.ak.crunchyroll.com/i/spire4-tmb/554197194719955e2f746fc300540f321377988494_full.jpg"
class="w-full h-full">
<div class="position-absolute ep-title w-full p-10 text-truncate bottom-0">Episode 21 - Crushing Blow -
57th Expedition Beyond the Walls (5)</div>
</div>
<div class="position-relative w-250 rounded mr-10 overflow-hidden pointer">
<img loading="lazy"
src="https://img1.ak.crunchyroll.com/i/spire2-tmb/350c8f1fddd535e04cfb4b29b4e3ab751378592642_full.jpg"
class="w-full h-full">
<div class="position-absolute ep-title w-full p-10 text-truncate bottom-0">Episode 22 - The Defeated -
57th Expedition Beyond the Walls (6)</div>
</div>
<div class="position-relative w-250 rounded mr-10 overflow-hidden pointer">
<img loading="lazy"
src="https://img1.ak.crunchyroll.com/i/spire3-tmb/5c2122871212f063628d60a0280568bf1379190681_full.jpg"
class="w-full h-full">
<div class="position-absolute ep-title w-full p-10 text-truncate bottom-0">Episode 23 - Smile - Raid on
Stohess District (1)</div>
</div>
<div class="position-relative w-250 rounded mr-10 overflow-hidden pointer">
<img loading="lazy"
src="https://img1.ak.crunchyroll.com/i/spire3-tmb/83697a20a24c8d623cba002043e8e5241379794821_full.jpg"
class="w-full h-full">
<div class="position-absolute ep-title w-full p-10 text-truncate bottom-0">Episode 24 - Mercy - Raid on
Stohess District (2)</div>
</div>
<div class="position-relative w-250 rounded mr-10 overflow-hidden pointer">
<img loading="lazy"
src="https://img1.ak.crunchyroll.com/i/spire3-tmb/09379010a52b6c46c3e8fd0939974a071380395420_full.jpg"
class="w-full h-full">
<div class="position-absolute ep-title w-full p-10 text-truncate bottom-0">Episode 25 - The Wall - Raid
on Stohess District (3)</div>
</div>
</div>
</div>
<div class="col-md-3 px-sm-0 px-20">
<h1 class="title font-weight-bold text-white">Details</h1>
<div class="card m-0 px-20 py-10 d-flex flex-md-column flex-row overflow-x-auto text-capitalize"
id='viewDetails'>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- <div class="modal modal-full bg-dark-light" id="view" tabindex="-1" role="dialog">
<div class="modal-dialog bg-transparent" role="document">
<div class="h-full modal-content bg-transparent">

View file

@ -4,6 +4,7 @@ import { client } from './main.js'
import { searchParams, DOMPARSER, countdown } from './util.js'
import { alRequest } from './anilist.js'
import { nyaaRss } from './rss.js'
import { viewMedia } from './interface.js'
import halfmoon from 'halfmoon'
import anitomyscript from 'anitomyscript'
const torrentRx = /(^magnet:){1}|(^[A-F\d]{8,40}$){1}|(.*\.torrent$){1}/i
@ -61,7 +62,7 @@ function traceAnime (image, type) { // WAIT lookup logic
fetch(url, options).then(res => res.json()).then(async result => {
if (result.docs[0].similarity >= 0.85) {
const res = await alRequest({ method: 'SearchIDSingle', id: result.docs[0].anilist_id })
viewAnime(res.data.Media)
viewMedia(res.data.Media)
} else {
halfmoon.initStickyAlert({
content: 'Couldn\'t find anime for specified image! Try to remove black bars, or use a more detailed image.',
@ -73,7 +74,7 @@ function traceAnime (image, type) { // WAIT lookup logic
})
}
// events
navNowPlaying.onclick = () => viewAnime(client.nowPlaying?.media)
navNowPlaying.onclick = () => viewMedia(client.nowPlaying?.media)
// AL lookup logic
// these really shouldnt be global

View file

@ -308,10 +308,11 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util.js */ "./app/js/util.js");
/* harmony import */ var _anilist_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./anilist.js */ "./app/js/anilist.js");
/* harmony import */ var _rss_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./rss.js */ "./app/js/rss.js");
/* harmony import */ var halfmoon__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! halfmoon */ "halfmoon");
/* harmony import */ var halfmoon__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(halfmoon__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var anitomyscript__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! anitomyscript */ "anitomyscript");
/* harmony import */ var anitomyscript__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(anitomyscript__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _interface_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./interface.js */ "./app/js/interface.js");
/* harmony import */ var halfmoon__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! halfmoon */ "halfmoon");
/* harmony import */ var halfmoon__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(halfmoon__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var anitomyscript__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! anitomyscript */ "anitomyscript");
/* harmony import */ var anitomyscript__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(anitomyscript__WEBPACK_IMPORTED_MODULE_6__);
/* provided dependency */ var console = __webpack_require__(/*! ./node_modules/console-browserify/index.js */ "./node_modules/console-browserify/index.js");
/* eslint-env browser */
/* global searchText, navNowPlaying */
@ -321,6 +322,7 @@ __webpack_require__.r(__webpack_exports__);
const torrentRx = /(^magnet:){1}|(^[A-F\d]{8,40}$){1}|(.*\.torrent$){1}/i
const imageRx = /\.(jpeg|jpg|gif|png|webp)/i
window.addEventListener('paste', async e => { // WAIT image lookup on paste, or add torrent on paste
@ -360,7 +362,7 @@ if (_util_js__WEBPACK_IMPORTED_MODULE_1__.searchParams.get('link')) {
window.location = '/app/#home'
}
function traceAnime (image, type) { // WAIT lookup logic
halfmoon__WEBPACK_IMPORTED_MODULE_4___default().initStickyAlert({
halfmoon__WEBPACK_IMPORTED_MODULE_5___default().initStickyAlert({
content: `Looking up anime for image.<br><img class="w-200 rounded pt-5" src="${image}">`
})
let options
@ -376,9 +378,9 @@ function traceAnime (image, type) { // WAIT lookup logic
fetch(url, options).then(res => res.json()).then(async result => {
if (result.docs[0].similarity >= 0.85) {
const res = await (0,_anilist_js__WEBPACK_IMPORTED_MODULE_2__.alRequest)({ method: 'SearchIDSingle', id: result.docs[0].anilist_id })
viewAnime(res.data.Media)
;(0,_interface_js__WEBPACK_IMPORTED_MODULE_4__.viewMedia)(res.data.Media)
} else {
halfmoon__WEBPACK_IMPORTED_MODULE_4___default().initStickyAlert({
halfmoon__WEBPACK_IMPORTED_MODULE_5___default().initStickyAlert({
content: 'Couldn\'t find anime for specified image! Try to remove black bars, or use a more detailed image.',
title: 'Search Failed',
alertType: 'alert-danger',
@ -388,7 +390,7 @@ function traceAnime (image, type) { // WAIT lookup logic
})
}
// events
navNowPlaying.onclick = () => viewAnime(_main_js__WEBPACK_IMPORTED_MODULE_0__.client.nowPlaying.media)
navNowPlaying.onclick = () => (0,_interface_js__WEBPACK_IMPORTED_MODULE_4__.viewMedia)(_main_js__WEBPACK_IMPORTED_MODULE_0__.client.nowPlaying.media)
// AL lookup logic
// these really shouldnt be global
@ -411,7 +413,7 @@ const episodeRx = /Episode (\d+) - (.*)/
// this is fucked beyond belief, this is why you use frameworks
/* global view, viewImg, viewTitle, viewDesc, viewDetails, viewSeason, viewMediaInfo, viewPlay, viewTrailer, viewRelationsGallery, viewSynonym, viewSynonymText, viewEpisodesWrapper, episodes, trailerVideo, trailerClose */
function viewAnime (media) {
halfmoon__WEBPACK_IMPORTED_MODULE_4___default().showModal('view')
halfmoon__WEBPACK_IMPORTED_MODULE_5___default().showModal('view')
view.setAttribute('style', `background-image: url(${media.bannerImage}) !important`)
viewImg.src = media.coverImage.extraLarge
viewTitle.innerHTML = media.title.userPreferred
@ -427,7 +429,7 @@ function viewAnime (media) {
}
viewSeason.innerHTML = `${(media.season ? media.season.toLowerCase() + ' ' : '') + (media.seasonYear ? media.seasonYear : '')}`
viewMediaInfo.innerHTML = `${media.format ? '<span>' + media.format + '</span>' : ''}${media.episodes ? '<span>' + media.episodes + ' Episodes</span>' : ''}${media.duration ? '<span>' + media.duration + ' Minutes</span>' : ''}`
viewPlay.onclick = () => { nyaaSearch(media, 1); halfmoon__WEBPACK_IMPORTED_MODULE_4___default().toggleModal('view') }
viewPlay.onclick = () => { nyaaSearch(media, 1); halfmoon__WEBPACK_IMPORTED_MODULE_5___default().toggleModal('view') }
if (media.trailer) {
viewTrailer.removeAttribute('disabled', '')
viewTrailer.onclick = () =>
@ -470,7 +472,7 @@ function viewAnime (media) {
</div>
</div>`
template.onclick = async () => {
halfmoon__WEBPACK_IMPORTED_MODULE_4___default().hideModal('view')
halfmoon__WEBPACK_IMPORTED_MODULE_5___default().hideModal('view')
const res = await (0,_anilist_js__WEBPACK_IMPORTED_MODULE_2__.alRequest)({ method: 'SearchIDSingle', id: edge.node.id })
viewAnime(res.data.Media)
}
@ -495,7 +497,7 @@ function viewAnime (media) {
temp.innerHTML = `
<img loading="lazy" src="${episode.thumbnail}" class="w-full h-full">
<div class="position-absolute ep-title w-full p-10 text-truncate bottom-0">${episode.title}</div>`
temp.onclick = () => { nyaaSearch(media, episodeRx.exec(episode.title)[1]); halfmoon__WEBPACK_IMPORTED_MODULE_4___default().toggleModal('view') }
temp.onclick = () => { nyaaSearch(media, episodeRx.exec(episode.title)[1]); halfmoon__WEBPACK_IMPORTED_MODULE_5___default().toggleModal('view') }
frag.appendChild(temp)
})
episodes.appendChild(frag)
@ -508,7 +510,7 @@ trailerClose.onclick = () => {
}
function trailerPopup (trailer) {
trailerVideo.src = ''
halfmoon__WEBPACK_IMPORTED_MODULE_4___default().toggleModal('trailer')
halfmoon__WEBPACK_IMPORTED_MODULE_5___default().toggleModal('trailer')
switch (trailer.site) { // should support the other possible sites too, but i cant find any examples
case 'youtube':
trailerVideo.src = 'https://www.youtube.com/embed/' + trailer.id
@ -548,7 +550,7 @@ async function nyaaSearch (media, episode, isOffline) {
const results = await (0,_rss_js__WEBPACK_IMPORTED_MODULE_3__.nyaaRss)(media, episode, isOffline)
if (results.children.length === 0) {
halfmoon__WEBPACK_IMPORTED_MODULE_4___default().initStickyAlert({
halfmoon__WEBPACK_IMPORTED_MODULE_5___default().initStickyAlert({
content: `Couldn't find torrent for ${media.title.userPreferred} Episode ${parseInt(episode)}! Try specifying a torrent manually.`,
title: 'Search Failed',
alertType: 'alert-danger',
@ -557,7 +559,7 @@ async function nyaaSearch (media, episode, isOffline) {
} else {
table.innerHTML = ''
table.appendChild(results)
halfmoon__WEBPACK_IMPORTED_MODULE_4___default().toggleModal('tsearch')
halfmoon__WEBPACK_IMPORTED_MODULE_5___default().toggleModal('tsearch')
}
}
@ -591,8 +593,8 @@ async function resolveFileMedia (opts) {
}
}
const parsePromises = opts.fileName.constructor === Array
? opts.fileName.map(name => anitomyscript__WEBPACK_IMPORTED_MODULE_5___default()(name))
: [anitomyscript__WEBPACK_IMPORTED_MODULE_5___default()(opts.fileName)]
? opts.fileName.map(name => anitomyscript__WEBPACK_IMPORTED_MODULE_6___default()(name))
: [anitomyscript__WEBPACK_IMPORTED_MODULE_6___default()(opts.fileName)]
const parseObjs = await Promise.all(parsePromises)
await Promise.all([...new Set(parseObjs.map(obj => obj.anime_title))].map(title => resolveTitle(title)))
const assoc = {}
@ -713,7 +715,6 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./util.js */ "./app/js/util.js");
/* harmony import */ var halfmoon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! halfmoon */ "halfmoon");
/* harmony import */ var halfmoon__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(halfmoon__WEBPACK_IMPORTED_MODULE_6__);
/* provided dependency */ var console = __webpack_require__(/*! ./node_modules/console-browserify/index.js */ "./node_modules/console-browserify/index.js");
/* eslint-env browser */
/* global navHome, searchClear, searchWrapper, skeletonCardTemplate, bareCardTemplate, fullCardTemplate, home, searchText, searchGenre, searchYear, searchSeason, searchFormat, searchStatus, searchSort, navSchedule, homeContinueMore, homeReleasesMore, homePlanningMore, homeTrendingMore, homeRomanceMore, homeActionMore, homeContinue, homeReleases, homePlanning, homeTrending, homeRomance, homeAction */
@ -789,7 +790,6 @@ function loadHomePage () {
}
if (Object.keys(def).length !== Object.keys(opts).length) {
const mediaList = (await (0,_anilist_js__WEBPACK_IMPORTED_MODULE_0__.alRequest)(opts)).data.Page.media
viewMedia(mediaList[0])
galleryAppend({ media: mediaList, gallery: browseGallery, method: 'search', page: page || 1 })
} else {
searchClear.classList.remove('text-primary')
@ -817,7 +817,7 @@ function loadHomePage () {
;(0,_anime_js__WEBPACK_IMPORTED_MODULE_1__.resolveFileMedia)({ fileName: doc.querySelector('item title').textContent, isRelease: true }).then(mediaInformation => {
if (_settings_js__WEBPACK_IMPORTED_MODULE_3__.settings.other1) {
const notification = new Notification(mediaInformation.media.title.userPreferred, {
body: `Episode ${mediaInformation.episode} was just released!`,
body: `Episode ${mediaInformation.episodeNumber} was just released!`,
icon: mediaInformation.media.coverImage.medium
})
notification.onclick = async () => {
@ -903,7 +903,7 @@ function loadHomePage () {
}
media = media.media
}
cards.push(cardCreator({ media: media, schedule: opts.schedule, onclick: () => (0,_anime_js__WEBPACK_IMPORTED_MODULE_1__.viewAnime)(media) }))
cards.push(cardCreator({ media: media, schedule: opts.schedule, onclick: () => viewMedia(media) }))
})
opts.gallery.append(...cards)
canScroll = true
@ -1092,47 +1092,47 @@ function trailerPopup (trailer) {
break
}
}
/* global viewImg, viewTitle, viewRating, viewFormat, viewLabels, viewDuration, viewEpisode, viewBadges, viewPlay, viewPlayEp, viewPlayText, viewDescription, viewDetails, viewDownload, viewDownloadEp, trailerVideo, viewTrailer, viewPlayback, viewBanner */
/* global trailerVideo, viewAnime */
const viewNodes = viewAnime.querySelectorAll('*')
function viewMedia (input) {
console.log(input)
halfmoon__WEBPACK_IMPORTED_MODULE_6___default().showModal('viewAnime')
const media = (0,_util_js__WEBPACK_IMPORTED_MODULE_5__.flattenObj)(input)
viewImg.src = media.extraLarge || media.medium
viewTitle.textContent = media.userPreferred
viewRating.textContent = media.averageScore + '%'
viewFormat.textContent = media.format === 'TV' ? media.format : media.format?.toLowerCase()
viewNodes[9].src = media.extraLarge || media.medium
viewNodes[13].textContent = media.userPreferred
viewNodes[17].textContent = media.averageScore + '%'
viewNodes[20].textContent = media.format === 'TV' ? media.format : media.format?.toLowerCase()
if (media.episodes === 1 || !media.episodes) {
viewLabels.classList.add('movie')
viewDuration.textContent = media.duration + ' min'
viewNodes[14].classList.add('movie')
viewNodes[28].textContent = media.duration + ' min'
} else {
viewEpisode.textContent = media.episodes
viewNodes[24].textContent = media.episodes
}
viewBadges.textContent = ''
viewBadges.append(...genreBadges(media.genres))
viewNodes[29].textContent = ''
viewNodes[29].append(...genreBadges(media.genres))
if (media.episodes || media.episode) {
viewPlayback.classList.remove('hidden')
viewPlay.onclick = () => (0,_anime_js__WEBPACK_IMPORTED_MODULE_1__.nyaaSearch)(input, viewPlayEp.value)
viewPlayEp.value = media.progress || 1
viewPlayText.textContent = media.progress && media.progress !== media.episodes ? 'Continue' : 'Play'
viewNodes[31].classList.remove('hidden')
viewNodes[33].onclick = () => { ;(0,_anime_js__WEBPACK_IMPORTED_MODULE_1__.nyaaSearch)(input, Number(viewNodes[44].value) || 1); halfmoon__WEBPACK_IMPORTED_MODULE_6___default().hideModal('viewAnime') }
viewNodes[44].value = Number(media.progress) + 1 || 1
viewNodes[35].textContent = media.progress && media.progress !== media.episodes ? 'Continue' : 'Play'
viewDownload.onclick = () => (0,_anime_js__WEBPACK_IMPORTED_MODULE_1__.nyaaSearch)(input, viewPlayEp.value, true)
viewDownloadEp.value = media.progress || 1
viewNodes[46].onclick = () => { ;(0,_anime_js__WEBPACK_IMPORTED_MODULE_1__.nyaaSearch)(input, Number(viewNodes[56].value) || 1, true); halfmoon__WEBPACK_IMPORTED_MODULE_6___default().hideModal('viewAnime') }
viewNodes[56].value = Number(media.progress) + 1 || 1
} else {
viewPlayback.classList.add('hidden')
viewNodes[31].classList.add('hidden')
}
if (media.bannerImage) {
viewBanner.style = `background-image: linear-gradient(0deg, rgba(17,20,23,1) 0%, rgba(17,20,23,0.80) 25%, rgba(17,20,23,0.40) 50%, rgba(37,40,44,0) 100%), url('${media.bannerImage}') !important`
viewNodes[4].style = `background-image: linear-gradient(0deg, rgba(17,20,23,1) 0%, rgba(17,20,23,0.80) 25%, rgba(17,20,23,0.40) 50%, rgba(37,40,44,0) 100%), url('${media.bannerImage}') !important`
} else {
viewBanner.style = 'background-image: linear-gradient(0deg, rgba(17,20,23,1) 0%, rgba(17,20,23,0.80) 25%, rgba(17,20,23,0.40) 50%, rgba(37,40,44,0) 100%) !important'
viewNodes[4].style = 'background-image: linear-gradient(0deg, rgba(17,20,23,1) 0%, rgba(17,20,23,0.80) 25%, rgba(17,20,23,0.40) 50%, rgba(37,40,44,0) 100%) !important'
}
viewTrailer.onclick = () => trailerPopup(input.trailer)
viewNodes[57].onclick = () => trailerPopup(input.trailer)
viewDescription.innerHTML = media.description
viewNodes[63].innerHTML = media.description
viewDetails.textContent = ''
viewDetails.append(...mediaDetails(media))
console.log(media)
viewNodes[68].textContent = ''
viewNodes[68].append(...mediaDetails(media))
}
let alID // login icon
@ -1512,7 +1512,7 @@ async function saveSettings () {
}
}
if (!Object.values(settings).length) {
if (Object.keys(settings).length !== settingsElements.length + 1) {
saveSettings()
}
function restoreDefaults () {
@ -1544,7 +1544,7 @@ for (const setting of Object.entries(settings)) {
if (settingElement) settingElement.type === 'checkbox' ? settingElement.checked = setting[1] : settingElement.value = setting[1]
}
other1.onclick = () => Notification.requestPermission().then(perm => { perm === 'denied' ? other1.checked = false : other1.checked = true })
other1.oninput = () => other1.checked && Notification.requestPermission().then(perm => { perm === 'denied' ? other1.checked = false : other1.checked = true })
/***/ }),

File diff suppressed because one or more lines are too long

View file

@ -4,7 +4,7 @@
// THIS IS WHY YOU FUCKING USE FRAMEWORKS
import { alRequest } from './anilist.js'
import { resolveFileMedia, viewAnime, relations, nyaaSearch } from './anime.js'
import { resolveFileMedia, relations, nyaaSearch } from './anime.js'
import { getRSSurl, getRSSContent } from './rss.js'
import { settings } from './settings.js'
import { client } from './main.js'
@ -73,7 +73,6 @@ export function loadHomePage () {
}
if (Object.keys(def).length !== Object.keys(opts).length) {
const mediaList = (await alRequest(opts)).data.Page.media
viewMedia(mediaList[0])
galleryAppend({ media: mediaList, gallery: browseGallery, method: 'search', page: page || 1 })
} else {
searchClear.classList.remove('text-primary')
@ -101,7 +100,7 @@ export function loadHomePage () {
resolveFileMedia({ fileName: doc.querySelector('item title').textContent, isRelease: true }).then(mediaInformation => {
if (settings.other1) {
const notification = new Notification(mediaInformation.media.title.userPreferred, {
body: `Episode ${mediaInformation.episode} was just released!`,
body: `Episode ${mediaInformation.episodeNumber} was just released!`,
icon: mediaInformation.media.coverImage.medium
})
notification.onclick = async () => {
@ -187,7 +186,7 @@ export function loadHomePage () {
}
media = media.media
}
cards.push(cardCreator({ media: media, schedule: opts.schedule, onclick: () => viewAnime(media) }))
cards.push(cardCreator({ media: media, schedule: opts.schedule, onclick: () => viewMedia(media) }))
})
opts.gallery.append(...cards)
canScroll = true
@ -376,47 +375,47 @@ function trailerPopup (trailer) {
break
}
}
/* global viewImg, viewTitle, viewRating, viewFormat, viewLabels, viewDuration, viewEpisode, viewBadges, viewPlay, viewPlayEp, viewPlayText, viewDescription, viewDetails, viewDownload, viewDownloadEp, trailerVideo, viewTrailer, viewPlayback, viewBanner */
/* global trailerVideo, viewAnime */
const viewNodes = viewAnime.querySelectorAll('*')
function viewMedia (input) {
console.log(input)
halfmoon.showModal('viewAnime')
const media = flattenObj(input)
viewImg.src = media.extraLarge || media.medium
viewTitle.textContent = media.userPreferred
viewRating.textContent = media.averageScore + '%'
viewFormat.textContent = media.format === 'TV' ? media.format : media.format?.toLowerCase()
viewNodes[9].src = media.extraLarge || media.medium
viewNodes[13].textContent = media.userPreferred
viewNodes[17].textContent = media.averageScore + '%'
viewNodes[20].textContent = media.format === 'TV' ? media.format : media.format?.toLowerCase()
if (media.episodes === 1 || !media.episodes) {
viewLabels.classList.add('movie')
viewDuration.textContent = media.duration + ' min'
viewNodes[14].classList.add('movie')
viewNodes[28].textContent = media.duration + ' min'
} else {
viewEpisode.textContent = media.episodes
viewNodes[24].textContent = media.episodes
}
viewBadges.textContent = ''
viewBadges.append(...genreBadges(media.genres))
viewNodes[29].textContent = ''
viewNodes[29].append(...genreBadges(media.genres))
if (media.episodes || media.episode) {
viewPlayback.classList.remove('hidden')
viewPlay.onclick = () => nyaaSearch(input, viewPlayEp.value)
viewPlayEp.value = media.progress || 1
viewPlayText.textContent = media.progress && media.progress !== media.episodes ? 'Continue' : 'Play'
viewNodes[31].classList.remove('hidden')
viewNodes[33].onclick = () => { nyaaSearch(input, Number(viewNodes[44].value) || 1); halfmoon.hideModal('viewAnime') }
viewNodes[44].value = Number(media.progress) + 1 || 1
viewNodes[35].textContent = media.progress && media.progress !== media.episodes ? 'Continue' : 'Play'
viewDownload.onclick = () => nyaaSearch(input, viewPlayEp.value, true)
viewDownloadEp.value = media.progress || 1
viewNodes[46].onclick = () => { nyaaSearch(input, Number(viewNodes[56].value) || 1, true); halfmoon.hideModal('viewAnime') }
viewNodes[56].value = Number(media.progress) + 1 || 1
} else {
viewPlayback.classList.add('hidden')
viewNodes[31].classList.add('hidden')
}
if (media.bannerImage) {
viewBanner.style = `background-image: linear-gradient(0deg, rgba(17,20,23,1) 0%, rgba(17,20,23,0.80) 25%, rgba(17,20,23,0.40) 50%, rgba(37,40,44,0) 100%), url('${media.bannerImage}') !important`
viewNodes[4].style = `background-image: linear-gradient(0deg, rgba(17,20,23,1) 0%, rgba(17,20,23,0.80) 25%, rgba(17,20,23,0.40) 50%, rgba(37,40,44,0) 100%), url('${media.bannerImage}') !important`
} else {
viewBanner.style = 'background-image: linear-gradient(0deg, rgba(17,20,23,1) 0%, rgba(17,20,23,0.80) 25%, rgba(17,20,23,0.40) 50%, rgba(37,40,44,0) 100%) !important'
viewNodes[4].style = 'background-image: linear-gradient(0deg, rgba(17,20,23,1) 0%, rgba(17,20,23,0.80) 25%, rgba(17,20,23,0.40) 50%, rgba(37,40,44,0) 100%) !important'
}
viewTrailer.onclick = () => trailerPopup(input.trailer)
viewNodes[57].onclick = () => trailerPopup(input.trailer)
viewDescription.innerHTML = media.description
viewNodes[63].innerHTML = media.description
viewDetails.textContent = ''
viewDetails.append(...mediaDetails(media))
console.log(media)
viewNodes[68].textContent = ''
viewNodes[68].append(...mediaDetails(media))
}
export let alID // login icon

View file

@ -39,7 +39,7 @@ async function saveSettings () {
}
}
if (!Object.values(settings).length) {
if (Object.keys(settings).length !== settingsElements.length + 1) {
saveSettings()
}
function restoreDefaults () {
@ -71,4 +71,4 @@ for (const setting of Object.entries(settings)) {
if (settingElement) settingElement.type === 'checkbox' ? settingElement.checked = setting[1] : settingElement.value = setting[1]
}
other1.onclick = () => Notification.requestPermission().then(perm => { perm === 'denied' ? other1.checked = false : other1.checked = true })
other1.oninput = () => other1.checked && Notification.requestPermission().then(perm => { perm === 'denied' ? other1.checked = false : other1.checked = true })