3
3
< head >
4
4
< meta charset ="UTF-8 ">
5
5
< meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
6
- < title > LrcAPI - 致谢名单</ title >
6
+ < title > 致谢名单</ title >
7
7
< link rel ="stylesheet " href ="/src/css/v50.css ">
8
8
< style >
9
9
.barrage-container {
17
17
overflow : hidden;
18
18
}
19
19
20
+ .financial-status {
21
+ opacity : 0 ;
22
+ transform : translateY (20px );
23
+ animation : fadeInUp 0.8s ease forwards;
24
+ }
25
+
26
+ @keyframes fadeInUp {
27
+ to {
28
+ opacity : 1 ;
29
+ transform : translateY (0 );
30
+ }
31
+ }
32
+
20
33
.barrage-item {
21
34
position : fixed;
22
35
white-space : nowrap;
27
40
transform : translateX (100vw );
28
41
}
29
42
</ style >
43
+ < script src ="/src/js/site-config.js "> </ script >
44
+ < script src ="/src/js/common-elements.js "> </ script >
45
+ < script >
46
+ document . addEventListener ( 'DOMContentLoaded' , ( ) => {
47
+ document . title = `${ siteConfig . site . name } - 致谢名单` ;
48
+ } ) ;
49
+ </ script >
30
50
</ head >
31
51
< body >
32
- < header >
33
- < div class ="logo-container ">
34
- < img src ="/src/img/LrcAPI-Text-Extra.png " alt ="LrcAPI Logo " class ="logo ">
35
- < span class ="project-name "> LrcAPI</ span >
36
- </ div >
37
- < div class ="github-link ">
38
- < a href ="https://github.com/hisatri/LrcAPI " class ="github-button ">
39
- < svg height ="20 " viewBox ="0 0 16 16 " width ="20 " class ="github-icon ">
40
- < path fill ="currentColor " d ="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z "> </ path >
41
- </ svg >
42
- GitHub
43
- </ a >
44
- </ div >
45
- </ header >
52
+ < header > </ header >
46
53
47
54
< div class ="barrage-container " id ="barrageContainer "> </ div >
48
55
@@ -51,6 +58,14 @@ <h1>致谢名单</h1>
51
58
< div class ="acknowledgment-content ">
52
59
< p style ="text-align: center "> 感谢所有支持 LrcAPI 项目发展的朋友们。LrcAPI 是一个完全免费的开源项目,它的发展离不开社区成员的支持。在此特别感谢以下支持者的慷慨赞助</ p >
53
60
< p class ="subtitle " style ="text-align: center "> *排名不分先后。如果我们遗漏了您的名字,请您随时通过赞助渠道联系我们,我们将及时更新。</ p >
61
+ < div id ="financialStatus " class ="financial-status " style ="text-align: center; margin-bottom: 30px; ">
62
+ < p style ="color: #666; margin-bottom: 10px; "> 项目运营状况</ p >
63
+ < h1 id ="financialAmount " style ="font-weight: bold; display: inline-block; margin: 10px 0; "> </ h1 >
64
+ < p style ="color: #666; font-size: 0.9em; ">
65
+ < span style ="color: #2ecc71; "> 正值</ span > 代表项目有结余 |
66
+ < span style ="color: #e74c3c; "> 负值</ span > 代表项目需要赞助
67
+ </ p >
68
+ </ div >
54
69
< div class ="supporters-list ">
55
70
< div class ="supporter-card ">
56
71
< h3 > 项目赞助者</ h3 >
@@ -62,9 +77,7 @@ <h3>项目赞助者</h3>
62
77
</ div >
63
78
</ main >
64
79
65
- < footer >
66
- < p class ="license-text "> 本项目基于 < a href ="https://github.com/HisAtri/LrcApi/blob/main/LICENSE " target ="_blank " style ="color: gray; text-decoration: none; "> GNU General Public License v3.0</ a > 开源协议发布 | < a href ="/ "> 回到主页</ a > </ p >
67
- </ footer >
80
+ < footer > </ footer >
68
81
69
82
< script >
70
83
class BarrageSystem {
@@ -146,33 +159,6 @@ <h3>项目赞助者</h3>
146
159
}
147
160
}
148
161
149
- // 初始化弹幕系统
150
- const barrageSystem = new BarrageSystem ( ) ;
151
- // 消息数据,在这里添加需要显示的弹幕
152
- const messages = [
153
- "项目越来越好!" ,
154
- "加油!继续努力!" ,
155
- "很棒的项目!" ,
156
- "支持开源!" ,
157
- "希望项目能一直维护下去" ,
158
- "太赞了!" ,
159
- "非常实用的API" ,
160
- "非常好的项目,爱来自LinuxDo" ,
161
- "我是Mio,请你吃疯狂星期四" ,
162
- "Good Job!" ,
163
- "感谢开发LRCAPI" ,
164
- "真好用" ,
165
- "完美,好东西!" ,
166
- "很棒!继续加油"
167
- ] ;
168
- // 定期发送弹幕,使用可变的时间间隔
169
- function sendRandomMessage ( ) {
170
- const msg = messages [ Math . floor ( Math . random ( ) * messages . length ) ] ;
171
- barrageSystem . addMessage ( msg ) ;
172
- // 在此处调整弹幕发送频率(当前为0.5-2秒)
173
- setTimeout ( sendRandomMessage , 500 + Math . random ( ) * 1500 ) ;
174
- }
175
- sendRandomMessage ( ) ;
176
162
// 定义支持者卡片组件
177
163
class SupporterCard extends HTMLElement {
178
164
constructor ( ) {
@@ -190,30 +176,98 @@ <h3>项目赞助者</h3>
190
176
}
191
177
192
178
customElements . define ( 'supporter-card' , SupporterCard ) ;
193
- // 支持者数据,在这里添加需要显示的支持者和赞助金额
194
- const supporters = [
195
- { name : 'XinLoong' , amount : 10.00 } ,
196
- { name : '木羽' , amount : 5.00 } ,
197
- { name : '依然不懂' , amount : 5.00 } ,
198
- { name : '扑克' , amount : 20.00 } ,
199
- { name : '未知' , amount : 10.00 } ,
200
- { name : 'yule' , amount : 10.00 } ,
201
- { name : 'Erikaze' , amount : 90.00 } ,
202
- { name : 'hikaru' , amount : 10.00 } ,
203
- { name : 'KawaKaze' , amount : 6.66 } ,
204
- { name : 'Mio' , amount : 50.00 } ,
205
- { name : '呜噜噜' , amount : 50.00 }
206
- ] ;
207
- const supportersGrid = document . getElementById ( 'supportersGrid' ) ;
208
- supporters . forEach ( supporter => {
209
- const li = document . createElement ( 'li' ) ;
210
- li . className = 'supporter-box' ;
211
-
212
- const card = document . createElement ( 'supporter-card' ) ;
213
- card . supporter = supporter ;
214
-
215
- li . appendChild ( card ) ;
216
- supportersGrid . appendChild ( li ) ;
179
+
180
+ // 模块控制器
181
+ class ModuleController {
182
+ constructor ( config ) {
183
+ this . config = config ;
184
+ this . init ( ) ;
185
+ }
186
+
187
+ init ( ) {
188
+ // 初始化财务状况显示
189
+ if ( this . config . financial . enabled ) {
190
+ this . initFinancial ( ) ;
191
+ } else {
192
+ document . getElementById ( 'financialStatus' ) . style . display = 'none' ;
193
+ }
194
+
195
+ // 初始化弹幕系统
196
+ if ( this . config . barrage . enabled ) {
197
+ this . initBarrage ( ) ;
198
+ } else {
199
+ document . getElementById ( 'barrageContainer' ) . style . display = 'none' ;
200
+ }
201
+
202
+ // 初始化支持者列表
203
+ if ( this . config . supporters . enabled ) {
204
+ this . initSupporters ( ) ;
205
+ } else {
206
+ document . querySelector ( '.supporters-list' ) . style . display = 'none' ;
207
+ }
208
+ }
209
+
210
+ initFinancial ( ) {
211
+ const financial = this . config . financial ;
212
+ const element = document . getElementById ( 'financialAmount' ) ;
213
+ const startValue = 0 ;
214
+ const endValue = financial . amount ;
215
+ const duration = financial . duration ;
216
+ const currency = financial . currency ;
217
+
218
+ // 设置颜色
219
+ element . style . color = endValue >= 0 ? '#2ecc71' : '#e74c3c' ;
220
+
221
+ // 使用 CSS cubic-bezier 实现动画效果
222
+ const startTime = performance . now ( ) ;
223
+
224
+ function update ( currentTime ) {
225
+ const elapsed = currentTime - startTime ;
226
+ const progress = Math . min ( elapsed / duration , 1 ) ;
227
+
228
+ // 使用缓动函数使动画更自然
229
+ const easeProgress = progress < 0.5
230
+ ? 4 * progress * progress * progress
231
+ : 1 - Math . pow ( - 2 * progress + 2 , 3 ) / 2 ;
232
+
233
+ const currentValue = startValue + ( endValue - startValue ) * easeProgress ;
234
+ element . textContent = `${ currency } ${ currentValue . toFixed ( 2 ) } ` ;
235
+
236
+ if ( progress < 1 ) {
237
+ requestAnimationFrame ( update ) ;
238
+ }
239
+ }
240
+
241
+ requestAnimationFrame ( update ) ;
242
+ }
243
+
244
+ initBarrage ( ) {
245
+ const barrageSystem = new BarrageSystem ( ) ;
246
+ const sendRandomMessage = ( ) => {
247
+ const messages = this . config . barrage . messages ;
248
+ const msg = messages [ Math . floor ( Math . random ( ) * messages . length ) ] ;
249
+ barrageSystem . addMessage ( msg ) ;
250
+ setTimeout ( sendRandomMessage , 500 + Math . random ( ) * 1500 ) ;
251
+ } ;
252
+ sendRandomMessage ( ) ;
253
+ }
254
+
255
+ initSupporters ( ) {
256
+ const supportersGrid = document . getElementById ( 'supportersGrid' ) ;
257
+ this . config . supporters . data . forEach ( supporter => {
258
+ const li = document . createElement ( 'li' ) ;
259
+ li . className = 'supporter-box' ;
260
+ const card = document . createElement ( 'supporter-card' ) ;
261
+ card . supporter = supporter ;
262
+ li . appendChild ( card ) ;
263
+ supportersGrid . appendChild ( li ) ;
264
+ } ) ;
265
+ }
266
+ }
267
+
268
+ // 初始化模块控制器
269
+ document . addEventListener ( 'DOMContentLoaded' , ( ) => {
270
+ new ModuleController ( siteConfig . acknowledgments ) ;
217
271
} ) ;
218
272
</ script >
219
273
</ body >
0 commit comments