fix: 优化日历弹窗样式
- 缩小日历组件尺寸
* 日历面板宽度:固定 260px
* 日期格子高度:固定 32px
* 导航按钮:24x24px
* 字体大小:0.75em
- 修复格子大小不一致问题
* 移除 aspect-ratio: 1
* 使用固定宽高
* 添加 box-sizing: border-box
* 所有格子统一尺寸
- 优化间距
* grid gap: 4px → 2px
* padding: 12px → 10px
* margin-bottom: 15px → 10px
- 视觉优化
* border-radius: 8px → 6px → 3px
* 更紧凑的布局
* 防止内容溢出容器
🎨 日历现在紧凑又美观!
This commit is contained in:
@@ -315,27 +315,35 @@ function MemoryModal({ lobsterId, lobsterName, onClose }) {
|
|||||||
|
|
||||||
.memory-calendar-panel {
|
.memory-calendar-panel {
|
||||||
border: 1px solid #e2e8f0;
|
border: 1px solid #e2e8f0;
|
||||||
border-radius: 8px;
|
border-radius: 6px;
|
||||||
padding: 15px;
|
padding: 10px;
|
||||||
background: white;
|
background: white;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
width: 260px;
|
||||||
|
min-width: 260px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.calendar-header {
|
.calendar-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-bottom: 15px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.calendar-header button {
|
.calendar-header button {
|
||||||
background: #4299e1;
|
background: #4299e1;
|
||||||
color: white;
|
color: white;
|
||||||
border: none;
|
border: none;
|
||||||
padding: 5px 12px;
|
padding: 3px 6px;
|
||||||
border-radius: 6px;
|
border-radius: 3px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
font-size: 0.85em;
|
||||||
|
width: 24px;
|
||||||
|
height: 24px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.calendar-header button:hover {
|
.calendar-header button:hover {
|
||||||
@@ -345,27 +353,30 @@ function MemoryModal({ lobsterId, lobsterName, onClose }) {
|
|||||||
.calendar-grid {
|
.calendar-grid {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(7, 1fr);
|
grid-template-columns: repeat(7, 1fr);
|
||||||
gap: 4px;
|
gap: 2px;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.calendar-weekday {
|
.calendar-weekday {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 0.8em;
|
font-size: 0.75em;
|
||||||
color: #718096;
|
color: #718096;
|
||||||
padding: 8px 0;
|
padding: 6px 0;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
.calendar-day {
|
.calendar-day {
|
||||||
aspect-ratio: 1;
|
width: 100%;
|
||||||
|
height: 32px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
border-radius: 6px;
|
border-radius: 3px;
|
||||||
font-size: 0.9em;
|
font-size: 0.75em;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: all 0.2s;
|
transition: all 0.2s;
|
||||||
|
padding: 0;
|
||||||
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.calendar-day:hover:not(.empty) {
|
.calendar-day:hover:not(.empty) {
|
||||||
@@ -380,20 +391,24 @@ function MemoryModal({ lobsterId, lobsterName, onClose }) {
|
|||||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||||
color: white;
|
color: white;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
width: 100%;
|
||||||
|
height: 32px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.calendar-day.selected {
|
.calendar-day.selected {
|
||||||
border: 2px solid #ed8936;
|
border: 2px solid #ed8936;
|
||||||
background: #f6ad55;
|
background: #f6ad55;
|
||||||
color: white;
|
color: white;
|
||||||
|
width: 100%;
|
||||||
|
height: 32px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.calendar-legend {
|
.calendar-legend {
|
||||||
margin-top: 10px;
|
margin-top: 8px;
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 20px;
|
gap: 12px;
|
||||||
font-size: 0.85em;
|
font-size: 0.75em;
|
||||||
padding-top: 10px;
|
padding-top: 8px;
|
||||||
border-top: 1px solid #e2e8f0;
|
border-top: 1px solid #e2e8f0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -424,9 +439,9 @@ function MemoryModal({ lobsterId, lobsterName, onClose }) {
|
|||||||
.stat-badge {
|
.stat-badge {
|
||||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||||
color: white;
|
color: white;
|
||||||
padding: 6px 12px;
|
padding: 4px 10px;
|
||||||
border-radius: 20px;
|
border-radius: 16px;
|
||||||
font-size: 0.9em;
|
font-size: 0.75em;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user