1606 lines
48 KiB
HTML
1606 lines
48 KiB
HTML
|
<html lang="en"><head></head><body>
|
||
|
<form id="mainForm" method="post" action="https://run.stackblitz.com/api/angular/v1?file=src/app/app.component.ts" target="_self"><input type="hidden" name="files[src/app/about.component.ts]" value="import { Component, OnInit } from '@angular/core';
|
||
|
|
||
|
@Component({
|
||
|
selector: 'app-about',
|
||
|
templateUrl: './about.component.html',
|
||
|
styleUrls: ['./about.component.css']
|
||
|
})
|
||
|
export class AboutComponent implements OnInit {
|
||
|
|
||
|
constructor() { }
|
||
|
|
||
|
ngOnInit() {
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
/*
|
||
|
Copyright Google LLC. All Rights Reserved.
|
||
|
Use of this source code is governed by an MIT-style license that
|
||
|
can be found in the LICENSE file at https://angular.io/license
|
||
|
*/"><input type="hidden" name="files[src/app/animations.ts]" value="import {
|
||
|
animation, trigger, animateChild, group,
|
||
|
transition, animate, style, query
|
||
|
} from '@angular/animations';
|
||
|
|
||
|
export const transAnimation = animation([
|
||
|
style({
|
||
|
height: '{{ height }}',
|
||
|
opacity: '{{ opacity }}',
|
||
|
backgroundColor: '{{ backgroundColor }}'
|
||
|
}),
|
||
|
animate('{{ time }}')
|
||
|
]);
|
||
|
|
||
|
// Routable animations
|
||
|
export const slideInAnimation =
|
||
|
trigger('routeAnimations', [
|
||
|
transition('HomePage <=> AboutPage', [
|
||
|
style({ position: 'relative' }),
|
||
|
query(':enter, :leave', [
|
||
|
style({
|
||
|
position: 'absolute',
|
||
|
top: 0,
|
||
|
left: 0,
|
||
|
width: '100%'
|
||
|
})
|
||
|
]),
|
||
|
query(':enter', [
|
||
|
style({ left: '-100%' })
|
||
|
]),
|
||
|
query(':leave', animateChild()),
|
||
|
group([
|
||
|
query(':leave', [
|
||
|
animate('300ms ease-out', style({ left: '100%' }))
|
||
|
]),
|
||
|
query(':enter', [
|
||
|
animate('300ms ease-out', style({ left: '0%' }))
|
||
|
])
|
||
|
]),
|
||
|
query(':enter', animateChild()),
|
||
|
]),
|
||
|
transition('* <=> FilterPage', [
|
||
|
style({ position: 'relative' }),
|
||
|
query(':enter, :leave', [
|
||
|
style({
|
||
|
position: 'absolute',
|
||
|
top: 0,
|
||
|
left: 0,
|
||
|
width: '100%'
|
||
|
})
|
||
|
]),
|
||
|
query(':enter', [
|
||
|
style({ left: '-100%' })
|
||
|
]),
|
||
|
query(':leave', animateChild()),
|
||
|
group([
|
||
|
query(':leave', [
|
||
|
animate('200ms ease-out', style({ left: '100%' }))
|
||
|
]),
|
||
|
query(':enter', [
|
||
|
animate('300ms ease-out', style({ left: '0%' }))
|
||
|
])
|
||
|
]),
|
||
|
query(':enter', animateChild()),
|
||
|
])
|
||
|
]);
|
||
|
|
||
|
|
||
|
/*
|
||
|
Copyright Google LLC. All Rights Reserved.
|
||
|
Use of this source code is governed by an MIT-style license that
|
||
|
can be found in the LICENSE file at https://angular.io/license
|
||
|
*/"><input type="hidden" name="files[src/app/app.component.ts]" value="import { Component, HostBinding } from '@angular/core';
|
||
|
import {
|
||
|
trigger,
|
||
|
state,
|
||
|
style,
|
||
|
animate,
|
||
|
transition,
|
||
|
// ...
|
||
|
} from '@angular/animations';
|
||
|
|
||
|
import { RouterOutlet } from '@angular/router';
|
||
|
import { slideInAnimation } from './animations';
|
||
|
|
||
|
@Component({
|
||
|
selector: 'app-root',
|
||
|
templateUrl: 'app.component.html',
|
||
|
styleUrls: ['app.component.css'],
|
||
|
animations: [
|
||
|
slideInAnimation
|
||
|
// animation triggers go here
|
||
|
]
|
||
|
})
|
||
|
export class AppComponent {
|
||
|
@HostBinding('@.disabled')
|
||
|
public animationsDisabled = false;
|
||
|
|
||
|
prepareRoute(outlet: RouterOutlet) {
|
||
|
return outlet && outlet.activatedRouteData && outlet.activatedRouteData.animation;
|
||
|
}
|
||
|
|
||
|
|
||
|
toggleAnimations() {
|
||
|
this.animationsDisabled = !this.animationsDisabled;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
/*
|
||
|
Copyright Google LLC. All Rights Reserved.
|
||
|
Use of this source code is governed by an MIT-style license that
|
||
|
can be found in the LICENSE file at https://angular.io/license
|
||
|
*/"><input type="hidden" name="files[src/app/app.module.ts]" value="import { NgModule } from '@angular/core';
|
||
|
import { BrowserModule } from '@angular/platform-browser';
|
||
|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||
|
import { RouterModule } from '@angular/router';
|
||
|
import { AppComponent } from './app.component';
|
||
|
import { OpenCloseComponent } from './open-close.component';
|
||
|
import { OpenClosePageComponent } from './open-close-page.component';
|
||
|
import { OpenCloseChildComponent } from './open-close.component.4';
|
||
|
import { ToggleAnimationsPageComponent } from './toggle-animations-page.component';
|
||
|
import { StatusSliderComponent } from './status-slider.component';
|
||
|
import { StatusSliderPageComponent } from './status-slider-page.component';
|
||
|
import { HeroListPageComponent } from './hero-list-page.component';
|
||
|
import { HeroListGroupPageComponent } from './hero-list-group-page.component';
|
||
|
import { HeroListGroupsComponent } from './hero-list-groups.component';
|
||
|
import { HeroListEnterLeavePageComponent } from './hero-list-enter-leave-page.component';
|
||
|
import { HeroListEnterLeaveComponent } from './hero-list-enter-leave.component';
|
||
|
import { HeroListAutoCalcPageComponent } from './hero-list-auto-page.component';
|
||
|
import { HeroListAutoComponent } from './hero-list-auto.component';
|
||
|
import { HomeComponent } from './home.component';
|
||
|
import { AboutComponent } from './about.component';
|
||
|
import { InsertRemoveComponent } from './insert-remove.component';
|
||
|
|
||
|
|
||
|
@NgModule({
|
||
|
imports: [
|
||
|
BrowserModule,
|
||
|
BrowserAnimationsModule,
|
||
|
RouterModule.forRoot([
|
||
|
{ path: '', pathMatch: 'full', redirectTo: '/enter-leave' },
|
||
|
{ path: 'open-close', component: OpenClosePageComponent },
|
||
|
{ path: 'status', component: StatusSliderPageComponent },
|
||
|
{ path: 'toggle', component: ToggleAnimationsPageComponent },
|
||
|
{ path: 'heroes', component: HeroListPageComponent, data: {animation: 'FilterPage'} },
|
||
|
{ path: 'hero-groups', component: HeroListGroupPageComponent },
|
||
|
{ path: 'enter-leave', component: HeroListEnterLeavePageComponent },
|
||
|
{ path: 'auto', component: HeroListAutoCalcPageComponent },
|
||
|
{ path: 'insert-remove', component: InsertRemoveComponent},
|
||
|
{ path: 'home', component: HomeComponent, data: {animation: 'HomePage'} },
|
||
|
{ path: 'about', component: AboutComponent, data: {animation: 'AboutPage'} },
|
||
|
|
||
|
])
|
||
|
],
|
||
|
declarations: [
|
||
|
AppComponent,
|
||
|
StatusSliderComponent,
|
||
|
OpenCloseComponent,
|
||
|
OpenCloseChildComponent,
|
||
|
OpenClosePageComponent,
|
||
|
StatusSliderPageComponent,
|
||
|
ToggleAnimationsPageComponent,
|
||
|
HeroListPageComponent,
|
||
|
HeroListGroupsComponent,
|
||
|
HeroListGroupPageComponent,
|
||
|
HeroListEnterLeavePageComponent,
|
||
|
HeroListEnterLeaveComponent,
|
||
|
HeroListAutoCalcPageComponent,
|
||
|
HeroListAutoComponent,
|
||
|
HomeComponent,
|
||
|
InsertRemoveComponent,
|
||
|
AboutComponent
|
||
|
],
|
||
|
bootstrap: [AppComponent]
|
||
|
})
|
||
|
export class AppModule { }
|
||
|
|
||
|
|
||
|
/*
|
||
|
Copyright Google LLC. All Rights Reserved.
|
||
|
Use of this source code is governed by an MIT-style license that
|
||
|
can be found in the LICENSE file at https://angular.io/license
|
||
|
*/"><input type="hidden" name="files[src/app/hero-list-auto-page.component.ts]" value="import { Component } from '@angular/core';
|
||
|
import { HEROES } from './mock-heroes';
|
||
|
|
||
|
@Component({
|
||
|
selector: 'app-hero-list-auto-page',
|
||
|
template: `
|
||
|
<section>
|
||
|
<h2>Automatic Calculation</h2>
|
||
|
|
||
|
<app-hero-list-auto [heroes]="heroes" (remove)="onRemove($event)"></app-hero-list-auto>
|
||
|
</section>
|
||
|
`
|
||
|
})
|
||
|
export class HeroListAutoCalcPageComponent {
|
||
|
heroes = HEROES.slice();
|
||
|
|
||
|
onRemove(id: number) {
|
||
|
this.heroes = this.heroes.filter(hero => hero.id !== id);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
/*
|
||
|
Copyright Google LLC. All Rights Reserved.
|
||
|
Use of this source code is governed by an MIT-style license that
|
||
|
can be found in the LICENSE file at https://angular.io/license
|
||
|
*/"><input type="hidden" name="files[src/app/hero-list-auto.component.ts]" value="import {
|
||
|
Component,
|
||
|
Input,
|
||
|
Output,
|
||
|
EventEmitter
|
||
|
} from '@angular/core';
|
||
|
import {
|
||
|
trigger,
|
||
|
state,
|
||
|
style,
|
||
|
animate,
|
||
|
transition
|
||
|
} from '@angular/animations';
|
||
|
|
||
|
import { Hero } from './hero';
|
||
|
|
||
|
@Component({
|
||
|
selector: 'app-hero-list-auto',
|
||
|
templateUrl: 'hero-list-auto.component.html',
|
||
|
styleUrls: ['./hero-list-page.component.css'],
|
||
|
animations: [
|
||
|
trigger('shrinkOut', [
|
||
|
state('in', style({ height: '*' })),
|
||
|
transition('* => void', [
|
||
|
style({ height: '*' }),
|
||
|
animate(250, style({ height: 0 }))
|
||
|
])
|
||
|
])
|
||
|
]
|
||
|
})
|
||
|
export class HeroListAutoComponent {
|
||
|
@Input() heroes: Hero[];
|
||
|
|
||
|
@Output() remove = new EventEmitter<number>();
|
||
|
|
||
|
removeHero(id: number) {
|
||
|
this.remove.emit(id);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
/*
|
||
|
Copyright Google LLC. All Rights Reserved.
|
||
|
Use of this source code is governed by an MIT-style license that
|
||
|
can be found in the LICENSE file at https://angular.io/license
|
||
|
*/"><input type="hidden" name="files[src/app/hero-list-enter-leave-page.component.ts]" value="import { Component } from '@angular/core';
|
||
|
import { HEROES } from './mock-heroes';
|
||
|
|
||
|
@Component({
|
||
|
selector: 'app-hero-list-enter-leave-page',
|
||
|
template: `
|
||
|
<section>
|
||
|
<h2>Enter/Leave</h2>
|
||
|
|
||
|
<app-hero-list-enter-leave [heroes]="heroes" (remove)="onRemove($event)"></app-hero-list-enter-leave>
|
||
|
</section>
|
||
|
`
|
||
|
})
|
||
|
export class HeroListEnterLeavePageComponent {
|
||
|
heroes = HEROES.slice();
|
||
|
|
||
|
onRemove(id: number) {
|
||
|
this.heroes = this.heroes.filter(hero => hero.id !== id);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
/*
|
||
|
Copyright Google LLC. All Rights Reserved.
|
||
|
Use of this source code is governed by an MIT-style license that
|
||
|
can be found in the LICENSE file at https://angular.io/license
|
||
|
*/"><input type="hidden" name="files[src/app/hero-list-enter-leave.component.ts]" value="import {
|
||
|
Component,
|
||
|
Input,
|
||
|
Output,
|
||
|
EventEmitter
|
||
|
} from '@angular/core';
|
||
|
import {
|
||
|
trigger,
|
||
|
state,
|
||
|
style,
|
||
|
animate,
|
||
|
transition
|
||
|
} from '@angular/animations';
|
||
|
|
||
|
import { Hero } from './hero';
|
||
|
|
||
|
@Component({
|
||
|
selector: 'app-hero-list-enter-leave',
|
||
|
template: `
|
||
|
<ul class="heroes">
|
||
|
<li *ngFor="let hero of heroes"
|
||
|
[@flyInOut]="'in'" (click)="removeHero(hero.id)">
|
||
|
<div class="inner">
|
||
|
<span class="badge">{{ hero.id }}</span>
|
||
|
<span>{{ hero.name }}</span>
|
||
|
</div>
|
||
|
</li>
|
||
|
</ul>
|
||
|
`,
|
||
|
styleUrls: ['./hero-list-page.component.css'],
|
||
|
animations: [
|
||
|
trigger('flyInOut', [
|
||
|
state('in', style({ transform: 'translateX(0)' })),
|
||
|
transition('void => *', [
|
||
|
style({ transform: 'translateX(-100%)' }),
|
||
|
animate(100)
|
||
|
]),
|
||
|
transition('* => void', [
|
||
|
animate(100, style({ transform: 'translateX(100%)' }))
|
||
|
])
|
||
|
])
|
||
|
]
|
||
|
})
|
||
|
export class HeroListEnterLeaveComponent {
|
||
|
@Input() heroes: Hero[];
|
||
|
|
||
|
@Output() remove = new EventEmitter<number>();
|
||
|
|
||
|
removeHero(id: number) {
|
||
|
this.remove.emit(id);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
/*
|
||
|
Copyright Google LLC. All Rights Reserved.
|
||
|
Use of this source code is governed by an MIT-style license that
|
||
|
can be found in the LICENSE file at https://angular.io/license
|
||
|
*/"><input type="hidden" name="files[src/app/hero-list-group-page.component.ts]" value="import { Component } from '@angular/core';
|
||
|
import { HEROES } from './mock-heroes';
|
||
|
|
||
|
@Component({
|
||
|
selector: 'app-hero-list-groups-page',
|
||
|
template: `
|
||
|
<section>
|
||
|
<h2>Hero List Group</h2>
|
||
|
|
||
|
<app-hero-list-groups [heroes]="heroes" (remove)="onRemove($event)"></app-hero-list-groups>
|
||
|
</section>
|
||
|
`
|
||
|
})
|
||
|
export class HeroListGroupPageComponent {
|
||
|
heroes = HEROES.slice();
|
||
|
|
||
|
onRemove(id: number) {
|
||
|
this.heroes = this.heroes.filter(hero => hero.id !== id);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
/*
|
||
|
Copyright Google LLC. All Rights Reserved.
|
||
|
Use of this source code is governed by an MIT-style license that
|
||
|
can be found in the LICENSE file at https://angular.io/license
|
||
|
*/"><input type="hidden" name="files[src/app/hero-list-groups.component.ts]" value="import {
|
||
|
Component,
|
||
|
Input,
|
||
|
Output,
|
||
|
EventEmitter
|
||
|
} from '@angular/core';
|
||
|
import {
|
||
|
trigger,
|
||
|
state,
|
||
|
style,
|
||
|
animate,
|
||
|
transition,
|
||
|
group
|
||
|
} from '@angular/animations';
|
||
|
|
||
|
import { Hero } from './hero';
|
||
|
|
||
|
@Component({
|
||
|
selector: 'app-hero-list-groups',
|
||
|
template: `
|
||
|
<ul class="heroes">
|
||
|
<li *ngFor="let hero of heroes"
|
||
|
[@flyInOut]="'in'" (click)="removeHero(hero.id)">
|
||
|
<div class="inner">
|
||
|
<span class="badge">{{ hero.id }}</span>
|
||
|
<span>{{ hero.name }}</span>
|
||
|
</div>
|
||
|
</li>
|
||
|
</ul>
|
||
|
`,
|
||
|
styleUrls: ['./hero-list-page.component.css'],
|
||
|
animations: [
|
||
|
trigger('flyInOut', [
|
||
|
state('in', style({
|
||
|
width: 120,
|
||
|
transform: 'translateX(0)', opacity: 1
|
||
|
})),
|
||
|
transition('void => *', [
|
||
|
style({ width: 10, transform: 'translateX(50px)', opacity: 0 }),
|
||
|
group([
|
||
|
animate('0.3s 0.1s ease', style({
|
||
|
transform: 'translateX(0)',
|
||
|
width: 120
|
||
|
})),
|
||
|
animate('0.3s ease', style({
|
||
|
opacity: 1
|
||
|
}))
|
||
|
])
|
||
|
]),
|
||
|
transition('* => void', [
|
||
|
group([
|
||
|
animate('0.3s ease', style({
|
||
|
transform: 'translateX(50px)',
|
||
|
width: 10
|
||
|
})),
|
||
|
animate('0.3s 0.2s ease', style({
|
||
|
opacity: 0
|
||
|
}))
|
||
|
])
|
||
|
])
|
||
|
])
|
||
|
]
|
||
|
})
|
||
|
export class HeroListGroupsComponent {
|
||
|
@Input() heroes: Hero[];
|
||
|
|
||
|
@Output() remove = new EventEmitter<number>();
|
||
|
|
||
|
removeHero(id: number) {
|
||
|
this.remove.emit(id);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
/*
|
||
|
Copyright Google LLC. All Rights Reserved.
|
||
|
Use of this source code is governed by an MIT-style license that
|
||
|
can be found in the LICENSE file at https://angular.io/license
|
||
|
*/"><input type="hidden" name="files[src/app/hero-list-page.component.ts]" value="// tslint:disable: variable-name
|
||
|
import { Component, HostBinding, OnInit } from '@angular/core';
|
||
|
import { trigger, transition, animate, style, query, stagger } from '@angular/animations';
|
||
|
import { HEROES } from './mock-heroes';
|
||
|
|
||
|
@Component({
|
||
|
selector: 'app-hero-list-page',
|
||
|
templateUrl: 'hero-list-page.component.html',
|
||
|
styleUrls: ['hero-list-page.component.css'],
|
||
|
animations: [
|
||
|
trigger('pageAnimations', [
|
||
|
transition(':enter', [
|
||
|
query('.hero, form', [
|
||
|
style({opacity: 0, transform: 'translateY(-100px)'}),
|
||
|
stagger(-30, [
|
||
|
animate('500ms cubic-bezier(0.35, 0, 0.25, 1)', style({ opacity: 1, transform: 'none' }))
|
||
|
])
|
||
|
])
|
||
|
])
|
||
|
]),
|
||
|
trigger('filterAnimation', [
|
||
|
transition(':enter, * => 0, * => -1', []),
|
||
|
transition(':increment', [
|
||
|
query(':enter', [
|
||
|
style({ opacity: 0, width: '0px' }),
|
||
|
stagger(50, [
|
||
|
animate('300ms ease-out', style({ opacity: 1, width: '*' })),
|
||
|
]),
|
||
|
], { optional: true })
|
||
|
]),
|
||
|
transition(':decrement', [
|
||
|
query(':leave', [
|
||
|
stagger(50, [
|
||
|
animate('300ms ease-out', style({ opacity: 0, width: '0px' })),
|
||
|
]),
|
||
|
])
|
||
|
]),
|
||
|
]),
|
||
|
]
|
||
|
})
|
||
|
export class HeroListPageComponent implements OnInit {
|
||
|
@HostBinding('@pageAnimations')
|
||
|
public animatePage = true;
|
||
|
|
||
|
heroTotal = -1;
|
||
|
get heroes() { return this._heroes; }
|
||
|
private _heroes = [];
|
||
|
|
||
|
ngOnInit() {
|
||
|
this._heroes = HEROES;
|
||
|
}
|
||
|
|
||
|
updateCriteria(criteria: string) {
|
||
|
criteria = criteria ? criteria.trim() : '';
|
||
|
|
||
|
this._heroes = HEROES.filter(hero => hero.name.toLowerCase().includes(criteria.toLowerCase()));
|
||
|
const newTotal = this.heroes.length;
|
||
|
|
||
|
if (this.heroTotal !== newTotal) {
|
||
|
this.heroTotal = newTotal;
|
||
|
} else if (!criteria) {
|
||
|
this.heroTotal = -1;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
/*
|
||
|
Copyright Google LLC. All Rights Reserved.
|
||
|
Use of this source code is governed by an MIT-style license that
|
||
|
can be found in the LICENSE file at https://angular.io/license
|
||
|
*/"><input type="hidden" name="files[src/app/hero.ts]" value="export interface Hero {
|
||
|
id: number;
|
||
|
name: string;
|
||
|
}
|
||
|
|
||
|
|
||
|
/*
|
||
|
Copyright Google LLC. All Rights Reserved.
|
||
|
Use of this source code is governed by an MIT-style license that
|
||
|
can be found in the LICENSE file at https://angular.io/license
|
||
|
*/"><input type="hidden" name="files[src/app/home.component.ts]" value="import { Component, OnInit } from '@angular/core';
|
||
|
|
||
|
@Component({
|
||
|
selector: 'app-home',
|
||
|
templateUrl: './home.component.html',
|
||
|
styleUrls: ['./home.component.css']
|
||
|
})
|
||
|
export class HomeComponent implements OnInit {
|
||
|
|
||
|
constructor() { }
|
||
|
|
||
|
ngOnInit() {
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
/*
|
||
|
Copyright Google LLC. All Rights Reserved.
|
||
|
Use of this source code is governed by an MIT-style license that
|
||
|
can be found in the LICENSE file at https://angular.io/license
|
||
|
*/"><input type="hidden" name="files[src/app/insert-remove.component.ts]" value="import { Component } from '@angular/core';
|
||
|
import { trigger, transition, animate, style } from '@angular/animations';
|
||
|
|
||
|
@Component({
|
||
|
selector: 'app-insert-remove',
|
||
|
animations: [
|
||
|
trigger('myInsertRemoveTrigger', [
|
||
|
transition(':enter', [
|
||
|
style({ opacity: 0 }),
|
||
|
animate('100ms', style({ opacity: 1 })),
|
||
|
]),
|
||
|
transition(':leave', [
|
||
|
animate('100ms', style({ opacity: 0 }))
|
||
|
])
|
||
|
]),
|
||
|
],
|
||
|
templateUrl: 'insert-remove.component.html',
|
||
|
styleUrls: ['insert-remove.component.css']
|
||
|
})
|
||
|
export class InsertRemoveComponent {
|
||
|
isShown = false;
|
||
|
|
||
|
toggle() {
|
||
|
this.isShown = !this.isShown;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
/*
|
||
|
Copyright Google LLC. All Rights Reserved.
|
||
|
Use of this source code is governed by an MIT-style license that
|
||
|
can be found in the LICENSE file at https://angular.io/license
|
||
|
*/"><input type="hidden" name="files[src/app/mock-heroes.ts]" value="import { Hero } from './hero';
|
||
|
|
||
|
export const HEROES: Hero[] = [
|
||
|
{ id: 11, name: 'Dr Nice' },
|
||
|
{ id: 12, name: 'Narco' },
|
||
|
{ id: 13, name: 'Bombasto' },
|
||
|
{ id: 14, name: 'Celeritas' },
|
||
|
{ id: 15, name: 'Magneta' },
|
||
|
{ id: 16, name: 'RubberMan' },
|
||
|
{ id: 17, name: 'Dynama' },
|
||
|
{ id: 18, name: 'Dr IQ' },
|
||
|
{ id: 19, name: 'Magma' },
|
||
|
{ id: 20, name: 'Tornado' }
|
||
|
];
|
||
|
|
||
|
|
||
|
/*
|
||
|
Copyright Google LLC. All Rights Reserved.
|
||
|
Use of this source code is governed by an MIT-style license that
|
||
|
can be found in the LICENSE file at https://angular.io/license
|
||
|
*/"><input type="hidden" name="files[src/app/open-close-page.component.ts]" value="import { Component } from '@angular/core';
|
||
|
|
||
|
@Component({
|
||
|
selector: 'app-open-close-page',
|
||
|
template: `
|
||
|
<section>
|
||
|
<h2>Open Close Component</h2>
|
||
|
<input type="checkbox" [checked]="logging" (click)="toggleLogging()"/> Console Log Animation Events
|
||
|
|
||
|
<app-open-close [logging]="logging"></app-open-close>
|
||
|
</section>
|
||
|
`
|
||
|
})
|
||
|
export class OpenClosePageComponent {
|
||
|
logging = false;
|
||
|
|
||
|
toggleLogging() {
|
||
|
this.logging = !this.logging;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
/*
|
||
|
Copyright Google LLC. All Rights Reserved.
|
||
|
Use of this source code is governed by an MIT-style license that
|
||
|
can be found in the LICENSE file at https://angular.io/license
|
||
|
*/"><input type="hidden" name="files[src/app/open-close.component.4.ts]" value="import { Component } from '@angular/core';
|
||
|
import { trigger, transition, state, animate, style } from '@angular/animations';
|
||
|
|
||
|
@Component({
|
||
|
selector: 'app-open-close-toggle',
|
||
|
templateUrl: 'open-close.component.4.html',
|
||
|
styleUrls: ['open-close.component.css'],
|
||
|
animations: [
|
||
|
trigger('childAnimation', [
|
||
|
// ...
|
||
|
state('open', style({
|
||
|
width: '250px',
|
||
|
opacity: 1,
|
||
|
backgroundColor: 'yellow'
|
||
|
})),
|
||
|
state('closed', style({
|
||
|
width: '100px',
|
||
|
opacity: 0.5,
|
||
|
backgroundColor: 'green'
|
||
|
})),
|
||
|
transition('* => *', [
|
||
|
animate('1s')
|
||
|
]),
|
||
|
]),
|
||
|
],
|
||
|
})
|
||
|
export class OpenCloseChildComponent {
|
||
|
isDisabled = false;
|
||
|
isOpen = false;
|
||
|
toggleAnimations() {
|
||
|
this.isDisabled = !this.isDisabled;
|
||
|
}
|
||
|
|
||
|
toggle() {
|
||
|
this.isOpen = !this.isOpen;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
/*
|
||
|
Copyright Google LLC. All Rights Reserved.
|
||
|
Use of this source code is governed by an MIT-style license that
|
||
|
can be found in the LICENSE file at https://angular.io/license
|
||
|
*/"><input type="hidden" name="files[src/app/open-close.component.ts]" value="import { Component, Input } from '@angular/core';
|
||
|
import { trigger, transition, state, animate, style, AnimationEvent } from '@angular/animations';
|
||
|
|
||
|
@Component({
|
||
|
selector: 'app-open-close',
|
||
|
animations: [
|
||
|
trigger('openClose', [
|
||
|
// ...
|
||
|
state('open', style({
|
||
|
height: '200px',
|
||
|
opacity: 1,
|
||
|
backgroundColor: 'yellow'
|
||
|
})),
|
||
|
state('closed', style({
|
||
|
height: '100px',
|
||
|
opacity: 0.5,
|
||
|
backgroundColor: 'green'
|
||
|
})),
|
||
|
transition('open => closed', [
|
||
|
animate('1s')
|
||
|
]),
|
||
|
transition('closed => open', [
|
||
|
animate('0.5s')
|
||
|
]),
|
||
|
transition('* => closed', [
|
||
|
animate('1s')
|
||
|
]),
|
||
|
transition('* => open', [
|
||
|
animate('0.5s')
|
||
|
]),
|
||
|
transition('open <=> closed', [
|
||
|
animate('0.5s')
|
||
|
]),
|
||
|
transition ('* => open', [
|
||
|
animate ('1s',
|
||
|
style ({ opacity: '*' }),
|
||
|
),
|
||
|
]),
|
||
|
transition('* => *', [
|
||
|
animate('1s')
|
||
|
]),
|
||
|
]),
|
||
|
],
|
||
|
templateUrl: 'open-close.component.html',
|
||
|
styleUrls: ['open-close.component.css']
|
||
|
})
|
||
|
export class OpenCloseComponent {
|
||
|
@Input() logging = false;
|
||
|
isOpen = true;
|
||
|
|
||
|
toggle() {
|
||
|
this.isOpen = !this.isOpen;
|
||
|
}
|
||
|
|
||
|
onAnimationEvent( event: AnimationEvent ) {
|
||
|
if (!this.logging) {
|
||
|
return;
|
||
|
}
|
||
|
// openClose is trigger name in this example
|
||
|
console.warn(`Animation Trigger: ${event.triggerName}`);
|
||
|
|
||
|
// phaseName is start or done
|
||
|
console.warn(`Phase: ${event.phaseName}`);
|
||
|
|
||
|
// in our example, totalTime is 1000 or 1 second
|
||
|
console.warn(`Total time: ${event.totalTime}`);
|
||
|
|
||
|
// in our example, fromState is either open or closed
|
||
|
console.warn(`From: ${event.fromState}`);
|
||
|
|
||
|
// in our example, toState either open or closed
|
||
|
console.warn(`To: ${event.toState}`);
|
||
|
|
||
|
// the HTML element itself, the button in this case
|
||
|
console.warn(`Element: ${event.element}`);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
/*
|
||
|
Copyright Google LLC. All Rights Reserved.
|
||
|
Use of this source code is governed by an MIT-style license that
|
||
|
can be found in the LICENSE file at https://angular.io/license
|
||
|
*/"><input type="hidden" name="files[src/app/status-slider-page.component.ts]" value="import { Component } from '@angular/core';
|
||
|
|
||
|
@Component({
|
||
|
selector: 'app-status-slider-page',
|
||
|
template: `
|
||
|
<section>
|
||
|
<h2>Status Slider</h2>
|
||
|
<app-status-slider></app-status-slider>
|
||
|
</section>
|
||
|
`
|
||
|
})
|
||
|
export class StatusSliderPageComponent {}
|
||
|
|
||
|
|
||
|
/*
|
||
|
Copyright Google LLC. All Rights Reserved.
|
||
|
Use of this source code is governed by an MIT-style license that
|
||
|
can be found in the LICENSE file at https://angular.io/license
|
||
|
*/"><input type="hidden" name="files[src/app/status-slider.component.ts]" value="import { Component } from '@angular/core';
|
||
|
import { trigger, transition, state, animate, style, keyframes } from '@angular/animations';
|
||
|
|
||
|
@Component({
|
||
|
selector: 'app-status-slider',
|
||
|
templateUrl: 'status-slider.component.html',
|
||
|
styleUrls: ['status-slider.component.css'],
|
||
|
animations: [
|
||
|
trigger('slideStatus', [
|
||
|
state('inactive', style({ backgroundColor: 'blue' })),
|
||
|
state('active', style({ backgroundColor: 'orange' })),
|
||
|
|
||
|
transition('* => active', [
|
||
|
animate('2s', keyframes([
|
||
|
style({ backgroundColor: 'blue', offset: 0}),
|
||
|
style({ backgroundColor: 'red', offset: 0.8}),
|
||
|
style({ backgroundColor: 'orange', offset: 1.0})
|
||
|
])),
|
||
|
]),
|
||
|
transition('* => inactive', [
|
||
|
animate('2s', keyframes([
|
||
|
style({ backgroundColor: 'orange', offset: 0}),
|
||
|
style({ backgroundColor: 'red', offset: 0.2}),
|
||
|
style({ backgroundColor: 'blue', offset: 1.0})
|
||
|
]))
|
||
|
]),
|
||
|
|
||
|
transition('* => active', [
|
||
|
animate('2s', keyframes([
|
||
|
style({ backgroundColor: 'blue' }),
|
||
|
style({ backgroundColor: 'red' }),
|
||
|
style({ backgroundColor: 'orange' })
|
||
|
]))
|
||
|
]),
|
||
|
])
|
||
|
]
|
||
|
})
|
||
|
export class StatusSliderComponent {
|
||
|
status: 'active' | 'inactive' = 'inactive';
|
||
|
|
||
|
toggle() {
|
||
|
if (this.status === 'active') {
|
||
|
this.status = 'inactive';
|
||
|
} else {
|
||
|
this.status = 'active';
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
/*
|
||
|
Copyright Google LLC. All Rights Reserved.
|
||
|
Use of this source code is governed by an MIT-style license that
|
||
|
can be found in the LICENSE file at https://angular.io/license
|
||
|
*/"><input type="hidden" name="files[src/app/toggle-animations-page.component.ts]" value="import { Component } from '@angular/core';
|
||
|
|
||
|
@Component({
|
||
|
selector: 'app-toggle-animations-child-page',
|
||
|
template: `
|
||
|
<section>
|
||
|
<h2>Toggle Animations</h2>
|
||
|
|
||
|
<app-open-close-toggle></app-open-close-toggle>
|
||
|
</section>
|
||
|
`
|
||
|
})
|
||
|
export class ToggleAnimationsPageComponent {}
|
||
|
|
||
|
|
||
|
/*
|
||
|
Copyright Google LLC. All Rights Reserved.
|
||
|
Use of this source code is governed by an MIT-style license that
|
||
|
can be found in the LICENSE file at https://angular.io/license
|
||
|
*/"><input type="hidden" name="files[src/environments/environment.prod.ts]" value="export const environment = {
|
||
|
production: true
|
||
|
};
|
||
|
|
||
|
|
||
|
/*
|
||
|
Copyright Google LLC. All Rights Reserved.
|
||
|
Use of this source code is governed by an MIT-style license that
|
||
|
can be found in the LICENSE file at https://angular.io/license
|
||
|
*/"><input type="hidden" name="files[src/environments/environment.ts]" value="// This file can be replaced during build by using the `fileReplacements` array.
|
||
|
// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
|
||
|
// The list of file replacements can be found in `angular.json`.
|
||
|
|
||
|
export const environment = {
|
||
|
production: false
|
||
|
};
|
||
|
|
||
|
/*
|
||
|
* For easier debugging in development mode, you can import the following file
|
||
|
* to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
|
||
|
*
|
||
|
* This import should be commented out in production mode because it will have a negative impact
|
||
|
* on performance if an error is thrown.
|
||
|
*/
|
||
|
// import 'zone.js/plugins/zone-error'; // Included with Angular CLI.
|
||
|
|
||
|
|
||
|
/*
|
||
|
Copyright Google LLC. All Rights Reserved.
|
||
|
Use of this source code is governed by an MIT-style license that
|
||
|
can be found in the LICENSE file at https://angular.io/license
|
||
|
*/"><input type="hidden" name="files[src/main.ts]" value="import { enableProdMode } from '@angular/core';
|
||
|
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||
|
|
||
|
import { AppModule } from './app/app.module';
|
||
|
import { environment } from './environments/environment';
|
||
|
|
||
|
if (environment.production) {
|
||
|
enableProdMode();
|
||
|
}
|
||
|
|
||
|
platformBrowserDynamic().bootstrapModule(AppModule);
|
||
|
|
||
|
|
||
|
/*
|
||
|
Copyright Google LLC. All Rights Reserved.
|
||
|
Use of this source code is governed by an MIT-style license that
|
||
|
can be found in the LICENSE file at https://angular.io/license
|
||
|
*/"><input type="hidden" name="files[src/polyfills.ts]" value="/**
|
||
|
* This file includes polyfills needed by Angular and is loaded before the app.
|
||
|
* You can add your own extra polyfills to this file.
|
||
|
*
|
||
|
* This file is divided into 2 sections:
|
||
|
* 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
|
||
|
* 2. Application imports. Files imported after ZoneJS that should be loaded before your main
|
||
|
* file.
|
||
|
*
|
||
|
* The current setup is for so-called "evergreen" browsers; the last versions of browsers that
|
||
|
* automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
|
||
|
* Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
|
||
|
*
|
||
|
* Learn more in https://angular.io/guide/browser-support
|
||
|
*/
|
||
|
|
||
|
/***************************************************************************************************
|
||
|
* BROWSER POLYFILLS
|
||
|
*/
|
||
|
|
||
|
/** IE11 requires the following for NgClass support on SVG elements */
|
||
|
// import 'classlist.js'; // Run `npm install --save classlist.js`.
|
||
|
|
||
|
/**
|
||
|
* Web Animations `@angular/platform-browser/animations`
|
||
|
* Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
|
||
|
* Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
|
||
|
*/
|
||
|
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
|
||
|
|
||
|
/**
|
||
|
* By default, zone.js will patch all possible macroTask and DomEvents
|
||
|
* user can disable parts of macroTask/DomEvents patch by setting following flags
|
||
|
* because those flags need to be set before `zone.js` being loaded, and webpack
|
||
|
* will put import in the top of bundle, so user need to create a separate file
|
||
|
* in this directory (for example: zone-flags.ts), and put the following flags
|
||
|
* into that file, and then add the following code before importing zone.js.
|
||
|
* import './zone-flags';
|
||
|
*
|
||
|
* The flags allowed in zone-flags.ts are listed here.
|
||
|
*
|
||
|
* The following flags will work for all browsers.
|
||
|
*
|
||
|
* (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch
|
||
|
* requestAnimationFrame
|
||
|
* (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
|
||
|
* (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch
|
||
|
* specified eventNames
|
||
|
*
|
||
|
* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
|
||
|
* with the following flag, it will bypass `zone.js` patch for IE/Edge
|
||
|
*
|
||
|
* (window as any).__Zone_enable_cross_context_check = true;
|
||
|
*
|
||
|
*/
|
||
|
|
||
|
/***************************************************************************************************
|
||
|
* Zone JS is required by default for Angular itself.
|
||
|
*/
|
||
|
import 'zone.js'; // Included with Angular CLI.
|
||
|
|
||
|
/***************************************************************************************************
|
||
|
* APPLICATION IMPORTS
|
||
|
*/
|
||
|
|
||
|
|
||
|
/*
|
||
|
Copyright Google LLC. All Rights Reserved.
|
||
|
Use of this source code is governed by an MIT-style license that
|
||
|
can be found in the LICENSE file at https://angular.io/license
|
||
|
*/"><input type="hidden" name="files[src/app/about.component.css]" value="
|
||
|
|
||
|
/*
|
||
|
Copyright Google LLC. All Rights Reserved.
|
||
|
Use of this source code is governed by an MIT-style license that
|
||
|
can be found in the LICENSE file at https://angular.io/license
|
||
|
*/"><input type="hidden" name="files[src/app/app.component.css]" value=":host {
|
||
|
display: block;
|
||
|
}
|
||
|
|
||
|
section {
|
||
|
margin-top: 100px;
|
||
|
}
|
||
|
|
||
|
|
||
|
/*
|
||
|
Copyright Google LLC. All Rights Reserved.
|
||
|
Use of this source code is governed by an MIT-style license that
|
||
|
can be found in the LICENSE file at https://angular.io/license
|
||
|
*/"><input type="hidden" name="files[src/app/hero-list-page.component.css]" value=".heroes {
|
||
|
margin: 0 0 2em 0;
|
||
|
list-style-type: none;
|
||
|
padding: 0;
|
||
|
width: 15em;
|
||
|
}
|
||
|
|
||
|
.heroes li {
|
||
|
position: relative;
|
||
|
height: 2.3em;
|
||
|
overflow:hidden;
|
||
|
margin: .5em;
|
||
|
}
|
||
|
|
||
|
.heroes li > .inner {
|
||
|
cursor: pointer;
|
||
|
background-color: #EEE;
|
||
|
padding: .3em 0;
|
||
|
height: 1.6em;
|
||
|
border-radius: 4px;
|
||
|
width: 19em;
|
||
|
}
|
||
|
|
||
|
.heroes li:hover > .inner {
|
||
|
color: #607D8B;
|
||
|
background-color: #DDD;
|
||
|
transform: translateX(.1em);
|
||
|
}
|
||
|
|
||
|
.heroes a {
|
||
|
color: #888;
|
||
|
text-decoration: none;
|
||
|
position: relative;
|
||
|
display: block;
|
||
|
width: 250px;
|
||
|
}
|
||
|
|
||
|
.heroes a:hover {
|
||
|
color:#607D8B;
|
||
|
}
|
||
|
|
||
|
.heroes .badge {
|
||
|
display: inline-block;
|
||
|
font-size: small;
|
||
|
color: white;
|
||
|
padding: 0.8em 0.7em 0 0.7em;
|
||
|
background-color: #607D8B;
|
||
|
line-height: 1em;
|
||
|
position: relative;
|
||
|
left: -1px;
|
||
|
top: -4px;
|
||
|
height: 1.8em;
|
||
|
min-width: 16px;
|
||
|
text-align: right;
|
||
|
margin-right: .8em;
|
||
|
border-radius: 4px 0 0 4px;
|
||
|
}
|
||
|
|
||
|
.button {
|
||
|
background-color: #eee;
|
||
|
border: none;
|
||
|
padding: 5px 10px;
|
||
|
border-radius: 4px;
|
||
|
cursor: pointer;
|
||
|
font-family: Arial, sans-serif;
|
||
|
}
|
||
|
|
||
|
button:hover {
|
||
|
background-color: #cfd8dc;
|
||
|
}
|
||
|
|
||
|
button.delete {
|
||
|
position: relative;
|
||
|
left: 24em;
|
||
|
top: -32px;
|
||
|
background-color: gray !important;
|
||
|
color: white;
|
||
|
display: inherit;
|
||
|
padding: 5px 8px;
|
||
|
width: 2em;
|
||
|
}
|
||
|
|
||
|
input {
|
||
|
font-size: 100%;
|
||
|
margin-bottom: 2px;
|
||
|
width: 11em;
|
||
|
}
|
||
|
|
||
|
.heroes input {
|
||
|
position: relative;
|
||
|
top: -3px;
|
||
|
width: 12em;
|
||
|
}
|
||
|
|
||
|
|
||
|
/*
|
||
|
Copyright Google LLC. All Rights Reserved.
|
||
|
Use of this source code is governed by an MIT-style license that
|
||
|
can be found in the LICENSE file at https://angular.io/license
|
||
|
*/"><input type="hidden" name="files[src/app/hero-list.component.css]" value="ul {
|
||
|
list-style-type: none;
|
||
|
padding: 0;
|
||
|
}
|
||
|
|
||
|
li {
|
||
|
display: block;
|
||
|
width: 120px;
|
||
|
line-height: 50px;
|
||
|
padding: 0 10px;
|
||
|
box-sizing: border-box;
|
||
|
background-color: #eee;
|
||
|
border-radius: 4px;
|
||
|
margin: 10px;
|
||
|
cursor: pointer;
|
||
|
overflow: hidden;
|
||
|
white-space: nowrap;
|
||
|
}
|
||
|
|
||
|
.active {
|
||
|
background-color: #cfd8dc;
|
||
|
transform: scale(1.1);
|
||
|
}
|
||
|
.inactive {
|
||
|
background-color: #eee;
|
||
|
transform: scale(1);
|
||
|
}
|
||
|
|
||
|
|
||
|
/*
|
||
|
Copyright Google LLC. All Rights Reserved.
|
||
|
Use of this source code is governed by an MIT-style license that
|
||
|
can be found in the LICENSE file at https://angular.io/license
|
||
|
*/"><input type="hidden" name="files[src/app/home.component.css]" value="
|
||
|
|
||
|
/*
|
||
|
Copyright Google LLC. All Rights Reserved.
|
||
|
Use of this source code is governed by an MIT-style license that
|
||
|
can be found in the LICENSE file at https://angular.io/license
|
||
|
*/"><input type="hidden" name="files[src/app/insert-remove.component.css]" value=":host {
|
||
|
display: block;
|
||
|
}
|
||
|
|
||
|
.insert-remove-container {
|
||
|
border: 1px solid #dddddd;
|
||
|
margin-top: 1em;
|
||
|
padding: 20px 20px 0px 20px;
|
||
|
color: #000000;
|
||
|
font-weight: bold;
|
||
|
font-size: 20px;
|
||
|
}
|
||
|
|
||
|
|
||
|
/*
|
||
|
Copyright Google LLC. All Rights Reserved.
|
||
|
Use of this source code is governed by an MIT-style license that
|
||
|
can be found in the LICENSE file at https://angular.io/license
|
||
|
*/"><input type="hidden" name="files[src/app/open-close.component.css]" value=":host {
|
||
|
display: block;
|
||
|
}
|
||
|
|
||
|
.open-close-container {
|
||
|
border: 1px solid #dddddd;
|
||
|
margin-top: 1em;
|
||
|
padding: 20px 20px 0px 20px;
|
||
|
color: #000000;
|
||
|
font-weight: bold;
|
||
|
font-size: 20px;
|
||
|
}
|
||
|
|
||
|
|
||
|
/*
|
||
|
Copyright Google LLC. All Rights Reserved.
|
||
|
Use of this source code is governed by an MIT-style license that
|
||
|
can be found in the LICENSE file at https://angular.io/license
|
||
|
*/"><input type="hidden" name="files[src/app/status-slider.component.css]" value=":host {
|
||
|
display: block;
|
||
|
}
|
||
|
|
||
|
.box {
|
||
|
width: 300px;
|
||
|
border: 5px solid black;
|
||
|
display: block;
|
||
|
line-height: 300px;
|
||
|
text-align: center;
|
||
|
font-size: 50px;
|
||
|
color: white;
|
||
|
}
|
||
|
|
||
|
|
||
|
/*
|
||
|
Copyright Google LLC. All Rights Reserved.
|
||
|
Use of this source code is governed by an MIT-style license that
|
||
|
can be found in the LICENSE file at https://angular.io/license
|
||
|
*/"><input type="hidden" name="files[src/styles.css]" value="/* Global Styles */
|
||
|
* {
|
||
|
font-family: Arial, Helvetica, sans-serif;
|
||
|
}
|
||
|
h1 {
|
||
|
color: #264D73;
|
||
|
font-size: 2.5rem;
|
||
|
}
|
||
|
h2, h3 {
|
||
|
color: #444;
|
||
|
font-weight: lighter;
|
||
|
}
|
||
|
h3 {
|
||
|
font-size: 1.3rem;
|
||
|
}
|
||
|
body {
|
||
|
padding: .5rem;
|
||
|
max-width: 1000px;
|
||
|
margin: auto;
|
||
|
}
|
||
|
@media (min-width: 600px) {
|
||
|
body {
|
||
|
padding: 2rem;
|
||
|
}
|
||
|
}
|
||
|
body, input[text] {
|
||
|
color: #333;
|
||
|
font-family: Cambria, Georgia, serif;
|
||
|
}
|
||
|
a {
|
||
|
cursor: pointer;
|
||
|
}
|
||
|
button {
|
||
|
background-color: #eee;
|
||
|
border: none;
|
||
|
border-radius: 4px;
|
||
|
cursor: pointer;
|
||
|
color: black;
|
||
|
font-size: 1.2rem;
|
||
|
padding: 1rem;
|
||
|
margin-right: 1rem;
|
||
|
margin-bottom: 1rem;
|
||
|
}
|
||
|
button:hover {
|
||
|
background-color: black;
|
||
|
color: white;
|
||
|
}
|
||
|
button:disabled {
|
||
|
background-color: #eee;
|
||
|
color: #aaa;
|
||
|
cursor: auto;
|
||
|
}
|
||
|
|
||
|
/* Navigation link styles */
|
||
|
nav a {
|
||
|
padding: 5px 10px;
|
||
|
text-decoration: none;
|
||
|
margin-right: 10px;
|
||
|
margin-top: 10px;
|
||
|
display: inline-block;
|
||
|
background-color: #e8e8e8;
|
||
|
color: #3d3d3d;
|
||
|
border-radius: 4px;
|
||
|
}
|
||
|
|
||
|
nav a:hover {
|
||
|
color: white;
|
||
|
background-color: #42545C;
|
||
|
}
|
||
|
nav a.active {
|
||
|
background-color: black;
|
||
|
color: white;
|
||
|
}
|
||
|
hr {
|
||
|
margin: 1.5rem 0;
|
||
|
}
|
||
|
input[type="text"] {
|
||
|
box-sizing: border-box;
|
||
|
width: 100%;
|
||
|
padding: .5rem;
|
||
|
}
|
||
|
|
||
|
|
||
|
/*
|
||
|
Copyright Google LLC. All Rights Reserved.
|
||
|
Use of this source code is governed by an MIT-style license that
|
||
|
can be found in the LICENSE file at https://angular.io/license
|
||
|
*/"><input type="hidden" name="files[src/app/about.component.html]" value="<p>
|
||
|
Angular's animations library makes it easy to define and apply animation effects such as page and list transitions.
|
||
|
</p>
|
||
|
|
||
|
|
||
|
<!--
|
||
|
Copyright Google LLC. All Rights Reserved.
|
||
|
Use of this source code is governed by an MIT-style license that
|
||
|
can be found in the LICENSE file at https://angular.io/license
|
||
|
-->"><input type="hidden" name="files[src/app/app.component.html]" value="<h1>Animations</h1>
|
||
|
|
||
|
Toggle All Animations <input type="checkbox" [checked]="!animationsDisabled" (click)="toggleAnimations()"/>
|
||
|
|
||
|
<nav>
|
||
|
<a id="home" routerLink="/home" routerLinkActive="active">Home</a>
|
||
|
<a id="about" routerLink="/about" routerLinkActive="active">About</a>
|
||
|
<a id="open-close" routerLink="/open-close" routerLinkActive="active">Open/Close</a>
|
||
|
<a id="status" routerLink="/status" routerLinkActive="active">Status Slider</a>
|
||
|
<a id="toggle" routerLink="/toggle" routerLinkActive="active">Toggle Animations</a>
|
||
|
<a id="enter-leave" routerLink="/enter-leave" routerLinkActive="active">Enter/Leave</a>
|
||
|
<a id="auto" routerLink="/auto" routerLinkActive="active">Auto Calculation</a>
|
||
|
<a id="heroes" routerLink="/heroes" routerLinkActive="active">Filter/Stagger</a>
|
||
|
<a id="hero-groups" routerLink="/hero-groups" routerLinkActive="active">Hero Groups</a>
|
||
|
<a id="insert-remove" routerLink="/insert-remove" routerLinkActive="active">Insert/Remove</a>
|
||
|
|
||
|
</nav>
|
||
|
|
||
|
<div [@routeAnimations]="prepareRoute(outlet)">
|
||
|
<router-outlet #outlet="outlet"></router-outlet>
|
||
|
</div>
|
||
|
|
||
|
|
||
|
<!--
|
||
|
Copyright Google LLC. All Rights Reserved.
|
||
|
Use of this source code is governed by an MIT-style license that
|
||
|
can be found in the LICENSE file at https://angular.io/license
|
||
|
-->"><input type="hidden" name="files[src/app/hero-list-auto.component.html]" value="<ul class="heroes">
|
||
|
<li *ngFor="let hero of heroes"
|
||
|
[@shrinkOut]="'in'" (click)="removeHero(hero.id)">
|
||
|
<div class="inner">
|
||
|
<span class="badge">{{ hero.id }}</span>
|
||
|
<span>{{ hero.name }}</span>
|
||
|
</div>
|
||
|
</li>
|
||
|
</ul>
|
||
|
|
||
|
<!--
|
||
|
Copyright Google LLC. All Rights Reserved.
|
||
|
Use of this source code is governed by an MIT-style license that
|
||
|
can be found in the LICENSE file at https://angular.io/license
|
||
|
-->"><input type="hidden" name="files[src/app/hero-list-page.component.html]" value="<h2>Filter/Stagger</h2>
|
||
|
|
||
|
<form>
|
||
|
<input #criteria (input)="updateCriteria(criteria.value)" placeholder="Search Heroes" />
|
||
|
</form>
|
||
|
|
||
|
<ul class="heroes" [@filterAnimation]="heroTotal">
|
||
|
<li *ngFor="let hero of heroes" class="hero">
|
||
|
<div class="inner">
|
||
|
<span class="badge">{{ hero.id }}</span>
|
||
|
<span>{{ hero.name }}</span>
|
||
|
</div>
|
||
|
</li>
|
||
|
</ul>
|
||
|
|
||
|
<!--
|
||
|
Copyright Google LLC. All Rights Reserved.
|
||
|
Use of this source code is governed by an MIT-style license that
|
||
|
can be found in the LICENSE file at https://angular.io/license
|
||
|
-->"><input type="hidden" name="files[src/app/home.component.html]" value="<p>
|
||
|
Welcome to Animations in Angular!
|
||
|
</p>
|
||
|
|
||
|
|
||
|
<!--
|
||
|
Copyright Google LLC. All Rights Reserved.
|
||
|
Use of this source code is governed by an MIT-style license that
|
||
|
can be found in the LICENSE file at https://angular.io/license
|
||
|
-->"><input type="hidden" name="files[src/app/insert-remove.component.html]" value="
|
||
|
<h2>Insert/Remove</h2>
|
||
|
|
||
|
<nav>
|
||
|
<button (click)="toggle()">Toggle Insert/Remove</button>
|
||
|
</nav>
|
||
|
|
||
|
<div @myInsertRemoveTrigger *ngIf="isShown" class="insert-remove-container">
|
||
|
<p>The box is inserted</p>
|
||
|
</div>
|
||
|
|
||
|
|
||
|
<!--
|
||
|
Copyright Google LLC. All Rights Reserved.
|
||
|
Use of this source code is governed by an MIT-style license that
|
||
|
can be found in the LICENSE file at https://angular.io/license
|
||
|
-->"><input type="hidden" name="files[src/app/open-close.component.4.html]" value="<nav>
|
||
|
<button (click)="toggleAnimations()">Toggle Animations</button>
|
||
|
<button (click)="toggle()">Toggle Open/Closed</button>
|
||
|
</nav>
|
||
|
<div [@.disabled]="isDisabled">
|
||
|
<div [@childAnimation]="isOpen ? 'open' : 'closed'"
|
||
|
class="open-close-container">
|
||
|
<p>The box is now {{ isOpen ? 'Open' : 'Closed' }}!</p>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<!--
|
||
|
Copyright Google LLC. All Rights Reserved.
|
||
|
Use of this source code is governed by an MIT-style license that
|
||
|
can be found in the LICENSE file at https://angular.io/license
|
||
|
-->"><input type="hidden" name="files[src/app/open-close.component.html]" value="<nav>
|
||
|
<button (click)="toggle()">Toggle Open/Close</button>
|
||
|
</nav>
|
||
|
|
||
|
<div [@openClose]="isOpen ? 'open' : 'closed'"
|
||
|
(@openClose.start)="onAnimationEvent($event)"
|
||
|
(@openClose.done)="onAnimationEvent($event)"
|
||
|
class="open-close-container">
|
||
|
<p>The box is now {{ isOpen ? 'Open' : 'Closed' }}!</p>
|
||
|
</div>
|
||
|
|
||
|
|
||
|
<!--
|
||
|
Copyright Google LLC. All Rights Reserved.
|
||
|
Use of this source code is governed by an MIT-style license that
|
||
|
can be found in the LICENSE file at https://angular.io/license
|
||
|
-->"><input type="hidden" name="files[src/app/status-slider.component.html]" value="<nav>
|
||
|
<button (click)="toggle()">Toggle Status</button>
|
||
|
</nav>
|
||
|
|
||
|
<div [@slideStatus]="status" class="box">
|
||
|
{{ status == 'active' ? 'Active' : 'Inactive' }}
|
||
|
</div>
|
||
|
|
||
|
|
||
|
<!--
|
||
|
Copyright Google LLC. All Rights Reserved.
|
||
|
Use of this source code is governed by an MIT-style license that
|
||
|
can be found in the LICENSE file at https://angular.io/license
|
||
|
-->"><input type="hidden" name="files[src/index.html]" value="<!DOCTYPE html>
|
||
|
<html lang="en">
|
||
|
<head>
|
||
|
<meta charset="UTF-8">
|
||
|
<title>Animations</title>
|
||
|
<base href="/">
|
||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||
|
</head>
|
||
|
|
||
|
<body>
|
||
|
<app-root></app-root>
|
||
|
</body>
|
||
|
|
||
|
</html>
|
||
|
|
||
|
|
||
|
<!--
|
||
|
Copyright Google LLC. All Rights Reserved.
|
||
|
Use of this source code is governed by an MIT-style license that
|
||
|
can be found in the LICENSE file at https://angular.io/license
|
||
|
-->"><input type="hidden" name="files[angular.json]" value="{
|
||
|
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
||
|
"version": 1,
|
||
|
"newProjectRoot": "projects",
|
||
|
"projects": {
|
||
|
"angular.io-example": {
|
||
|
"projectType": "application",
|
||
|
"schematics": {
|
||
|
"@schematics/angular:application": {
|
||
|
"strict": true
|
||
|
}
|
||
|
},
|
||
|
"root": "",
|
||
|
"sourceRoot": "src",
|
||
|
"prefix": "app",
|
||
|
"architect": {
|
||
|
"build": {
|
||
|
"builder": "@angular-devkit/build-angular:browser",
|
||
|
"options": {
|
||
|
"outputPath": "dist",
|
||
|
"index": "src/index.html",
|
||
|
"main": "src/main.ts",
|
||
|
"polyfills": "src/polyfills.ts",
|
||
|
"tsConfig": "tsconfig.app.json",
|
||
|
"aot": true,
|
||
|
"assets": [
|
||
|
"src/favicon.ico",
|
||
|
"src/assets"
|
||
|
],
|
||
|
"styles": [
|
||
|
"src/styles.css"
|
||
|
],
|
||
|
"scripts": []
|
||
|
},
|
||
|
"configurations": {
|
||
|
"production": {
|
||
|
"fileReplacements": [
|
||
|
{
|
||
|
"replace": "src/environments/environment.ts",
|
||
|
"with": "src/environments/environment.prod.ts"
|
||
|
}
|
||
|
],
|
||
|
"optimization": true,
|
||
|
"outputHashing": "all",
|
||
|
"sourceMap": false,
|
||
|
"namedChunks": false,
|
||
|
"extractLicenses": true,
|
||
|
"vendorChunk": false,
|
||
|
"buildOptimizer": true,
|
||
|
"budgets": [
|
||
|
{
|
||
|
"type": "initial",
|
||
|
"maximumWarning": "500kb",
|
||
|
"maximumError": "1mb"
|
||
|
},
|
||
|
{
|
||
|
"type": "anyComponentStyle",
|
||
|
"maximumWarning": "2kb",
|
||
|
"maximumError": "4kb"
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
"serve": {
|
||
|
"builder": "@angular-devkit/build-angular:dev-server",
|
||
|
"options": {
|
||
|
"browserTarget": "angular.io-example:build"
|
||
|
},
|
||
|
"configurations": {
|
||
|
"production": {
|
||
|
"browserTarget": "angular.io-example:build:production"
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
"extract-i18n": {
|
||
|
"builder": "@angular-devkit/build-angular:extract-i18n",
|
||
|
"options": {
|
||
|
"browserTarget": "angular.io-example:build"
|
||
|
}
|
||
|
},
|
||
|
"test": {
|
||
|
"builder": "@angular-devkit/build-angular:karma",
|
||
|
"options": {
|
||
|
"main": "src/test.ts",
|
||
|
"polyfills": "src/polyfills.ts",
|
||
|
"tsConfig": "tsconfig.spec.json",
|
||
|
"karmaConfig": "karma.conf.js",
|
||
|
"assets": [
|
||
|
"src/favicon.ico",
|
||
|
"src/assets"
|
||
|
],
|
||
|
"styles": [
|
||
|
"src/styles.css"
|
||
|
],
|
||
|
"scripts": []
|
||
|
}
|
||
|
},
|
||
|
"lint": {
|
||
|
"builder": "@angular-devkit/build-angular:tslint",
|
||
|
"options": {
|
||
|
"tsConfig": [
|
||
|
"tsconfig.app.json",
|
||
|
"tsconfig.spec.json",
|
||
|
"e2e/tsconfig.json"
|
||
|
],
|
||
|
"exclude": [
|
||
|
"**/node_modules/**"
|
||
|
]
|
||
|
}
|
||
|
},
|
||
|
"e2e": {
|
||
|
"builder": "@angular-devkit/build-angular:protractor",
|
||
|
"options": {
|
||
|
"protractorConfig": "e2e/protractor.conf.js",
|
||
|
"devServerTarget": "angular.io-example:serve"
|
||
|
},
|
||
|
"configurations": {
|
||
|
"production": {
|
||
|
"devServerTarget": "angular.io-example:serve:production"
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
"defaultProject": "angular.io-example"
|
||
|
}
|
||
|
"><input type="hidden" name="files[tsconfig.json]" value="{
|
||
|
"compileOnSave": false,
|
||
|
"compilerOptions": {
|
||
|
"baseUrl": "./",
|
||
|
"outDir": "./dist/out-tsc",
|
||
|
"forceConsistentCasingInFileNames": true,
|
||
|
"noImplicitReturns": true,
|
||
|
"noFallthroughCasesInSwitch": true,
|
||
|
"sourceMap": true,
|
||
|
"declaration": false,
|
||
|
"downlevelIteration": true,
|
||
|
"experimentalDecorators": true,
|
||
|
"moduleResolution": "node",
|
||
|
"importHelpers": true,
|
||
|
"target": "es2015",
|
||
|
"module": "es2020",
|
||
|
"lib": [
|
||
|
"es2018",
|
||
|
"dom"
|
||
|
]
|
||
|
},
|
||
|
"angularCompilerOptions": {
|
||
|
"strictInjectionParameters": true,
|
||
|
"strictInputAccessModifiers": true,
|
||
|
"strictTemplates": true,
|
||
|
"enableIvy": true
|
||
|
}
|
||
|
}"><input type="hidden" name="tags[0]" value="angular"><input type="hidden" name="tags[1]" value="example"><input type="hidden" name="tags[2]" value="animations"><input type="hidden" name="description" value="Angular Example - Angular Animations Guide"><input type="hidden" name="dependencies" value="{"@angular/animations":"~11.0.1","@angular/common":"~11.0.1","@angular/compiler":"~11.0.1","@angular/core":"~11.0.1","@angular/forms":"~11.0.1","@angular/platform-browser":"~11.0.1","@angular/platform-browser-dynamic":"~11.0.1","@angular/router":"~11.0.1","angular-in-memory-web-api":"~0.11.0","rxjs":"~6.6.0","tslib":"^2.0.0","zone.js":"~0.11.4","jasmine-core":"~3.6.0","jasmine-marbles":"~0.6.0"}"></form>
|
||
|
<script>
|
||
|
var embedded = 'ctl=1';
|
||
|
var isEmbedded = window.location.search.indexOf(embedded) > -1;
|
||
|
|
||
|
if (isEmbedded) {
|
||
|
var form = document.getElementById('mainForm');
|
||
|
var action = form.action;
|
||
|
var actionHasParams = action.indexOf('?') > -1;
|
||
|
var symbol = actionHasParams ? '&' : '?'
|
||
|
form.action = form.action + symbol + embedded;
|
||
|
}
|
||
|
document.getElementById("mainForm").submit();
|
||
|
</script>
|
||
|
</body></html>
|