Skip to content

Commit

Permalink
update: links in database page for better navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
alikia2x committed Jul 11, 2024
1 parent e548326 commit 942ce3d
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 4 deletions.
41 changes: 41 additions & 0 deletions data/song/BV1pE421A7mM.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"id": "BV1pE421A7mM",
"name": "唱给锦依卫",
"url": "https://www.bilibili.com/video/BV1pE421A7mM",
"singer": [
"洛天依"
],
"producer": "WOVOP",
"tuning": [
"鬼面P"
],
"lyricist": [
"青天纤云-TsingClouds"
],
"composer": [
"WOVOP"
],
"arranger": [
"随手诶"
],
"mixing": [
"__月华__"
],
"pv": [
"璇玑坊Studio"
],
"illustrator": [
"Ben_SY"
],
"harmony": [
"Vsinger ACE全员"
],
"instruments": [],
"songURL": ["https://assets.aquavox.app/public/BV1pE421A7mM.mp3"],
"coverURL": ["https://assets.aquavox.app/public/BV1pE421A7mM.jpg"],
"duration": 192.22,
"views": 3021,
"publishTime": "2024-07-12 00:00:00",
"updateTime": "2024-07-12 01:49:30",
"lyric": "[ti: 唱给锦依卫]\n[ar: 洛天依]\n[tool: 歌词滚动姬 https://lrc-maker.github.io]\n[00:00.000]\n[00:11.400] 推开窗,又是一缕曙光轻拂你脸庞\n[00:17.100] 风轻扬,浮现初见时你青涩模样\n[00:22.830] 齐开唱,歌声驱散你眼神中的迷茫\n[00:28.770] 飘过秋叶与春花,流转几轮冬与夏\n[00:34.410] 乘着馨风去远航,有你长夜也明亮\n[00:40.230] 携手向梦的彼方,追寻心中那道光\n[00:46.800] 一起唱下去吧\n[00:50.880] 用你我梦想\n[00:53.610] 希望光芒为你点亮\n[00:58.230] 续写未来篇章\n[01:02.400] 纵岁月漫长\n[01:05.220] 会永远传唱\n[01:09.797]\n[01:32.370] 指尖淌,自由弦音随着风儿去流浪\n[01:38.040] 回头望,路上不时也会跌跌撞撞\n[01:44.010] 别彷徨,遗忘那过去的灰心和失望\n[01:49.740] 有你相伴的过往,每篇故事都珍藏\n[01:55.470] 载着梦想去远航,你我并肩去闯荡\n[02:01.260] 执笔最美的诗行,烟火为你而绽放\n[02:07.830] 一起唱下去吧\n[02:11.640] 星澜里荡漾\n[02:14.700] 留下最绚烂的光芒\n[02:19.350] 唱你我的梦想\n[02:23.370] 在舞台中央\n[02:26.190] 交织中回响\n[02:31.020] 一起唱下去吧\n[02:34.980] 用你我梦想\n[02:37.800] 将希望光芒再点亮\n[02:42.450] 续写未来篇章\n[02:46.500] 纵岁月沧桑\n[02:49.410] 永远在你身旁\n[02:53.364]"
}
2 changes: 1 addition & 1 deletion src/lib/formatViews.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ export function formatViews(num: number): string {
const formattedNum = Math.floor(num / 1000) / 10; // 向下保留1位小数
return `${formattedNum} 万`;
} else {
return num.toString();
return num.toString() + " ";
}
}
1 change: 1 addition & 0 deletions src/routes/+page.server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const ssr = false;
2 changes: 2 additions & 0 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@
on:click={() => window.confirm('确定要删除本地数据库中所有内容吗?') && clear()}
class="text-white bg-red-500 px-4 py-2 mt-4 rounded-md">一键清除</button
>
<h2 class="mt-4"><a href="/database/">音乐数据库</a></h2>
<p>你可以在这里探索,提交和分享好听的歌曲。</p>
</div>

<style lang="postcss">
Expand Down
6 changes: 4 additions & 2 deletions src/routes/database/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
<title>AquaVox 音乐数据库</title>
</svelte:head>

<h1 class="text-3xl text-red-500"><a href="/">AquaVox</a></h1>

<div>
<div class="flex justify-between items-center h-20 mb-8">
<h1>AquaVox 音乐数据库</h1>
Expand Down Expand Up @@ -72,11 +74,11 @@
</span>
<div class="absolute right-2 bottom-2 text-right">
{#if song.duration}
<span>{formatDuration(song.duration)}</span>
<span style="text-shadow: 0px 0px 4px rgba(65, 65, 65, .6);">{formatDuration(song.duration)}</span>
{/if}
<br />
{#if song.views}
<span>{formatViews(song.views)}</span>
<span style="text-shadow: 0px 0px 4px rgba(65, 65, 65, .6);">{formatViews(song.views)}播放</span>
{/if}
</div>
</div>
Expand Down
2 changes: 2 additions & 0 deletions src/routes/database/edit/[id]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
<title>建议编辑: {data.songData.name} ({songID})</title>
</svelte:head>

<h1 class="text-3xl text-red-500"><a href="/database/">AquaVox 音乐数据库</a></h1>

<h1>建议编辑: {data.songData.name} ({songID})</h1>

<textarea bind:value={editingData} class="dark:bg-zinc-600 w-full min-h-[30rem] mt-6" />
Expand Down
5 changes: 4 additions & 1 deletion src/routes/database/submit/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
let editingData: string = JSON.stringify(templateSongData, null, 8);
async function submit() {
fetch(`/api/database/song/${templateSongData.id}`, {
const dataToSubmit: MusicMetadata = JSON.parse(editingData);
fetch(`/api/database/song/${dataToSubmit.id}`, {
method: 'POST',
headers: {
Accept: 'application/json',
Expand All @@ -45,6 +46,8 @@
<title>提交新曲</title>
</svelte:head>

<h1 class="text-3xl text-red-500"><a href="/database/">AquaVox 音乐数据库</a></h1>

<h1>提交新曲</h1>

<textarea bind:value={editingData} class="dark:bg-zinc-600 w-full min-h-[36rem] mt-6" />
Expand Down

0 comments on commit 942ce3d

Please sign in to comment.