仰望星辰工作室

starmusic-pc

starmusic-pc/ frontend/src/components/AboutSection.vue 13.8 KB · 569 行 原始文件
1<script setup>
2/**
3 * AboutSection — 关于板块(嵌入设置页)
4 *
5 * 由原独立「关于」页整体迁移而来:品牌介绍 + 星空主题装饰卡 +
6 * 隐藏彩蛋(连点版本号 7 次触发「星辰跳一跳」)。
7 * 刻意使用深色星空风格,与设置页的浅色卡片形成反差,作为「惊喜」时刻。
8 */
9import { ref, onBeforeUnmount } from 'vue'
10import Icon from '../components/Icon.vue'
11import StarJumpGame from './StarJumpGame.vue'
12import { getAppVersion } from '../common/update.js'
13import { currentTheme } from '../composables/useTheme.js'
14import { toast, toastOk } from '../composables/useFeedback.js'
15import { openExternal } from '../uni/native.js'
16
17const version = ref(getAppVersion())
18const showGame = ref(false)
19const unlocked = ref([])
20
21const MESSAGES = ['每一颗星星,都是一个未说出口的愿望', '愿你像星辰一样,即使微弱,也始终发光', '仰望星辰的人,终会成为别人的光', '夏日之瓜 · 仰望星辰工作室 · 感谢你发现这里']
22const THRESHOLDS = [3, 6, 10, 15]
23
24// ============ 星空 ============
25
26const stars = Array.from({ length: 36 }, (_, i) => ({
27 id: i,
28 x: Math.random() * 100,
29 y: Math.random() * 100,
30 size: 1 + Math.random() * 2.4,
31 delay: Math.random() * 4,
32 duration: 2.4 + Math.random() * 3.2,
33}))
34
35// ============ 隐藏入口:连点 7 次 ============
36
37const TAP_TARGET = 7
38const taps = ref(0)
39let resetTimer = null
40
41const handleVersionTap = () => {
42 taps.value += 1
43 if (resetTimer) clearTimeout(resetTimer)
44 resetTimer = setTimeout(() => {
45 taps.value = 0
46 }, 5000)
47
48 if (taps.value >= TAP_TARGET) {
49 taps.value = 0
50 if (resetTimer) clearTimeout(resetTimer)
51 showGame.value = true
52 toastOk('发现隐藏彩蛋:星辰跳一跳')
53 return
54 }
55 if (taps.value >= 3) {
56 toast(`再点 ${TAP_TARGET - taps.value} 次试试`, 'none', 1400)
57 }
58}
59
60const onGameScore = (score) => {
61 const list = []
62 THRESHOLDS.forEach((t, i) => {
63 if (score >= t) list.push(MESSAGES[i])
64 })
65 unlocked.value = list
66}
67
68onBeforeUnmount(() => {
69 if (resetTimer) clearTimeout(resetTimer)
70})
71
72const openHomepage = async () => {
73 const ok = await openExternal('https://starmusic.fangqihang.cn/')
74 if (!ok) toast('链接已复制到剪贴板', 'none', 2000)
75}
76
77const stack = [
78 { icon: 'play', label: '播放内核', value: 'HTMLAudio + 事件总线' },
79 { icon: 'database', label: '音源协议', value: 'LX Music 兼容沙箱' },
80 { icon: 'palette', label: '界面', value: 'Vue 3 + 自绘设计系统' },
81 { icon: 'shield', label: '外壳', value: 'Wails / WebView2' },
82]
83</script>
84
85<template>
86 <div class="about-section">
87 <div class="sky-deco">
88 <span
89 v-for="s in stars"
90 :key="s.id"
91 class="star"
92 :style="{
93 left: `${s.x}%`,
94 top: `${s.y}%`,
95 width: `${s.size}px`,
96 height: `${s.size}px`,
97 animationDelay: `${s.delay}s`,
98 animationDuration: `${s.duration}s`,
99 }"
100 />
101 </div>
102
103 <div class="inner">
104 <!-- ============ 品牌 ============ -->
105 <section class="hero">
106 <div class="logo">
107 <span class="logo-mark">
108 <Icon name="music2" :size="34" :width="2" />
109 </span>
110 <span class="logo-ring" />
111 </div>
112 <h1>星音乐</h1>
113 <p class="hero-sub">star-music · 夏日之瓜 · 仰望星辰工作室出品</p>
114 <div class="hero-tags">
115 <span class="tag">多平台聚合</span>
116 <span class="tag">自定义音源</span>
117 <span class="tag">云同步歌单</span>
118 <span class="tag">节拍可视化</span>
119 </div>
120 </section>
121
122 <!-- ============ 星空寄语卡 ============ -->
123 <section class="star-card">
124 <div class="card-sky">
125 <span class="moon" />
126 <span class="shooting" />
127 <span class="shooting s2" />
128 <span
129 v-for="s in stars.slice(0, 22)"
130 :key="`c${s.id}`"
131 class="star"
132 :style="{
133 left: `${s.x}%`,
134 top: `${s.y}%`,
135 width: `${s.size}px`,
136 height: `${s.size}px`,
137 animationDelay: `${s.delay}s`,
138 animationDuration: `${s.duration}s`,
139 }"
140 />
141 </div>
142 <div class="card-content">
143 <p class="card-title">愿每一次仰望,都有星光回应</p>
144 <p class="card-sub">
145 星音乐把「找歌 → 试听 → 收藏 → 播放」这一条链路做成了一个安静的小工具。
146 它不提供任何音乐文件,只把你自己导入的音源与官方公开接口连起来。
147 </p>
148 </div>
149 </section>
150
151 <!-- ============ 已解锁寄语 ============ -->
152 <TransitionGroup name="unlock" tag="section" class="unlock-list">
153 <div v-for="(text, i) in unlocked" :key="text" class="unlock-item" :style="{ '--delay': `${i * 70}ms` }">
154 <Icon name="sparkle" :size="14" />
155 <span>{{ text }}</span>
156 </div>
157 </TransitionGroup>
158
159 <!-- ============ 技术栈 ============ -->
160 <section class="stack">
161 <div v-for="item in stack" :key="item.label" class="stack-item">
162 <span class="stack-icon"><Icon :name="item.icon" :size="15" /></span>
163 <span class="stack-label">{{ item.label }}</span>
164 <span class="stack-value">{{ item.value }}</span>
165 </div>
166 </section>
167
168 <!-- ============ 责任声明 ============ -->
169 <section class="notice">
170 <p class="notice-title">
171 <Icon name="info" :size="14" />
172 责任声明
173 </p>
174 <p class="notice-text">
175 本项目仅用于技术学习与交流,不提供任何音乐文件的存储与分发。所有播放数据均来自你自行导入的第三方音源,
176 版权归原作者及版权方所有。请勿用于商业用途,并在法律允许的范围内使用。
177 </p>
178 </section>
179
180 <!-- ============ 页脚(彩蛋入口) ============ -->
181 <footer class="foot">
182 <button class="ver-btn press" title="嗯?多点几下试试" @click="handleVersionTap">
183 <Icon name="star4" :size="13" />
184 <span>v{{ version }}</span>
185 <em v-if="taps > 0 && taps < TAP_TARGET">{{ taps }}/{{ TAP_TARGET }}</em>
186 </button>
187 <span class="sep">·</span>
188 <span>{{ currentTheme.name }}</span>
189 <span class="sep">·</span>
190 <button class="link-btn" @click="openHomepage">
191 官网
192 <Icon name="external" :size="11" />
193 </button>
194 <span class="sep">·</span>
195 <span>© 2026 仰望星辰工作室</span>
196 </footer>
197 </div>
198
199 <!-- ============ 彩蛋游戏 ============ -->
200 <Transition name="game">
201 <div v-if="showGame" class="game-mask" @click.self="showGame = false">
202 <StarJumpGame
203 :color="currentTheme.color"
204 class="game-panel"
205 @score="onGameScore"
206 @close="showGame = false"
207 />
208 </div>
209 </Transition>
210 </div>
211</template>
212
213<style scoped>
214.about-section {
215 position: relative;
216 margin-top: 14px;
217 padding: 22px 20px 24px;
218 border-radius: var(--r-xl);
219 background: radial-gradient(120% 80% at 20% 0%, #1a2740 0%, #121c2c 42%, #0d141f 100%);
220 border: 1px solid rgba(255, 255, 255, 0.1);
221 overflow: hidden;
222}
223
224.sky-deco {
225 position: absolute;
226 inset: 0;
227 pointer-events: none;
228 opacity: 0.7;
229}
230
231.star {
232 position: absolute;
233 border-radius: var(--r-full);
234 background: #fff;
235 animation: kTwinkle 3s var(--ease-in-out) infinite;
236}
237
238.inner {
239 position: relative;
240 z-index: 2;
241 max-width: 760px;
242 margin: 0 auto;
243 display: flex;
244 flex-direction: column;
245 gap: 16px;
246}
247
248/* ---------- 品牌 ---------- */
249
250.hero {
251 display: flex;
252 flex-direction: column;
253 align-items: center;
254 text-align: center;
255 padding: 6px 0 2px;
256}
257
258.logo {
259 position: relative;
260 display: grid;
261 place-items: center;
262 width: 72px;
263 height: 72px;
264 margin-bottom: 14px;
265}
266
267.logo-mark {
268 display: grid;
269 place-items: center;
270 width: 72px;
271 height: 72px;
272 border-radius: 22px;
273 color: #fff;
274 background: linear-gradient(140deg, var(--theme-color), var(--theme-color-dark));
275 box-shadow: 0 16px 40px rgba(var(--theme-color-rgb), 0.42);
276 animation: kBreath 5s var(--ease-in-out) infinite;
277}
278
279.logo-ring {
280 position: absolute;
281 inset: -10px;
282 border-radius: 32px;
283 border: 1.5px solid rgba(var(--theme-color-rgb), 0.4);
284 animation: kPulseRing 3.6s var(--ease-out) infinite;
285}
286
287.hero h1 {
288 font-size: 26px;
289 font-weight: 700;
290 letter-spacing: 7px;
291 text-indent: 7px;
292 color: #fff;
293}
294
295.hero-sub {
296 margin-top: 8px;
297 font-size: 12.5px;
298 letter-spacing: 1.4px;
299 color: rgba(226, 236, 250, 0.6);
300}
301
302.hero-tags {
303 display: flex;
304 flex-wrap: wrap;
305 justify-content: center;
306 gap: 7px;
307 margin-top: 14px;
308}
309
310.tag {
311 padding: 4px 11px;
312 border-radius: var(--r-full);
313 font-size: 11.5px;
314 color: rgba(226, 236, 250, 0.82);
315 background: rgba(255, 255, 255, 0.08);
316 border: 1px solid rgba(255, 255, 255, 0.1);
317}
318
319/* ---------- 寄语卡 ---------- */
320
321.star-card {
322 position: relative;
323 border-radius: var(--r-xl);
324 overflow: hidden;
325 border: 1px solid rgba(255, 255, 255, 0.12);
326 background: rgba(255, 255, 255, 0.05);
327 backdrop-filter: blur(20px) saturate(150%);
328 -webkit-backdrop-filter: blur(20px) saturate(150%);
329 box-shadow: 0 24px 60px rgba(0, 0, 0, 0.36);
330}
331
332.card-sky {
333 position: absolute;
334 inset: 0;
335 pointer-events: none;
336}
337
338.moon {
339 position: absolute;
340 top: 22px;
341 right: 30px;
342 width: 42px;
343 height: 42px;
344 border-radius: var(--r-full);
345 background: radial-gradient(circle at 34% 34%, #fff, #dfe9ff 60%, #b9c8e6);
346 box-shadow: 0 0 34px rgba(220, 232, 255, 0.6);
347}
348
349.shooting {
350 position: absolute;
351 top: 24%;
352 right: 12%;
353 width: 120px;
354 height: 1.5px;
355 border-radius: var(--r-full);
356 background: linear-gradient(90deg, rgba(255, 255, 255, 0.95), transparent);
357 animation: kShooting 6s var(--ease-out) infinite;
358 animation-delay: 1.4s;
359}
360
361.shooting.s2 {
362 top: 54%;
363 right: 30%;
364 width: 80px;
365 animation-delay: 3.8s;
366 opacity: 0.7;
367}
368
369.card-content {
370 position: relative;
371 z-index: 2;
372 padding: 26px 24px;
373}
374
375.card-title {
376 font-size: 17px;
377 font-weight: 600;
378 letter-spacing: 1.4px;
379 color: #fff;
380}
381
382.card-sub {
383 margin-top: 10px;
384 font-size: 12.5px;
385 line-height: 1.9;
386 color: rgba(226, 236, 250, 0.66);
387 max-width: 560px;
388}
389
390/* ---------- 解锁寄语 ---------- */
391
392.unlock-list {
393 display: flex;
394 flex-direction: column;
395 gap: 8px;
396}
397
398.unlock-item {
399 display: flex;
400 align-items: center;
401 gap: 9px;
402 padding: 11px 15px;
403 border-radius: var(--r-md);
404 font-size: 12.5px;
405 letter-spacing: 0.6px;
406 color: rgba(255, 255, 255, 0.9);
407 background: linear-gradient(100deg, rgba(var(--theme-color-rgb), 0.24), rgba(255, 255, 255, 0.04));
408 border: 1px solid rgba(var(--theme-color-rgb), 0.3);
409 animation: kFadeUp var(--t-slow) var(--ease-out) both;
410 animation-delay: var(--delay, 0ms);
411}
412
413.unlock-enter-active {
414 transition: opacity var(--t-slow) var(--ease-out), transform var(--t-slow) var(--ease-overshoot);
415}
416
417.unlock-enter-from {
418 opacity: 0;
419 transform: translateY(12px);
420}
421
422/* ---------- 技术栈 ---------- */
423
424.stack {
425 display: grid;
426 grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
427 gap: 10px;
428}
429
430.stack-item {
431 display: flex;
432 flex-direction: column;
433 gap: 6px;
434 padding: 13px 15px;
435 border-radius: var(--r-lg);
436 background: rgba(255, 255, 255, 0.05);
437 border: 1px solid rgba(255, 255, 255, 0.09);
438}
439
440.stack-icon {
441 display: grid;
442 place-items: center;
443 width: 28px;
444 height: 28px;
445 border-radius: var(--r-sm);
446 color: var(--theme-color);
447 background: rgba(var(--theme-color-rgb), 0.16);
448}
449
450.stack-label {
451 font-size: 11px;
452 letter-spacing: 0.6px;
453 color: rgba(226, 236, 250, 0.5);
454}
455
456.stack-value {
457 font-size: 12.5px;
458 color: rgba(255, 255, 255, 0.9);
459}
460
461/* ---------- 声明 ---------- */
462
463.notice {
464 padding: 15px 17px;
465 border-radius: var(--r-lg);
466 background: rgba(255, 255, 255, 0.04);
467 border: 1px solid rgba(255, 255, 255, 0.08);
468}
469
470.notice-title {
471 display: flex;
472 align-items: center;
473 gap: 7px;
474 font-size: 12.5px;
475 font-weight: 600;
476 color: rgba(255, 255, 255, 0.86);
477 margin-bottom: 7px;
478}
479
480.notice-text {
481 font-size: 11.5px;
482 line-height: 1.9;
483 color: rgba(226, 236, 250, 0.58);
484}
485
486/* ---------- 页脚 ---------- */
487
488.foot {
489 display: flex;
490 align-items: center;
491 justify-content: center;
492 flex-wrap: wrap;
493 gap: 8px;
494 padding: 8px 0 2px;
495 font-size: 11.5px;
496 color: rgba(226, 236, 250, 0.5);
497}
498
499.ver-btn {
500 display: inline-flex;
501 align-items: center;
502 gap: 6px;
503 height: 24px;
504 padding: 0 10px;
505 border-radius: var(--r-full);
506 color: rgba(226, 236, 250, 0.72);
507 font-size: 11.5px;
508 background: rgba(255, 255, 255, 0.07);
509 transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
510}
511
512.ver-btn:hover {
513 background: rgba(var(--theme-color-rgb), 0.24);
514 color: #fff;
515}
516
517.ver-btn em {
518 font-style: normal;
519 color: var(--theme-color);
520 font-weight: 600;
521}
522
523.link-btn {
524 display: inline-flex;
525 align-items: center;
526 gap: 4px;
527 color: rgba(226, 236, 250, 0.7);
528 font-size: 11.5px;
529 transition: color var(--t-fast) var(--ease-out);
530}
531
532.link-btn:hover {
533 color: var(--theme-color);
534}
535
536.sep {
537 opacity: 0.4;
538}
539
540/* ---------- 游戏覆盖层 ---------- */
541
542.game-mask {
543 position: fixed;
544 inset: 0;
545 z-index: var(--z-overlay);
546 display: grid;
547 place-items: center;
548 padding: 32px;
549 background: rgba(8, 12, 20, 0.66);
550 backdrop-filter: blur(6px);
551 -webkit-backdrop-filter: blur(6px);
552 animation: kMaskIn var(--t-base) ease both;
553}
554
555.game-panel {
556 width: min(760px, 100%);
557 animation: kPopIn var(--t-slow) var(--ease-overshoot) both;
558}
559
560.game-enter-active,
561.game-leave-active {
562 transition: opacity var(--t-base) var(--ease-out);
563}
564
565.game-enter-from,
566.game-leave-to {
567 opacity: 0;
568}
569</style>