minor fixes
This commit is contained in:
4
build.ts
4
build.ts
@@ -52,8 +52,8 @@ for (let listing_type of ["anime", "manga", "music"]) {
|
||||
name: listing_name,
|
||||
type: listing_type,
|
||||
favourites: {
|
||||
listing: favourites_info[listing_name] ? favourites_info[listing_name].favourites.listing : false,
|
||||
chapters: favourites_info[listing_name] ? favourites_info[listing_name].favourites.chapters : [],
|
||||
listing: favourites_info[`${listing_type}-${listing_name}`] ? favourites_info[`${listing_type}-${listing_name}`].favourites.listing : false,
|
||||
chapters: favourites_info[`${listing_type}-${listing_name}`] ? favourites_info[`${listing_type}-${listing_name}`].favourites.chapters : [],
|
||||
}
|
||||
})
|
||||
).filter(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"senpai-wa-otokonoko": {
|
||||
"manga-senpai-wa-otokonoko": {
|
||||
"favourites": {
|
||||
"listing": true,
|
||||
"chapters": [
|
||||
@@ -8,13 +8,13 @@
|
||||
]
|
||||
}
|
||||
}
|
||||
"bocchi-the-boulder": {
|
||||
"anime-bocchi-the-boulder": {
|
||||
"favourites": {
|
||||
"listing": true,
|
||||
"chapters": []
|
||||
}
|
||||
},
|
||||
"not-buna": {
|
||||
"music-not-buna": {
|
||||
"favourites": {
|
||||
"listing": false,
|
||||
"chapters": [
|
||||
@@ -22,7 +22,7 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"arizona-philips": {
|
||||
"music-arizona-philips": {
|
||||
"favourites": {
|
||||
"listing": true,
|
||||
"chapters": []
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
</head>
|
||||
<body>
|
||||
<div id="main">
|
||||
<input id="master-password" type="password">
|
||||
<input id="master-password" type="password" onkeydown="detect_enter(event)">
|
||||
<button onclick="get_passwords()">get</button>
|
||||
<br>
|
||||
<span id="computed"></span>
|
||||
@@ -15,10 +15,6 @@
|
||||
<span id="computed2"></span>
|
||||
</div>
|
||||
<script>
|
||||
function get_passwords() {
|
||||
get_password(new Date(), "computed");
|
||||
get_password(new Date((new Date()).getTime() + 24 * 60 * 60 * 1000), "computed2");
|
||||
}
|
||||
async function get_password(date, el) {
|
||||
//password changes every day
|
||||
const master_bytes = new TextEncoder().encode(`${document.getElementById("master-password").value}${date.getUTCFullYear()}-${date.getUTCMonth()}-${date.getUTCDate()}`);
|
||||
@@ -32,6 +28,13 @@
|
||||
}
|
||||
document.getElementById(el).innerText = hash_hex.toLowerCase();
|
||||
}
|
||||
function get_passwords() {
|
||||
get_password(new Date(), "computed");
|
||||
get_password(new Date((new Date()).getTime() + 24 * 60 * 60 * 1000), "computed2");
|
||||
}
|
||||
function detect_enter(e) {
|
||||
if (e.key === "Enter") get_passwords();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -14,6 +14,9 @@
|
||||
.music {
|
||||
margin: 25px;
|
||||
}
|
||||
#captions-box {
|
||||
height: 1em;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
@@ -24,9 +27,25 @@
|
||||
<br>
|
||||
<audio controls>
|
||||
<source src="/music_assets/[[ listing.name ]]/[[ chapter ]].mp3" type="audio/mpeg">
|
||||
<track id="audio-captions" default kind="captions" src="/music_subtitle_assets/[[ listing.name ]]/[[ chapter ]].vtt"/>
|
||||
</audio>
|
||||
<div id="captions-box">
|
||||
</div>
|
||||
[[ component:nav ]] <!-- id: nav -->
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
let captions_ele = document.getElementById("audio-captions");
|
||||
let captions_box = document.getElementById("captions-box");
|
||||
|
||||
captions_ele.addEventListener("cuechange", () => {
|
||||
//do we need to sanitize this? surely not, right?
|
||||
captions_box.innerHTML = "";
|
||||
let active_cue = captions_ele.track.activeCues[0];
|
||||
if (active_cue) {
|
||||
captions_box.appendChild(active_cue.getCueAsHTML());
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user