Initial commit: gamer project
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
let pickerYear = currentYear;
|
||||
let pickerMonth = currentMonth;
|
||||
|
||||
function openMonthPicker() {
|
||||
pickerYear = currentYear;
|
||||
pickerMonth = currentMonth;
|
||||
renderMonthPicker();
|
||||
document.getElementById('monthPickerOverlay').classList.add('show');
|
||||
}
|
||||
|
||||
function closeMonthPicker() {
|
||||
document.getElementById('monthPickerOverlay').classList.remove('show');
|
||||
}
|
||||
|
||||
function changePickerYear(delta) {
|
||||
pickerYear += delta;
|
||||
renderMonthPicker();
|
||||
}
|
||||
|
||||
function renderMonthPicker() {
|
||||
document.getElementById('pickerYearDisplay').textContent = pickerYear;
|
||||
const grid = document.getElementById('pickerMonthGrid');
|
||||
grid.innerHTML = '';
|
||||
for (let m = 1; m <= 12; m++) {
|
||||
const btn = document.createElement('button');
|
||||
btn.textContent = m + '月';
|
||||
if (m === pickerMonth) btn.classList.add('active');
|
||||
btn.onclick = () => {
|
||||
pickerMonth = m;
|
||||
grid.querySelectorAll('button').forEach(b => b.classList.remove('active'));
|
||||
btn.classList.add('active');
|
||||
};
|
||||
grid.appendChild(btn);
|
||||
}
|
||||
}
|
||||
|
||||
function confirmMonth() {
|
||||
currentYear = pickerYear;
|
||||
currentMonth = pickerMonth;
|
||||
updateMonthDisplay();
|
||||
closeMonthPicker();
|
||||
loadStats();
|
||||
}
|
||||
Reference in New Issue
Block a user