Support configurable background image and transparency (#1126)

This commit is contained in:
Aditya Chandel
2025-09-09 22:18:52 -06:00
committed by GitHub
parent d8be663a4d
commit 1008a9476b
25 changed files with 1159 additions and 147 deletions
+13 -4
View File
@@ -1,14 +1,23 @@
@if (loading) {
<div class="splash-screen">
<div class="splash-content">
<img src="assets/favicon.svg" alt="Booklore logo" class="logo" />
<img src="assets/favicon.svg" alt="Booklore logo" class="logo"/>
<h1>Loading Booklore…</h1>
<p>Please wait while we get things ready.</p>
<div class="loader"></div>
</div>
</div>
} @else {
<p-confirmDialog />
<p-toast></p-toast>
<router-outlet></router-outlet>
<div class="app-background"
[style.background-image]="showBackground() ? backgroundStyle() : 'none'">
<div class="app-overlay"
[style.backdrop-filter]="showBackground() ? blurStyle() : 'none'"
[style.-webkit-backdrop-filter]="showBackground() ? blurStyle() : 'none'"
[style.display]="showBackground() ? 'block' : 'none'"></div>
<div class="app-content">
<p-confirmDialog></p-confirmDialog>
<p-toast></p-toast>
<router-outlet></router-outlet>
</div>
</div>
}
+22
View File
@@ -1,3 +1,25 @@
.app-background {
min-height: 100vh;
position: relative;
background-size: cover;
background-position: center center;
background-attachment: fixed;
background-repeat: no-repeat;
}
.app-overlay {
position: absolute;
inset: 0;
background: rgba(20, 20, 20, 0.4);
z-index: 0;
}
.app-content {
position: relative;
z-index: 1;
min-height: 100vh;
}
.splash-screen {
display: flex;
align-items: center;
+23 -1
View File
@@ -1,4 +1,4 @@
import {Component, inject, OnInit, OnDestroy} from '@angular/core';
import {Component, computed, inject, OnDestroy, OnInit} from '@angular/core';
import {RxStompService} from './shared/websocket/rx-stomp.service';
import {BookService} from './book/service/book.service';
import {NotificationEventService} from './shared/websocket/notification-event.service';
@@ -37,6 +37,7 @@ export class AppComponent implements OnInit, OnDestroy {
private taskEventService = inject(TaskEventService);
private duplicateFileService = inject(DuplicateFileService);
private appConfigService = inject(AppConfigService); // Keep it here to ensure the service is initialized
private readonly configService = inject(AppConfigService);
ngOnInit(): void {
this.authInit.initialized$.subscribe(ready => {
@@ -101,4 +102,25 @@ export class AppComponent implements OnInit, OnDestroy {
ngOnDestroy(): void {
this.subscriptions.forEach(sub => sub.unsubscribe());
}
readonly backgroundStyle = computed(() => {
const state = this.configService.appState();
const backgroundImage = state.backgroundImage;
if (!backgroundImage) {
return 'none';
}
return `url('${backgroundImage}')`;
});
readonly blurStyle = computed(() => {
const state = this.configService.appState();
const blur = state.backgroundBlur ?? AppConfigService.DEFAULT_BACKGROUND_BLUR;
return `blur(${blur}px)`;
});
readonly showBackground = computed(() => {
const state = this.configService.appState();
return state.showBackground ?? true;
});
}
@@ -1,6 +1,10 @@
.no-books-text {
font-size: 1rem;
font-weight: 500;
color: var(--text-color);
background: var(--card-background);
padding: 0.75rem 1rem;
border-radius: 0.5rem;
}
.no-books-container {
@@ -2,4 +2,9 @@ export interface AppState {
preset?: string;
primary?: string;
surface?: string;
backgroundImage?: string;
backgroundBlur?: number;
showBackground?: boolean;
lastUpdated?: number; // Not persisted, used for cache busting
surfaceAlpha?: number;
}
@@ -1,8 +1,9 @@
import {DOCUMENT, isPlatformBrowser} from '@angular/common';
import {effect, inject, Injectable, PLATFORM_ID, signal} from '@angular/core';
import {$t, updatePreset, updateSurfacePalette} from '@primeng/themes';
import {$t} from '@primeng/themes';
import Aura from '@primeng/themes/aura';
import {AppState} from '../model/app-state.model';
import {UrlHelperService} from '../../utilities/service/url-helper.service';
type ColorPalette = Record<string, string>;
@@ -15,10 +16,15 @@ interface Palette {
providedIn: 'root',
})
export class AppConfigService {
public static readonly DEFAULT_BACKGROUND_BLUR = 20;
public static readonly DEFAULT_SURFACE_ALPHA = 0.88;
public static readonly DEFAULT_PRIMARY_COLOR = 'indigo';
private readonly STORAGE_KEY = 'appConfigState';
appState = signal<AppState>({});
document = inject(DOCUMENT);
platformId = inject(PLATFORM_ID);
private readonly urlHelper = inject(UrlHelperService);
private initialized = false;
readonly surfaces: Palette[] = [
@@ -162,17 +168,20 @@ export class AppConfigService {
constructor() {
const initialState = this.loadAppState();
this.appState.set({...initialState});
this.appState.set(initialState);
this.document.documentElement.classList.add('p-dark');
if (isPlatformBrowser(this.platformId)) {
this.onPresetChange();
this.setBackendImage();
setTimeout(() => {
this.onPresetChange();
this.initialized = true;
}, 0);
}
effect(() => {
const state = this.appState();
if (!this.initialized || !state) {
this.initialized = true;
return;
}
this.saveAppState(state);
@@ -180,33 +189,87 @@ export class AppConfigService {
}, {allowSignalWrites: true});
}
private setBackendImage(): void {
const backendUrl = this.urlHelper.getBackgroundImageUrl(Date.now());
this.appState.update(state => ({
...state,
backgroundImage: backendUrl,
lastUpdated: Date.now()
}));
}
refreshBackgroundImage(): void {
const timestamp = Date.now();
const backendUrl = this.urlHelper.getBackgroundImageUrl(timestamp);
this.appState.update(state => ({
...state,
backgroundImage: backendUrl,
lastUpdated: timestamp
}));
}
private loadAppState(): AppState {
const defaultState: AppState = {
preset: 'Aura',
primary: AppConfigService.DEFAULT_PRIMARY_COLOR,
surface: 'neutral',
backgroundBlur: AppConfigService.DEFAULT_BACKGROUND_BLUR,
showBackground: true,
surfaceAlpha: AppConfigService.DEFAULT_SURFACE_ALPHA,
};
if (isPlatformBrowser(this.platformId)) {
const storedState = localStorage.getItem(this.STORAGE_KEY);
if (storedState) {
return JSON.parse(storedState);
try {
const parsed = JSON.parse(storedState);
return {
preset: parsed.preset || defaultState.preset,
primary: parsed.primary || defaultState.primary,
surface: parsed.surface || defaultState.surface,
backgroundBlur: parsed.backgroundBlur ?? defaultState.backgroundBlur,
showBackground: parsed.showBackground ?? defaultState.showBackground,
surfaceAlpha: parsed.surfaceAlpha ?? defaultState.surfaceAlpha,
};
} catch (error) {
return defaultState;
}
}
}
return {
preset: 'Aura',
primary: 'green',
surface: 'neutral',
};
return defaultState;
}
private saveAppState(state: AppState): void {
if (isPlatformBrowser(this.platformId)) {
localStorage.setItem(this.STORAGE_KEY, JSON.stringify(state));
const {backgroundImage, lastUpdated, ...stateToSave} = state;
localStorage.setItem(this.STORAGE_KEY, JSON.stringify(stateToSave));
}
}
private getSurfacePalette(surface: string): ColorPalette {
return this.surfaces.find(s => s.name === surface)?.palette ?? {};
const palette = this.surfaces.find(s => s.name === surface)?.palette ?? {};
const alpha = this.appState().surfaceAlpha ?? AppConfigService.DEFAULT_SURFACE_ALPHA;
const transparentPalette: ColorPalette = {};
// Text/content colors that should remain opaque (not transparent)
const opaqueKeys = ['0', '50', '100', '200', '300', '400'];
Object.entries(palette).forEach(([key, hex]) => {
if (opaqueKeys.includes(key)) {
// Keep text colors opaque
transparentPalette[key] = hex;
} else {
// Apply transparency to background colors (500-950)
transparentPalette[key] = this.hexToRgba(hex, alpha);
}
});
return transparentPalette;
}
getPresetExt(): object {
const surfacePalette = this.getSurfacePalette(this.appState().surface ?? 'neutral');
const primaryName = this.appState().primary ?? 'green';
const primaryName = this.appState().primary ?? AppConfigService.DEFAULT_PRIMARY_COLOR;
const presetPalette = (Aura.primitive ?? {}) as Record<string, ColorPalette>;
const color = presetPalette[primaryName] ?? {};
@@ -248,8 +311,8 @@ export class AppConfigService {
highlight: {
background: 'color-mix(in srgb, {primary.400}, transparent 84%)',
focusBackground: 'color-mix(in srgb, {primary.400}, transparent 76%)',
color: 'rgba(255,255,255,.87)',
focusColor: 'rgba(255,255,255,.87)'
color: 'rgba(255,255,255,.88)',
focusColor: 'rgba(255,255,255,.88)'
}
}
}
@@ -257,9 +320,30 @@ export class AppConfigService {
};
}
private hexToRgba(hex: string, alpha: number = AppConfigService.DEFAULT_SURFACE_ALPHA): string {
const r = parseInt(hex.slice(1, 3), 16);
const g = parseInt(hex.slice(3, 5), 16);
const b = parseInt(hex.slice(5, 7), 16);
return `rgba(${r}, ${g}, ${b}, ${alpha})`;
}
onPresetChange(): void {
const surfacePalette = this.getSurfacePalette(this.appState().surface ?? 'neutral');
const preset = this.getPresetExt();
$t().preset(Aura).preset(preset).surfacePalette(surfacePalette).use({useDefaultOptions: true});
}
updateBackgroundBlur(blur: number): void {
this.appState.update(state => ({
...state,
backgroundBlur: blur
}));
}
updateSurfaceAlpha(alpha: number): void {
this.appState.update(state => ({
...state,
surfaceAlpha: alpha
}));
}
}
@@ -0,0 +1,32 @@
import {Injectable, inject} from '@angular/core';
import {HttpClient} from '@angular/common/http';
import {Observable, map, tap} from 'rxjs';
import {API_CONFIG} from '../../../config/api-config';
@Injectable({providedIn: 'root'})
export class BackgroundUploadService {
private readonly baseUrl = `${API_CONFIG.BASE_URL}/api/v1/background`;
private readonly http = inject(HttpClient);
uploadFile(file: File): Observable<string> {
const formData = new FormData();
formData.append('file', file);
return this.http.post<{ url: string }>(`${this.baseUrl}/upload`, formData).pipe(
tap(response => console.log('File upload response:', response)),
map(resp => resp?.url)
);
}
uploadUrl(url: string): Observable<string> {
return this.http.post<{ url: string }>(`${this.baseUrl}/url`, {url}).pipe(
tap(response => console.log('URL upload response:', response)),
map(resp => resp?.url)
);
}
resetToDefault(): Observable<void> {
return this.http.delete<void>(this.baseUrl).pipe(
tap(() => console.log('Background reset to default'))
);
}
}
@@ -28,6 +28,67 @@
</button>
}
</div>
<div class="surface-alpha-control">
<span class="config-panel-label">Transparency: {{ (1 - surfaceAlphaValue).toFixed(2) }}</span>
<p-slider
[(ngModel)]="surfaceAlphaValue"
[min]="0.75"
[max]="1"
[step]="0.01"
(onSlideEnd)="updateSurfaceAlpha($event)"
class="alpha-slider">
</p-slider>
</div>
</div>
<div class="config-panel-colors">
<span class="config-panel-label">Background</span>
<div class="background-center-wrapper">
<div class="background-controls">
<div class="background-control">
<label>Show: </label>
<p-toggleswitch
size="small"
[(ngModel)]="backgroundVisible">
</p-toggleswitch>
</div>
@if (backgroundVisible) {
<div class="background-control">
<label for="blurRange">Blur: {{ backgroundBlurValue }}</label>
<p-slider
[(ngModel)]="backgroundBlurValue"
[min]="0"
[max]="30"
[step]="1"
(onSlideEnd)="updateBackgroundBlur($event)"
class="blur-slider">
</p-slider>
</div>
}
</div>
@if (backgroundVisible) {
<div class="background-actions-row">
<p-button
class="upload-bg-btn"
size="small"
outlined
severity="primary"
(click)="openUploadDialog()"
label="Upload Image"
icon="pi pi-upload">
</p-button>
<p-button
class="reset-bg-btn"
size="small"
outlined
severity="secondary"
(click)="resetBackground()"
label="Reset"
icon="pi pi-refresh">
</p-button>
</div>
}
</div>
</div>
</div>
@@ -0,0 +1,95 @@
.config-panel-section {
margin-bottom: 1.5rem;
padding-bottom: 1rem;
border-bottom: 1px solid var(--surface-border);
}
.config-panel-field {
display: flex;
flex-direction: column;
gap: 0.5rem;
margin-bottom: 1rem;
label {
font-weight: 500;
color: var(--text-color);
}
input[type="text"], input[type="range"] {
padding: 0.5rem;
border: 1px solid var(--surface-border);
border-radius: var(--border-radius);
background: var(--surface-ground);
color: var(--text-color);
}
input[type="range"] {
width: 100%;
}
}
// Background section styles
.config-panel-colors {
.surface-alpha-control {
display: flex;
flex-direction: column;
margin-top: 0.75rem;
padding: 0.5rem 0;
.config-panel-label {
margin-bottom: 0.5rem;
}
.alpha-slider {
width: 100%;
}
}
.background-center-wrapper {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.background-controls {
display: flex;
flex-direction: column;
width: 100%;
box-sizing: border-box;
}
.background-control {
display: flex;
align-items: center;
padding-top: 0.5rem;
padding-bottom: 0.1rem;
label {
min-width: 80px;
font-size: 0.85em;
font-weight: 500;
color: var(--text-secondary-color);
}
.blur-slider {
flex: 1;
margin-left: 0.5rem;
}
}
.background-actions-row {
display: flex;
flex-direction: row;
gap: 0.75rem;
margin-top: 0.75rem;
width: 100%;
box-sizing: border-box;
align-items: center;
justify-content: flex-end;
.upload-bg-btn {
margin-left: 0;
}
}
}
}
@@ -1,13 +1,19 @@
import {CommonModule} from '@angular/common';
import {Component, computed, effect, inject} from '@angular/core';
import {FormsModule} from '@angular/forms';
import {$t} from '@primeng/themes';
import Aura from '@primeng/themes/aura';
import {ButtonModule} from 'primeng/button';
import {RadioButtonModule} from 'primeng/radiobutton';
import {ToggleSwitchModule} from 'primeng/toggleswitch';
import {InputTextModule} from 'primeng/inputtext';
import {SliderModule, SliderSlideEndEvent} from 'primeng/slider';
import {AppConfigService} from '../../../core/service/app-config.service';
import {FaviconService} from './favicon-service';
import {DialogService, DynamicDialogRef} from 'primeng/dynamicdialog';
import {UploadDialogComponent} from './upload-dialog/upload-dialog.component';
import {UrlHelperService} from '../../../utilities/service/url-helper.service';
import {BackgroundUploadService} from './background-upload.service';
import {debounceTime, Subject} from 'rxjs';
type ColorPalette = Record<string, string>;
@@ -20,6 +26,7 @@ interface Palette {
selector: 'app-theme-configurator',
standalone: true,
templateUrl: './theme-configurator.component.html',
styleUrls: ['./theme-configurator.component.scss'],
host: {
class: 'config-panel hidden'
},
@@ -28,12 +35,17 @@ interface Palette {
FormsModule,
ButtonModule,
RadioButtonModule,
ToggleSwitchModule
]
ToggleSwitchModule,
InputTextModule,
SliderModule
],
providers: [DialogService]
})
export class ThemeConfiguratorComponent {
readonly configService = inject(AppConfigService);
readonly faviconService = inject(FaviconService);
readonly urlHelper = inject(UrlHelperService);
private readonly backgroundUploadService = inject(BackgroundUploadService);
readonly surfaces = this.configService.surfaces;
@@ -41,7 +53,7 @@ export class ThemeConfiguratorComponent {
readonly selectedSurfaceColor = computed(() => this.configService.appState().surface);
readonly faviconColor = computed(() => {
const name = this.selectedPrimaryColor() ?? 'green';
const name = this.selectedPrimaryColor() ?? AppConfigService.DEFAULT_PRIMARY_COLOR;
const presetPalette = (Aura.primitive ?? {}) as Record<string, ColorPalette>;
const colorPalette = presetPalette[name];
return colorPalette?.[500] ?? name;
@@ -62,6 +74,64 @@ export class ThemeConfiguratorComponent {
);
});
get backgroundVisible(): boolean {
return this.configService.appState().showBackground ?? true;
}
set backgroundVisible(value: boolean) {
this.configService.appState.update(state => ({
...state,
showBackground: value
}));
}
get backgroundBlurValue(): number {
return this.configService.appState().backgroundBlur ?? AppConfigService.DEFAULT_BACKGROUND_BLUR;
}
set backgroundBlurValue(value: number) {
this.configService.updateBackgroundBlur(value);
}
get surfaceAlphaValue(): number {
return this.configService.appState().surfaceAlpha ?? AppConfigService.DEFAULT_SURFACE_ALPHA;
}
set surfaceAlphaValue(value: number) {
this.configService.updateSurfaceAlpha(value);
}
private readonly dialogService = inject(DialogService);
private dialogRef: DynamicDialogRef | undefined;
private surfaceAlphaSubject = new Subject<number>();
constructor() {
this.surfaceAlphaSubject.pipe(
debounceTime(100)
).subscribe(value => {
this.configService.updateSurfaceAlpha(value);
});
}
openUploadDialog() {
this.dialogRef = this.dialogService.open(UploadDialogComponent, {
header: 'Upload or Paste Image URL',
width: '450px',
modal: true,
closable: true,
data: {}
});
this.dialogRef.onClose.subscribe((result) => {
if (result) {
if (result.success || result.uploaded || result.url || result.imageUrl) {
this.configService.refreshBackgroundImage();
}
}
});
}
updateColors(event: Event, type: 'primary' | 'surface', color: { name: string; palette?: ColorPalette }) {
this.configService.appState.update((state) => ({
...state,
@@ -69,4 +139,26 @@ export class ThemeConfiguratorComponent {
}));
event.stopPropagation();
}
updateBackgroundBlur(event: SliderSlideEndEvent): void {
this.configService.appState.update(state => ({
...state,
backgroundBlur: Number(event.value)
}));
}
updateSurfaceAlpha(event: SliderSlideEndEvent): void {
this.surfaceAlphaSubject.next(Number(event.value));
}
resetBackground() {
this.backgroundUploadService.resetToDefault().subscribe({
next: () => {
this.configService.refreshBackgroundImage();
},
error: (err) => {
console.error('Failed to reset background:', err);
}
});
}
}
@@ -0,0 +1,59 @@
<div class="upload-dialog-content">
<div class="upload-section">
<div class="file-selector">
<label class="file-label">Choose File:</label>
<p-button
label="Select Image"
icon="pi pi-upload"
(click)="fileInput.click()"
outlined
severity="info">
</p-button>
</div>
<input
#fileInput
type="file"
accept=".jpg,.jpeg,.png,image/jpeg,image/png"
(change)="onFileSelected($event)"
style="display: none;">
<small class="file-note">Only JPG and PNG files are supported</small>
@if (uploadFile) {
<small class="selected-file">{{ uploadFile.name }}</small>
}
</div>
<p-divider align="center" type="solid">
<span class="or-text">OR</span>
</p-divider>
<div class="url-section">
<label for="urlInput" class="url-label">Image URL:</label>
<input
id="urlInput"
type="text"
[(ngModel)]="uploadImageUrl"
placeholder="Paste image URL here"
class="url-input"
pInputText>
<small class="url-note">Only JPG and PNG URLs are supported</small>
</div>
@if (uploadError) {
<p-message severity="error">{{uploadError}}</p-message>
}
<div class="dialog-footer">
<p-button
label="Cancel"
icon="pi pi-times"
(click)="cancel()"
severity="secondary"
outlined>
</p-button>
<p-button
label="Submit"
icon="pi pi-check"
(click)="submit()">
</p-button>
</div>
</div>
@@ -0,0 +1,82 @@
.upload-dialog-content {
display: flex;
flex-direction: column;
gap: 1.5rem;
padding: 1rem 0;
.upload-section {
display: flex;
flex-direction: column;
gap: 0.5rem;
margin-bottom: 1rem;
.file-selector {
display: flex;
align-items: center;
gap: 1rem;
}
.file-label {
font-weight: 500;
color: var(--text-color);
}
.file-input {
padding: 0.75rem;
border: 1px solid var(--border-color);
border-radius: var(--p-border-radius);
background: var(--ground-background);
}
.file-note {
color: var(--text-secondary-color);
font-size: 0.875rem;
margin-top: 0.25rem;
}
.selected-file {
color: var(--text-secondary-color);
font-style: italic;
}
}
.url-section {
display: flex;
flex-direction: column;
gap: 0.25rem;
.url-label {
font-weight: 500;
color: var(--text-color);
margin-bottom: 0.5rem;
}
.url-input {
width: 100%;
padding: 0.75rem;
}
.url-note {
color: var(--text-secondary-color);
font-size: 0.875rem;
margin-top: 0.25rem;
}
}
.or-text {
font-size: 0.9rem;
color: var(--text-color);
font-weight: 500;
}
p-message {
margin-top: 1rem;
}
.dialog-footer {
display: flex;
gap: 1rem;
justify-content: flex-end;
margin-top: 1rem;
}
}
@@ -0,0 +1,72 @@
import {Component, inject} from '@angular/core';
import {CommonModule} from '@angular/common';
import {FormsModule} from '@angular/forms';
import {DynamicDialogRef} from 'primeng/dynamicdialog';
import {ButtonModule} from 'primeng/button';
import {InputTextModule} from 'primeng/inputtext';
import {DividerModule} from 'primeng/divider';
import {MessageModule} from 'primeng/message';
import {BackgroundUploadService} from '../background-upload.service';
import {take} from 'rxjs';
@Component({
selector: 'app-upload-dialog',
standalone: true,
templateUrl: './upload-dialog.component.html',
styleUrls: ['./upload-dialog.component.scss'],
imports: [
CommonModule,
FormsModule,
ButtonModule,
InputTextModule,
DividerModule,
MessageModule
]
})
export class UploadDialogComponent {
private readonly dialogRef = inject(DynamicDialogRef);
private readonly backgroundUploadService = inject(BackgroundUploadService);
uploadImageUrl = '';
uploadFile: File | null = null;
uploadError = '';
onFileSelected(event: Event) {
const input = event.target as HTMLInputElement;
if (input.files && input.files.length > 0) {
this.uploadFile = input.files[0];
this.uploadImageUrl = '';
}
}
submit() {
this.uploadError = '';
let upload$;
if (this.uploadFile) {
upload$ = this.backgroundUploadService.uploadFile(this.uploadFile);
} else if (this.uploadImageUrl.trim()) {
upload$ = this.backgroundUploadService.uploadUrl(this.uploadImageUrl.trim());
} else {
this.uploadError = 'Please select a file or paste a URL.';
return;
}
upload$.pipe(take(1)).subscribe({
next: (imageUrl) => {
if (imageUrl) {
this.dialogRef.close({ imageUrl });
} else {
this.uploadError = 'Failed to upload image.';
}
},
error: (err) => {
console.error('Upload failed:', err);
this.uploadError = 'Upload failed. Please try again.';
}
});
}
cancel() {
this.dialogRef.close();
}
}
@@ -7,7 +7,7 @@
}
.header-card {
background: var(--surface-card, rgba(255, 255, 255, 0.05));
background: var(--card-background);
border-radius: 8px;
padding: 25px;
margin-bottom: 30px;
@@ -196,10 +196,10 @@
color: var(--text-color, #ffffff);
padding: 10px 16px;
border-radius: 6px;
font-size: 0.9rem;
cursor: pointer;
transition: all 0.3s ease;
display: flex;
font-weight: 500;
align-items: center;
gap: 8px;
flex: 1;
@@ -422,7 +422,7 @@
}
.chart-section {
background: var(--surface-card, rgba(255, 255, 255, 0.05));
background: var(--card-background);
border-radius: 8px;
padding: 15px;
backdrop-filter: blur(10px);
@@ -40,4 +40,16 @@ export class UrlHelperService {
const url = `${this.mediaBaseUrl}/bookdrop/${bookdropId}/cover`;
return this.appendToken(url);
}
getBackgroundImageUrl(lastUpdated?: number): string {
let url = `${this.mediaBaseUrl}/background`;
if (lastUpdated) {
url += `?t=${lastUpdated}`;
}
const token = this.getToken();
if (token) {
url += `${url.includes('?') ? '&' : '?'}token=${token}`;
}
return url;
}
}
@@ -114,14 +114,15 @@
}
.config-panel-colors {
> div {
// Only apply flex to color picker rows, not background-center-wrapper
> div:not(.background-center-wrapper) {
justify-content: flex-start;
padding-top: .5rem;
display: flex;
gap: .5rem;
flex-wrap: wrap;
button {
button:not([pbutton]):not(.p-button) {
border: none;
width: 1.25rem;
height: 1.25rem;