You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

638 lines
10 KiB
SCSS

2 years ago
$device-s-width: 640px;
$device-m-width: 1200px;
:root {
--accent: #7b3a99;
}
// Normalize
*,
*::before,
*::after {
box-sizing: border-box;
}
html,
body {
width: 100%;
height: 100%;
min-height: 100%;
margin: 0;
2 years ago
font-family: 'Lato', sans-serif;
2 years ago
font-weight: 300;
font-size: 18px;
2 years ago
line-height: 1;
}
2 years ago
textarea {
border: none;
outline: gray;
width: 100%;
padding: 1rem;
box-shadow: -2px 4px 8px 1px #00000010, 0 0 4px 0px #00000010;
2 years ago
border-radius: 0.25rem;
background: #ffffff;
}
label {
font-weight: 400;
}
input[type='text'] {
border: none;
outline: gray;
width: 100%;
padding: 0.5rem;
box-shadow: -2px 4px 4px 0 #00000010;
2 years ago
border-radius: 0.25rem;
background: #ffffff;
font-family: 'Lato';
font-weight: 400;
font-size: 16px;
2 years ago
color: #555;
}
.input-select {
display: inline-flex;
align-items: center;
justify-content: space-between;
cursor: pointer;
font-family: 'Lato';
font-weight: 600;
font-size: 16px;
color: #555;
border: 1px solid #c8c8c8;
padding: 0;
margin: 0;
box-shadow: -2px 2px 16px 0 #00000010;
border-radius: 0.25rem;
background: linear-gradient(180deg, #f0f0f0, #e8e8e8 20%, #e0e0e0 90%, #cdcdcd);
&:hover {
border: 1px solid #c4c4c4;
box-shadow: -2px 2px 20px 0 #00000010;
background: linear-gradient(180deg, #fff, #ededed 20%, #e8e8e8 90%, #c0c0c0);
}
select {
cursor: pointer;
height: 100%;
appearance: none;
transform: translate(0, -0.0625rem);
padding: 0.35rem 0 0.35rem 0.35rem;
margin: 0;
border: none;
outline: none;
background: none;
font-family: 'Lato';
font-weight: 600;
font-size: 16px;
color: #555;
}
.material-symbols-outlined {
display: grid;
place-content: center;
width: 1.75rem;
height: 1.75rem;
transform: translate(0, 0.0625rem);
}
}
2 years ago
button {
cursor: pointer;
font-family: 'Lato';
font-weight: 600;
font-size: 16px;
2 years ago
color: #555;
border: 1px solid #c8c8c8;
padding: 0.5rem 2rem;
box-shadow: -2px 2px 16px 0 #00000010;
2 years ago
border-radius: 0.25rem;
background: linear-gradient(180deg, #f0f0f0, #e8e8e8 20%, #e0e0e0 90%, #cdcdcd);
2 years ago
transition: all 100ms ease-in;
&:hover {
border: 1px solid #c4c4c4;
box-shadow: -2px 2px 20px 0 #00000010;
background: linear-gradient(180deg, #fff, #ededed 20%, #e8e8e8 90%, #c0c0c0);
2 years ago
}
&.compact {
padding: 0.35rem;
font-size: 15px;
}
&:disabled {
cursor: default;
opacity: 0.6;
filter: grayscale(1);
&:hover {
border: 1px solid #c8c8c8;
box-shadow: -2px 2px 16px 0 #00000010;
background: linear-gradient(180deg, #f0f0f0, #e8e8e8 20%, #e0e0e0 90%, #cdcdcd);
}
}
&.icon {
padding: 0.25rem;
display: grid;
place-content: center;
.material-symbols-outlined {
font-size: 20px;
}
}
2 years ago
}
.link,
a,
a:visited {
cursor: pointer;
color: var(--accent);
2 years ago
text-decoration: none;
&:hover {
text-decoration: underline;
}
}
//
// Typography
//
.math-inline {
font-size: 95%;
}
p {
margin: 0;
}
2 years ago
p + p {
margin-top: 0.5rem;
}
$base-font-size: 16px;
$heading-scale: 1.25;
@function pow($number, $exponent) {
$value: 1;
@if $exponent > 0 {
@for $i from 1 through $exponent {
$value: $value * $number;
}
}
@return $value;
}
@for $i from 1 through 4 {
h#{$i} {
margin: 0;
$factor: pow($heading-scale, 4 - $i);
font-size: $base-font-size * $factor;
font-weight: 500;
&:not(:first-child) {
padding-top: 0.5rem * $factor;
}
line-height: 1;
}
}
2 years ago
//
// Components
//
.text-body {
font-family: 'EB Garamond', serif;
font-weight: 400;
font-size: 18px;
2 years ago
line-height: 1.41;
b,
strong {
font-weight: 600;
}
}
//
// Structure
//
body {
display: flex;
flex-direction: column;
align-items: center;
background: #f8f8f8;
2 years ago
}
2 years ago
2 years ago
main {
padding: 2rem 2rem 6rem;
width: 100%;
2 years ago
2 years ago
display: flex;
flex-direction: column;
align-items: center;
gap: 2rem;
.subtitle {
font-size: 22px;
2 years ago
}
.fill-main {
display: flex;
gap: 0.5rem;
width: 100%;
max-width: 80ch;
}
2 years ago
}
main.page-home {
2 years ago
.board {
width: 100%;
// min-width: 0;
2 years ago
display: grid;
grid-template-columns: repeat(auto-fit, minmax(auto, 70ch));
2 years ago
gap: 2rem;
justify-content: center;
.fill-row {
grid-column: 1 / -1;
}
.board-controls {
justify-self: start;
}
}
}
main.page-problem {
summary {
padding: 1rem;
text-align: center;
user-select: none;
}
2 years ago
}
2 years ago
//
// Components
//
details {
width: 100%;
max-width: 80ch;
}
.solution-list {
width: 100%;
display: flex;
flex-direction: column;
2 years ago
align-items: center;
gap: 1rem;
}
header {
display: grid;
place-content: center;
2 years ago
width: 100%;
position: relative;
2 years ago
.logo {
font-size: 42px;
font-family: 'Lato';
font-weight: 300;
2 years ago
a:hover {
text-decoration: none;
border-bottom: 3px solid var(--accent);
}
}
2 years ago
nav {
position: absolute;
right: 0;
display: flex;
gap: 1rem;
height: 100%;
align-items: center;
.nav-item {
font-size: 20px;
font-weight: 300;
a.active {
border-bottom: 1px solid var(--accent);
}
2 years ago
a:hover {
text-decoration: none;
border-bottom: 2px solid var(--accent);
}
2 years ago
}
}
}
2 years ago
.problem {
padding: 1rem;
max-width: 80ch;
box-shadow: -2px 4px 8px 1px #00000010, 0 0 4px 0px #00000010;
border-radius: 0.5rem;
background: #ffffff;
display: flex;
flex-direction: column;
gap: 0.5rem;
.problem-header {
display: grid;
grid-template-columns: auto;
gap: 0.25rem;
.problem-title {
font-size: 22px;
font-weight: 400;
}
}
.problem-content {
@extend .text-body;
}
.problem-footer {
font-size: 16px;
}
}
.solution {
padding: 1rem;
2 years ago
width: 100%;
max-width: 80ch;
2 years ago
box-shadow: -2px 4px 8px 1px #00000010, 0 0 4px 0px #00000010;
border-radius: 0.5rem;
background: #ffffff;
2 years ago
display: flex;
flex-direction: column;
gap: 0.5rem;
2 years ago
2 years ago
transition: all 100ms ease-in-out;
&.correct {
2 years ago
border: 4px solid #00aa00;
}
&.wrong {
2 years ago
border: 4px solid #cc0000;
}
.solution-header {
display: grid;
grid-template-columns: auto;
gap: 0.25rem;
2 years ago
font-size: 18px;
}
2 years ago
.solution-content {
@extend .text-body;
}
.solution-footer {
display: flex;
justify-content: end;
font-size: 16px;
.label {
font-weight: 400;
}
.row {
display: flex;
gap: 0.5rem;
align-items: center;
}
.pending {
color: #1653a3;
font-style: italic;
}
.correct {
color: green;
// font-weight: 400;
}
.wrong {
color: darkred;
// font-weight: 400;
}
.status-label {
text-align: right;
}
}
}
2 years ago
.form {
min-width: 50ch;
2 years ago
background: #e0e0e0;
2 years ago
display: grid;
grid-template-columns: auto 1fr;
2 years ago
border: 1px solid #c0c0c0;
border-radius: 1rem;
2 years ago
// box-shadow: -2px 4px 16px 4px #00000018, -2px 4px 4px 1px #00000018;
2 years ago
padding: 1.5rem 2rem 1rem;
gap: 1rem;
2 years ago
align-items: center;
2 years ago
.fill {
grid-column: span 2;
justify-self: center;
2 years ago
}
}
2 years ago
.markdown-editor {
display: grid;
width: 100%;
grid-template-columns: repeat(2, 1fr);
gap: 1rem;
2 years ago
.editor,
.preview {
width: 100%;
max-width: 70ch;
2 years ago
display: flex;
flex-direction: column;
align-items: center;
2 years ago
2 years ago
gap: 1rem;
}
2 years ago
.editor {
justify-self: end;
2 years ago
textarea {
font-family: 'DM Mono', monospace;
font-size: 16px;
resize: none;
overflow-y: hidden;
min-height: 8rem;
2 years ago
}
}
2 years ago
.preview {
justify-self: start;
.placeholder {
color: #666;
}
.preview-content {
@extend .text-body;
width: 100%;
padding: 1rem;
box-shadow: -2px 4px 8px 1px #00000010, 0 0 4px 0px #00000010;
border-radius: 0.25rem;
background: #ffffff;
}
}
2 years ago
}
2 years ago
2 years ago
//
// Mobile
//
2 years ago
2 years ago
// Not on mobile
@media screen and (min-width: $device-s-width) and (pointer: fine) {
// ...
}
2 years ago
2 years ago
// On mobile
@media screen and (max-width: $device-s-width), (pointer: coarse) {
main {
padding: 1rem 1rem 6rem;
&.page-home {
.board {
gap: 1rem;
}
}
}
header {
display: flex;
flex-direction: column;
align-items: center;
gap: 2rem;
nav {
position: relative;
right: unset;
display: flex;
flex-direction: column;
align-items: center;
}
}
.problem {
padding: 0.75rem;
}
.markdown-editor {
grid-template-columns: auto;
grid-template-rows: auto auto;
}
.form {
width: 100%;
padding: 1rem;
min-width: unset;
display: flex;
flex-direction: column;
label {
align-self: start;
2 years ago
}
2 years ago
}
textarea,
.markdown-editor .preview .preview-content {
padding: 0.75rem;
}
2 years ago
}
2 years ago
@media screen and (max-width: $device-m-width), (pointer: coarse) {
.markdown-editor {
grid-template-columns: auto;
grid-template-rows: auto auto;
2 years ago
.preview,
.editor {
justify-self: center;
2 years ago
}
}
2 years ago
}