File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44<!DOCTYPE html>
55< html >
66< head >
7- < title > 神秘礼物</ title >
7+ < meta charset =" UTF-8 " > < title > 神秘礼物</ title >
88</ head >
99< body >
1010
@@ -15,7 +15,7 @@ <h1>这里什么都没有...真的吗?</h1>
1515 alert ( "节日快乐 4月1日的英雄 " )
1616
1717alert ( "谢某人祝您节日快乐!" )
18-
18+
1919alert ( "哈哈,上当了吗?" )
2020
2121alert ( "别难过了~~~" )
Original file line number Diff line number Diff line change 11# 主题配置文件
2- avatar : /img/avatar.png
2+ avatar : /img/avatar.png
3+
4+ # 主题菜单配置
5+ menu :
6+ 首页 : /
7+ 归档 : /archives
8+ 友链 : /links
9+ 关于 : /about
10+ 番茄钟定时器 : /pomodoro
11+ 2048小游戏 : /smallgame/2048
12+ 谢益辉的恶作剧 : /smallgame/trick
13+
14+ # 为每个菜单项分配一个图标
15+ menu_icons :
16+ 首页 : 🏠
17+ 归档 : 🗂️
18+ 友链 : 🤝
19+ 关于 : 🙋♂️
20+ 番茄钟定时器 : 🍅
21+ 2048小游戏 : 🎮
22+ 谢益辉的恶作剧 : 🤡
Original file line number Diff line number Diff line change 1717 </div >
1818
1919 <nav class =" site-nav" >
20- <a href =" /" ><span >🏠</span > 首页</a >
21- <a href =" /archives" ><span >🗂️</span > 归档</a >
22- <a href =" /links" ><span >🤝</span > 友链</a >
23- <a href =" /about" ><span >🙋♂️</span > 关于</a >
20+ <% for (var name in theme .menu ) { % >
21+ < a href= " <%- url_for(theme.menu[name]) %>" >
22+ < span>< %- theme .menu_icons [name] || ' 📄' % >< / span>
23+ < %- name % >
24+ < / a>
25+ < % } %>
2426 </nav >
2527
2628 <div class =" social-links" >
Original file line number Diff line number Diff line change 1111.main-container {
1212 display : grid;
1313 /* 划重点:左栏 240px,中间自适应剩下的空间,右栏 240px */
14- grid-template-columns : 240 px 1fr 240 px ;
14+ grid-template-columns : 200 px 1fr 220 px ;
1515 gap : 30px ; /* 三栏之间的间距 */
16- max-width : 1200 px ; /* 网站最大宽度 */
16+ max-width : 1350 px ; /* 网站最大宽度 */
1717 margin : 40px auto; /* 上下留白,左右居中 */
1818 padding : 0 20px ;
1919 align-items : start; /* 让左右侧边栏能在顶部对齐 */
4141.content-mid {
4242 background : # fff ;
4343 border-radius : 12px ;
44- padding : 40px ;
44+ /* 原来是 padding: 40px; 可以改成上下 40px,左右 30px */
45+ padding : 40px 30px ;
4546 box-shadow : 0 4px 12px rgba (0 , 0 , 0 , 0.05 );
4647 min-height : 80vh ; /* 保证高度足够好看 */
4748}
@@ -165,18 +166,30 @@ body {
165166.site-nav {
166167 display : flex;
167168 flex-direction : column;
168- margin-top : 20 px ;
169- gap : 8 px ;
169+ margin-top : 15 px ; /* 稍微缩小顶部间距 */
170+ gap : 4 px ; /* 缩小项与项之间的间距,防止列表过长溢出容器 */
170171}
172+
171173.site-nav a {
172174 display : flex;
173175 align-items : center;
174- padding : 10 px 15px ;
176+ padding : 8 px 15px ; /* 缩小上下内边距 */
175177 color : # 555 ;
176178 text-decoration : none;
177179 border-radius : 8px ;
178180 transition : all 0.3s ease;
179- font-size : 0.95rem ;
181+ font-size : 0.9rem ; /* 稍微调小一点字号,看起来更精致 */
182+ }
183+
184+ /* 如果菜单实在太多,可以让侧边栏内部产生滚动条 */
185+ .sidebar-left {
186+ max-height : calc (100vh - 80px ); /* 限制高度为屏幕高度减去边距 */
187+ overflow-y : auto; /* 内容多时自动出现滚动条 */
188+ }
189+
190+ /* 隐藏侧边栏那条丑陋的滚动条,但保留滚动功能 */
191+ .sidebar-left ::-webkit-scrollbar {
192+ width : 0px ;
180193}
181194.site-nav a span {
182195 margin-right : 12px ;
You can’t perform that action at this time.
0 commit comments