{
transform: translateY(-140px);
color: var(--main-text-color);
animation: fade-time-in 0.6s cubic-bezier(0.21, 0.78, 0.36, 1);
- transition: transform 0.3s;
+ transition: transform 0.3s, opacity 0.5s;
z-index: 1;
&.focus {
transform: translateY(-180px);
@@ -128,6 +140,10 @@ onBeforeUnmount(() => {
&.set {
transform: translateY(-220px);
}
+ &.hidden {
+ transform: translateY(-180px);
+ opacity: 0;
+ }
.time {
cursor: pointer;
font-size: 3rem;
diff --git a/src/stores/setData.js b/src/stores/setData.js
index 77c15ee..6ba798b 100644
--- a/src/stores/setData.js
+++ b/src/stores/setData.js
@@ -6,6 +6,7 @@ const useSetDataStore = defineStore("setData", {
// 壁纸类别
// 0 本地 / 1 必应 / 2 随机风景 / 3 随机动漫 / 4 自定义
backgroundType: 2,
+ backgroundCustom: "",
// 壁纸遮罩
showBackgroundGray: true,
// 搜索引擎
@@ -36,6 +37,23 @@ const useSetDataStore = defineStore("setData", {
// 设置新引擎
this.searchEngine = value;
},
+ // 恢复数据
+ recoverSiteData(data) {
+ let isSuccess = false;
+ try {
+ for (const key in data) {
+ if (Object.hasOwnProperty.call(data, key)) {
+ const item = data[key];
+ this[key] = item;
+ }
+ }
+ isSuccess = true;
+ } catch (error) {
+ console.error("站点数据恢复时处理失败:", error);
+ isSuccess = false;
+ }
+ return isSuccess;
+ },
},
// 开启数据持久化
persist: {
diff --git a/src/stores/statusData.js b/src/stores/statusData.js
index e781fad..89a3e55 100644
--- a/src/stores/statusData.js
+++ b/src/stores/statusData.js
@@ -12,6 +12,8 @@ const useStatusDataStore = defineStore("statusData", {
engineChangeStatus: false,
// 搜索框文本
searchInputValue: "",
+ // 盒子大小
+ mainBoxBig: false,
};
},
getters: {},
@@ -19,9 +21,10 @@ const useStatusDataStore = defineStore("statusData", {
setImgLoadStatus(value) {
this.imgLoadStatus = value;
},
- setSiteStatus(value) {
+ setSiteStatus(value, alsoChange = true) {
this.siteStatus = value;
this.searchInputValue = "";
+ if (alsoChange) this.engineChangeStatus = false;
},
setEngineChangeStatus(value) {
this.engineChangeStatus = value;
@@ -29,6 +32,15 @@ const useStatusDataStore = defineStore("statusData", {
setSearchInputValue(value) {
this.searchInputValue = value;
},
+ setMainBoxBig(value) {
+ this.mainBoxBig = value;
+ },
+ },
+ // 开启数据持久化
+ persist: {
+ key: "statusData",
+ storage: window.localStorage,
+ paths: ["mainBoxBig"],
},
});