feat: enhance UI styling, add date picker, and clean up inline CSS

This commit is contained in:
2026-06-09 15:12:58 +08:00
parent 18f44ac244
commit b72b5a31bb
6 changed files with 634 additions and 168 deletions
+22 -1
View File
@@ -5,7 +5,7 @@ endblock %} {% block content %}
{% if prev_day %}
<a href="/day/{{ prev_day }}" class="date-nav-btn">← 前一天</a>
{% endif %}
<h1 class="date-title">{{ current_date }}</h1>
<div class="date-title" id="date-picker-trigger">{{ current_date }}</div>
{% if next_day <= today %}
<a href="/day/{{ next_day }}" class="date-nav-btn">后一天 →</a>
{% endif %}
@@ -34,3 +34,24 @@ endblock %} {% block content %}
{% endfor %}
</div>
{% endblock %}
{% block scripts %}
<script src="/static/js/date-picker.js"></script>
<script>
(function() {
var trigger = document.getElementById('date-picker-trigger');
if (!trigger) return;
var markedDates = {{ available_dates | tojson }};
new KamiDatePicker(trigger, {
value: {{ current_date | tojson }},
maxDate: {{ today | tojson }},
markedDates: markedDates,
onChange: function(dateStr) {
if (dateStr) window.location.href = '/day/' + dateStr;
}
});
})();
</script>
{% endblock %}