$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; font-family: 'Lato', sans-serif; font-weight: 300; font-size: 18px; color: #222; line-height: 1; } textarea { border: none; outline: gray; width: 100%; padding: 1rem; box-shadow: -2px 4px 6px 1px #00000018, 0 0 4px 0px #00000010; 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; border-radius: 0.25rem; background: #ffffff; font-family: 'Lato'; font-weight: 400; font-size: 16px; 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); } } button, .button { // reset link styles text-decoration: none; display: grid; place-content: center; height: 38px; cursor: pointer; font-family: 'Lato'; font-weight: 600; font-size: 16px; color: #555; border: 1px solid #c8c8c8; padding: 0.5rem 1.5rem; box-shadow: -2px 2px 16px 0 #00000010; border-radius: 0.25rem; background: linear-gradient(180deg, #f0f0f0, #e8e8e8 20%, #e0e0e0 90%, #cdcdcd); 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); } &.compact { padding: 0.35rem; font-size: 15px; } &:disabled { cursor: default; opacity: 0.4; 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.125rem; display: grid; place-content: center; .material-symbols-outlined { font-size: 19px; } } .table .cell & { padding: 0.3rem 1rem; } } .link, a:not(.button), a:not(.button):visited { cursor: pointer; color: var(--accent); text-decoration: none; &:hover { text-decoration: underline; } } // // Typography // .mono { font-family: monospace; font-size: 90%; } .icon-text { display: flex; align-items: center; gap: 0.5rem; } hr { width: 100%; max-width: 100ch; height: 1px; background: #ccc; border: none; margin: 0; } .vr { height: 100%; width: 1px; background: #ccc; } .dotted { cursor: help; border-bottom: 2px dotted #555; } .math-inline { font-size: 95%; } p { margin: 0; } 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; } } // // Components // .row { display: flex; gap: 0.5rem; align-items: center; @media screen and (max-width: $device-s-width), (pointer: coarse) { flex-direction: column; width: 100%; } } .text-body { font-family: 'EB Garamond', serif; font-weight: 400; font-size: 18px; line-height: 1.41; b, strong { font-weight: 600; } } // // Structure // body { display: flex; flex-direction: column; align-items: center; background: #f8f8f8; } main { padding: 2rem 2rem 6rem; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 2rem; .col { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; } .title { font-size: 32px; } .subtitle { font-size: 28px; } .info { font-size: 20px; display: grid; grid-template-columns: auto auto; gap: 1rem; } .info-box { padding: 1rem; font-size: 28px; box-shadow: -2px 4px 6px 1px #00000018, 0 0 4px 0px #00000010; border-radius: 0.5rem; background: #ffffff; } .fill-main { display: flex; gap: 0.5rem; width: 100%; max-width: 80ch; } } main.page-home { .board { width: 100%; // min-width: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(auto, 71ch)); 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; } } main.page-scores { .table { grid-template-columns: repeat(3, auto); .icon { cursor: pointer; display: grid; place-content: center; } .cell { padding: 1rem 2rem 1rem 1rem; &.header { font-weight: 400; font-size: 22px; padding-right: 0.5rem; background: #f0f0f0; display: flex; gap: 1rem; align-items: center; text-align: center; justify-content: space-between; } &:nth-child(3) { border-top-right-radius: 0.5rem; } &:nth-last-child(3) { border-bottom-left-radius: 0.5rem; } } } } // // Components // .scrollable { display: flex; overflow: auto; max-width: 100%; padding: 1rem; } .table { display: grid; grid-template-columns: repeat(var(--cols), auto); box-shadow: -2px 4px 6px 1px #00000018, 0 0 4px 0px #00000010; border: 1px solid #ddd; border-radius: 0.5rem; background: #ffffff; user-select: none; .cell { padding: 0.75rem; white-space: nowrap; border-right: 1px solid #ddd; border-bottom: 1px solid #ddd; display: flex; gap: 0.75rem; align-items: center; justify-content: start; &:first-child { border-top-left-radius: 0.5rem; } &:last-child { border-bottom-right-radius: 0.5rem; } &.last-col { border-right: none; } &.last-row { border-bottom: none; } &.header { font-weight: 400; padding-right: 1rem; background: #f0f0f0; display: flex; align-items: center; text-align: center; justify-content: space-between; } &:not(.header) { user-select: text; } } @media screen and (max-width: $device-s-width), (pointer: coarse) { .cell { padding: 0.5rem; gap: 0.5rem; &.header { padding: 0.75rem 0.5rem; } } } } details { width: 100%; max-width: 80ch; } .solution-list { display: flex; flex-direction: column; align-items: center; gap: 1rem; width: 100%; max-width: 80ch; .controls { display: flex; width: 100%; gap: 1rem; } } header { display: grid; place-content: center; width: 100%; position: relative; padding: 2rem 0; // border-bottom: 1px solid #ddd; box-shadow: 0 0 0.5rem 0 #00000028; background: #fdfdfd; .logo { z-index: 1; font-size: 42px; font-family: 'Lato'; font-weight: 300; a:hover { text-decoration: none; border-bottom: 3px solid var(--accent); } } nav { position: absolute; width: 100%; height: 100%; z-index: 0; .nav-left { gap: 1rem; display: flex; height: 100%; align-items: center; position: absolute; left: 2rem; } .nav-right { gap: 1rem; display: flex; height: 100%; align-items: center; position: absolute; right: 2rem; } .nav-item { font-size: 20px; font-weight: 300; a.active { border-bottom: 1px solid var(--accent); } a:hover { text-decoration: none; border-bottom: 2px solid var(--accent); } } } } .problem { padding: 1rem; max-width: 80ch; box-shadow: -2px 4px 6px 1px #00000018, 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; flex-grow: 1; } .problem-footer { font-size: 16px; } } .solution { padding: 1rem 0.5rem 0.5rem 1rem; width: 100%; max-width: 80ch; box-shadow: -2px 4px 6px 1px #00000018, 0 0 4px 0px #00000010; border-radius: 0.5rem; background: #ffffff; display: flex; flex-direction: column; gap: 0.5rem; transition: all 100ms ease-in-out; &.correct { border: 4px solid #00aa00; } &.wrong { border: 4px solid #cc0000; } .solution-header { display: grid; grid-template-columns: auto; gap: 0.25rem; font-size: 18px; line-height: 1.25; } .solution-content { @extend .text-body; pre, code { margin: 0; font-family: 'DM Mono', monospace; font-size: 16px; background: #f0f0f0; } pre { padding: 0.25rem; overflow-x: auto; border-radius: 0.25rem; white-space: break-spaces; } padding-right: 0.5rem; } .solution-footer { display: flex; justify-content: end; font-size: 16px; .label { font-weight: 400; } .pending { color: #1653a3; font-style: italic; } .correct { color: green; // font-weight: 400; } .wrong { color: darkred; // font-weight: 400; } .status-label { user-select: none; text-align: right; } } } .form { min-width: 50ch; max-width: 80ch; background: #f0f0f0; display: grid; grid-template-columns: auto 1fr; box-shadow: -2px 4px 6px 1px #00000018, 0 0 4px 0px #00000010; border: 1px solid #ddd; border-radius: 0.5rem; padding: 1.5rem 2rem 1rem; gap: 1rem; align-items: center; .fill { grid-column: span 2; justify-self: center; } } .markdown-editor { display: grid; width: 100%; grid-template-columns: repeat(2, 1fr); gap: 1rem; .editor, .preview { width: 100%; max-width: 70ch; display: flex; flex-direction: column; align-items: center; gap: 1rem; } .editor { justify-self: end; textarea { font-family: 'DM Mono', monospace; font-size: 16px; resize: none; overflow-y: hidden; min-height: 8rem; } } .preview { justify-self: start; .placeholder { color: #666; } .preview-content { @extend .text-body; width: 100%; padding: 1rem; box-shadow: -2px 4px 6px 1px #00000018, 0 0 4px 0px #00000010; border-radius: 0.25rem; background: #ffffff; } } } // // Pages // main.page-admin { .problem-title { @extend .row; } .users-table { @extend .table; grid-template-columns: auto 1fr auto auto; .cell { &:nth-child(4) { border-top-right-radius: 0.5rem; } &:nth-last-child(4) { border-bottom-left-radius: 0.5rem; } } } } // // Mobile // // Not on mobile @media screen and (min-width: $device-s-width) and (pointer: fine) { // ... } // On mobile @media screen and (max-width: $device-s-width), (pointer: coarse) { main { padding: 2rem 1rem 6rem; &.page-home { .board { gap: 1rem; } } } header { display: flex; flex-direction: column; align-items: center; gap: 2rem; padding: 1rem; nav { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1rem; .nav-left, .nav-right { left: unset; right: unset; position: relative; flex-direction: column; } } } .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; } } textarea, .markdown-editor .preview .preview-content { padding: 0.75rem; } .solution { .solution-content { pre { white-space: pre-line; word-break: break-all; } } } } @media screen and (max-width: $device-m-width), (pointer: coarse) { .markdown-editor { grid-template-columns: auto; grid-template-rows: auto auto; .preview, .editor { justify-self: center; } } }