commit 7cd555fdae93a099c141d3c8d7f46b89f8f0a085 Author: 底层用户 Date: Mon Mar 21 16:42:56 2022 +0800 first commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..600d2d3 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.vscode \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..ddd82dc --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 imsyy + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..7df8434 --- /dev/null +++ b/README.md @@ -0,0 +1,44 @@ +

+

Snavigation

+一个简约的起始页 +

+ +![Snavigation](https://img.imsyy.top/other/Snavigation.png) + +>尚未完成 + +### Demo +>由于 CDN 缓存原因,查看最新效果可能需要 `Ctrl` + `F5` 强制刷新浏览器缓存 + +- [Snavigation](https://nav.imsyy.top) + +### 功能 + +- [x] 载入动画 +- [x] 搜索引擎切换 +- [x] 时间及天气显示 +- [x] 快捷方式自定义 +- [x] 网站背景自定义 +- [x] 数据备份及恢复 +- [x] 移动端适配 +* [ ] 还没想好呢 + +### 插件 + +* [iziToast](https://izitoast.marcelodolza.com/) +* [Iconfont](https://www.iconfont.cn/) +* [jQuery](https://jquery.com/) + +### API + +* [小歪 API](https://api.ixiaowai.cn/) +* [天气 API](https://www.tianqiapi.com/) + +### 鸣谢 + +本站部分内容参考自 + +* [青柠起始页](https://limestart.cn/) +* [sou2](https://github.com/yeetime/sou2/) + +   diff --git a/css/animation.css b/css/animation.css new file mode 100644 index 0000000..f0365a1 --- /dev/null +++ b/css/animation.css @@ -0,0 +1,202 @@ +/*渐入动画*/ +@keyframes fade { + 0% { + opacity: 0; + } + + 100% { + opacity: 1; + } +} + +@-webkit-keyframes fade { + 0% { + opacity: 0; + } + + 100% { + opacity: 1; + } +} + +@-moz-keyframes fade { + 0% { + opacity: 0; + } + + 100% { + opacity: 1; + } +} + +@-o-keyframes fade { + 0% { + opacity: 0; + } + + 100% { + opacity: 1; + } +} + +/*文字闪烁*/ +@-webkit-keyframes fadenum { + + 0% { + opacity: 1; + } + + 50% { + opacity: 0; + } + + 100% { + opacity: 1; + } + +} + +@-moz-keyframes fadenum { + + 0% { + opacity: 1; + } + + 50% { + opacity: 0; + } + + 100% { + opacity: 1; + } + +} + +@-o-keyframes fadenum { + + 0% { + opacity: 1; + } + + 50% { + opacity: 0; + } + + 100% { + opacity: 1; + } + +} + +@keyframes fadenum { + + 0% { + opacity: 1; + } + + 50% { + opacity: 0; + } + + 100% { + opacity: 1; + } + +} + +/*下沉动画*/ +@-moz-keyframes down { + 0% { + opacity: 0; + top: 44%; + /* -webkit-transform: translateY(-25%); + -moz-transform: translateY(-25%); + -o-transform: translateY(-25%); + -ms-transform: translateY(-25%); + transform: translateY(-25%) */ + } + + 100% { + opacity: 1; + -ms-filter: none; + filter: none; + top: 46%; + /* -webkit-transform: translateY(-20%); + -moz-transform: translateY(-20%); + -o-transform: translateY(-20%); + -ms-transform: translateY(-20%); + transform: translateY(-20%) */ + } +} + +@-webkit-keyframes down { + 0% { + opacity: 0; + top: 44%; + /* -webkit-transform: translateY(-25%); + -moz-transform: translateY(-25%); + -o-transform: translateY(-25%); + -ms-transform: translateY(-25%); + transform: translateY(-25%) */ + } + + 100% { + opacity: 1; + -ms-filter: none; + filter: none; + top: 46%; + /* -webkit-transform: translateY(-20%); + -moz-transform: translateY(-20%); + -o-transform: translateY(-20%); + -ms-transform: translateY(-20%); + transform: translateY(-20%) */ + } +} + +@-o-keyframes down { + 0% { + opacity: 0; + top: 44%; + /* -webkit-transform: translateY(-25%); + -moz-transform: translateY(-25%); + -o-transform: translateY(-25%); + -ms-transform: translateY(-25%); + transform: translateY(-25%) */ + } + + 100% { + opacity: 1; + -ms-filter: none; + filter: none; + top: 46%; + /* -webkit-transform: translateY(-20%); + -moz-transform: translateY(-20%); + -o-transform: translateY(-20%); + -ms-transform: translateY(-20%); + transform: translateY(-20%) */ + } +} + +@keyframes down { + 0% { + opacity: 0; + top: 44%; + /* -webkit-transform: translateY(-25%); + -moz-transform: translateY(-25%); + -o-transform: translateY(-25%); + -ms-transform: translateY(-25%); + transform: translateY(-25%) */ + } + + 100% { + opacity: 1; + -ms-filter: none; + filter: none; + top: 46%; + /* -webkit-transform: translateY(-20%); + -moz-transform: translateY(-20%); + -o-transform: translateY(-20%); + -ms-transform: translateY(-20%); + transform: translateY(-20%) */ + } +} \ No newline at end of file diff --git a/css/firefox.css b/css/firefox.css new file mode 100644 index 0000000..e69de29 diff --git a/css/font.css b/css/font.css new file mode 100644 index 0000000..9566397 --- /dev/null +++ b/css/font.css @@ -0,0 +1,92 @@ +@font-face { + font-family: "MiSans"; + src: url('../font/MiSans-Regular.woff') format('woff'); +} + +@font-face { + font-family: "iconfont"; + /* Project id 3222465 */ + src: url('//at.alicdn.com/t/font_3222465_kuwc8yy7j9g.woff2?t=1647790391080') format('woff2'), + url('//at.alicdn.com/t/font_3222465_kuwc8yy7j9g.woff?t=1647790391080') format('woff'), + url('//at.alicdn.com/t/font_3222465_kuwc8yy7j9g.ttf?t=1647790391080') format('truetype'); +} + +.iconfont { + font-family: "iconfont" !important; + font-size: 16px; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.icon-tianjia-:before { + content: "\e643"; +} + +.icon-taobao:before { + content: "\e755"; +} + +.icon-jingdong:before { + content: "\e618"; +} + +.icon-xinlangweibo:before { + content: "\e601"; +} + +.icon-zhihu:before { + content: "\e60a"; +} + +.icon-github:before { + content: "\e691"; +} + +.icon-delete:before { + content: "\e94d"; +} + +.icon-home:before { + content: "\e964"; +} + +.icon-xiugai:before { + content: "\e626"; +} + +.icon-bilibilidonghua:before { + content: "\e8b1"; +} + +.icon-wangluo:before { + content: "\e600"; +} + +.icon-sougousousuo:before { + content: "\e685"; +} + +.icon-360sousuo:before { + content: "\e64d"; +} + +.icon-baidu:before { + content: "\eb49"; +} + +.icon-bing:before { + content: "\eb4c"; +} + +.icon-google:before { + content: "\ebaa"; +} + +.icon-shezhi:before { + content: "\e634"; +} + +.icon-sousuo:before { + content: "\e635"; +} \ No newline at end of file diff --git a/css/loading.css b/css/loading.css new file mode 100644 index 0000000..32683d3 --- /dev/null +++ b/css/loading.css @@ -0,0 +1,127 @@ +@charset "utf-8"; + +#loading-box .loading-left-bg, +#loading-box .loading-right-bg { + position: fixed; + z-index: 999998; + width: 50%; + height: 100%; + background-color: rgb(81 81 81 / 80%); + transition: all 0.7s cubic-bezier(0.42, 0, 0, 1.01); + backdrop-filter: blur(10px); +} + +#loading-box .loading-right-bg { + right: 0; +} + +#loading-box>.spinner-box { + position: fixed; + z-index: 999999; + display: flex; + justify-content: center; + align-items: center; + width: 100%; + height: 100vh; +} + +#loading-box .spinner-box .loading-word { + position: absolute; + color: #ffffff; + font-size: 0.95rem; + transform: translateY(64px); + text-align: center; +} + +p.loading-title { + font-size: 1.25rem; + margin: 20px 10px 4px 10px; +} + +#loading-box .spinner-box .configure-core { + width: 100%; + height: 100%; + background-color: #37474f; +} + +div.loaded div.loading-left-bg { + transform: translate(-100%, 0); +} + +div.loaded div.loading-right-bg { + transform: translate(100%, 0); +} + +div.loaded div.spinner-box { + display: none !important; +} + +.loader { + position: absolute; + top: calc(50% - 32px); + left: calc(50% - 32px); + width: 64px; + height: 64px; + border-radius: 50%; + perspective: 800px; + transition: all 0.7s cubic-bezier(0.42, 0, 0, 1.01); +} + +.inner { + position: absolute; + box-sizing: border-box; + width: 100%; + height: 100%; + border-radius: 50%; +} + +.inner.one { + left: 0%; + top: 0%; + animation: rotate-one 1s linear infinite; + border-bottom: 3px solid #EFEFFA; +} + +.inner.two { + right: 0%; + top: 0%; + animation: rotate-two 1s linear infinite; + border-right: 3px solid #EFEFFA; +} + +.inner.three { + right: 0%; + bottom: 0%; + animation: rotate-three 1s linear infinite; + border-top: 3px solid #EFEFFA; +} + +@keyframes rotate-one { + 0% { + transform: rotateX(35deg) rotateY(-45deg) rotateZ(0deg); + } + + 100% { + transform: rotateX(35deg) rotateY(-45deg) rotateZ(360deg); + } +} + +@keyframes rotate-two { + 0% { + transform: rotateX(50deg) rotateY(10deg) rotateZ(0deg); + } + + 100% { + transform: rotateX(50deg) rotateY(10deg) rotateZ(360deg); + } +} + +@keyframes rotate-three { + 0% { + transform: rotateX(35deg) rotateY(55deg) rotateZ(0deg); + } + + 100% { + transform: rotateX(35deg) rotateY(55deg) rotateZ(360deg); + } +} \ No newline at end of file diff --git a/css/mobile.css b/css/mobile.css new file mode 100644 index 0000000..53e38a3 --- /dev/null +++ b/css/mobile.css @@ -0,0 +1,94 @@ +@charset "utf-8"; + +/*小于1200px时*/ +@media (max-width: 1200px) { + + /*书签及设置高度*/ + .mark, + .set { + margin-top: 180px; + } +} + +/*小于720px时*/ +@media (max-width: 720px) { + + /*书签*/ + .quick, + .quicks { + width: 23%; + min-width: 23%; + max-width: 23%; + } +} + +/*小于512px时*/ +@media (max-width: 512px) { + + /*文字大小*/ + #time_text { + font-size: 2.75rem; + } + + #day { + font-size: 1.05rem; + } + + .weather { + font-size: 1rem; + } + + .wd::-webkit-input-placeholder { + letter-spacing: 1px; + font-size: 0.95rem; + } + + /*搜索引擎*/ + .se-li { + width: 31.33%; + min-width: 31.33%; + max-width: 31.33%; + } + + /*设置按钮*/ + #menu i { + font-size: 1.45rem; + } + + /*书签*/ + .quick, + .quicks { + width: 31.33%; + min-width: 31.33%; + max-width: 31.33%; + } + + /*壁纸设置*/ + #wallpaper { + flex-wrap: wrap; + } + + #wallpaper_text { + margin-top: 0px; + } + + .form-radio { + margin: 0px 10px 30px 0px; + } + + /*隐藏*/ + .mobile { + display: none; + } +} + +/* 大于568px时 */ +@media (min-width: 568px) { + .iziToast { + border-radius: 30px !important; + } + + .iziToast-wrapper { + padding: 10px 0px !important; + } +} \ No newline at end of file diff --git a/css/style.css b/css/style.css new file mode 100644 index 0000000..2d38909 --- /dev/null +++ b/css/style.css @@ -0,0 +1,1010 @@ +@charset "utf-8"; + +:root { + --body-background-color: #333333; + --main-text-color: #efefef; + --main-text-form-color: #333333; + --main-text-form-hover-color: #efefef; + /* --main-background-color: #ffffff40; + --main-background-hover-color: #ffffff60; + --main-background-active-color: #ffffff80; */ + --main-background-color: #00000040; + --main-background-hover-color: #acacac60; + --main-background-active-color: #8a8a8a80; + --main-button-color: #ffffff40; + --main-button-hover-color: #00000030; + --main-button-active-color: #00000020; + --main-input-color: #ffffff30; + --main-input-text-placeholder-color: #ffffff70; + --main-text-shadow: 0px 0px 8px #00000066; + --main-search-shadow: 0 0 20px #0000000d; + --main-search-hover-shadow: 0 0 20px #00000033; + --border-bottom-color-hover: #efefef80; + --border-bottom-color-active: #efefef; +} + +html, +body { + width: 100%; + height: 100%; + margin: 0; + background-color: var(--body-background-color); + -webkit-tap-highlight-color: transparent; + -webkit-user-select: none; + user-select: none; +} + +*, +a, +p { + text-decoration: none; + transition: 0.3s; + color: var(--main-text-color); + user-select: none; + font-family: 'MiSans', sans-serif; +} + +section { + display: block; + position: fixed; + width: 100%; + height: 100%; + min-height: 600px; + opacity: 0; + transition: ease 1.5s; +} + +.noclickn { + pointer-events: none; +} + +/*背景*/ +.bg-all { + z-index: 0; + position: absolute; + top: calc(0px + 0px); + left: 0; + width: 100%; + height: calc(100% - 0px); + transition: .25s; +} + +#bg { + transform: scale(1.10); + filter: blur(10px); + position: fixed; + left: 0; + top: 0; + width: 100%; + height: 100%; + object-fit: cover; + transition: opacity 1s, transform .25s, filter .25s; + backface-visibility: hidden; +} + +img.error { + display: none; +} + +.cover { + opacity: 0; + position: fixed; + left: 0; + top: 0; + width: 100%; + height: 100%; + background-image: radial-gradient(rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, .5) 100%), radial-gradient(rgba(0, 0, 0, 0) 33%, rgba(0, 0, 0, .3) 166%); + transition: .25s; +} + +/*总布局*/ +#content { + width: 100%; + height: 100%; + display: flex; + align-items: center; + justify-content: center; +} + +.con { + width: 100%; + display: flex; + justify-content: center; + flex-direction: column; + align-items: center; +} + +.sou { + max-width: 680px; + width: calc(100% - 60px); + animation: fade; + -webkit-animation: fade 0.5s; + -moz-animation: fade 0.5s; + -o-animation: fade 0.5s; + -ms-animation: fade 0.5s; + /* transform: translateY(-150%); */ +} + +/* .box .sou { + display: none; +} */ + +.box .all-search { + opacity: 0; + transition: 0.3s; +} + + +/*时间*/ +.tool-all { + position: absolute; + display: flex; + flex-direction: column; + align-items: center; + transform: translateY(-120%); +} + +.time { + color: var(--main-text-color); + display: flex; + flex-direction: column; + align-items: center; +} + +#point { + margin: 0px 4px; + animation: fadenum 2s infinite; + -webkit-animation: fadenum 2s infinite; + -moz-animation: fadenum 2s infinite; + -o-animation: fadenum 2s linear infinite; + -ms-animation: fadenum 2s linear infinite; +} + +#time_text { + font-size: 3rem; + margin: 6px 0px; + text-shadow: var(--main-text-shadow); + transition: 0.2s; +} + +#time_text:hover { + cursor: pointer; + transition: 0.2s; + transform: scale(1.08); +} + +#time_text:active { + transition: 0.2s; + opacity: 0.6; + transform: scale(1.02); +} + +#day { + font-size: 1.15rem; + opacity: 0.8; + margin: 4px 0px; + text-shadow: var(--main-text-shadow); +} + +/*天气*/ +.weather { + color: #efefef; + opacity: 0.8; + font-size: 1.10rem; + text-shadow: var(--main-text-shadow); +} + +/*搜索框*/ +.search, +.wd, +.s { + padding: 0; + margin: 0; + border: none; + outline: none; + background: none; + display: flex; + justify-content: center; + animation: fade; + -webkit-animation: fade 0.5s; + -moz-animation: fade 0.5s; + -o-animation: fade 0.5s; + -ms-animation: fade 0.5s; +} + +.wd::-webkit-input-placeholder { + letter-spacing: 2px; + font-size: 1.05rem; +} + +.all-search { + display: flex; + align-items: center; + width: 100%; + height: 43px; + border-radius: 30px; + color: var(--main-text-color); + background-color: var(--main-background-color); + box-shadow: var(--main-search-shadow); + -webkit-backdrop-filter: blur(10px); + backdrop-filter: blur(10px); + overflow: hidden; + transition: 0.5s ease; +} + +.all-search:hover { + box-shadow: var(--main-search-hover-shadow); +} + +.con .sou form .wd { + width: 100%; + height: 100%; + line-height: 100%; + text-indent: 4px; + font-size: 1.25rem; + color: var(--main-text-form-color); + /* background-color: transparent; */ +} + +.sou form .se, +.sou form .s { + width: 40px; + height: 40px; + padding: 10px; + cursor: pointer; +} + +.sou form .se { + display: flex; + align-items: center; + justify-content: center; +} + +#icon-se, +#icon-sou { + font-size: 1.25rem; + color: #efefef; +} + +.sou form .se { + transition: 0.3s; + border-radius: 0px 30px 30px 0px; +} + +.sou form .se:hover { + transition: 0.3s; + background: var(--main-background-color); + border-radius: 0px 30px 30px 0px; +} + +.sou-button { + padding: 10px; + transition: 0.3s; + border-radius: 30px 0px 0px 30px; +} + +.sou-button:hover { + transition: 0.3s; + background: var(--main-background-color); + border-radius: 30px 0px 0px 30px; +} + +.all-search input::-webkit-input-placeholder { + color: var(--main-text-color); + text-align: center; +} + +.all-search input::-moz-placeholder { + color: var(--main-text-color); + text-align: center; +} + +.all-search input:-ms-input-placeholder { + color: var(--main-text-color); + text-align: center; +} + +/*切换搜索引擎*/ +.search-engine { + position: absolute; + margin-top: 10px; + margin-left: 5px; + padding: 10px; + color: var(--main-text-color); + background-color: var(--main-background-color); + box-shadow: var(--main-search-shadow); + -webkit-backdrop-filter: blur(10px); + backdrop-filter: blur(10px); + border-radius: 8px; + display: none; + z-index: 999; + animation: fade; + -webkit-animation: fade 0.5s; + -moz-animation: fade 0.5s; + -o-animation: fade 0.5s; + -ms-animation: fade 0.5s; +} + +.search-engine-list { + display: flex; + justify-content: flex-start; + width: 100%; + flex-wrap: wrap; + height: 152px; + overflow-y: auto; + overflow-x: hidden; +} + +.se-li { + flex: 1; + width: 23%; + min-width: 23%; + max-width: 23%; + width: 100%; + padding: 8px 0px; + margin: 1%; + border-radius: 8px; + transition: 0.3s; + background: var(--main-background-color); +} + +.se-li:hover { + cursor: pointer; + transition: 0.3s; + border-radius: 8px; + background-color: var(--main-background-hover-color); +} + +.se-li-text { + display: flex; + width: 100%; + height: 100%; + align-items: center; + justify-content: center; +} + +.se-li-text span { + margin-left: 10px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + +} + +/*搜索建议*/ +#keywords { + position: absolute; + width: 100%; + top: 46%; + font-size: small; + color: var(--main-text-color); + background-color: var(--main-background-color); + box-shadow: var(--main-search-shadow); + border-radius: 8px; + display: none; + z-index: 999; + -webkit-backdrop-filter: blur(10px); + backdrop-filter: blur(10px); + animation: down; + -webkit-animation: down 0.5s; + -moz-animation: down 0.5s; + -o-animation: down 0.5s; + -ms-animation: down 0.5s; +} + +.keyword { + padding: 6px 12px; + border-radius: 8px; + transition: 0.3s; + animation: fade; + -webkit-animation: fade 0.5s; + -moz-animation: fade 0.5s; + -o-animation: fade 0.5s; + -ms-animation: fade 0.5s; +} + +.keyword i { + margin-right: 6px; + font-size: small; +} + +.keyword:hover { + cursor: pointer; + /* font-weight: bold; */ + transition: 0.3s; + text-indent: 10px; + border-radius: 8px; + background-color: var(--main-background-hover-color); + border-radius: 8px; +} + +/*书签及设置*/ +.mark, +.set { + flex-direction: column; + align-items: center; + background: var(--main-background-color); + border-radius: 8px; + height: 400px; + max-height: 400px; + width: 80%; + max-width: 900px; + max-width: 900px; + position: absolute; + margin-top: 200px; + z-index: 2000; + animation: fade; + -webkit-animation: fade 0.75s; + -moz-animation: fade 0.75s; + -o-animation: fade 0.75s; + -ms-animation: fade 0.75s; +} + +.mark .tab, +.set .tabs { + height: 40px; + min-height: 40px; + width: 100%; + display: flex; + justify-content: space-around; + align-items: center; + margin-bottom: 20px; +} + +.set .tabs { + margin-bottom: 0px !important; +} + +.mark .tab .tab-item, +.set .tabs .tab-items { + width: 100%; + height: 100%; + display: flex; + justify-content: center; + align-items: center; + font-size: 0.95rem; + transition: 0.3s; + border-bottom: 2px solid transparent; + border-top: 2px solid transparent; +} + +.mark .tab .tab-item:hover, +.set .tabs .tab-items:hover { + transition: 0.3s; + cursor: pointer; + border-bottom-color: var(--border-bottom-color-hover); +} + +.mark .tab .tab-item.active, +.set .tabs .tab-items.actives { + border-bottom-color: var(--border-bottom-color-active); +} + +.products, +.productss { + width: 100%; + height: 100%; +} + +.products .mainCont, +.productss .mainConts { + display: none; + width: 100%; + /* overflow: auto; */ + flex-wrap: wrap; + animation: fade; + -webkit-animation: fade 0.5s; + -moz-animation: fade 0.5s; + -o-animation: fade 0.5s; + -ms-animation: fade 0.5s; +} + +.products .mainCont.selected, +.productss .mainConts.selected { + display: flex; +} + +/*快捷方式*/ +.quick-all, +.quick-alls { + display: flex; + flex-wrap: wrap; + justify-content: flex-start; + align-content: flex-start; + width: 100%; + margin: 0px 20px 20px 20px; + height: 316px; + overflow: auto; +} + +.quick, +.quicks { + flex: 1; + height: 48px; + background: var(--main-background-color); + cursor: pointer; + border-radius: 8px; + width: 18%; + min-width: 18%; + max-width: 18%; + margin: 0% 1% 2% 1%; + transition: 0.3s; +} + +.quick:hover, +.quicks:hover { + transition: 0.3s; + background: var(--main-background-hover-color); +} + +.quick:active, +.quicks:active { + transform: scale(0.95); + transition: 0.3s; + background: var(--main-background-active-color); +} + +.quick a, +.quicks a { + width: 100%; + height: 100%; + display: flex; + justify-content: center; + align-items: center; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +/*设置区域统一样式*/ +#menu { + width: 44px; + height: 44px; + position: absolute; + right: 8px; + top: 8px; + z-index: 2000000; + cursor: pointer; + transition: 0.5s; + border-radius: 8px; + transition: 0.3s; + animation: fade; + -webkit-animation: fade 1s; + -moz-animation: fade 1s; + -o-animation: fade 1s; + -ms-animation: fade 1s; +} + +#menu:hover { + cursor: pointer; + transition: 0.3s; + background: var(--main-background-color); + border-radius: 8px; +} + +#menu:active { + cursor: pointer; + transform: scale(0.90); +} + +#menu i { + display: flex; + justify-content: center; + align-items: center; + height: 100%; + font-size: 1.75rem; + transition: 0.3s; +} + +.set_blocks { + width: 100%; + height: 340px; + display: flex; + flex-direction: column; + justify-content: space-between; +} + +.set_blocks_content { + display: flex; + margin: 20px 20px 0px 20px; + height: 430px; + flex-direction: column; + justify-content: space-between; +} + +.set_blocks_content .se_add_preinstall, +.set_blocks_content .se_add_preinstalls, +.from_items.button { + display: flex; + justify-content: center; +} + +.set_se_list_add, +.set_se_list_preinstall, +.se_add_save, +.se_add_cancel, +.set_quick_list_add, +.set_quick_list_preinstall, +.quick_add_cancel, +.quick_add_save, +.wallpaper_save { + width: 25%; + display: flex; + height: 40px; + border-radius: 8px; + background: var(--main-background-color); + margin: 0 20px; + justify-content: center; + align-items: center; + transition: 0.3s; +} + +.set_se_list_add:hover, +.set_se_list_preinstall:hover, +.se_add_save:hover, +.se_add_cancel:hover, +.set_quick_list_add:hover, +.set_quick_list_preinstall:hover, +.quick_add_cancel:hover, +.quick_add_save:hover, +.wallpaper_save:hover { + cursor: pointer; + background: var(--main-background-hover-color); + transition: 0.3s; +} + +.set_se_list_add:active, +.set_se_list_preinstall:active, +.se_add_save:active, +.se_add_cancel:active, +.set_quick_list_add:active, +.set_quick_list_preinstall:active, +.quick_add_cancel:active, +.quick_add_save:active, +.wallpaper_save:active { + transform: scale(0.90); + background: var(--main-background-active-color); + transition: 0.3s; +} + +.set_blocks_content button { + width: 40px; + height: 100%; + background: var(--main-button-color); + border: 1px solid transparent; + transition: 0.3s; +} + +.set_blocks_content button:hover { + cursor: pointer; + background: var(--main-button-hover-color); +} + +.set_blocks_content button:active { + transform: scale(0.95); + background: var(--main-button-active-color); +} + +.se_list, +.se_add_preinstall, +.se_add_preinstalls, +.quick_list, +.add_content { + animation: fade; + -webkit-animation: fade 0.5s; + -moz-animation: fade 0.5s; + -o-animation: fade 0.5s; + -ms-animation: fade 0.5s; +} + +/*表单内容*/ +.add_content { + display: flex; + flex-direction: column; + height: 320px; + justify-content: space-between; + overflow-y: auto; + overflow-x: hidden; +} + +.froms { + height: 100%; + display: flex; + flex-direction: column; + justify-content: space-evenly; +} + +.froms .from_items { + display: flex; + flex-direction: row; + align-items: center; + width: 100%; +} + +.from_text { + width: 60px; + display: flex; + justify-content: center; + margin-right: 10px; +} + +.add_content input, +#wallpaper_url input { + font-size: 1.05rem; + outline: none; + height: 40px; + width: 100%; + border-radius: 8px; + padding: 0px 10px; + border: none; + background: var(--main-input-color); +} + +.add_content input:hover, +.add_content input:active, +#wallpaper_url input:hover, +#wallpaper_url input:active { + box-shadow: var(--main-search-hover-shadow); +} + +.add_content input::-webkit-input-placeholder, +#wallpaper_url input::-webkit-input-placeholder { + color: var(--main-input-text-placeholder-color); +} + +input::-webkit-outer-spin-button, +input::-webkit-inner-spin-button { + -webkit-appearance: none; +} + +input[type="number"] { + -moz-appearance: textfield; +} + +/*快捷方式和搜索引擎设置*/ +.quick_list, +.se_list { + height: 260px; + overflow-y: auto; +} + +.quick_list_table, +.se_list_table { + display: flex; + flex-direction: column; + margin: 0px 10px; +} + +.quick_list_div, +.se_list_div { + height: 40px; + display: flex; + flex-direction: row; + align-items: center; + justify-content: space-between; + margin-bottom: 14px; + background: var(--main-background-color); + border-radius: 8px; + transition: 0.3s; +} + +.quick_list_div:hover, +.se_list_div:hover { + background: var(--main-background-hover-color); + transition: 0.3s; +} + +.quick_list_div_num, +.se_list_num { + height: 40px; + width: 40px; + min-width: 40px; + display: flex; + justify-content: center; + align-items: center; + background: var(--main-background-color); + border-radius: 8px; +} + +.quick_list_div_name, +.se_list_name { + width: 100%; + margin-left: 10px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.quick_list_div_button, +.se_list_button { + height: 40px; + border-radius: 8px; + display: flex; + align-items: center; + justify-content: center; +} + +/*背景图片*/ +#wallpaper { + display: flex; + flex-direction: row; +} + +#wallpaper_url { + margin: 10px 0px; + animation: fade; + -webkit-animation: fade 0.5s; + -moz-animation: fade 0.5s; + -o-animation: fade 0.5s; + -ms-animation: fade 0.5s; +} + +#wallpaper_text { + font-weight: bold; + margin-top: 6px; +} + +.form-radio { + margin: 0px 10px 10px 0px; +} + +input[type="radio"]+label { + cursor: pointer; + padding: 6px 10px; + background: var(--main-background-color); + border-radius: 8px; + transition: 0.3s; + border: 2px solid transparent; +} + +input[type="radio"]:checked+label { + background: var(--main-background-active-color); + border: 2px solid var(--main-background-active-color); +} + +/*数据备份*/ +.set_tip { + display: flex; + margin: 20px; + background: var(--main-background-color); + padding: 20px; + border-radius: 8px; + flex-direction: column; +} + +.set_button { + margin: 20px; + display: flex; + justify-content: center; +} + +.but-ordinary { + width: 25%; + display: flex; + height: 40px; + border-radius: 8px; + background: var(--main-background-color); + margin: 0 20px; + justify-content: center; + align-items: center; + transition: 0.3s; +} + +.but-ordinary:hover { + cursor: pointer; + background: var(--main-background-hover-color); + transition: 0.3s; +} + +.but-ordinary:active { + transform: scale(0.90); + background: var(--main-background-active-color); + transition: 0.3s; +} + +.set_version { + display: flex; + justify-content: center; + flex-direction: column; + align-items: center; +} + +.set_version-text2 { + font-size: small; + color: var(--main-background-active-color); +} + +/*页脚*/ +.foot { + position: absolute; + bottom: 10px; + z-index: 1000; + text-align: center; + width: 100%; + height: 20px; + line-height: 20px; +} + +.power { + color: var(--main-text-color); + opacity: 0.8; + font-size: small; + text-shadow: var(--main-text-shadow); +} + +/*弹窗样式*/ +.iziToast { + backdrop-filter: blur(10px) !important; +} + +.iziToast:after { + box-shadow: none !important; +} + +.iziToast>.iziToast-body { + display: flex; + align-items: center; +} + +.iziToast>.iziToast-body .iziToast-message { + margin: 0 !important; +} + +.iziToast>.iziToast-body .iziToast-texts { + margin: 0 !important; +} + +.iziToast>.iziToast-body .iziToast-buttons>a, +.iziToast>.iziToast-body .iziToast-buttons>button, +.iziToast>.iziToast-body .iziToast-buttons>input:not([type=checkbox]):not([type=radio]) { + margin: 2px 6px !important; + color: #efefef !important; +} + +.iziToast>.iziToast-body .iziToast-buttons>a:focus, +.iziToast>.iziToast-body .iziToast-buttons>button:focus, +.iziToast>.iziToast-body .iziToast-buttons>input:not([type=checkbox]):not([type=radio]):focus { + box-shadow: none !important; +} + +/*滚动条*/ +::-webkit-scrollbar { + background-color: transparent !important; + width: 6px; +} + +::-webkit-scrollbar-track { + display: none; +} + +::-webkit-scrollbar-thumb { + border-radius: 10px; + box-shadow: inset 0 0 6px rgba(0, 0, 0, .1); + -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .1); + background-color: var(--main-background-color); +} + +::-webkit-scrollbar-thumb:hover { + background-color: var(--main-background-active-color); +} + +/*文字选中*/ +::selection { + background: #00000040; + color: #000000b3; +} + +::-moz-selection { + background: #00000040; + color: #000000b3; +} + +::-webkit-selection { + background: #00000040; + color: #000000b3; +} + +.from_items input::selection { + background: #ffffff60; + color: #ffffffb3; +} \ No newline at end of file diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..91c5221 Binary files /dev/null and b/favicon.ico differ diff --git a/font/MiSans-Regular.woff b/font/MiSans-Regular.woff new file mode 100644 index 0000000..c1a95a7 Binary files /dev/null and b/font/MiSans-Regular.woff differ diff --git a/img/background1.webp b/img/background1.webp new file mode 100644 index 0000000..9002a2f Binary files /dev/null and b/img/background1.webp differ diff --git a/img/background10.webp b/img/background10.webp new file mode 100644 index 0000000..fadd799 Binary files /dev/null and b/img/background10.webp differ diff --git a/img/background2.webp b/img/background2.webp new file mode 100644 index 0000000..eea9b29 Binary files /dev/null and b/img/background2.webp differ diff --git a/img/background3.webp b/img/background3.webp new file mode 100644 index 0000000..e53a1aa Binary files /dev/null and b/img/background3.webp differ diff --git a/img/background4.webp b/img/background4.webp new file mode 100644 index 0000000..cc6445b Binary files /dev/null and b/img/background4.webp differ diff --git a/img/background5.webp b/img/background5.webp new file mode 100644 index 0000000..5e1565b Binary files /dev/null and b/img/background5.webp differ diff --git a/img/background6.webp b/img/background6.webp new file mode 100644 index 0000000..6662f1f Binary files /dev/null and b/img/background6.webp differ diff --git a/img/background7.webp b/img/background7.webp new file mode 100644 index 0000000..900f506 Binary files /dev/null and b/img/background7.webp differ diff --git a/img/background8.webp b/img/background8.webp new file mode 100644 index 0000000..efe0b32 Binary files /dev/null and b/img/background8.webp differ diff --git a/img/background9.webp b/img/background9.webp new file mode 100644 index 0000000..29a1256 Binary files /dev/null and b/img/background9.webp differ diff --git a/img/icon/favicon - 128.ico b/img/icon/favicon - 128.ico new file mode 100644 index 0000000..8eb32cc Binary files /dev/null and b/img/icon/favicon - 128.ico differ diff --git a/img/icon/favicon - 32.ico b/img/icon/favicon - 32.ico new file mode 100644 index 0000000..bf05bc6 Binary files /dev/null and b/img/icon/favicon - 32.ico differ diff --git a/img/icon/favicon - 64.ico b/img/icon/favicon - 64.ico new file mode 100644 index 0000000..91c5221 Binary files /dev/null and b/img/icon/favicon - 64.ico differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..1b77c4a --- /dev/null +++ b/index.html @@ -0,0 +1,523 @@ + + + + + + + + Snavigation + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+
+
+
+
+

Snavigation

+ 加载中 +
+
+
+ +
+ +
+
+ +
+ +
+
+ +
+
+ 00:00 + 0 月 00 日 周一 +
+
+ N/A N/A°C ~ N/A°C +
+
+ +
+ + + +
+ + + + + + +
+
+ + +
+
Copyright © 2020 +  無名 &  + + Made by imsyy +
+
+
+ + + + + + + + + + \ No newline at end of file diff --git a/js/js.cookie.js b/js/js.cookie.js new file mode 100644 index 0000000..826ae33 --- /dev/null +++ b/js/js.cookie.js @@ -0,0 +1,164 @@ +/*! + * JavaScript Cookie v2.2.1 + * https://github.com/js-cookie/js-cookie + * + * Copyright 2006, 2015 Klaus Hartl & Fagner Brack + * Released under the MIT license + */ +; +(function (factory) { + var registeredInModuleLoader; + if (typeof define === 'function' && define.amd) { + define(factory); + registeredInModuleLoader = true; + } + if (typeof exports === 'object') { + module.exports = factory(); + registeredInModuleLoader = true; + } + if (!registeredInModuleLoader) { + var OldCookies = window.Cookies; + var api = window.Cookies = factory(); + api.noConflict = function () { + window.Cookies = OldCookies; + return api; + }; + } +}(function () { + function extend() { + var i = 0; + var result = {}; + for (; i < arguments.length; i++) { + var attributes = arguments[i]; + for (var key in attributes) { + result[key] = attributes[key]; + } + } + return result; + } + + function decode(s) { + return s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent); + } + + function init(converter) { + function api() {} + + function set(key, value, attributes) { + if (typeof document === 'undefined') { + return; + } + + attributes = extend({ + path: '/' + }, api.defaults, attributes); + + if (typeof attributes.expires === 'number') { + attributes.expires = new Date(new Date() * 1 + attributes.expires * 864e+5); + } + + // We're using "expires" because "max-age" is not supported by IE + attributes.expires = attributes.expires ? attributes.expires.toUTCString() : ''; + + try { + var result = JSON.stringify(value); + if (/^[\{\[]/.test(result)) { + value = result; + } + } catch (e) {} + + value = converter.write ? + converter.write(value, key) : + encodeURIComponent(String(value)) + .replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent); + + key = encodeURIComponent(String(key)) + .replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent) + .replace(/[\(\)]/g, escape); + + var stringifiedAttributes = ''; + for (var attributeName in attributes) { + if (!attributes[attributeName]) { + continue; + } + stringifiedAttributes += '; ' + attributeName; + if (attributes[attributeName] === true) { + continue; + } + + // Considers RFC 6265 section 5.2: + // ... + // 3. If the remaining unparsed-attributes contains a %x3B (";") + // character: + // Consume the characters of the unparsed-attributes up to, + // not including, the first %x3B (";") character. + // ... + stringifiedAttributes += '=' + attributes[attributeName].split(';')[0]; + } + + return (document.cookie = key + '=' + value + stringifiedAttributes); + } + + function get(key, json) { + if (typeof document === 'undefined') { + return; + } + + var jar = {}; + // To prevent the for loop in the first place assign an empty array + // in case there are no cookies at all. + var cookies = document.cookie ? document.cookie.split('; ') : []; + var i = 0; + + for (; i < cookies.length; i++) { + var parts = cookies[i].split('='); + var cookie = parts.slice(1).join('='); + + if (!json && cookie.charAt(0) === '"') { + cookie = cookie.slice(1, -1); + } + + try { + var name = decode(parts[0]); + cookie = (converter.read || converter)(cookie, name) || + decode(cookie); + + if (json) { + try { + cookie = JSON.parse(cookie); + } catch (e) {} + } + + jar[name] = cookie; + + if (key === name) { + break; + } + } catch (e) {} + } + + return key ? jar[key] : jar; + } + + api.set = set; + api.get = function (key) { + return get(key, false /* read as raw */ ); + }; + api.getJSON = function (key) { + return get(key, true /* read as json */ ); + }; + api.remove = function (key, attributes) { + set(key, '', extend(attributes, { + expires: -1 + })); + }; + + api.defaults = {}; + + api.withConverter = init; + + return api; + } + + return init(function () {}); +})); \ No newline at end of file diff --git a/js/main.js b/js/main.js new file mode 100644 index 0000000..032ffb3 --- /dev/null +++ b/js/main.js @@ -0,0 +1,124 @@ +//加载完成后执行 +window.addEventListener('load', function () { + //载入动画 + $('#loading-box').attr('class', 'loaded'); + $('#bg').css("cssText", "transform: scale(1);filter: blur(0px);transition: ease 1.5s;"); + $('#section').css("cssText", "opacity: 1;transition: ease 1.5s;"); + $('.cover').css("cssText", "opacity: 1;transition: ease 1.5s;"); + + //用户欢迎 + iziToast.settings({ + timeout: 3000, + backgroundColor: '#ffffff40', + titleColor: '#efefef', + messageColor: '#efefef', + progressBar: false, + close: false, + closeOnEscape: true, + position: 'topCenter', + transitionIn: 'bounceInDown', + transitionOut: 'flipOutX', + displayMode: 'replace', + layout: '1' + }); + setTimeout(function () { + iziToast.show({ + title: hello, + message: '欢迎来到 Snavigation' + }); + }, 800); + +}, false) + +//屏蔽浏览器默认右键 +// document.oncontextmenu = function () { +// undefined +// return false; +// } + +//获取时间 +var t = null; +t = setTimeout(time, 1000); + +function time() { + clearTimeout(t); + dt = new Date(); + var mm = dt.getMonth() + 1; + var d = dt.getDate(); + var weekday = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"]; + var day = dt.getDay(); + var h = dt.getHours(); + var m = dt.getMinutes(); + if (h < 10) { + h = "0" + h; + } + if (m < 10) { + m = "0" + m; + } + $("#time_text").html(h + ':' + m); + $("#day").html(mm + " 月 " + d + " 日 " + weekday[day]); + t = setTimeout(time, 1000); +} + +//获取天气 +//每日限量 100 次 +//请前往 https://www.tianqiapi.com/index/doc?version=v6 申请(免费) +fetch('https://yiketianqi.com/api?unescape=1&version=v6&appid=43986679&appsecret=TksqGZT7') + .then(response => response.json()) + .then(data => { + //$('#wea_text').html(data.wea + ' ' + data.tem_night + '℃' + ' ~ ' + data.tem_day + '℃') + $('#wea_text').text(data.wea) + $('#tem1').text(data.tem1) + $('#tem2').text(data.tem2) + }) + .catch(console.error) + +//火狐浏览器独立样式 +if (isFirefox = navigator.userAgent.indexOf("Firefox") > 0) { + var head = document.getElementsByTagName('head')[0]; + var link = document.createElement('link'); + link.href = './css/firefox.css'; + link.rel = 'stylesheet'; + link.type = 'text/css'; + head.appendChild(link); + window.addEventListener('load', function () { + setTimeout(function () { + iziToast.show({ + timeout: 8000, + message: '您正在使用火狐浏览器,部分功能可能不支持' + }); + }, 3800); + }, false) +} + +//Tab书签页 +$(function () { + $(".mark .tab .tab-item").click(function () { + $(this).addClass("active").siblings().removeClass("active"); + $(".products .mainCont").eq($(this).index()).css("display", "flex").siblings().css("display", "none"); + }) +}) + +//设置 +$(function () { + $(".set .tabs .tab-items").click(function () { + $(this).addClass("actives").siblings().removeClass("actives"); + $(".productss .mainConts").eq($(this).index()).css("display", "flex").siblings().css("display", "none"); + }) +}) + +//监听网页宽度 +// window.addEventListener('load', function () { +// if (window.innerWidth <= 512) { +// $('.wd').attr('placeholder', '搜索'); +// } else { +// $('.wd').attr('placeholder', '想要搜点什么'); +// } +// window.addEventListener('resize', function () { +// if (window.innerWidth <= 512) { +// $('.wd').attr('placeholder', '搜索'); +// } else { +// $('.wd').attr('placeholder', '想要搜点什么'); +// } +// }) +// }) \ No newline at end of file diff --git a/js/set.js b/js/set.js new file mode 100644 index 0000000..966c6f4 --- /dev/null +++ b/js/set.js @@ -0,0 +1,1241 @@ +/* +作者:D.Young +主页:https://yyv.me/ +github:https://github.com/5iux/sou +日期:2019-07-26 +版权所有,请勿删除 +======================================== +由 yeetime 修改 +github:https://github.com/yeetime/sou2 +日期:2019-12-13 +======================================== +由 imsyy 二次修改 +github:https://github.com/imsyy/sou2 +日期:2022-03-10 +*/ + +// 默认搜索引擎列表 +var se_list_preinstall = { + '1': { + id: 1, + title: "百度", + url: "https://www.baidu.com/s", + name: "wd", + icon: "iconfont icon-baidu", + }, + '2': { + id: 2, + title: "必应", + url: "https://cn.bing.com/search", + name: "q", + icon: "iconfont icon-bing", + }, + '3': { + id: 3, + title: "谷歌", + url: "https://www.google.com/search", + name: "q", + icon: "iconfont icon-google", + }, + '4': { + id: 4, + title: "搜狗", + url: "https://www.sogou.com/web", + name: "query", + icon: "iconfont icon-sougousousuo", + }, + '5': { + id: 5, + title: "360", + url: "https://www.so.com/s", + name: "q", + icon: "iconfont icon-360sousuo", + }, + '6': { + id: 6, + title: "微博", + url: "https://s.weibo.com/weibo", + name: "q", + icon: "iconfont icon-xinlangweibo", + }, + '7': { + id: 7, + title: "知乎", + url: "https://www.zhihu.com/search", + name: "q", + icon: "iconfont icon-zhihu", + }, + '8': { + id: 8, + title: "Github", + url: "https://github.com/search", + name: "q", + icon: "iconfont icon-github", + }, + '9': { + id: 9, + title: "BiliBili", + url: "https://search.bilibili.com/all", + name: "keyword", + icon: "iconfont icon-bilibilidonghua", + }, + '10': { + id: 10, + title: "淘宝", + url: "https://s.taobao.com/search", + name: "q", + icon: "iconfont icon-taobao", + }, + '11': { + id: 11, + title: "京东", + url: "https://search.jd.com/Search", + name: "keyword", + icon: "iconfont icon-jingdong", + } +}; + +// 默认快捷方式 +var quick_list_preinstall = { + '1': { + title: "哔哩哔哩", + url: "https://www.bilibili.com/", + explain: "哔哩哔哩 (゜-゜)つロ 干杯~", + }, + '2': { + title: "GitHub", + url: "https://github.com/", + explain: "GitHub", + }, + '3': { + title: "V2EX", + url: "https://www.v2ex.com/", + explain: "V2EX", + }, + '4': { + title: "Steam", + url: "https://store.steampowered.com/", + explain: "Steam", + }, + '5': { + title: "Github", + url: "https://github.com/", + explain: "GitHub", + }, + '6': { + title: "Github", + url: "https://github.com/", + explain: "GitHub", + }, + '7': { + title: "Github", + url: "https://github.com/", + explain: "GitHub", + }, + '8': { + title: "Github", + url: "https://github.com/", + explain: "GitHub", + }, + '9': { + title: "Github", + url: "https://github.com/", + explain: "GitHub", + }, + '10': { + title: "Github", + url: "https://github.com/", + explain: "GitHub", + } +}; + +// 获取搜索引擎列表 +function getSeList() { + var se_list_local = Cookies.get('se_list'); + if (se_list_local !== "{}" && se_list_local) { + return JSON.parse(se_list_local); + } else { + setSeList(se_list_preinstall); + return se_list_preinstall; + } +} + +// 设置搜索引擎列表 +function setSeList(se_list) { + if (se_list) { + Cookies.set('se_list', se_list, { + expires: 36500 + }); + return true; + } + return false; +} + +// 获得默认搜索引擎 +function getSeDefault() { + var se_default = Cookies.get('se_default'); + return se_default ? se_default : "1"; +} + +//背景图片 +var bg_img_preinstall = { + "type": "2", // 1:使用主题默认的背景图片 2:关闭背景图片 3:使用自定义的背景图片 + "path": "", //自定义图片 +}; + +// 获取背景图片 +function getBgImg() { + var bg_img_local = Cookies.get('bg_img'); + if (bg_img_local && bg_img_local !== "{}") { + return JSON.parse(bg_img_local); + } else { + setBgImg(bg_img_preinstall); + return bg_img_preinstall; + } +} + +// 设置背景图片 +function setBgImg(bg_img) { + if (bg_img) { + Cookies.set('bg_img', bg_img, { + expires: 36500 + }); + return true; + } + return false; +} + +// 设置-壁纸 +//$('#bg').attr('src','https://api.dujin.org/bing/1920.php') +function setBgImgInit() { + var bg_img = getBgImg(); + $("input[name='wallpaper-type'][value=" + bg_img["type"] + "]").click(); + if (bg_img["type"] === "5") { + $("#wallpaper-url").val(bg_img["path"]); + $("#wallpaper-button").fadeIn(100); + $("#wallpaper_url").fadeIn(100); + } else { + $("#wallpaper_url").fadeOut(300); + $("#wallpaper-button").fadeOut(300); + } + + switch (bg_img["type"]) { + case "1": + var pictures = new Array(); + pictures[0] = './img/background1.webp'; + pictures[1] = './img/background2.webp'; + pictures[2] = './img/background3.webp'; + pictures[3] = './img/background4.webp'; + pictures[4] = './img/background5.webp'; + pictures[5] = './img/background6.webp'; + pictures[6] = './img/background7.webp'; + pictures[7] = './img/background8.webp'; + pictures[8] = './img/background9.webp'; + pictures[9] = './img/background10.webp'; + var rd = Math.floor(Math.random()*10); + $('#bg').attr('src', pictures[rd]) //随机默认壁纸 + break; + case "2": + $('#bg').attr('src', 'https://api.dujin.org/bing/1920.php') //必应每日 + break; + case "3": + $('#bg').attr('src', 'https://api.ixiaowai.cn/gqapi/gqapi.php') //随机风景 + break; + case "4": + $('#bg').attr('src', 'https://api.ixiaowai.cn/api/api.php') //随机二次元 + break; + case "5": + $('#bg').attr('src', bg_img["path"]) //自定义 + break; + } +} + +// 搜索框高亮 +function focusWd() { + //输入框 + $(".all-search").css({ + "background-color": 'var(--main-text-form-hover-color)', + "transition": "ease 0.4s", + "transform": "translateY(-140%)" + }); + //背景模糊 + $('#bg').css({ + "transform": "scale(1.08)", + "filter": "blur(10px)", + "transition": "ease 0.3s", + }); + //搜索引擎按钮 + $('#icon-se').css({ + "color": 'var(--main-text-form-color)', + "transition": "ease 0.5s" + }); + //搜索按钮 + $('#icon-sou').css({ + "color": "var(--main-text-form-color)", + "transition": "ease 0.5s" + }); + //时间上移 + $(".tool-all").css({ + "transform": "translateY(-140%)" + }); +} + +// 搜索框取消高亮 +function blurWd() { + //输入框 + $(".all-search").css({ + "background-color": "", + "transition": "ease 0.4s", + "transform": "" + }); + //背景模糊 + $('#bg').css({ + "transform": "scale(1)", + "filter": "blur(0px)", + "transition": "ease 0.3s", + }); + //搜索引擎按钮 + $('#icon-se').css({ + "color": "var(--main-text-color)", + "transition": "ease 0.5s" + }); + //搜索按钮 + $('#icon-sou').css({ + "color": 'var(--main-text-color)', + "transition": "ease 0.5s" + }); + //隐藏输入 + $(".wd").val(""); + //时间下移 + $(".tool-all").css({ + "transform": "translateY(-120%)" + }); +} + +// 关键字提示 +function keywordReminder() { + var keyword = $(".wd").val(); + if (keyword != "") { + $.ajax({ + url: 'https://suggestion.baidu.com/su?wd=' + keyword, + dataType: 'jsonp', + jsonp: 'cb', //回调函数的参数名(键值)key + success: function (data) { + //获取宽度 + $("#keywords").css("width", $('.sou').width()); + $("#keywords").empty().show(); + $.each(data.s, function (i, val) { + $('#keywords').append("
" + "" + val + "
"); + }); + $("#keywords").attr("data-length", data.s["length"]); + }, + error: function () { + $("#keywords").empty().show(); + $("#keywords").hide(); + } + }) + } else { + $("#keywords").empty().show(); + $("#keywords").hide(); + } +} + +// 搜索框数据加载 +function searchData() { + var se_default = getSeDefault(); + var se_list = getSeList(); + var defaultSe = se_list[se_default]; + if (defaultSe) { + $(".search").attr("action", defaultSe["url"]); + $("#icon-se").attr("class", defaultSe["icon"]); + $(".wd").attr("name", defaultSe["name"]); + } + + // 判断窗口大小,添加输入框自动完成 + // var wid = $("body").width(); + // if (wid < 640) { + // $(".wd").attr('autocomplete', 'off'); + // } else { + // $(".wd").focus(); + // focusWd(); + // } +} + +// 搜索引擎列表加载 +function seList() { + var html = ""; + var se_list = getSeList(); + for (var i in se_list) { + //html += "
" + se_list[i]["title"] + "
"; + html += "
" + se_list[i]["title"] + "
"; + } + $(".search-engine-list").html(html); +} + +// 设置-搜索引擎列表加载 +function setSeInit() { + var se_default = getSeDefault(); + var se_list = getSeList(); + var html = ""; + for (var i in se_list) { + var tr = "
" + i + "
"; + if (i === se_default) { + tr = "
\ +
"; + } + tr += "
" + se_list[i]["title"] + "
\ +
\ + \ + \ +
\ +
"; + html += tr; + } + $(".se_list_table").html(html); +} + +// 获取快捷方式列表 +function getQuickList() { + var quick_list_local = Cookies.get('quick_list'); + if (quick_list_local !== "{}" && quick_list_local) { + return JSON.parse(quick_list_local); + } else { + setQuickList(quick_list_preinstall); + return quick_list_preinstall; + } +} + +// 设置快捷方式列表 +function setQuickList(quick_list) { + if (quick_list) { + Cookies.set('quick_list', quick_list, { + expires: 36500 + }); + return true; + } + return false; +} + +// 快捷方式数据加载 +function quickData() { + var html = ""; + var quick_list = getQuickList(); + for (var i in quick_list) { + html += ""; + } + $(".quick-all").html(html + ""); +} + +// 设置-快捷方式加载 +function setQuickInit() { + var quick_list = getQuickList(); + var html = ""; + for (var i in quick_list) { + tr = "
\ +
" + i + "
\ +
" + quick_list[i]['title'] + "
\ +
\ + \ + \ +
\ +
\ +
"; + html += tr; + } + $(".quick_list_table").html(html); +} + +/** + * 下載文本为文件 + * @param filename 文件名 + * @param text 内容 + */ +function download(filename, text) { + var element = document.createElement('a'); + element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text)); + element.setAttribute('download', filename); + + element.style.display = 'none'; + document.body.appendChild(element); + + element.click(); + + document.body.removeChild(element); +} + +// 打开设置 +function openSet() { + $("#menu").addClass('on'); + + openBox(); + + //更改设置图标 + $("#icon-menu").attr("class", "iconfont icon-home"); + + //隐藏书签打开设置 + $(".mark").css({ + "display": "none", + }); + $(".set").css({ + "display": "flex", + }); +} + +// 关闭设置 +function closeSet() { + $("#menu").removeClass('on'); + + closeBox(); + + //更改设置图标 + $("#icon-menu").attr("class", "iconfont icon-shezhi"); + + //隐藏设置 + $(".set").css({ + "display": "none", + }); + + // 刷新主页数据 + seList(); + quickData(); +} + +// 书签显示 +function openBox() { + $("#content").addClass('box'); + $(".mark").css({ + "display": "flex", + }); + //时间上移 + $(".tool-all").css({ + "transform": 'translateY(-160%)' + }); + //背景模糊 + $('#bg').css({ + "transform": 'scale(1.08)', + "filter": "blur(10px)", + "transition": "ease 0.3s", + }); +} + +// 书签关闭 +function closeBox() { + $("#content").removeClass('box'); + $(".mark").css({ + "display": "none", + }); + //时间下移 + $(".tool-all").css({ + "transform": 'translateY(-110%)' + }); + //背景模糊 + $('#bg').css({ + "transform": 'scale(1)', + "filter": "blur(0px)", + "transition": "ease 0.3s", + }); +} + +//显示设置搜索引擎列表 +function showSe() { + $(".se_list").show(); + $(".se_add_preinstall").show(); +} + +//隐藏设置搜索引擎列表 +function hideSe() { + $(".se_list").hide(); + $(".se_add_preinstall").hide(); +} + +//显示设置快捷方式列表 +function showQuick() { + $(".quick_list").show(); + $(".se_add_preinstalls").show(); +} + +//隐藏设置快捷方式列表 +function hideQuick() { + $(".quick_list").hide(); + $(".se_add_preinstalls").hide(); +} + + +$(document).ready(function () { + + // 搜索框数据加载 + searchData(); + + // 搜索引擎列表加载 + seList(); + + // 快捷方式数据加载 + quickData(); + + // 壁纸数据加载 + setBgImgInit(); + + // 点击事件 + $(document).on('click', function (e) { + // 选择搜索引擎点击 + if ($(".search-engine").is(":hidden") && $(".se").is(e.target) || $(".search-engine").is(":hidden") && $("#icon-se").is(e.target)) { + if ($(".se").is(e.target) || $("#icon-se").is(e.target)) { + //获取宽度 + $(".search-engine").css("width", $('.sou').width() - 30); + //出现动画 + $(".search-engine").slideDown(160); + } + } else { + if (!$(".search-engine").is(e.target) && $(".search-engine").has(e.target).length === 0) { + $(".search-engine").slideUp(160); + } + } + + // 自动提示隐藏 + if (!$(".sou").is(e.target) && $(".sou").has(e.target).length === 0) { + $("#keywords").hide(); + } + }); + + // 时间点击 + $("#time_text").click(function () { + if ($("#content").attr("class") === "box") { + closeBox(); + closeSet(); + } else { + openBox(); + } + }); + + // 搜索引擎列表点击 + $(".search-engine-list").on("click", ".se-li", function () { + var url = $(this).attr('data-url'); + var name = $(this).attr('data-name'); + var icon = $(this).attr('data-icon'); + $(".search").attr("action", url); + $(".wd").attr("name", name); + $("#icon-se").attr("class", icon); + $(".search-engine").slideUp(160); + }); + + // 搜索框获得焦点事件 + $(".wd").focus(function () { + focusWd(); + keywordReminder(); + $(".search-engine").slideUp(160); + }); + + // 搜索框失去焦点事件 + $(".wd").blur(function () { + blurWd(); + }); + + // 自动提示( 调用百度 api ) + $('.wd').keyup(function (event) { + var key = event.keyCode; + // 屏蔽上下键 + var shieldKey = [38, 40]; + if (shieldKey.includes(key)) return; + keywordReminder(); + }); + + // 点击自动提示的关键字 + $("#keywords").on("click", "div", function () { + var wd = $(this).text(); + $(".wd").val(wd); + $(".search").submit(); + //隐藏输入 + $(".wd").val(""); + $("#keywords").hide(); + }); + + // 自动提示键盘方向键选择操作 + // $(".wd").keydown(function (event) { //上下键获取焦点 + // var key = event.keyCode; + // if ($.trim($(this).val()).length === 0) return; + + // var id = $(".keyword-active").attr("data-id"); + // if (id === undefined) id = 0; + + // if (key === 38) { + // /*向上按钮*/ + // id--; + // } else if (key === 40) { + // /*向下按钮*/ + // id++; + // } else { + // return; + // } + // var length = $("#keywords").attr("data-length"); + // if (id > length) id = 1; + // if (id < 1) id = length; + + // $(".keyword[data-id=" + id + "]").addClass("keyword-active").siblings().removeClass("keyword-active"); + // $(".wd").val($(".keyword[data-id=" + id + "]").text()); + // }); + + // 菜单点击 + $("#menu").click(function (event) { + if ($(this).attr("class") === "on") { + closeSet(); + } else { + openSet(); + + // 设置内容加载 + setSeInit(); //搜索引擎设置 + setQuickInit(); //快捷方式设置 + } + }); + + // 快捷方式添加按钮点击 + $("#set-quick").click(function (event) { + if ($(this).attr("class") === "on") { + closeSet(); + } else { + openSet(); + + // 设置内容加载 + setSeInit(); //搜索引擎设置 + setQuickInit(); //快捷方式设置 + + //添加快捷方式 + $("#set-quick-menu").trigger('click'); + $(".set_quick_list_add").trigger('click'); + } + }); + + // 修改默认搜索引擎 + $(".se_list_table").on("click", ".set_se_default", function () { + var name = $(this).val(); + Cookies.set('se_default', name, { + expires: 36500 + }); + iziToast.show({ + timeout: 8000, + message: '是否设置为默认搜索引擎?', + buttons: [ + ['', function (instance, toast) { + setSeInit(); + instance.hide({ + transitionOut: 'flipOutX', + }, toast, 'buttonName'); + iziToast.show({ + message: '设置成功' + }); + setTimeout(function () { + window.location.reload() + }, 1000); + }, true], + ['', function (instance, toast) { + instance.hide({ + transitionOut: 'flipOutX', + }, toast, 'buttonName'); + }] + ] + }); + }); + + // 搜索引擎添加 + $(".set_se_list_add").click(function () { + $(".se_add_content input").val(""); + + hideSe(); + $(".se_add_content").show(); + }); + + // 搜索引擎保存 + $(".se_add_save").click(function () { + var key_inhere = $(".se_add_content input[name='key_inhere']").val(); + var key = $(".se_add_content input[name='key']").val(); + var title = $(".se_add_content input[name='title']").val(); + var url = $(".se_add_content input[name='url']").val(); + var name = $(".se_add_content input[name='name']").val(); + //var icon = $(".se_add_content input[name='icon']").val(); + var icon = "iconfont icon-wangluo"; + + var num = /^\+?[1-9][0-9]*$/; + if (!num.test(key)) { + iziToast.show({ + timeout: 2000, + message: '序号 ' + key + ' 不是正整数' + }); + return; + } + + var se_list = getSeList(); + + if (se_list[key]) { + iziToast.show({ + timeout: 8000, + message: '搜索引擎 ' + key + ' 已有数据,是否覆盖?', + buttons: [ + ['', function (instance, toast) { + se_list[key] = { + title: title, + url: url, + name: name, + icon: icon, + }; + setSeList(se_list); + setSeInit(); + $(".se_add_content").hide(); + //显示列表 + showSe(); + + instance.hide({ + transitionOut: 'flipOutX', + }, toast, 'buttonName'); + iziToast.show({ + message: '覆盖成功' + }); + }, true], + ['', function (instance, toast) { + instance.hide({ + transitionOut: 'flipOutX', + }, toast, 'buttonName'); + }] + ] + }); + return; + } + + if (key_inhere && key !== key_inhere) { + delete se_list[key_inhere]; + } + + se_list[key] = { + title: title, + url: url, + name: name, + icon: icon, + }; + setSeList(se_list); + setSeInit(); + iziToast.show({ + timeout: 2000, + message: '添加成功' + }); + $(".se_add_content").hide(); + showSe(); + }); + + // 关闭表单 + $(".se_add_cancel").click(function () { + $(".se_add_content").hide(); + + //显示列表 + showSe(); + }); + + // 搜索引擎修改 + $(".se_list").on("click", ".edit_se", function () { + + var se_list = getSeList(); + var key = $(this).val(); + $(".se_add_content input[name='key_inhere']").val(key); + $(".se_add_content input[name='key']").val(key); + $(".se_add_content input[name='title']").val(se_list[key]["title"]); + $(".se_add_content input[name='url']").val(se_list[key]["url"]); + $(".se_add_content input[name='name']").val(se_list[key]["name"]); + // $(".se_add_content input[name='icon']").val("iconfont icon-Earth"); + + //隐藏列表 + hideSe(); + + $(".se_add_content").show(); + }); + + // 搜索引擎删除 + $(".se_list").on("click", ".delete_se", function () { + var se_default = getSeDefault(); + var key = $(this).val(); + if (key == se_default) { + iziToast.show({ + message: '默认搜索引擎不可删除' + }); + } else { + iziToast.show({ + timeout: 8000, + message: '搜索引擎 ' + key + ' 是否删除?', + buttons: [ + ['', function (instance, toast) { + var se_list = getSeList(); + delete se_list[key]; + setSeList(se_list); + setSeInit(); + instance.hide({ + transitionOut: 'flipOutX', + }, toast, 'buttonName'); + iziToast.show({ + message: '删除成功' + }); + }, true], + ['', function (instance, toast) { + instance.hide({ + transitionOut: 'flipOutX', + }, toast, 'buttonName'); + }] + ] + }); + } + }); + + // 恢复预设搜索引擎 + $(".set_se_list_preinstall").click(function () { + iziToast.show({ + timeout: 8000, + message: '现有搜索引擎数据将被清空', + buttons: [ + ['', function (instance, toast) { + setSeList(se_list_preinstall); + Cookies.set('se_default', 1, { + expires: 36500 + }); + setSeInit(); + instance.hide({ + transitionOut: 'flipOutX', + }, toast, 'buttonName'); + iziToast.show({ + message: '重置成功' + }); + setTimeout(function () { + window.location.reload() + }, 1000); + }, true], + ['', function (instance, toast) { + instance.hide({ + transitionOut: 'flipOutX', + }, toast, 'buttonName'); + }] + ] + }); + }); + + // 设置-快捷方式添加 + $(".set_quick_list_add").click(function () { + $(".quick_add_content input").val(""); + $(".quick_add_content").show(); + + //隐藏列表 + hideQuick(); + }); + + // 设置-快捷方式保存 + $(".quick_add_save").click(function () { + var key_inhere = $(".quick_add_content input[name='key_inhere']").val(); + var key = $(".quick_add_content input[name='key']").val(); + var title = $(".quick_add_content input[name='title']").val(); + var url = $(".quick_add_content input[name='url']").val(); + var img = $(".quick_add_content input[name='img']").val(); + + var num = /^\+?[1-9][0-9]*$/; + if (!num.test(key)) { + iziToast.show({ + timeout: 2000, + message: '快捷方式 ' + key + ' 不是正整数' + }); + return; + } + + var quick_list = getQuickList(); + + if (quick_list[key]) { + iziToast.show({ + timeout: 8000, + message: '快捷方式 " + key + " 已有数据,是否覆盖?', + buttons: [ + ['', function (instance, toast) { + quick_list[key] = { + title: title, + url: url, + img: img, + }; + setQuickList(quick_list); + setQuickInit(); + $(".quick_add_content").hide(); + //显示列表 + showQuick(); + + instance.hide({ + transitionOut: 'flipOutX', + }, toast, 'buttonName'); + iziToast.show({ + message: '覆盖成功' + }); + }, true], + ['', function (instance, toast) { + instance.hide({ + transitionOut: 'flipOutX', + }, toast, 'buttonName'); + }] + ] + }); + return; + } + + if (key_inhere && key != key_inhere) { + delete quick_list[key_inhere]; + } + + quick_list[key] = { + title: title, + url: url, + img: img, + }; + setQuickList(quick_list); + setQuickInit(); + $(".quick_add_content").hide(); + iziToast.show({ + timeout: 2000, + message: '添加成功' + }); + + //显示列表 + showQuick(); + }); + + // 设置-快捷方式关闭添加表单 + $(".quick_add_cancel").click(function () { + $(".quick_add_content").hide(); + + //显示列表 + showQuick(); + }); + + //恢复预设快捷方式 + $(".set_quick_list_preinstall").click(function () { + iziToast.show({ + timeout: 8000, + message: '快捷方式数据将被清空', + buttons: [ + ['', function (instance, toast) { + setQuickList(quick_list_preinstall); + setQuickInit(); + instance.hide({ + transitionOut: 'flipOutX', + }, toast, 'buttonName'); + iziToast.show({ + timeout: 2000, + message: '重置成功' + }); + setTimeout(function () { + window.location.reload() + }, 1000); + }, true], + ['', function (instance, toast) { + instance.hide({ + transitionOut: 'flipOutX', + }, toast, 'buttonName'); + }] + ] + }); + }); + + // 快捷方式修改 + $(".quick_list").on("click", ".edit_quick", function () { + + var quick_list = getQuickList(); + var key = $(this).val(); + $(".quick_add_content input[name='key_inhere']").val(key); + $(".quick_add_content input[name='key']").val(key); + $(".quick_add_content input[name='title']").val(quick_list[key]["title"]); + $(".quick_add_content input[name='url']").val(quick_list[key]["url"]); + $(".quick_add_content input[name='img']").val(quick_list[key]["img"]); + + //隐藏列表 + hideQuick(); + + $(".quick_add_content").show(); + }); + + // 快捷方式删除 + $(".quick_list").on("click", ".delete_quick", function () { + + var key = $(this).val(); + + iziToast.show({ + timeout: 8000, + message: '快捷方式 ' + key + ' 是否删除?', + buttons: [ + ['', function (instance, toast) { + var quick_list = getQuickList(); + delete quick_list[key]; + setQuickList(quick_list); + setQuickInit(); + instance.hide({ + transitionOut: 'flipOutX', + }, toast, 'buttonName'); + iziToast.show({ + timeout: 2000, + message: '删除成功' + }); + }, true], + ['', function (instance, toast) { + instance.hide({ + transitionOut: 'flipOutX', + }, toast, 'buttonName'); + }] + ] + }); + }); + + // 壁纸设置 + $("#wallpaper").on("click", ".set-wallpaper", function () { + var type = $(this).val(); + var bg_img = getBgImg(); + bg_img["type"] = type; + + if (type === "1") { + $('#wallpaper_text').html("显示默认壁纸,刷新页面以生效"); + setBgImg(bg_img); + iziToast.show({ + message: '壁纸设置成功,刷新生效', + }); + } + + if (type === "2") { + $('#wallpaper_text').html("显示必应每日一图,每天更新,刷新页面以生效 | API @ 缙哥哥"); + setBgImg(bg_img); + iziToast.show({ + message: '壁纸设置成功,刷新生效', + }); + } + + if (type === "3") { + $('#wallpaper_text').html("显示随机风景图,每次刷新后更换,刷新页面以生效 | API @ 小歪"); + setBgImg(bg_img); + iziToast.show({ + message: '壁纸设置成功,刷新生效', + }); + } + + if (type === "4") { + $('#wallpaper_text').html("显示随机二次元图,每次刷新后更换,刷新页面以生效 | API @ 小歪"); + setBgImg(bg_img); + iziToast.show({ + message: '壁纸设置成功,刷新生效', + }); + } + + if (type === "5") { + $('#wallpaper_text').html("自定义壁纸地址,请输入正确地址,点击保存且刷新页面以生效"); + $("#wallpaper_url").fadeIn(100); + $("#wallpaper-button").fadeIn(100); + $("#wallpaper-url").val(bg_img["path"]); + } else { + $("#wallpaper_url").fadeOut(300); + $("#wallpaper-button").fadeOut(300); + } + }); + + // 自定义壁纸设置保存 + $(".wallpaper_save").click(function () { + var url = $("#wallpaper-url").val(); + var reg = /^http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- ./?%&=]*)?$/; + if (!reg.test(url)) { + iziToast.show({ + message: '请输入正确的链接', + }); + } else { + var bg_img = getBgImg(); + bg_img["type"] = "5"; + bg_img["path"] = url; + setBgImg(bg_img); + iziToast.show({ + message: '自定义壁纸设置成功,刷新生效', + }); + } + }); + + // 我的数据导出 + $("#my_data_out").click(function () { + var cookies = Cookies.get(); + var json = JSON.stringify(cookies); + download("Snavigation-back-up-" + $.now() + ".json", json); + iziToast.show({ + timeout: 2000, + message: '已导出备份文件至下载目录' + }); + }); + + // 我的数据导入 点击触发文件选择 + $("#my_data_in").click(function () { + $("#my_data_file").click(); + }); + + // 选择文件后读取文件内容 + $("#my_data_file").change(function () { + var selectedFile = document.getElementById('my_data_file').files[0]; + //var name = selectedFile.name;//读取选中文件的文件名 + //var size = selectedFile.size;//读取选中文件的大小 + //console.log("文件名:"+name+" 大小:"+size); + + var reader = new FileReader(); //这是核心,读取操作就是由它完成. + reader.readAsText(selectedFile); //读取文件的内容,也可以读取文件的URL + reader.onload = function () { + //当读取完成后回调这个函数,然后此时文件的内容存储到了result中,直接操作即可 + //console.log(this.result); + + // json 格式校验 + var mydata; + try { + mydata = JSON.parse(this.result); + } catch (e) { + iziToast.show({ + timeout: 2000, + message: '数据解析异常' + }); + return; + } + if (typeof mydata != 'object') { + iziToast.show({ + timeout: 2000, + message: '数据格式错误' + }); + return; + } + + iziToast.show({ + timeout: 8000, + message: '当前数据将会被覆盖!是否继续导入?', + buttons: [ + ['', function (instance, toast) { + for (var key in mydata) { + Cookies.set(key, mydata[key], { + expires: 36500 + }); + } + instance.hide({ + transitionOut: 'flipOutX', + }, toast, 'buttonName'); + iziToast.show({ + timeout: 2000, + message: '导入成功' + }); + setTimeout(function () { + window.location.reload() + }, 1000); + }, true], + ['', function (instance, toast) { + instance.hide({ + transitionOut: 'flipOutX', + }, toast, 'buttonName'); + setTimeout(function () { + window.location.reload() + }, 1000); + }] + ] + }); + } + }); +}); \ No newline at end of file diff --git a/js/time.js b/js/time.js new file mode 100644 index 0000000..33977c6 --- /dev/null +++ b/js/time.js @@ -0,0 +1,18 @@ +now = new Date(), hour = now.getHours() +if (hour < 6) { + var hello = "凌晨好"; +} else if (hour < 9) { + var hello = "早上好"; +} else if (hour < 12) { + var hello = "上午好"; +} else if (hour < 14) { + var hello = "中午好"; +} else if (hour < 17) { + var hello = "下午好"; +} else if (hour < 19) { + var hello = "傍晚好"; +} else if (hour < 22) { + var hello = "晚上好"; +} else { + var hello = "夜深了"; +} \ No newline at end of file diff --git a/vercel.json b/vercel.json new file mode 100644 index 0000000..e42aa0f --- /dev/null +++ b/vercel.json @@ -0,0 +1,12 @@ +{ + "version": 2, + "routes": [{ + "handle": "filesystem" + }, + { + "src": "/(.*)", + "status": 404, + "dest": "/" + } + ] +}