From 1297a8a23a351598baf3b74f056d2a67f38c71c3 Mon Sep 17 00:00:00 2001 From: SimonGschnell Date: Fri, 22 Nov 2024 15:02:42 +0100 Subject: [PATCH] reafactor(Calendar/Day/Page.js): refactors styles of elements for easier readability --- public/js/components/Calendar/Day/Page.js | 66 ++++++++++++++++++++--- 1 file changed, 59 insertions(+), 7 deletions(-) diff --git a/public/js/components/Calendar/Day/Page.js b/public/js/components/Calendar/Day/Page.js index e7927e896..c8fb9aae7 100644 --- a/public/js/components/Calendar/Day/Page.js +++ b/public/js/components/Calendar/Day/Page.js @@ -82,6 +82,34 @@ export default { } }, computed: { + dayGridStyle(){ + return { + 'grid-template-columns': '1 1fr', + 'grid-template-rows': 'repeat(' + (this.hours.length * 60 / this.smallestTimeFrame) + ', 1fr)', + } + }, + noLvStyle(){ + return { + top: (this.calendarScrollTop + 100) + 'px', + position: 'absolute', + left: 0, + 'text-align': 'center', + width: '100%', + 'z-index': 1, + } + }, + indicatorStyle(){ + return { + 'pointer-events': 'none', + 'padding-left': '3.5rem', + 'margin-top': '-1px', + 'z-index': 2, + 'border-color':'#00649C!important', + top: this.hourPosition + 'px', + left: 0, + right: 0, + } + }, noEventsCondition(){ return !this.isSliding && this.filteredEvents?.length === 0; }, @@ -150,6 +178,19 @@ export default { ) } }, + hourGridIdentifier(hour) { + // this is the id attribute that is responsible to scroll the calender to the first event + return 'scroll' + hour + this.focusDate.d + this.week; + }, + hourGridStyle(hour){ + return { + 'pointer-events': 'none', + top: this.getAbsolutePositionForHour(hour), + left: 0, + right: 0, + 'z-index': 0, + } + }, showModal: function (evt) { let event = evt.orig; this.setSelectedEvent(event); @@ -216,6 +257,17 @@ export default { }, dateToMinutesOfDay(day) { return Math.floor(((day.getHours() - 7) * 60 + day.getMinutes()) / this.smallestTimeFrame) + 1; + }, + eventGridStyle(day,event){ + return { + 'z-index': 1, + 'grid-column-start': 1 + (event.lane - 1) * day.lanes / event.maxLane, + 'grid-column-end': 1 + event.lane * day.lanes / event.maxLane, + 'grid-row-start': this.dateToMinutesOfDay(event.start), + 'grid-row-end': this.dateToMinutesOfDay(event.end), + 'background-color': event.orig.color, + '--test': this.dateToMinutesOfDay(event.end), + } } }, template: /*html*/` @@ -232,19 +284,19 @@ export default {
-
-
+
+
{{hourPositionTime}}
-

Keine Lehrveranstaltungen

-
+

Keine Lehrveranstaltungen

+
{{hour}}:00
-
-
+
+
@@ -280,7 +332,7 @@ export default {

Keine Lehrveranstaltungen