From 981320feb2e4d11ee9d47031badeef440b4a572d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A5=9E=E5=A5=87=E3=81=AEDz?= Date: Wed, 23 Aug 2023 13:38:17 +0800 Subject: [PATCH] style(formatting): apply Prettier code formatting --- index.html | 75 ++++++++-------- src/App.vue | 69 ++++++--------- src/api/index.js | 20 ++--- src/assets/socialLinks.json | 21 +++-- src/components/Background.vue | 42 ++++----- src/components/Footer.vue | 6 +- src/components/Hitokoto.vue | 24 +++--- src/components/Links.vue | 31 +++---- src/components/Loading.vue | 10 ++- src/components/Message.vue | 24 +++--- src/components/Music.vue | 65 ++++---------- src/components/Player.vue | 97 ++++++++++----------- src/components/Set.vue | 23 ++--- src/components/SocialLinks.vue | 8 +- src/components/TimeCapsule.vue | 55 +++--------- src/components/Weather.vue | 26 +++--- src/main.js | 18 ++-- src/store/index.js | 22 ++--- src/style/global.scss | 29 +++---- src/style/style.scss | 16 ++-- src/utils/cursor.js | 153 ++++++++++++++++----------------- src/utils/debounce.js | 34 ++++---- src/utils/getTime.js | 65 ++++++-------- src/views/Box/index.vue | 16 ++-- src/views/Func/index.vue | 18 ++-- src/views/Main/Left.vue | 8 +- src/views/Main/Right.vue | 13 ++- src/views/MoreSet/index.vue | 55 ++++-------- 28 files changed, 451 insertions(+), 592 deletions(-) diff --git a/index.html b/index.html index 9220b52..f2c2682 100644 --- a/index.html +++ b/index.html @@ -1,40 +1,39 @@ - + + + + + + + + + + + + + + + %VITE_SITE_NAME% + + + + + + + - - - - - - - - - - - - - - %VITE_SITE_NAME% - - - - - - - - - - -
- - - - - - \ No newline at end of file + + +
+ + + + + diff --git a/src/App.vue b/src/App.vue index 73f94b2..feb0393 100644 --- a/src/App.vue +++ b/src/App.vue @@ -12,20 +12,12 @@ -
+
- + @@ -36,19 +28,19 @@ @@ -142,8 +128,7 @@ onBeforeUnmount(() => { height: 100%; transform: scale(1.2); transition: transform 0.3s; - animation: fade-blur-main-in 0.65s cubic-bezier(0.25, 0.46, 0.45, 0.94) - forwards; + animation: fade-blur-main-in 0.65s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; animation-delay: 0.5s; .container { width: 100%; diff --git a/src/api/index.js b/src/api/index.js index 82c6c7d..ab0d6b4 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -1,5 +1,5 @@ // import axios from "axios"; -import fetchJsonp from "fetch-jsonp"; +import fetchJsonp from 'fetch-jsonp'; /** * 音乐播放器 @@ -8,19 +8,17 @@ import fetchJsonp from "fetch-jsonp"; // 获取音乐播放列表 export const getPlayerList = async (server, type, id) => { const res = await fetch( - `${import.meta.env.VITE_SONG_API}?server=${server}&type=${type}&id=${id}` + `${import.meta.env.VITE_SONG_API}?server=${server}&type=${type}&id=${id}`, ); const data = await res.json(); - if (data[0].url.startsWith("@")) { - const [handle, jsonpCallback, jsonpCallbackFunction, url] = data[0].url - .split("@") - .slice(1); + if (data[0].url.startsWith('@')) { + const [handle, jsonpCallback, jsonpCallbackFunction, url] = data[0].url.split('@').slice(1); const jsonpData = await fetchJsonp(url).then((res) => res.json()); const domain = ( - jsonpData.req_0.data.sip.find((i) => !i.startsWith("http://ws")) || + jsonpData.req_0.data.sip.find((i) => !i.startsWith('http://ws')) || jsonpData.req_0.data.sip[0] - ).replace("http://", "https://"); + ).replace('http://', 'https://'); return data.map((v, i) => ({ title: v.name || v.title, @@ -46,7 +44,7 @@ export const getPlayerList = async (server, type, id) => { // 获取一言数据 export const getHitokoto = async () => { - const res = await fetch("https://v1.hitokoto.cn"); + const res = await fetch('https://v1.hitokoto.cn'); return await res.json(); }; @@ -63,7 +61,7 @@ export const getAdcode = async (key) => { // 获取高德地理天气信息 export const getWeather = async (key, city) => { const res = await fetch( - `https://restapi.amap.com/v3/weather/weatherInfo?key=${key}&city=${city}` + `https://restapi.amap.com/v3/weather/weatherInfo?key=${key}&city=${city}`, ); return await res.json(); }; @@ -71,6 +69,6 @@ export const getWeather = async (key, city) => { // 获取教书先生天气 API // https://api.oioweb.cn/doc/weather/GetWeather export const getOtherWeather = async () => { - const res = await fetch("https://api.oioweb.cn/api/weather/GetWeather"); + const res = await fetch('https://api.oioweb.cn/api/weather/GetWeather'); return await res.json(); }; diff --git a/src/assets/socialLinks.json b/src/assets/socialLinks.json index 2be8bef..7865332 100644 --- a/src/assets/socialLinks.json +++ b/src/assets/socialLinks.json @@ -1,31 +1,38 @@ -[{ +[ + { "name": "Github", "icon": "/images/icon/github.png", "tip": "去 Github 看看", "url": "https://github.com/imsyy" -}, { + }, + { "name": "BiliBili", "icon": "/images/icon/bilibili.png", "tip": "(゜-゜)つロ 干杯 ~", "url": "https://space.bilibili.com/98544142" -}, { + }, + { "name": "QQ", "icon": "/images/icon/qq.png", "tip": "有什么事吗", "url": "https://res.abeim.cn/api/qq/?qq=1539250352" -}, { + }, + { "name": "Email", "icon": "/images/icon/email.png", "tip": "来封 Email ~", "url": "mailto:one@imsyy.top" -}, { + }, + { "name": "Twitter", "icon": "/images/icon/twitter.png", "tip": "你懂的 ~", "url": "https://twitter.com/iimmsyy" -}, { + }, + { "name": "Telegram", "icon": "/images/icon/telegram.png", "tip": "你懂的 ~", "url": "https://t.me/bottom_user" -}] \ No newline at end of file + } +] diff --git a/src/components/Background.vue b/src/components/Background.vue index 0383274..430ad61 100644 --- a/src/components/Background.vue +++ b/src/components/Background.vue @@ -24,13 +24,13 @@ @@ -92,7 +92,7 @@ watch( height: 142px; margin-left: 12px; transform: translateY(-8px); - font-family: "Pacifico-Regular"; + font-family: 'Pacifico-Regular'; .bg { font-size: 5rem; @@ -136,7 +136,7 @@ watch( p { &:nth-of-type(1) { - font-family: "Pacifico-Regular"; + font-family: 'Pacifico-Regular'; } } } @@ -174,4 +174,4 @@ watch( } } } - \ No newline at end of file + diff --git a/src/components/Music.vue b/src/components/Music.vue index 1b1c0d2..d71e245 100644 --- a/src/components/Music.vue +++ b/src/components/Music.vue @@ -11,49 +11,24 @@ 回到一言
- +
- - + +
- +
-
+
{ onMounted(() => { // 空格键事件 - window.addEventListener("keydown", (e) => { - if (e.code == "Space") { + window.addEventListener('keydown', (e) => { + if (e.code == 'Space') { changePlayState(); } }); @@ -162,7 +127,7 @@ watch( (value) => { store.musicVolume = value; playerRef.value.changeVolume(store.musicVolume); - } + }, ); diff --git a/src/components/Player.vue b/src/components/Player.vue index 6afcfa3..ca25511 100644 --- a/src/components/Player.vue +++ b/src/components/Player.vue @@ -20,10 +20,10 @@ \ No newline at end of file + diff --git a/src/views/Main/Right.vue b/src/views/Main/Right.vue index 757f7cc..c018ebe 100644 --- a/src/views/Main/Right.vue +++ b/src/views/Main/Right.vue @@ -13,16 +13,15 @@ - \ No newline at end of file + diff --git a/src/views/MoreSet/index.vue b/src/views/MoreSet/index.vue index 3cf6870..d700000 100644 --- a/src/views/MoreSet/index.vue +++ b/src/views/MoreSet/index.vue @@ -1,10 +1,5 @@