Selecting Aero starts a random track from the Frutiger Aero playlist (Bigblamboii's set on SoundCloud); every following track is drawn at random too, so the set shuffles itself. The player is the credit bar from the mock: a 44px glass circle with a note by default, expanding into pause + the track's title + "SoundCloud - artist" (both reported by the widget). - Only Aero ever touches SoundCloud: the embed and the widget API are created while the theme is on and the listener has not turned it off; light/dark request nothing (pinned by a suite check). - The off choice persists (freezmo.aero-music.v1); re-selecting Aero in Settings is fresh consent (applyTheme clears it). - Autoplay rides the theme-selection gesture; after a reload the circle comes up paused (browsers require a gesture) and one tap starts it. - Volume 45; the iframe is 1px and inert, only the audio engine; the credit area collapses back to the circle without stopping the music. - Geometry: clears the phone tab bar, lifts above the chat composer and the wizard bar, steps aside under immersive overlays and while the cookie notice shares the corner. 44px targets on phones. - Cookie policy gained the third-party-embed paragraph it was owed. tests/aero-music-test.mjs (16th suite, stubbed widget API, 21 checks). All suites green, contrast scan clean. Version 0.7.0, SW v92.
53 lines
1.2 KiB
TypeScript
53 lines
1.2 KiB
TypeScript
"use client";
|
|
|
|
/**
|
|
* The Frutiger Aero soundtrack's little store.
|
|
*
|
|
* The player itself lives in components/AeroMusic.tsx; this is the one bit of
|
|
* state that outlives it: whether the listener turned the music off. The flag
|
|
* clears when Aero is (re)selected in Settings — picking the theme again is
|
|
* the gesture that says "play it".
|
|
*/
|
|
|
|
const STORAGE_KEY = "freezmo.aero-music.v1";
|
|
|
|
let dismissed = false;
|
|
let loaded = false;
|
|
|
|
function load(): void {
|
|
if (loaded) return;
|
|
loaded = true;
|
|
try {
|
|
dismissed = window.localStorage.getItem(STORAGE_KEY) === "off";
|
|
} catch {
|
|
/* private mode */
|
|
}
|
|
}
|
|
|
|
/** True while the Aero player may run (Aero on, not turned off). */
|
|
export function aeroMusicEnabled(): boolean {
|
|
load();
|
|
return !dismissed;
|
|
}
|
|
|
|
/** The listener closed the player: stop until the theme is chosen again. */
|
|
export function dismissAeroMusic(): void {
|
|
dismissed = true;
|
|
loaded = true;
|
|
try {
|
|
window.localStorage.setItem(STORAGE_KEY, "off");
|
|
} catch {
|
|
/* private mode */
|
|
}
|
|
}
|
|
|
|
/** Selecting Aero again is fresh consent. */
|
|
export function allowAeroMusic(): void {
|
|
dismissed = false;
|
|
loaded = true;
|
|
try {
|
|
window.localStorage.removeItem(STORAGE_KEY);
|
|
} catch {
|
|
/* private mode */
|
|
}
|
|
}
|