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.

657 lines
12 KiB
SCSS

@use './reset.scss';
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap');
$media-small-device-size: 750px;
body {
color: #333;
background: #f8f8f8;
// background: #fff;
font-family: 'Inter', sans-serif;
display: flex;
flex-direction: column;
align-items: center;
padding-bottom: 6rem;
}
//
// Utility Classes
//
@keyframes rotating {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
@mixin panel {
background: #fff;
box-shadow: 0 0 8px 0px #0001, 0 0 16px 8px #0001;
border-radius: 0.25rem;
@media screen and (max-width: $media-small-device-size) {
width: 100%;
max-width: 100%;
border-radius: 0;
}
}
@mixin padded-panel {
@include panel;
padding: 2rem;
@media screen and (max-width: $media-small-device-size) {
padding: 1rem;
}
}
.hidden {
display: none !important;
}
//
// Typography
//
// Headings
$base-font-size: 18px;
$heading-scale: 1.33;
@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 5 {
h#{$i} {
font-family: 'Inter', serif;
$factor: pow($heading-scale, 5 - $i);
font-size: $base-font-size * $factor;
font-weight: 600;
}
}
//
// Base Elements
//
a,
a:visited {
color: royalblue;
text-decoration: none;
&:hover {
text-decoration: underline;
}
}
@mixin button-panel {
background: #ddd;
color: #222;
box-shadow: 0 2px 12px 2px #0002, 0 0 2px 0px #0005;
&:hover {
background: #d0d0d0;
}
}
button {
@include button-panel;
border: none;
padding: 0 0.75rem;
height: 2rem;
border-radius: 3px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
&:active {
background: #c4c4c4;
}
&.square {
padding: 0;
width: 2rem;
height: 2rem;
}
}
input[type='text'],
input[type='password'],
textarea {
border: none;
background: #fff;
padding: 0 0.25rem;
min-height: 2rem;
border-radius: 3px;
color: #222;
box-shadow: 0 0 12px 2px #0001, 0 1px 3px 1px #0002;
}
//
// General Page Structure
//
nav {
width: 100%;
height: 4rem;
position: relative;
@include panel;
border-radius: 0;
.nav-group,
.nav-item {
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.left,
.center,
.right {
display: flex;
gap: 1rem;
}
@media screen and (max-width: $media-small-device-size) {
height: unset;
display: flex;
flex-direction: column;
.nav-group {
height: 4rem;
}
}
@media screen and (min-width: $media-small-device-size) {
.left,
.center,
.right {
position: absolute;
}
.left {
left: 0;
padding-left: 1rem;
}
.center {
left: 50%;
transform: translate(-50%, 0);
font-size: 22px;
}
.right {
right: 0;
padding-right: 1rem;
}
}
}
main {
width: 100%;
@media screen and (min-width: $media-small-device-size) {
max-width: 80ch;
}
padding-top: 2rem;
display: flex;
flex-direction: column;
align-items: center;
gap: 2rem;
}
.form {
@include padded-panel;
display: grid;
grid-template-columns: auto 1fr;
gap: 0 1rem;
.error {
color: #d00;
}
.fill-row {
grid-column: 1 / span 2;
place-self: center;
}
.gap-above-s {
margin-top: 0.5rem;
}
.gap-above-l {
margin-top: 1rem;
}
input[type='text'],
input[type='password'],
textarea {
width: 100%;
}
button {
padding: 0 1.5rem;
}
@media screen and (max-width: $media-small-device-size) {
grid-template-columns: 1fr;
.fill-row {
grid-column: 1 / span 1;
}
}
}
.room-diagram {
--posto-libero-bg: #ddd;
--posto-occupato-bg: #d88;
--posto-mio-occupato-bg: #8d8;
@include padded-panel;
display: flex;
flex-direction: column;
align-items: center;
gap: 1rem;
@media screen and (min-width: $media-small-device-size) {
width: 450px;
}
.room-grid {
// To absolutely position a canvas underneath and render grid lines
position: relative;
z-index: 0;
display: grid;
grid-template-columns: repeat(15, 1fr);
grid-template-rows: repeat(16, 1fr);
gap: 4px;
padding: 4px;
aspect-ratio: 15 / 16;
width: 100%;
.posto {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
background: #f0f0f0;
&.mio {
background: var(--posto-mio-occupato-bg);
}
&.libero {
background: var(--posto-libero-bg);
}
&.occupato {
background: var(--posto-occupato-bg);
}
border: 4px solid #0004;
cursor: pointer;
&:hover {
border-color: #0008;
border-width: 4px;
}
line-height: 1;
&:not(.mio, .libero, .occupato) {
&::before {
font-size: 12px;
content: '';
animation: rotating 1s linear infinite;
}
&::after {
content: none;
}
}
&::before {
font-size: 12px;
content: 'Posto';
}
&::after {
font-size: 12px;
content: attr(data-index);
}
}
}
.room-seat-list {
display: flex;
flex-direction: column;
gap: 0.5rem;
width: 100%;
.seat-item {
display: grid;
grid-template-columns: 1fr auto;
}
}
}
//
// Time Table
//
.time-table {
@include padded-panel;
display: flex;
flex-direction: column;
gap: 1rem;
width: 100%;
.controls {
display: flex;
width: 100%;
gap: 1rem;
justify-content: space-between;
.group {
display: flex;
gap: 1rem;
}
align-items: center;
}
.weekly {
display: flex;
width: 100%;
gap: 0.75rem;
.day {
display: flex;
flex-direction: column;
width: 100%;
gap: 0.5rem;
.title {
display: flex;
flex-direction: column;
align-items: center;
font-weight: 600;
}
.slot {
@include button-panel;
width: 100%;
min-height: 5rem;
padding: 0.25rem;
font-size: 13px;
user-select: none;
cursor: pointer;
.counter {
font-size: 18px;
}
}
}
}
}
//
// Tooltip
//
body {
position: relative;
#tooltip {
position: absolute;
left: 0;
right: 0;
padding: 0.25rem;
width: fit-content;
font-size: 14px;
line-height: 1;
opacity: 0.8;
background: #666;
color: #ddd;
left: var(--x, -100px);
top: var(--y, -100px);
z-index: 100;
user-select: none;
pointer-events: none;
}
}
// .panel {
// border: 1px solid #ddd;
// background: #fff;
// }
// main {
// display: flex;
// flex-direction: column;
// gap: 2rem;
// align-items: center;
// padding: 2rem 1rem 2rem;
// .room-name {
// display: flex;
// align-items: center;
// justify-content: center;
// font-size: 26px;
// font-weight: bold;
// }
// .room-main {
// display: grid;
// grid-template-columns: auto 1fr;
// grid-template-rows: auto auto;
// grid-template-areas:
// 'diagram bookings'
// 'timeline timeline';
// max-width: 800px;
// .room-diagram {
// grid-area: diagram;
// }
// .room-bookings {
// grid-area: bookings;
// }
// .room-timeline {
// grid-area: timeline;
// }
// gap: 1rem;
// .room-diagram {
// padding: 1rem;
// // --posto-libero-bg: #ddf;
// // --posto-libero-bg-1: #88f;
// // --posto-libero-bg-2: #66d;
// --posto-libero-bg: #8d8;
// --posto-occupato-bg: #d88;
// display: grid;
// grid-template-columns: repeat(15, 1fr);
// grid-template-rows: repeat(16, 1fr);
// gap: 0.25rem;
// aspect-ratio: 15 / 16;
// width: calc(15 * 2rem);
// max-width: 500px;
// .posto {
// display: flex;
// align-items: center;
// justify-content: center;
// flex-direction: column;
// &.libero {
// background: var(--posto-libero-bg);
// }
// &.occupato {
// background: var(--posto-occupato-bg);
// }
// border: 2px solid #0004;
// cursor: pointer;
// &:hover {
// border-color: #0006;
// border-width: 4px;
// }
// line-height: 1;
// &::before {
// font-size: 12px;
// content: 'Posto';
// }
// &::after {
// font-size: 12px;
// content: attr(data-index);
// }
// }
// }
// .room-bookings {
// display: flex;
// flex-direction: column;
// min-width: 15rem;
// width: 100%;
// padding: 0.75rem 0;
// .seat-list {
// display: flex;
// flex-direction: column;
// .seat {
// padding: 0.25rem 1rem;
// display: grid;
// grid-template-columns: 1fr auto;
// height: 2.5rem;
// &:hover {
// background: #0001;
// }
// .name {
// display: flex;
// align-items: center;
// }
// &.selected {
// background: #0002;
// .name {
// font-style: italic;
// }
// }
// }
// }
// }
// .room-timeline {
// padding: 1rem;
// display: flex;
// flex-direction: row;
// gap: 0.5rem;
// align-items: center;
// overflow-x: auto;
// button {
// min-width: 8rem;
// height: 3rem;
// }
// }
// }
// }
// @media screen and (max-width: $media-small-device-size) {
// header {
// height: unset;
// display: flex;
// flex-direction: column;
// .nav-cell {
// position: relative;
// padding: 0 1rem;
// }
// }
// main {
// .room-main {
// display: flex;
// flex-direction: column;
// .room-diagram {
// width: 200px;
// }
// .room-timeline {
// flex-direction: column;
// }
// }
// }
// }