Skip to content
Snippets Groups Projects
Commit 84051603 authored by D3B1RUM4N's avatar D3B1RUM4N
Browse files

feat: community page

Co-authored-by: henri.hartz
parent 400134fb
1 merge request!53feat: community page
Pipeline #303751 passed with stages
in 42 seconds
.containerGlobal {
display: flex;
}
.containerGlobal {
height: 100%;
width: 100%;
......@@ -9,6 +13,10 @@
.containerLeft {
height: 100%;
width: 50%;
padding-inline: 2%;
display: flex;
flex-direction: column;
justify-content: 'space-between';
}
.containerRight {
......@@ -17,27 +25,25 @@
background-image: url(../../../../../public/BackgroundSubScreen.png);
background-repeat: no-repeat;
background-size: cover;
display: flex;
/* display: flex;
flex-direction: column;
align-items: center;
padding-top: 2vmin;
padding-left: 75px;
align-items: center; */
}
.list {
.container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
flex-grow: 3;
overflow-y: auto;
overflow-x: hidden;
flex-wrap: nowrap;
/* scrollbar-color: rebeccapurple gray; */
--sb-track-color: #f3f3f3;
--sb-thumb-color: #ffffff;
--sb-size: 14px;
padding-top: 1%;
padding-bottom: 1%;
border-radius: 25px;
background-color: #fff;
box-shadow: 0 0 0.5% rgba(0, 0, 0, 0.1);
width: 100%;
height: 70%;
flex-grow: 0;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
border: 1vmin solid #F3F3F3;
}
\ No newline at end of file
......@@ -2,20 +2,16 @@
<div class="containerGlobal">
<div class="containerLeft">
<h1>Community quiz</h1>
<input (keyup)="filter()" [(ngModel)]="filterText" type="text" placeholder="Search a quiz" class="inputRecherche" />
<div class="list">
<div class="scrollable-list" *ngFor="let quiz of quizzes">
<app-quiz-list-detail
[title]="quiz.id"
[nbQuestions]="quiz.questions.length"
[difficulty]="quiz.difficulty.name"
[creator]="quiz.author ?? 'Anonymous'"
/>
<input (keyup)="filter()" [(ngModel)]="filterText" type="text" placeholder="Search a quiz"
class="inputRecherche" />
<div class="container">
<div class="scrollable-list">
<app-quiz-list [quizList]="quizList"></app-quiz-list>
</div>
</div>
</div>
<div class="containerRight">
<div class="quiz-detail"><app-quiz-detail [codeQuiz]="clickedQuiz"></app-quiz-detail></div>
<app-quiz-list-detail />
</div>
</div>
</div>
......@@ -33,7 +29,7 @@
<!--<tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>-->
<!-- <mat-paginator
<!-- <mat-paginator
(page)="onPageChange($event)"
[pageSize]="take"
[pageIndex]="skip"
......
......@@ -7,14 +7,15 @@ import { filter } from 'rxjs';
@Component({
selector: 'app-list-quiz',
templateUrl: './list-quiz.component.html',
styleUrls: ['./list-quiz.component.css','../../../../styles.css'],
styleUrls: ['./list-quiz.component.css', '../../../../styles.css'],
})
export class ListQuizComponent implements OnInit {
//listQuizDataSource = new MatTableDataSource();
quizzes: any[] = []
quizList: any[] = [];
//displayedColumns = ['Component'];
constructor(private communityService: CommunityService) {}
constructor(private communityService: CommunityService) { }
codeQuiz: string = '';
skip: number = 0;
take: number = 10;
......@@ -36,6 +37,10 @@ export class ListQuizComponent implements OnInit {
//this.listQuizDataSource.data = data;
this.quizzes = data;
this.totalQuiz = data.length;
this.quizzes.map((quiz => {
this.quizList.push({ title: !quiz.name ? 'Untitled' : quiz.name, content: `${quiz.questions.length} QUESTIONS | ${quiz.difficulty.name} | ${!quiz.author ? 'Anonymous' : quiz.author}` })
}))
},
});
}
......
.main-container {
height: 10%;
width: 100%;
background-color: #F3F3F3;
border-radius: 8;
.container {
display: flex;
flex-direction: column;
justify-content: space-evenly;
height: calc(100% - 2vmin);
width: calc(100% - 100px);
gap: 1rem;
padding-left: 100px;
}
/* Titre */
.container h1 {
font-size: 1.8em;
color: #333;
text-align: center;
/* margin-bottom: 1.5rem; */
margin: 0;
font-weight: 500;
}
.quiz-info {
display: flex;
flex-direction: column;
justify-content: space-between;
height: 30vh;
background-color: #FEFEFE;
border-radius: 10px;
gap: 1rem;
}
.quiz-info-content {
display: flex;
flex-direction: row;
gap: 0.6rem;
padding-left: 10%;
}
.quiz-title {
display: flex;
flex-direction: column;
align-items: center;
}
hr {
width: 70%;
padding-left: 15%;
height: 0.5vmin;
margin: 0;
background-color: #B9B9B9;
border: none;
}
\ No newline at end of file
<div class="main-container">
<h4>{{ title }}</h4>
<p class="description">
{{ nbQuestions }} QUESTIONS | {{ difficulty.toUpperCase() }} | {{ creator.toUpperCase() }}
</p>
<div class="container">
<div class="quiz-detail">
<h1>{{ quiz.title }}</h1>
<h2>{{ quiz.content }}</h2>
</div>
<div class="quiz-info">
<div class="quiz-title">
<p class="quiz-info-title">About this quiz</p>
<hr />
</div>
<div class="quiz-info-content">
<p class="quiz-info-content-value">{{quiz.nbQuestions}} Questions, {{quiz.difficulty}}</p>
</div>
</div>
<div class="new-quiz">
<button class="blueButton" (click)="playQuiz()">Go !</button>
</div>
</div>
\ No newline at end of file
......@@ -3,11 +3,27 @@ import { Component, Input } from '@angular/core';
@Component({
selector: 'app-quiz-list-detail',
templateUrl: './quiz-list-detail.component.html',
styleUrls: ['./quiz-list-detail.component.css','../../../../styles.css'],
styleUrls: ['./quiz-list-detail.component.css', '../../../../styles.css'],
})
export class QuizListDetailComponent {
@Input() title: string = '';
@Input() nbQuestions: number = 0;
@Input() difficulty: string = '';
@Input() creator: string = '';
quiz: any
ngOnInit(): void {
this.quiz = {
title: "Quiz de la mort qui tue",
content: "un quiz de la mort qui tue",
difficulty: "hard",
creator: "Klebert",
nbQuestions: 10
}
}
playQuiz() {
console.log('play quiz');
}
}
......@@ -45,12 +45,7 @@
height: 89%;
}
.scrollable-list {
/* max-height: 95%; */
overflow-y: auto;
overflow-x: hidden;
}
.form-group {
width: 100%;
......
......@@ -18,8 +18,7 @@
/* Styles génériques */
button {
width: 100%;
/* margin-bottom: 1%; */
height: 8vh;
width: 90%;
flex-shrink: 0;
margin: 1%;
......
......@@ -171,4 +171,11 @@ h1 {
.scrollable-list::-webkit-scrollbar-thumb:hover {
background-color: #555;
}
.scrollable-list {
/* max-height: 95%; */
overflow-y: auto;
overflow-x: hidden;
}
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment