capitals_quiz/game_styles.css

265 lines
3.9 KiB
CSS
Raw Permalink Normal View History

2021-04-10 14:02:36 +00:00
:root {
2022-01-19 20:37:49 +00:00
--a-color: var(--red);
--b-color: var(--yellow);
--c-color: var(--green);
--d-color: var(--blue);
2022-04-13 16:38:06 +00:00
--question-country-color: var(--base16-teal);
2022-01-19 20:37:49 +00:00
--question-capital-color: var(--blue);
2022-01-13 20:10:47 +00:00
}
input {
2022-01-19 20:37:49 +00:00
font-family: inherit;
2021-04-10 14:02:36 +00:00
}
2021-04-11 14:04:52 +00:00
.correct {
2022-01-19 20:37:49 +00:00
animation: correct 0.5s;
2021-04-11 14:04:52 +00:00
}
.incorrect {
2022-01-19 20:37:49 +00:00
animation: incorrect 0.5s;
2021-04-11 14:04:52 +00:00
}
@keyframes correct {
2022-01-19 20:37:49 +00:00
0% {
2022-04-13 01:59:24 +00:00
background: var(--bg);
2022-01-19 20:37:49 +00:00
}
50% {
background: var(--green);
}
100% {
2022-04-13 01:59:24 +00:00
background: var(--bg);
2022-01-19 20:37:49 +00:00
}
2021-04-11 14:04:52 +00:00
}
@keyframes incorrect {
2022-01-19 20:37:49 +00:00
0% {
2022-04-13 02:00:40 +00:00
background: var(--bg);
2022-01-19 20:37:49 +00:00
}
50% {
background: var(--red);
}
100% {
2022-04-13 02:00:40 +00:00
background: var(--bg);
2022-01-19 20:37:49 +00:00
}
2021-04-11 14:04:52 +00:00
}
2021-04-11 17:03:01 +00:00
#toprow {
2022-01-19 20:37:49 +00:00
display: flex;
justify-content: space-between;
align-items: center;
2021-04-10 14:02:36 +00:00
}
@media only screen and (max-width: 600px) {
2022-01-19 20:37:49 +00:00
#toprow {
flex-direction: column-reverse;
}
2021-04-10 14:02:36 +00:00
}
2021-04-11 17:03:01 +00:00
#question {
2022-01-19 20:37:49 +00:00
font-size: 1.5em;
display: flex;
align-items: center;
2022-01-14 01:49:34 +00:00
}
#question img {
2022-01-19 20:37:49 +00:00
max-height: 10vh;
2022-01-14 01:49:34 +00:00
}
#question * {
2022-01-19 20:37:49 +00:00
margin: 1em;
2021-04-10 14:02:36 +00:00
}
2021-04-11 17:03:01 +00:00
#score {
2022-01-19 20:37:49 +00:00
--good: var(--green);
--okay: var(--yellow);
--bad: var(--red);
background: var(--good);
2022-04-13 01:55:01 +00:00
color: var(--dark);
2021-04-10 14:02:36 +00:00
}
2021-12-01 15:11:20 +00:00
#time {
2022-01-19 20:37:49 +00:00
background: var(--blue);
2022-04-13 01:55:01 +00:00
color: var(--dark);
2021-12-01 15:11:20 +00:00
}
#gameinfo {
2022-01-19 20:37:49 +00:00
display: flex;
2021-12-01 15:11:20 +00:00
}
#gameinfo * {
2022-01-19 20:37:49 +00:00
margin: 0 0.5em 0 0.5em;
2021-12-01 15:11:20 +00:00
}
2022-01-19 20:37:49 +00:00
#previousQuestionAnswer {
background: var(--green);
2022-04-13 02:00:40 +00:00
color: var(--dark);
2022-01-19 20:37:49 +00:00
}
2021-04-10 14:02:36 +00:00
#game .answer {
2022-01-19 20:37:49 +00:00
display: flex;
justify-content: space-evenly;
align-items: center;
align-content: center;
2021-04-10 14:02:36 +00:00
}
#game .answer .text {
2022-01-19 20:37:49 +00:00
width: 50%;
2021-04-10 14:02:36 +00:00
}
#game .answer .letter {
2022-01-19 20:37:49 +00:00
font-size: 1.5em;
padding: 1em;
border: 0;
border-radius: 0.25em;
2021-04-10 14:02:36 +00:00
}
2021-04-11 17:03:01 +00:00
#a {
2022-01-19 20:37:49 +00:00
background-color: var(--a-color);
border-color: var(--a-color);
2022-04-13 01:57:14 +00:00
color: var(--dark);
2021-04-10 14:02:36 +00:00
}
2021-04-11 17:03:01 +00:00
#b {
2022-01-19 20:37:49 +00:00
background-color: var(--b-color);
border-color: var(--b-color);
2022-04-13 01:57:14 +00:00
color: var(--dark);
2021-04-10 14:02:36 +00:00
}
2021-04-11 17:03:01 +00:00
#c {
2022-01-19 20:37:49 +00:00
background-color: var(--c-color);
border-color: var(--c-color);
2022-04-13 01:57:14 +00:00
color: var(--dark);
2021-04-10 14:02:36 +00:00
}
2021-04-11 17:03:01 +00:00
#d {
2022-01-19 20:37:49 +00:00
background-color: var(--d-color);
border-color: var(--d-color);
2022-04-13 01:57:14 +00:00
color: var(--dark);
2021-04-10 14:02:36 +00:00
}
span#questionCountry {
2022-01-19 20:37:49 +00:00
background-color: var(--question-country-color);
2022-04-13 01:57:14 +00:00
color: var(--dark);
2021-04-10 14:02:36 +00:00
}
2021-04-11 14:04:52 +00:00
2022-01-13 20:10:47 +00:00
span#questionCapital {
2022-01-19 20:37:49 +00:00
background-color: var(--question-capital-color);
2022-04-13 01:57:14 +00:00
color: var(--dark);
2022-01-13 20:10:47 +00:00
}
2021-04-11 14:04:52 +00:00
#settings {
2022-01-19 20:37:49 +00:00
width: 100%;
2021-04-11 14:04:52 +00:00
}
2022-01-13 23:27:52 +00:00
#regionList {
2022-01-19 20:37:49 +00:00
display: flex;
flex-wrap: wrap;
justify-content: center;
2021-04-11 14:04:52 +00:00
}
2022-01-13 23:27:52 +00:00
#settings .regionListItem {
2022-01-19 20:37:49 +00:00
padding: 1em;
transition: 0.5s;
2022-01-13 20:35:02 +00:00
}
2022-01-13 23:27:52 +00:00
#settings .regionListItem:hover {
2022-04-13 01:55:01 +00:00
background: var(--light);
color: var(--dark);
2021-04-11 14:04:52 +00:00
}
2022-01-13 20:10:47 +00:00
/* toggle switches */
/* https://www.w3schools.com/howto/tryit.asp?filename=tryhow_css_switch */
.switch {
position: relative;
display: inline-block;
width: 60px;
height: 34px;
}
2022-01-19 20:37:49 +00:00
.switch input {
2022-01-13 20:10:47 +00:00
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);
2022-01-19 20:37:49 +00:00
-webkit-transition: 0.4s;
transition: 0.4s;
2022-01-13 20:10:47 +00:00
}
.slider:before {
position: absolute;
content: "";
height: 26px;
width: 26px;
left: 4px;
bottom: 4px;
background-color: white;
2022-01-19 20:37:49 +00:00
-webkit-transition: 0.4s;
transition: 0.4s;
2022-01-13 20:10:47 +00:00
}
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 {
2022-01-19 20:37:49 +00:00
display: flex;
width: 100%;
align-items: center;
justify-content: space-around;
margin-top: 3em;
margin-bottom: 3em;
2022-01-13 20:10:47 +00:00
}
2022-01-13 20:35:02 +00:00
2022-01-19 20:37:49 +00:00
.text img,
td img {
max-height: 15vh;
}
2022-01-14 02:18:58 +00:00
2022-01-19 20:37:49 +00:00
#questionTypeSelector input[type="radio"] {
display: none;
}
input[type="radio"] + label {
padding: 0.5em;
2022-01-14 02:18:58 +00:00
}
2022-01-19 20:37:49 +00:00
input[type="radio"]:checked + label {
background-color: var(--yellow);
2022-04-13 01:55:01 +00:00
color: var(--dark);
2022-01-14 02:18:58 +00:00
}
2022-01-19 20:35:33 +00:00
#previousQuestionAnswer {
2022-01-19 20:37:49 +00:00
display: inline;
2022-01-19 20:35:33 +00:00
}
#previousQuestionAnswer img {
2022-01-19 20:37:49 +00:00
display: inline;
max-height: 2em;
2022-01-19 20:35:33 +00:00
}