capitals_quiz/game_styles.css

209 lines
3.1 KiB
CSS
Raw Normal View History

2021-04-10 14:02:36 +00:00
:root {
--a-color: var(--red);
--b-color: var(--yellow);
--c-color: var(--green);
--d-color: var(--blue);
--question-country-color: var(--teal);
2022-01-13 20:10:47 +00:00
--question-capital-color: var(--blue);
}
input {
font-family: inherit
2021-04-10 14:02:36 +00:00
}
2021-04-11 14:04:52 +00:00
.correct {
animation: correct .5s;
2021-04-11 14:04:52 +00:00
}
.incorrect {
animation: incorrect .5s;
2021-04-11 14:04:52 +00:00
}
@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); }
}
2021-04-11 17:03:01 +00:00
#toprow {
2021-04-10 14:02:36 +00:00
display: flex;
justify-content: space-between;
align-items: center;
}
@media only screen and (max-width: 600px) {
2021-04-11 17:03:01 +00:00
#toprow {
2021-04-10 14:02:36 +00:00
flex-direction: column-reverse;
}
}
2021-04-11 17:03:01 +00:00
#question {
2021-04-10 14:02:36 +00:00
font-size: 1.5em;
}
2021-04-11 17:03:01 +00:00
#score {
2021-04-10 14:02:36 +00:00
--good: var(--green);
--okay: var(--yellow);
--bad: var(--red);
2021-04-11 17:03:01 +00:00
background: var(--good);
2021-04-10 14:02:36 +00:00
}
2021-12-01 15:11:20 +00:00
#time {
background: var(--blue);
}
#gameinfo {
display: flex;
}
#gameinfo * {
margin: 0 0.5em 0 0.5em;
}
#previousQuestionAnswer { background: var(--green) }
2021-04-10 14:02:36 +00:00
#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;
2021-04-10 14:02:36 +00:00
border-radius: 0.25em;
}
2021-04-11 17:03:01 +00:00
#a {
2021-04-10 14:02:36 +00:00
background-color: var(--a-color);
border-color: var(--a-color);
}
2021-04-11 17:03:01 +00:00
#b {
2021-04-10 14:02:36 +00:00
background-color: var(--b-color);
border-color: var(--b-color);
}
2021-04-11 17:03:01 +00:00
#c {
2021-04-10 14:02:36 +00:00
background-color: var(--c-color);
border-color: var(--c-color);
}
2021-04-11 17:03:01 +00:00
#d {
2021-04-10 14:02:36 +00:00
background-color: var(--d-color);
border-color: var(--d-color);
}
span#questionCountry {
background-color: var(--question-country-color);
}
2021-04-11 14:04:52 +00:00
2022-01-13 20:10:47 +00:00
span#questionCapital {
background-color: var(--question-capital-color);
}
2021-04-11 14:04:52 +00:00
#settings {
width: 100%
}
2022-01-13 23:27:52 +00:00
#regionList {
2021-04-11 14:04:52 +00:00
display: flex;
flex-wrap: wrap;
2021-04-11 17:03:01 +00:00
justify-content: center;
2021-04-11 14:04:52 +00:00
}
2022-01-13 23:27:52 +00:00
#settings .regionListItem {
2022-01-13 20:35:02 +00:00
padding: 1em;
transition: 0.5s;
}
2022-01-13 23:27:52 +00:00
#settings .regionListItem:hover {
2022-01-13 20:35:02 +00:00
background: #d9d9d9;
color: black;
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;
}
.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;;
}
2022-01-13 20:35:02 +00:00