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.
orario/src/styles/main.scss

1292 lines
28 KiB
SCSS

*,
*::before,
*::after {
box-sizing: border-box;
margin: 0;
}
body,
html {
width: 100%;
height: 100%;
}
// Theme
:root {
--bg-500: #ffffff;
--bg-selected-500: #f8f8f8;
--bg-highlight-500: #f0f0f0;
--border-400: #e8e8e8;
--border-500: #d8d8d8;
--border-600: #c0c0c0;
--border-highlight-500: #b0b0b0;
--border-selected-500: #909090;
--text-500: #282828;
--accent-100: #d6ffc2;
--accent-500: #6cc16c;
--accent-900: #244624;
--bubble-red: hsl(359, 100%, 92%);
--bubble-purple: hsl(274, 100%, 92%);
--bubble-blue: hsl(241, 100%, 92%);
--bubble-yellow: hsl(50, 100%, 92%);
--bubble-green: hsl(125, 100%, 92%);
--bubble-orange: hsl(25, 100%, 92%);
--bubble-lightlightblue: hsl(176, 100%, 92%);
--bubble-lightblue: hsl(198, 100%, 92%);
--bubble-highlight-red: hsl(359, 100%, 85%);
--bubble-highlight-purple: hsl(274, 100%, 85%);
--bubble-highlight-blue: hsl(241, 100%, 85%);
--bubble-highlight-yellow: hsl(50, 100%, 85%);
--bubble-highlight-green: hsl(125, 100%, 85%);
--bubble-highlight-orange: hsl(25, 100%, 85%);
--bubble-highlight-lightlightblue: hsl(176, 100%, 85%);
--bubble-highlight-lightblue: hsl(198, 100%, 85%);
--bubble-border-red: hsl(359, 75%, 51%);
--bubble-border-purple: hsl(274, 75%, 51%);
--bubble-border-blue: hsl(241, 75%, 51%);
--bubble-border-yellow: hsl(50, 75%, 51%);
--bubble-border-green: hsl(125, 75%, 51%);
--bubble-border-orange: hsl(25, 75%, 51%);
--bubble-border-lightlightblue: hsl(176, 75%, 51%);
--bubble-border-lightblue: hsl(198, 75%, 51%);
--bold-on-dark: 300;
}
body.dark-mode {
--bg-400: hsl(269, 24%, 3%);
--bg-500: hsl(269, 24%, 7%);
--bg-selected-500: hsl(276, 56%, 30%);
--bg-highlight-500: hsl(277, 66%, 35%);
--border-400: hsl(269, 40%, 45%);
--border-500: hsl(269, 60%, 30%);
--border-600: hsl(269, 80%, 35%);
--border-highlight-500: hsl(269, 80%, 50%);
--border-selected-500: #b66af6;
--text-500: #e6cff6;
--accent-100: hsl(269, 50%, 50%);
--accent-500: hsl(269, 40%, 70%);
--accent-900: hsl(269, 30%, 90%);
--bubble-red: hsl(359, 40%, 25%);
--bubble-purple: hsl(274, 40%, 25%);
--bubble-blue: hsl(241, 40%, 25%);
--bubble-yellow: hsl(50, 40%, 25%);
--bubble-green: hsl(125, 40%, 25%);
--bubble-orange: hsl(25, 40%, 25%);
--bubble-lightblue: hsl(176, 40%, 25%);
--bubble-border-red: hsl(359, 75%, 51%);
--bubble-border-purple: hsl(274, 75%, 51%);
--bubble-border-blue: hsl(241, 75%, 51%);
--bubble-border-yellow: hsl(50, 75%, 51%);
--bubble-border-green: hsl(125, 75%, 51%);
--bubble-border-orange: hsl(25, 75%, 51%);
--bubble-border-lightblue: hsl(176, 75%, 51%);
--bubble-highlight-red: hsl(359, 40%, 31%);
--bubble-highlight-purple: hsl(274, 40%, 31%);
--bubble-highlight-blue: hsl(241, 40%, 31%);
--bubble-highlight-yellow: hsl(50, 40%, 31%);
--bubble-highlight-green: hsl(125, 40%, 31%);
--bubble-highlight-orange: hsl(25, 40%, 31%);
--bubble-highlight-lightblue: hsl(176, 40%, 31%);
--bold-on-dark: 500;
}
$device-s-width: 900px;
// Elements
a,
a:visited {
color: var(--text-500);
font-weight: 400;
}
code {
font-size: 90%;
}
sup {
display: inline-block;
transform: translate(0, -0.25rem);
}
// Headings
$base-font-size: 18px;
$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;
display: flex;
align-items: center;
gap: 0.5rem;
}
}
button,
.button {
display: flex;
align-items: center;
justify-content: center;
gap: 0.25rem;
color: var(--text-500);
background: var(--bg-500);
border: 2px solid var(--border-400);
border-radius: 0.5rem;
font: inherit;
font-weight: 400;
padding: 0.5rem 1rem;
cursor: pointer;
position: relative;
overflow: hidden;
&:hover::after {
content: '';
position: absolute;
inset: 0;
background: #0000000c;
z-index: 1;
}
&.primary {
background: var(--accent-100);
border-color: var(--accent-500);
&:hover::after {
background: #00000020;
}
}
&.icon {
padding: 0.5rem;
width: 2.5rem;
height: 2.5rem;
}
&.flat {
border: none;
}
}
.input-combo {
display: flex;
// align-items: center;
justify-content: center;
height: 3rem;
background: var(--bg-500);
border: 2px solid var(--border-400);
border-radius: 0.5rem;
font-weight: 400;
// padding: 0.5rem 0.5rem 0.5rem 1rem;
user-select: none;
cursor: pointer;
position: relative;
select {
border: none;
background: none;
color: var(--text-500);
appearance: none;
font-family: inherit;
font-size: inherit;
font-weight: 300;
height: 100%;
padding-left: 1rem;
padding-right: 3rem;
width: 100%;
}
.icon {
position: absolute;
right: 0;
height: 100%;
width: calc(3rem - 4px);
display: grid;
place-content: center;
pointer-events: none;
}
}
// Components
.logo {
display: flex;
align-items: center;
& > img {
max-height: 2.5rem;
body.dark-mode & {
filter: hue-rotate(135deg) brightness(1.1);
}
}
gap: 0.25rem;
}
.popup-container {
position: absolute;
inset: 0;
z-index: 10;
background: #00000099;
max-width: 100%;
.popup {
@extend .panel;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
gap: 1rem;
box-shadow: 0 0 1.5rem #00000033;
.header {
display: flex;
align-items: center;
justify-content: space-between;
user-select: none;
.title {
display: flex;
align-items: center;
gap: 0.5rem;
font-size: 24px;
}
}
.content {
@extend .text-block;
width: 60ch;
max-width: 100%;
max-height: 60vh;
overflow-y: auto;
padding-bottom: 3rem;
}
max-width: 100%;
}
}
.compound {
display: flex;
.material-symbols-outlined {
font-size: 20px;
}
button,
.button {
border-radius: 0;
border-right: none;
padding-left: 0.75rem;
padding-right: 0.75rem;
height: 2.5rem;
&:first-child {
padding-left: 1rem;
border-top-left-radius: 0.5rem;
border-bottom-left-radius: 0.5rem;
}
&:last-child {
padding-right: 1rem;
border-top-right-radius: 0.5rem;
border-bottom-right-radius: 0.5rem;
border: 2px solid var(--border-400);
}
&.radio {
&.selected {
background: var(--accent-100);
border-color: var(--accent-500);
& + .radio {
border-left-color: var(--accent-500);
}
&:hover::after {
background: #00000018;
}
}
&.icon {
padding: 0 0.5rem;
}
}
}
}
// Extension Classes
.panel {
background: var(--bg-500);
border: 1px solid var(--border-500);
border-radius: 1rem;
padding: 1rem;
}
.text-block {
display: flex;
flex-direction: column;
gap: 0.5rem;
p {
line-height: 1.5;
.material-symbols-outlined {
font-size: 18px;
vertical-align: text-top;
}
}
ul {
padding: 0.5rem 0 0.5rem 1.5rem;
display: flex;
flex-direction: column;
gap: 0.5rem;
}
}
// Structure
body {
background: var(--bg-400);
color: var(--text-500);
font-weight: 300;
font-family: 'Inter', sans-serif;
position: relative;
}
.toolbar {
@extend .panel;
padding: 1rem 0.75rem 1rem 1rem;
border-radius: 0;
border: none;
border-bottom: 1px solid var(--border-500);
height: 4rem;
display: flex;
align-items: center;
justify-content: space-between;
.option-group {
display: flex;
align-items: center;
gap: 0.75rem;
@media screen and (max-width: $device-s-width), (pointer: coarse) {
display: none;
}
}
}
.option-bar {
@extend .panel;
padding: 0.5rem;
border-radius: 0;
border: none;
border-bottom: 1px solid var(--border-500);
height: 4rem;
display: none;
align-items: center;
justify-content: space-between;
overflow-y: hidden;
overflow-x: auto;
max-width: 100%;
gap: 0.5rem;
@media screen and (max-width: $device-s-width), (pointer: coarse) {
display: flex;
}
.option-group {
display: flex;
align-items: center;
gap: 0.75rem;
}
}
.events-view {
height: calc(100vh - 4rem);
@media screen and (max-width: $device-s-width), (pointer: coarse) {
height: calc(100vh - 8rem);
}
.course-view {
padding: 1rem;
display: flex;
flex-direction: column;
align-items: center;
height: 100%;
overflow-y: scroll;
.wrap-container {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(30ch, 1fr));
gap: 1rem;
width: 100%;
max-width: 1200px;
.course {
@extend .panel;
display: flex;
flex-direction: column;
gap: 0.25rem;
flex-grow: 1;
position: relative;
cursor: pointer;
&.selected {
background: var(--bg-selected-500);
&::after {
content: '';
position: absolute;
inset: -1px;
border-radius: 1rem;
border: 3px solid var(--border-selected-500);
}
}
&.highlight {
background: var(--bg-highlight-500);
border-color: var(--border-highlight-500);
}
.title {
font-size: 24px;
}
.docenti {
font-size: 16px;
}
.events {
font-size: 18px;
}
}
}
}
.work-week-h-view {
--header-height: 3rem;
--event-height: 2rem;
display: grid;
grid-template-columns: auto 1fr;
grid-template-rows: var(--header-height) 1fr;
overflow-y: scroll;
height: 100%;
.week {
grid-column: 1 / 2;
grid-row: 2 / 3;
display: flex;
flex-direction: column;
.day {
box-sizing: content-box;
// @media screen and (max-width: $device-s-width) {
// writing-mode: vertical-lr;
// }
height: calc(var(--size) * var(--event-height) + (var(--size) - 1) * 0.25rem);
border-top: 1px solid var(--border-500);
border-right: 1px solid var(--border-500);
padding: 0.5rem 1rem 0 0.5rem;
font-size: 18px;
font-weight: 400;
&:last-child {
border-bottom: 1px solid var(--border-500);
}
}
}
.events {
grid-column: 2 / 3;
grid-row: 1 / 3;
overflow-y: hidden;
overflow-x: scroll;
// scrollbar-gutter: stable both-edges;
display: grid;
grid-template-rows: auto 1fr;
--hour-width: 7.5rem;
.header {
display: grid;
grid-template-columns: repeat(12, var(--hour-width));
grid-template-rows: var(--header-height);
gap: 0.25rem;
.label {
display: grid;
place-content: center;
font-size: 18px;
font-weight: 400;
border-left: 1px solid var(--border-500);
&:nth-child(2),
&:nth-child(4) {
border-right: 1px solid var(--border-500);
}
}
}
.days {
display: flex;
flex-direction: column;
.day {
display: grid;
// grid-template-columns: repeat(7, 0) repeat(12, 1fr) repeat(5, 0);
grid-template-columns: repeat(12, var(--hour-width));
grid-template-rows: repeat(var(--size), var(--event-height));
gap: 0.25rem;
position: relative;
&:hover {
z-index: 5;
}
.event {
grid-row: var(--row) / span 1;
grid-column: var(--start) / span var(--size);
$color: var(--bg-500);
background: $color;
color: var(--text-500);
border-radius: 0.25rem;
border: 1px solid var(--border-600);
display: flex;
padding: 0.4rem;
font-size: 15px;
width: 100%;
min-height: var(--event-height);
overflow: hidden;
position: relative;
line-height: 1.1;
&::after {
content: '';
position: absolute;
inset: 0;
border-radius: 0.25rem;
background: linear-gradient(to top, $color 0%, transparent 25%);
}
&:hover {
z-index: 3;
position: absolute;
overflow: visible;
&::after {
background: none;
}
}
z-index: 2;
}
border-top: 1px solid var(--border-500);
padding: 0.25rem 0;
&:last-child {
border-bottom: 1px solid var(--border-500);
}
}
}
}
}
.work-week-v-view {
position: relative;
display: grid;
grid-template-columns: max-content repeat(5, minmax(auto, 1fr));
height: 100%;
overflow: scroll;
// --event-height: 4.75rem;
--event-height: 6rem;
.pivot {
height: 3rem;
grid-column: 1 / 2;
grid-row: 1 / 2;
position: sticky;
top: 0;
left: 0;
z-index: 2;
background: var(--bg-500);
border-bottom: 1px solid var(--border-500);
border-right: 1px solid var(--border-500);
}
.left-header {
grid-column: 1 / 2;
grid-row: 1 / 2;
display: grid;
position: sticky;
left: 0;
border-right: 1px solid var(--border-500);
background: var(--bg-500);
z-index: 1;
padding-top: 3rem;
.blocks {
display: grid;
grid-template-rows: repeat(24, calc(var(--event-height) / 2));
.block {
grid-row: var(--start) / span var(--size);
display: grid;
place-content: center;
padding: 0.5rem;
font-size: 16px;
font-weight: 400;
border-top: 1px solid var(--border-500);
@media screen and (max-width: $device-s-width), (pointer: coarse) {
writing-mode: vertical-lr;
}
&:not(.skip-border) {
height: calc(2 * var(--event-height) + 0.5px);
border-bottom: 1px solid var(--border-500);
}
}
}
}
.day {
position: relative;
display: flex;
flex-direction: column;
.top-header {
position: sticky;
top: 0;
height: 3rem;
flex: 0 0 auto;
z-index: 1;
grid-column: span var(--size);
display: flex;
align-items: center;
justify-content: center;
font-size: 18px;
font-weight: 400;
background: var(--bg-500);
border-bottom: 1px solid var(--border-500);
}
// &:not(:last-child) {
border-right: 1px solid var(--border-500);
// }
.events {
position: relative;
display: grid;
grid-template-columns: repeat(var(--size), auto);
grid-template-rows: repeat(24, calc(var(--event-height) / 2));
padding: 0 0.25rem;
// gap: 1rem 0.5rem;
.event {
position: relative;
cursor: pointer;
grid-row: var(--start) / span var(--size);
grid-column: var(--stack) / span 1;
background: var(--bg-500);
border: 1px solid var(--border-600);
// border: 4px solid hsl(var(--hue), 80%, 80%);
border-radius: 0.5rem;
display: flex;
flex-direction: column;
gap: 0.25rem;
padding: 0.5rem 1rem 0.5rem 0.5rem;
margin: 0.5rem 0.25rem;
// box-sizing: content-box;
&.selected {
background: var(--bg-selected-500);
&::after {
content: '';
position: absolute;
inset: -1px;
border-radius: 0.5rem;
border: 3px solid var(--border-selected-500);
}
}
&.highlight {
background: var(--bg-highlight-500);
border-color: var(--border-highlight-500);
}
.title {
font-size: 18px;
font-weight: 400;
}
.aula {
font-size: 16px;
font-weight: 300;
}
}
.grid-line-h {
grid-column: 1 / span var(--size);
grid-row: var(--track) / span 1;
height: 0px;
border-bottom: 1px dashed var(--border-500);
transform: translate(0, -1px);
// align-self: center;
position: relative;
top: 0.5px;
left: -0.5rem;
width: calc(100% + 1rem);
z-index: -1;
}
}
}
}
.work-week-grid-view {
position: relative;
padding: 1rem;
display: flex;
flex-direction: column;
align-items: center;
height: 100%;
overflow-y: auto;
.grid {
width: 100%;
max-width: 55rem;
display: grid;
grid-template-columns: 3rem repeat(var(--time-length), 1fr);
grid-template-rows: 2rem repeat(var(--days-length), 1fr);
border: 1px solid var(--border-600);
border-radius: 10px 10px 0 0;
@media screen and (max-width: $device-s-width), (pointer: coarse) {
font-size: 12px;
}
.time {
display: flex;
align-items: center;
justify-content: center;
padding: 0.5rem;
grid-row: 1;
grid-column: var(--offset) / span 2;
}
.day-name {
display: flex;
align-items: center;
justify-content: center;
padding: 0.5rem;
grid-column: 1;
grid-row: var(--line);
}
.event {
display: flex;
flex-direction: row;
@media screen and (max-width: $device-s-width), (pointer: coarse) {
flex-direction: column;
}
gap: 0.25rem;
align-items: center;
justify-content: center;
margin: 0.25rem;
padding: 0.5rem;
grid-row: var(--line);
grid-column: var(--offset) / span var(--length);
background-color: var(--color);
border: 3px solid var(--color);
border-radius: 10px;
font-weight: var(--bold-on-dark);
text-align: center;
&.highlight {
background-color: var(--highlight-color);
border: 3px solid var(--highlight-color);
}
&.selected {
border: 3px solid var(--border-color);
}
}
.hline {
grid-column: 1 / 13;
grid-row: var(--line);
height: 0px;
border-bottom: 1px solid var(--border-500);
}
.vline {
grid-column: var(--offset);
grid-row: 1 / calc(2 + var(--days-length));
width: 0px;
border-right: 1px dashed var(--border-500);
}
}
.legend {
max-width: 55rem;
display: grid;
grid-template-columns: min-content 1fr;
border: 1px solid var(--border-600);
border-radius: 0 0 10px 10px;
border-top: none;
padding: 1rem;
gap: 0.5rem 1rem;
align-items: center;
justify-content: center;
width: 100%;
.name {
width: 100%;
}
.color {
display: flex;
justify-content: center;
align-items: center;
font-weight: 500;
width: 2rem;
height: 1.5rem;
background-color: var(--color);
border: 2px solid var(--border-color);
border-radius: 10px;
font-weight: var(--bold-on-dark);
}
}
}
.schedule-view {
padding: 1rem;
display: flex;
flex-direction: column;
align-items: center;
gap: 1rem;
overflow-y: scroll;
height: 100%;
& > * {
max-width: 50rem;
}
.header {
position: relative;
width: 100%;
display: grid;
place-content: center;
&.giorno {
font-size: 24px;
font-weight: 400;
.inner {
background: var(--bg-500);
padding: 0 0.5rem;
}
&::before {
position: absolute;
content: '';
top: 50%;
left: 0;
right: 0;
height: 1px;
background: var(--border-600);
z-index: -1;
}
}
&.orario {
font-size: 18px;
font-weight: 300;
}
}
.event {
@extend .panel;
width: 100%;
.title {
font-size: 22px;
}
position: relative;
cursor: pointer;
@media screen and (min-width: $device-s-width), (pointer: fine) {
&:hover {
background: var(--bg-highlight-500);
border-color: var(--border-highlight-500);
}
}
&.selected {
background: var(--bg-selected-500);
&::after {
content: '';
position: absolute;
inset: -1px;
border-radius: 1rem;
border: 3px solid var(--border-selected-500);
}
}
}
}
}
.overlay {
display: flex;
position: fixed;
bottom: 3rem;
right: 3rem;
// on mobile
@media screen and (max-width: $device-s-width), (pointer: coarse) {
bottom: 1rem;
right: 1rem;
}
gap: 0.5rem;
button {
width: 3rem;
height: 3rem;
border-radius: 100%;
.material-symbols-outlined {
font-size: 22px;
}
color: var(--accent-900);
box-shadow: 0 0.25rem 0.75rem #00000033;
}
animation: fade-in 150ms ease-in forwards;
}
.menu {
position: absolute;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background: var(--bg-500);
z-index: 10;
.header {
height: 4rem;
padding: 0.75rem 1rem 0.75rem 0.75rem;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid var(--border-500);
.option-group {
display: flex;
gap: 0.5rem;
}
}
.options {
padding: 1rem;
display: grid;
grid-template-columns: auto 1fr;
gap: 1rem;
align-items: center;
.label {
font-weight: 400;
}
}
hr {
position: relative;
width: calc(100% - 2rem);
height: 1px;
left: 1rem;
background: var(--border-500);
border: none;
}
.help {
@extend .text-block;
padding: 1rem 1rem 2.5rem;
}
}
// not on mobile
@media screen and (min-width: $device-s-width) and (pointer: fine) {
.mobile {
display: none;
}
.menu {
display: none;
}
}
// on mobile
@media screen and (max-width: $device-s-width), (pointer: coarse) {
.toolbar {
padding: 0.75rem 1rem 0.75rem 0.75rem;
}
}
@media print {
// @page {
// size: A4 landscape;
// }
.toolbar,
.menu,
.overlay {
display: none;
}
.work-week-v-view {
overflow: visible;
}
}
@keyframes fade-in {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
.fade-out {
animation: fade-out 150ms ease-in forwards;
}
@keyframes fade-out {
0% {
opacity: 1;
}
100% {
opacity: 0;
}
}
// Utilities
span.bold {
font-weight: 400;
}