ottimizzazione face tracking e backup di navigazione (tap e tastiera/pedale)
This commit is contained in:
@@ -105,7 +105,7 @@
|
||||
</div>
|
||||
|
||||
<!-- Sections rendering -->
|
||||
<div class="lyrics-view">
|
||||
<div class="lyrics-view" (click)="handleLyricsClick($event)">
|
||||
<div *ngFor="let section of parsedSections(); let si = index"
|
||||
class="section"
|
||||
[class.chorus]="section.type === 'chorus'"
|
||||
|
||||
@@ -42,6 +42,30 @@ export class PlayerPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
} else if (event.key === 'MediaPlayPause') {
|
||||
this.toggleAudio();
|
||||
event.preventDefault();
|
||||
} else if (event.key === 'PageUp' || event.key === 'ArrowLeft') {
|
||||
this.prev(true);
|
||||
event.preventDefault();
|
||||
} else if (event.key === 'PageDown' || event.key === 'ArrowRight') {
|
||||
this.next(false, true);
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
|
||||
handleLyricsClick(event: MouseEvent) {
|
||||
const target = event.target as HTMLElement;
|
||||
if (target && (target.closest('button') || target.closest('ion-button') || target.closest('.side-indicator') || target.closest('.autoscroll-indicator') || target.closest('ion-icon'))) {
|
||||
return;
|
||||
}
|
||||
const selection = window.getSelection();
|
||||
if (selection && selection.toString().length > 0) {
|
||||
return;
|
||||
}
|
||||
const clickX = event.clientX;
|
||||
const width = window.innerWidth;
|
||||
if (clickX > width / 2) {
|
||||
this.next(false, true);
|
||||
} else {
|
||||
this.prev(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user