Fixed half-hour lessons for work-week-v

pull/4/head
Antonio De Lucreziis 2 years ago
parent abb98dfbc3
commit e432b60b54

@ -57,8 +57,8 @@ export const WorkWeek = ({ events, selection, setSelection, hideOtherCourses })
<div <div
class="block skip-border" class="block skip-border"
style={{ style={{
'--start': 9 - 7, '--start': 2 * (9 - 7),
'--size': 2, '--size': 4,
}} }}
> >
9:00 &ndash; 11:00 9:00 &ndash; 11:00
@ -66,8 +66,8 @@ export const WorkWeek = ({ events, selection, setSelection, hideOtherCourses })
<div <div
class="block" class="block"
style={{ style={{
'--start': 11 - 7, '--start': 2 * (11 - 7),
'--size': 2, '--size': 4,
}} }}
> >
11:00 &ndash; 13:00 11:00 &ndash; 13:00
@ -75,8 +75,8 @@ export const WorkWeek = ({ events, selection, setSelection, hideOtherCourses })
<div <div
class="block skip-border" class="block skip-border"
style={{ style={{
'--start': 14 - 7, '--start': 2 * (14 - 7),
'--size': 2, '--size': 4,
}} }}
> >
14:00 &ndash; 16:00 14:00 &ndash; 16:00
@ -84,8 +84,8 @@ export const WorkWeek = ({ events, selection, setSelection, hideOtherCourses })
<div <div
class="block" class="block"
style={{ style={{
'--start': 16 - 7, '--start': 2 * (16 - 7),
'--size': 2, '--size': 4,
}} }}
> >
16:00 &ndash; 18:00 16:00 &ndash; 18:00
@ -109,9 +109,9 @@ export const WorkWeek = ({ events, selection, setSelection, hideOtherCourses })
} }
data-event-id={event.data.id} data-event-id={event.data.id}
style={{ style={{
'--start': event.start / 60 - 7, '--start': event.start / 30 - 14,
'--stack': stackIndex + 1, '--stack': stackIndex + 1,
'--size': (event.end - event.start) / 60, '--size': (event.end - event.start) / 30,
'--hue': '--hue':
(Math.abs(hashString('seed3' + event.data.id)) % (Math.abs(hashString('seed3' + event.data.id)) %
360) + 360) +
@ -134,10 +134,10 @@ export const WorkWeek = ({ events, selection, setSelection, hideOtherCourses })
))} ))}
{/* Grid Tracks */} {/* Grid Tracks */}
{[2, 4, 6].map(i => ( {[4, 8, 12].map(i => (
<div class="grid-line-h" style={{ '--track': i }}></div> <div class="grid-line-h" style={{ '--track': i }}></div>
))} ))}
{[7, 9, 11].map(i => ( {[14, 18, 22].map(i => (
<div class="grid-line-h" style={{ '--track': i }}></div> <div class="grid-line-h" style={{ '--track': i }}></div>
))} ))}
</div> </div>

@ -778,7 +778,7 @@ body {
.blocks { .blocks {
display: grid; display: grid;
grid-template-rows: repeat(12, calc(var(--event-height))); grid-template-rows: repeat(24, calc(var(--event-height) / 2));
.block { .block {
grid-row: var(--start) / span var(--size); grid-row: var(--start) / span var(--size);
@ -842,7 +842,7 @@ body {
display: grid; display: grid;
grid-template-columns: repeat(var(--size), auto); grid-template-columns: repeat(var(--size), auto);
grid-template-rows: repeat(12, var(--event-height)); grid-template-rows: repeat(24, calc(var(--event-height) / 2));
padding: 0 0.25rem; padding: 0 0.25rem;

Loading…
Cancel
Save