Skip to content

Commit 2ee0cd4

Browse files
committed
1.1 - Improving UI/UX
1 parent 17fa224 commit 2ee0cd4

File tree

8 files changed

+52
-10
lines changed

8 files changed

+52
-10
lines changed

dist/inline.bundle.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/main.bundle.js

Lines changed: 8 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/main.bundle.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/components/youtube-search.component.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
</div>
99
<div *ngIf="searchForm.valid" id="search-video-list" class="video-list">
1010
<div *ngFor="let video of videos; let i = index" [attr.data-index]="i" class="video-item" (click)="onClickVideo($event, i)">
11+
<div class="video-item-image">
12+
<img src="{{ video.snippet.thumbnails.default.url }}" alt="video thumbnail" />
13+
</div>
1114
<div class="video-item-content">
1215
<p>{{ video.snippet.title }}</p>
1316
</div>
@@ -16,6 +19,7 @@
1619
<div *ngIf="relatedVideos" id="related-video-list" class="video-list">
1720
<div class="video-item-head">
1821
Recommended videos
22+
<span (click)="clearRelatedVideos()" class="video-list-clear"><span class="fa fa-close"></span>Clear</span>
1923
</div>
2024
<div *ngFor="let relatedVideo of relatedVideos; let i = index" [attr.data-index]="i" class="video-item" (click)="onClickRelatedVideo($event, i)">
2125
<div class="video-item-image">

src/app/components/youtube-search.component.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ export class SearchComponent implements OnInit {
9797
);
9898
}
9999

100+
clearRelatedVideos() {
101+
this.relatedVideos = null;
102+
}
103+
100104
clearSearch() {
101105
this.searchForm.reset();
102106
this.videos = null;
@@ -110,7 +114,6 @@ export class SearchComponent implements OnInit {
110114
const clickedVideo = this.videos[i];
111115
this.currentVideoID = clickedVideo.id.videoId;
112116
this.currentVideoName = clickedVideo.snippet.title;
113-
console.log(this.currentVideoID);
114117
this.player.loadVideoById(this.currentVideoID);
115118
this.getRelatedVideos();
116119
this.clearSearch();

src/app/components/youtube-settings.component.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,21 @@ export class SettingsComponent implements OnInit {
4343
this.http.get('assets/settings.json')
4444
.map(res => res.json())
4545
.subscribe(
46-
data => { this.playerAttr.settings = data },
46+
data => {
47+
this.playerAttr.settings = data
48+
},
4749
err => console.log('JSON Settings ' + err),
48-
() => { this.finished = true; this.setForm(); }
50+
() => {
51+
this.finished = true; this.setForm();
52+
}
4953
);
5054
}
5155

5256
checkInputs() {
5357
this.showSettings(this.playerAttr);
5458
this.settingsForm.valueChanges.subscribe((data) => {
5559
Object.keys(data.settings).map(i => {
56-
this.playerAttr.settings[i] = data.settings[i];
60+
this.playerAttr.settings[i].selected = data.settings[i];
5761
});
5862
this.showSettings(data);
5963
});

src/assets/css/main.css

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ footer {
613613
}
614614

615615
#search-video-list {
616-
z-index: 1;
616+
z-index: 9;
617617
}
618618

619619
#search-video-list .video-item:last-child {
@@ -766,3 +766,16 @@ iframe {
766766
#related-video-list .video-item-content {
767767
margin-top: 20px;
768768
}
769+
770+
.video-list-clear {
771+
float: right;
772+
cursor: pointer;
773+
background-color: #ffffff;
774+
color: #212121;
775+
padding: 2px 10px;
776+
border-radius: 20px;
777+
}
778+
779+
.video-list-clear .fa {
780+
margin-right: 5px;
781+
}

src/assets/scss/_videos.scss

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
}
2020

2121
#search-video-list {
22-
z-index: 1;
22+
z-index: 9;
2323
.video-item:last-child {
2424
box-shadow: 0px 10px 10px 0px rgba($c-black,0.1);
2525
}
@@ -149,4 +149,16 @@ iframe {
149149
.video-item-content {
150150
margin-top: 20px;
151151
}
152+
}
153+
154+
.video-list-clear {
155+
float: right;
156+
cursor: pointer;
157+
background-color: $c-white;
158+
color: $c-black;
159+
padding: 2px 10px;
160+
border-radius: 20px;
161+
.fa {
162+
margin-right: 5px;
163+
}
152164
}

0 commit comments

Comments
 (0)