mirror of
https://github.com/alvierahman90/capitals_quiz.git
synced 2024-11-23 17:59:55 +00:00
211 lines
3.2 KiB
CSS
211 lines
3.2 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 .5s;
|
|
}
|
|
|
|
.incorrect {
|
|
animation: incorrect .5s;
|
|
}
|
|
|
|
@keyframes correct {
|
|
0% { background: var(--default-bg); }
|
|
50% { background: var(--green); }
|
|
100% { background: var(--default-bg); }
|
|
}
|
|
|
|
@keyframes incorrect {
|
|
0% { background: var(--default-bg); }
|
|
50% { background: var(--red); }
|
|
100% { background: var(--default-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;
|
|
}
|
|
|
|
#score {
|
|
--good: var(--green);
|
|
--okay: var(--yellow);
|
|
--bad: var(--red);
|
|
background: var(--good);
|
|
}
|
|
|
|
#time {
|
|
background: var(--blue);
|
|
}
|
|
|
|
#gameinfo {
|
|
display: flex;
|
|
}
|
|
|
|
#gameinfo * {
|
|
margin: 0 0.5em 0 0.5em;
|
|
}
|
|
|
|
#previousQuestionAnswer { background: var(--green) }
|
|
|
|
#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);
|
|
}
|
|
|
|
#b {
|
|
background-color: var(--b-color);
|
|
border-color: var(--b-color);
|
|
}
|
|
|
|
#c {
|
|
background-color: var(--c-color);
|
|
border-color: var(--c-color);
|
|
}
|
|
|
|
#d {
|
|
background-color: var(--d-color);
|
|
border-color: var(--d-color);
|
|
}
|
|
|
|
span#questionCountry {
|
|
background-color: var(--question-country-color);
|
|
}
|
|
|
|
span#questionCapital {
|
|
background-color: var(--question-capital-color);
|
|
}
|
|
|
|
#region_selector {
|
|
width: 100%;
|
|
background: var(--dark-bg);
|
|
font-size: 1.5em;
|
|
padding: 1em;
|
|
border: none;
|
|
border-radius: 0.25em;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
#settings {
|
|
width: 100%
|
|
}
|
|
|
|
#selector_results {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
justify-content: center;
|
|
}
|
|
|
|
#settings .selector_result {
|
|
margin: 1em;
|
|
}
|
|
|
|
/* 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: .4s;
|
|
transition: .4s;
|
|
}
|
|
|
|
.slider:before {
|
|
position: absolute;
|
|
content: "";
|
|
height: 26px;
|
|
width: 26px;
|
|
left: 4px;
|
|
bottom: 4px;
|
|
background-color: white;
|
|
-webkit-transition: .4s;
|
|
transition: .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;;
|
|
}
|