Skip to content

Commit 2e0c4ac

Browse files
committed
描述调整
1 parent 8ecaf5a commit 2e0c4ac

File tree

1 file changed

+6
-18
lines changed

1 file changed

+6
-18
lines changed

index.html

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,12 @@
145145
<h1>人生网格 - 900个月</h1>
146146
<div class="description">
147147
<p>这个网格展示了一个人生中的900个月(75年)。每个格子代表一个月。</p>
148-
<p>点击格子可以标记已经度过的月份,不同颜色代表不同的人生阶段。</p>
148+
<p>不同颜色代表不同的人生阶段:
149+
<span style="display: inline-block; width: 12px; height: 12px; background-color: #4fc3f7; margin: 0 4px;"></span>0-20年,
150+
<span style="display: inline-block; width: 12px; height: 12px; background-color: #81c784; margin: 0 4px;"></span>20-40年,
151+
<span style="display: inline-block; width: 12px; height: 12px; background-color: #ffb74d; margin: 0 4px;"></span>40-60年,
152+
<span style="display: inline-block; width: 12px; height: 12px; background-color: #e57373; margin: 0 4px;"></span>60-80年
153+
</p>
149154
</div>
150155

151156
<div class="grid-container" id="lifeGrid"></div>
@@ -176,26 +181,9 @@ <h1>人生网格 - 900个月</h1>
176181
gridItem.className = 'grid-item';
177182
gridItem.dataset.index = i;
178183
gridItem.dataset.stage = Math.floor(i / 240);
179-
180-
gridItem.addEventListener('click', function() {
181-
this.classList.toggle('filled');
182-
this.classList.toggle(`stage-${this.dataset.stage}`);
183-
updateCount();
184-
});
185-
186184
grid.appendChild(gridItem);
187185
}
188186

189-
// 从本地存储加载出生年月
190-
const savedBirthDate = localStorage.getItem('birthDate');
191-
if (savedBirthDate) {
192-
birthDate = new Date(JSON.parse(savedBirthDate));
193-
fillGridToDate(birthDate);
194-
const birthYear = birthDate.getFullYear();
195-
const birthMonth = birthDate.getMonth() + 1;
196-
birthInfo.textContent = `出生年月: ${birthYear}${birthMonth}月`;
197-
}
198-
199187
// 重置按钮
200188
resetBtn.addEventListener('click', function() {
201189
const items = document.querySelectorAll('.grid-item');

0 commit comments

Comments
 (0)