iswhoa/public/style.css
2025-06-20 14:00:23 +02:00

155 lines
2.4 KiB
CSS

div.offscreen {
position: fixed;
left: -100px;
top: -100px;
}
div.question.reveal label {
transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
label:has(input[type=radio]) {
width: 100%;
border-style: solid;
border-color: var(--border);
border-width: 1px;
border-radius: var(--standard-border-radius);
text-align: center;
position: relative;
margin-block: 0.5em;
padding-block: 0.4em;
font-size: 0.9em;
font-weight: bold;
box-sizing: border-box;
cursor: pointer;
}
label:has(input[type=radio]):hover {
border-color: var(--accent-hover);
color: var(--accent-hover);
}
label:has(input[type=radio]:disabled):hover {
border-color: var(--border);
color: var(--text);
}
label:has(input[type=radio]:checked) {
color: var(--accent-text);
background-color: var(--accent);
}
label:has(input[type=radio].answer:checked) {
background: green;
color: white;
}
label:has(input[type=radio].answer) {
border-color: green;
color: green;
border-width: 2px;
padding-block: calc(0.4em - 1px);
}
label:has(input[type=radio].wrong:checked) {
background: red;
color: white;
border-color: grey;
}
label i {
position: absolute;
left: 6px;
display: none;
}
label:has(input[type=radio].wrong:checked) i,
label:has(input[type=radio].answer) i {
display: inline-block;
}
input[type=radio] {
visibility: hidden;
height: 0;
width: 0;
padding: 0;
margin: 0;
margin-inline-start: -1px;
}
.hidden {
display: none !important;
}
/**
* Page transition
*/
@view-transition {
navigation: auto;
}
@keyframes move-out {
from {
transform: translateX(0%);
}
to {
transform: translateX(-100%);
}
}
@keyframes move-in {
from {
transform: translateX(100%);
}
to {
transform: translateX(0%);
}
}
@keyframes fade-out {
from {
opacity: 100%;
}
to {
opacity: 0;
}
}
@keyframes fade-in {
from {
opacity: 0;
}
to {
opacity: 100%;
}
}
/* Apply the custom animation to the old and new page states */
::view-transition-old(root) {
animation: 0.3s ease-in both move-out;
}
::view-transition-new(root) {
animation: 0.3s ease-in both move-in;
}
@media (prefers-reduced-motion: reduce) {
::view-transition-old(root) {
animation: 0.3s ease-in both fade-out;
}
::view-transition-new(root) {
animation: 0.3s ease-in both fade-in;
}
}