| @@ -25,6 +25,7 @@ const routes: Routes = [ | |||||
| { component: VideoChapterComponent, path: 'video-chapter/:heading' }, | { component: VideoChapterComponent, path: 'video-chapter/:heading' }, | ||||
| { component: VideoNotesComponent, path: 'video-notes/:heading' }, | { component: VideoNotesComponent, path: 'video-notes/:heading' }, | ||||
| { component: QuizComponent, path: 'quiz' }, | { component: QuizComponent, path: 'quiz' }, | ||||
| { component: QuizComponent, path: 'quiz/:heading' }, | |||||
| { component: TestComponent, path: 'test'}, | { component: TestComponent, path: 'test'}, | ||||
| { component: CalendarComponent, path: 'calendar' }, | { component: CalendarComponent, path: 'calendar' }, | ||||
| { component: AttendanceComponent, path: 'attendance'}, | { component: AttendanceComponent, path: 'attendance'}, | ||||
| @@ -37,8 +37,8 @@ | |||||
| <section class="schedule-details"> | <section class="schedule-details"> | ||||
| <header> {{ selectedDate }}, {{ selectedMonth }} {{ selectedYear }} </header> | <header> {{ selectedDate }}, {{ selectedMonth }} {{ selectedYear }} </header> | ||||
| <ul> | <ul> | ||||
| <li class="progress" [routerLink]="['/quiz']"> | |||||
| <svg-icon [applyClass]="true" class="icon status-icon" src="assets/custom-icons/question-mark.svg"></svg-icon> | |||||
| <li class="progress" [routerLink]="['/tabs/home']"> | |||||
| <svg-icon [applyClass]="true" class="icon status-icon" src="assets/custom-icons/play-button.svg"></svg-icon> | |||||
| <div class="content-holder"> | <div class="content-holder"> | ||||
| <div class="content"> | <div class="content"> | ||||
| <label> Social Science class </label> | <label> Social Science class </label> | ||||
| @@ -93,7 +93,7 @@ | |||||
| <label> Social Science class </label> | <label> Social Science class </label> | ||||
| <p> 4:00 PM to 5:00 PM </p> | <p> 4:00 PM to 5:00 PM </p> | ||||
| </div> | </div> | ||||
| <span class="status"> In Progress </span> | |||||
| <span class="status"> Completed Quiz </span> | |||||
| </div> | </div> | ||||
| </li> | </li> | ||||
| @@ -133,14 +133,14 @@ | |||||
| <header> {{ selectedDate - 2 }}, {{ selectedMonth }} {{ selectedYear }} </header> | <header> {{ selectedDate - 2 }}, {{ selectedMonth }} {{ selectedYear }} </header> | ||||
| <ul> | <ul> | ||||
| <li class="absent" [routerLink]="['/quiz']"> | |||||
| <svg-icon [applyClass]="true" class="icon status-icon" src="assets/custom-icons/question-mark.svg"></svg-icon> | |||||
| <li class="absent" [routerLink]="['/video-chapter', 'Living Things']"> | |||||
| <svg-icon [applyClass]="true" class="icon status-icon" src="assets/custom-icons/close-circle.svg"></svg-icon> | |||||
| <div class="content-holder"> | <div class="content-holder"> | ||||
| <div class="content"> | <div class="content"> | ||||
| <label> Social Science class </label> | <label> Social Science class </label> | ||||
| <p> 4:00 PM to 5:00 PM </p> | <p> 4:00 PM to 5:00 PM </p> | ||||
| </div> | </div> | ||||
| <span class="status"> In Progress </span> | |||||
| <span class="status"> Absent </span> | |||||
| </div> | </div> | ||||
| </li> | </li> | ||||
| @@ -181,5 +181,5 @@ | |||||
| </section> | </section> | ||||
| </section> | </section> | ||||
| <button class="add-button"> <svg-icon [applyClass]="true" class="icon" src="assets/custom-icons/plus.svg"></svg-icon> </button> | |||||
| <button *ngIf="demoType === 'Teacher'" class="add-button"> <svg-icon [applyClass]="true" class="icon" src="assets/custom-icons/plus.svg"></svg-icon> </button> | |||||
| </section> | </section> | ||||
| @@ -17,7 +17,7 @@ export class CalendarComponent implements OnInit { | |||||
| preceedingDays: Array<number> = []; | preceedingDays: Array<number> = []; | ||||
| succeedingDays: Array<number> = []; | succeedingDays: Array<number> = []; | ||||
| selectedMonthDays: Array<number> = []; | selectedMonthDays: Array<number> = []; | ||||
| demoType: string; | |||||
| showAllSchedules: boolean = false; | showAllSchedules: boolean = false; | ||||
| constructor( | constructor( | ||||
| @@ -40,6 +40,7 @@ export class CalendarComponent implements OnInit { | |||||
| } | } | ||||
| ngOnInit(): void { | ngOnInit(): void { | ||||
| this.demoType = localStorage.demoType; | |||||
| this.selectToday(); | this.selectToday(); | ||||
| } | } | ||||
| @@ -1,13 +1,19 @@ | |||||
| <ul class="subject-list"> | <ul class="subject-list"> | ||||
| <li *ngFor="let class of classes" [ngClass]="{'late' : class.attendanceStatus && class.attendanceStatus === 'LATE', | <li *ngFor="let class of classes" [ngClass]="{'late' : class.attendanceStatus && class.attendanceStatus === 'LATE', | ||||
| 'attended' : class.attendanceStatus && class.attendanceStatus === 'PRESENT', | 'attended' : class.attendanceStatus && class.attendanceStatus === 'PRESENT', | ||||
| 'absent' : class.attendanceStatus && class.attendanceStatus === 'ABSENT'}"> | |||||
| 'absent' : class.attendanceStatus && class.attendanceStatus === 'ABSENT', | |||||
| 'ripple' : class.isLive, 'disable' : hasLive && !class.isLive }"> | |||||
| <div class="schedule"> | <div class="schedule"> | ||||
| <label> {{ class.time }} </label> | <label> {{ class.time }} </label> | ||||
| <p> {{ class.duration }} </p> | <p> {{ class.duration }} </p> | ||||
| </div> | </div> | ||||
| <div class="subject"> | <div class="subject"> | ||||
| <label> {{ class.subject }} </label> | <label> {{ class.subject }} </label> | ||||
| <p class="status"> | |||||
| <span *ngIf="class.attendanceStatus && class.attendanceStatus === 'PRESENT'"> Present </span> | |||||
| <span *ngIf="class.attendanceStatus && class.attendanceStatus === 'ABSENT'"> Absent </span> | |||||
| <span *ngIf="class.attendanceStatus && class.attendanceStatus === 'LATE'"> 10 Mins late </span> | |||||
| </p> | |||||
| <p *ngIf="class.teacher.name !== 'You'"> | <p *ngIf="class.teacher.name !== 'You'"> | ||||
| <img [src]="class.teacher.profile_image"> | <img [src]="class.teacher.profile_image"> | ||||
| <span> {{ class.teacher.name }} </span> | <span> {{ class.teacher.name }} </span> | ||||
| @@ -30,6 +30,26 @@ | |||||
| box-shadow: 0px 0px 5px -2px var(--black); | box-shadow: 0px 0px 5px -2px var(--black); | ||||
| position: relative; | position: relative; | ||||
| &.disable { | |||||
| filter: grayscale(70%); | |||||
| pointer-events: none; | |||||
| } | |||||
| &.ripple { | |||||
| box-shadow: none; | |||||
| border: 2px solid var(--teal-green); | |||||
| animation: ripple 1s infinite; | |||||
| } | |||||
| @keyframes ripple { | |||||
| 100% { | |||||
| box-shadow: 0px 0px 1px 20px transparent; | |||||
| } | |||||
| 0% { | |||||
| box-shadow: 0px 0px 1px 0px var(--teal); | |||||
| } | |||||
| } | |||||
| &::before { | &::before { | ||||
| content: ''; | content: ''; | ||||
| position: absolute; | position: absolute; | ||||
| @@ -40,27 +60,48 @@ | |||||
| background-color: transparent; | background-color: transparent; | ||||
| } | } | ||||
| &.attended::before { | |||||
| background-color: var(--teal-green); | |||||
| &.attended { | |||||
| &::before { | |||||
| background-color: var(--teal-green); | |||||
| } | |||||
| .status { | |||||
| color: var(--teal-green); | |||||
| } | |||||
| } | } | ||||
| &.absent::before { | |||||
| background-color: var(--danger); | |||||
| &.absent { | |||||
| &::before { | |||||
| background-color: var(--danger); | |||||
| } | |||||
| .status { | |||||
| color: var(--danger-dark); | |||||
| } | |||||
| } | } | ||||
| &.late::before { | |||||
| background-color: rgba(orange, 0.5); | |||||
| &.late { | |||||
| &::before { | |||||
| background-color: rgba(orange, 0.5); | |||||
| } | |||||
| .status { | |||||
| color: rgba(orange, 0.8); | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| .schedule { | .schedule { | ||||
| width: 80px; | |||||
| padding-right: 15px; | |||||
| width: 100px; | |||||
| text-align: center; | text-align: center; | ||||
| padding: 0 5px; | |||||
| } | } | ||||
| .subject { | .subject { | ||||
| flex-grow: 1; | |||||
| width: calc(100% - 100px); | |||||
| border-left: 1px solid #cecece; | border-left: 1px solid #cecece; | ||||
| padding-left: 15px; | padding-left: 15px; | ||||
| overflow: hidden; | overflow: hidden; | ||||
| @@ -7,11 +7,11 @@ import { Component, OnInit, Input } from '@angular/core'; | |||||
| }) | }) | ||||
| export class ClassCardListComponent implements OnInit { | export class ClassCardListComponent implements OnInit { | ||||
| @Input() classes: any; | @Input() classes: any; | ||||
| @Input() hasLive: boolean; | |||||
| constructor() { } | constructor() { } | ||||
| ngOnInit(): void { | ngOnInit(): void { | ||||
| } | } | ||||
| } | } | ||||
| @@ -27,22 +27,23 @@ | |||||
| <ul class="forum-post-list"> | <ul class="forum-post-list"> | ||||
| <li class="post" *ngFor="let post of forumPostList"> | <li class="post" *ngFor="let post of forumPostList"> | ||||
| <button class="book-mark-button" [ngClass]="{'active' : post.isBookmarked}"> | |||||
| <button class="book-mark-button" [ngClass]="{'active' : post.isBookmarked}" | |||||
| (click)="post.isBookmarked = !post.isBookmarked"> | |||||
| <svg-icon [applyClass]="true" class="icon" src="assets/custom-icons/bookmark.svg"></svg-icon> | <svg-icon [applyClass]="true" class="icon" src="assets/custom-icons/bookmark.svg"></svg-icon> | ||||
| </button> | </button> | ||||
| <div (click)="openPostDetails(post)"> | <div (click)="openPostDetails(post)"> | ||||
| <h5> | <h5> | ||||
| {{ post.question }} | {{ post.question }} | ||||
| </h5> | </h5> | ||||
| <div class="tags"> | |||||
| <!-- <div class="tags"> | |||||
| <button *ngFor="let tag of post.friendTags"> @ {{ tag }} </button> | <button *ngFor="let tag of post.friendTags"> @ {{ tag }} </button> | ||||
| </div> | |||||
| </div> --> | |||||
| <p *ngIf="post.helpLink"> | <p *ngIf="post.helpLink"> | ||||
| <a href="{{ post.helpLink }}" target="_blank"> Link Related to this Topic </a> | <a href="{{ post.helpLink }}" target="_blank"> Link Related to this Topic </a> | ||||
| </p> | </p> | ||||
| <div class="tags"> | |||||
| <!-- <div class="tags"> | |||||
| <button *ngFor="let tag of post.hashTags"> # {{ tag }} </button> | <button *ngFor="let tag of post.hashTags"> # {{ tag }} </button> | ||||
| </div> | |||||
| </div> --> | |||||
| </div> | </div> | ||||
| <div class="author"> | <div class="author"> | ||||
| <img src="{{ post.author.imgSrc }}"> | <img src="{{ post.author.imgSrc }}"> | ||||
| @@ -18,16 +18,17 @@ | |||||
| <li *ngFor="let answerPost of postDetails.answers; let i = index" class="post" | <li *ngFor="let answerPost of postDetails.answers; let i = index" class="post" | ||||
| [ngClass]="{'active' : selectedAnswer === i }"> | [ngClass]="{'active' : selectedAnswer === i }"> | ||||
| <button class="book-mark-button" [ngClass]="{'active' : answerPost.isBookmarked }"> | |||||
| <button class="book-mark-button" [ngClass]="{'active' : answerPost.isBookmarked }" | |||||
| (click)="answerPost.isBookmarked = !answerPost.isBookmarked"> | |||||
| <svg-icon [applyClass]="true" class="icon" src="assets/custom-icons/bookmark.svg"></svg-icon> | <svg-icon [applyClass]="true" class="icon" src="assets/custom-icons/bookmark.svg"></svg-icon> | ||||
| </button> | </button> | ||||
| <div (click)="openSelectedAnswer(i)" id="answer-{{ i }}"> | <div (click)="openSelectedAnswer(i)" id="answer-{{ i }}"> | ||||
| <h5> | <h5> | ||||
| {{ answerPost.answer }} | {{ answerPost.answer }} | ||||
| </h5> | </h5> | ||||
| <div class="tags"> | |||||
| <!-- <div class="tags"> | |||||
| <button *ngFor="let tag of answerPost.friendTags"> @ {{ tag }} </button> | <button *ngFor="let tag of answerPost.friendTags"> @ {{ tag }} </button> | ||||
| </div> | |||||
| </div> --> | |||||
| <p *ngIf="answerPost.helpLink"> | <p *ngIf="answerPost.helpLink"> | ||||
| <a href="{{ answerPost.helpLink }}" target="_blank"> Link Related to this Topic </a> | <a href="{{ answerPost.helpLink }}" target="_blank"> Link Related to this Topic </a> | ||||
| </p> | </p> | ||||
| @@ -206,7 +206,8 @@ export class DemoService { | |||||
| teacher: { | teacher: { | ||||
| name: 'Mr Kashinath Kashyap', | name: 'Mr Kashinath Kashyap', | ||||
| profile_image: 'https://pbs.twimg.com/profile_images/3478244961/01ebfc40ecc194a2abc81e82ab877af4.jpeg' | profile_image: 'https://pbs.twimg.com/profile_images/3478244961/01ebfc40ecc194a2abc81e82ab877af4.jpeg' | ||||
| } | |||||
| }, | |||||
| isLive: true, | |||||
| }, { | }, { | ||||
| time: '3:00 PM', | time: '3:00 PM', | ||||
| duration: '45 Mins', | duration: '45 Mins', | ||||
| @@ -271,7 +272,8 @@ export class DemoService { | |||||
| teacher: { | teacher: { | ||||
| name: 'You', | name: 'You', | ||||
| profile_image: 'https://pbs.twimg.com/profile_images/3478244961/01ebfc40ecc194a2abc81e82ab877af4.jpeg' | profile_image: 'https://pbs.twimg.com/profile_images/3478244961/01ebfc40ecc194a2abc81e82ab877af4.jpeg' | ||||
| } | |||||
| }, | |||||
| isLive: true, | |||||
| }, { | }, { | ||||
| time: '11:00 AM', | time: '11:00 AM', | ||||
| duration: '45 Mins', | duration: '45 Mins', | ||||
| @@ -6,7 +6,7 @@ import { Component, OnInit } from '@angular/core'; | |||||
| styleUrls: ['./test.component.scss'] | styleUrls: ['./test.component.scss'] | ||||
| }) | }) | ||||
| export class TestComponent implements OnInit { | export class TestComponent implements OnInit { | ||||
| testStatus: string = 'PROGRESS'; | |||||
| testStatus: string = 'START'; | |||||
| testData = { | testData = { | ||||
| name: 'CHEMISTRY', | name: 'CHEMISTRY', | ||||
| @@ -9,8 +9,15 @@ | |||||
| <div class="topic-name" *ngIf="classList.length > 0"> | <div class="topic-name" *ngIf="classList.length > 0"> | ||||
| <h2> {{ classList[0].classes[0].subject }} </h2> | <h2> {{ classList[0].classes[0].subject }} </h2> | ||||
| <p> Starts at </p> | |||||
| <div class="counter"> {{ classList[0].classes[0].time }} </div> | |||||
| <p> Starts in </p> | |||||
| <div class="counter"> 00 : 00 : 0{{ secondsCounter }} </div> | |||||
| <div class="checkbox-holder" (click)="joinAutomatically = !joinAutomatically" | |||||
| *ngIf="secondsCounter > 0"> | |||||
| <div class="checkbox" [ngClass]="{'active' : joinAutomatically }"> | |||||
| <span> ✓ </span> | |||||
| </div> | |||||
| <p> Join in automatically </p> | |||||
| </div> | |||||
| </div> | </div> | ||||
| <span class="tutor"> | <span class="tutor"> | ||||
| @@ -22,7 +29,8 @@ | |||||
| <img src="https://pbs.twimg.com/profile_images/3478244961/01ebfc40ecc194a2abc81e82ab877af4.jpeg"> | <img src="https://pbs.twimg.com/profile_images/3478244961/01ebfc40ecc194a2abc81e82ab877af4.jpeg"> | ||||
| <span> {{ classList[0].classes[0].teacher.name }} </span> | <span> {{ classList[0].classes[0].teacher.name }} </span> | ||||
| </div> | </div> | ||||
| <button (click)="showVideo = true" *ngIf="demoType === 'Teacher'" class="go-live-button"> Go Live </button> | |||||
| <button (click)="showVideo = true" *ngIf="demoType === 'Teacher' && hasLive" class="go-live-button"> Go Live </button> | |||||
| <button (click)="showVideo = true" *ngIf="demoType === 'Student' && hasLive" class="go-live-button"> Join </button> | |||||
| </span> | </span> | ||||
| </section> | </section> | ||||
| @@ -100,12 +108,12 @@ | |||||
| </div> | </div> | ||||
| </section> | </section> | ||||
| <div class="card-list-holder"> | |||||
| <div class="card-list-holder" *ngIf="!showClassDetails"> | |||||
| <div class="card-list" *ngFor="let class of classList"> | <div class="card-list" *ngFor="let class of classList"> | ||||
| <header> | <header> | ||||
| <h5> {{ class.date }} </h5> | <h5> {{ class.date }} </h5> | ||||
| </header> | </header> | ||||
| <app-class-card-list [classes]="class.classes"></app-class-card-list> | |||||
| <app-class-card-list [hasLive]="hasLive" [classes]="class.classes"></app-class-card-list> | |||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| @@ -59,7 +59,7 @@ | |||||
| position: sticky; | position: sticky; | ||||
| position: -webkit-sticky; | position: -webkit-sticky; | ||||
| top: 0; | top: 0; | ||||
| z-index: 1; | |||||
| z-index: 2; | |||||
| transition: width 0.5s, border-radius 0.5s; | transition: width 0.5s, border-radius 0.5s; | ||||
| overflow: hidden; | overflow: hidden; | ||||
| height: 35vh; | height: 35vh; | ||||
| @@ -178,6 +178,43 @@ | |||||
| } | } | ||||
| } | } | ||||
| .checkbox-holder { | |||||
| display: flex; | |||||
| align-items: flex-start; | |||||
| justify-content: center; | |||||
| width: 100%; | |||||
| margin: 5px auto; | |||||
| .checkbox { | |||||
| width: 20px; | |||||
| height: 20px; | |||||
| border: 2px solid var(--light-grey); | |||||
| display: flex; | |||||
| align-items: center; | |||||
| justify-content: center; | |||||
| background-color: white; | |||||
| border-radius: 3px; | |||||
| transition: background-color 0.2s, border-color 0.2s; | |||||
| &.active { | |||||
| background-color: var(--teal-green); | |||||
| color: white; | |||||
| border-color: var(--teal-green); | |||||
| } | |||||
| span { | |||||
| font-size: 12px; | |||||
| } | |||||
| } | |||||
| p { | |||||
| color: var(--teal-green); | |||||
| margin-left: 10px; | |||||
| font-size: 14px; | |||||
| line-height: 1.5; | |||||
| } | |||||
| } | |||||
| h2 { | h2 { | ||||
| font-size: 20px; | font-size: 20px; | ||||
| margin-bottom: 5px; | margin-bottom: 5px; | ||||
| @@ -215,11 +252,13 @@ | |||||
| border-radius: 7px; | border-radius: 7px; | ||||
| overflow: hidden; | overflow: hidden; | ||||
| width: 90%; | width: 90%; | ||||
| margin: 20px auto; | |||||
| margin: 1px auto 20px; | |||||
| transition: width 0.5s, border-radius 0.5s; | transition: width 0.5s, border-radius 0.5s; | ||||
| position: sticky; | position: sticky; | ||||
| position: -webkit-sticky; | position: -webkit-sticky; | ||||
| top: 35vh; | top: 35vh; | ||||
| max-height: 50vh; | |||||
| overflow: auto; | |||||
| z-index: 1; | z-index: 1; | ||||
| @media screen and (min-width: 1023px) { | @media screen and (min-width: 1023px) { | ||||
| @@ -252,6 +291,10 @@ | |||||
| height: 45px; | height: 45px; | ||||
| border-radius: 7px; | border-radius: 7px; | ||||
| padding: 0 5%; | padding: 0 5%; | ||||
| position: sticky; | |||||
| position: -webkit-sticky; | |||||
| top: 0; | |||||
| z-index: 1; | |||||
| @media screen and (min-width: 1023px) { | @media screen and (min-width: 1023px) { | ||||
| display: none; | display: none; | ||||
| @@ -313,7 +356,6 @@ | |||||
| width: 90%; | width: 90%; | ||||
| margin: 0 auto; | margin: 0 auto; | ||||
| color: var(--light-grey); | color: var(--light-grey); | ||||
| height: 150px; | |||||
| overflow: auto; | overflow: auto; | ||||
| @media screen and (min-width: 1023px) { | @media screen and (min-width: 1023px) { | ||||
| @@ -330,7 +372,6 @@ | |||||
| list-style: none; | list-style: none; | ||||
| width: 90%; | width: 90%; | ||||
| margin: 0 auto; | margin: 0 auto; | ||||
| height: 150px; | |||||
| overflow: auto; | overflow: auto; | ||||
| a { | a { | ||||
| @@ -9,33 +9,41 @@ import { DemoService } from '../../services/demo.service'; | |||||
| }) | }) | ||||
| export class HomeComponent implements OnInit { | export class HomeComponent implements OnInit { | ||||
| expandVideo: boolean = false; | expandVideo: boolean = false; | ||||
| showClassDetails: boolean; | |||||
| showClassDetails: boolean = false; | |||||
| selectedSegment: string = 'transcript'; | selectedSegment: string = 'transcript'; | ||||
| showVideo: boolean = false; | showVideo: boolean = false; | ||||
| demoType: string; | demoType: string; | ||||
| hasLive: boolean = false; | |||||
| classList = []; | classList = []; | ||||
| secondsCounter: number = 3; | |||||
| timerInterval: any; | |||||
| joinAutomatically: boolean = false; | |||||
| constructor( | constructor( | ||||
| private demoService: DemoService | private demoService: DemoService | ||||
| ) { } | ) { } | ||||
| ngOnInit(): void { | ngOnInit(): void { | ||||
| if (window.innerWidth > 1023) { | |||||
| this.showClassDetails = true; | |||||
| } else { | |||||
| this.showClassDetails = false; | |||||
| } | |||||
| this.demoType = localStorage.demoType; | this.demoType = localStorage.demoType; | ||||
| if (this.demoType === 'Student') { | if (this.demoType === 'Student') { | ||||
| this.classList = this.demoService.studentClassList; | this.classList = this.demoService.studentClassList; | ||||
| this.showVideo = true; | |||||
| } | } | ||||
| if (this.demoType === 'Teacher') { | if (this.demoType === 'Teacher') { | ||||
| this.classList = this.demoService.teacherClassList; | this.classList = this.demoService.teacherClassList; | ||||
| } | } | ||||
| this.timerInterval = setInterval(() => { | |||||
| if (this.secondsCounter > 0) { | |||||
| this.secondsCounter -= 1; | |||||
| } else { | |||||
| clearInterval(this.timerInterval); | |||||
| this.hasLive = true; | |||||
| this.showClassDetails = true; | |||||
| this.joinAutomatically ? this.showVideo = true : this.showVideo = false; | |||||
| } | |||||
| }, 1000); | |||||
| } | } | ||||
| public handleScroll(event: ScrollEvent) { | public handleScroll(event: ScrollEvent) { | ||||
| @@ -10,11 +10,11 @@ | |||||
| </section> | </section> | ||||
| <div class="card-list-holder"> | <div class="card-list-holder"> | ||||
| <div class="card-list" *ngFor="let class of classList"> | |||||
| <header> | |||||
| <div class="card-list" *ngFor="let class of classList; let i = index"> | |||||
| <header id="list-header-{{ i }}" class="white-header"> | |||||
| <h5> {{ class.date }} </h5> | <h5> {{ class.date }} </h5> | ||||
| </header> | </header> | ||||
| <app-class-card-list [classes]="class.classes"></app-class-card-list> | |||||
| <app-class-card-list [hasLive]="hasLive" [classes]="class.classes"></app-class-card-list> | |||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| @@ -5,7 +5,11 @@ | |||||
| .upfold { | .upfold { | ||||
| width: 100%; | width: 100%; | ||||
| color: white; | color: white; | ||||
| position: relative; | |||||
| position: sticky; | |||||
| position: -webkit-sticky; | |||||
| z-index: 1; | |||||
| top: 0; | |||||
| background-color: var(--black); | |||||
| padding: 30px 10% 0 10%; | padding: 30px 10% 0 10%; | ||||
| h1 { | h1 { | ||||
| @@ -40,10 +44,8 @@ | |||||
| margin: 0 auto; | margin: 0 auto; | ||||
| .card-list { | .card-list { | ||||
| &:first-child { | |||||
| header { | |||||
| color: white; | |||||
| } | |||||
| header.white-header { | |||||
| color: var(--light-grey); | |||||
| } | } | ||||
| } | } | ||||
| @@ -54,7 +56,7 @@ | |||||
| h5 { | h5 { | ||||
| font-size: 14px; | font-size: 14px; | ||||
| margin-top: 30px; | margin-top: 30px; | ||||
| font-weight: 500; | |||||
| font-weight: bold; | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -9,12 +9,13 @@ import { DemoService } from '../services/demo.service'; | |||||
| export class WelcomeComponent implements OnInit { | export class WelcomeComponent implements OnInit { | ||||
| classList = []; | classList = []; | ||||
| demoType: string; | demoType: string; | ||||
| hasLive: boolean = false; | |||||
| constructor( | constructor( | ||||
| private demoService: DemoService | private demoService: DemoService | ||||
| ) { } | ) { } | ||||
| ngOnInit(): void { | |||||
| ngOnInit(): void { | |||||
| this.demoType = localStorage.demoType; | this.demoType = localStorage.demoType; | ||||
| if (this.demoType === 'Student') { | if (this.demoType === 'Student') { | ||||
| this.classList = this.demoService.studentClassList; | this.classList = this.demoService.studentClassList; | ||||
| @@ -23,10 +24,14 @@ export class WelcomeComponent implements OnInit { | |||||
| if (this.demoType === 'Teacher') { | if (this.demoType === 'Teacher') { | ||||
| this.classList = this.demoService.teacherClassList; | this.classList = this.demoService.teacherClassList; | ||||
| } | } | ||||
| } | |||||
| ngOnDestroy() { | |||||
| } | |||||
| for (let i = 0; i < this.classList.length; i += 1) { | |||||
| for (let j = 0; j < this.classList[i].classes.length; j += 1) { | |||||
| if (this.classList[i].classes[j].isLive) { | |||||
| this.hasLive = true; | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| } | } | ||||