optimizing mobile song text view
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
<nav class="head">
|
<nav [class.hidden]="(windowScroll$|async)>60" class="head">
|
||||||
<div class="links">
|
<div class="links">
|
||||||
<app-link [icon]="faSongs" link="/songs" text="Lieder"></app-link>
|
<app-link [icon]="faSongs" link="/songs" text="Lieder"></app-link>
|
||||||
<app-link [icon]="faShows" link="/shows" text="Veranstaltungen"></app-link>
|
<app-link [icon]="faShows" link="/shows" text="Veranstaltungen"></app-link>
|
||||||
|
|||||||
@@ -11,11 +11,17 @@ nav {
|
|||||||
background: @navigation-background;
|
background: @navigation-background;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
.card-3;
|
.card-3;
|
||||||
|
transition: all 300ms ease-in-out;
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: flex-end;
|
align-items: flex-end;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|
||||||
|
&.hidden {
|
||||||
|
@media screen and (max-width: 860px) {
|
||||||
|
top: -60px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,23 +1,21 @@
|
|||||||
import {Component, OnInit} from '@angular/core';
|
import {Component} from '@angular/core';
|
||||||
import {faMusic} from '@fortawesome/free-solid-svg-icons/faMusic';
|
import {faMusic} from '@fortawesome/free-solid-svg-icons/faMusic';
|
||||||
import {faPersonBooth} from '@fortawesome/free-solid-svg-icons/faPersonBooth';
|
import {faPersonBooth} from '@fortawesome/free-solid-svg-icons/faPersonBooth';
|
||||||
import {faUserCog} from '@fortawesome/free-solid-svg-icons/faUserCog';
|
import {faUserCog} from '@fortawesome/free-solid-svg-icons/faUserCog';
|
||||||
|
import {fromEvent} from 'rxjs';
|
||||||
|
import {distinctUntilChanged, map, shareReplay, startWith} from 'rxjs/operators';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-navigation',
|
selector: 'app-navigation',
|
||||||
templateUrl: './navigation.component.html',
|
templateUrl: './navigation.component.html',
|
||||||
styleUrls: ['./navigation.component.less']
|
styleUrls: ['./navigation.component.less']
|
||||||
})
|
})
|
||||||
export class NavigationComponent implements OnInit {
|
export class NavigationComponent {
|
||||||
|
|
||||||
public faSongs = faMusic;
|
public faSongs = faMusic;
|
||||||
public faShows = faPersonBooth;
|
public faShows = faPersonBooth;
|
||||||
public faUser = faUserCog;
|
public faUser = faUserCog;
|
||||||
|
|
||||||
constructor() {
|
public readonly windowScroll$ = fromEvent(window, 'scroll').pipe(map(x => window.scrollY), startWith(0), distinctUntilChanged(), shareReplay(1));
|
||||||
}
|
|
||||||
|
|
||||||
ngOnInit() {
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
<div [class.chords]="_chordMode!=='hide'" class="song-text">
|
<div (click)="onClick()" [class.chords]="_chordMode!=='hide'" class="song-text">
|
||||||
|
|
||||||
<div (click)="onChordClick()" class="menu">
|
<div (click)="onChordClick()" class="menu">
|
||||||
<fa-icon [icon]="faLines"></fa-icon>
|
<fa-icon [icon]="faLines"></fa-icon>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngFor="let section of sections" [class.chorus]="section.type===1" class="section">
|
<div *ngFor="let section of sections" [class.chorus]="section.type===1" class="section">
|
||||||
<div *ngFor="let line of getLines(section)" [class.chord]="line.type===0" class="line">
|
<div *ngFor="let line of getLines(section)" [class.chord]="line.type===0" class="line">{{line.text}}</div>
|
||||||
{{line.text}}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
|
import {Component, ElementRef, EventEmitter, Input, OnInit, Output} from '@angular/core';
|
||||||
import {
|
import {
|
||||||
Line,
|
Line,
|
||||||
LineType,
|
LineType,
|
||||||
@@ -26,7 +26,7 @@ export class SongTextComponent implements OnInit {
|
|||||||
@Output() public chordModeChanged = new EventEmitter<ChordMode>();
|
@Output() public chordModeChanged = new EventEmitter<ChordMode>();
|
||||||
public faLines = faGripLines;
|
public faLines = faGripLines;
|
||||||
|
|
||||||
constructor(private textRenderingService: TextRenderingService) {
|
constructor(private textRenderingService: TextRenderingService, private elRef: ElementRef) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
@@ -71,4 +71,7 @@ export class SongTextComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public onClick() {
|
||||||
|
scrollTo(0, this.elRef.nativeElement.offsetTop - 20);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,9 @@
|
|||||||
//html, body {
|
//html, body {
|
||||||
// height: 100%;
|
// height: 100%;
|
||||||
//}
|
//}
|
||||||
|
html {
|
||||||
|
scroll-behavior: smooth;
|
||||||
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user