Added calendar view to the shifts

This commit is contained in:
2025-07-16 18:05:49 -06:00
parent 966479b80c
commit 34f71c05c2
5 changed files with 575 additions and 19 deletions

View File

@@ -182,6 +182,196 @@
align-items: center;
}
/* View toggle and calendar styles */
.shifts-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 15px;
}
.view-toggle {
display: flex;
gap: 5px;
}
.view-toggle .btn {
padding: 8px 15px;
}
.view-toggle .btn.active {
background-color: var(--primary-color);
color: white;
}
/* Calendar View Styles */
.calendar-view {
margin-bottom: 40px;
}
.calendar-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
padding: 0 10px;
}
.calendar-header h3 {
margin: 0;
color: var(--dark-color);
}
.calendar-grid {
display: grid;
grid-template-columns: repeat(7, 1fr);
gap: 1px;
background-color: #e0e0e0;
border: 1px solid #e0e0e0;
border-radius: var(--border-radius);
overflow: hidden;
}
.calendar-day-header {
background-color: var(--primary-color);
color: white;
padding: 12px 8px;
text-align: center;
font-weight: bold;
font-size: 0.9em;
}
.calendar-day {
background-color: white;
min-height: 120px;
padding: 8px;
position: relative;
border: none;
display: flex;
flex-direction: column;
}
.calendar-day.other-month {
background-color: #f9f9f9;
color: #ccc;
}
.calendar-day.today {
background-color: #fff3cd;
}
.calendar-day-number {
font-size: 0.9em;
font-weight: bold;
margin-bottom: 5px;
color: var(--dark-color);
}
.calendar-day.other-month .calendar-day-number {
color: #ccc;
}
.calendar-shifts {
display: flex;
flex-direction: column;
gap: 2px;
flex-grow: 1;
}
.calendar-shift {
background-color: var(--primary-color);
color: white;
padding: 2px 4px;
border-radius: 3px;
font-size: 0.75em;
cursor: pointer;
transition: var(--transition);
line-height: 1.2;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.calendar-shift:hover {
opacity: 0.8;
transform: scale(1.02);
}
.calendar-shift.my-shift {
background-color: var(--success-color);
}
.calendar-shift.full-shift {
background-color: var(--secondary-color);
}
.calendar-shift.available-shift {
background-color: var(--primary-color);
}
/* Calendar legend */
.calendar-legend {
display: flex;
justify-content: center;
gap: 20px;
margin-top: 20px;
flex-wrap: wrap;
}
.legend-item {
display: flex;
align-items: center;
gap: 8px;
font-size: 0.9em;
}
.legend-color {
width: 16px;
height: 16px;
border-radius: 3px;
}
.legend-color.my-shift {
background-color: var(--success-color);
}
.legend-color.available-shift {
background-color: var(--primary-color);
}
.legend-color.full-shift {
background-color: var(--secondary-color);
}
/* Calendar shift popup/tooltip */
.shift-popup {
position: absolute;
background: white;
border: 1px solid #e0e0e0;
border-radius: var(--border-radius);
padding: 15px;
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
z-index: 1000;
min-width: 250px;
max-width: 300px;
}
.shift-popup h4 {
margin: 0 0 10px 0;
color: var(--dark-color);
}
.shift-popup p {
margin: 5px 0;
color: var(--secondary-color);
}
.shift-popup .shift-actions {
margin-top: 10px;
display: flex;
gap: 10px;
}
/* Mobile adjustments */
@media (max-width: 768px) {
.shifts-container {
@@ -237,13 +427,66 @@
.filter-group {
flex-wrap: wrap;
}
.shifts-header {
flex-direction: column;
align-items: stretch;
gap: 15px;
}
.view-toggle {
justify-content: center;
}
.calendar-day {
min-height: 80px;
padding: 4px;
}
.calendar-day-number {
font-size: 0.8em;
}
.calendar-shift {
font-size: 0.7em;
padding: 1px 2px;
}
.calendar-header {
padding: 0;
}
.calendar-header h3 {
font-size: 1.1em;
}
.calendar-legend {
gap: 15px;
}
.legend-item {
font-size: 0.8em;
}
.shift-popup {
max-width: 280px;
padding: 12px;
}
}
/* Prevent dropdown from being cut off */
.shifts-grid {
overflow: visible;
}
.shift-card {
overflow: visible;
/* Extra small screens */
@media (max-width: 480px) {
.calendar-day {
min-height: 60px;
padding: 2px;
}
.calendar-shift {
font-size: 0.65em;
padding: 1px;
}
.calendar-day-number {
font-size: 0.75em;
}
}