Integrazione Liturgia: accordioni, navigazione date, proxy CORS, alto contrasto e piano AI
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { LiturgiaPage } from './liturgia.page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
RouterModule.forChild([
|
||||
{
|
||||
path: '',
|
||||
component: LiturgiaPage
|
||||
}
|
||||
])
|
||||
],
|
||||
declarations: [LiturgiaPage]
|
||||
})
|
||||
export class LiturgiaPageModule {}
|
||||
@@ -0,0 +1,71 @@
|
||||
<ion-header [translucent]="true" class="ion-no-border">
|
||||
<ion-toolbar class="bg-gradient">
|
||||
<ion-buttons slot="start">
|
||||
<ion-back-button defaultHref="/settings" color="secondary"></ion-back-button>
|
||||
</ion-buttons>
|
||||
<ion-title class="outfit-font">Liturgia del Giorno</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content [fullscreen]="true" class="bg-gradient">
|
||||
<div class="liturgia-container ion-padding">
|
||||
|
||||
<div class="date-header-wrapper ion-margin-bottom">
|
||||
<div class="date-header glass">
|
||||
<div class="date-navigation">
|
||||
<ion-button fill="clear" color="secondary" (click)="liturgyService.prevDay()">
|
||||
<ion-icon name="chevron-back-outline"></ion-icon>
|
||||
</ion-button>
|
||||
<h2 class="outfit-font">{{ getTodayString() }}</h2>
|
||||
<ion-button fill="clear" color="secondary" (click)="liturgyService.nextDay()">
|
||||
<ion-icon name="chevron-forward-outline"></ion-icon>
|
||||
</ion-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div *ngIf="liturgyService.loading()" class="ion-text-center ion-padding">
|
||||
<ion-spinner name="crescent" color="secondary"></ion-spinner>
|
||||
<p class="outfit-font">Caricamento letture...</p>
|
||||
</div>
|
||||
|
||||
<div *ngIf="!liturgyService.loading() && liturgyService.readings() as r" class="readings-content">
|
||||
|
||||
<ion-accordion-group class="glass-accordion ion-margin-bottom">
|
||||
|
||||
<!-- Prima Lettura -->
|
||||
<ion-accordion value="prima" *ngIf="r.primaLettura">
|
||||
<ion-item slot="header" class="transparent-item">
|
||||
<ion-label class="outfit-font reading-title">Prima Lettura</ion-label>
|
||||
</ion-item>
|
||||
<div class="reading-text ion-padding" slot="content" [innerHTML]="r.primaLettura"></div>
|
||||
</ion-accordion>
|
||||
|
||||
<!-- Seconda Lettura -->
|
||||
<ion-accordion value="seconda" *ngIf="r.secondaLettura">
|
||||
<ion-item slot="header" class="transparent-item">
|
||||
<ion-label class="outfit-font reading-title">Seconda Lettura</ion-label>
|
||||
</ion-item>
|
||||
<div class="reading-text ion-padding" slot="content" [innerHTML]="r.secondaLettura"></div>
|
||||
</ion-accordion>
|
||||
|
||||
<!-- Vangelo -->
|
||||
<ion-accordion value="vangelo" *ngIf="r.vangelo">
|
||||
<ion-item slot="header" class="transparent-item">
|
||||
<ion-label class="outfit-font reading-title">Vangelo</ion-label>
|
||||
</ion-item>
|
||||
<div class="reading-text ion-padding" slot="content" [innerHTML]="r.vangelo"></div>
|
||||
</ion-accordion>
|
||||
|
||||
</ion-accordion-group>
|
||||
|
||||
<!-- Le sezioni dei suggerimenti sono state rimosse temporaneamente in attesa dell'implementazione AI lato server -->
|
||||
</div>
|
||||
|
||||
<div *ngIf="!liturgyService.loading() && !liturgyService.readings()" class="ion-text-center ion-padding glass">
|
||||
<p class="outfit-font">Non è stato possibile caricare le letture per oggi.</p>
|
||||
<ion-button fill="clear" color="secondary" (click)="liturgyService.fetchTodayLiturgy()">Riprova</ion-button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</ion-content>
|
||||
@@ -0,0 +1,144 @@
|
||||
.bg-gradient {
|
||||
--background: transparent;
|
||||
background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
|
||||
}
|
||||
|
||||
.liturgia-container {
|
||||
max-width: 800px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.glass {
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
backdrop-filter: blur(10px);
|
||||
-webkit-backdrop-filter: blur(10px);
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
border-radius: 16px;
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.date-header {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
|
||||
.date-navigation {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
|
||||
h2 {
|
||||
margin: 0;
|
||||
font-size: 1.1rem;
|
||||
color: var(--ion-color-secondary);
|
||||
text-transform: capitalize;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.keywords-container {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 4px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.moment-group {
|
||||
.moment-header {
|
||||
margin-bottom: 8px;
|
||||
ion-badge {
|
||||
font-size: 0.9rem;
|
||||
padding: 6px 12px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.glass-accordion {
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
backdrop-filter: blur(10px);
|
||||
-webkit-backdrop-filter: blur(10px);
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
border-radius: 16px;
|
||||
overflow: hidden;
|
||||
|
||||
ion-accordion {
|
||||
--background: transparent;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.reading-title {
|
||||
color: var(--ion-color-secondary);
|
||||
font-size: 1.1rem;
|
||||
font-weight: 600;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.reading-text {
|
||||
color: rgba(255, 255, 255, 0.9);
|
||||
line-height: 1.6;
|
||||
font-size: 1rem;
|
||||
white-space: pre-wrap;
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
|
||||
::ng-deep br {
|
||||
display: block;
|
||||
content: "";
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.section-title {
|
||||
color: #fff;
|
||||
font-size: 1.2rem;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.song-card {
|
||||
padding: 0;
|
||||
transition: transform 0.2s ease;
|
||||
|
||||
&:active {
|
||||
transform: scale(0.98);
|
||||
}
|
||||
|
||||
.song-title {
|
||||
color: #fff;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.song-author {
|
||||
color: rgba(255, 255, 255, 0.5);
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
}
|
||||
|
||||
.transparent-item {
|
||||
--background: transparent;
|
||||
--color: #fff;
|
||||
--padding-start: 16px;
|
||||
--padding-end: 16px;
|
||||
}
|
||||
|
||||
/* Alto Contrasto per Liturgia */
|
||||
:host-context(body.high-contrast) {
|
||||
.glass-accordion {
|
||||
// Mantengo il look glass per gli header come richiesto
|
||||
|
||||
ion-accordion {
|
||||
.reading-text {
|
||||
color: #000 !important; // Testo nero
|
||||
background: #fff !important; // Sfondo bianco solido per massimo contrasto
|
||||
padding: 20px !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
import { Component, OnInit, inject, signal } from '@angular/core';
|
||||
import { LiturgyService } from '../../services/liturgy.service';
|
||||
import { Router } from '@angular/router';
|
||||
import { Canto } from '../../services/canti.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-liturgia',
|
||||
templateUrl: './liturgia.page.html',
|
||||
styleUrls: ['./liturgia.page.scss'],
|
||||
standalone: false
|
||||
})
|
||||
export class LiturgiaPage implements OnInit {
|
||||
public liturgyService = inject(LiturgyService);
|
||||
private router = inject(Router);
|
||||
|
||||
ngOnInit() {
|
||||
this.liturgyService.fetchTodayLiturgy();
|
||||
}
|
||||
|
||||
suggest() {
|
||||
this.liturgyService.suggestSongs();
|
||||
}
|
||||
|
||||
onDateChange(event: any) {
|
||||
const newDate = event.detail.value.split('T')[0];
|
||||
this.liturgyService.fetchTodayLiturgy(newDate);
|
||||
}
|
||||
|
||||
openSong(song: Canto) {
|
||||
this.router.navigate(['/player'], { queryParams: { id: song.id } });
|
||||
}
|
||||
|
||||
getTodayString(): string {
|
||||
const date = new Date(this.liturgyService.selectedDate());
|
||||
return date.toLocaleDateString('it-IT', {
|
||||
weekday: 'long',
|
||||
day: 'numeric',
|
||||
month: 'long',
|
||||
year: 'numeric'
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -57,7 +57,14 @@
|
||||
<h2 class="settings-item-title">Editor e Canti Personali</h2>
|
||||
<p class="settings-item-subtitle">Abilita aggiunta e gestione "Miei"</p>
|
||||
</ion-label>
|
||||
<ion-toggle slot="end" [checked]="settingsService.showEditor()" (ionChange)="settingsService.toggleEditor()" color="secondary"></ion-toggle>
|
||||
<ion-toggle slot="end" [checked]="settingsService.showEditor()" (ionChange)="settingsService.toggleEditor()" color="secondary" [disabled]="true"></ion-toggle>
|
||||
</ion-item>
|
||||
<ion-item class="transparent-item" lines="none" routerLink="/liturgia" detail="true" button>
|
||||
<ion-icon name="book-outline" slot="start" color="secondary"></ion-icon>
|
||||
<ion-label class="outfit-font">
|
||||
<h2 class="settings-item-title">Liturgia del Giorno</h2>
|
||||
<p class="settings-item-subtitle">Letture e suggerimenti canti</p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user