Skip to content

Commit

Permalink
edit result style and marked style
Browse files Browse the repository at this point in the history
  • Loading branch information
a7med3sam committed Jul 16, 2024
1 parent b39e043 commit 67ef14d
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 8 deletions.
Binary file added congratulation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 40 additions & 4 deletions css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ body {
#notfound {
position: relative;
height: 100vh;
background-color: #fafbfd;
background-color: #f1f1f1;
}

#notfound .notfound {
Expand Down Expand Up @@ -44,7 +44,7 @@ body {
width: 100%;
background: #fff;
border-radius: 90px;
height: 125px;
height: 140px;
}

.notfound .notfound-bg > div:nth-child(1) {
Expand Down Expand Up @@ -85,18 +85,40 @@ body {
margin: 0;
font-weight: 700;
color: #151515;
/* color: #269a48; */
font-size: 33px;
}


#image-stauts{
width: 150px;
margin: 10px 0;
}
.score{
font-size: 20px;
}

.score #score-number{
display: inline-block;
padding: 10px 30px;
border-radius: 20px;
color: white;
}

@media only screen and (max-width: 767px) {
.notfound .notfound-bg {
width: 287px;
margin: auto;
margin: 0 auto;
}

.notfound .notfound-bg > div {
height: 85px;
height: 140px;
width: 320px;
}
#resultMessage {
font-size: 18px;
}

}

@media only screen and (max-width: 480px) {
Expand All @@ -107,4 +129,18 @@ body {
.notfound h2 {
font-size: 18px;
}
.notfound .notfound-bg > div {


border-radius: 90px;
height: 140px;
}
.score {
font-size: 13px;
}

.notfound h2 {
font-size: 32px;
margin-bottom: 20px;
}
}
Binary file added fail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 12 additions & 1 deletion js/result.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,22 @@
const score = urlParams.get('score');
const scoreDisplay = document.getElementById('score');
const resultMessage = document.getElementById('resultMessage');
const image = document.getElementById("image-stauts");
const head2 = document.getElementById("head2");
const scoreNumber = document.getElementById("score-number");

scoreDisplay.textContent = score;

if (score >= 6) {
resultMessage.textContent = 'Congratulations! You passed the quiz.';
head2.style.color = "#269a48";
resultMessage.style.color = "#269a48";
scoreNumber.style.backgroundColor = "#269a48";
image.src = "congratulation.png";
} else {
resultMessage.textContent = 'Sorry! You did not pass the quiz. Please try again.';
resultMessage.textContent = 'Sorry! You did not pass the quiz.';
head2.style.color = "#de0909";
scoreNumber.style.backgroundColor = "#de0909";
resultMessage.style.color = "#de0909";
image.src = "fail.png";
}
7 changes: 5 additions & 2 deletions result.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@
<div></div>
<div></div>
</div>
<h2>Quiz Result</h2>
<h2 id="head2">Quiz Result</h2>
<div>
<img id="image-stauts" src="" alt="">
</div>
<div class="score">
<p>Your score is: <strong id="score"></strong></p>
<p id="score-number">Your score is: <strong id="score"></strong></p>
<p id="resultMessage"></p>
</div>
</div>
Expand Down
5 changes: 4 additions & 1 deletion style/quiz.css
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,11 @@ label {
.marked-question {
cursor: pointer;
padding: 10px;
border-bottom: 1px solid #2d1414;
text-align: center;
background-color: #f2be42;
margin: 20px 5px;
border-radius: 5px;

}

.title-ques {
Expand Down

0 comments on commit 67ef14d

Please sign in to comment.