diff --git a/frontend/components/time-tracking/TimeEntryBlock.vue b/frontend/components/time-tracking/TimeEntryBlock.vue index e80adf1..121ad78 100644 --- a/frontend/components/time-tracking/TimeEntryBlock.vue +++ b/frontend/components/time-tracking/TimeEntryBlock.vue @@ -17,38 +17,33 @@
-
- - - - - - - - - - + {{ duration }} +
+
+ {{ duration }} +
@@ -116,13 +111,11 @@ const sizeLevel = computed(() => { return 0 }) +const hasProject = computed(() => !!props.entry.project) + const blockStyle = computed(() => { const startMinutes = startDate.value.getHours() * 60 + startDate.value.getMinutes() + resizeTopDeltaMinutes.value const topPx = ((startMinutes - props.dayStartHour * 60) / 60) * props.hourHeight - const hex = (props.entry.project?.color ?? '#94a3b8').replace('#', '') - const r = parseInt(hex.substring(0, 2), 16) - const g = parseInt(hex.substring(2, 4), 16) - const b = parseInt(hex.substring(4, 6), 16) const col = props.columnIndex ?? 0 const total = props.totalColumns ?? 1 @@ -130,14 +123,28 @@ const blockStyle = computed(() => { const leftPercent = (col / total) * 100 const widthPercent = (1 / total) * 100 - return { + const base: Record = { top: `${topPx}px`, height: `${heightPx.value}px`, - backgroundColor: `rgb(${Math.round(r + (255 - r) * 0.6)}, ${Math.round(g + (255 - g) * 0.6)}, ${Math.round(b + (255 - b) * 0.6)})`, - color: `rgb(${r}, ${g}, ${b})`, left: `calc(${leftPercent}% + ${gapPx}px)`, width: `calc(${widthPercent}% - ${gapPx * 2}px)`, } + + if (hasProject.value) { + const hex = props.entry.project!.color.replace('#', '') + const r = parseInt(hex.substring(0, 2), 16) + const g = parseInt(hex.substring(2, 4), 16) + const b = parseInt(hex.substring(4, 6), 16) + base.backgroundColor = `rgb(${Math.round(r + (255 - r) * 0.6)}, ${Math.round(g + (255 - g) * 0.6)}, ${Math.round(b + (255 - b) * 0.6)})` + base.color = `rgb(${r}, ${g}, ${b})` + } else { + base.backgroundColor = '#e5e7eb' + base.backgroundImage = 'repeating-conic-gradient(#d1d5db 0% 25%, #f3f4f6 0% 50%)' + base.backgroundSize = '12px 12px' + base.color = '#6b7280' + } + + return base }) // --- Click / Drag detection --- diff --git a/frontend/components/time-tracking/TimeTrackingCalendar.vue b/frontend/components/time-tracking/TimeTrackingCalendar.vue index 6c41716..0de926a 100644 --- a/frontend/components/time-tracking/TimeTrackingCalendar.vue +++ b/frontend/components/time-tracking/TimeTrackingCalendar.vue @@ -1,27 +1,27 @@ diff --git a/frontend/components/ui/DateFilter.vue b/frontend/components/ui/DateFilter.vue index 404f5d6..cd69acb 100644 --- a/frontend/components/ui/DateFilter.vue +++ b/frontend/components/ui/DateFilter.vue @@ -15,22 +15,6 @@ >