Settings as a tabbed modal over the current view

Ten tabs in three groups, opened from the sidebar, Ctrl+, or the engine chip. It remembers the last tab and scroll position, closes with Esc or the backdrop, and fits every window size.
This commit is contained in:
Christian
2026-11-20 15:06:27 -05:00
parent 879a182ddb
commit c5c3357666
5 changed files with 345 additions and 195 deletions
+84 -7
View File
@@ -380,12 +380,9 @@ function progressBar(fraction, cls = "") {
/* shell & navigation */
function bindShell() {
bindOnboarding();
$$("[data-nav]").forEach((b) =>
b.addEventListener("click", () => {
go(b.dataset.nav);
if (b.dataset.anchor) $(`#set-${b.dataset.anchor}`)?.scrollIntoView({ block: "start" });
})
);
$$("[data-nav]").forEach((b) => b.addEventListener("click", () => go(b.dataset.nav)));
$$("[data-settings]").forEach((b) => b.addEventListener("click", () => openSettings(b.dataset.settings || null)));
bindSettingsModal();
$("#clearFetched").addEventListener("click", () => {
state.collections.forEach((c) => invoke("forget", { id: c.data.id }));
state.collections = [];
@@ -438,6 +435,8 @@ function bindShell() {
}
function go(view) {
if (view === "settings") return openSettings();
if (settingsOpen()) closeSettings(false);
$$(".nav-item[data-nav]").forEach((b) => b.dataset.nav === view ? b.setAttribute("aria-current", "page") : b.removeAttribute("aria-current"));
if (state.view === view) return markLibNav();
state.view = view;
@@ -446,7 +445,6 @@ function go(view) {
closeMenus();
if (view !== "library") closeDrawers();
if (view === "downloads") renderDownloads(true);
if (view === "settings") renderSettings();
markLibNav();
}
@@ -455,6 +453,10 @@ function onKey(e) {
if (mod && e.key.toLowerCase() === "k") {
e.preventDefault();
openSearch();
} else if (mod && e.key === ",") {
e.preventDefault();
if (settingsOpen()) closeSettings();
else if (state.settings?.rightsAccepted) openSettings();
} else if (mod && e.key.toLowerCase() === "l") {
e.preventDefault();
go("get");
@@ -1485,6 +1487,80 @@ async function patch(p) {
}
}
/* the settings modal opens over whatever you were doing and comes back on the tab (and scroll spot) you left */
const SET_TAB_KEY = "atmo.settingsTab";
const SetUI = { tab: "playback", opener: null, scroll: {}, downOnScrim: false };
try { SetUI.tab = localStorage.getItem(SET_TAB_KEY) || SetUI.tab; } catch {}
const settingsOpen = () => !$("#settingsModal").hidden;
function openSettings(tab) {
if (!state.settings?.rightsAccepted) return;
const wrap = $("#settingsModal");
if (tab && $(`.set-panel[data-panel="${tab}"]`)) SetUI.tab = tab;
if (!$(`.set-panel[data-panel="${SetUI.tab}"]`)) SetUI.tab = "playback";
if (wrap.hidden) {
SetUI.opener = document.activeElement;
closeSaveMenu();
closeMenus();
wrap.hidden = false;
$("#shell").setAttribute("inert", "");
$("#player").setAttribute("inert", "");
$("#settingsBtn").setAttribute("aria-expanded", "true");
}
renderSettings();
showSetTab(SetUI.tab, !!tab);
$(`.set-tab[data-tab="${SetUI.tab}"]`)?.focus({ preventScroll: true });
}
function closeSettings(restoreFocus = true) {
const wrap = $("#settingsModal");
if (wrap.hidden) return;
SetUI.scroll[SetUI.tab] = $("#settingsScroll").scrollTop;
wrap.hidden = true;
if ($("#onboarding").hidden) $("#shell").removeAttribute("inert");
$("#player").removeAttribute("inert");
$("#settingsBtn").setAttribute("aria-expanded", "false");
if (restoreFocus && SetUI.opener?.isConnected) SetUI.opener.focus({ preventScroll: true });
}
function showSetTab(tab, fresh = false) {
const scroller = $("#settingsScroll");
if (!$("#settingsModal").hidden && SetUI.tab !== tab) SetUI.scroll[SetUI.tab] = scroller.scrollTop;
SetUI.tab = tab;
try { localStorage.setItem(SET_TAB_KEY, tab); } catch {}
$$(".set-tab").forEach((b) => (b.dataset.tab === tab ? b.setAttribute("aria-current", "page") : b.removeAttribute("aria-current")));
$(`.set-tab[data-tab="${tab}"]`)?.scrollIntoView({ block: "nearest", inline: "nearest" });
$$(".set-panel").forEach((p) => (p.hidden = p.dataset.panel !== tab));
$("#setTitle").textContent = $(`.set-tab[data-tab="${tab}"]`)?.textContent.trim() || "Settings";
scroller.scrollTop = fresh ? 0 : SetUI.scroll[tab] || 0;
}
function bindSettingsModal() {
const wrap = $("#settingsModal");
$$(".set-tab").forEach((b) => b.addEventListener("click", () => showSetTab(b.dataset.tab, false)));
$(".set-rail").addEventListener("keydown", (e) => {
if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(e.key)) return;
const tabs = $$(".set-tab");
const at = tabs.indexOf(document.activeElement);
if (at < 0) return;
e.preventDefault();
const to = e.key === "Home" ? 0 : e.key === "End" ? tabs.length - 1 : (at + (e.key === "ArrowDown" ? 1 : -1) + tabs.length) % tabs.length;
tabs[to].focus();
showSetTab(tabs[to].dataset.tab);
});
$("#settingsClose").addEventListener("click", () => closeSettings());
wrap.addEventListener("mousedown", (e) => (SetUI.downOnScrim = e.target === wrap));
wrap.addEventListener("click", (e) => { if (e.target === wrap && SetUI.downOnScrim) closeSettings(); });
document.addEventListener("keydown", (e) => {
if (e.key !== "Escape" || wrap.hidden || $(".modal-wrap, .qs-wrap, #tv:not([hidden])")) return;
e.preventDefault();
e.stopImmediatePropagation();
if ($(".menu.ctx")) closeMenus();
else closeSettings();
}, true);
}
const TOKENS = ["{artist}", "{title}", "{album}", "{albumartist}", "{index}", "{year}", "{genre}", "{collection}", "{platform}"];
function bindSettings() {
$$("[data-key]").forEach((el) => {
@@ -1518,6 +1594,7 @@ function bindSettings() {
});
$("#revokeBtn").addEventListener("click", async () => {
state.settings = await invoke("revoke_rights");
closeSettings(false);
$$(".pledge-check").forEach((c) => (c.checked = false));
$("#obAccept").disabled = true;
showOnboarding(1);
+1 -1
View File
File diff suppressed because one or more lines are too long
+210 -181
View File
@@ -1,5 +1,5 @@
<!doctype html>
<!-- atmosphere · index.html · Window markup: onboarding, sidebar, Get / Downloads / Settings views and the save-as menu. -->
<!-- atmosphere · index.html · Window markup: onboarding, sidebar, Get / Downloads views, the settings modal and the save-as menu. -->
<html lang="en">
<head>
<meta charset="utf-8" />
@@ -57,9 +57,9 @@
</div>
<div class="sidebar-foot">
<button class="nav-item" data-nav="settings"><span class="i" data-icon="settings"></span><span>Settings</span></button>
<button class="nav-item" id="settingsBtn" data-settings="" aria-haspopup="dialog"><span class="i" data-icon="settings"></span><span>Settings</span><kbd>Ctrl ,</kbd></button>
<button class="update-chip" id="updateChip" hidden></button>
<button class="engine-state" id="engineState" data-nav="settings" data-anchor="engine"></button>
<button class="engine-state" id="engineState" data-settings="engine" aria-haspopup="dialog"></button>
</div>
</aside>
@@ -163,184 +163,6 @@
</div>
</section>
<section class="view view-settings" data-view="settings" hidden>
<header class="view-head">
<div><h1>Settings</h1><p class="view-sub">Changes save as you make them.</p></div>
<span class="saved" id="savedFlag" aria-live="polite"></span>
</header>
<div class="settings-scroll">
<div class="settings">
<h2 id="set-playback">Playback</h2>
<div class="group">
<div class="setting">
<div><strong>Crossfade</strong><span id="xfNote">Off. The next song is always loaded ahead, so songs play back to back with no gap.</span></div>
<div class="slider-row"><input type="range" class="range" id="xfRange" min="0" max="12" step="1" value="0" aria-label="Crossfade length" /><span class="slider-val" id="xfVal">Off</span></div>
</div>
<label class="setting"><div><strong>Even out volume</strong><span>Plays quiet and loud songs at a similar level, like streaming apps do. Each song is measured once; your files aren't changed.</span></div><input type="checkbox" class="switch" id="levelToggle" /></label>
</div>
<h2 id="set-files">Files</h2>
<div class="group">
<div class="setting">
<div><strong>Save to</strong><span id="setDir"></span></div>
<button class="btn" id="setDirBtn">Change…</button>
</div>
<label class="setting"><div><strong>Prefer official audio</strong><span>When you save only the sound of a YouTube music video, use the artist's official audio upload if there is one, since videos often have intros, effects or a different mix.</span></div><input type="checkbox" class="switch" data-key="preferOfficialAudio" /></label>
<label class="setting"><div><strong>Give albums and playlists their own folder</strong><span>Albums go in Albums, playlists in Playlists (so they show up as playlists), and single songs in Tracks.</span></div><input type="checkbox" class="switch" data-key="collectionFolders" /></label>
<label class="setting"><div><strong>Number tracks in albums and playlists</strong><span>Keeps files sorted in their original order.</span></div><input type="checkbox" class="switch" data-key="numberTracks" /></label>
<div class="setting stack">
<div><strong>File names</strong><span>Click a token to add it. Preview: <code id="templatePreview"></code></span></div>
<input class="text" data-key="filenameTemplate" id="templateInput" spellcheck="false" />
<div class="tokens" id="tokens"></div>
</div>
<label class="setting"><div><strong>Skip anything downloaded before</strong><span>Remembers what you've saved, even after files are moved.</span></div><input type="checkbox" class="switch" data-key="skipDownloaded" /></label>
<div class="setting">
<div><strong>Downloads at once</strong><span>Albums and playlists always start in track order.</span></div>
<div class="stepper"><button type="button" data-step="-1" aria-label="Fewer">−</button><output id="concValue">3</output><button type="button" data-step="1" aria-label="More">+</button></div>
</div>
</div>
<h2 id="set-library">Library</h2>
<div class="group" id="libFolders"></div>
<div class="group gap-top">
<div class="setting"><div><strong>Playlist folders live in</strong><span id="playlistsDir"></span></div></div>
<label class="setting"><div><strong>Find artist photos, bios and logos</strong><span>Looks up artist names on Deezer, Wikipedia, Wikidata and TheAudioDB, which need no account or key. Nothing else is sent, and you can change or remove anything on an artist's page.</span></div><input type="checkbox" class="switch" data-key="artistInfo" /></label>
<div class="setting" id="hiddenSongs"></div>
<label class="setting"><div><strong>Copy songs into playlists</strong><span>Off: songs are hard-linked, so they appear in the folder without using extra space (same drive only). On: real copies, which are best for syncing to phones and USB drives.</span></div><input type="checkbox" class="switch" data-key="playlistCopy" /></label>
</div>
<h2 id="set-lyrics">Lyrics</h2>
<p class="set-note">Sources are tried top to bottom until synced lyrics are found. Reorder them with the arrows.</p>
<div class="group" id="lyricsProviders"></div>
<div class="group gap-top">
<div class="setting"><div><strong>Musixmatch API key</strong><span>A developer API key from developer.musixmatch.com (free tier available). Stays on this device.</span></div><input class="text" type="password" data-key="musixmatchKey" placeholder="Not set" spellcheck="false" autocomplete="off" /></div>
<label class="setting"><div><strong>Soft focus around the current line</strong><span>Blurs synced lyrics more the further they are from what's being sung. Hover any line to read it clearly.</span></div><input type="checkbox" class="switch" id="lyricsBlurToggle" /></label>
<label class="setting"><div><strong>Save lyrics with downloads</strong><span>Writes a synced .lrc file next to each song you download, when lyrics are found.</span></div><input type="checkbox" class="switch" data-key="lyricsOnDownload" /></label>
</div>
<h2 class="sub">Custom sources</h2>
<div class="group" id="customProviders"></div>
<h2 id="set-tags">Tags</h2>
<div class="group">
<label class="setting"><div><strong>Write metadata and cover art</strong><span>Title, artist, album, track number, date and artwork, plus any edits you make.</span></div><input type="checkbox" class="switch" data-key="embedMetadata" /></label>
<label class="setting"><div><strong>Keep chapters</strong><span>When the source has them (mixes, long videos).</span></div><input type="checkbox" class="switch" data-key="embedChapters" /></label>
</div>
<h2 id="set-video">Video</h2>
<div class="group">
<label class="setting"><div><strong>Embed subtitles</strong><span>When available, in these languages:</span></div><input type="checkbox" class="switch" data-key="embedSubtitles" /></label>
<div class="setting"><div><strong>Subtitle languages</strong><span>Comma-separated codes, e.g. <code>en,es</code></span></div><input class="text short" data-key="subtitleLangs" spellcheck="false" /></div>
<label class="setting"><div><strong>Cut sponsor segments</strong><span>Uses SponsorBlock on YouTube. Audio downloads also drop non-music sections.</span></div><input type="checkbox" class="switch" data-key="sponsorblock" /></label>
</div>
<h2 id="set-engine">Engine</h2>
<div class="group" id="engineGroup">
<div class="setting tool" id="toolYtdlp"></div>
<div class="setting tool" id="toolFfmpeg"></div>
<details class="setting advanced">
<summary><strong>Use my own copies</strong><span>Point to yt-dlp or ffmpeg you've installed yourself.</span></summary>
<div class="adv-fields">
<label><span>yt-dlp path</span><input class="text" data-key="ytdlpPath" placeholder="Managed by Atmosphere" spellcheck="false" /></label>
<label><span>ffmpeg path</span><input class="text" data-key="ffmpegPath" placeholder="Managed by Atmosphere" spellcheck="false" /></label>
</div>
</details>
</div>
<h2 id="set-network">Network &amp; sign-in</h2>
<div class="group">
<div class="setting signin">
<div><strong>Use my browser sign-in</strong><span>Lets Atmosphere reach content your account can already see, like your own private uploads. Your sign-in stays on this computer.</span><p class="signin-status" id="signinStatus" role="status" hidden></p></div>
<div class="signin-ctl">
<select data-key="cookiesBrowser" id="signinSelect">
<option value="">Off</option>
<option value="firefox">Firefox</option>
<option value="chrome">Chrome</option>
<option value="edge">Edge</option>
<option value="brave">Brave</option>
<option value="opera">Opera</option>
<option value="vivaldi">Vivaldi</option>
<option value="chromium">Chromium</option>
<option value="file">A cookies.txt file</option>
</select>
<button class="btn" id="signinCheck" type="button"><span class="label">Check</span><span class="spin" aria-hidden="true"></span></button>
</div>
</div>
<div class="setting" id="cookiesFileRow" hidden>
<div><strong>Cookies file</strong><span id="cookiesFilePath">Export one in Netscape format from a browser you're signed in to, using a cookies.txt extension.</span></div>
<button class="btn" id="cookiesFilePick" type="button">Choose file</button>
</div>
<div class="setting"><div><strong>Speed limit</strong><span>Blank for no limit. For example <code>2M</code> is 2 MB/s.</span></div><input class="text short" data-key="rateLimit" placeholder="No limit" spellcheck="false" /></div>
<div class="setting"><div><strong>Proxy</strong><span>For example <code>socks5://127.0.0.1:1080</code></span></div><input class="text" data-key="proxy" placeholder="None" spellcheck="false" /></div>
</div>
<h2 id="set-app">App</h2>
<div class="group">
<div class="setting"><div><strong>Updates</strong><span id="updateInfo">Atmosphere</span></div><button class="btn" id="updateBtn" type="button"><span class="label">Check for updates</span><span class="spin" aria-hidden="true"></span></button></div>
<label class="setting"><div><strong>Check for updates automatically</strong><span>When Atmosphere opens, and every few hours while it's open, it asks its GitHub releases page whether there's a newer version. You choose when to install, and every update is signed and checked first.</span></div><input type="checkbox" class="switch" data-key="checkUpdates" /></label>
<div class="setting">
<div><strong>Appearance</strong><span>Follows Windows unless you choose.</span></div>
<div class="seg" data-seg="theme"><button type="button" data-value="system">System</button><button type="button" data-value="light">Light</button><button type="button" data-value="dark">Dark</button></div>
</div>
<label class="setting"><div><strong>Offer copied links</strong><span>When you switch to Atmosphere with a link copied, offer to fetch it.</span></div><input type="checkbox" class="switch" data-key="watchClipboard" /></label>
</div>
<h2 id="set-discord">Discord</h2>
<div class="group">
<label class="setting"><div><strong>Show what you're listening to</strong><span class="api-status" id="discordStatus" role="status">Off. Nothing is shared with Discord.</span></div><input type="checkbox" class="switch" data-key="discordEnabled" id="discordToggle" /></label>
<div class="setting discord-opt">
<div><strong>Your status says</strong><span>The short line next to your name in member lists, DMs and your friends list, like "Listening to Atmosphere" or "Listening to Rihanna". Your profile card always shows the song, artist, cover and progress.</span></div>
<div class="seg" data-seg="discordStatus"><button type="button" data-value="app">Atmosphere</button><button type="button" data-value="artist">Artist</button><button type="button" data-value="song">Song</button></div>
</div>
<label class="setting discord-opt"><div><strong>Show cover art</strong><span>Your status shows the song's cover, with the Atmosphere logo as a small badge. Discord can only show pictures from the web, so Atmosphere finds the cover on Deezer or Apple Music (only the artist, title and album are sent). If none is found, or this is off, the Atmosphere logo is shown instead.</span></div><input type="checkbox" class="switch" data-key="discordCover" /></label>
<label class="setting discord-opt"><div><strong>Keep showing while paused</strong><span>Off: your status clears when you pause and comes back when you press play.</span></div><input type="checkbox" class="switch" data-key="discordPaused" /></label>
<details class="setting advanced discord-opt">
<summary><strong>Your own Discord app</strong><span>Shows your app's name and art instead, like "Listening to My Music". Leave the ID blank to use Atmosphere's.</span></summary>
<div class="adv-fields">
<ol class="discord-steps">
<li>Create an application in the <button class="link" id="discordPortal" type="button">Discord Developer Portal</button>. Its name is what your status shows.</li>
<li>Save the images. Under <strong>Rich Presence › Art Assets</strong>, add <code>atmosphere.png</code> and <code>paused.png</code> without renaming them, and optionally <code>invite-cover.png</code> as the invite cover image.</li>
<li>Paste the <strong>Application ID</strong> from <strong>General Information</strong> here.</li>
</ol>
<div class="discord-assets"><button class="btn" id="discordAssets" type="button"><span class="label">Save the images…</span><span class="spin" aria-hidden="true"></span></button><span class="muted small">You choose the folder. Includes the logo, the paused badge, an invite cover and these steps.</span></div>
<label><span>Application ID</span><input class="text" id="discordClientId" placeholder="Atmosphere's own" inputmode="numeric" spellcheck="false" autocomplete="off" /></label>
</div>
</details>
</div>
<h2 id="set-api">Connections</h2>
<p class="set-note">Let other apps on this computer, like stream overlays, status tools or your own scripts, see what's playing and control Atmosphere. It stays off unless you turn it on.</p>
<div class="group">
<label class="setting"><div><strong>Let other apps connect</strong><span class="api-status" id="apiStatus" role="status">Off</span></div><input type="checkbox" class="switch" data-key="apiEnabled" id="apiEnabledToggle" /></label>
<div class="setting">
<div><strong>Access token</strong><span id="apiTokenNote">Apps send this token with every request. It's shown once; Atmosphere keeps only a fingerprint.</span>
<div class="api-token" id="apiTokenBox" hidden><code id="apiTokenValue"></code><button class="btn small" id="apiTokenCopy" type="button">Copy</button><p class="muted small">Copy it now. It won't be shown again.</p></div>
</div>
<button class="btn" id="apiTokenBtn" type="button">Create token</button>
</div>
<label class="setting api-scope"><div><strong>See what's playing and browse the library</strong><span>Song details, artwork, playlists and live updates.</span></div><input type="checkbox" class="switch" data-key="apiRead" /></label>
<label class="setting api-scope"><div><strong>Control playback and the queue</strong><span>Play, pause, skip, seek, volume and queueing songs.</span></div><input type="checkbox" class="switch" data-key="apiControl" /></label>
<label class="setting api-scope"><div><strong>Send links to Get</strong><span>Opens the link in Atmosphere. Nothing is saved until you review and confirm it.</span></div><input type="checkbox" class="switch" data-key="apiLinks" /></label>
<div class="setting api-scope"><div><strong>Port</strong><span>Only reachable from this computer. <button class="link" id="apiDocs" type="button">How apps connect</button></span></div><input class="text short" id="apiPort" inputmode="numeric" spellcheck="false" aria-label="API port" /></div>
</div>
<h2 id="set-storage">Storage</h2>
<p class="set-note">Temporary files are removed automatically on every launch and exit. Here's everything else Atmosphere keeps.</p>
<div class="group" id="storageList"></div>
<div class="group">
<div class="setting"><div><strong>Back up your data</strong><span>Settings, stats and play counts, liked songs, artist photos and download history in one .zip. Your music isn't included and is never touched.</span></div><button class="btn" id="backupBtn" type="button"><span class="label">Back up</span><span class="spin" aria-hidden="true"></span></button></div>
<div class="setting"><div><strong>Restore from a backup</strong><span>Replaces your current settings and stats with the backup's, then restarts Atmosphere.</span></div><button class="btn" id="restoreBtn" type="button">Restore</button></div>
</div>
<h2 id="set-rights">Your responsibility</h2>
<div class="group">
<div class="setting">
<div><strong>Rights acknowledgment</strong><span id="rightsInfo"></span></div>
<button class="btn danger-ghost" id="revokeBtn">Withdraw</button>
</div>
</div>
</div>
</div>
</section>
</main>
</div>
@@ -408,6 +230,213 @@
</div>
</div>
<div class="set-wrap" id="settingsModal" hidden>
<div class="set-modal" role="dialog" aria-modal="true" aria-labelledby="setTitle">
<nav class="set-rail" aria-label="Settings sections">
<h2 class="nav-heading">Listening</h2>
<button class="nav-item set-tab" type="button" data-tab="playback" aria-controls="setp-playback"><span class="i" data-icon="headphones"></span><span>Playback</span></button>
<button class="nav-item set-tab" type="button" data-tab="lyrics" aria-controls="setp-lyrics"><span class="i" data-icon="microphone"></span><span>Lyrics</span></button>
<button class="nav-item set-tab" type="button" data-tab="library" aria-controls="setp-library"><span class="i" data-icon="books"></span><span>Library</span></button>
<h2 class="nav-heading">Downloads</h2>
<button class="nav-item set-tab" type="button" data-tab="downloads" aria-controls="setp-downloads"><span class="i" data-icon="download"></span><span>Downloads</span></button>
<button class="nav-item set-tab" type="button" data-tab="network" aria-controls="setp-network"><span class="i" data-icon="world"></span><span>Sign-in &amp; network</span></button>
<button class="nav-item set-tab" type="button" data-tab="engine" aria-controls="setp-engine"><span class="i" data-icon="tool"></span><span>Engine</span></button>
<h2 class="nav-heading">App</h2>
<button class="nav-item set-tab" type="button" data-tab="general" aria-controls="setp-general"><span class="i" data-icon="settings"></span><span>General</span></button>
<button class="nav-item set-tab" type="button" data-tab="discord" aria-controls="setp-discord"><span class="i" data-icon="brand-discord"></span><span>Discord</span></button>
<button class="nav-item set-tab" type="button" data-tab="connections" aria-controls="setp-connections"><span class="i" data-icon="plug-connected"></span><span>Connections</span></button>
<button class="nav-item set-tab" type="button" data-tab="storage" aria-controls="setp-storage"><span class="i" data-icon="database"></span><span>Storage</span></button>
</nav>
<div class="set-main">
<header class="set-head">
<div class="set-head-text"><h1 id="setTitle">Settings</h1><span class="saved" id="savedFlag" aria-live="polite"></span></div>
<button class="set-close" id="settingsClose" type="button" aria-label="Close settings" title="Close (Esc)"><span class="set-close-x"><span class="i" data-icon="x"></span></span><span class="set-close-key" aria-hidden="true">Esc</span></button>
</header>
<div class="set-scroll" id="settingsScroll">
<div class="settings">
<section class="set-panel" id="setp-playback" data-panel="playback" aria-labelledby="setTitle" hidden>
<span class="set-anchor" id="set-playback"></span>
<div class="group">
<div class="setting">
<div><strong>Crossfade</strong><span id="xfNote">Off. The next song is always loaded ahead, so songs play back to back with no gap.</span></div>
<div class="slider-row"><input type="range" class="range" id="xfRange" min="0" max="12" step="1" value="0" aria-label="Crossfade length" /><span class="slider-val" id="xfVal">Off</span></div>
</div>
<label class="setting"><div><strong>Even out volume</strong><span>Plays quiet and loud songs at a similar level, like streaming apps do. Each song is measured once; your files aren't changed.</span></div><input type="checkbox" class="switch" id="levelToggle" /></label>
</div>
</section>
<section class="set-panel" id="setp-lyrics" data-panel="lyrics" aria-labelledby="setTitle" hidden>
<span class="set-anchor" id="set-lyrics"></span>
<p class="set-note">Sources are tried top to bottom until synced lyrics are found. Reorder them with the arrows.</p>
<div class="group" id="lyricsProviders"></div>
<div class="group gap-top">
<div class="setting"><div><strong>Musixmatch API key</strong><span>A developer API key from developer.musixmatch.com (free tier available). Stays on this device.</span></div><input class="text" type="password" data-key="musixmatchKey" placeholder="Not set" spellcheck="false" autocomplete="off" /></div>
<label class="setting"><div><strong>Soft focus around the current line</strong><span>Blurs synced lyrics more the further they are from what's being sung. Hover any line to read it clearly.</span></div><input type="checkbox" class="switch" id="lyricsBlurToggle" /></label>
<label class="setting"><div><strong>Save lyrics with downloads</strong><span>Writes a synced .lrc file next to each song you download, when lyrics are found.</span></div><input type="checkbox" class="switch" data-key="lyricsOnDownload" /></label>
</div>
<h2 class="sub">Custom sources</h2>
<div class="group" id="customProviders"></div>
</section>
<section class="set-panel" id="setp-library" data-panel="library" aria-labelledby="setTitle" hidden>
<span class="set-anchor" id="set-library"></span>
<div class="group" id="libFolders"></div>
<div class="group gap-top">
<div class="setting"><div><strong>Playlist folders live in</strong><span id="playlistsDir"></span></div></div>
<label class="setting"><div><strong>Find artist photos, bios and logos</strong><span>Looks up artist names on Deezer, Wikipedia, Wikidata and TheAudioDB, which need no account or key. Nothing else is sent, and you can change or remove anything on an artist's page.</span></div><input type="checkbox" class="switch" data-key="artistInfo" /></label>
<div class="setting" id="hiddenSongs"></div>
<label class="setting"><div><strong>Copy songs into playlists</strong><span>Off: songs are hard-linked, so they appear in the folder without using extra space (same drive only). On: real copies, which are best for syncing to phones and USB drives.</span></div><input type="checkbox" class="switch" data-key="playlistCopy" /></label>
</div>
</section>
<section class="set-panel" id="setp-downloads" data-panel="downloads" aria-labelledby="setTitle" hidden>
<span class="set-anchor" id="set-downloads"></span>
<h2 id="set-files">Files</h2>
<div class="group">
<div class="setting">
<div><strong>Save to</strong><span id="setDir"></span></div>
<button class="btn" id="setDirBtn">Change…</button>
</div>
<label class="setting"><div><strong>Prefer official audio</strong><span>When you save only the sound of a YouTube music video, use the artist's official audio upload if there is one, since videos often have intros, effects or a different mix.</span></div><input type="checkbox" class="switch" data-key="preferOfficialAudio" /></label>
<label class="setting"><div><strong>Give albums and playlists their own folder</strong><span>Albums go in Albums, playlists in Playlists (so they show up as playlists), and single songs in Tracks.</span></div><input type="checkbox" class="switch" data-key="collectionFolders" /></label>
<label class="setting"><div><strong>Number tracks in albums and playlists</strong><span>Keeps files sorted in their original order.</span></div><input type="checkbox" class="switch" data-key="numberTracks" /></label>
<div class="setting stack">
<div><strong>File names</strong><span>Click a token to add it. Preview: <code id="templatePreview"></code></span></div>
<input class="text" data-key="filenameTemplate" id="templateInput" spellcheck="false" />
<div class="tokens" id="tokens"></div>
</div>
<label class="setting"><div><strong>Skip anything downloaded before</strong><span>Remembers what you've saved, even after files are moved.</span></div><input type="checkbox" class="switch" data-key="skipDownloaded" /></label>
<div class="setting">
<div><strong>Downloads at once</strong><span>Albums and playlists always start in track order.</span></div>
<div class="stepper"><button type="button" data-step="-1" aria-label="Fewer">−</button><output id="concValue">3</output><button type="button" data-step="1" aria-label="More">+</button></div>
</div>
</div>
<h2 id="set-tags">Tags</h2>
<div class="group">
<label class="setting"><div><strong>Write metadata and cover art</strong><span>Title, artist, album, track number, date and artwork, plus any edits you make.</span></div><input type="checkbox" class="switch" data-key="embedMetadata" /></label>
<label class="setting"><div><strong>Keep chapters</strong><span>When the source has them (mixes, long videos).</span></div><input type="checkbox" class="switch" data-key="embedChapters" /></label>
</div>
<h2 id="set-video">Video</h2>
<div class="group">
<label class="setting"><div><strong>Embed subtitles</strong><span>When available, in these languages:</span></div><input type="checkbox" class="switch" data-key="embedSubtitles" /></label>
<div class="setting"><div><strong>Subtitle languages</strong><span>Comma-separated codes, e.g. <code>en,es</code></span></div><input class="text short" data-key="subtitleLangs" spellcheck="false" /></div>
<label class="setting"><div><strong>Cut sponsor segments</strong><span>Uses SponsorBlock on YouTube. Audio downloads also drop non-music sections.</span></div><input type="checkbox" class="switch" data-key="sponsorblock" /></label>
</div>
</section>
<section class="set-panel" id="setp-network" data-panel="network" aria-labelledby="setTitle" hidden>
<span class="set-anchor" id="set-network"></span>
<div class="group">
<div class="setting signin">
<div><strong>Use my browser sign-in</strong><span>Lets Atmosphere reach content your account can already see, like your own private uploads. Your sign-in stays on this computer.</span><p class="signin-status" id="signinStatus" role="status" hidden></p></div>
<div class="signin-ctl">
<select data-key="cookiesBrowser" id="signinSelect">
<option value="">Off</option>
<option value="firefox">Firefox</option>
<option value="chrome">Chrome</option>
<option value="edge">Edge</option>
<option value="brave">Brave</option>
<option value="opera">Opera</option>
<option value="vivaldi">Vivaldi</option>
<option value="chromium">Chromium</option>
<option value="file">A cookies.txt file</option>
</select>
<button class="btn" id="signinCheck" type="button"><span class="label">Check</span><span class="spin" aria-hidden="true"></span></button>
</div>
</div>
<div class="setting" id="cookiesFileRow" hidden>
<div><strong>Cookies file</strong><span id="cookiesFilePath">Export one in Netscape format from a browser you're signed in to, using a cookies.txt extension.</span></div>
<button class="btn" id="cookiesFilePick" type="button">Choose file</button>
</div>
<div class="setting"><div><strong>Speed limit</strong><span>Blank for no limit. For example <code>2M</code> is 2 MB/s.</span></div><input class="text short" data-key="rateLimit" placeholder="No limit" spellcheck="false" /></div>
<div class="setting"><div><strong>Proxy</strong><span>For example <code>socks5://127.0.0.1:1080</code></span></div><input class="text" data-key="proxy" placeholder="None" spellcheck="false" /></div>
</div>
</section>
<section class="set-panel" id="setp-engine" data-panel="engine" aria-labelledby="setTitle" hidden>
<span class="set-anchor" id="set-engine"></span>
<div class="group" id="engineGroup">
<div class="setting tool" id="toolYtdlp"></div>
<div class="setting tool" id="toolFfmpeg"></div>
<details class="setting advanced">
<summary><strong>Use my own copies</strong><span>Point to yt-dlp or ffmpeg you've installed yourself.</span></summary>
<div class="adv-fields">
<label><span>yt-dlp path</span><input class="text" data-key="ytdlpPath" placeholder="Managed by Atmosphere" spellcheck="false" /></label>
<label><span>ffmpeg path</span><input class="text" data-key="ffmpegPath" placeholder="Managed by Atmosphere" spellcheck="false" /></label>
</div>
</details>
</div>
</section>
<section class="set-panel" id="setp-general" data-panel="general" aria-labelledby="setTitle" hidden>
<span class="set-anchor" id="set-app"></span>
<div class="group">
<div class="setting"><div><strong>Updates</strong><span id="updateInfo">Atmosphere</span></div><button class="btn" id="updateBtn" type="button"><span class="label">Check for updates</span><span class="spin" aria-hidden="true"></span></button></div>
<label class="setting"><div><strong>Check for updates automatically</strong><span>When Atmosphere opens, and every few hours while it's open, it asks its GitHub releases page whether there's a newer version. You choose when to install, and every update is signed and checked first.</span></div><input type="checkbox" class="switch" data-key="checkUpdates" /></label>
<div class="setting">
<div><strong>Appearance</strong><span>Follows Windows unless you choose.</span></div>
<div class="seg" data-seg="theme"><button type="button" data-value="system">System</button><button type="button" data-value="light">Light</button><button type="button" data-value="dark">Dark</button></div>
</div>
<label class="setting"><div><strong>Offer copied links</strong><span>When you switch to Atmosphere with a link copied, offer to fetch it.</span></div><input type="checkbox" class="switch" data-key="watchClipboard" /></label>
</div>
<h2 id="set-rights">Your responsibility</h2>
<div class="group">
<div class="setting">
<div><strong>Rights acknowledgment</strong><span id="rightsInfo"></span></div>
<button class="btn danger-ghost" id="revokeBtn">Withdraw</button>
</div>
</div>
</section>
<section class="set-panel" id="setp-discord" data-panel="discord" aria-labelledby="setTitle" hidden>
<span class="set-anchor" id="set-discord"></span>
<div class="group">
<label class="setting"><div><strong>Show what you're listening to</strong><span class="api-status" id="discordStatus" role="status">Off. Nothing is shared with Discord.</span></div><input type="checkbox" class="switch" data-key="discordEnabled" id="discordToggle" /></label>
<div class="setting discord-opt">
<div><strong>Your status says</strong><span>The short line next to your name in member lists, DMs and your friends list, like "Listening to Atmosphere" or "Listening to Rihanna". Your profile card always shows the song, artist, cover and progress.</span></div>
<div class="seg" data-seg="discordStatus"><button type="button" data-value="app">Atmosphere</button><button type="button" data-value="artist">Artist</button><button type="button" data-value="song">Song</button></div>
</div>
<label class="setting discord-opt"><div><strong>Show cover art</strong><span>Your status shows the song's cover, with the Atmosphere logo as a small badge. Discord can only show pictures from the web, so Atmosphere finds the cover on Deezer or Apple Music (only the artist, title and album are sent). If none is found, or this is off, the Atmosphere logo is shown instead.</span></div><input type="checkbox" class="switch" data-key="discordCover" /></label>
<label class="setting discord-opt"><div><strong>Keep showing while paused</strong><span>Off: your status clears when you pause and comes back when you press play.</span></div><input type="checkbox" class="switch" data-key="discordPaused" /></label>
<details class="setting advanced discord-opt">
<summary><strong>Your own Discord app</strong><span>Shows your app's name and art instead, like "Listening to My Music". Leave the ID blank to use Atmosphere's.</span></summary>
<div class="adv-fields">
<ol class="discord-steps">
<li>Create an application in the <button class="link" id="discordPortal" type="button">Discord Developer Portal</button>. Its name is what your status shows.</li>
<li>Save the images. Under <strong>Rich Presence › Art Assets</strong>, add <code>atmosphere.png</code> and <code>paused.png</code> without renaming them, and optionally <code>invite-cover.png</code> as the invite cover image.</li>
<li>Paste the <strong>Application ID</strong> from <strong>General Information</strong> here.</li>
</ol>
<div class="discord-assets"><button class="btn" id="discordAssets" type="button"><span class="label">Save the images…</span><span class="spin" aria-hidden="true"></span></button><span class="muted small">You choose the folder. Includes the logo, the paused badge, an invite cover and these steps.</span></div>
<label><span>Application ID</span><input class="text" id="discordClientId" placeholder="Atmosphere's own" inputmode="numeric" spellcheck="false" autocomplete="off" /></label>
</div>
</details>
</div>
</section>
<section class="set-panel" id="setp-connections" data-panel="connections" aria-labelledby="setTitle" hidden>
<span class="set-anchor" id="set-api"></span>
<p class="set-note">Let other apps on this computer, like stream overlays, status tools or your own scripts, see what's playing and control Atmosphere. It stays off unless you turn it on.</p>
<div class="group">
<label class="setting"><div><strong>Let other apps connect</strong><span class="api-status" id="apiStatus" role="status">Off</span></div><input type="checkbox" class="switch" data-key="apiEnabled" id="apiEnabledToggle" /></label>
<div class="setting">
<div><strong>Access token</strong><span id="apiTokenNote">Apps send this token with every request. It's shown once; Atmosphere keeps only a fingerprint.</span>
<div class="api-token" id="apiTokenBox" hidden><code id="apiTokenValue"></code><button class="btn small" id="apiTokenCopy" type="button">Copy</button><p class="muted small">Copy it now. It won't be shown again.</p></div>
</div>
<button class="btn" id="apiTokenBtn" type="button">Create token</button>
</div>
<label class="setting api-scope"><div><strong>See what's playing and browse the library</strong><span>Song details, artwork, playlists and live updates.</span></div><input type="checkbox" class="switch" data-key="apiRead" /></label>
<label class="setting api-scope"><div><strong>Control playback and the queue</strong><span>Play, pause, skip, seek, volume and queueing songs.</span></div><input type="checkbox" class="switch" data-key="apiControl" /></label>
<label class="setting api-scope"><div><strong>Send links to Get</strong><span>Opens the link in Atmosphere. Nothing is saved until you review and confirm it.</span></div><input type="checkbox" class="switch" data-key="apiLinks" /></label>
<div class="setting api-scope"><div><strong>Port</strong><span>Only reachable from this computer. <button class="link" id="apiDocs" type="button">How apps connect</button></span></div><input class="text short" id="apiPort" inputmode="numeric" spellcheck="false" aria-label="API port" /></div>
</div>
</section>
<section class="set-panel" id="setp-storage" data-panel="storage" aria-labelledby="setTitle" hidden>
<span class="set-anchor" id="set-storage"></span>
<p class="set-note">Temporary files are removed automatically on every launch and exit. Here's everything else Atmosphere keeps.</p>
<div class="group" id="storageList"></div>
<div class="group">
<div class="setting"><div><strong>Back up your data</strong><span>Settings, stats and play counts, liked songs, artist photos and download history in one .zip. Your music isn't included and is never touched.</span></div><button class="btn" id="backupBtn" type="button"><span class="label">Back up</span><span class="spin" aria-hidden="true"></span></button></div>
<div class="setting"><div><strong>Restore from a backup</strong><span>Replaces your current settings and stats with the backup's, then restarts Atmosphere.</span></div><button class="btn" id="restoreBtn" type="button">Restore</button></div>
</div>
</section>
</div>
</div>
</div>
</div>
</div>
<div class="toasts" id="toasts" aria-live="polite"></div>
<script src="icons.js"></script>
+1 -1
View File
@@ -76,7 +76,7 @@ function lyricsBody(big) {
const l = Lyr.data;
if (!l) return h("div", { class: "lyr-state" }, h("p", {}, "No lyrics found for this song."),
Lyr.cachedMiss ? h("p", { class: "muted small" }, "Searched recently with no match. Search again to retry every source.") : Lyr.tried.length ? h("ul", { class: "tried" }, ...Lyr.tried.map((a) => h("li", {}, h("strong", {}, a.provider), ` ${a.outcome}`))) : null,
h("div", { class: "row" }, h("button", { class: "btn small", onclick: () => loadLyrics(true) }, icon("refresh"), "Search again"), h("button", { class: "btn small ghost", onclick: () => { closeTv(); go("settings"); $("#set-lyrics")?.scrollIntoView(); } }, "Lyrics sources")));
h("div", { class: "row" }, h("button", { class: "btn small", onclick: () => loadLyrics(true) }, icon("refresh"), "Search again"), h("button", { class: "btn small ghost", onclick: () => { closeTv(); openSettings("lyrics"); } }, "Lyrics sources")));
if (l.instrumental) return h("div", { class: "lyr-state" }, icon("music"), h("p", {}, "Instrumental"));
return lyricLines(l, big);
}
+49 -5
View File
@@ -385,11 +385,55 @@ select { padding-right: var(--s6); cursor: pointer; }
.empty-downloads > .i { width: 32px; height: 32px; color: var(--text-3); }
.empty-downloads h2 { font-size: 15px; color: var(--text); }
/* settings */
.settings-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.settings { max-width: 760px; padding: 0 var(--s8) var(--s12); }
/* settings: a modal over the current view, sections as tabs down the left */
.set-wrap { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: calc(var(--titlebar) + var(--s2)) var(--s6) var(--s6); background: rgba(5, 6, 12, 0.5); animation: fadeOnly 150ms var(--ease); }
.set-wrap[hidden] { display: none; }
body:has(.modal-wrap, .set-wrap:not([hidden])) .titlebar::after { content: ""; position: absolute; inset: 0; z-index: 5; background: rgba(5, 6, 12, 0.5); pointer-events: none; animation: fadeOnly 150ms var(--ease); }
.set-modal { width: min(1040px, 100%); height: min(760px, 100%); min-height: 0; display: grid; grid-template-columns: clamp(188px, 24%, 236px) minmax(0, 1fr); background: var(--bg); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; animation: setIn 200ms var(--ease); }
@keyframes setIn { from { opacity: 0; transform: scale(0.985); } }
.set-rail { display: flex; flex-direction: column; gap: 2px; min-width: 0; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: var(--s5) var(--s3); background: var(--sidebar); border-right: 1px solid var(--hairline); }
.set-rail .nav-heading { margin-top: var(--s4); }
.set-rail .nav-heading:first-child { margin-top: 0; }
.set-tab { flex-shrink: 0; }
.set-tab .i { flex-shrink: 0; }
.set-tab > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.set-head { flex-shrink: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s4); padding: var(--s6) var(--s5) var(--s4) var(--s8); }
.set-head-text { display: flex; align-items: baseline; gap: var(--s3); min-width: 0; padding-top: 6px; }
.set-head h1 { font: 600 20px/1.2 var(--font-display); letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-close { flex-shrink: 0; display: grid; justify-items: center; gap: 3px; color: var(--text-3); transition: color 120ms var(--ease); }
.set-close-x { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid currentColor; transition: background-color 120ms var(--ease); }
.set-close .i { width: 18px; height: 18px; }
.set-close:hover { color: var(--text); }
.set-close:hover .set-close-x { background: var(--hover); }
.set-close-key { font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.set-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 0 var(--s8) var(--s8); }
.set-panel { animation: viewIn 160ms var(--ease); }
.set-anchor { display: none; }
.settings { max-width: 720px; }
.settings h2 { font-size: 13px; font-weight: 600; color: var(--text-2); margin: var(--s6) 0 var(--s2) var(--s1); }
.settings h2:first-child { margin-top: 0; }
.settings h2:first-child, .set-anchor + h2 { margin-top: 0; }
.settings .setting { flex-wrap: wrap; row-gap: var(--s2); }
.settings .setting > div:first-child { flex: 1 1 240px; }
.settings .setting > .text, .settings .slider-row { max-width: 100%; }
.settings .slider-row .range { width: min(180px, 100%); }
@media (max-width: 760px) {
.set-wrap { padding: calc(var(--titlebar) + var(--s2)) var(--s3) var(--s3); }
.set-modal { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); border-radius: 14px; }
.set-rail { flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: var(--s2); gap: var(--s1); border-right: 0; border-bottom: 1px solid var(--hairline); scrollbar-width: thin; }
.set-rail .nav-heading { display: none; }
.set-tab { width: auto; }
.set-tab[aria-current="page"]::before { display: none; }
.set-tab:focus-visible { outline-offset: -2px; }
.set-head { padding: var(--s4) var(--s4) var(--s3) var(--s5); }
.set-scroll { padding: 0 var(--s5) var(--s6); }
.set-close-key { display: none; }
}
@media (max-height: 560px) {
.set-wrap { padding-bottom: var(--s3); }
.set-rail { padding-block: var(--s3); }
.set-head { padding-top: var(--s4); padding-bottom: var(--s3); }
}
.group { border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--hairline); overflow: hidden; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: var(--s6); min-height: 56px; padding: var(--s3) var(--s4); border-top: 1px solid var(--hairline); }
.setting:first-child { border-top: 0; }
@@ -471,7 +515,7 @@ label.setting { cursor: pointer; }
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after { animation-duration: 120ms !important; animation-iteration-count: 1 !important; transition-duration: 120ms !important; }
.view, .inspector, .save-menu, .menu, .toast, .group-card { animation-name: fadeOnly !important; }
.view, .inspector, .save-menu, .menu, .toast, .group-card, .set-modal, .set-panel { animation-name: fadeOnly !important; }
.skeleton, .bar.indet > i, .btn .spin { animation: none !important; }
}
@keyframes fadeOnly { from { opacity: 0; } }