refactor(frontend): rename booklore-ui to frontend
- Frontend path: - rename the tracked Angular app tree from `booklore-ui/` to `frontend/` - preserve file contents during the move so this commit stays focused on the path change itself - Frontend docs: - update the moved frontend README and contribution guide where they refer to the renamed folder - keep those edits limited to path references introduced by the directory rename
This commit is contained in:
+107
@@ -0,0 +1,107 @@
|
||||
<ng-container *transloco="let t; prefix: 'settingsReader.appMode'">
|
||||
<div class="preferences-section">
|
||||
<div class="section-header">
|
||||
<h3 class="section-title">
|
||||
<i class="pi pi-cog"></i>
|
||||
{{ t('title') }}
|
||||
</h3>
|
||||
<p class="section-description">
|
||||
{{ t('description') }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="settings-card">
|
||||
<div class="setting-item">
|
||||
<div class="setting-info">
|
||||
<div class="setting-label-row">
|
||||
<label class="setting-label">{{ t('pdfLabel') }}</label>
|
||||
<div class="button-group">
|
||||
@for (item of scopeOptions; track item) {
|
||||
<button
|
||||
type="button"
|
||||
class="option-button"
|
||||
[class.selected]="selectedPdfScope === item.key"
|
||||
(click)="selectedPdfScope = item.key; onPdfScopeChange()">
|
||||
<i [class]="item.icon"></i>
|
||||
<span class="option-text">{{ item.key === 'Global' ? t('defaultOverride') : t('bookSpecific') }}</span>
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<p class="setting-description">
|
||||
{{ t('pdfDesc') }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="setting-item">
|
||||
<div class="setting-info">
|
||||
<div class="setting-label-row">
|
||||
<label class="setting-label">{{ t('ebookLabel') }}</label>
|
||||
<div class="button-group">
|
||||
@for (item of scopeOptions; track item) {
|
||||
<button
|
||||
type="button"
|
||||
class="option-button"
|
||||
[class.selected]="selectedEpubScope === item.key"
|
||||
(click)="selectedEpubScope = item.key; onEpubScopeChange()">
|
||||
<i [class]="item.icon"></i>
|
||||
<span class="option-text">{{ item.key === 'Global' ? t('defaultOverride') : t('bookSpecific') }}</span>
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<p class="setting-description">
|
||||
{{ t('ebookDesc') }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="setting-item">
|
||||
<div class="setting-info">
|
||||
<div class="setting-label-row">
|
||||
<label class="setting-label">{{ t('comicLabel') }}</label>
|
||||
<div class="button-group">
|
||||
@for (item of scopeOptions; track item) {
|
||||
<button
|
||||
type="button"
|
||||
class="option-button"
|
||||
[class.selected]="selectedCbxScope === item.key"
|
||||
(click)="selectedCbxScope = item.key; onCbxScopeChange()">
|
||||
<i [class]="item.icon"></i>
|
||||
<span class="option-text">{{ item.key === 'Global' ? t('defaultOverride') : t('bookSpecific') }}</span>
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<p class="setting-description">
|
||||
{{ t('comicDesc') }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="setting-item">
|
||||
<div class="setting-info">
|
||||
<div class="setting-label-row">
|
||||
<label class="setting-label">{{ t('streamingPdfLabel') }}</label>
|
||||
<div class="button-group">
|
||||
@for (item of scopeOptions; track item) {
|
||||
<button
|
||||
type="button"
|
||||
class="option-button"
|
||||
[class.selected]="selectedNewPdfScope === item.key"
|
||||
(click)="selectedNewPdfScope = item.key; onNewPdfScopeChange()">
|
||||
<i [class]="item.icon"></i>
|
||||
<span class="option-text">{{ item.key === 'Global' ? t('defaultOverride') : t('bookSpecific') }}</span>
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<p class="setting-description">
|
||||
{{ t('streamingPdfDesc') }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ng-container>
|
||||
+151
@@ -0,0 +1,151 @@
|
||||
.preferences-section {
|
||||
@media (min-width: 768px) {
|
||||
padding: 0 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
.section-header {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
font-size: 1.125rem;
|
||||
font-weight: 600;
|
||||
color: var(--p-text-color);
|
||||
margin: 0 0 0.5rem 0;
|
||||
|
||||
.pi {
|
||||
color: var(--p-primary-color);
|
||||
}
|
||||
}
|
||||
|
||||
.section-description {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 0.5rem;
|
||||
color: var(--p-text-muted-color);
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.5;
|
||||
margin: 0;
|
||||
|
||||
.pi {
|
||||
color: var(--p-primary-color);
|
||||
margin-top: 0.125rem;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.settings-card {
|
||||
border: 1px solid var(--p-content-border-color);
|
||||
border-radius: 8px;
|
||||
background: var(--p-content-background);
|
||||
padding: 1.5rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.setting-item {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 2rem;
|
||||
padding: 0.25rem 0;
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
.setting-info {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
|
||||
.setting-label {
|
||||
display: block;
|
||||
font-weight: 600;
|
||||
color: var(--p-text-color);
|
||||
font-size: 1rem;
|
||||
margin-bottom: 0.5rem;
|
||||
min-width: 220px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.setting-label-row {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 1rem;
|
||||
margin-bottom: 0.5rem;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.setting-label {
|
||||
margin-bottom: 0;
|
||||
min-width: 220px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.setting-description {
|
||||
color: var(--p-text-muted-color);
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.5;
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.button-group {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
gap: 0.5rem;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.option-button {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 0.375rem;
|
||||
padding: 0.5rem 0.75rem;
|
||||
border-radius: 0.375rem;
|
||||
border: 1.5px solid color-mix(in srgb, var(--text-color) 20%, transparent);
|
||||
background: color-mix(in srgb, var(--text-color) 5%, transparent);
|
||||
color: var(--text-color);
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 500;
|
||||
min-width: 4.5rem;
|
||||
|
||||
i {
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.option-text {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
||||
border-color: color-mix(in srgb, var(--primary-color) 40%, transparent);
|
||||
}
|
||||
|
||||
&.selected {
|
||||
border-color: var(--primary-color);
|
||||
background: color-mix(in srgb, var(--primary-color) 10%, transparent);
|
||||
color: var(--primary-color);
|
||||
box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary-color) 15%, transparent);
|
||||
|
||||
&:hover {
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
import {ChangeDetectionStrategy, Component, inject, Input, OnInit} from '@angular/core';
|
||||
import {TranslocoDirective} from '@jsverse/transloco';
|
||||
import {ReaderPreferencesService} from '../reader-preferences.service';
|
||||
import {UserSettings} from '../../user-management/user.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-settings-application-mode',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
templateUrl: './settings-application-mode.component.html',
|
||||
standalone: true,
|
||||
styleUrls: ['./settings-application-mode.component.scss'],
|
||||
imports: [TranslocoDirective]
|
||||
})
|
||||
export class SettingsApplicationModeComponent implements OnInit {
|
||||
@Input() userSettings!: UserSettings;
|
||||
|
||||
readonly scopeOptions = [
|
||||
{name: 'Global', key: 'Global', icon: 'pi pi-globe'},
|
||||
{name: 'Individual', key: 'Individual', icon: 'pi pi-user'}
|
||||
];
|
||||
|
||||
selectedPdfScope!: string;
|
||||
selectedNewPdfScope!: string;
|
||||
selectedEpubScope!: string;
|
||||
selectedCbxScope!: string;
|
||||
|
||||
private readonly readerPreferencesService = inject(ReaderPreferencesService);
|
||||
|
||||
ngOnInit(): void {
|
||||
this.loadPreferences();
|
||||
}
|
||||
|
||||
private loadPreferences(): void {
|
||||
this.selectedPdfScope = this.userSettings.perBookSetting.pdf;
|
||||
this.selectedNewPdfScope = this.userSettings.perBookSetting.newPdf || 'Global';
|
||||
this.selectedEpubScope = this.userSettings.perBookSetting.epub;
|
||||
this.selectedCbxScope = this.userSettings.perBookSetting.cbx;
|
||||
}
|
||||
|
||||
onPdfScopeChange() {
|
||||
this.readerPreferencesService.updatePreference(['perBookSetting', 'pdf'], this.selectedPdfScope);
|
||||
}
|
||||
|
||||
onNewPdfScopeChange() {
|
||||
this.readerPreferencesService.updatePreference(['perBookSetting', 'newPdf'], this.selectedNewPdfScope);
|
||||
}
|
||||
|
||||
onEpubScopeChange() {
|
||||
this.readerPreferencesService.updatePreference(['perBookSetting', 'epub'], this.selectedEpubScope);
|
||||
}
|
||||
|
||||
onCbxScopeChange() {
|
||||
this.readerPreferencesService.updatePreference(['perBookSetting', 'cbx'], this.selectedCbxScope);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user