show component

This commit is contained in:
2020-03-08 09:45:05 +01:00
committed by smuddy
parent d68cd590ad
commit bb0676a428
53 changed files with 344 additions and 185 deletions

View File

@@ -0,0 +1 @@
<input (input)="onInputChange($event.target.value)" placeholder="Suche">

View File

@@ -0,0 +1,16 @@
@import "../../../../../../styles/styles";
input {
font-size: 16px;
background: transparent;
border: none;
border-bottom: 1px solid #ccc;
color: #888;
margin-right: 20px;
&:focus {
outline: none;
border-bottom: 2px solid @primary-color;
margin-bottom: -1px;
}
}

View File

@@ -0,0 +1,25 @@
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
import {FilterComponent} from './filter.component';
describe('FilterComponent', () => {
let component: FilterComponent;
let fixture: ComponentFixture<FilterComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [FilterComponent]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(FilterComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@@ -0,0 +1,21 @@
import {Component} from '@angular/core';
import {Router} from '@angular/router';
@Component({
selector: 'app-filter',
templateUrl: './filter.component.html',
styleUrls: ['./filter.component.less']
})
export class FilterComponent {
constructor(private router: Router) {
}
public onInputChange(text: string): void {
const route = text
? this.router.createUrlTree(['songs'], {queryParams: {q: text}})
: this.router.createUrlTree(['songs']);
this.router.navigateByUrl(route);
}
}

View File

@@ -0,0 +1,3 @@
<a [routerLink]="link" href="#" routerLinkActive="active">
<fa-icon [icon]="icon"></fa-icon>
<span class="link-text">&nbsp;&nbsp;{{text}}</span></a>

View File

@@ -0,0 +1,43 @@
@import "../../../../../../styles/styles";
a {
display: block;
height: 60px;
color: @navigation-link-color;
font-size: 20px;
font-weight: bold;
text-decoration: none;
padding: 20px;
box-sizing: border-box;
background: transparent;
transition: @transition;
fa-icon {
display: inline-block;
transform: scale(1);
transition: @transition;
}
@media screen and (max-width: 860px) {
.link-text {
display: none;
}
}
&:hover {
background: #eee;
fa-icon {
transform: scale(1.2);
}
}
&.active {
background: @primary-color;
color: #fff;
fa-icon {
transform: scale(1.3);
}
}
}

View File

@@ -0,0 +1,25 @@
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
import {LinkComponent} from './link.component';
describe('LinkComponent', () => {
let component: LinkComponent;
let fixture: ComponentFixture<LinkComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [LinkComponent]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(LinkComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@@ -0,0 +1,13 @@
import {Component, Input} from '@angular/core';
import {IconProp} from '@fortawesome/fontawesome-svg-core';
@Component({
selector: 'app-link',
templateUrl: './link.component.html',
styleUrls: ['./link.component.less']
})
export class LinkComponent {
@Input() public text: string;
@Input() public link: string;
@Input() public icon: IconProp;
}

View File

@@ -0,0 +1,12 @@
<nav class="head">
<div class="links">
<app-link [icon]="faSongs" link="/songs" text="Lieder"></app-link>
<app-link [icon]="faShows" link="/shows" text="Veranstaltungen"></app-link>
<app-link [icon]="faUser" link="/user" text="Benutzer"></app-link>
</div>
<div class="actions">
<app-filter></app-filter>
</div>
</nav>

View File

@@ -0,0 +1,32 @@
@import "../../../../../styles/styles";
@import "../../../../../styles/shadow";
nav {
&.head {
position: fixed;
top: 0;
left: 0;
right: 0;
height: 60px;
background: @navigation-background;
z-index: 1;
.card-3;
display: flex;
align-items: flex-end;
justify-content: space-between;
}
}
.actions {
display: flex;
height: 100%;
align-items: center;
}
.links {
display: flex;
}

View File

@@ -0,0 +1,25 @@
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
import {NavigationComponent} from './navigation.component';
describe('NavigationComponent', () => {
let component: NavigationComponent;
let fixture: ComponentFixture<NavigationComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [NavigationComponent]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(NavigationComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@@ -0,0 +1,23 @@
import {Component, OnInit} from '@angular/core';
import {faMusic} from '@fortawesome/free-solid-svg-icons/faMusic';
import {faPersonBooth} from '@fortawesome/free-solid-svg-icons/faPersonBooth';
import {faUserCog} from '@fortawesome/free-solid-svg-icons/faUserCog';
@Component({
selector: 'app-navigation',
templateUrl: './navigation.component.html',
styleUrls: ['./navigation.component.less']
})
export class NavigationComponent implements OnInit {
public faSongs = faMusic;
public faShows = faPersonBooth;
public faUser = faUserCog;
constructor() {
}
ngOnInit() {
}
}