Skip to content

Commit

Permalink
Merge pull request #1496 from rahulkhandait-sde/quit-btn
Browse files Browse the repository at this point in the history
Add quit button styling to quiz page
  • Loading branch information
akshitagupta15june authored Mar 26, 2024
2 parents 49c43cb + b6f1ade commit a4fdbb0
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
34 changes: 33 additions & 1 deletion quiz_page/quiz.css
Original file line number Diff line number Diff line change
Expand Up @@ -379,4 +379,36 @@ footer button.show{
border-radius: 50%;
object-fit: cover;
}



/* This CSS styles a "quit" button, including its position, size, color, and hover effect. */
.quit_btn{
position: absolute;
left:30rem;
bottom: 1.3rem;
}

footer .quit_btn{
position: relative;
height: 40px;
padding: 0 13px;
margin-right: 15px;
font-size: 18px;
font-weight: 400;
cursor: pointer;
border: none;
outline: none;
color: #fff;
border-radius: 5px;
background: #ff0000;
border: 1px solid #ff0000;
line-height: 10px;
opacity: 1;
pointer-events: auto;
transform: scale(0.95);
transition: all 0.3s ease;
}

footer .quit_btn:hover{
background: #ca0202 !important;
}
1 change: 1 addition & 0 deletions quiz_page/quiz.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
<div class="total_que">

</div>
<button class="quit_btn">Quit Quiz</button>
<button class="next_btn">Next Ques</button>
</footer>
</div>
Expand Down
6 changes: 6 additions & 0 deletions quiz_page/quiz.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ restart_quiz.onclick = ()=>{
quit_quiz.onclick = ()=>{
window.location.reload();
}

const quit_btn = document.querySelector("footer .quit_btn");
quit_btn.onclick = ()=>{
quiz_box.classList.remove("activeQuiz");
}

const next_btn = document.querySelector("footer .next_btn");
const bottom_ques_counter = document.querySelector("footer .total_que");

Expand Down

0 comments on commit a4fdbb0

Please sign in to comment.