完善设置页面

This commit is contained in:
底层用户 2022-11-27 14:44:53 +08:00
parent 8c6dc91075
commit 3463084339
14 changed files with 445 additions and 128 deletions

View File

@ -14,6 +14,7 @@
"axios": "^1.1.3",
"element-plus": "^2.2.18",
"pinia": "^2.0.23",
"pinia-plugin-persistedstate": "^3.0.0",
"vue": "^3.2.37",
"vue3-aplayer": "^1.7.3"
},

View File

@ -2,7 +2,7 @@
<div class="animate">
<Background />
<main>
<div class="container">
<div class="container" v-show="!store.backgroundShow">
<transition name="el-fade-in-linear">
<section class="main" v-show="!store.setOpenState">
<MainLeft />
@ -11,13 +11,17 @@
</section>
</transition>
<transition name="el-fade-in-linear">
<section class="more" v-show="store.setOpenState" @click="store.setOpenState = false">
<section
class="more"
v-show="store.setOpenState"
@click="store.setOpenState = false"
>
<MoreSet />
</section>
</transition>
</div>
</main>
<Footer />
<Footer v-show="!store.backgroundShow" />
</div>
</template>
@ -57,6 +61,18 @@ onMounted(() => {
loadingBox.classList.add("loaded");
});
//
window.addEventListener("mousedown", (event) => {
if (event.button == 1) {
store.backgroundShow = !store.backgroundShow;
if (store.backgroundShow) {
ElMessage("已开启壁纸展示状态");
} else {
ElMessage("已退出壁纸展示状态");
}
}
});
//
getWidth();
window.addEventListener("resize", getWidth);
@ -103,6 +119,8 @@ main {
transition: all ease 1.25s;
opacity: 1;
filter: blur(0);
width: 100%;
height: 100%;
}
.loading {

View File

@ -1,12 +1,22 @@
<template>
<div class="cover">
<img class="bg" :src="bgUrl" alt="cover" />
<div class="gray"></div>
<div :class="store.backgroundShow ? 'gray sm' : 'gray'" />
<transition name="el-fade-in-linear">
<a
class="down"
:href="bgUrl"
target="_blank"
v-show="store.backgroundShow && store.coverType != '3'"
>下载壁纸</a
>
</transition>
</div>
</template>
<script setup>
import { onMounted, ref, watch } from "vue";
import { onMounted, ref, watch, h } from "vue";
import { SuccessPicture } from "@icon-park/vue-next";
import { mainStore } from "@/store";
const store = mainStore();
@ -24,7 +34,7 @@ const changeBg = (type) => {
} else if (type == 3) {
bgUrl.value = "https://api.ixiaowai.cn/api/api.php";
}
}
};
onMounted(() => {
//
@ -36,6 +46,13 @@ watch(
() => store.coverType,
(value) => {
changeBg(value);
ElMessage({
message: "壁纸设置成功",
icon: h(SuccessPicture, {
theme: "filled",
fill: "#efefef",
}),
});
}
);
</script>
@ -62,7 +79,6 @@ watch(
transition: all 1.5s ease 0s;
backface-visibility: hidden;
}
.gray {
opacity: 1;
position: absolute;
@ -70,11 +86,42 @@ watch(
top: 0;
width: 100%;
height: 100%;
background-image: radial-gradient(rgba(0, 0, 0, 0) 0,
rgba(0, 0, 0, 0.5) 100%),
background-image: radial-gradient(
rgba(0, 0, 0, 0) 0,
rgba(0, 0, 0, 0.5) 100%
),
radial-gradient(rgba(0, 0, 0, 0) 33%, rgba(0, 0, 0, 0.3) 166%);
transition: 1.5s;
&.sm {
opacity: 0;
transition: 1.5s;
}
}
.down {
font-size: 16px;
color: white;
position: absolute;
bottom: 30px;
left: 0;
right: 0;
margin: 0 auto;
display: block;
padding: 20px 26px;
border-radius: 8px;
background-color: #00000030;
width: 120px;
height: 30px;
display: flex;
justify-content: center;
align-items: center;
&:hover {
transform: scale(1.05);
background-color: #00000060;
}
&:active {
transform: scale(1);
}
}
}

View File

@ -98,6 +98,10 @@
:songId="playerData.id"
ref="playerRef"
/>
<div class="error" v-if="!store.musicIsOk">
<play-wrong theme="outline" size="60" />
<span>音乐播放器加载失败</span>
</div>
</div>
</Transition>
</div>
@ -115,6 +119,7 @@ import {
VolumeMute,
VolumeSmall,
VolumeNotice,
PlayWrong,
} from "@icon-park/vue-next";
import Player from "@/components/Player/index.vue";
import { mainStore } from "@/store";
@ -153,7 +158,7 @@ const changeMusicIndex = (type) => {
onMounted(() => {
//
window.addEventListener("keydown", (e) => {
if (e.code == "Space") {
if (e.code == "Space" && store.musicIsOk) {
changePlayState();
}
});
@ -183,10 +188,12 @@ watch(
flex-direction: column;
animation: fade;
-webkit-animation: fade 0.5s;
.btns {
display: flex;
align-items: center;
margin-bottom: 6px;
span {
background: #ffffff26;
padding: 2px 8px;
@ -195,17 +202,20 @@ watch(
text-overflow: ellipsis;
overflow-x: hidden;
white-space: nowrap;
&:hover {
background: #ffffff4d;
}
}
}
.control {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-evenly;
width: 100%;
.state {
.i-icon {
width: 50px;
@ -213,6 +223,7 @@ watch(
display: block;
}
}
.i-icon {
width: 36px;
height: 36px;
@ -222,14 +233,17 @@ watch(
justify-content: center;
border-radius: 6px;
transform: scale(1);
&:hover {
background: #ffffff33;
}
&:active {
transform: scale(0.95);
}
}
}
.menu {
height: 26px;
width: 100%;
@ -238,6 +252,7 @@ watch(
flex-direction: column;
align-items: center;
justify-content: center;
.name {
width: 100%;
text-align: center;
@ -246,26 +261,32 @@ watch(
white-space: nowrap;
// font-size: 1.1rem;
}
.volume {
width: 100%;
padding: 0 12px;
display: flex;
align-items: center;
flex-direction: row;
.icon {
margin-right: 12px;
span {
width: 24px;
height: 24px;
display: block;
}
}
:deep(*) {
transition: none;
}
:deep(.el-slider__button) {
transition: 0.3s;
}
.el-slider {
margin-right: 12px;
--el-slider-main-bg-color: #efefef;
@ -275,6 +296,7 @@ watch(
}
}
}
.music-list {
position: fixed;
top: 0;
@ -285,6 +307,7 @@ watch(
background-color: #00000080;
backdrop-filter: blur(20px);
z-index: 1;
.list {
position: absolute;
display: flex;
@ -297,6 +320,7 @@ watch(
background-color: #ffffff66;
border-radius: 6px;
z-index: 999;
.close {
position: absolute;
top: 12px;
@ -304,13 +328,24 @@ watch(
width: 28px;
height: 28px;
display: block;
&:hover {
transform: scale(1.2);
}
&:active {
transform: scale(0.95);
}
}
.error {
display: flex;
flex-direction: column;
align-items: center;
.i-icon {
margin-bottom: 20px;
}
}
}
}
@ -318,14 +353,17 @@ watch(
.zoom-enter-active {
animation: zoom 0.4s ease-in-out;
}
.zoom-leave-active {
animation: zoom 0.3s ease-in-out reverse;
}
@keyframes zoom {
0% {
opacity: 0;
transform: scale(0) translateY(-600px);
}
100% {
opacity: 1;
transform: scale(1) translateY(0);

View File

@ -11,39 +11,14 @@
</el-radio-group>
</div>
</el-collapse-item>
<el-collapse-item title="Feedback" name="2">
<div>
Operation feedback: enable the users to clearly perceive their
operations by style updates and interactive effects;
</div>
<div>
Visual feedback: reflect current state by updating or rearranging
elements of the page.
</div>
<el-collapse-item title="其他设置" name="2">
<div>设置内容待增加</div>
</el-collapse-item>
<el-collapse-item title="Efficiency" name="3">
<div>
Simplify the process: keep operating process simple and intuitive;
</div>
<div>
Definite and clear: enunciate your intentions clearly so that the
users can quickly understand and make decisions;
</div>
<div>
Easy to identify: the interface should be straightforward, which helps
the users to identify and frees them from memorizing and recalling.
</div>
<el-collapse-item title="其他设置" name="3">
<div>设置内容待增加</div>
</el-collapse-item>
<el-collapse-item title="Controllability" name="4">
<div>
Decision making: giving advices about operations is acceptable, but do
not make decisions for the users;
</div>
<div>
Controlled consequences: users should be granted the freedom to
operate, including canceling, aborting or terminating current
operation.
</div>
<el-collapse-item title="其他设置" name="4">
<div>设置内容待增加</div>
</el-collapse-item>
</el-collapse>
</div>
@ -55,12 +30,12 @@ import { mainStore } from "@/store";
const store = mainStore();
//
let activeName = ref('1');
let activeName = ref("1");
let bgSet = ref("0");
onMounted(() => {
bgSet.value = store.coverType.toString();
})
});
//
watch(
@ -95,24 +70,26 @@ watch(
.bg-set {
.el-radio-group {
justify-content: center;
justify-content: space-between;
.el-radio {
margin: 10px 16px;
background: #ffffff26;
border: 2px solid transparent;
border-radius: 8px;
.el-radio__label {
color: #fff;
}
.el-radio__inner {
background-color: #ffffff60 !important;
border-color: #fff !important;
background: #ffffff06 !important;
border: 2px solid #eeeeee !important;
}
&.is-checked {
background-color: #ffffff60;
border-color: #ffffff80;
background: #ffffff06 !important;
border: 2px solid #eeeeee !important;
}
.is-checked {
@ -121,18 +98,14 @@ watch(
border-color: #fff !important;
}
&+.el-radio__label {
& + .el-radio__label {
color: #fff !important;
}
}
}
}
}
}
}
}
}

View File

@ -6,10 +6,12 @@ import App from '@/App.vue';
// 引入 pinia
import {
createPinia
} from 'pinia'
} from 'pinia';
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate';
const app = createApp(App);
const pinia = createPinia();
pinia.use(piniaPluginPersistedstate);
app.use(pinia);
app.mount('#app')

View File

@ -9,6 +9,7 @@ export const mainStore = defineStore("main", {
coverType: "0", // 壁纸种类
musicIsOk: false, // 音乐是否加载完成
musicOpenState: false, // 音乐面板开启状态
backgroundShow: false, // 壁纸展示状态
boxOpenState: false, // 盒子开启状态
setOpenState: false, // 设置页面开启状态
playerState: false, // 当前播放状态
@ -58,4 +59,9 @@ export const mainStore = defineStore("main", {
this.playerArtist = artist;
}
},
persist: {
key: 'data',
storage: window.localStorage,
paths: ['coverType'],
},
})

32
src/style/global.css Normal file
View File

@ -0,0 +1,32 @@
@charset "UTF-8";
.container {
max-width: 1200px;
}
/* 小于1200px时 */
@media (max-width: 1380px) {
.el-radio-group {
justify-content: center !important;
}
}
/* 小于1200px时 */
@media (max-width: 1200px) {
.container {
max-width: 1000px;
}
.sm-hidden {
display: none;
}
}
/* 小于992px时 */
@media (max-width: 992px) {
.container {
max-width: 900px;
}
}
/* 小于720px时 */
@media (max-width: 720px) {
.xs-hidden {
display: none;
}
}/*# sourceMappingURL=global.css.map */

1
src/style/global.css.map Normal file
View File

@ -0,0 +1 @@
{"version":3,"sources":["global.css","global.scss"],"names":[],"mappings":"AAAA,gBAAgB;ACIZ;EACI,iBAFqB;ADA7B;;ACSA,cAAA;AACA;EACI;IACI,kCAAA;EDNN;AACF;ACSA,cAAA;AACA;EAhBI;IACI,iBAgB2B;EDNjC;ECSE;IACI,aAAA;EDPN;AACF;ACUA,aAAA;AACA;EA1BI;IACI,gBA0B2B;EDPjC;AACF;ACSA,aAAA;AACA;EAGI;IACI,aAAA;EDTN;AACF","file":"global.css"}

View File

@ -10,6 +10,13 @@
// 首次调用
@include changeWidth;
/* 小于1200px时 */
@media (max-width: 1380px) {
.el-radio-group {
justify-content: center !important;
}
}
/* 小于1200px时 */
@media (max-width: 1200px) {
@include changeWidth($maxWidth:1000px);

179
src/style/style.css Normal file
View File

@ -0,0 +1,179 @@
@charset "UTF-8";
/*
作者: imsyy
主页https://www.imsyy.top/
GitHubhttps://github.com/imsyy/home
版权所有请勿删除
*/
/*全局样式*/
html,
body {
width: 100%;
height: 100%;
background-color: #333;
overflow: hidden;
}
*,
a,
p {
margin: 0;
padding: 0;
-webkit-user-select: none;
-webkit-user-drag: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
text-decoration: none;
transition: 0.3s;
color: #fff;
box-sizing: border-box;
}
*:hover,
a:hover,
p:hover {
transition: 0.3s;
}
@font-face {
font-family: "Pacifico-Regular";
src: url("/font/Pacifico-Regular.ttf") format("truetype");
}
@font-face {
font-family: "UnidreamLED";
src: url("/font/UnidreamLED.ttf") format("truetype");
}
#app {
position: absolute;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
z-index: 0;
}
.cards {
border-radius: 6px;
background: rgba(0, 0, 0, 0.2509803922);
-webkit-backdrop-filter: blur(10px);
backdrop-filter: blur(10px);
transform: scale(1);
transition: 0.5s;
animation: fade;
-webkit-animation: fade 0.5s;
}
.cards:hover {
transform: scale(1.01);
transition: 0.5s;
}
.cards:active {
transform: scale(0.98);
transition: 0.5s;
}
.el-message {
--el-message-bg-color: #00000040 !important;
--el-message-text-color: #efefef !important;
-webkit-backdrop-filter: blur(10px);
backdrop-filter: blur(10px);
border-radius: 25px !important;
border-color: transparent !important;
}
.el-message .el-message__badge {
display: none;
}
.el-progress-bar .el-progress-bar__outer {
border-radius: 6px;
background-color: rgba(0, 0, 0, 0.1254901961);
}
.el-progress-bar .el-progress-bar__outer .el-progress-bar__inner {
background-color: #efefef;
border-radius: 6px;
text-align: center;
font-family: "UnidreamLED";
}
.el-progress-bar .el-progress-bar__outer .el-progress-bar__inner span {
color: #564d59;
font-size: 0.9rem;
}
.el-popper.is-dark {
background: rgba(255, 255, 255, 0.3764705882) !important;
border: 1px solid transparent !important;
}
.el-card {
border-radius: 8px !important;
border: 1px solid transparent !important;
background-color: transparent !important;
}
.el-card .el-card__header {
font-weight: bold;
padding: 16px 20px !important;
background-color: rgba(255, 255, 255, 0.1882352941) !important;
border-bottom: 1px solid transparent !important;
}
.el-card .el-card__body {
padding: 0 !important;
background-color: rgba(255, 255, 255, 0.062745098) !important;
}
.fade-enter-active {
-webkit-animation: fade 0.3s ease-in-out;
animation: fade 0.3s ease-in-out;
}
.fade-leave-active {
animation: fade 0.3s ease-in-out reverse;
}
@-webkit-keyframes fade {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
@keyframes fade {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
#cursor {
position: fixed;
width: 18px;
height: 18px;
background: #fff;
border-radius: 25px;
opacity: 0.25;
z-index: 10086;
pointer-events: none;
transition: 0.2s ease-in-out;
transition-property: background, opacity, transform;
}
#cursor.hidden {
opacity: 0;
}
#cursor.active {
opacity: 0.5;
transform: scale(0.5);
}
::-webkit-scrollbar {
width: 6px;
height: 6px;
background-color: transparent;
}
::-webkit-scrollbar-thumb {
border-radius: 10px;
background-color: #eeeeee;
}/*# sourceMappingURL=style.css.map */

1
src/style/style.css.map Normal file
View File

@ -0,0 +1 @@
{"version":3,"sources":["style.css","style.scss"],"names":[],"mappings":"AAAA,gBAAgB;ACAhB;;;;;CAAA;AASA,OAAA;AAEA;;EAEI,WAAA;EACA,YAAA;EACA,sBAAA;EACA,gBAAA;ADFJ;;ACKA;;;EAGI,SAAA;EACA,UAAA;EACA,yBAAA;EACA,uBAAA;EACA,sBAAA;GAAA,qBAAA;OAAA,iBAAA;EACA,qBAAA;EACA,gBAAA;EACA,WAAA;EACA,sBAAA;ADFJ;ACII;;;EACI,gBAAA;ADAR;;ACOA;EACI,+BAAA;EACA,yDAAA;ADJJ;ACOA;EACI,0BAAA;EACA,oDAAA;ADLJ;ACUA;EACI,kBAAA;EACA,MAAA;EACA,OAAA;EACA,YAAA;EACA,aAAA;EACA,UAAA;ADRJ;;ACYA;EACI,kBAAA;EACA,uCAAA;EACA,mCAAA;EACA,2BAAA;EACA,mBAAA;EACA,gBAAA;EACA,eAAA;EACA,4BAAA;ADTJ;;ACYA;EACI,sBAAA;EACA,gBAAA;ADTJ;;ACYA;EACI,sBAAA;EACA,gBAAA;ADTJ;;ACaA;EACI,2CAAA;EACA,2CAAA;EACA,mCAAA;EACA,2BAAA;EACA,8BAAA;EACA,oCAAA;ADVJ;ACYI;EACI,aAAA;ADVR;;ACgBI;EACI,kBAAA;EACA,6CAAA;ADbR;ACeQ;EACI,yBAAA;EACA,kBAAA;EACA,kBAAA;EACA,0BAAA;ADbZ;ACeY;EACI,cAAA;EACA,iBAAA;ADbhB;;ACsBA;EACI,wDAAA;EACA,wCAAA;ADnBJ;;ACuBA;EACI,6BAAA;EACA,wCAAA;EACA,wCAAA;ADpBJ;ACsBI;EACI,iBAAA;EACA,6BAAA;EACA,8DAAA;EACA,+CAAA;ADpBR;ACuBI;EACI,qBAAA;EACA,6DAAA;ADrBR;;AC0BA;EACI,wCAAA;UAAA,gCAAA;ADvBJ;;AC0BA;EACI,wCAAA;ADvBJ;;AC0BA;EACI;IACI,UAAA;EDvBN;EC0BE;IACI,UAAA;EDxBN;AACF;;ACiBA;EACI;IACI,UAAA;EDvBN;EC0BE;IACI,UAAA;EDxBN;AACF;AC4BA;EACI,eAAA;EACA,WAAA;EACA,YAAA;EACA,gBAAA;EACA,mBAAA;EACA,aAAA;EACA,cAAA;EACA,oBAAA;EACA,4BAAA;EACA,mDAAA;AD1BJ;AC4BI;EACI,UAAA;AD1BR;AC6BI;EACI,YAAA;EACA,qBAAA;AD3BR;;ACiCA;EACI,UAAA;EACA,WAAA;EACA,6BAAA;AD9BJ;;ACiCA;EACI,mBAAA;EACA,yBAAA;AD9BJ","file":"style.css"}

View File

@ -4,7 +4,7 @@
<close-one class="close" theme="filled" size="28" fill="#ffffff60" v-show="closeShow"
@click="store.setOpenState = false" />
</transition>
<el-row :gutter="20">
<el-row :gutter="40">
<el-col :span="12" class="left">
<div class="logo">
<span class="bg">{{ siteUrl[0] }}</span>
@ -105,7 +105,7 @@ const jumpTo = () => {
.left {
height: 100%;
margin-left: 20px;
padding-left: 40px !important;
padding-bottom: 20px;
display: flex;
flex-direction: column;
@ -166,6 +166,10 @@ const jumpTo = () => {
align-items: center;
padding-bottom: 16px;
&:nth-last-of-type(1) {
padding: 0;
}
.i-icon {
width: 22px;
height: 22px;
@ -180,6 +184,9 @@ const jumpTo = () => {
.right {
height: 100%;
padding-right: 40px !important;
display: flex;
flex-direction: column;
justify-content: center;
.title {
display: flex;

View File

@ -1134,6 +1134,11 @@ picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.2, picomatch@^2.3.1:
resolved "https://registry.npmmirror.com/picomatch/-/picomatch-2.3.1.tgz"
integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==
pinia-plugin-persistedstate@^3.0.0:
version "3.0.0"
resolved "https://registry.npmmirror.com/pinia-plugin-persistedstate/-/pinia-plugin-persistedstate-3.0.0.tgz#a7c97a84938c004499762e186149cff1c668400c"
integrity sha512-q62E691P9X0LRCj6QW44w0+HcXPQSteBiTHkQmXJcqcY6OD1mne0X0im3ghqjXDyo1hSq6pKRdnBIKEc988r/g==
pinia@^2.0.23:
version "2.0.23"
resolved "https://registry.npmmirror.com/pinia/-/pinia-2.0.23.tgz"