feat: редизайн календаря — liquid glass UI/UX
- CalendarView: новый тулбар (nav-группа, badge счётчика событий), расширенный сайдбар с мини-навигатором месяца и улучшенным списком календарей (checkbox-стиль с цветными dot-индикаторами) - MiniCalendar: новый компонент — компактный месячный навигатор с подсветкой текущей недели и кликом по дню для перехода - WeekView: заголовки дней с увеличенным номером и Today-кружком с glow, пунктирные полу-часовые линии, пульсирующий now-dot, тонкая полоска подсветки колонки сегодня, custom scrollbar - EventBlock: полноценный liquid glass — backdrop-filter, цветной gradient border, specular highlight, цветная метка времени, glow при hover, dashed левая полоска для tentative - EventDetailPopup: цветная accent-полоска сверху, цветной dot в заголовке, icon-wrap для каждой строки метаданных, popup-in анимация (spring scale), slim scrollbar - AppIcon: добавлены иконки warning, location, person, people - calendar.store: метод goToDate для перехода к произвольной дате Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
5be387b034
commit
c5a5527a44
7 changed files with 1084 additions and 330 deletions
|
|
@ -25,6 +25,10 @@ export type IconName =
|
|||
| 'image'
|
||||
| 'bell-off'
|
||||
| 'calendar'
|
||||
| 'warning'
|
||||
| 'location'
|
||||
| 'person'
|
||||
| 'people'
|
||||
|
||||
const props = defineProps<{
|
||||
name: IconName
|
||||
|
|
@ -148,6 +152,25 @@ const paths: Record<IconName, string> = {
|
|||
<line x1="8" y1="2" x2="8" y2="6"/>
|
||||
<line x1="3" y1="10" x2="21" y2="10"/>
|
||||
`,
|
||||
warning: `
|
||||
<path d="M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"/>
|
||||
<line x1="12" y1="9" x2="12" y2="13"/>
|
||||
<line x1="12" y1="17" x2="12.01" y2="17" stroke-width="2.5"/>
|
||||
`,
|
||||
location: `
|
||||
<path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"/>
|
||||
<circle cx="12" cy="10" r="3"/>
|
||||
`,
|
||||
person: `
|
||||
<path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/>
|
||||
<circle cx="12" cy="7" r="4"/>
|
||||
`,
|
||||
people: `
|
||||
<path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"/>
|
||||
<circle cx="9" cy="7" r="4"/>
|
||||
<path d="M23 21v-2a4 4 0 0 0-3-3.87"/>
|
||||
<path d="M16 3.13a4 4 0 0 1 0 7.75"/>
|
||||
`,
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -12,12 +12,20 @@ const props = defineProps<{
|
|||
const emit = defineEmits<{ click: [event: CalendarEvent] }>()
|
||||
|
||||
const timeLabel = computed(() => {
|
||||
if (props.event.isAllDay) return 'All day'
|
||||
if (props.event.isAllDay) return 'Весь день'
|
||||
const start = new Date(props.event.start)
|
||||
const end = new Date(props.event.end)
|
||||
return `${format(start, 'HH:mm')} – ${format(end, 'HH:mm')}`
|
||||
})
|
||||
|
||||
const durationMinutes = computed(() => {
|
||||
const start = new Date(props.event.start)
|
||||
const end = new Date(props.event.end)
|
||||
return (end.getTime() - start.getTime()) / 60_000
|
||||
})
|
||||
|
||||
const isShort = computed(() => durationMinutes.value < 45)
|
||||
|
||||
const statusClass = computed(() => {
|
||||
if (props.event.status === 'cancelled') return 'cancelled'
|
||||
if (props.event.status === 'tentative') return 'tentative'
|
||||
|
|
@ -28,65 +36,168 @@ const statusClass = computed(() => {
|
|||
<template>
|
||||
<div
|
||||
class="event-block"
|
||||
:class="statusClass"
|
||||
:style="{ ...(style ?? {}), '--event-color': color ?? 'var(--accent)' }"
|
||||
:class="[statusClass, { 'event-short': isShort }]"
|
||||
:style="{ ...(style ?? {}), '--ev-color': color ?? 'var(--accent)' }"
|
||||
@click.stop="emit('click', event)"
|
||||
>
|
||||
<div class="event-title">{{ event.title }}</div>
|
||||
<div class="event-time">{{ timeLabel }}</div>
|
||||
<div v-if="event.location" class="event-location">{{ event.location }}</div>
|
||||
<!-- Specular highlight bar -->
|
||||
<div class="ev-specular" />
|
||||
|
||||
<div class="ev-content">
|
||||
<div class="ev-title">{{ event.title }}</div>
|
||||
<div v-if="!isShort" class="ev-time">{{ timeLabel }}</div>
|
||||
<div v-if="!isShort && event.location" class="ev-location">
|
||||
<span class="ev-loc-dot">·</span>{{ event.location }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.event-block {
|
||||
position: absolute;
|
||||
left: 2px;
|
||||
right: 2px;
|
||||
border-radius: 6px;
|
||||
padding: 3px 6px;
|
||||
font-size: 11px;
|
||||
line-height: 1.3;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
background: color-mix(in srgb, var(--event-color) 22%, transparent);
|
||||
border-left: 3px solid var(--event-color);
|
||||
color: var(--text-primary);
|
||||
transition: filter var(--transition-fast), transform var(--transition-fast);
|
||||
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
|
||||
z-index: 2;
|
||||
|
||||
/* Liquid glass base */
|
||||
background:
|
||||
linear-gradient(
|
||||
135deg,
|
||||
color-mix(in srgb, var(--ev-color) 28%, rgba(255,255,255,0.06)) 0%,
|
||||
color-mix(in srgb, var(--ev-color) 14%, transparent) 100%
|
||||
);
|
||||
border: 1px solid color-mix(in srgb, var(--ev-color) 45%, transparent);
|
||||
border-top-color: color-mix(in srgb, var(--ev-color) 55%, rgba(255,255,255,0.4));
|
||||
backdrop-filter: blur(12px) saturate(1.6);
|
||||
-webkit-backdrop-filter: blur(12px) saturate(1.6);
|
||||
box-shadow:
|
||||
inset 0 1px 0 color-mix(in srgb, var(--ev-color) 20%, rgba(255,255,255,0.18)),
|
||||
0 2px 8px rgba(0, 0, 0, 0.30),
|
||||
0 0 0 0 color-mix(in srgb, var(--ev-color) 0%, transparent);
|
||||
|
||||
transition:
|
||||
transform 100ms ease,
|
||||
box-shadow 100ms ease,
|
||||
filter 100ms ease;
|
||||
}
|
||||
|
||||
.event-block::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: 3px;
|
||||
background: var(--ev-color);
|
||||
box-shadow: 1px 0 8px color-mix(in srgb, var(--ev-color) 60%, transparent);
|
||||
border-radius: 8px 0 0 8px;
|
||||
}
|
||||
|
||||
.event-block:hover {
|
||||
filter: brightness(1.15);
|
||||
transform: scale(1.01);
|
||||
transform: scaleX(1.008) scaleY(1.005);
|
||||
z-index: 3;
|
||||
box-shadow:
|
||||
inset 0 1px 0 color-mix(in srgb, var(--ev-color) 25%, rgba(255,255,255,0.22)),
|
||||
0 4px 16px rgba(0, 0, 0, 0.40),
|
||||
0 0 20px color-mix(in srgb, var(--ev-color) 22%, transparent);
|
||||
filter: brightness(1.12);
|
||||
}
|
||||
|
||||
.event-block.cancelled {
|
||||
opacity: 0.45;
|
||||
opacity: 0.38;
|
||||
text-decoration: line-through;
|
||||
filter: grayscale(0.4);
|
||||
}
|
||||
|
||||
.event-block.tentative {
|
||||
border-left-style: dashed;
|
||||
opacity: 0.75;
|
||||
opacity: 0.68;
|
||||
}
|
||||
|
||||
.event-title {
|
||||
.event-block.tentative::before {
|
||||
background: repeating-linear-gradient(
|
||||
180deg,
|
||||
var(--ev-color) 0px,
|
||||
var(--ev-color) 4px,
|
||||
transparent 4px,
|
||||
transparent 8px
|
||||
);
|
||||
}
|
||||
|
||||
/* Specular top highlight */
|
||||
.ev-specular {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 4px;
|
||||
right: 4px;
|
||||
height: 1px;
|
||||
background: linear-gradient(
|
||||
90deg,
|
||||
transparent,
|
||||
color-mix(in srgb, var(--ev-color) 30%, rgba(255,255,255,0.50)) 30%,
|
||||
color-mix(in srgb, var(--ev-color) 30%, rgba(255,255,255,0.50)) 70%,
|
||||
transparent
|
||||
);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.ev-content {
|
||||
padding: 4px 7px 4px 11px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1px;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.event-short .ev-content {
|
||||
padding-top: 3px;
|
||||
padding-bottom: 3px;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.ev-title {
|
||||
font-size: 11.5px;
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
line-height: 1.3;
|
||||
letter-spacing: -0.1px;
|
||||
}
|
||||
|
||||
.event-time,
|
||||
.event-location {
|
||||
.event-short .ev-title {
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.ev-time {
|
||||
font-size: 10px;
|
||||
color: var(--text-secondary);
|
||||
font-weight: 500;
|
||||
color: color-mix(in srgb, var(--ev-color) 75%, rgba(255,255,255,0.6));
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.ev-location {
|
||||
font-size: 10px;
|
||||
color: rgba(255, 255, 255, 0.42);
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
line-height: 1.3;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 3px;
|
||||
}
|
||||
|
||||
.ev-loc-dot {
|
||||
font-size: 12px;
|
||||
line-height: 1;
|
||||
color: var(--ev-color);
|
||||
opacity: 0.7;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import AppIcon from '../AppIcon.vue'
|
|||
|
||||
const props = defineProps<{
|
||||
event: CalendarEvent
|
||||
color?: string
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{ close: [] }>()
|
||||
|
|
@ -18,62 +19,115 @@ const dateLabel = computed(() => {
|
|||
if (props.event.isAllDay) {
|
||||
const isSameDay = start.toDateString() === end.toDateString()
|
||||
if (isSameDay) return format(start, 'd MMMM yyyy', { locale: ru })
|
||||
const endAdjusted = new Date(end.getTime() - 1) // all-day end is exclusive
|
||||
const endAdjusted = new Date(end.getTime() - 1)
|
||||
return `${format(start, 'd MMMM', { locale: ru })} – ${format(endAdjusted, 'd MMMM yyyy', { locale: ru })}`
|
||||
}
|
||||
|
||||
const sameDay = start.toDateString() === end.toDateString()
|
||||
if (sameDay) {
|
||||
return `${format(start, 'd MMMM yyyy, HH:mm', { locale: ru })} – ${format(end, 'HH:mm')}`
|
||||
return `${format(start, 'd MMMM yyyy', { locale: ru })}, ${format(start, 'HH:mm')} – ${format(end, 'HH:mm')}`
|
||||
}
|
||||
return `${format(start, 'd MMMM HH:mm', { locale: ru })} – ${format(end, 'd MMMM HH:mm yyyy', { locale: ru })}`
|
||||
})
|
||||
|
||||
const statusLabel: Record<string, string> = {
|
||||
confirmed: 'Подтверждено',
|
||||
tentative: 'Предварительно',
|
||||
cancelled: 'Отменено'
|
||||
const durationLabel = computed(() => {
|
||||
if (props.event.isAllDay) return 'Весь день'
|
||||
const start = new Date(props.event.start)
|
||||
const end = new Date(props.event.end)
|
||||
const mins = Math.round((end.getTime() - start.getTime()) / 60_000)
|
||||
if (mins < 60) return `${mins} мин`
|
||||
const h = Math.floor(mins / 60)
|
||||
const m = mins % 60
|
||||
return m > 0 ? `${h} ч ${m} мин` : `${h} ч`
|
||||
})
|
||||
|
||||
const statusConfig = {
|
||||
confirmed: { label: 'Подтверждено', color: '#4ade80' },
|
||||
tentative: { label: 'Предварительно', color: '#f0a500' },
|
||||
cancelled: { label: 'Отменено', color: '#ff5555' }
|
||||
}
|
||||
|
||||
// CAL_COLORS palette (same as WeekView)
|
||||
const CAL_COLORS = ['#a8e600', '#38bdf8', '#a78bfa', '#f472b6', '#fb923c', '#4ade80', '#f87171']
|
||||
function calendarColor(id: string): string {
|
||||
let hash = 0
|
||||
for (let i = 0; i < id.length; i++) hash = (hash * 31 + id.charCodeAt(i)) & 0xffffff
|
||||
return CAL_COLORS[Math.abs(hash) % CAL_COLORS.length]
|
||||
}
|
||||
|
||||
const evColor = computed(() => props.color ?? calendarColor(props.event.calendarId))
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="popup-backdrop" @click.self="emit('close')">
|
||||
<div class="popup">
|
||||
<div class="popup" :style="{ '--ev-color': evColor }">
|
||||
<!-- Color accent strip -->
|
||||
<div class="popup-accent" />
|
||||
|
||||
<!-- Header -->
|
||||
<div class="popup-header">
|
||||
<h3 class="popup-title">{{ event.title }}</h3>
|
||||
<div class="popup-title-wrap">
|
||||
<div class="popup-color-dot" />
|
||||
<h3 class="popup-title">{{ event.title }}</h3>
|
||||
</div>
|
||||
<button class="close-btn" @click="emit('close')">
|
||||
<AppIcon name="close" :size="14" />
|
||||
<AppIcon name="close" :size="12" />
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Metadata rows -->
|
||||
<div class="popup-body">
|
||||
|
||||
<!-- Date & duration -->
|
||||
<div class="meta-row">
|
||||
<span class="meta-icon">📅</span>
|
||||
<span>{{ dateLabel }}</span>
|
||||
<div class="meta-icon-wrap">
|
||||
<AppIcon name="calendar" :size="13" />
|
||||
</div>
|
||||
<div class="meta-text">
|
||||
<span class="meta-primary">{{ dateLabel }}</span>
|
||||
<span class="meta-secondary">{{ durationLabel }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="event.status && event.status !== 'confirmed'" class="meta-row status" :class="event.status">
|
||||
<span class="meta-icon">●</span>
|
||||
<span>{{ statusLabel[event.status] ?? event.status }}</span>
|
||||
<!-- Status (non-confirmed only) -->
|
||||
<div
|
||||
v-if="event.status && event.status !== 'confirmed'"
|
||||
class="meta-row status-row"
|
||||
:style="{ '--status-color': statusConfig[event.status]?.color ?? '#888' }"
|
||||
>
|
||||
<div class="meta-icon-wrap status-icon">
|
||||
<span class="status-dot" />
|
||||
</div>
|
||||
<span class="meta-primary">{{ statusConfig[event.status]?.label ?? event.status }}</span>
|
||||
</div>
|
||||
|
||||
<!-- Location -->
|
||||
<div v-if="event.location" class="meta-row">
|
||||
<span class="meta-icon">📍</span>
|
||||
<span>{{ event.location }}</span>
|
||||
<div class="meta-icon-wrap">
|
||||
<AppIcon name="location" :size="13" />
|
||||
</div>
|
||||
<span class="meta-primary">{{ event.location }}</span>
|
||||
</div>
|
||||
|
||||
<!-- Organizer -->
|
||||
<div v-if="event.organizer" class="meta-row">
|
||||
<span class="meta-icon">👤</span>
|
||||
<span>{{ event.organizer }}</span>
|
||||
<div class="meta-icon-wrap">
|
||||
<AppIcon name="person" :size="13" />
|
||||
</div>
|
||||
<span class="meta-primary">{{ event.organizer }}</span>
|
||||
</div>
|
||||
|
||||
<div v-if="event.attendees.length > 0" class="meta-row attendees">
|
||||
<span class="meta-icon">👥</span>
|
||||
<!-- Attendees -->
|
||||
<div v-if="event.attendees.length > 0" class="meta-row attendees-row">
|
||||
<div class="meta-icon-wrap">
|
||||
<AppIcon name="people" :size="13" />
|
||||
</div>
|
||||
<div class="attendee-list">
|
||||
<span v-for="a in event.attendees" :key="a" class="attendee-chip">{{ a }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Description -->
|
||||
<div v-if="event.description" class="description">
|
||||
{{ event.description }}
|
||||
</div>
|
||||
|
|
@ -90,86 +144,193 @@ const statusLabel: Record<string, string> = {
|
|||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: rgba(0, 0, 0, 0.45);
|
||||
backdrop-filter: blur(4px);
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
backdrop-filter: blur(6px);
|
||||
-webkit-backdrop-filter: blur(6px);
|
||||
animation: backdrop-in 180ms ease;
|
||||
}
|
||||
|
||||
@keyframes backdrop-in {
|
||||
from { opacity: 0; }
|
||||
to { opacity: 1; }
|
||||
}
|
||||
|
||||
.popup {
|
||||
width: 400px;
|
||||
max-width: 90vw;
|
||||
max-height: 80vh;
|
||||
width: 420px;
|
||||
max-width: 92vw;
|
||||
max-height: 82vh;
|
||||
overflow-y: auto;
|
||||
border-radius: var(--radius-xl);
|
||||
border: 1px solid var(--glass-border-strong);
|
||||
border-radius: 20px;
|
||||
border: 1px solid rgba(255, 255, 255, 0.11);
|
||||
border-top-color: rgba(255, 255, 255, 0.18);
|
||||
background:
|
||||
linear-gradient(160deg, rgba(255,255,255,0.09) 0%, rgba(255,255,255,0.03) 100%),
|
||||
rgba(14, 14, 22, 0.94);
|
||||
backdrop-filter: blur(48px) saturate(2);
|
||||
linear-gradient(160deg, rgba(255, 255, 255, 0.095) 0%, rgba(255, 255, 255, 0.030) 50%, transparent 100%),
|
||||
rgba(14, 14, 24, 0.95);
|
||||
backdrop-filter: blur(56px) saturate(2.2);
|
||||
-webkit-backdrop-filter: blur(56px) saturate(2.2);
|
||||
box-shadow:
|
||||
inset 0 1px 0 rgba(255,255,255,0.14),
|
||||
var(--shadow-xl);
|
||||
padding: 20px;
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.17),
|
||||
0 4px 24px rgba(0, 0, 0, 0.45),
|
||||
0 24px 80px rgba(0, 0, 0, 0.70),
|
||||
0 0 0 1px rgba(0, 0, 0, 0.3);
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
animation: popup-in 200ms cubic-bezier(0.34, 1.4, 0.64, 1);
|
||||
}
|
||||
|
||||
@keyframes popup-in {
|
||||
from { opacity: 0; transform: scale(0.93) translateY(8px); }
|
||||
to { opacity: 1; transform: scale(1) translateY(0); }
|
||||
}
|
||||
|
||||
/* Color accent strip at top */
|
||||
.popup-accent {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 3px;
|
||||
background: linear-gradient(
|
||||
90deg,
|
||||
transparent 0%,
|
||||
color-mix(in srgb, var(--ev-color) 70%, transparent) 20%,
|
||||
var(--ev-color) 50%,
|
||||
color-mix(in srgb, var(--ev-color) 70%, transparent) 80%,
|
||||
transparent 100%
|
||||
);
|
||||
box-shadow: 0 0 20px color-mix(in srgb, var(--ev-color) 50%, transparent);
|
||||
}
|
||||
|
||||
/* Header */
|
||||
.popup-header {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 8px;
|
||||
margin-bottom: 16px;
|
||||
gap: 10px;
|
||||
padding: 20px 20px 14px;
|
||||
}
|
||||
|
||||
.popup-title-wrap {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 10px;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.popup-color-dot {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
border-radius: 50%;
|
||||
background: var(--ev-color);
|
||||
box-shadow: 0 0 8px color-mix(in srgb, var(--ev-color) 70%, transparent);
|
||||
flex-shrink: 0;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.popup-title {
|
||||
flex: 1;
|
||||
font-size: 16px;
|
||||
font-size: 17px;
|
||||
font-weight: 600;
|
||||
line-height: 1.3;
|
||||
color: var(--text-primary);
|
||||
margin: 0;
|
||||
letter-spacing: -0.3px;
|
||||
}
|
||||
|
||||
.close-btn {
|
||||
flex-shrink: 0;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: var(--text-muted);
|
||||
background: var(--glass-bg);
|
||||
border: 1px solid var(--glass-border);
|
||||
background: rgba(255, 255, 255, 0.06);
|
||||
border: 1px solid rgba(255, 255, 255, 0.09);
|
||||
transition: background var(--transition-fast), color var(--transition-fast);
|
||||
margin-top: 1px;
|
||||
}
|
||||
|
||||
.close-btn:hover {
|
||||
background: var(--glass-bg-hover);
|
||||
background: rgba(255, 255, 255, 0.11);
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
/* Body */
|
||||
.popup-body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
gap: 2px;
|
||||
padding: 0 20px 20px;
|
||||
}
|
||||
|
||||
.meta-row {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 8px;
|
||||
font-size: 13px;
|
||||
color: var(--text-secondary);
|
||||
gap: 10px;
|
||||
padding: 7px 10px;
|
||||
border-radius: 10px;
|
||||
transition: background var(--transition-fast);
|
||||
}
|
||||
|
||||
.meta-icon {
|
||||
.meta-row:hover {
|
||||
background: rgba(255, 255, 255, 0.04);
|
||||
}
|
||||
|
||||
.meta-icon-wrap {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
border-radius: 8px;
|
||||
background: rgba(255, 255, 255, 0.06);
|
||||
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
font-size: 14px;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.meta-text {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
justify-content: center;
|
||||
min-height: 28px;
|
||||
}
|
||||
|
||||
.meta-primary {
|
||||
font-size: 13px;
|
||||
color: var(--text-primary);
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.meta-row.tentative { color: var(--warning); }
|
||||
.meta-row.cancelled { color: var(--danger); }
|
||||
.meta-secondary {
|
||||
font-size: 11px;
|
||||
color: var(--text-muted);
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.attendees {
|
||||
/* Status */
|
||||
.status-row .meta-icon-wrap {
|
||||
background: color-mix(in srgb, var(--status-color) 15%, transparent);
|
||||
border-color: color-mix(in srgb, var(--status-color) 25%, transparent);
|
||||
}
|
||||
|
||||
.status-dot {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
background: var(--status-color);
|
||||
box-shadow: 0 0 6px var(--status-color);
|
||||
}
|
||||
|
||||
.status-row .meta-primary {
|
||||
color: var(--status-color);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/* Attendees */
|
||||
.attendees-row {
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
|
|
@ -177,24 +338,46 @@ const statusLabel: Record<string, string> = {
|
|||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 4px;
|
||||
padding-top: 2px;
|
||||
}
|
||||
|
||||
.attendee-chip {
|
||||
font-size: 11px;
|
||||
padding: 2px 8px;
|
||||
padding: 3px 9px;
|
||||
border-radius: var(--radius-full);
|
||||
background: var(--glass-bg-raised);
|
||||
border: 1px solid var(--glass-border);
|
||||
background: rgba(255, 255, 255, 0.06);
|
||||
border: 1px solid rgba(255, 255, 255, 0.09);
|
||||
color: var(--text-secondary);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/* Description */
|
||||
.description {
|
||||
font-size: 13px;
|
||||
color: var(--text-secondary);
|
||||
white-space: pre-wrap;
|
||||
line-height: 1.5;
|
||||
border-top: 1px solid var(--glass-border);
|
||||
padding-top: 10px;
|
||||
line-height: 1.6;
|
||||
padding: 12px 10px;
|
||||
margin-top: 4px;
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.06);
|
||||
}
|
||||
|
||||
/* Scrollbar */
|
||||
.popup {
|
||||
scrollbar-width: thin;
|
||||
scrollbar-color: rgba(255,255,255,0.1) transparent;
|
||||
}
|
||||
|
||||
.popup::-webkit-scrollbar {
|
||||
width: 4px;
|
||||
}
|
||||
|
||||
.popup::-webkit-scrollbar-track {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.popup::-webkit-scrollbar-thumb {
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
border-radius: 2px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
221
src/renderer/src/components/calendar/MiniCalendar.vue
Normal file
221
src/renderer/src/components/calendar/MiniCalendar.vue
Normal file
|
|
@ -0,0 +1,221 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue'
|
||||
import {
|
||||
startOfMonth,
|
||||
endOfMonth,
|
||||
startOfWeek,
|
||||
endOfWeek,
|
||||
addDays,
|
||||
addMonths,
|
||||
subMonths,
|
||||
isSameMonth,
|
||||
isSameDay,
|
||||
isToday,
|
||||
isWithinInterval
|
||||
} from 'date-fns'
|
||||
import { ru } from 'date-fns/locale'
|
||||
import { format } from 'date-fns'
|
||||
import AppIcon from '../AppIcon.vue'
|
||||
|
||||
const props = defineProps<{
|
||||
selectedWeekStart: Date
|
||||
selectedWeekEnd: Date
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{ dayClick: [date: Date] }>()
|
||||
|
||||
const viewMonth = ref(startOfMonth(props.selectedWeekStart))
|
||||
|
||||
const monthLabel = computed(() => format(viewMonth.value, 'LLLL yyyy', { locale: ru }))
|
||||
|
||||
const DOW_LABELS = ['Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Вс']
|
||||
|
||||
/** Build 6-week grid starting from Monday */
|
||||
const grid = computed((): Date[] => {
|
||||
const monthStart = startOfMonth(viewMonth.value)
|
||||
const gridStart = startOfWeek(monthStart, { weekStartsOn: 1 })
|
||||
const monthEnd = endOfMonth(viewMonth.value)
|
||||
const gridEnd = endOfWeek(monthEnd, { weekStartsOn: 1 })
|
||||
const days: Date[] = []
|
||||
let cur = gridStart
|
||||
while (cur <= gridEnd) {
|
||||
days.push(cur)
|
||||
cur = addDays(cur, 1)
|
||||
}
|
||||
return days
|
||||
})
|
||||
|
||||
function isSelected(d: Date): boolean {
|
||||
return isWithinInterval(d, { start: props.selectedWeekStart, end: props.selectedWeekEnd })
|
||||
}
|
||||
|
||||
function isWeekStart(d: Date): boolean {
|
||||
return isSameDay(d, props.selectedWeekStart)
|
||||
}
|
||||
|
||||
function isWeekEnd(d: Date): boolean {
|
||||
return isSameDay(d, props.selectedWeekEnd)
|
||||
}
|
||||
|
||||
function prevMonth(): void {
|
||||
viewMonth.value = subMonths(viewMonth.value, 1)
|
||||
}
|
||||
|
||||
function nextMonth(): void {
|
||||
viewMonth.value = addMonths(viewMonth.value, 1)
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="mini-cal">
|
||||
<div class="mini-header">
|
||||
<button class="mini-nav" @click="prevMonth">
|
||||
<AppIcon name="chevron-right" :size="11" style="transform: rotate(180deg)" />
|
||||
</button>
|
||||
<span class="mini-month">{{ monthLabel }}</span>
|
||||
<button class="mini-nav" @click="nextMonth">
|
||||
<AppIcon name="chevron-right" :size="11" />
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="dow-row">
|
||||
<span v-for="d in DOW_LABELS" :key="d" class="dow">{{ d }}</span>
|
||||
</div>
|
||||
|
||||
<div class="day-grid">
|
||||
<button
|
||||
v-for="(day, i) in grid"
|
||||
:key="i"
|
||||
class="day-cell"
|
||||
:class="{
|
||||
'other-month': !isSameMonth(day, viewMonth),
|
||||
'is-today': isToday(day),
|
||||
'in-range': isSelected(day),
|
||||
'range-start': isWeekStart(day),
|
||||
'range-end': isWeekEnd(day)
|
||||
}"
|
||||
@click="emit('dayClick', day)"
|
||||
>
|
||||
{{ format(day, 'd') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.mini-cal {
|
||||
padding: 10px 10px 8px;
|
||||
}
|
||||
|
||||
.mini-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.mini-month {
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
color: var(--text-secondary);
|
||||
text-transform: capitalize;
|
||||
letter-spacing: 0.2px;
|
||||
}
|
||||
|
||||
.mini-nav {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border-radius: var(--radius-sm);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: var(--text-muted);
|
||||
background: transparent;
|
||||
border: 1px solid transparent;
|
||||
transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
|
||||
}
|
||||
|
||||
.mini-nav:hover {
|
||||
background: var(--glass-bg-raised);
|
||||
border-color: var(--glass-border);
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.dow-row {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(7, 1fr);
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
|
||||
.dow {
|
||||
font-size: 9px;
|
||||
font-weight: 600;
|
||||
text-align: center;
|
||||
color: var(--text-muted);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.3px;
|
||||
padding: 2px 0;
|
||||
}
|
||||
|
||||
.day-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(7, 1fr);
|
||||
gap: 1px;
|
||||
}
|
||||
|
||||
.day-cell {
|
||||
aspect-ratio: 1;
|
||||
font-size: 11px;
|
||||
font-weight: 400;
|
||||
color: var(--text-secondary);
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
background: transparent;
|
||||
border: none;
|
||||
transition: background var(--transition-fast), color var(--transition-fast);
|
||||
position: relative;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.day-cell:hover {
|
||||
background: var(--glass-bg-hover);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.day-cell.other-month {
|
||||
color: var(--text-muted);
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.day-cell.is-today {
|
||||
color: var(--accent);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.day-cell.in-range {
|
||||
background: rgba(168, 230, 0, 0.10);
|
||||
color: var(--text-primary);
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.day-cell.range-start {
|
||||
border-radius: 4px 0 0 4px;
|
||||
background: rgba(168, 230, 0, 0.22);
|
||||
color: var(--accent);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.day-cell.range-end {
|
||||
border-radius: 0 4px 4px 0;
|
||||
background: rgba(168, 230, 0, 0.22);
|
||||
color: var(--accent);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.day-cell.range-start.range-end {
|
||||
border-radius: 4px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, computed, onMounted, watch } from 'vue'
|
||||
import { ref, computed, onMounted, onUnmounted, watch } from 'vue'
|
||||
import { format, addDays, isSameDay, isToday } from 'date-fns'
|
||||
import { ru } from 'date-fns/locale'
|
||||
import EventBlock from './EventBlock.vue'
|
||||
|
|
@ -14,7 +14,7 @@ const props = defineProps<{
|
|||
const emit = defineEmits<{ eventClick: [event: CalendarEvent] }>()
|
||||
|
||||
const scrollEl = ref<HTMLElement | null>(null)
|
||||
const HOUR_HEIGHT = 56 // px per hour
|
||||
const HOUR_HEIGHT = 60 // px per hour
|
||||
const HOURS = Array.from({ length: 24 }, (_, i) => i)
|
||||
|
||||
// ── Days of the week ────────────────────────────────────────────────────────
|
||||
|
|
@ -38,17 +38,14 @@ const now = ref(new Date())
|
|||
let timerId: ReturnType<typeof setInterval>
|
||||
|
||||
onMounted(() => {
|
||||
timerId = setInterval(() => { now.value = new Date() }, 60_000)
|
||||
// Scroll to business hours (8:00)
|
||||
scrollEl.value?.scrollTo({ top: 8 * HOUR_HEIGHT - 20, behavior: 'smooth' })
|
||||
timerId = setInterval(() => { now.value = new Date() }, 30_000)
|
||||
scrollEl.value?.scrollTo({ top: 8 * HOUR_HEIGHT - 30, behavior: 'smooth' })
|
||||
})
|
||||
|
||||
// Re-scroll when week changes
|
||||
watch(() => props.weekStart, () => {
|
||||
scrollEl.value?.scrollTo({ top: 8 * HOUR_HEIGHT - 20, behavior: 'smooth' })
|
||||
scrollEl.value?.scrollTo({ top: 8 * HOUR_HEIGHT - 30, behavior: 'smooth' })
|
||||
})
|
||||
|
||||
import { onUnmounted } from 'vue'
|
||||
onUnmounted(() => clearInterval(timerId))
|
||||
|
||||
const nowTop = computed(() => {
|
||||
|
|
@ -72,18 +69,9 @@ interface LayoutEvent {
|
|||
totalColumns: number
|
||||
}
|
||||
|
||||
const allDayEvents = computed(() => {
|
||||
return props.events.filter((e) => e.isAllDay)
|
||||
})
|
||||
const allDayEvents = computed(() => props.events.filter((e) => e.isAllDay))
|
||||
const timedEvents = computed(() => props.events.filter((e) => !e.isAllDay))
|
||||
|
||||
const timedEvents = computed(() => {
|
||||
return props.events.filter((e) => !e.isAllDay)
|
||||
})
|
||||
|
||||
/**
|
||||
* Lay out timed events per day, detecting overlaps.
|
||||
* Events in the same day that overlap in time are split into columns.
|
||||
*/
|
||||
const layoutEvents = computed((): LayoutEvent[] => {
|
||||
const result: LayoutEvent[] = []
|
||||
|
||||
|
|
@ -97,7 +85,6 @@ const layoutEvents = computed((): LayoutEvent[] => {
|
|||
(eStart < dayDate && eEnd > dayDate)
|
||||
})
|
||||
|
||||
// Simple overlap detection: group overlapping events
|
||||
const columns: CalendarEvent[][] = []
|
||||
for (const ev of dayEvs) {
|
||||
const eStart = new Date(ev.start).getTime()
|
||||
|
|
@ -116,13 +103,11 @@ const layoutEvents = computed((): LayoutEvent[] => {
|
|||
if (!placed) columns.push([ev])
|
||||
}
|
||||
|
||||
// Build LayoutEvent for each event
|
||||
for (let colIdx = 0; colIdx < columns.length; colIdx++) {
|
||||
for (const ev of columns[colIdx]) {
|
||||
const eStart = new Date(ev.start)
|
||||
const eEnd = new Date(ev.end)
|
||||
|
||||
// Clamp to day boundaries
|
||||
const dayStart = new Date(dayDate)
|
||||
dayStart.setHours(0, 0, 0, 0)
|
||||
const dayEnd = new Date(dayDate)
|
||||
|
|
@ -134,7 +119,6 @@ const layoutEvents = computed((): LayoutEvent[] => {
|
|||
const startHours = clampedStart.getHours() + clampedStart.getMinutes() / 60
|
||||
const durationHours = (clampedEnd.getTime() - clampedStart.getTime()) / 3_600_000
|
||||
|
||||
// Find how many columns this event belongs to (for width calculation)
|
||||
const totalCols = columns.filter((col) => {
|
||||
const eS = new Date(ev.start).getTime()
|
||||
const eE = new Date(ev.end).getTime()
|
||||
|
|
@ -150,7 +134,7 @@ const layoutEvents = computed((): LayoutEvent[] => {
|
|||
event: ev,
|
||||
dayIndex,
|
||||
top: startHours * HOUR_HEIGHT,
|
||||
height: Math.max(durationHours * HOUR_HEIGHT, 18),
|
||||
height: Math.max(durationHours * HOUR_HEIGHT, 22),
|
||||
column: colIdx,
|
||||
totalColumns: totalCols
|
||||
})
|
||||
|
|
@ -161,7 +145,6 @@ const layoutEvents = computed((): LayoutEvent[] => {
|
|||
return result
|
||||
})
|
||||
|
||||
/** Events per day index for rendering into the correct column. */
|
||||
function eventsForDay(dayIndex: number): LayoutEvent[] {
|
||||
return layoutEvents.value.filter((e) => e.dayIndex === dayIndex)
|
||||
}
|
||||
|
|
@ -176,7 +159,7 @@ function allDayEventsForDay(dayIndex: number): CalendarEvent[] {
|
|||
}
|
||||
|
||||
function formatHour(h: number): string {
|
||||
return h === 0 ? '00:00' : `${String(h).padStart(2, '0')}:00`
|
||||
return h === 0 ? '' : `${String(h).padStart(2, '0')}:00`
|
||||
}
|
||||
|
||||
function eventStyle(layout: LayoutEvent): Record<string, string> {
|
||||
|
|
@ -190,7 +173,6 @@ function eventStyle(layout: LayoutEvent): Record<string, string> {
|
|||
}
|
||||
}
|
||||
|
||||
// Accent color palette for calendars (cycle through)
|
||||
const CAL_COLORS = ['#a8e600', '#38bdf8', '#a78bfa', '#f472b6', '#fb923c', '#4ade80', '#f87171']
|
||||
function calendarColor(calendarId: string): string {
|
||||
let hash = 0
|
||||
|
|
@ -211,18 +193,20 @@ function calendarColor(calendarId: string): string {
|
|||
:class="{ today: day.isToday }"
|
||||
>
|
||||
<span class="day-name">{{ day.dayName }}</span>
|
||||
<span class="day-num">{{ day.dayNum }}</span>
|
||||
<div class="day-num-wrap" :class="{ today: day.isToday }">
|
||||
<span class="day-num">{{ day.dayNum }}</span>
|
||||
</div>
|
||||
<span class="month-label">{{ day.monthLabel }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- All-day event row (shown only when there are all-day events) -->
|
||||
<!-- All-day event row -->
|
||||
<div
|
||||
v-if="events.some((e) => e.isAllDay)"
|
||||
class="allday-row"
|
||||
>
|
||||
<div class="time-gutter allday-gutter">
|
||||
<span class="allday-label">весь день</span>
|
||||
<span class="allday-label">всё<br>время</span>
|
||||
</div>
|
||||
<div v-for="(day, i) in days" :key="i" class="allday-col">
|
||||
<div
|
||||
|
|
@ -260,12 +244,16 @@ function calendarColor(calendarId: string): string {
|
|||
:class="{ today: day.isToday }"
|
||||
>
|
||||
<!-- Hour grid lines -->
|
||||
<div
|
||||
v-for="h in HOURS"
|
||||
:key="h"
|
||||
class="hour-row"
|
||||
:style="{ top: `${h * HOUR_HEIGHT}px`, height: `${HOUR_HEIGHT}px` }"
|
||||
/>
|
||||
<template v-for="h in HOURS" :key="h">
|
||||
<div
|
||||
class="hour-row"
|
||||
:style="{ top: `${h * HOUR_HEIGHT}px`, height: `${HOUR_HEIGHT}px` }"
|
||||
/>
|
||||
<div
|
||||
class="half-hour-row"
|
||||
:style="{ top: `${h * HOUR_HEIGHT + HOUR_HEIGHT / 2}px` }"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<!-- Current time indicator -->
|
||||
<div
|
||||
|
|
@ -290,7 +278,7 @@ function calendarColor(calendarId: string): string {
|
|||
|
||||
<!-- Loading overlay -->
|
||||
<div v-if="loading" class="loading-overlay">
|
||||
<span class="spinner" />
|
||||
<div class="loading-ring" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -308,12 +296,13 @@ function calendarColor(calendarId: string): string {
|
|||
.day-headers {
|
||||
display: flex;
|
||||
flex-shrink: 0;
|
||||
border-bottom: 1px solid var(--glass-border);
|
||||
background: rgba(10, 10, 18, 0.5);
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.06);
|
||||
background: rgba(10, 10, 18, 0.35);
|
||||
backdrop-filter: blur(8px);
|
||||
}
|
||||
|
||||
.time-gutter {
|
||||
width: 52px;
|
||||
width: 56px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
|
|
@ -322,55 +311,70 @@ function calendarColor(calendarId: string): string {
|
|||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 8px 4px;
|
||||
font-size: 11px;
|
||||
color: var(--text-muted);
|
||||
border-left: 1px solid var(--glass-border);
|
||||
gap: 2px;
|
||||
padding: 10px 4px 8px;
|
||||
border-left: 1px solid rgba(255, 255, 255, 0.05);
|
||||
gap: 3px;
|
||||
user-select: none;
|
||||
transition: background var(--transition-fast);
|
||||
}
|
||||
|
||||
.day-header.today .day-num {
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
border-radius: 50%;
|
||||
background: var(--accent);
|
||||
color: var(--accent-text);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-weight: 700;
|
||||
.day-header.today {
|
||||
background: rgba(168, 230, 0, 0.04);
|
||||
}
|
||||
|
||||
.day-name {
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
font-size: 10px;
|
||||
font-weight: 700;
|
||||
color: var(--text-muted);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.6px;
|
||||
}
|
||||
|
||||
.day-num {
|
||||
font-size: 18px;
|
||||
font-weight: 300;
|
||||
color: var(--text-primary);
|
||||
line-height: 1;
|
||||
.day-header.today .day-name {
|
||||
color: var(--accent);
|
||||
}
|
||||
|
||||
.day-num-wrap {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
transition: background var(--transition-fast), box-shadow var(--transition-fast);
|
||||
}
|
||||
|
||||
.day-num-wrap.today {
|
||||
background: var(--accent);
|
||||
box-shadow: 0 0 16px rgba(168, 230, 0, 0.45);
|
||||
}
|
||||
|
||||
.day-num {
|
||||
font-size: 17px;
|
||||
font-weight: 300;
|
||||
color: var(--text-primary);
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.day-num-wrap.today .day-num {
|
||||
color: var(--accent-text);
|
||||
font-weight: 700;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.month-label {
|
||||
font-size: 10px;
|
||||
font-size: 9px;
|
||||
color: var(--text-muted);
|
||||
text-transform: capitalize;
|
||||
}
|
||||
|
||||
/* ── All-day row ── */
|
||||
.allday-row {
|
||||
display: flex;
|
||||
flex-shrink: 0;
|
||||
border-bottom: 1px solid var(--glass-border);
|
||||
min-height: 28px;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.06);
|
||||
min-height: 30px;
|
||||
background: rgba(255, 255, 255, 0.01);
|
||||
}
|
||||
|
||||
.allday-gutter {
|
||||
|
|
@ -381,16 +385,19 @@ function calendarColor(calendarId: string): string {
|
|||
}
|
||||
|
||||
.allday-label {
|
||||
font-size: 9px;
|
||||
font-size: 8px;
|
||||
font-weight: 600;
|
||||
color: var(--text-muted);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.4px;
|
||||
text-align: right;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.allday-col {
|
||||
flex: 1;
|
||||
border-left: 1px solid var(--glass-border);
|
||||
padding: 2px 3px;
|
||||
border-left: 1px solid rgba(255, 255, 255, 0.05);
|
||||
padding: 3px 4px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
|
|
@ -398,20 +405,23 @@ function calendarColor(calendarId: string): string {
|
|||
|
||||
.allday-event {
|
||||
font-size: 11px;
|
||||
padding: 1px 6px;
|
||||
border-radius: 4px;
|
||||
background: color-mix(in srgb, var(--event-color) 22%, transparent);
|
||||
border-left: 3px solid var(--event-color);
|
||||
font-weight: 500;
|
||||
padding: 2px 7px;
|
||||
border-radius: 5px;
|
||||
background: color-mix(in srgb, var(--event-color) 18%, transparent);
|
||||
border: 1px solid color-mix(in srgb, var(--event-color) 35%, transparent);
|
||||
color: var(--text-primary);
|
||||
cursor: pointer;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
font-weight: 500;
|
||||
backdrop-filter: blur(8px);
|
||||
transition: filter var(--transition-fast), background var(--transition-fast);
|
||||
}
|
||||
|
||||
.allday-event:hover {
|
||||
filter: brightness(1.15);
|
||||
filter: brightness(1.2);
|
||||
background: color-mix(in srgb, var(--event-color) 28%, transparent);
|
||||
}
|
||||
|
||||
/* ── Scrollable grid ── */
|
||||
|
|
@ -420,6 +430,21 @@ function calendarColor(calendarId: string): string {
|
|||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
position: relative;
|
||||
scrollbar-width: thin;
|
||||
scrollbar-color: rgba(255,255,255,0.1) transparent;
|
||||
}
|
||||
|
||||
.grid-scroll::-webkit-scrollbar {
|
||||
width: 4px;
|
||||
}
|
||||
|
||||
.grid-scroll::-webkit-scrollbar-track {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.grid-scroll::-webkit-scrollbar-thumb {
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.time-grid {
|
||||
|
|
@ -429,44 +454,54 @@ function calendarColor(calendarId: string): string {
|
|||
|
||||
/* ── Time gutter column ── */
|
||||
.time-gutter-col {
|
||||
width: 52px;
|
||||
width: 56px;
|
||||
flex-shrink: 0;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.hour-label {
|
||||
position: absolute;
|
||||
right: 8px;
|
||||
right: 10px;
|
||||
font-size: 10px;
|
||||
font-weight: 500;
|
||||
color: var(--text-muted);
|
||||
transform: translateY(-50%);
|
||||
user-select: none;
|
||||
white-space: nowrap;
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
/* ── Day column ── */
|
||||
.day-col {
|
||||
flex: 1;
|
||||
position: relative;
|
||||
border-left: 1px solid var(--glass-border);
|
||||
border-left: 1px solid rgba(255, 255, 255, 0.05);
|
||||
}
|
||||
|
||||
.day-col.today {
|
||||
background: rgba(168, 230, 0, 0.022);
|
||||
background: linear-gradient(
|
||||
180deg,
|
||||
rgba(168, 230, 0, 0.025) 0%,
|
||||
rgba(168, 230, 0, 0.012) 100%
|
||||
);
|
||||
}
|
||||
|
||||
/* ── Hour rows (grid lines) ── */
|
||||
/* ── Hour / half-hour grid lines ── */
|
||||
.hour-row {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.05);
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.045);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.hour-row:nth-child(2n) {
|
||||
border-top-color: transparent;
|
||||
border-top: 1px dashed rgba(255, 255, 255, 0.03);
|
||||
.half-hour-row {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 0;
|
||||
border-top: 1px dashed rgba(255, 255, 255, 0.022);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
/* ── Current time line ── */
|
||||
|
|
@ -475,22 +510,35 @@ function calendarColor(calendarId: string): string {
|
|||
left: 0;
|
||||
right: 0;
|
||||
height: 2px;
|
||||
background: var(--accent);
|
||||
opacity: 0.75;
|
||||
pointer-events: none;
|
||||
z-index: 4;
|
||||
z-index: 5;
|
||||
background: linear-gradient(
|
||||
90deg,
|
||||
transparent 0%,
|
||||
var(--accent) 8%,
|
||||
var(--accent) 100%
|
||||
);
|
||||
box-shadow: 0 0 6px rgba(168, 230, 0, 0.5);
|
||||
}
|
||||
|
||||
.now-dot {
|
||||
position: absolute;
|
||||
left: -4px;
|
||||
left: -5px;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
border-radius: 50%;
|
||||
background: var(--accent);
|
||||
box-shadow: 0 0 6px var(--accent);
|
||||
box-shadow:
|
||||
0 0 0 2px rgba(168, 230, 0, 0.25),
|
||||
0 0 10px rgba(168, 230, 0, 0.7);
|
||||
animation: pulse-dot 2s ease-in-out infinite;
|
||||
}
|
||||
|
||||
@keyframes pulse-dot {
|
||||
0%, 100% { box-shadow: 0 0 0 2px rgba(168, 230, 0, 0.25), 0 0 10px rgba(168, 230, 0, 0.7); }
|
||||
50% { box-shadow: 0 0 0 4px rgba(168, 230, 0, 0.15), 0 0 18px rgba(168, 230, 0, 0.5); }
|
||||
}
|
||||
|
||||
/* ── Loading overlay ── */
|
||||
|
|
@ -500,18 +548,19 @@ function calendarColor(calendarId: string): string {
|
|||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: rgba(9, 9, 14, 0.45);
|
||||
backdrop-filter: blur(4px);
|
||||
background: rgba(9, 9, 14, 0.55);
|
||||
backdrop-filter: blur(6px);
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.spinner {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
border: 2px solid var(--glass-border);
|
||||
border-top-color: var(--accent);
|
||||
.loading-ring {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
border-radius: 50%;
|
||||
animation: spin 0.8s linear infinite;
|
||||
border: 2px solid rgba(168, 230, 0, 0.15);
|
||||
border-top-color: var(--accent);
|
||||
animation: spin 0.75s linear infinite;
|
||||
box-shadow: 0 0 12px rgba(168, 230, 0, 0.2);
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
|
|
|
|||
|
|
@ -113,6 +113,11 @@ export const useCalendarStore = defineStore('calendar', () => {
|
|||
selectedEvent.value = event
|
||||
}
|
||||
|
||||
async function goToDate(date: Date): Promise<void> {
|
||||
currentWeekStart.value = startOfWeek(date, { weekStartsOn: 1 })
|
||||
await loadEvents()
|
||||
}
|
||||
|
||||
return {
|
||||
calendars,
|
||||
events,
|
||||
|
|
@ -130,6 +135,7 @@ export const useCalendarStore = defineStore('calendar', () => {
|
|||
goToToday,
|
||||
prevWeek,
|
||||
nextWeek,
|
||||
selectEvent
|
||||
selectEvent,
|
||||
goToDate
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import { useCalendarStore } from '../stores/calendar.store'
|
|||
import { useAccountsStore } from '../stores/accounts.store'
|
||||
import AccountSwitcher from '../components/sidebar/AccountSwitcher.vue'
|
||||
import WeekView from '../components/calendar/WeekView.vue'
|
||||
import MiniCalendar from '../components/calendar/MiniCalendar.vue'
|
||||
import EventDetailPopup from '../components/calendar/EventDetailPopup.vue'
|
||||
import AddAccountDialog from '../components/accounts/AddAccountDialog.vue'
|
||||
import NotificationContainer from '../components/notifications/NotificationContainer.vue'
|
||||
|
|
@ -33,7 +34,7 @@ async function probeCalDAV(): Promise<void> {
|
|||
}
|
||||
}
|
||||
|
||||
// Calendar color palette, same as WeekView
|
||||
// Calendar color palette
|
||||
const CAL_COLORS = ['#a8e600', '#38bdf8', '#a78bfa', '#f472b6', '#fb923c', '#4ade80', '#f87171']
|
||||
function calendarColor(calendarId: string): string {
|
||||
let hash = 0
|
||||
|
|
@ -65,31 +66,33 @@ function handleEventClick(ev: CalendarEvent): void {
|
|||
<template>
|
||||
<div class="calendar-shell">
|
||||
<div class="content-area">
|
||||
<!-- Account switcher (same as mail view) -->
|
||||
<!-- Account switcher -->
|
||||
<div class="account-bar">
|
||||
<AccountSwitcher @add-account="showAddAccount = true" />
|
||||
</div>
|
||||
|
||||
<!-- Calendar sidebar -->
|
||||
<div class="cal-sidebar">
|
||||
<div class="sidebar-header">
|
||||
<AppIcon name="calendar" :size="15" class="cal-icon" />
|
||||
<span>Календарь</span>
|
||||
</div>
|
||||
|
||||
<!-- Error state -->
|
||||
<div v-if="calStore.error" class="sidebar-error">
|
||||
<div class="error-icon-wrap">
|
||||
<AppIcon name="warning" :size="20" class="error-icon" />
|
||||
</div>
|
||||
<p class="error-title">CalDAV недоступен</p>
|
||||
<p class="error-detail">{{ calStore.error }}</p>
|
||||
<div class="error-actions">
|
||||
<button class="retry-btn" @click="reload">
|
||||
<AppIcon name="refresh" :size="12" />
|
||||
Повторить
|
||||
</button>
|
||||
<button class="retry-btn" :disabled="probing" @click="probeCalDAV">
|
||||
<AppIcon name="search" :size="12" />
|
||||
{{ probing ? 'Сканирование…' : 'Найти путь' }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<button class="retry-btn" @click="reload">Повторить</button>
|
||||
<button class="retry-btn probe-btn" :disabled="probing" @click="probeCalDAV">
|
||||
{{ probing ? 'Сканирование…' : 'Найти CalDAV путь' }}
|
||||
</button>
|
||||
|
||||
<!-- Probe results -->
|
||||
<div v-if="probeResults" class="probe-results">
|
||||
<p class="probe-title">Результаты сканирования:</p>
|
||||
<p class="probe-title">Результаты:</p>
|
||||
<div
|
||||
v-for="r in probeResults"
|
||||
:key="r.path"
|
||||
|
|
@ -99,53 +102,81 @@ function handleEventClick(ev: CalendarEvent): void {
|
|||
<span class="probe-path">{{ r.path }}</span>
|
||||
<span class="probe-note">{{ r.note }}</span>
|
||||
</div>
|
||||
<p class="probe-hint">Скопируйте путь со статусом 207 в настройки CalDAV → «Путь».</p>
|
||||
<p class="probe-hint">Скопируйте путь со статусом 207 в настройки CalDAV.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Calendar list -->
|
||||
<div v-else-if="!calStore.loadingCalendars" class="calendar-list">
|
||||
<div
|
||||
v-for="cal in calStore.calendars"
|
||||
:key="cal.id"
|
||||
class="cal-item"
|
||||
:class="{ active: calStore.selectedCalendarIds.has(cal.id) }"
|
||||
@click="calStore.toggleCalendar(cal.id)"
|
||||
>
|
||||
<span
|
||||
class="cal-dot"
|
||||
:style="{ background: calendarColor(cal.id) }"
|
||||
/>
|
||||
<span class="cal-name" :title="cal.name">{{ cal.name }}</span>
|
||||
<template v-else>
|
||||
<!-- Mini calendar navigator -->
|
||||
<MiniCalendar
|
||||
:selected-week-start="calStore.currentWeekStart"
|
||||
:selected-week-end="calStore.currentWeekEnd"
|
||||
@day-click="calStore.goToDate($event)"
|
||||
/>
|
||||
|
||||
<div class="sidebar-divider" />
|
||||
|
||||
<!-- Calendar list header -->
|
||||
<div class="cal-list-header">
|
||||
<AppIcon name="calendar" :size="12" class="cal-list-icon" />
|
||||
<span>Мои календари</span>
|
||||
</div>
|
||||
|
||||
<div v-if="calStore.calendars.length === 0 && !calStore.loadingCalendars && !calStore.error" class="no-calendars">
|
||||
Нет доступных календарей
|
||||
<!-- Loading state -->
|
||||
<div v-if="calStore.loadingCalendars" class="sidebar-loading">
|
||||
<span class="spinner" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-else class="sidebar-loading">
|
||||
<span class="spinner" />
|
||||
</div>
|
||||
<!-- Calendar list -->
|
||||
<div v-else class="calendar-list">
|
||||
<div
|
||||
v-for="cal in calStore.calendars"
|
||||
:key="cal.id"
|
||||
class="cal-item"
|
||||
:class="{ active: calStore.selectedCalendarIds.has(cal.id) }"
|
||||
@click="calStore.toggleCalendar(cal.id)"
|
||||
>
|
||||
<div class="cal-check" :class="{ checked: calStore.selectedCalendarIds.has(cal.id) }">
|
||||
<span
|
||||
class="cal-dot-inner"
|
||||
:style="{ background: calendarColor(cal.id) }"
|
||||
/>
|
||||
</div>
|
||||
<span class="cal-name" :title="cal.name">{{ cal.name }}</span>
|
||||
</div>
|
||||
|
||||
<div v-if="calStore.calendars.length === 0" class="no-calendars">
|
||||
Нет доступных<br>календарей
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<!-- Main calendar area -->
|
||||
<div class="calendar-main">
|
||||
<!-- Toolbar -->
|
||||
<div class="toolbar">
|
||||
<button class="nav-btn" @click="calStore.prevWeek()">
|
||||
<AppIcon name="chevron-right" :size="14" style="transform: rotate(180deg)" />
|
||||
</button>
|
||||
<button class="nav-btn today-btn" @click="calStore.goToToday()">Сегодня</button>
|
||||
<button class="nav-btn" @click="calStore.nextWeek()">
|
||||
<AppIcon name="chevron-right" :size="14" />
|
||||
</button>
|
||||
<div class="toolbar-nav">
|
||||
<button class="nav-btn" @click="calStore.prevWeek()">
|
||||
<AppIcon name="chevron-right" :size="13" style="transform: rotate(180deg)" />
|
||||
</button>
|
||||
<button class="nav-btn" @click="calStore.nextWeek()">
|
||||
<AppIcon name="chevron-right" :size="13" />
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<span class="week-label">{{ weekLabel() }}</span>
|
||||
<button class="today-btn" @click="calStore.goToToday()">Сегодня</button>
|
||||
|
||||
<button class="nav-btn refresh-btn" :disabled="calStore.loading" @click="calStore.loadEvents()">
|
||||
<AppIcon name="refresh" :size="14" :class="{ spinning: calStore.loading }" />
|
||||
</button>
|
||||
<h2 class="week-label">{{ weekLabel() }}</h2>
|
||||
|
||||
<div class="toolbar-right">
|
||||
<span v-if="calStore.visibleEvents.length > 0" class="event-count-badge">
|
||||
{{ calStore.visibleEvents.length }}
|
||||
</span>
|
||||
<button class="icon-btn" :disabled="calStore.loading" @click="calStore.loadEvents()" title="Обновить">
|
||||
<AppIcon name="refresh" :size="14" :class="{ spinning: calStore.loading }" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Week view -->
|
||||
|
|
@ -181,7 +212,7 @@ function handleEventClick(ev: CalendarEvent): void {
|
|||
>
|
||||
<div class="empty-content">
|
||||
<div class="empty-icon">
|
||||
<AppIcon name="calendar" :size="64" />
|
||||
<AppIcon name="calendar" :size="56" />
|
||||
</div>
|
||||
<h2>Добро пожаловать в Aero Mail</h2>
|
||||
<p>Добавьте почтовый аккаунт для просмотра календаря</p>
|
||||
|
|
@ -197,7 +228,7 @@ function handleEventClick(ev: CalendarEvent): void {
|
|||
flex-direction: column;
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
background: #07070c;
|
||||
background: var(--base-bg);
|
||||
}
|
||||
|
||||
.content-area {
|
||||
|
|
@ -209,7 +240,7 @@ function handleEventClick(ev: CalendarEvent): void {
|
|||
gap: 8px;
|
||||
}
|
||||
|
||||
/* Account bar — same styling as in AppShell */
|
||||
/* Account bar */
|
||||
.account-bar {
|
||||
width: var(--sidebar-width);
|
||||
flex-shrink: 0;
|
||||
|
|
@ -232,80 +263,113 @@ function handleEventClick(ev: CalendarEvent): void {
|
|||
|
||||
/* Calendar sidebar */
|
||||
.cal-sidebar {
|
||||
width: 200px;
|
||||
width: 192px;
|
||||
flex-shrink: 0;
|
||||
border-radius: 14px;
|
||||
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||
border: 1px solid rgba(255, 255, 255, 0.09);
|
||||
background:
|
||||
linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.015) 100%),
|
||||
rgba(9, 9, 15, 0.80);
|
||||
backdrop-filter: blur(28px) saturate(1.8);
|
||||
-webkit-backdrop-filter: blur(28px) saturate(1.8);
|
||||
linear-gradient(160deg, rgba(255, 255, 255, 0.065) 0%, rgba(255, 255, 255, 0.02) 100%),
|
||||
rgba(10, 10, 17, 0.85);
|
||||
backdrop-filter: blur(32px) saturate(1.9);
|
||||
-webkit-backdrop-filter: blur(32px) saturate(1.9);
|
||||
overflow-y: auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
box-shadow:
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.10),
|
||||
0 8px 28px rgba(0, 0, 0, 0.40);
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.13),
|
||||
0 8px 28px rgba(0, 0, 0, 0.42);
|
||||
}
|
||||
|
||||
.sidebar-header {
|
||||
.sidebar-divider {
|
||||
height: 1px;
|
||||
margin: 0 12px;
|
||||
background: linear-gradient(90deg,
|
||||
transparent,
|
||||
rgba(255, 255, 255, 0.07) 20%,
|
||||
rgba(255, 255, 255, 0.07) 80%,
|
||||
transparent
|
||||
);
|
||||
}
|
||||
|
||||
/* Calendar list header */
|
||||
.cal-list-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 7px;
|
||||
padding: 14px 14px 10px;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
color: var(--text-secondary);
|
||||
letter-spacing: 0.3px;
|
||||
gap: 6px;
|
||||
padding: 10px 12px 6px;
|
||||
font-size: 10px;
|
||||
font-weight: 700;
|
||||
color: var(--text-muted);
|
||||
letter-spacing: 0.6px;
|
||||
text-transform: uppercase;
|
||||
border-bottom: 1px solid var(--glass-border);
|
||||
}
|
||||
|
||||
.cal-icon {
|
||||
.cal-list-icon {
|
||||
color: var(--accent);
|
||||
}
|
||||
|
||||
/* Calendar list */
|
||||
.calendar-list {
|
||||
padding: 8px 0;
|
||||
padding: 2px 6px 8px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1px;
|
||||
}
|
||||
|
||||
.cal-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 6px 14px;
|
||||
gap: 9px;
|
||||
padding: 5px 8px;
|
||||
cursor: pointer;
|
||||
border-radius: 8px;
|
||||
margin: 0 4px;
|
||||
transition: background var(--transition-fast);
|
||||
opacity: 0.55;
|
||||
}
|
||||
|
||||
.cal-item.active {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.cal-item:hover {
|
||||
background: var(--glass-bg-hover);
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.cal-dot {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
.cal-check {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
border-radius: 5px;
|
||||
border: 1.5px solid rgba(255, 255, 255, 0.15);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
transition: border-color var(--transition-fast), background var(--transition-fast);
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.cal-item.active .cal-check {
|
||||
border-color: transparent;
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
}
|
||||
|
||||
.cal-dot-inner {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
flex-shrink: 0;
|
||||
box-shadow: 0 0 4px currentColor;
|
||||
transition: opacity var(--transition-fast), box-shadow var(--transition-fast);
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.cal-item.active .cal-dot-inner {
|
||||
opacity: 1;
|
||||
box-shadow: 0 0 5px currentColor;
|
||||
}
|
||||
|
||||
.cal-name {
|
||||
font-size: 13px;
|
||||
color: var(--text-secondary);
|
||||
font-size: 12px;
|
||||
color: var(--text-muted);
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
transition: color var(--transition-fast);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.cal-item.active .cal-name {
|
||||
|
|
@ -313,18 +377,37 @@ function handleEventClick(ev: CalendarEvent): void {
|
|||
}
|
||||
|
||||
.no-calendars {
|
||||
padding: 16px;
|
||||
font-size: 12px;
|
||||
padding: 12px 8px;
|
||||
font-size: 11px;
|
||||
color: var(--text-muted);
|
||||
text-align: center;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
/* Error state */
|
||||
.sidebar-error {
|
||||
padding: 12px 14px;
|
||||
padding: 16px 14px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.error-icon-wrap {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border-radius: 50%;
|
||||
background: rgba(255, 85, 85, 0.12);
|
||||
border: 1px solid rgba(255, 85, 85, 0.2);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
.error-icon {
|
||||
color: var(--danger);
|
||||
}
|
||||
|
||||
.error-title {
|
||||
|
|
@ -334,41 +417,56 @@ function handleEventClick(ev: CalendarEvent): void {
|
|||
}
|
||||
|
||||
.error-detail {
|
||||
font-size: 11px;
|
||||
font-size: 10px;
|
||||
color: var(--text-muted);
|
||||
word-break: break-all;
|
||||
user-select: text;
|
||||
-webkit-user-select: text;
|
||||
cursor: text;
|
||||
text-align: left;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.error-actions {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 5px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.retry-btn {
|
||||
align-self: flex-start;
|
||||
font-size: 12px;
|
||||
padding: 4px 12px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 5px;
|
||||
width: 100%;
|
||||
font-size: 11px;
|
||||
padding: 5px 10px;
|
||||
border-radius: var(--radius-sm);
|
||||
background: var(--glass-bg-raised);
|
||||
border: 1px solid var(--glass-border);
|
||||
color: var(--text-secondary);
|
||||
transition: background var(--transition-fast);
|
||||
font-weight: 500;
|
||||
}
|
||||
.retry-btn:hover:not(:disabled) {
|
||||
background: var(--glass-bg-hover);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
.retry-btn:hover:not(:disabled) { background: var(--glass-bg-hover); }
|
||||
.retry-btn:disabled { opacity: 0.5; cursor: default; }
|
||||
|
||||
.probe-btn { margin-top: 2px; }
|
||||
|
||||
.probe-results {
|
||||
margin-top: 6px;
|
||||
width: 100%;
|
||||
border-top: 1px solid var(--glass-border);
|
||||
padding-top: 8px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 3px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.probe-title {
|
||||
font-size: 11px;
|
||||
font-size: 10px;
|
||||
font-weight: 600;
|
||||
color: var(--text-secondary);
|
||||
margin-bottom: 2px;
|
||||
|
|
@ -388,7 +486,7 @@ function handleEventClick(ev: CalendarEvent): void {
|
|||
}
|
||||
|
||||
.probe-path {
|
||||
font-size: 10px;
|
||||
font-size: 9px;
|
||||
font-family: monospace;
|
||||
color: var(--text-primary);
|
||||
word-break: break-all;
|
||||
|
|
@ -398,7 +496,7 @@ function handleEventClick(ev: CalendarEvent): void {
|
|||
}
|
||||
|
||||
.probe-note {
|
||||
font-size: 10px;
|
||||
font-size: 9px;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
|
|
@ -408,10 +506,10 @@ function handleEventClick(ev: CalendarEvent): void {
|
|||
}
|
||||
|
||||
.probe-hint {
|
||||
font-size: 10px;
|
||||
font-size: 9px;
|
||||
color: var(--text-muted);
|
||||
line-height: 1.5;
|
||||
margin-top: 4px;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
.sidebar-loading {
|
||||
|
|
@ -428,69 +526,121 @@ function handleEventClick(ev: CalendarEvent): void {
|
|||
min-width: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border-radius: 14px;
|
||||
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||
border-radius: 16px;
|
||||
border: 1px solid rgba(255, 255, 255, 0.09);
|
||||
background:
|
||||
linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%),
|
||||
rgba(10, 10, 17, 0.55);
|
||||
backdrop-filter: blur(18px) saturate(1.3);
|
||||
-webkit-backdrop-filter: blur(18px) saturate(1.3);
|
||||
linear-gradient(160deg, rgba(255, 255, 255, 0.04) 0%, transparent 60%),
|
||||
rgba(11, 11, 18, 0.60);
|
||||
backdrop-filter: blur(24px) saturate(1.5);
|
||||
-webkit-backdrop-filter: blur(24px) saturate(1.5);
|
||||
overflow: hidden;
|
||||
box-shadow:
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.08),
|
||||
0 8px 28px rgba(0, 0, 0, 0.32);
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.10),
|
||||
0 8px 32px rgba(0, 0, 0, 0.36);
|
||||
}
|
||||
|
||||
/* Toolbar */
|
||||
.toolbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
padding: 10px 16px;
|
||||
border-bottom: 1px solid var(--glass-border);
|
||||
gap: 8px;
|
||||
padding: 10px 16px 10px 14px;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.07);
|
||||
flex-shrink: 0;
|
||||
background: rgba(255, 255, 255, 0.02);
|
||||
}
|
||||
|
||||
.toolbar-nav {
|
||||
display: flex;
|
||||
gap: 2px;
|
||||
}
|
||||
|
||||
.nav-btn {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
padding: 0 10px;
|
||||
border-radius: var(--radius-sm);
|
||||
border-radius: 8px;
|
||||
background: var(--glass-bg);
|
||||
border: 1px solid var(--glass-border);
|
||||
color: var(--text-secondary);
|
||||
font-size: 12px;
|
||||
color: var(--text-muted);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 4px;
|
||||
transition: background var(--transition-fast), color var(--transition-fast);
|
||||
transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
|
||||
}
|
||||
|
||||
.nav-btn:hover:not(:disabled) {
|
||||
background: var(--glass-bg-hover);
|
||||
.nav-btn:hover {
|
||||
background: var(--glass-bg-raised);
|
||||
border-color: var(--glass-border-strong);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.nav-btn:disabled {
|
||||
opacity: 0.4;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.today-btn {
|
||||
font-weight: 500;
|
||||
height: 28px;
|
||||
padding: 0 12px;
|
||||
border-radius: 8px;
|
||||
background: var(--glass-bg-raised);
|
||||
border: 1px solid var(--glass-border-strong);
|
||||
color: var(--text-secondary);
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.2px;
|
||||
transition: background var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
|
||||
}
|
||||
|
||||
.today-btn:hover {
|
||||
background: rgba(168, 230, 0, 0.12);
|
||||
border-color: rgba(168, 230, 0, 0.3);
|
||||
color: var(--accent);
|
||||
box-shadow: 0 0 12px rgba(168, 230, 0, 0.12);
|
||||
}
|
||||
|
||||
.week-label {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
margin-left: 4px;
|
||||
margin: 0;
|
||||
flex: 1;
|
||||
letter-spacing: -0.2px;
|
||||
}
|
||||
|
||||
.refresh-btn {
|
||||
margin-left: auto;
|
||||
flex: none;
|
||||
.toolbar-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.event-count-badge {
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
padding: 1px 7px;
|
||||
border-radius: var(--radius-full);
|
||||
background: rgba(168, 230, 0, 0.12);
|
||||
border: 1px solid rgba(168, 230, 0, 0.25);
|
||||
color: var(--accent);
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.icon-btn {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
border-radius: 8px;
|
||||
background: var(--glass-bg);
|
||||
border: 1px solid var(--glass-border);
|
||||
color: var(--text-muted);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: background var(--transition-fast), color var(--transition-fast);
|
||||
}
|
||||
|
||||
.icon-btn:hover:not(:disabled) {
|
||||
background: var(--glass-bg-raised);
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.icon-btn:disabled {
|
||||
opacity: 0.4;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
|
|
@ -517,48 +667,54 @@ function handleEventClick(ev: CalendarEvent): void {
|
|||
animation: spin 0.8s linear infinite;
|
||||
}
|
||||
|
||||
/* Empty state (no accounts) */
|
||||
/* Empty state */
|
||||
.empty-state {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: transparent;
|
||||
background: rgba(0, 0, 0, 0.3);
|
||||
backdrop-filter: blur(8px);
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.empty-content {
|
||||
text-align: center;
|
||||
padding: 64px 72px;
|
||||
width: 480px;
|
||||
background: rgba(255, 255, 255, 0.11);
|
||||
padding: 56px 64px;
|
||||
width: 460px;
|
||||
border-radius: 24px;
|
||||
border: 1px solid rgba(255, 255, 255, 0.12);
|
||||
background:
|
||||
linear-gradient(145deg, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0.04) 100%),
|
||||
rgba(12, 12, 20, 0.92);
|
||||
backdrop-filter: blur(72px) saturate(2.8);
|
||||
-webkit-backdrop-filter: blur(72px) saturate(2.8);
|
||||
border-radius: 20px;
|
||||
box-shadow:
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.55),
|
||||
0 8px 32px rgba(0, 0, 0, 0.45),
|
||||
0 32px 80px rgba(0, 0, 0, 0.65);
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.20),
|
||||
0 8px 32px rgba(0, 0, 0, 0.50),
|
||||
0 32px 80px rgba(0, 0, 0, 0.70);
|
||||
}
|
||||
|
||||
.empty-icon {
|
||||
margin-bottom: 24px;
|
||||
opacity: 0.28;
|
||||
margin-bottom: 20px;
|
||||
opacity: 0.22;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.empty-content h2 {
|
||||
font-size: 22px;
|
||||
font-size: 20px;
|
||||
font-weight: 600;
|
||||
margin-bottom: 8px;
|
||||
color: var(--text-primary);
|
||||
letter-spacing: -0.3px;
|
||||
}
|
||||
|
||||
.empty-content p {
|
||||
color: var(--text-secondary);
|
||||
font-size: 14px;
|
||||
margin-bottom: 32px;
|
||||
font-size: 13px;
|
||||
margin-bottom: 28px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.add-btn {
|
||||
|
|
@ -571,10 +727,12 @@ function handleEventClick(ev: CalendarEvent): void {
|
|||
color: var(--accent-text);
|
||||
border-radius: var(--radius-md);
|
||||
font-weight: 600;
|
||||
font-size: 14px;
|
||||
font-size: 13px;
|
||||
letter-spacing: 0.1px;
|
||||
box-shadow:
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.40),
|
||||
0 2px 10px color-mix(in srgb, var(--accent) 30%, transparent);
|
||||
0 2px 12px color-mix(in srgb, var(--accent) 30%, transparent);
|
||||
transition: background var(--transition-fast), box-shadow var(--transition-fast);
|
||||
}
|
||||
|
||||
.add-btn:hover {
|
||||
|
|
@ -583,5 +741,8 @@ function handleEventClick(ev: CalendarEvent): void {
|
|||
color-mix(in srgb, var(--accent-hover) 88%, white 12%) 0%,
|
||||
var(--accent-hover) 100%
|
||||
);
|
||||
box-shadow:
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.40),
|
||||
0 2px 20px color-mix(in srgb, var(--accent) 45%, transparent);
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Reference in a new issue