mirror of
https://github.com/alvierahman90/capitals_quiz.git
synced 2024-11-23 17:59:55 +00:00
265 lines
3.9 KiB
CSS
265 lines
3.9 KiB
CSS
:root {
|
|
--a-color: var(--red);
|
|
--b-color: var(--yellow);
|
|
--c-color: var(--green);
|
|
--d-color: var(--blue);
|
|
--question-country-color: var(--teal);
|
|
--question-capital-color: var(--blue);
|
|
}
|
|
|
|
input {
|
|
font-family: inherit;
|
|
}
|
|
|
|
.correct {
|
|
animation: correct 0.5s;
|
|
}
|
|
|
|
.incorrect {
|
|
animation: incorrect 0.5s;
|
|
}
|
|
|
|
@keyframes correct {
|
|
0% {
|
|
background: var(--bg);
|
|
}
|
|
50% {
|
|
background: var(--green);
|
|
}
|
|
100% {
|
|
background: var(--bg);
|
|
}
|
|
}
|
|
|
|
@keyframes incorrect {
|
|
0% {
|
|
background: var(--bg);
|
|
}
|
|
50% {
|
|
background: var(--red);
|
|
}
|
|
100% {
|
|
background: var(--bg);
|
|
}
|
|
}
|
|
|
|
#toprow {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
}
|
|
|
|
@media only screen and (max-width: 600px) {
|
|
#toprow {
|
|
flex-direction: column-reverse;
|
|
}
|
|
}
|
|
|
|
#question {
|
|
font-size: 1.5em;
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
|
|
#question img {
|
|
max-height: 10vh;
|
|
}
|
|
|
|
#question * {
|
|
margin: 1em;
|
|
}
|
|
|
|
#score {
|
|
--good: var(--green);
|
|
--okay: var(--yellow);
|
|
--bad: var(--red);
|
|
background: var(--good);
|
|
color: var(--dark);
|
|
}
|
|
|
|
#time {
|
|
background: var(--blue);
|
|
color: var(--dark);
|
|
}
|
|
|
|
#gameinfo {
|
|
display: flex;
|
|
}
|
|
|
|
#gameinfo * {
|
|
margin: 0 0.5em 0 0.5em;
|
|
}
|
|
|
|
#previousQuestionAnswer {
|
|
background: var(--green);
|
|
color: var(--dark);
|
|
}
|
|
|
|
#game .answer {
|
|
display: flex;
|
|
justify-content: space-evenly;
|
|
align-items: center;
|
|
align-content: center;
|
|
}
|
|
|
|
#game .answer .text {
|
|
width: 50%;
|
|
}
|
|
|
|
#game .answer .letter {
|
|
font-size: 1.5em;
|
|
padding: 1em;
|
|
border: 0;
|
|
border-radius: 0.25em;
|
|
}
|
|
|
|
#a {
|
|
background-color: var(--a-color);
|
|
border-color: var(--a-color);
|
|
color: var(--dark);
|
|
}
|
|
|
|
#b {
|
|
background-color: var(--b-color);
|
|
border-color: var(--b-color);
|
|
color: var(--dark);
|
|
}
|
|
|
|
#c {
|
|
background-color: var(--c-color);
|
|
border-color: var(--c-color);
|
|
color: var(--dark);
|
|
}
|
|
|
|
#d {
|
|
background-color: var(--d-color);
|
|
border-color: var(--d-color);
|
|
color: var(--dark);
|
|
}
|
|
|
|
span#questionCountry {
|
|
background-color: var(--question-country-color);
|
|
color: var(--dark);
|
|
}
|
|
|
|
span#questionCapital {
|
|
background-color: var(--question-capital-color);
|
|
color: var(--dark);
|
|
}
|
|
|
|
#settings {
|
|
width: 100%;
|
|
}
|
|
|
|
#regionList {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
justify-content: center;
|
|
}
|
|
|
|
#settings .regionListItem {
|
|
padding: 1em;
|
|
transition: 0.5s;
|
|
}
|
|
|
|
#settings .regionListItem:hover {
|
|
background: var(--light);
|
|
color: var(--dark);
|
|
}
|
|
|
|
/* toggle switches */
|
|
/* https://www.w3schools.com/howto/tryit.asp?filename=tryhow_css_switch */
|
|
.switch {
|
|
position: relative;
|
|
display: inline-block;
|
|
width: 60px;
|
|
height: 34px;
|
|
}
|
|
|
|
.switch input {
|
|
opacity: 0;
|
|
width: 0;
|
|
height: 0;
|
|
}
|
|
|
|
.slider {
|
|
position: absolute;
|
|
cursor: pointer;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
background-color: var(--question-country-color);
|
|
-webkit-transition: 0.4s;
|
|
transition: 0.4s;
|
|
}
|
|
|
|
.slider:before {
|
|
position: absolute;
|
|
content: "";
|
|
height: 26px;
|
|
width: 26px;
|
|
left: 4px;
|
|
bottom: 4px;
|
|
background-color: white;
|
|
-webkit-transition: 0.4s;
|
|
transition: 0.4s;
|
|
}
|
|
|
|
input:checked + .slider {
|
|
background-color: var(--question-capital-color);
|
|
}
|
|
|
|
input:focus + .slider {
|
|
box-shadow: 0 0 1px var(--blue);
|
|
}
|
|
|
|
input:checked + .slider:before {
|
|
-webkit-transform: translateX(26px);
|
|
-ms-transform: translateX(26px);
|
|
transform: translateX(26px);
|
|
}
|
|
|
|
/* Rounded sliders */
|
|
.slider.round {
|
|
border-radius: 34px;
|
|
}
|
|
|
|
.slider.round:before {
|
|
border-radius: 50%;
|
|
}
|
|
|
|
#questionTypeSelector {
|
|
display: flex;
|
|
width: 100%;
|
|
align-items: center;
|
|
justify-content: space-around;
|
|
margin-top: 3em;
|
|
margin-bottom: 3em;
|
|
}
|
|
|
|
.text img,
|
|
td img {
|
|
max-height: 15vh;
|
|
}
|
|
|
|
#questionTypeSelector input[type="radio"] {
|
|
display: none;
|
|
}
|
|
input[type="radio"] + label {
|
|
padding: 0.5em;
|
|
}
|
|
input[type="radio"]:checked + label {
|
|
background-color: var(--yellow);
|
|
color: var(--dark);
|
|
}
|
|
|
|
#previousQuestionAnswer {
|
|
display: inline;
|
|
}
|
|
|
|
#previousQuestionAnswer img {
|
|
display: inline;
|
|
max-height: 2em;
|
|
}
|