-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
122 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { trigger, state, style, transition, animate } from '@angular/animations'; | ||
|
||
export const expandTrigger = (name: string) => { | ||
return trigger(name, [ | ||
state('collapsed', style({ | ||
height: '0', | ||
overflow: 'hidden', | ||
visibility: 'hidden' | ||
})), | ||
state('expanded', style({ | ||
height: '*', | ||
visibility: 'visible' | ||
})), | ||
transition('collapsed <=> expanded', animate('225ms ease-in-out')), | ||
]); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<div style="text-align: center;"> | ||
Lade Inhalt...<mat-progress-bar color="primary" mode="indeterminate" /> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { LoadingComponent } from './loading.component'; | ||
|
||
describe('LoadingComponent', () => { | ||
let component: LoadingComponent; | ||
let fixture: ComponentFixture<LoadingComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
imports: [LoadingComponent] | ||
}) | ||
.compileComponents(); | ||
|
||
fixture = TestBed.createComponent(LoadingComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Component } from '@angular/core'; | ||
import { MatProgressBarModule } from '@angular/material/progress-bar'; | ||
|
||
@Component({ | ||
selector: 'app-loading', | ||
standalone: true, | ||
imports: [MatProgressBarModule], | ||
templateUrl: './loading.component.html' | ||
}) | ||
export class LoadingComponent { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
margin: 2rem 5%; | ||
} | ||
|
||
footer { | ||
.centered { | ||
margin: 2rem 5%; | ||
text-align: center; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,61 @@ | ||
<h1>{{ greeting }}, {{ userName }}</h1> | ||
<h2 mat-subheader>Deine Reise</h2> | ||
<div role="progress"> | ||
<ng-container *ngFor="let unit of units$ | async"> | ||
<a href="#{{unit.no}}"> | ||
<p class="value">0%</p> | ||
<span>Einheit {{ unit.no }}</span> | ||
</a> | ||
<p> | ||
<mat-divider vertical="true" /> | ||
</p> | ||
</ng-container> | ||
</div> | ||
<ng-template #loading><app-loading /></ng-template> | ||
|
||
<div class="unit" *ngFor="let unit of units$ | async; let i = index"> | ||
<div class="header" [id]="unit.no"> | ||
<span mat-subheader>Einheit {{unit.no}}</span> | ||
<h3>{{unit.title}}</h3> | ||
<ng-container *ngIf="units$ | async as units; else loading"> | ||
<h1>{{ greeting }}, {{ userName }}</h1> | ||
<h2 mat-subheader>Deine Reise</h2> | ||
<div role="progress"> | ||
<ng-container *ngFor="let unit of units$ | async"> | ||
<a href="#{{unit.no}}"> | ||
<p class="value">0%</p> | ||
<span>Einheit {{ unit.no }}</span> | ||
</a> | ||
<p> | ||
<mat-divider vertical="true" /> | ||
</p> | ||
</ng-container> | ||
</div> | ||
<p> | ||
<mat-divider /> | ||
</p> | ||
<div class="card-container"> | ||
<mat-card class="card" *ngFor="let section of (unit.pages | async); let j = index"> | ||
<mat-card-header> | ||
<mat-card-title> | ||
<h3> | ||
<a [routerLink]="['/p', i, j]"> | ||
{{section.title}} | ||
</a> | ||
</h3> | ||
</mat-card-title> | ||
@if (section.hero_section) { | ||
<mat-card-subtitle> | ||
{{section.hero_section.subhead}} | ||
</mat-card-subtitle> | ||
} | ||
</mat-card-header> | ||
<mat-card-content> | ||
<p> | ||
@if (section.hero_section && section.hero_section.image) { | ||
<img class="thumbnail" mat-card-image [src]="section.hero_section.image" [alt]="section.hero_section.image_info" /> | ||
|
||
<div class="unit" *ngFor="let unit of units$ | async; let i = index"> | ||
<div class="header" [id]="unit.no"> | ||
<span mat-subheader>Einheit {{unit.no}}</span> | ||
<h3>{{unit.title}}</h3> | ||
</div> | ||
<p> | ||
<mat-divider /> | ||
</p> | ||
<div class="card-container"> | ||
<mat-card class="card" *ngFor="let section of (unit.pages | async); let j = index"> | ||
<mat-card-header> | ||
<mat-card-title> | ||
<h3> | ||
<a [routerLink]="['/p', i, j]"> | ||
{{section.title}} | ||
</a> | ||
</h3> | ||
</mat-card-title> | ||
@if (section.hero_section) { | ||
<mat-card-subtitle> | ||
{{section.hero_section.subhead}} | ||
</mat-card-subtitle> | ||
} | ||
</mat-card-header> | ||
<mat-card-content> | ||
<p> | ||
@if (section.hero_section && section.hero_section.image) { | ||
<img class="thumbnail" mat-card-image [src]="section.hero_section.image" [alt]="section.hero_section.image_info" /> | ||
} @else { | ||
<mat-divider /> | ||
} | ||
</p> | ||
</mat-card-content> | ||
<mat-card-footer class="footer"> | ||
@if (done(i)) { | ||
<mat-icon fontIcon="check_box"/> Erledigt | ||
} @else { | ||
<mat-divider /> | ||
<mat-icon fontIcon="check_box_outline_blank"/> Offen | ||
} | ||
</p> | ||
</mat-card-content> | ||
<mat-card-footer class="footer"> | ||
@if (done(i)) { | ||
<mat-icon fontIcon="check_box"/> Erledigt | ||
} @else { | ||
<mat-icon fontIcon="check_box_outline_blank"/> Offen | ||
} | ||
</mat-card-footer> | ||
</mat-card> | ||
</mat-card-footer> | ||
</mat-card> | ||
</div> | ||
</div> | ||
</div> | ||
</ng-container> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters