2024-04-30 00:04:19 +06:00
|
|
|
import { services as s, version, repo, donations, supportedAudio, links, env } from "../config.js";
|
2022-08-12 19:36:19 +06:00
|
|
|
import { getCommitInfo } from "../sub/currentCommit.js";
|
|
|
|
import loc from "../../localization/manager.js";
|
|
|
|
import emoji from "../emoji.js";
|
2022-09-11 21:04:06 +06:00
|
|
|
import changelogManager from "../changelog/changelogManager.js";
|
2022-08-12 19:36:19 +06:00
|
|
|
|
2024-04-30 00:04:19 +06:00
|
|
|
import {
|
|
|
|
checkbox,
|
|
|
|
collapsibleList,
|
|
|
|
explanation,
|
|
|
|
footerButtons,
|
|
|
|
multiPagePopup,
|
|
|
|
popup,
|
|
|
|
popupWithBottomButtons,
|
|
|
|
sep,
|
|
|
|
settingsCategory,
|
|
|
|
switcher,
|
|
|
|
socialLink,
|
|
|
|
socialLinks,
|
|
|
|
urgentNotice,
|
|
|
|
keyboardShortcuts,
|
|
|
|
webLoc,
|
|
|
|
sponsoredList,
|
|
|
|
betaTag,
|
|
|
|
linkSVG
|
|
|
|
} from "./elements.js";
|
|
|
|
|
2022-08-12 19:36:19 +06:00
|
|
|
let com = getCommitInfo();
|
|
|
|
|
2023-08-23 01:03:31 +06:00
|
|
|
let enabledServices = Object.keys(s).filter(p => s[p].enabled).sort().map((p) => {
|
2022-12-07 01:21:07 +06:00
|
|
|
return `<br>• ${s[p].alias ? s[p].alias : p}`
|
2023-01-30 00:17:33 +06:00
|
|
|
}).join('').substring(4)
|
2022-08-12 19:36:19 +06:00
|
|
|
|
|
|
|
let donate = ``
|
|
|
|
let donateLinks = ``
|
|
|
|
let audioFormats = supportedAudio.map((p) => {
|
2022-08-16 13:14:19 +06:00
|
|
|
return { "action": p }
|
2022-08-12 19:36:19 +06:00
|
|
|
})
|
|
|
|
audioFormats.unshift({ "action": "best" })
|
2022-11-20 19:46:08 +06:00
|
|
|
for (let i in donations["links"]) {
|
|
|
|
donateLinks += `<a id="don-${i}" class="switch autowidth" href="${donations["links"][i]}" target="_blank">REPLACEME ${i}</a>`
|
2022-08-12 19:36:19 +06:00
|
|
|
}
|
|
|
|
let extr = ''
|
|
|
|
for (let i in donations["crypto"]) {
|
|
|
|
donate += `<div class="subtitle${extr}">${i} (REPLACEME)</div><div id="don-${i}" class="text-to-copy" onClick="copy('don-${i}')">${donations["crypto"][i]}</div>`
|
2022-09-28 18:21:36 +06:00
|
|
|
extr = ' top-margin'
|
2022-08-12 19:36:19 +06:00
|
|
|
}
|
2023-01-14 00:34:48 +06:00
|
|
|
|
2022-08-12 19:36:19 +06:00
|
|
|
export default function(obj) {
|
2024-05-11 01:05:24 +06:00
|
|
|
const t = (str, replace) => {
|
|
|
|
return loc(obj.lang, str, replace)
|
|
|
|
}
|
2023-03-10 00:41:17 +06:00
|
|
|
|
2023-01-14 00:34:48 +06:00
|
|
|
audioFormats[0]["text"] = t('SettingsAudioFormatBest');
|
|
|
|
|
2022-08-12 19:36:19 +06:00
|
|
|
try {
|
2023-08-05 00:43:12 +06:00
|
|
|
return `
|
|
|
|
<!DOCTYPE html>
|
2023-07-14 22:19:58 +06:00
|
|
|
<html lang="${obj.lang}">
|
2022-08-12 19:36:19 +06:00
|
|
|
<head>
|
2024-01-13 00:20:36 +00:00
|
|
|
<meta charset="utf-8">
|
2024-05-11 01:05:24 +06:00
|
|
|
<meta name="viewport" content="viewport-fit=cover, width=device-width, height=device-height, initial-scale=1, maximum-scale=1">
|
2022-08-12 19:36:19 +06:00
|
|
|
|
2023-08-05 00:43:12 +06:00
|
|
|
<title>${t("AppTitleCobalt")}</title>
|
2022-08-12 19:36:19 +06:00
|
|
|
|
2024-04-29 18:56:05 +07:00
|
|
|
<meta property="og:url" content="${env.webURL}">
|
2024-01-12 23:43:26 +00:00
|
|
|
<meta property="og:title" content="${t("AppTitleCobalt")}">
|
|
|
|
<meta property="og:description" content="${t('EmbedBriefDescription')}">
|
2024-04-29 18:56:05 +07:00
|
|
|
<meta property="og:image" content="${env.webURL}icons/generic.png">
|
2024-01-12 23:43:26 +00:00
|
|
|
<meta name="title" content="${t("AppTitleCobalt")}">
|
|
|
|
<meta name="description" content="${t('AboutSummary')}">
|
|
|
|
<meta name="twitter:card" content="summary">
|
2023-08-05 00:43:12 +06:00
|
|
|
|
|
|
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
|
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
|
|
|
<meta name="apple-mobile-web-app-title" content="${t("AppTitleCobalt")}">
|
2022-08-12 19:36:19 +06:00
|
|
|
|
2024-01-12 23:43:26 +00:00
|
|
|
<link rel="icon" type="image/x-icon" href="icons/favicon.ico">
|
|
|
|
<link rel="icon" type="image/png" sizes="32x32" href="icons/favicon-32x32.png">
|
|
|
|
<link rel="icon" type="image/png" sizes="16x16" href="icons/favicon-16x16.png">
|
2023-08-05 00:43:12 +06:00
|
|
|
|
2024-01-12 23:43:26 +00:00
|
|
|
<link rel="apple-touch-icon" sizes="180x180" href="icons/apple-touch-icon.png">
|
|
|
|
|
|
|
|
<link rel="manifest" href="manifest.webmanifest">
|
2024-01-12 23:44:30 +00:00
|
|
|
<link rel="stylesheet" href="fonts/notosansmono.css">
|
2024-01-12 23:43:26 +00:00
|
|
|
<link rel="stylesheet" href="cobalt.css">
|
2022-08-12 19:36:19 +06:00
|
|
|
|
2024-05-12 19:34:48 +06:00
|
|
|
<meta name="theme-color" content="#000000">
|
|
|
|
|
2024-03-06 19:12:04 +06:00
|
|
|
<link rel="preload" href="fonts/notosansmono.css" as="style">
|
|
|
|
<link rel="preload" href="assets/meowbalt/error.png" as="image">
|
|
|
|
<link rel="preload" href="assets/meowbalt/question.png" as="image">
|
2024-03-16 22:03:54 +06:00
|
|
|
|
2024-04-29 18:56:05 +07:00
|
|
|
${env.plausibleHostname ?
|
2024-03-16 22:03:54 +06:00
|
|
|
`<script
|
|
|
|
defer
|
2024-04-29 18:56:05 +07:00
|
|
|
data-domain="${new URL(env.webURL).hostname}"
|
|
|
|
src="https://${env.plausibleHostname}/js/script.js"
|
2024-03-16 22:03:54 +06:00
|
|
|
></script>`
|
|
|
|
: ''}
|
2022-08-12 19:36:19 +06:00
|
|
|
</head>
|
2024-05-11 01:05:24 +06:00
|
|
|
<body id="cobalt-body">
|
2024-01-12 23:43:26 +00:00
|
|
|
<noscript>
|
|
|
|
<div style="margin: 2rem;">${t('NoScriptMessage')}</div>
|
|
|
|
</noscript>
|
2022-08-12 19:36:19 +06:00
|
|
|
${multiPagePopup({
|
|
|
|
name: "about",
|
2023-08-05 00:43:12 +06:00
|
|
|
closeAria: t('AccessibilityGoBack'),
|
2022-08-12 19:36:19 +06:00
|
|
|
tabs: [{
|
|
|
|
name: "about",
|
2023-01-14 00:34:48 +06:00
|
|
|
title: `${emoji("🐲")} ${t('AboutTab')}`,
|
2022-08-12 19:36:19 +06:00
|
|
|
content: popup({
|
|
|
|
name: "about",
|
|
|
|
header: {
|
|
|
|
aboveTitle: {
|
2023-01-14 00:34:48 +06:00
|
|
|
text: t('MadeWithLove'),
|
2024-04-30 00:04:19 +06:00
|
|
|
url: repo
|
2022-08-12 19:36:19 +06:00
|
|
|
},
|
2023-08-05 00:43:12 +06:00
|
|
|
closeAria: t('AccessibilityGoBack'),
|
2023-01-30 00:17:33 +06:00
|
|
|
title: `${emoji("🔮", 30)} ${t('TitlePopupAbout')}`
|
2022-08-12 19:36:19 +06:00
|
|
|
},
|
|
|
|
body: [{
|
2023-01-14 00:34:48 +06:00
|
|
|
text: t('AboutSummary')
|
2022-08-12 19:36:19 +06:00
|
|
|
}, {
|
2023-01-30 00:17:33 +06:00
|
|
|
text: collapsibleList([{
|
2023-08-05 00:43:12 +06:00
|
|
|
name: "services",
|
2023-08-11 21:53:30 +06:00
|
|
|
title: `${emoji("🔗")} ${t("CollapseServices")}`,
|
2023-09-16 23:38:07 +06:00
|
|
|
body: `${enabledServices}`
|
|
|
|
+ `<div class="explanation embedded">${t("SupportNotAffiliated")}`
|
|
|
|
+ `${obj.lang === "ru" ? `<br>${t("SupportMetaNoticeRU")}` : ''}`
|
|
|
|
+ `</div>`
|
|
|
|
+ `${t("ServicesNote")}`
|
2023-08-11 21:53:30 +06:00
|
|
|
}, {
|
|
|
|
name: "keyboard",
|
|
|
|
title: `${emoji("⌨")} ${t("CollapseKeyboard")}`,
|
|
|
|
body:
|
|
|
|
`${t("KeyboardShortcutsIntro")}
|
|
|
|
${keyboardShortcuts([{
|
|
|
|
items: [{
|
|
|
|
combo: "Shift+D",
|
|
|
|
name: t("PasteFromClipboard")
|
|
|
|
}, {
|
|
|
|
combo: "Shift+K",
|
|
|
|
name: t("ModeToggleAuto")
|
|
|
|
}, {
|
|
|
|
combo: "Shift+L",
|
|
|
|
name: t("ModeToggleAudio")
|
|
|
|
}]
|
|
|
|
}, {
|
|
|
|
items: [{
|
2023-12-21 00:31:48 +06:00
|
|
|
combo: "⌘/Ctrl+V",
|
2023-08-11 21:53:30 +06:00
|
|
|
name: t("KeyboardShortcutQuickPaste")
|
|
|
|
}, {
|
2023-08-14 00:09:50 +06:00
|
|
|
combo: "Esc",
|
2023-08-11 21:53:30 +06:00
|
|
|
name: t("KeyboardShortcutClear")
|
|
|
|
}, {
|
|
|
|
combo: "Esc",
|
|
|
|
name: t("KeyboardShortcutClosePopup")
|
|
|
|
}]
|
|
|
|
}, {
|
|
|
|
items: [{
|
|
|
|
combo: "Shift+B",
|
|
|
|
name: t("AboutTab")
|
|
|
|
}, {
|
|
|
|
combo: "Shift+N",
|
|
|
|
name: t("ChangelogTab")
|
|
|
|
}, {
|
|
|
|
combo: "Shift+M",
|
|
|
|
name: t("TitlePopupSettings")
|
|
|
|
}]
|
|
|
|
}])}`
|
2023-01-30 00:17:33 +06:00
|
|
|
}, {
|
2023-08-05 00:43:12 +06:00
|
|
|
name: "support",
|
2023-08-11 21:53:30 +06:00
|
|
|
title: `${emoji("❤️🩹")} ${t("CollapseSupport")}`,
|
2023-12-25 17:46:33 +06:00
|
|
|
body: `${t("SupportSelfTroubleshooting")}`
|
|
|
|
+ `${socialLink(emoji("📢"), t("StatusPage"), links.statusPage)}`
|
|
|
|
+ `${socialLink(emoji("🔧"), t("TroubleshootingGuide"), links.troubleshootingGuide)}`
|
2024-01-13 00:20:36 +00:00
|
|
|
+ `<br>`
|
2023-12-25 17:46:33 +06:00
|
|
|
+ `${t("FollowSupport")}`
|
|
|
|
+ `${socialLinks(obj.lang)}`
|
2024-01-13 00:20:36 +00:00
|
|
|
+ `<br>`
|
2023-12-25 17:46:33 +06:00
|
|
|
+ `${t("SourceCode")}`
|
|
|
|
+ `${socialLink(emoji("🐙"), repo.replace("https://github.com/", ''), repo)}`
|
2023-01-30 00:17:33 +06:00
|
|
|
}, {
|
2023-08-05 00:43:12 +06:00
|
|
|
name: "privacy",
|
2023-08-11 21:53:30 +06:00
|
|
|
title: `${emoji("🔒")} ${t("CollapsePrivacy")}`,
|
2024-03-16 23:33:33 +06:00
|
|
|
body: t("PrivacyPolicy") + `${
|
2024-04-29 18:56:05 +07:00
|
|
|
env.plausibleHostname ? `<br><br>${t("AnalyticsDescription")}` : ''
|
2024-03-16 23:33:33 +06:00
|
|
|
}`
|
2023-08-14 00:09:50 +06:00
|
|
|
}, {
|
|
|
|
name: "legal",
|
|
|
|
title: `${emoji("📑")} ${t("CollapseLegal")}`,
|
|
|
|
body: t("FairUse")
|
2023-01-30 00:17:33 +06:00
|
|
|
}])
|
2023-10-12 17:33:26 +06:00
|
|
|
},
|
2024-04-29 18:56:05 +07:00
|
|
|
...(env.showSponsors ?
|
2023-10-12 17:33:26 +06:00
|
|
|
[{
|
|
|
|
text: t("SponsoredBy"),
|
|
|
|
classes: ["sponsored-by-text"],
|
|
|
|
nopadding: true
|
|
|
|
}, {
|
|
|
|
text: sponsoredList(),
|
|
|
|
raw: true
|
|
|
|
}] : []
|
|
|
|
)]
|
2022-08-12 19:36:19 +06:00
|
|
|
})
|
|
|
|
}, {
|
|
|
|
name: "changelog",
|
2023-01-14 00:34:48 +06:00
|
|
|
title: `${emoji("🎉")} ${t('ChangelogTab')}`,
|
2022-08-12 19:36:19 +06:00
|
|
|
content: popup({
|
|
|
|
name: "changelog",
|
|
|
|
header: {
|
2023-08-05 00:43:12 +06:00
|
|
|
closeAria: t('AccessibilityGoBack'),
|
2023-01-14 00:34:48 +06:00
|
|
|
title: `${emoji("🪄", 30)} ${t('TitlePopupChangelog')}`
|
2022-08-12 19:36:19 +06:00
|
|
|
},
|
|
|
|
body: [{
|
2023-01-14 00:34:48 +06:00
|
|
|
text: `<div class="category-title">${t('ChangelogLastMajor')}</div>`,
|
2022-08-12 19:36:19 +06:00
|
|
|
raw: true
|
2022-11-12 22:40:11 +06:00
|
|
|
}, {
|
2024-01-14 23:53:06 +00:00
|
|
|
text: (() => {
|
|
|
|
const banner = changelogManager('banner');
|
|
|
|
if (!banner) return '';
|
|
|
|
return `<div class="changelog-banner">
|
|
|
|
<img class="changelog-img" ` +
|
|
|
|
`src="${banner.url}" ` +
|
|
|
|
`alt="${banner.alt.replaceAll('"', '"')}" ` +
|
|
|
|
`width="${banner.width}" ` +
|
|
|
|
`height="${banner.height}" ` +
|
|
|
|
`onerror="this.style.opacity=0" loading="lazy">
|
|
|
|
</div>`;
|
|
|
|
})(),
|
2022-11-12 22:40:11 +06:00
|
|
|
raw: true
|
2023-08-05 00:43:12 +06:00
|
|
|
}, {
|
|
|
|
text: changelogManager("version"),
|
|
|
|
classes: ["changelog-tags"],
|
|
|
|
nopadding: true
|
2022-08-12 19:36:19 +06:00
|
|
|
}, {
|
2022-09-11 21:04:06 +06:00
|
|
|
text: changelogManager("title"),
|
2022-08-12 19:36:19 +06:00
|
|
|
classes: ["changelog-subtitle"],
|
|
|
|
nopadding: true
|
2022-08-19 23:54:20 +06:00
|
|
|
}, {
|
2022-10-02 20:13:33 +06:00
|
|
|
text: changelogManager("content")
|
2022-08-12 19:36:19 +06:00
|
|
|
}, {
|
2023-08-05 00:43:12 +06:00
|
|
|
text: sep(),
|
|
|
|
raw: true
|
|
|
|
},{
|
|
|
|
text: `<a class="text-backdrop changelog-tag-version" href="${repo}/commit/${obj.hash}">#${obj.hash}</a>`,
|
|
|
|
classes: ["changelog-tags"],
|
|
|
|
nopadding: true
|
|
|
|
}, {
|
|
|
|
text: com[0],
|
2022-08-12 19:36:19 +06:00
|
|
|
classes: ["changelog-subtitle"],
|
|
|
|
nopadding: true
|
|
|
|
}, {
|
|
|
|
text: com[1]
|
2022-09-11 21:04:06 +06:00
|
|
|
}, {
|
2023-01-14 00:34:48 +06:00
|
|
|
text: `<div class="category-title">${t('ChangelogOlder')}</div>`,
|
2022-09-11 21:04:06 +06:00
|
|
|
raw: true
|
|
|
|
}, {
|
2023-08-05 00:43:12 +06:00
|
|
|
text: `
|
|
|
|
<div id="changelog-history">
|
|
|
|
<button class="switch bottom-margin" onclick="loadOnDemand('changelog-history', '0')">${t("ChangelogPressToExpand")}</button>
|
|
|
|
</div>`,
|
2022-09-11 21:04:06 +06:00
|
|
|
raw: true
|
2022-08-12 19:36:19 +06:00
|
|
|
}]
|
|
|
|
})
|
|
|
|
}, {
|
|
|
|
name: "donate",
|
2023-05-17 22:50:11 +06:00
|
|
|
title: `${emoji("💖")} ${t('DonationsTab')}`,
|
2022-08-12 19:36:19 +06:00
|
|
|
content: popup({
|
|
|
|
name: "donate",
|
|
|
|
header: {
|
2023-08-05 00:43:12 +06:00
|
|
|
closeAria: t('AccessibilityGoBack'),
|
2023-01-14 00:34:48 +06:00
|
|
|
title: emoji("💸", 30) + t('TitlePopupDonate')
|
2022-08-12 19:36:19 +06:00
|
|
|
},
|
|
|
|
body: [{
|
2023-01-14 00:34:48 +06:00
|
|
|
text: `<div class="category-title">${t('DonateSub')}</div>`,
|
|
|
|
raw: true
|
|
|
|
}, {
|
2024-01-13 00:20:36 +00:00
|
|
|
text: `
|
|
|
|
<div class="changelog-banner">
|
2023-08-11 21:53:30 +06:00
|
|
|
<img class="changelog-img" ` +
|
2024-01-13 00:20:36 +00:00
|
|
|
`src="updateBanners/catsleep.webp" ` +
|
2024-01-17 16:47:08 +06:00
|
|
|
`alt="${t("DonateImageDescription")}" ` +
|
2023-08-11 21:53:30 +06:00
|
|
|
`width="480" ` +
|
|
|
|
`height="270" ` +
|
2024-01-13 00:20:36 +00:00
|
|
|
`onerror="this.style.opacity=0" loading="lazy">
|
2023-08-05 00:43:12 +06:00
|
|
|
</div>`,
|
2022-11-20 19:46:08 +06:00
|
|
|
raw: true
|
|
|
|
}, {
|
2023-01-14 00:34:48 +06:00
|
|
|
text: t('DonateExplanation')
|
|
|
|
}, {
|
|
|
|
text: donateLinks.replace(/REPLACEME/g, t('DonateVia')),
|
2022-08-12 19:36:19 +06:00
|
|
|
raw: true
|
|
|
|
}, {
|
2023-01-14 00:34:48 +06:00
|
|
|
text: t('DonateLinksDescription'),
|
2022-08-12 19:36:19 +06:00
|
|
|
classes: ["explanation"]
|
|
|
|
}, {
|
2022-12-17 17:09:49 +06:00
|
|
|
text: sep(),
|
2022-11-20 19:46:08 +06:00
|
|
|
raw: true
|
2022-08-12 19:36:19 +06:00
|
|
|
}, {
|
2023-01-14 00:34:48 +06:00
|
|
|
text: donate.replace(/REPLACEME/g, t('ClickToCopy')),
|
2022-11-20 19:46:08 +06:00
|
|
|
classes: ["desc-padding"]
|
2022-08-12 19:36:19 +06:00
|
|
|
}]
|
|
|
|
})
|
|
|
|
}],
|
|
|
|
})}
|
|
|
|
${multiPagePopup({
|
|
|
|
name: "settings",
|
2023-08-05 00:43:12 +06:00
|
|
|
closeAria: t('AccessibilityGoBack'),
|
2022-08-12 19:36:19 +06:00
|
|
|
header: {
|
|
|
|
aboveTitle: {
|
2024-05-11 01:05:24 +06:00
|
|
|
text: `v.${version}-${obj.hash} (${obj.branch})`,
|
2022-08-22 20:10:54 +06:00
|
|
|
url: `${repo}/commit/${obj.hash}`
|
2022-08-12 19:36:19 +06:00
|
|
|
},
|
2023-01-14 00:34:48 +06:00
|
|
|
title: `${emoji("⚙️", 30)} ${t('TitlePopupSettings')}`
|
2022-08-12 19:36:19 +06:00
|
|
|
},
|
|
|
|
tabs: [{
|
|
|
|
name: "video",
|
2023-01-14 00:34:48 +06:00
|
|
|
title: `${emoji("🎬")} ${t('SettingsVideoTab')}`,
|
2022-08-12 19:36:19 +06:00
|
|
|
content: settingsCategory({
|
|
|
|
name: "downloads",
|
2023-02-26 22:49:25 +06:00
|
|
|
title: t('SettingsQualitySubtitle'),
|
2022-08-12 19:36:19 +06:00
|
|
|
body: switcher({
|
2022-11-04 14:49:58 +06:00
|
|
|
name: "vQuality",
|
2023-01-14 00:34:48 +06:00
|
|
|
explanation: t('SettingsQualityDescription'),
|
2022-08-12 19:36:19 +06:00
|
|
|
items: [{
|
2023-08-05 00:43:12 +06:00
|
|
|
action: "max",
|
|
|
|
text: "8k+"
|
2022-08-12 19:36:19 +06:00
|
|
|
}, {
|
2023-08-05 00:43:12 +06:00
|
|
|
action: "2160",
|
|
|
|
text: "4k"
|
2022-08-12 19:36:19 +06:00
|
|
|
}, {
|
2023-08-05 00:43:12 +06:00
|
|
|
action: "1440",
|
|
|
|
text: "1440p"
|
2022-08-12 19:36:19 +06:00
|
|
|
}, {
|
2023-08-05 00:43:12 +06:00
|
|
|
action: "1080",
|
|
|
|
text: "1080p"
|
2023-02-26 22:49:25 +06:00
|
|
|
}, {
|
2023-08-05 00:43:12 +06:00
|
|
|
action: "720",
|
|
|
|
text: "720p"
|
2023-02-26 22:49:25 +06:00
|
|
|
}, {
|
2023-08-05 00:43:12 +06:00
|
|
|
action: "480",
|
|
|
|
text: "480p"
|
2023-02-26 22:49:25 +06:00
|
|
|
}, {
|
2023-08-05 00:43:12 +06:00
|
|
|
action: "360",
|
|
|
|
text: "360p"
|
2024-05-04 08:30:59 +06:00
|
|
|
}, {
|
|
|
|
action: "240",
|
|
|
|
text: "240p"
|
|
|
|
}, {
|
|
|
|
action: "144",
|
|
|
|
text: "144p"
|
2022-08-12 19:36:19 +06:00
|
|
|
}]
|
|
|
|
})
|
2023-01-14 00:34:48 +06:00
|
|
|
})
|
|
|
|
+ settingsCategory({
|
2023-10-12 23:14:54 +06:00
|
|
|
name: "codec",
|
|
|
|
title: t('SettingsCodecSubtitle'),
|
2023-01-14 00:34:48 +06:00
|
|
|
body: switcher({
|
2023-02-26 22:49:25 +06:00
|
|
|
name: "vCodec",
|
|
|
|
explanation: t('SettingsCodecDescription'),
|
2023-01-14 00:34:48 +06:00
|
|
|
items: [{
|
2023-08-05 00:43:12 +06:00
|
|
|
action: "h264",
|
|
|
|
text: "h264 (mp4)"
|
2023-02-26 22:49:25 +06:00
|
|
|
}, {
|
2023-08-05 00:43:12 +06:00
|
|
|
action: "av1",
|
|
|
|
text: "av1 (mp4)"
|
2023-01-14 00:34:48 +06:00
|
|
|
}, {
|
2023-08-05 00:43:12 +06:00
|
|
|
action: "vp9",
|
|
|
|
text: "vp9 (webm)"
|
2023-01-14 00:34:48 +06:00
|
|
|
}]
|
2022-08-16 16:31:41 +06:00
|
|
|
})
|
2023-01-14 00:34:48 +06:00
|
|
|
})
|
2023-03-15 22:18:31 +06:00
|
|
|
+ settingsCategory({
|
2024-04-30 00:04:19 +06:00
|
|
|
name: "twitter",
|
|
|
|
title: "twitter",
|
|
|
|
body: checkbox([{
|
|
|
|
action: "twitterGif",
|
|
|
|
name: t("SettingsTwitterGif"),
|
|
|
|
padding: "no-margin"
|
|
|
|
}])
|
|
|
|
+ explanation(t('SettingsTwitterGifDescription'))
|
|
|
|
})
|
|
|
|
+ settingsCategory({
|
|
|
|
name: "tiktok",
|
|
|
|
title: "tiktok",
|
|
|
|
body: checkbox([{
|
|
|
|
action: "tiktokH265",
|
|
|
|
name: t("SettingsTikTokH265"),
|
|
|
|
padding: "no-margin"
|
|
|
|
}])
|
|
|
|
+ explanation(t('SettingsTikTokH265Description'))
|
2023-03-15 22:18:31 +06:00
|
|
|
})
|
2022-08-12 19:36:19 +06:00
|
|
|
}, {
|
|
|
|
name: "audio",
|
2023-01-14 00:34:48 +06:00
|
|
|
title: `${emoji("🎶")} ${t('SettingsAudioTab')}`,
|
2022-08-12 19:36:19 +06:00
|
|
|
content: settingsCategory({
|
|
|
|
name: "general",
|
2023-02-26 22:49:25 +06:00
|
|
|
title: t('SettingsFormatSubtitle'),
|
2023-08-05 00:43:12 +06:00
|
|
|
body: switcher({
|
|
|
|
name: "aFormat",
|
|
|
|
explanation: t('SettingsAudioFormatDescription'),
|
|
|
|
items: audioFormats
|
|
|
|
})
|
|
|
|
+ sep(0)
|
|
|
|
+ checkbox([{
|
|
|
|
action: "muteAudio",
|
|
|
|
name: t("SettingsVideoMute"),
|
|
|
|
padding: "no-margin"
|
|
|
|
}])
|
|
|
|
+ explanation(t('SettingsVideoMuteExplanation'))
|
|
|
|
})
|
|
|
|
+ settingsCategory({
|
2024-04-30 00:04:19 +06:00
|
|
|
name: "youtube-dub",
|
2023-08-05 00:43:12 +06:00
|
|
|
title: t("SettingsAudioDub"),
|
2024-04-30 00:04:19 +06:00
|
|
|
body: checkbox([{
|
|
|
|
action: "ytDub",
|
|
|
|
name: t("SettingsYoutubeDub"),
|
|
|
|
padding: "no-margin"
|
|
|
|
}])
|
|
|
|
+ explanation(t('SettingsYoutubeDubDescription'))
|
2023-08-05 00:43:12 +06:00
|
|
|
})
|
|
|
|
+ settingsCategory({
|
2024-01-13 00:25:18 +00:00
|
|
|
name: "tiktok-audio",
|
2023-08-05 00:43:12 +06:00
|
|
|
title: "tiktok",
|
|
|
|
body: checkbox([{
|
|
|
|
action: "fullTikTokAudio",
|
|
|
|
name: t("SettingsAudioFullTikTok"),
|
|
|
|
padding: "no-margin"
|
|
|
|
}])
|
|
|
|
+ explanation(t('SettingsAudioFullTikTokDescription'))
|
|
|
|
})
|
2022-08-12 19:36:19 +06:00
|
|
|
}, {
|
|
|
|
name: "other",
|
2023-01-14 00:34:48 +06:00
|
|
|
title: `${emoji("🪅")} ${t('SettingsOtherTab')}`,
|
2022-08-12 19:36:19 +06:00
|
|
|
content: settingsCategory({
|
|
|
|
name: "appearance",
|
2023-01-14 00:34:48 +06:00
|
|
|
title: t('SettingsAppearanceSubtitle'),
|
2022-08-12 19:36:19 +06:00
|
|
|
body: switcher({
|
|
|
|
name: "theme",
|
|
|
|
items: [{
|
2023-08-05 00:43:12 +06:00
|
|
|
action: "auto",
|
|
|
|
text: t('SettingsThemeAuto')
|
2022-08-16 13:14:19 +06:00
|
|
|
}, {
|
2023-08-05 00:43:12 +06:00
|
|
|
action: "dark",
|
|
|
|
text: t('SettingsThemeDark')
|
2022-08-16 13:14:19 +06:00
|
|
|
}, {
|
2023-08-05 00:43:12 +06:00
|
|
|
action: "light",
|
|
|
|
text: t('SettingsThemeLight')
|
2022-08-12 19:36:19 +06:00
|
|
|
}]
|
2023-08-05 00:43:12 +06:00
|
|
|
})
|
|
|
|
})
|
2023-10-12 23:14:54 +06:00
|
|
|
+ settingsCategory({
|
|
|
|
name: "filename",
|
2023-10-14 22:51:53 +06:00
|
|
|
title: t('FilenameTitle'),
|
2023-10-12 23:14:54 +06:00
|
|
|
body: switcher({
|
|
|
|
name: "filenamePattern",
|
|
|
|
items: [{
|
|
|
|
action: "classic",
|
|
|
|
text: t('FilenamePatternClassic')
|
|
|
|
}, {
|
|
|
|
action: "basic",
|
|
|
|
text: t('FilenamePatternBasic')
|
2023-10-14 22:51:53 +06:00
|
|
|
}, {
|
|
|
|
action: "pretty",
|
|
|
|
text: t('FilenamePatternPretty')
|
2023-10-12 23:14:54 +06:00
|
|
|
}, {
|
|
|
|
action: "nerdy",
|
|
|
|
text: t('FilenamePatternNerdy')
|
|
|
|
}]
|
|
|
|
})
|
2023-10-14 22:51:53 +06:00
|
|
|
+ `<div id="filename-preview">
|
|
|
|
<div id="video-filename" class="filename-item line">
|
|
|
|
${emoji('🎞️', 32, 1, 1)}
|
|
|
|
<div class="filename-container">
|
|
|
|
<div class="filename-label">${t('Preview')}</div>
|
|
|
|
<div id="video-filename-text"></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div id="audio-filename" class="filename-item">
|
|
|
|
${emoji('🎧', 32, 1, 1)}
|
|
|
|
<div class="filename-container">
|
|
|
|
<div class="filename-label">${t('Preview')}</div>
|
|
|
|
<div id="audio-filename-text"></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>`
|
|
|
|
+ explanation(t('FilenameDescription'))
|
2023-10-12 23:14:54 +06:00
|
|
|
})
|
2023-08-05 00:43:12 +06:00
|
|
|
+ settingsCategory({
|
|
|
|
name: "accessibility",
|
|
|
|
title: t('Accessibility'),
|
|
|
|
body: checkbox([{
|
|
|
|
action: "alwaysVisibleButton",
|
|
|
|
name: t("SettingsKeepDownloadButton"),
|
|
|
|
aria: t("AccessibilityKeepDownloadButton")
|
|
|
|
}, {
|
|
|
|
action: "reduceTransparency",
|
|
|
|
name: t("SettingsReduceTransparency")
|
|
|
|
}, {
|
|
|
|
action: "disableAnimations",
|
|
|
|
name: t("SettingsDisableAnimations"),
|
|
|
|
padding: "no-margin"
|
|
|
|
}])
|
|
|
|
})
|
2024-03-16 23:33:33 +06:00
|
|
|
+ (() => {
|
2024-04-29 18:56:05 +07:00
|
|
|
if (env.plausibleHostname) {
|
2024-03-16 23:33:33 +06:00
|
|
|
return settingsCategory({
|
|
|
|
name: "privacy",
|
|
|
|
title: t('PrivateAnalytics'),
|
|
|
|
body: checkbox([{
|
|
|
|
action: "plausible_ignore",
|
|
|
|
name: t("SettingsDisableAnalytics"),
|
|
|
|
padding: "no-margin"
|
|
|
|
}])
|
|
|
|
+ explanation(t('SettingsAnalyticsExplanation'))
|
|
|
|
})
|
|
|
|
}
|
|
|
|
return ''
|
|
|
|
})()
|
2023-08-05 00:43:12 +06:00
|
|
|
+ settingsCategory({
|
2022-09-28 18:21:36 +06:00
|
|
|
name: "miscellaneous",
|
2023-01-14 00:34:48 +06:00
|
|
|
title: t('Miscellaneous'),
|
2023-08-05 00:43:12 +06:00
|
|
|
body: checkbox([{
|
|
|
|
action: "downloadPopup",
|
|
|
|
name: t("SettingsEnableDownloadPopup"),
|
|
|
|
aria: t("AccessibilityEnableDownloadPopup")
|
2023-08-24 08:31:39 +00:00
|
|
|
}, {
|
|
|
|
action: "disableMetadata",
|
2023-09-06 20:01:17 +06:00
|
|
|
name: t("SettingsDisableMetadata")
|
2023-08-05 00:43:12 +06:00
|
|
|
}])
|
2022-09-08 22:02:55 +06:00
|
|
|
})
|
2023-09-09 03:10:43 +06:00
|
|
|
}]
|
2022-08-12 19:36:19 +06:00
|
|
|
})}
|
2023-07-19 01:50:51 +06:00
|
|
|
${popupWithBottomButtons({
|
|
|
|
name: "picker",
|
2023-08-05 00:43:12 +06:00
|
|
|
closeAria: t('AccessibilityGoBack'),
|
2023-07-19 01:50:51 +06:00
|
|
|
header: {
|
2023-08-14 01:36:19 +06:00
|
|
|
title: `${emoji("🧮", 30)} <div id="picker-title"></div>`,
|
2023-07-19 01:50:51 +06:00
|
|
|
explanation: `<div id="picker-subtitle"></div>`,
|
|
|
|
},
|
|
|
|
buttons: [`<a id="picker-download" class="switch" target="_blank" href="/">${t('ImagePickerDownloadAudio')}</a>`],
|
|
|
|
content: '<div id="picker-holder"></div>'
|
|
|
|
})}
|
2023-08-05 00:43:12 +06:00
|
|
|
<div id="popup-download-container" class="popup-from-bottom">
|
|
|
|
${popup({
|
2022-08-12 19:36:19 +06:00
|
|
|
name: "download",
|
2023-08-05 00:43:12 +06:00
|
|
|
standalone: true,
|
|
|
|
buttonOnly: true,
|
2023-09-06 19:37:03 +06:00
|
|
|
classes: ["small"],
|
2023-08-05 00:43:12 +06:00
|
|
|
header: {
|
|
|
|
closeAria: t('AccessibilityGoBack'),
|
2024-03-06 19:12:04 +06:00
|
|
|
emoji: `<img class="popout-meowbalt" `
|
2024-03-06 13:28:11 +00:00
|
|
|
+ `draggable="false" loading="lazy" `
|
2024-03-06 19:12:04 +06:00
|
|
|
+ `alt="😿" src="assets/meowbalt/question.png">`,
|
2023-08-05 00:43:12 +06:00
|
|
|
title: t('TitlePopupDownload')
|
|
|
|
},
|
|
|
|
body: switcher({
|
|
|
|
name: "download",
|
2024-05-11 01:05:24 +06:00
|
|
|
explanation: t('DownloadPopupDescription'),
|
2023-08-05 00:43:12 +06:00
|
|
|
items: `<a id="pd-download" class="switch full" target="_blank" href="/"><span>${t('Download')}</span></a>
|
|
|
|
<div id="pd-share" class="switch full">${t('ShareURL')}</div>
|
|
|
|
<div id="pd-copy" class="switch full">${t('CopyURL')}</div>`
|
|
|
|
}),
|
|
|
|
buttonText: t('PopupCloseDone')
|
|
|
|
})}
|
|
|
|
</div>
|
|
|
|
<div id="popup-error-container" class="popup-from-bottom">
|
|
|
|
${popup({
|
|
|
|
name: "error",
|
|
|
|
standalone: true,
|
|
|
|
buttonOnly: true,
|
2023-09-06 19:37:03 +06:00
|
|
|
classes: ["small"],
|
2023-08-05 00:43:12 +06:00
|
|
|
header: {
|
2024-03-06 19:12:04 +06:00
|
|
|
emoji: `<img class="popout-meowbalt" `
|
2024-03-06 13:28:11 +00:00
|
|
|
+ `draggable="false" loading="lazy" `
|
2024-03-06 19:12:04 +06:00
|
|
|
+ `alt="😿" src="assets/meowbalt/error.png">`,
|
2023-08-05 00:43:12 +06:00
|
|
|
},
|
2023-09-09 03:10:43 +06:00
|
|
|
body: `<div id="desc-error" class="desc-padding subtext desc-error"></div>`,
|
|
|
|
buttonText: t('ErrorPopupCloseButton')
|
|
|
|
})}
|
|
|
|
</div>
|
2023-08-05 00:43:12 +06:00
|
|
|
<div id="popup-backdrop" onclick="hideAllPopups()"></div>
|
2023-08-14 00:09:50 +06:00
|
|
|
<div id="home" style="visibility:hidden">
|
2023-08-11 21:53:30 +06:00
|
|
|
${urgentNotice({
|
2024-05-18 00:26:05 +06:00
|
|
|
emoji: "🎉",
|
|
|
|
text: t("UpdateOneMillion"),
|
2023-12-02 12:54:27 +06:00
|
|
|
visible: true,
|
2023-09-09 03:10:43 +06:00
|
|
|
action: "popup('about', 1, 'changelog')"
|
2023-08-11 21:53:30 +06:00
|
|
|
})}
|
2023-08-14 00:09:50 +06:00
|
|
|
<div id="cobalt-main-box" class="center">
|
2023-10-28 18:51:20 +06:00
|
|
|
<div id="logo">${t("AppTitleCobalt")}${betaTag()}</div>
|
2023-08-05 00:43:12 +06:00
|
|
|
<div id="download-area">
|
|
|
|
<div id="top">
|
2023-12-25 23:57:33 +06:00
|
|
|
<div id="link-icon">${linkSVG}</div>
|
2024-05-31 14:53:25 +02:00
|
|
|
<input id="url-input-area" class="mono" type="text" autocomplete="off" data-form-type="other" spellcheck="false" maxlength="256" autocapitalize="off" placeholder="${t('LinkInput')}" aria-label="${t('AccessibilityInputArea')}" oninput="button()">
|
2023-08-05 00:43:12 +06:00
|
|
|
<button id="url-clear" onclick="clearInput()" style="display:none;">x</button>
|
2024-01-13 00:20:36 +00:00
|
|
|
<input id="download-button" class="mono dontRead" onclick="download(document.getElementById('url-input-area').value)" type="submit" value="" disabled aria-label="${t('AccessibilityDownloadButton')}">
|
2023-08-05 00:43:12 +06:00
|
|
|
</div>
|
|
|
|
<div id="bottom">
|
|
|
|
<button id="paste" class="switch" onclick="pasteClipboard()" aria-label="${t('PasteFromClipboard')}">${emoji("📋", 22)} ${t('PasteFromClipboard')}</button>
|
|
|
|
${switcher({
|
|
|
|
name: "audioMode",
|
|
|
|
noParent: true,
|
|
|
|
items: [{
|
|
|
|
action: "false",
|
|
|
|
text: `${emoji("✨")} ${t("ModeToggleAuto")}`
|
|
|
|
}, {
|
|
|
|
action: "true",
|
|
|
|
text: `${emoji("🎶")} ${t("ModeToggleAudio")}`
|
|
|
|
}]
|
|
|
|
})}
|
|
|
|
</div>
|
2022-09-28 18:21:36 +06:00
|
|
|
</div>
|
2022-08-12 19:36:19 +06:00
|
|
|
</div>
|
2023-08-14 00:09:50 +06:00
|
|
|
<footer id="footer">
|
2023-08-05 00:43:12 +06:00
|
|
|
${footerButtons([{
|
|
|
|
name: "about",
|
|
|
|
type: "popup",
|
|
|
|
text: `${emoji("🐲" , 22)} ${t('AboutTab')}`,
|
|
|
|
aria: t('AccessibilityOpenAbout')
|
|
|
|
}, {
|
|
|
|
name: "about",
|
|
|
|
type: "popup",
|
|
|
|
context: "donate",
|
|
|
|
text: `${emoji("💖", 22)} ${t('Donate')}`,
|
|
|
|
aria: t('AccessibilityOpenDonate')
|
|
|
|
}, {
|
|
|
|
name: "settings",
|
|
|
|
type: "popup",
|
|
|
|
text: `${emoji("⚙️", 22)} ${t('TitlePopupSettings')}`,
|
|
|
|
aria: t('AccessibilityOpenSettings')
|
|
|
|
}])}
|
|
|
|
</footer>
|
2022-08-12 19:36:19 +06:00
|
|
|
</div>
|
2024-01-13 00:20:36 +00:00
|
|
|
<script>
|
2024-04-29 18:56:05 +07:00
|
|
|
let defaultApiUrl = '${env.apiURL}';
|
2024-01-14 22:40:41 +06:00
|
|
|
const loc = ${webLoc(t,
|
|
|
|
[
|
|
|
|
'ErrorNoInternet',
|
|
|
|
'ErrorNoUrlReturned',
|
|
|
|
'ErrorUnknownStatus',
|
|
|
|
'ChangelogPressToHide',
|
|
|
|
'MediaPickerTitle',
|
|
|
|
'MediaPickerExplanationPhone',
|
|
|
|
'MediaPickerExplanationPC',
|
|
|
|
'FeatureErrorGeneric',
|
|
|
|
'ClipboardErrorNoPermission',
|
|
|
|
'ClipboardErrorFirefox',
|
|
|
|
'DataTransferSuccess',
|
|
|
|
'DataTransferError',
|
|
|
|
'FilenamePreviewVideoTitle',
|
|
|
|
'FilenamePreviewAudioTitle',
|
2024-05-11 01:05:24 +06:00
|
|
|
'FilenamePreviewAudioAuthor',
|
|
|
|
'DownloadPopupDescriptionIOS'
|
2024-01-14 22:40:41 +06:00
|
|
|
])}
|
|
|
|
</script>
|
2024-01-13 00:20:36 +00:00
|
|
|
<script src="cobalt.js"></script>
|
2022-08-12 19:36:19 +06:00
|
|
|
</body>
|
2023-08-05 00:43:12 +06:00
|
|
|
</html>
|
|
|
|
`
|
2022-08-12 19:36:19 +06:00
|
|
|
} catch (err) {
|
2023-01-14 00:34:48 +06:00
|
|
|
return `${t('ErrorPageRenderFail', obj.hash)}`;
|
2022-08-12 19:36:19 +06:00
|
|
|
}
|
|
|
|
}
|