Skip to content

Commit 905b6bb

Browse files
committed
feat(ui): 添加春节主题视觉装饰
- 在桌面版和移动版导航栏添加动态灯笼动画效果 - 实现首页春节横幅展示新春祝福信息 - 为不同屏幕尺寸适配响应式灯笼样式 - 添加移动端专用的灯笼摆动动画 - 在AGENTS.md中记录春节视觉装饰的临时性质
1 parent 00fa7c2 commit 905b6bb

9 files changed

Lines changed: 200 additions & 4 deletions

File tree

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
## 协作目标
1212
- `AGENTS.md` 保持精简,只保留会影响决策的长期约定;新增内容优先补充“关键链路”,避免堆砌背景信息。
13+
- 2026 春节临时视觉:全站顶栏灯笼 + 首页新春横幅;用户明确要求“节后”由 AI 直接移除,不额外做开关。
1314

1415
## 开发硬约束
1516
- 前端改动只改源码:`.scss` 与非 `min.js`;执行 `yarn run build` 生成产物;`classic``mobile` 皮肤需同步修改。

src/main/resources/css/base.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/resources/css/index.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/resources/css/mobile-base.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/resources/scss/base.scss

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -961,6 +961,17 @@ a[class*=" icon-"]:hover {
961961
/* end framework */
962962

963963
/* start header */
964+
@keyframes spring-lantern-swing {
965+
0%,
966+
100% {
967+
transform: rotate(-6deg);
968+
}
969+
970+
50% {
971+
transform: rotate(6deg);
972+
}
973+
}
974+
964975
.nav {
965976
position: sticky;
966977
top: 0;
@@ -975,6 +986,34 @@ a[class*=" icon-"]:hover {
975986
background-color: $theme-primary;
976987
box-shadow: 0px 5px 40px 0px rgba(17,58,93,.1);
977988
font-weight: 500;
989+
overflow: visible;
990+
991+
&::before,
992+
&::after {
993+
content: "";
994+
position: absolute;
995+
top: 6px;
996+
width: 18px;
997+
height: 30px;
998+
border-radius: 55% 55% 45% 45%;
999+
background:
1000+
linear-gradient(#d9b260, #d9b260) center top / 2px 8px no-repeat,
1001+
radial-gradient(circle at 50% 30%, #ffd68a 0, #ffb05e 28%, #dd4a2d 68%, #a41f1a 100%);
1002+
box-shadow: 0 4px 10px rgba(164, 31, 26, 0.28);
1003+
pointer-events: none;
1004+
z-index: 2;
1005+
transform-origin: top center;
1006+
animation: spring-lantern-swing 2.8s ease-in-out infinite;
1007+
}
1008+
1009+
&::before {
1010+
left: 12px;
1011+
}
1012+
1013+
&::after {
1014+
right: 12px;
1015+
animation-delay: -1.4s;
1016+
}
9781017

9791018
h1 {
9801019
//margin-right: 20px;
@@ -1224,6 +1263,13 @@ a[class*=" icon-"]:hover {
12241263
}
12251264
}
12261265

1266+
@media (max-width: 1200px) {
1267+
.nav::before,
1268+
.nav::after {
1269+
display: none;
1270+
}
1271+
}
1272+
12271273
/* end header */
12281274

12291275
/* start footer */

src/main/resources/scss/index.scss

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,6 +1269,56 @@ code .dec {
12691269

12701270
/* start index */
12711271
.index {
1272+
.spring-festival-banner {
1273+
max-width: 1160px;
1274+
margin: 12px auto 0;
1275+
padding: 10px 18px;
1276+
border-radius: 10px;
1277+
border: 1px solid rgba(212, 73, 44, 0.25);
1278+
background: linear-gradient(90deg, #fff7e0 0%, #ffe3c4 48%, #ffefd8 100%);
1279+
box-shadow: 0 4px 14px rgba(177, 58, 42, 0.12);
1280+
display: flex;
1281+
align-items: center;
1282+
justify-content: center;
1283+
gap: 14px;
1284+
color: #b13a2a;
1285+
}
1286+
1287+
.spring-festival-banner__text {
1288+
font-size: 16px;
1289+
font-weight: 600;
1290+
letter-spacing: 1px;
1291+
}
1292+
1293+
.spring-festival-banner__lantern {
1294+
position: relative;
1295+
width: 15px;
1296+
height: 21px;
1297+
border-radius: 55% 55% 45% 45%;
1298+
background:
1299+
linear-gradient(#d9b260, #d9b260) center top / 2px 6px no-repeat,
1300+
radial-gradient(circle at 50% 30%, #ffd68a 0, #ffb05e 28%, #dd4a2d 68%, #a41f1a 100%);
1301+
box-shadow: 0 2px 6px rgba(164, 31, 26, 0.25);
1302+
transform-origin: top center;
1303+
animation: spring-lantern-swing 2.8s ease-in-out infinite;
1304+
1305+
&::after {
1306+
content: "";
1307+
position: absolute;
1308+
left: 50%;
1309+
bottom: -7px;
1310+
width: 2px;
1311+
height: 7px;
1312+
border-radius: 2px;
1313+
background: linear-gradient(#f5d286, #d79b3b);
1314+
transform: translateX(-50%);
1315+
}
1316+
}
1317+
1318+
.spring-festival-banner__lantern:last-child {
1319+
animation-delay: -1.4s;
1320+
}
1321+
12721322
.index-main {
12731323
width: 60%;
12741324
}

src/main/resources/scss/mobile-base.scss

Lines changed: 90 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,34 @@ a[class*=" icon-"]:hover {
517517
padding: 5px 0;
518518
z-index: 99;
519519
background-color: rgba(217, 240, 255, 0.75);
520+
position: relative;
521+
overflow: visible;
522+
}
523+
524+
.nav::before,
525+
.nav::after {
526+
content: "";
527+
position: absolute;
528+
top: 5px;
529+
width: 10px;
530+
height: 14px;
531+
border-radius: 55% 55% 45% 45%;
532+
background:
533+
linear-gradient(#d9b260, #d9b260) center top / 1px 4px no-repeat,
534+
radial-gradient(circle at 50% 30%, #ffd68a 0, #ffb05e 28%, #dd4a2d 68%, #a41f1a 100%);
535+
box-shadow: 0 2px 4px rgba(164, 31, 26, 0.2);
536+
pointer-events: none;
537+
transform-origin: top center;
538+
animation: spring-lantern-swing-mobile 2.6s ease-in-out infinite;
539+
}
540+
541+
.nav::before {
542+
left: 6px;
543+
}
544+
545+
.nav::after {
546+
right: 6px;
547+
animation-delay: -1.3s;
520548
}
521549

522550
.nav .wrapper{
@@ -2033,6 +2061,17 @@ code .dec {
20332061
color: #999;
20342062
}
20352063

2064+
@keyframes spring-lantern-swing-mobile {
2065+
0%,
2066+
100% {
2067+
transform: rotate(-7deg);
2068+
}
2069+
2070+
50% {
2071+
transform: rotate(7deg);
2072+
}
2073+
}
2074+
20362075
.index {
20372076
.module-list .title {
20382077
margin-right: 30px;
@@ -2047,6 +2086,56 @@ code .dec {
20472086
color: #fff;
20482087
}
20492088
}
2089+
2090+
.spring-festival-banner {
2091+
margin: 10px 10px 0;
2092+
padding: 8px 10px;
2093+
border-radius: 8px;
2094+
border: 1px solid rgba(212, 73, 44, 0.22);
2095+
background: linear-gradient(90deg, #fff6e4 0%, #ffe7cf 100%);
2096+
box-shadow: 0 2px 8px rgba(177, 58, 42, 0.12);
2097+
display: flex;
2098+
align-items: center;
2099+
justify-content: center;
2100+
gap: 8px;
2101+
color: #b13a2a;
2102+
}
2103+
2104+
.spring-festival-banner__text {
2105+
font-size: 13px;
2106+
font-weight: 600;
2107+
letter-spacing: .5px;
2108+
}
2109+
2110+
.spring-festival-banner__lantern {
2111+
position: relative;
2112+
width: 12px;
2113+
height: 16px;
2114+
border-radius: 55% 55% 45% 45%;
2115+
background:
2116+
linear-gradient(#d9b260, #d9b260) center top / 2px 5px no-repeat,
2117+
radial-gradient(circle at 50% 30%, #ffd68a 0, #ffb05e 28%, #dd4a2d 68%, #a41f1a 100%);
2118+
box-shadow: 0 2px 4px rgba(164, 31, 26, 0.22);
2119+
transform-origin: top center;
2120+
animation: spring-lantern-swing-mobile 2.6s ease-in-out infinite;
2121+
2122+
&::after {
2123+
content: "";
2124+
position: absolute;
2125+
left: 50%;
2126+
bottom: -5px;
2127+
width: 2px;
2128+
height: 5px;
2129+
border-radius: 2px;
2130+
background: linear-gradient(#f5d286, #d79b3b);
2131+
transform: translateX(-50%);
2132+
}
2133+
}
2134+
2135+
.spring-festival-banner__lantern:last-child {
2136+
animation-delay: -1.3s;
2137+
}
2138+
20502139
}
20512140

20522141
/* end index */
@@ -4138,4 +4227,4 @@ body.night {
41384227

41394228
font-size: 14px; /* emoji/文字统一尺寸 */
41404229
line-height: 1; /* 防止 emoji 撑高 */
4141-
}
4230+
}

src/main/resources/skins/classic/index.ftl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@
3535
<#if showTopAd>
3636
${HeaderBannerLabel}
3737
</#if>
38+
<div class="spring-festival-banner" aria-label="春节氛围装饰">
39+
<span class="spring-festival-banner__lantern" aria-hidden="true"></span>
40+
<span class="spring-festival-banner__text">新春快乐 · 摸鱼大吉</span>
41+
<span class="spring-festival-banner__lantern" aria-hidden="true"></span>
42+
</div>
3843
<div class="main">
3944
<div class="wrapper index-full-size-white" id="nightTips" style="display: none"></div>
4045
<div class="wrapper" id="indexTopWrapper" style="padding-bottom: 20px">

src/main/resources/skins/mobile/index.ftl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@
3636
<#if showTopAd>
3737
${HeaderBannerLabel}
3838
</#if>
39+
<div class="spring-festival-banner" aria-label="春节氛围装饰">
40+
<span class="spring-festival-banner__lantern" aria-hidden="true"></span>
41+
<span class="spring-festival-banner__text">新春快乐 · 摸鱼大吉</span>
42+
<span class="spring-festival-banner__lantern" aria-hidden="true"></span>
43+
</div>
3944

4045
<#if esEnabled || algoliaEnabled>
4146
<form class="form wrapper" style="margin-top: 10px" action="/search">

0 commit comments

Comments
 (0)