Skip to content

Commit db3a564

Browse files
committed
RELEASE 3.9.8: performance and NEW styles (#42)
1 parent ac20675 commit db3a564

71 files changed

Lines changed: 1757 additions & 1467 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.angular-cli.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@
77
{
88
"root": "src",
99
"outDir": "dist",
10-
"assets": [
11-
"assets",
12-
"favicon.ico"
13-
],
10+
"assets": ["assets", "favicon.ico"],
1411
"index": "index.html",
1512
"main": "main.ts",
1613
"polyfills": "polyfills.ts",
@@ -19,6 +16,7 @@
1916
"testTsconfig": "tsconfig.spec.json",
2017
"prefix": "app",
2118
"styles": [
19+
"../node_modules/font-awesome/scss/font-awesome.scss",
2220
"css/style.scss"
2321
],
2422
"scripts": [],

.editorconfig

Lines changed: 0 additions & 13 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## v 3.9.8 (2018/04/29) (codename: Adi)
2+
3+
* [PERF] - performance optimization using pipes with function utils
4+
* [NEW] - cards videos & playlists rounded styles
5+
* [UPGRADE] - app menu with animation in/out
6+
* [REFACTOR] - using now more css utils to reduce css code
7+
* [REFACTOR] - app-search component restructure
8+
19
## v 3.9.7 (2018/03/17)
210

311
* [NEW] - added "Developed With YouTube" badge

package.json

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"name": "echoes-player",
3-
"version": "3.9.7",
3+
"version": "3.9.8",
44
"license": "MIT",
55
"scripts": {
66
"ng": "ng",
77
"start": "ng serve",
8-
"start:prod": "ng serve --prod",
8+
"start:prod": "ng serve --aot --build-optimizer",
99
"build": "ng build",
10-
"build:prod": "ng build --prod",
10+
"build:prod": "ng build --aot --build-optimizer",
1111
"build:env": "node config/build-env.js",
1212
"postinstall": "npm rebuild node-sass",
1313
"copy:heroku": "shx cp -r ./config/heroku/*.* ./dist",
@@ -33,15 +33,17 @@
3333
"@angular/platform-browser": "5.2.7",
3434
"@angular/platform-browser-dynamic": "5.2.7",
3535
"@angular/router": "5.2.7",
36-
"@ngrx/router": "1.0.0-beta.2",
3736
"core-js": "^2.4.1",
3837
"http-server": "0.10.0",
38+
"memo-decorator": "1.0.1",
39+
"node-sass": "4.7.2",
3940
"replace": "0.3.0",
4041
"rxjs": "^5.5.2",
42+
"sass-loader": "7.0.1",
4143
"zone.js": "^0.8.14"
4244
},
4345
"devDependencies": {
44-
"@angular/cli": "^1.6.6",
46+
"@angular/cli": "1.7.4",
4547
"@angular/compiler-cli": "5.2.7",
4648
"@angular/language-service": "5.2.7",
4749
"@ngrx/effects": "5.2.0",
@@ -51,17 +53,16 @@
5153
"@types/gapi": "0.0.35",
5254
"@types/gapi.auth2": "0.0.46",
5355
"@types/gapi.youtube": "3.0.34",
54-
"@types/jasmine": "~2.5.53",
56+
"@types/jasmine": "~2.8.3",
5557
"@types/jasminewd2": "~2.0.2",
5658
"@types/youtube": "0.0.31",
5759
"bootstrap-sass": "3.3.7",
5860
"codelyzer": "^4.0.1",
5961
"font-awesome": "4.7.0",
60-
"jasmine-core": "~2.6.2",
62+
"jasmine-core": "~2.8.0",
6163
"jasmine-spec-reporter": "~4.2.1",
62-
"karma": "~1.7.1",
63-
"karma-chrome-launcher": "~2.1.1",
64-
"karma-cli": "~1.0.1",
64+
"karma": "~2.0.0",
65+
"karma-chrome-launcher": "~2.2.0",
6566
"karma-coverage-istanbul-reporter": "^1.2.1",
6667
"karma-jasmine": "~1.1.0",
6768
"karma-jasmine-html-reporter": "^0.2.2",
@@ -70,14 +71,14 @@
7071
"ngrx-store-localstorage": "0.2.4",
7172
"ngx-infinite-scroll": "^0.8.2",
7273
"ngx-tooltip": "0.0.9",
73-
"ngx-typeahead": "0.1.0",
74+
"ngx-typeahead": "0.2.1",
7475
"ngx-youtube-player": "0.1.0",
7576
"prettier": "1.11.1",
7677
"protractor": "~5.1.2",
7778
"rimraf": "2.6.1",
7879
"shx": "0.2.2",
7980
"ts-node": "~3.2.0",
80-
"tslint": "~5.7.0",
81-
"typescript": "~2.4.2"
81+
"tslint": "~5.9.1",
82+
"typescript": "~2.5.3"
8283
}
8384
}

src/app/app.component.scss

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,18 @@
22

33
:host {
44
// DEFAULT THEME - 'arctic'
5-
5+
66
background-color: var(--app-bg-color);
77
display: block;
88
height: 100%;
9-
9+
1010
.container-main {
1111
height: 100vh;
1212
display: block;
13-
transition: margin .3s ease-out;
13+
transition: margin 0.3s ease-out;
1414
margin-left: 0;
1515
}
1616
}
17-
@media (min-width: 320px) {
18-
:host .container-fluid.container-main {
19-
padding-right: 0;
20-
padding-left: 0;
21-
}
22-
}
2317
@media (min-width: 768px) {
2418
:host .closed + .container-main {
2519
margin-left: $sidebar-closed-width;
@@ -29,4 +23,4 @@
2923
:host .container-main {
3024
margin-left: $drawer-width;
3125
}
32-
}
26+
}

src/app/app.component.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { VersionCheckerService } from './core/services/version-checker.service';
33
import { Component, HostBinding, OnInit } from '@angular/core';
44
import { EchoesState } from '@store/reducers';
55
import { getSidebarCollapsed, getAppTheme } from '@store/app-layout';
6+
import { AppApi } from '@core/api/app.api';
67

78
@Component({
89
selector: 'body',
@@ -15,8 +16,13 @@ export class AppComponent implements OnInit {
1516

1617
@HostBinding('class') style = 'arctic';
1718

18-
constructor(private store: Store<EchoesState>, private versionCheckerService: VersionCheckerService) {
19+
constructor(
20+
private store: Store<EchoesState>,
21+
private versionCheckerService: VersionCheckerService,
22+
private appApi: AppApi
23+
) {
1924
versionCheckerService.start();
25+
appApi.checkUserAuth();
2026
}
2127

2228
ngOnInit() {

src/app/containers/app-navbar/app-navbar-menu/app-navbar-menu.component.scss

Lines changed: 16 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,6 @@
22

33
@media (min-width: 320px) {
44
:host {
5-
@keyframes pulse {
6-
0% {
7-
transform: scale(0);
8-
opacity: 1;
9-
}
10-
50% {
11-
transform: scale(1);
12-
opacity: 0.5;
13-
}
14-
100% {
15-
transform: scale(1.5);
16-
opacity: 0;
17-
}
18-
}
19-
20-
@keyframes slideInDown {
21-
0% {
22-
transform: scale(0.4);
23-
opacity: 0;
24-
}
25-
26-
100% {
27-
transform: scale(1);
28-
opacity: 1;
29-
}
30-
}
31-
.pulse {
32-
animation: pulse 2s infinite;
33-
}
34-
355
.btn-toggle {
366
padding: 1rem 1.5rem;
377
font-size: 2rem;
@@ -46,22 +16,31 @@
4616
.menu-dropdown {
4717
position: absolute;
4818
right: 0;
49-
top: -35rem;
5019
min-width: 250px;
5120
z-index: $zindex-navbar-fixed;
21+
transform-origin: top right;
22+
23+
&.end-animation {
24+
top: -35rem;
25+
}
5226

5327
&.slideInDown {
5428
animation: slideInDown 0.5s 1;
5529
top: 5rem;
5630
transform-origin: top right;
5731
}
58-
.menu-backdrop {
59-
position: fixed;
60-
top: 0;
61-
bottom: 0;
62-
right: 0;
63-
left: 0;
32+
&.slideOutDown {
33+
animation: slideOutDown 0.8s 1 forwards;
34+
top: 5rem;
35+
transform-origin: top right;
6436
}
6537
}
38+
.menu-backdrop {
39+
position: fixed;
40+
top: 0;
41+
bottom: 0;
42+
right: 0;
43+
left: 0;
44+
}
6645
}
6746
}

src/app/containers/app-navbar/app-navbar-menu/app-navbar-menu.component.spec.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,21 @@ import { NO_ERRORS_SCHEMA } from '@angular/core';
22
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
33

44
import { AppNavbarMenuComponent } from './app-navbar-menu.component';
5+
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
56

67
describe('AppNavbarMenuComponent', () => {
78
let component: AppNavbarMenuComponent;
89
let fixture: ComponentFixture<AppNavbarMenuComponent>;
910

10-
beforeEach(async(() => {
11-
TestBed.configureTestingModule({
12-
declarations: [AppNavbarMenuComponent],
13-
schemas: [NO_ERRORS_SCHEMA]
11+
beforeEach(
12+
async(() => {
13+
TestBed.configureTestingModule({
14+
declarations: [AppNavbarMenuComponent],
15+
schemas: [NO_ERRORS_SCHEMA],
16+
imports: [NoopAnimationsModule]
17+
}).compileComponents();
1418
})
15-
.compileComponents();
16-
}));
19+
);
1720

1821
beforeEach(() => {
1922
fixture = TestBed.createComponent(AppNavbarMenuComponent);

src/app/containers/app-navbar/app-navbar-menu/app-navbar-menu.component.ts

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
import { Component, OnInit, ChangeDetectionStrategy, Input, Output, EventEmitter, HostListener } from '@angular/core';
1+
import {
2+
Component,
3+
OnInit,
4+
ChangeDetectionStrategy,
5+
Input,
6+
Output,
7+
EventEmitter,
8+
HostListener
9+
} from '@angular/core';
10+
import { expandFadeInAnimation } from '@shared/animations/fade-in.animation';
211

312
enum Key {
413
Backspace = 8,
@@ -14,16 +23,19 @@ enum Key {
1423

1524
@Component({
1625
selector: 'app-navbar-menu',
26+
animations: [expandFadeInAnimation],
1727
template: `
1828
<button class="btn btn-navbar btn-link ux-maker btn-toggle"
1929
(click)="toggleMenu()">
2030
<icon name="ellipsis-v"></icon>
2131
<icon *ngIf="appVersion.isNewAvailable" name="dot-circle-o" class="pulse update-indicator text-primary"></icon>
2232
</button>
33+
<div class="menu-backdrop" *ngIf="!hide" (click)="hideMenu()"></div>
2334
<div class="panel menu-dropdown"
24-
[class.slideInDown]="!hide"
35+
[class.end-animation]="end"
36+
[@expandFadeIn]="menuState"
37+
(@expandFadeIn.done)="endAnimation($event)"
2538
>
26-
<div class="menu-backdrop" *ngIf="!hide" (click)="hideMenu()"></div>
2739
<div class="list-group">
2840
<div *ngIf="appVersion.isNewAvailable" class="list-group-item">
2941
<button class="btn btn-success" title="click to update Echoes"
@@ -68,9 +80,15 @@ enum Key {
6880
changeDetection: ChangeDetectionStrategy.OnPush
6981
})
7082
export class AppNavbarMenuComponent implements OnInit {
83+
end = false;
7184
hide = true;
85+
get menuState() {
86+
return this.hide ? 'hide' : 'show';
87+
}
88+
7289
@Input() signedIn = false;
73-
@Input() appVersion = {
90+
@Input()
91+
appVersion = {
7492
semver: '',
7593
isNewAvailable: false,
7694
checkingForVersion: false
@@ -88,9 +106,9 @@ export class AppNavbarMenuComponent implements OnInit {
88106
}
89107
}
90108

91-
constructor() { }
109+
constructor() {}
92110

93-
ngOnInit() { }
111+
ngOnInit() {}
94112

95113
handleSignOut() {
96114
this.signOut.emit();
@@ -101,6 +119,7 @@ export class AppNavbarMenuComponent implements OnInit {
101119
}
102120

103121
toggleMenu() {
122+
this.end = false;
104123
this.hide = !this.hide;
105124
}
106125

@@ -115,4 +134,11 @@ export class AppNavbarMenuComponent implements OnInit {
115134
updateTheme(theme) {
116135
this.themeChange.emit(theme);
117136
}
137+
138+
endAnimation({ toState }) {
139+
if (toState === 'hide') {
140+
this.end = true;
141+
}
142+
console.log('animation done!');
143+
}
118144
}

0 commit comments

Comments
 (0)