diff --git a/.env b/.env index d5d39608dd..4487658201 100644 --- a/.env +++ b/.env @@ -3,7 +3,7 @@ VITE_SITE_NAME = "無名の主页" # 名称 VITE_SITE_ANTHOR = "無名" # 作者 VITE_SITE_KEYWORDS = "無名,个人主页" # 关键词 VITE_SITE_DES = "一个默默无闻的主页" # 站点简介 -VITE_SITE_URL = "imsyy.top" # 站点地址 +VITE_SITE_URL = "jmsyy.top" # 站点地址 VITE_SITE_LOGO = "/images/icon/favicon.ico" # 站点主图标 VITE_SITE_MAIN_LOGO = "/images/icon/logo.png" # 主页图标 VITE_SITE_APPLE_LOGO = "/images/logo/apple-touch-icon.png" # Apple 端图标 @@ -47,5 +47,5 @@ VITE_SONG_API = "https://api-meting.imsyy.top/api" VITE_SONG_SERVER = "netease" # 播放类型 ( song-歌曲, playlist-播放列表, album-专辑, search-搜索, artist-艺术家 ) VITE_SONG_TYPE = "playlist" -# 播放 ID +# 播放 ID ( 若无需播放器,请设为空即可 ) VITE_SONG_ID = "7452421335" \ No newline at end of file diff --git a/README.md b/README.md index 75ae6616f8..135e3f6a96 100644 --- a/README.md +++ b/README.md @@ -207,7 +207,7 @@ if (type == 0) { * [高德开放平台](https://lbs.amap.com/) * [Hitokoto 一言](https://hitokoto.cn/) * [MetingAPI By 武恩赐](https://api.wuenci.com/meting/api/) -* + ## Star History [![Star History Chart](https://api.star-history.com/svg?repos=imsyy/home&type=Date)](https://star-history.com/#imsyy/home&Date) diff --git a/package.json b/package.json index 62555df225..b6c5d5834d 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "github": "https://github.com/imsyy/home", "home": "https://imsyy.top", "private": true, - "version": "4.1.2", + "version": "4.1.3", "type": "module", "scripts": { "dev": "vite --host", diff --git a/public/font/Pacifico-Regular-all.ttf b/public/font/Pacifico-Regular-all.ttf new file mode 100644 index 0000000000..b9265a2a51 Binary files /dev/null and b/public/font/Pacifico-Regular-all.ttf differ diff --git a/public/font/README.md b/public/font/README.md new file mode 100644 index 0000000000..ba079baac0 --- /dev/null +++ b/public/font/README.md @@ -0,0 +1,3 @@ +## Logo 字体替换 + +可将该文件夹下的 `Pacifico-Regular-all.ttf` 替换原来的 `Pacifico-Regular.ttf` \ No newline at end of file diff --git a/src/App.vue b/src/App.vue index b4175236c9..3c905b66fa 100644 --- a/src/App.vue +++ b/src/App.vue @@ -17,7 +17,12 @@ - + @@ -178,7 +183,7 @@ onBeforeUnmount(() => { .i-icon { transform: translateY(2px); } - @media (min-width: 720px) { + @media (min-width: 721px) { display: none; } } diff --git a/src/components/Background.vue b/src/components/Background.vue index 178cfd5b37..2b8e385e07 100644 --- a/src/components/Background.vue +++ b/src/components/Background.vue @@ -1,5 +1,5 @@ @@ -57,13 +59,13 @@ const getHitokotoData = () => { fill: "#efefef", }), }); + hitokotoData.text = "这里应该显示一句话"; + hitokotoData.from = "無名"; }); }; // 更新一言数据 const updateHitokoto = () => { - hitokotoData.text = "新的一言正在赶来的路上"; - hitokotoData.from = "来源加载中"; // 防抖 debounce(() => { getHitokotoData(); diff --git a/src/components/Message.vue b/src/components/Message.vue index c35831ee32..228758d406 100644 --- a/src/components/Message.vue +++ b/src/components/Message.vue @@ -4,7 +4,7 @@ - +
@@ -281,12 +281,6 @@ watch( } // 弹窗动画 -.fade-enter-active { - animation: fade 0.3s ease-in-out; -} -.fade-leave-active { - animation: fade 0.3s ease-in-out reverse; -} .zoom-enter-active { animation: zoom 0.4s ease-in-out; } diff --git a/src/components/Player.vue b/src/components/Player.vue index 05870cacd9..4bff3493c1 100644 --- a/src/components/Player.vue +++ b/src/components/Player.vue @@ -16,6 +16,7 @@ @pause="onPause" @timeupdate="onTimeUp" @onSelectSong="onSelectSong" + @error="loadMusicError" /> @@ -37,6 +38,8 @@ const playList = ref([]); const playIndex = ref(0); const playListCount = ref(0); +const skipTimeout = ref(null); + // 配置项 const props = defineProps({ // 音频自动播放 @@ -202,8 +205,39 @@ const changeSong = (type) => { }); }; +// 加载音频错误 +const loadMusicError = () => { + let notice = ""; + if (playList.value.length > 1) { + notice = "播放歌曲出现错误,播放器将在 2s 后进行下一首"; + // 播放下一首 + skipTimeout.value = setTimeout(() => { + changeSong(1); + if (!player.value.audio.paused) { + onPlay(); + } + }, 2000); + } else { + notice = "播放歌曲出现错误"; + } + ElMessage({ + message: notice, + grouping: true, + icon: h(PlayWrong, { + theme: "filled", + fill: "#EFEFEF", + duration: 2000, + }), + }); + console.error("播放歌曲: " + player.value.currentMusic.title + " 出现错误"); +}; + // 暴露子组件方法 defineExpose({ playToggle, changeVolume, changeSong }); + +onBeforeUnmount(() => { + clearTimeout(skipTimeout.value); +});