From 876f897655cd831bf5ee921344c486d200357ca3 Mon Sep 17 00:00:00 2001 From: kj1352 Date: Tue, 9 Jun 2020 11:58:47 +0530 Subject: [PATCH] Courses UI --- src/app/app-routing.module.ts | 3 +- src/app/tabs/courses/courses.component.html | 53 ++++++++++++++- src/app/tabs/courses/courses.component.scss | 74 +++++++++++++++++++++ src/app/tabs/tabs.component.html | 9 +-- src/app/tabs/tabs.component.ts | 16 ++++- src/app/welcome/welcome.component.html | 2 +- 6 files changed, 148 insertions(+), 9 deletions(-) diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index b2ea638..6e15217 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -6,7 +6,8 @@ import { TabsComponent } from './tabs/tabs.component'; const routes: Routes = [ { path: '', pathMatch: 'full', redirectTo: 'welcome' }, { component: WelcomeComponent, path: 'welcome' }, - { component: TabsComponent, path: 'tabs' } + { component: TabsComponent, path: 'tabs' }, + { component: TabsComponent, path: 'tabs/:subpage' } ]; @NgModule({ diff --git a/src/app/tabs/courses/courses.component.html b/src/app/tabs/courses/courses.component.html index 1aa8288..2049b35 100644 --- a/src/app/tabs/courses/courses.component.html +++ b/src/app/tabs/courses/courses.component.html @@ -1 +1,52 @@ -

courses works!

+
Main Courses:
+ diff --git a/src/app/tabs/courses/courses.component.scss b/src/app/tabs/courses/courses.component.scss index e69de29..4edc453 100644 --- a/src/app/tabs/courses/courses.component.scss +++ b/src/app/tabs/courses/courses.component.scss @@ -0,0 +1,74 @@ +header { + padding: 0 7%; + color: white; + font-size: 18px; + position: relative; + margin-top: 50px; +} + +ul { + list-style: none; + width: 90%; + margin: 0 auto; + display: flex; + align-items: stretch; + justify-content: space-between; + position: relative; + flex-wrap: wrap; + + li { + width: 42vw; + height: 37vw; + padding: 15px; + background-color: white; + border-radius: 15px; + margin-top: 6vw; + box-shadow: 0px 0px 5px var(--light-grey); + position: relative; + } + + .details { + position: absolute; + bottom: 0px; + left: 0; + padding: 15px; + width: 100%; + } + + h2 { + font-size: 26px; + color: var(--teal-green); + opacity: 0.7; + font-weight: 700; + } + + h5 { + color: var(--black); + font-weight: 500; + font-size: 14px; + } + + p { + color: var(--dark-grey); + font-size: 12px; + } + + .progress-holder { + position: relative; + height: 5px; + background-color: #cecece; + border-radius: 30px; + overflow: hidden; + width: 100%; + margin-top: 10px; + + .progress { + background-color: var(--green); + width: 50%; + height: 100%; + position: absolute; + left: 0; + top: 0; + } + } +} diff --git a/src/app/tabs/tabs.component.html b/src/app/tabs/tabs.component.html index 28dad62..ce5b630 100644 --- a/src/app/tabs/tabs.component.html +++ b/src/app/tabs/tabs.component.html @@ -1,24 +1,25 @@
+
- - - - diff --git a/src/app/tabs/tabs.component.ts b/src/app/tabs/tabs.component.ts index 92c784d..23f4929 100644 --- a/src/app/tabs/tabs.component.ts +++ b/src/app/tabs/tabs.component.ts @@ -1,4 +1,6 @@ import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { Subscription } from 'rxjs'; @Component({ selector: 'app-tabs', @@ -6,11 +8,21 @@ import { Component, OnInit } from '@angular/core'; styleUrls: ['./tabs.component.scss'] }) export class TabsComponent implements OnInit { - selectedTab: string = 'home'; + selectedTab: string; + routeSubscription: Subscription; - constructor() { } + constructor( + private route: ActivatedRoute + ) { } ngOnInit(): void { + this.routeSubscription = this.route.params.subscribe((params) => { + this.selectedTab = params['subpage'] ? params['subpage'] : 'home'; + }); } + ngOnDestroy() { + this.routeSubscription.unsubscribe(); + } + } diff --git a/src/app/welcome/welcome.component.html b/src/app/welcome/welcome.component.html index 8e66878..f53c942 100644 --- a/src/app/welcome/welcome.component.html +++ b/src/app/welcome/welcome.component.html @@ -71,5 +71,5 @@ - +