Skip to content

Commit af3c883

Browse files
author
francois_lannoy
committed
✨ It's now possible to play a quizz
1 parent 93f27a2 commit af3c883

File tree

2 files changed

+25
-11
lines changed

2 files changed

+25
-11
lines changed

front/src/components/Play.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,10 @@ export default function Play(){
6868
setAnswered(true);
6969

7070
/* Checking if the quizz is over */
71-
if (currentidx<questions.length-1){
72-
$('#next-button').css('visibility', 'visible');
73-
}else{
74-
$('#finish-button').css('visibility', 'visible');
75-
76-
}
71+
if (currentidx<questions.length-1)
72+
{$('#next-button').css('visibility', 'visible');}
73+
else
74+
{$('#finish-button').css('visibility', 'visible');}
7775
}else{
7876

7977
}

front/src/components/css/play.css

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
#play-container {
22
text-align: center;
3+
position: relative;
34
}
45

56
#quizz-title>h2{
67
font-size: 3em;
78
}
89

9-
#question>h2{
10+
#score{
11+
position: absolute;
12+
top: 0;
13+
right: 5%;
14+
}
15+
16+
17+
#question>h2, #score>h2{
1018
font-size: 2em;
1119
}
1220

@@ -17,6 +25,7 @@
1725
}
1826

1927
.answer{
28+
position: relative;
2029
border-radius: 10px;
2130
height: 100%;
2231
width: 80%;
@@ -26,22 +35,29 @@
2635
padding-top: 12%;
2736
margin: 0 auto;
2837
margin-bottom: 10%;
38+
cursor: pointer;
2939
}
3040
.answer:hover{
3141
filter: brightness(1.13)
3242
}
3343

44+
.answer:active{
45+
filter: brightness(1);
46+
}
47+
3448
.answer>h2{
3549
font-size: 2em;
3650
padding: unset;
3751
margin: unset;
3852
}
3953

4054
.answer>i{
41-
position: static;
42-
bottom: 0;
43-
right: 0;
44-
/* visibility: hidden; */
55+
position: absolute;
56+
bottom: 16%;
57+
right: 5%;
58+
height: 2%;
59+
width: 2%;
60+
visibility: hidden;
4561
}
4662

4763
#answer0{background-color: #3BDB32;}

0 commit comments

Comments
 (0)