flashcards/assets/main.css

162 lines
2.3 KiB
CSS
Raw Normal View History

:root {
--text: white;
--correct: limegreen;
--correct-shadow: green;
--fail: crimson;
--fail-shadow: red;
--hover: gray;
--selection: goldenrod;
--selection-shadow: gold;
}
body {
background-color: #0f1116;
color: var(--text);
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
margin: 0px;
overflow-x: hidden;
}
#counter {
margin: 10px;
font-size: 20px;
> div {
display: inline-block;
&.correct {
color: var(--correct);
text-shadow: var(--correct-shadow) 0px 0px 30px;
}
&.wrong {
color: var(--fail);
text-shadow: var(--fail-shadow) 0px 0px 30px;
}
&:not(:last-child)::after {
color: var(--text);
content: "/";
}
}
}
#result {
display: none;
position: absolute;
width: 100%;
font-size: 40vw;
margin: auto;
text-align: center;
line-height: 1;
opacity: 0;
user-select: none;
&.visible {
display: block;
animation: 200ms fade-in forwards;
}
&.correct {
color: var(--correct);
text-shadow: var(--correct-shadow) 0px 0px 30px;
}
&.wrong {
color: var(--fail);
text-shadow: var(--fail-shadow) 0px 0px 30px;
}
}
@keyframes fade-in {
0% {
opacity: 0;
display: none;
}
100% {
opacity: 1;
display: block;
}
}
form {
width: 100%;
text-align: center;
display: flex;
flex-direction: column;
font-size: 24px;
user-select: none;
h1 {
text-wrap: balance;
&.correct {
color: var(--correct);
text-shadow: var(--correct-shadow) 0px 0px 30px;
}
&.wrong {
color: var(--fail);
text-shadow: var(--fail-shadow) 0px 0px 30px;
}
}
> div {
width: 100%;
height: 80px;
display: flex;
margin-top: 10px;
align-items: center;
align-self: center;
box-sizing: border-box;
border: solid 2px unset;
text-wrap: balance;
&.selected {
border: solid 2px var(--selection);
box-shadow: 0px 0px 13px -5px var(--selection-shadow);
}
&:hover:not(.selected) {
border: solid 1px var(--hoveer);
}
> input[type="checkbox"] {
display: none;
scale: 1.5;
margin-right: 10px;
}
> label {
flex-grow: 1;
}
&:hover,
> *:hover {
cursor: pointer;
}
}
> input[type="submit"] {
margin-top: 40px;
height: 70px;
background-color: transparent;
border: none;
color: white;
font-size: 42px;
&:hover {
font-size: 48px;
color: var(--selection);
cursor: pointer;
}
&:focus {
outline: none;
}
}
}