全功能日历备忘录

86 阅读8分钟
全功能日历备忘录 * { box-sizing: border-box; margin: 0; padding: 0; } body { font-family: 'Arial', sans-serif; background: linear-gradient(135deg, #0f0c29, #302b63, #24243e); color: white; padding: 20px; min-height: 100vh; display: grid; grid-template-columns: 1fr 1.2fr; gap: 20px; } h1 { grid-column: 1 / -1; font-size: 2.8rem; margin: 10px 0 20px; text-shadow: 0 0 15px rgba(100, 200, 255, 0.7); animation: glow 2s ease-in-out infinite alternate; text-align: center; } @keyframes glow { from { text-shadow: 0 0 10px rgba(100, 200, 255, 0.7); } to { text-shadow: 0 0 20px rgba(100, 220, 255, 0.9), 0 0 30px rgba(100, 200, 255, 0.5); } } /* 左侧节假日面板 */ .holiday-container { background: rgba(0, 0, 0, 0.3); border-radius: 15px; padding: 25px; backdrop-filter: blur(8px); border: 1px solid rgba(255, 255, 255, 0.15); box-shadow: 0 10px 35px rgba(0, 0, 0, 0.3); overflow-y: auto; height: calc(100vh - 120px); } .holiday-title { font-size: 1.8rem; color: #ffcc00; margin: 0 0 25px; text-align: center; padding-bottom: 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.2); } .holiday-list { font-size: 1.15rem; line-height: 1.6; } .holiday-list h3 { font-size: 1.4rem; color: #4fc3f7; margin: 25px 0 15px; padding-left: 10px; border-left: 4px solid #4fc3f7; } .holiday-list ul { list-style-type: none; padding: 0; margin: 0 0 30px; } .holiday-list li { margin: 15px 0; padding: 15px; background: rgba(255, 255, 255, 0.08); border-radius: 10px; transition: all 0.3s; } .holiday-list li:hover { transform: translateX(8px); background: rgba(255, 255, 255, 0.15); } .holiday-name { font-weight: bold; color: #ff9999; display: block; margin-bottom: 8px; } .holiday-date { color: #aaf; font-size: 1rem; display: block; margin-bottom: 8px; } .holiday-countdown { color: #4fc3f7; font-size: 0.95rem; display: block; margin-top: 8px; } .holiday-duration { background: rgba(79, 195, 247, 0.2); padding: 3px 8px; border-radius: 10px; font-size: 0.9rem; float: right; } /* 右侧日历面板 */ .calendar-container { background: rgba(0, 0, 0, 0.3); border-radius: 15px; padding: 25px; backdrop-filter: blur(8px); border: 1px solid rgba(255, 255, 255, 0.15); box-shadow: 0 10px 35px rgba(0, 0, 0, 0.3); height: calc(100vh - 120px); display: flex; flex-direction: column; } .month-selector { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; } .month-title { font-size: 1.8rem; color: #4fc3f7; font-weight: bold; text-align: center; flex-grow: 1; } .month-nav button { background: rgba(255, 255, 255, 0.1); color: white; border: none; padding: 10px 20px; border-radius: 8px; cursor: pointer; font-size: 1.1rem; transition: all 0.3s; display: flex; align-items: center; justify-content: center; } .month-nav button:hover { background: rgba(255, 255, 255, 0.2); transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2); } .month-nav button:active { transform: translateY(0); } /* 修复对齐问题的关键CSS */ .calendar-wrapper { flex: 1; display: flex; flex-direction: column; } .calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; flex-grow: 1; } .calendar-header { display: grid; grid-template-columns: repeat(7, 1fr); font-weight: bold; padding: 12px 0; font-size: 1.15rem; color: rgba(255, 255, 255, 0.8); } .day-header { text-align: center; padding: 5px; } .calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: 1fr; gap: 12px; flex-grow: 1; } .day { background: rgba(255, 255, 255, 0.1); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; transition: all 0.3s ease; position: relative; border: 1px solid rgba(255, 255, 255, 0.05); font-size: 1.15rem; min-height: 100px; } .day:hover { background: rgba(255, 255, 255, 0.2); transform: translateY(-5px) scale(1.03); box-shadow: 0 12px 25px rgba(0, 0, 0, 0.3); } .day-number { font-size: 1.3em; font-weight: bold; margin-bottom: 8px; color: #fff; text-shadow: 0 0 5px rgba(255, 255, 255, 0.5); } .memo-container { flex: 1; overflow-y: auto; padding: 3px; min-height: 60px; } .memo-text { font-size: 0.95em; color: #ffeb3b; text-align: left; padding: 5px; margin: 4px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: rgba(0, 0, 0, 0.3); border-radius: 5px; transition: all 0.2s; } .memo-text:hover { background: rgba(0, 0, 0, 0.5); transform: translateX(3px); } .empty-day { visibility: hidden; } .holiday { background: rgba(255, 100, 100, 0.25) !important; border: 1px solid rgba(255, 100, 100, 0.4) !important; animation: pulse 2s infinite; } @keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,100,100,0.4); } 70% { box-shadow: 0 0 0 12px rgba(255,100,100,0); } 100% { box-shadow: 0 0 0 0 rgba(255,100,100,0); } } .holiday .day-number { color: #ffbbbb !important; } .weekend { background: rgba(100, 200, 255, 0.15) !important; } .today { background: rgba(255, 255, 100, 0.25) !important; border: 1px solid rgba(255, 255, 100, 0.6) !important; } .today .day-number { color: #ffff00 !important; font-weight: bold; text-shadow: 0 0 10px rgba(255, 255, 0, 0.5); } /* 模态框样式 */ .modal { display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(30, 30, 60, 0.98); color: white; padding: 30px; border-radius: 20px; width: 400px; max-width: 90%; z-index: 1000; box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6); backdrop-filter: blur(15px); border: 1px solid rgba(255, 255, 255, 0.2); animation: modalFadeIn 0.4s ease-out; } @keyframes modalFadeIn { from { opacity: 0; transform: translate(-50%, -60%); } to { opacity: 1; transform: translate(-50%, -50%); } } .modal h3 { margin-top: 0; margin-bottom: 25px; color: #4fc3f7; font-size: 1.5rem; text-shadow: 0 0 15px rgba(79, 195, 247, 0.7); text-align: center; } .modal input { width: 100%; padding: 12px 15px; margin: 15px 0 25px; border: none; border-radius: 8px; background: rgba(255, 255, 255, 0.1); color: white; font-size: 1.1rem; transition: all 0.3s; } .modal input:focus { outline: none; background: rgba(255, 255, 255, 0.2); box-shadow: 0 0 15px rgba(79, 195, 247, 0.6); } .modal-buttons { display: flex; justify-content: space-between; gap: 15px; } .modal button { padding: 12px 20px; margin: 0; cursor: pointer; border: none; border-radius: 8px; font-weight: bold; font-size: 1.1rem; transition: all 0.3s; flex: 1; display: flex; align-items: center; justify-content: center; } .modal button:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3); } .modal button:active { transform: translateY(0); } #saveBtn { background: linear-gradient(135deg, #4CAF50, #2E7D32); color: white; } #saveBtn:hover { background: linear-gradient(135deg, #66BB6A, #388E3C); } #closeBtn { background: linear-gradient(135deg, #f44336, #c62828); color: white; } #closeBtn:hover { background: linear-gradient(135deg, #ef5350, #d32f2f); } .delete-btn { background: #ff4444; color: white; padding: 6px 12px; cursor: pointer; border-radius: 6px; margin-left: 10px; font-size: 0.9rem; transition: all 0.2s; border: none; } .delete-btn:hover { background: #ff0000; transform: scale(1.1); } .memo-list { max-height: 300px; overflow-y: auto; margin-top: 20px; padding-right: 10px; } .memo-list p { margin: 12px 0; padding: 12px; background: rgba(255, 255, 255, 0.1); border-radius: 8px; border-left: 4px solid #4fc3f7; transition: all 0.2s; display: flex; justify-content: space-between; align-items: center; } .memo-list p:hover { background: rgba(255, 255, 255, 0.2); transform: translateX(5px); } .no-memo { color: #aaa; font-style: italic; text-align: center; padding: 20px; } ::-webkit-scrollbar { width: 8px; height: 8px; } ::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.05); border-radius: 10px; } ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 10px; } ::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.3); } @media (max-width: 1200px) { body { grid-template-columns: 1fr; } .holiday-container, .calendar-container { height: auto; max-height: 50vh; } } @media (max-width: 768px) { h1 { font-size: 2.2rem; } .month-title { font-size: 1.5rem; } .holiday-title { font-size: 1.5rem; } .day { min-height: 100px; padding: 8px; } .modal { width: 90%; padding: 20px; } } </style>

✨ 全功能日历备忘录 ✨

2025-2026年法定节假日
← 上个月
下个月 →
<div class="calendar-wrapper">
    <div class="calendar">
        <div class="calendar-header">
            <div class="day-header">周日</div>
            <div class="day-header">周一</div>
            <div class="day-header">周二</div>
            <div class="day-header">周三</div>
            <div class="day-header">周四</div>
            <div class="day-header">周五</div>
            <div class="day-header">周六</div>
        </div>
    </div>

    <div class="calendar-grid" id="calendarGrid"></div>
</div>