+27
@@ -11,6 +11,33 @@
|
||||
</div>
|
||||
|
||||
<div class="settings-content">
|
||||
<div class="preferences-section">
|
||||
<div class="section-header">
|
||||
<h3 class="section-title">
|
||||
<i class="pi pi-palette"></i>
|
||||
{{ t('appearance.sectionTitle') }}
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div class="settings-card">
|
||||
<div class="setting-item">
|
||||
<div class="setting-info">
|
||||
<div class="setting-label-row">
|
||||
<label class="setting-label">{{ t('appearance.supportButtonAnimation') }}</label>
|
||||
<p-toggleswitch
|
||||
[(ngModel)]="supportButtonAnimation"
|
||||
(onChange)="onSupportAnimationChange($event.checked)">
|
||||
</p-toggleswitch>
|
||||
</div>
|
||||
<p class="setting-description">
|
||||
<i class="pi pi-info-circle"></i>
|
||||
{{ t('appearance.supportButtonAnimationDesc') }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="preferences-section">
|
||||
<div class="section-header">
|
||||
<h3 class="section-title">
|
||||
|
||||
+10
@@ -14,6 +14,8 @@ import {Slider} from 'primeng/slider';
|
||||
import {ExternalDocLinkComponent} from '../../../shared/components/external-doc-link/external-doc-link.component';
|
||||
import {TranslocoDirective, TranslocoPipe, TranslocoService} from '@jsverse/transloco';
|
||||
|
||||
export const SUPPORT_ANIMATION_KEY = 'booklore-support-animation';
|
||||
|
||||
@Component({
|
||||
selector: 'app-global-preferences',
|
||||
standalone: true,
|
||||
@@ -38,6 +40,8 @@ export class GlobalPreferencesComponent implements OnInit {
|
||||
enableTelemetry: true,
|
||||
};
|
||||
|
||||
supportButtonAnimation = localStorage.getItem(SUPPORT_ANIMATION_KEY) !== 'false';
|
||||
|
||||
coverCroppingSettings: CoverCroppingSettings = {
|
||||
verticalCroppingEnabled: false,
|
||||
horizontalCroppingEnabled: false,
|
||||
@@ -85,6 +89,12 @@ export class GlobalPreferencesComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
onSupportAnimationChange(checked: boolean): void {
|
||||
this.supportButtonAnimation = checked;
|
||||
localStorage.setItem(SUPPORT_ANIMATION_KEY, String(checked));
|
||||
window.dispatchEvent(new StorageEvent('storage', {key: SUPPORT_ANIMATION_KEY, newValue: String(checked)}));
|
||||
}
|
||||
|
||||
onCoverCroppingChange(): void {
|
||||
this.saveSetting(AppSettingKey.COVER_CROPPING_SETTINGS, this.coverCroppingSettings);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user