Skip to content

Commit

Permalink
perf: improve load timing for fonts (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
ykzts committed Nov 4, 2018
1 parent b363d58 commit 6840813
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 16 deletions.
4 changes: 4 additions & 0 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@
</mat-toolbar>

<router-outlet></router-outlet>

<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Noto+Sans+JP:400,700" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
6 changes: 0 additions & 6 deletions src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,4 @@ describe('AppComponent', () => {
const app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy();
});

it(`should have as title 'neru-camera'`, () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app.title).toEqual('neru-camera');
});
});
4 changes: 1 addition & 3 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,4 @@ import { Component } from '@angular/core';
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'neru-camera';
}
export class AppComponent { }
3 changes: 2 additions & 1 deletion src/app/camera/camera.component.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.container {
:host {
display: block;
margin: 0;
position: relative;
}
Expand Down
3 changes: 2 additions & 1 deletion src/app/camera/camera.component.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<div class="container" *ngIf="!failed; then thenBlock; else elseBlock"></div>
<ng-container *ngIf="!failed; then thenBlock; else elseBlock">
</ng-container>

<ng-template #thenBlock>
<canvas
Expand Down
7 changes: 2 additions & 5 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@
</head>
<body>
<app-root></app-root>
<noscript><p>Please enable JavaScript to continue using this application.</p></noscript>
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Noto+Sans+JP:400,700" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
</body>
<noscript><p>JavaScript を有効にしてください。</p></noscript>
</body>
</html>

0 comments on commit 6840813

Please sign in to comment.