refactor: zoom a livello di dispositivo e rimozione zoom da playlist

This commit is contained in:
David Frassi
2026-07-14 01:47:57 +02:00
parent 73097bf9bd
commit ad9286002b
4 changed files with 31 additions and 17 deletions
+15
View File
@@ -59,6 +59,9 @@ export class SettingsService {
/** Schermo nero per l'ascolto delle playlist in macchina: true = attivo */
public carModeBlackScreen = signal<boolean>(false);
/** Global zoom/font size factor for song presentation */
public globalZoom = signal<number>(1.0);
/** Identificativo utente univoco per la gestione delle comunità */
public userUuid = signal<string>('');
@@ -264,6 +267,14 @@ export class SettingsService {
this.carModeBlackScreen.set(false);
}
const savedGlobalZoom = localStorage.getItem('global-zoom');
if (savedGlobalZoom !== null) {
const parsed = parseFloat(savedGlobalZoom);
this.globalZoom.set(isNaN(parsed) ? 1.0 : parsed);
} else {
this.globalZoom.set(1.0);
}
// Sync browser fullscreen state with listeners (supporting vendor prefixes)
const updateFullscreenState = () => {
const isFs = !!(
@@ -325,6 +336,10 @@ export class SettingsService {
localStorage.setItem('car-mode-black-screen', this.carModeBlackScreen().toString());
});
effect(() => {
localStorage.setItem('global-zoom', this.globalZoom().toString());
});
effect(() => {
const active = this.keepScreenOn();
localStorage.setItem('keep-screen-on', active.toString());