Skip to content

Commit

Permalink
Preparation for Classic mode implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
nayakrujul committed Jun 29, 2024
1 parent 3b93e76 commit d2a1bf8
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
15 changes: 14 additions & 1 deletion scripts/folders-classic.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
let full_terms_list = [];
let randomised_terms = [];

function set_progress_bar_background(val, col) {
document.getElementById("progress-bar-container").style.background =
`linear-gradient(to right, ${col} ${val * 100}%, var(--other-colour) ${(1 - val) * 100}%)`;
}

function folders_start_classic(terms) {
full_terms_list = [...terms];
randomised_terms = random_shuffle(terms);

let classic_div = document.createElement("div");
classic_div.innerHTML = `
<div id="progress-bar-div">
<div id="progress-bar-container"></div>
<span id="progress-bar-text">0/0 (0.00%)</span>
</div>
<h1 id="classic-question">
<span id="classic-question-text"></span>
<button class="start-button" id="finish-button">Finish!</button>
</h1>
<input type="text" id="classic-input" placeholder="Type the definition here..." />
`;
classic_div.id = "classic-div";
document.getElementById("content")
Expand Down
30 changes: 30 additions & 0 deletions styles/folders.css
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,28 @@ div#classic-div {
box-sizing: border-box;
width: 100%;
height: 50%;

div#progress-bar-div {
height: 25px;

* {
height: 25px;
display: inline-block;
}

div#progress-bar-container {
box-sizing: border-box;
width: calc(100% - 150px);
border: 2px solid;
border-radius: 12.5px;
background: white;
}

span#progress-bar-text {
float: right;
font-size: 20px;
}
}
}

@media (max-width: 999px) {
Expand Down Expand Up @@ -376,6 +398,10 @@ body.light-theme {
color: beige;
border: 3px solid black;
}

div#progress-bar-container {
--other-colour: #ffffff;
}
}

body.dark-theme {
Expand Down Expand Up @@ -471,6 +497,10 @@ body.dark-theme {
background-color: #333333;
color: #e0f0f0;
}

div#progress-bar-container {
--other-colour: #111111;
}
}

@keyframes correct {
Expand Down

0 comments on commit d2a1bf8

Please sign in to comment.