worker-calendar
Version:
A customizable, responsive Angular calendar component for scheduling worker appointments or shifts
137 lines (119 loc) • 2.73 kB
CSS
/* projects/worker-calendar/src/lib/components/worker-calendar/worker-calendar.component.scss */
.worker-calendar {
display: flex;
flex-direction: column;
border: 1px solid #ddd;
border-radius: 4px;
font-family: Arial, sans-serif;
height: 100%;
min-height: 500px;
}
.calendar-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px;
background-color: #f5f5f5;
border-bottom: 1px solid #ddd;
}
.calendar-title {
font-size: 18px;
font-weight: bold;
}
.btn-control, .btn-view-mode {
padding: 6px 12px;
margin: 0 2px;
border: 1px solid #ccc;
background-color: #fff;
border-radius: 4px;
cursor: pointer;
&:hover {
background-color: #e9e9e9;
}
&.active {
background-color: #4285f4;
color: white;
border-color: #4285f4;
}
}
.day-view {
display: flex;
flex-direction: column;
flex: 1;
overflow: auto;
}
.time-header {
display: flex;
border-bottom: 1px solid #ddd;
.worker-column-header {
width: 150px;
padding: 8px;
font-weight: bold;
border-right: 1px solid #ddd;
background-color: #f5f5f5;
}
.hour-column {
flex: 1;
min-width: 80px;
padding: 8px;
text-align: center;
font-weight: bold;
border-right: 1px solid #ddd;
background-color: #f5f5f5;
}
}
.worker-row {
display: flex;
border-bottom: 1px solid #ddd;
.worker-info {
width: 150px;
padding: 8px;
border-right: 1px solid #ddd;
background-color: #f9f9f9;
.worker-name {
font-weight: bold;
}
.worker-description {
font-size: 12px;
color: #666;
}
}
.time-cell {
flex: 1;
min-width: 80px;
height: 60px;
border-right: 1px solid #ddd;
position: relative;
cursor: pointer;
&:hover {
background-color: #f0f8ff;
}
}
}
.event-item {
position: absolute;
top: 2px;
left: 2px;
right: 2px;
bottom: 2px;
padding: 2px 4px;
border-radius: 2px;
background-color: #4285f4;
color: white;
font-size: 12px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
cursor: pointer;
z-index: 1;
&:hover {
opacity: 0.9;
}
}
.week-view, .month-view {
display: flex;
justify-content: center;
align-items: center;
flex: 1;
color: #666;
}