hexo-theme-solitude 1.2.6 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +41 -0
- package/README.md +8 -8
- package/README_EN.md +6 -6
- package/_config.yml +495 -297
- package/languages/en-US.yml +105 -8
- package/languages/zh-CN.yml +98 -1
- package/layout/archive.pug +3 -3
- package/layout/category.pug +4 -5
- package/layout/includes/console.pug +15 -16
- package/layout/includes/footer.pug +26 -28
- package/layout/includes/head/config.pug +27 -8
- package/layout/includes/head/fest.pug +22 -0
- package/layout/includes/head/opengraph.pug +11 -0
- package/layout/includes/head.pug +1 -3
- package/layout/includes/header.pug +1 -1
- package/layout/includes/inject/body.pug +33 -13
- package/layout/includes/inject/head.pug +30 -20
- package/layout/includes/layout.pug +11 -8
- package/layout/includes/loading.pug +1 -64
- package/layout/includes/mixins/articleSort.pug +4 -4
- package/layout/includes/mixins/pagination.pug +1 -1
- package/layout/includes/nav.pug +10 -10
- package/layout/includes/page/about.pug +1 -0
- package/layout/includes/page/categories.pug +3 -3
- package/layout/includes/page/default.pug +1 -1
- package/layout/includes/page/echarts.pug +3 -3
- package/layout/includes/page/equipment.pug +0 -1
- package/layout/includes/page/links.pug +5 -26
- package/layout/includes/page/moments.pug +0 -1
- package/layout/includes/page/music.pug +19 -0
- package/layout/includes/page/not_configured.pug +18 -0
- package/layout/includes/page/rss.pug +20 -22
- package/layout/includes/page/says.pug +1 -2
- package/layout/includes/page/tags.pug +3 -3
- package/layout/includes/page/tlink.pug +0 -1
- package/layout/includes/sidebar.pug +7 -7
- package/layout/includes/widgets/aside/aside.pug +13 -1
- package/layout/includes/widgets/aside/asideArchive.pug +5 -3
- package/layout/includes/widgets/aside/asideCustom.pug +6 -0
- package/layout/includes/widgets/aside/asideHistory.pug +3 -3
- package/layout/includes/widgets/aside/asideInfoCard.pug +4 -6
- package/layout/includes/widgets/aside/asideNewestPost.pug +1 -1
- package/layout/includes/widgets/aside/asideSwitch.pug +0 -11
- package/layout/includes/widgets/aside/asideTag.pug +2 -2
- package/layout/includes/widgets/aside/asideToc.pug +1 -1
- package/layout/includes/widgets/aside/asideWebInfo.pug +6 -6
- package/layout/includes/widgets/aside/asideWelcome.pug +1 -1
- package/layout/includes/widgets/home/banner.pug +2 -2
- package/layout/includes/widgets/home/bbTimeList.pug +3 -3
- package/layout/includes/widgets/home/categoryBar.pug +3 -3
- package/layout/includes/widgets/home/categoryGroup.pug +2 -2
- package/layout/includes/widgets/home/hometop.pug +7 -7
- package/layout/includes/widgets/home/postList.pug +12 -8
- package/layout/includes/widgets/home/topGroup.pug +17 -13
- package/layout/includes/widgets/nav/left.pug +6 -6
- package/layout/includes/widgets/nav/menu.pug +4 -4
- package/layout/includes/widgets/nav/right.pug +14 -14
- package/layout/includes/widgets/page/about/authorinfo.pug +1 -1
- package/layout/includes/widgets/page/about/award.pug +11 -9
- package/layout/includes/widgets/page/about/contentinfo.pug +7 -7
- package/layout/includes/widgets/page/about/hobbies.pug +1 -1
- package/layout/includes/widgets/page/about/motto.pug +2 -2
- package/layout/includes/widgets/page/about/other.pug +10 -9
- package/layout/includes/widgets/page/about/personalities.pug +2 -2
- package/layout/includes/widgets/page/about/skillsinfo.pug +10 -12
- package/layout/includes/widgets/page/about/tenyear.pug +48 -0
- package/layout/includes/widgets/page/banner.pug +2 -2
- package/layout/includes/widgets/page/links/banner.pug +12 -14
- package/layout/includes/widgets/page/links/linksItem.pug +0 -1
- package/layout/includes/widgets/page/moments/angle.pug +7 -12
- package/layout/includes/widgets/page/moments/index.pug +7 -2
- package/layout/includes/widgets/post/award.pug +12 -8
- package/layout/includes/widgets/post/copyright.pug +16 -14
- package/layout/includes/widgets/post/postMeta.pug +36 -25
- package/layout/includes/widgets/post/postNav.pug +15 -15
- package/layout/includes/widgets/randomlink.pug +10 -5
- package/layout/includes/widgets/rightside/index.pug +9 -8
- package/layout/includes/widgets/third-party/ai/index.pug +12 -0
- package/layout/includes/widgets/third-party/comments/comment.pug +6 -1
- package/layout/includes/widgets/third-party/comments/twikoo.pug +5 -4
- package/layout/includes/widgets/third-party/comments/waline.pug +4 -5
- package/layout/includes/widgets/third-party/music.pug +1 -1
- package/layout/includes/widgets/third-party/pjax.pug +6 -1
- package/layout/includes/widgets/third-party/search/algolia-search.pug +4 -3
- package/layout/includes/widgets/third-party/search/index.pug +2 -2
- package/layout/includes/widgets/third-party/search/local-search.pug +3 -3
- package/layout/index.pug +5 -6
- package/layout/page.pug +34 -29
- package/layout/post.pug +3 -23
- package/layout/tag.pug +3 -3
- package/package.json +2 -2
- package/scripts/filter/checkThemeConfig.js +0 -5
- package/scripts/helper/cdn.js +12 -0
- package/scripts/helper/page.js +13 -0
- package/scripts/helper/related_post.js +0 -1
- package/scripts/tags/button.js +21 -0
- package/scripts/tags/card.js +9 -0
- package/scripts/tags/checkbox.js +51 -0
- package/scripts/tags/fold.js +0 -5
- package/scripts/tags/image.js +75 -0
- package/scripts/tags/inline-image.js +12 -0
- package/scripts/tags/label.js +10 -0
- package/scripts/tags/link.js +2 -0
- package/scripts/tags/media.js +29 -0
- package/scripts/tags/span.js +17 -0
- package/scripts/tags/timeline.js +2 -15
- package/scripts/tags/u.js +7 -0
- package/source/css/_global/animation.css +57 -0
- package/source/css/_global/index.styl +5 -20
- package/source/css/_global/var.styl +16 -1
- package/source/css/_layout/{base.styl → basic.styl} +24 -116
- package/source/css/_layout/header.styl +203 -615
- package/source/css/_layout/index.styl +29 -271
- package/source/css/_mode/index.styl +87 -94
- package/source/css/_page/_home/category-bar.styl +74 -0
- package/source/css/_page/_home/home-top.styl +541 -0
- package/source/css/_page/_home/index.styl +15 -0
- package/source/css/_page/_home/pagination.styl +176 -0
- package/source/css/_page/_home/recent-post.styl +204 -0
- package/source/css/_page/about/index.styl +1 -0
- package/source/css/_page/about/tenyear.styl +56 -0
- package/source/css/_page/about.styl +555 -626
- package/source/css/_page/category.styl +95 -119
- package/source/css/_page/douban.styl +126 -0
- package/source/css/_page/equipment.styl +100 -99
- package/source/css/_page/error.styl +130 -146
- package/source/css/_page/home.styl +41 -50
- package/source/css/_page/index.styl +42 -10
- package/source/css/_page/links.styl +305 -0
- package/source/css/_page/moment.styl +51 -51
- package/source/css/_page/music.styl +506 -0
- package/source/css/_page/rss.styl +62 -67
- package/source/css/_page/says.styl +375 -344
- package/source/css/_page/tag.styl +15 -13
- package/source/css/_widgets/{aside → _aside}/flip.styl +7 -5
- package/source/css/_widgets/{aside → _aside}/history.styl +9 -2
- package/source/css/_widgets/_aside/index.styl +96 -0
- package/source/css/_widgets/{aside → _aside}/info.styl +86 -89
- package/source/css/_widgets/{aside → _aside}/newPost.styl +7 -1
- package/source/css/_widgets/{aside → _aside}/toc.styl +28 -5
- package/source/css/_widgets/{comment → _comment}/index.styl +4 -12
- package/source/css/_widgets/{comment → _comment}/twikoo.styl +5 -2
- package/source/css/_widgets/{comment → _comment}/waline.styl +21 -5
- package/source/css/{_extra → _widgets/_extra}/console.styl +33 -10
- package/source/css/_widgets/_extra/fullpage.styl +46 -0
- package/source/css/_widgets/_extra/music.styl +218 -0
- package/source/css/_widgets/_extra/pace.styl +39 -0
- package/source/css/_widgets/_extra/rightmenu.styl +78 -0
- package/source/css/_widgets/_mixins/article-sort.styl +93 -0
- package/source/css/_widgets/_mixins/footer.styl +273 -0
- package/source/css/_widgets/_mixins/other.styl +34 -0
- package/source/css/_widgets/_mixins/sidebar.styl +230 -0
- package/source/css/_widgets/_post/_highlight/diff.styl +75 -0
- package/source/css/_widgets/_post/_highlight/index.styl +144 -0
- package/source/css/_widgets/_post/_highlight/theme/default.styl +12 -0
- package/source/css/_widgets/_post/_highlight/theme/mac.styl +25 -0
- package/source/css/_widgets/_post/_highlight/theme.styl +68 -0
- package/source/css/_widgets/_post/commentBarrage.styl +144 -0
- package/source/css/_widgets/_post/content.styl +152 -0
- package/source/css/_widgets/_post/copyright.styl +98 -0
- package/source/css/_widgets/_post/index.styl +20 -0
- package/source/css/_widgets/_post/meta.styl +420 -0
- package/source/css/_widgets/_post/pagination.styl +177 -0
- package/source/css/_widgets/_post/postAI.styl +131 -0
- package/source/css/{_post → _widgets/_post}/relatedPost.styl +4 -1
- package/source/css/_widgets/_post/tools.styl +249 -0
- package/source/css/{_search → _widgets/_search}/algolia-search.styl +4 -0
- package/source/css/{_search → _widgets/_search}/local-search.styl +15 -5
- package/source/css/_widgets/_tags/button.styl +60 -0
- package/source/css/_widgets/_tags/bvideo.styl +8 -0
- package/source/css/_widgets/_tags/card.styl +52 -0
- package/source/css/_widgets/_tags/checkbox.styl +85 -0
- package/source/css/_widgets/_tags/fold.styl +79 -0
- package/source/css/_widgets/_tags/image.styl +10 -0
- package/source/css/_widgets/_tags/index.styl +61 -0
- package/source/css/_widgets/_tags/inline-image.styl +6 -0
- package/source/css/_widgets/_tags/label.styl +3 -0
- package/source/css/_widgets/_tags/link.styl +80 -0
- package/source/css/_widgets/_tags/note.styl +101 -0
- package/source/css/_widgets/_tags/span.styl +61 -0
- package/source/css/_widgets/_tags/tabs.styl +105 -0
- package/source/css/_widgets/_tags/timeline.styl +80 -0
- package/source/css/_widgets/index.styl +50 -1
- package/source/css/index.styl +0 -25
- package/source/js/{commentBarrage.js → extend/comment/twikoo/commentBarrage.js} +0 -4
- package/source/js/extend/comment/{twikoo.js → twikoo/twikoo.js} +12 -40
- package/source/js/extend/comment/waline/commentBarrage.js +155 -0
- package/source/js/extend/comment/{waline.js → waline/waline.js} +10 -11
- package/source/js/extend/search/algolia-search.js +1 -5
- package/source/js/extend/search/local-search.js +33 -13
- package/source/js/main.js +144 -163
- package/source/js/music.js +129 -0
- package/source/js/utils.js +4 -7
- package/source/lib/cover-color.min.js +7 -0
- package/source/lib/rightside.min.js +1 -0
- package/source/lib/sco-ai.min.js +8 -0
- package/source/lib/snackbar.min.css +1 -1
- package/source/lib/txmap.min.js +1 -0
- package/source/lib/view-image.min.js +1 -1
- package/layout/includes/widgets/aside/asidePower.pug +0 -19
- package/layout/includes/widgets/home/rencentPost.pug +0 -26
- package/source/css/_extra/rightmenu.styl +0 -83
- package/source/css/_layout/articleSort.styl +0 -199
- package/source/css/_layout/footer.styl +0 -359
- package/source/css/_layout/sidebar.styl +0 -226
- package/source/css/_page/homeTop.styl +0 -1035
- package/source/css/_page/link.styl +0 -433
- package/source/css/_post/commentBarrage.styl +0 -149
- package/source/css/_post/externalTags.styl +0 -694
- package/source/css/_post/highlight.styl +0 -96
- package/source/css/_post/index.styl +0 -935
- package/source/css/_post/pagination.styl +0 -467
- package/source/css/_post/postContent.styl +0 -957
- package/source/css/_post/reward.styl +0 -217
- package/source/css/_widgets/aside/index.styl +0 -156
- package/source/css/_widgets/aside/power.styl +0 -90
- package/source/img/logo-horizontal_version.png +0 -0
- package/source/img/pwa/16.png +0 -0
- package/source/img/pwa/180.png +0 -0
- package/source/img/pwa/192.png +0 -0
- package/source/img/pwa/32.png +0 -0
- package/source/img/pwa/512.png +0 -0
- package/source/img/pwa/logo.png +0 -0
- package/source/img/pwa/siteicon/splash-1125x2436.png +0 -0
- package/source/img/pwa/siteicon/splash-1136x640.png +0 -0
- package/source/img/pwa/siteicon/splash-1170x2532.png +0 -0
- package/source/img/pwa/siteicon/splash-1179x2556.png +0 -0
- package/source/img/pwa/siteicon/splash-1242x2208.png +0 -0
- package/source/img/pwa/siteicon/splash-1242x2688.png +0 -0
- package/source/img/pwa/siteicon/splash-1248x2778.png +0 -0
- package/source/img/pwa/siteicon/splash-1290x2796.png +0 -0
- package/source/img/pwa/siteicon/splash-1334x750.png +0 -0
- package/source/img/pwa/siteicon/splash-1536x2048.png +0 -0
- package/source/img/pwa/siteicon/splash-1620x2160.png +0 -0
- package/source/img/pwa/siteicon/splash-1668x2224.png +0 -0
- package/source/img/pwa/siteicon/splash-1668x2388.png +0 -0
- package/source/img/pwa/siteicon/splash-1792x828.png +0 -0
- package/source/img/pwa/siteicon/splash-2048x1536.png +0 -0
- package/source/img/pwa/siteicon/splash-2048x2732.png +0 -0
- package/source/img/pwa/siteicon/splash-2160x1620.png +0 -0
- package/source/img/pwa/siteicon/splash-2208x1242.png +0 -0
- package/source/img/pwa/siteicon/splash-2224x1668.png +0 -0
- package/source/img/pwa/siteicon/splash-2388x1668.png +0 -0
- package/source/img/pwa/siteicon/splash-2436x1125.png +0 -0
- package/source/img/pwa/siteicon/splash-2532x1170.png +0 -0
- package/source/img/pwa/siteicon/splash-2556x1179.png +0 -0
- package/source/img/pwa/siteicon/splash-2688x1242.png +0 -0
- package/source/img/pwa/siteicon/splash-2732x2048.png +0 -0
- package/source/img/pwa/siteicon/splash-2778x1248.png +0 -0
- package/source/img/pwa/siteicon/splash-2796x1290.png +0 -0
- package/source/img/pwa/siteicon/splash-640x1136.png +0 -0
- package/source/img/pwa/siteicon/splash-750x1334.png +0 -0
- package/source/img/pwa/siteicon/splash-828x1792.png +0 -0
- package/source/img/solitude-show.jpg +0 -0
- package/source/js/extend/covercolor/local.js +0 -160
- package/source/js/rightside.js +0 -402
- package/source/js/txmap.js +0 -236
- package/source/lib/chuckle-post-ai.js +0 -1
- /package/source/css/_widgets/{aside → _aside}/allinfo.styl +0 -0
- /package/source/css/_widgets/{aside → _aside}/welcome.styl +0 -0
- /package/source/img/{theme/avatar.png → avatar.png} +0 -0
package/source/js/main.js
CHANGED
@@ -1,33 +1,3 @@
|
|
1
|
-
const adjustMenu = (change = false) => {
|
2
|
-
const $blogName = document.getElementById('site-name')
|
3
|
-
let blogNameWidth = $blogName && $blogName.offsetWidth
|
4
|
-
const $menusEle = document.querySelector('#menus .menus_items')
|
5
|
-
let menusWidth = $menusEle && $menusEle.offsetWidth
|
6
|
-
const $searchEle = document.querySelector('#search-button')
|
7
|
-
let searchWidth = $searchEle && $searchEle.offsetWidth
|
8
|
-
if (change) {
|
9
|
-
blogNameWidth = $blogName && $blogName.offsetWidth
|
10
|
-
menusWidth = $menusEle && $menusEle.offsetWidth
|
11
|
-
searchWidth = $searchEle && $searchEle.offsetWidth
|
12
|
-
}
|
13
|
-
const $nav = document.getElementById('nav')
|
14
|
-
let t
|
15
|
-
if (window.innerWidth < 768) t = true
|
16
|
-
else t = blogNameWidth + menusWidth + searchWidth > $nav.offsetWidth - 120
|
17
|
-
|
18
|
-
if (t) {
|
19
|
-
$nav.classList.add('hide-menu')
|
20
|
-
} else {
|
21
|
-
$nav.classList.remove('hide-menu')
|
22
|
-
}
|
23
|
-
}
|
24
|
-
|
25
|
-
// 初始化header
|
26
|
-
const initAdjust = () => {
|
27
|
-
adjustMenu()
|
28
|
-
document.getElementById('nav').classList.add('show')
|
29
|
-
}
|
30
|
-
|
31
1
|
/**
|
32
2
|
* side menu
|
33
3
|
*/
|
@@ -37,8 +7,6 @@ const sidebarFn = () => {
|
|
37
7
|
const $menuMask = document.getElementById('menu-mask')
|
38
8
|
const $body = document.body
|
39
9
|
|
40
|
-
const isOpen = () => $mobileSidebarMenus.classList.contains('open')
|
41
|
-
|
42
10
|
function openMobileSidebar() {
|
43
11
|
utils.sidebarPaddingR()
|
44
12
|
$body.style.overflow = 'hidden'
|
@@ -55,15 +23,15 @@ const sidebarFn = () => {
|
|
55
23
|
|
56
24
|
$toggleMenu.addEventListener('click', openMobileSidebar)
|
57
25
|
|
58
|
-
$menuMask.addEventListener('click',
|
59
|
-
if (
|
26
|
+
$menuMask.addEventListener('click', e => {
|
27
|
+
if ($mobileSidebarMenus.classList.contains('open')) {
|
60
28
|
closeMobileSidebar()
|
61
29
|
}
|
62
30
|
})
|
63
31
|
|
64
|
-
window.addEventListener('resize',
|
65
|
-
if (utils.isHidden($toggleMenu)
|
66
|
-
closeMobileSidebar()
|
32
|
+
window.addEventListener('resize', e => {
|
33
|
+
if (utils.isHidden($toggleMenu)) {
|
34
|
+
if ($mobileSidebarMenus.classList.contains('open')) closeMobileSidebar()
|
67
35
|
}
|
68
36
|
})
|
69
37
|
}
|
@@ -82,15 +50,16 @@ const scrollFn = function () {
|
|
82
50
|
const isDown = scrollDirection(currentTop);
|
83
51
|
|
84
52
|
if (currentTop > 0) {
|
85
|
-
$header.classList.add('nav-fixed');
|
86
53
|
if (isDown) {
|
87
54
|
if ($header.classList.contains('nav-visible')) $header.classList.remove('nav-visible');
|
88
55
|
} else {
|
89
56
|
if (!$header.classList.contains('nav-visible')) $header.classList.add('nav-visible');
|
90
57
|
}
|
58
|
+
$header.classList.add('nav-fixed');
|
91
59
|
} else {
|
92
60
|
$header.classList.remove('nav-fixed', 'nav-visible');
|
93
61
|
}
|
62
|
+
|
94
63
|
percent();
|
95
64
|
}, 200));
|
96
65
|
|
@@ -118,7 +87,7 @@ const percent = () => {
|
|
118
87
|
} else {
|
119
88
|
document.querySelector("#nav-totop").classList.remove("long")
|
120
89
|
if (scrollPercent >= 0) {
|
121
|
-
percentElement.innerHTML = scrollPercent
|
90
|
+
percentElement.innerHTML = scrollPercent + ""
|
122
91
|
}
|
123
92
|
}
|
124
93
|
|
@@ -187,10 +156,10 @@ const initObserver = () => {
|
|
187
156
|
entries.forEach(function (entry) {
|
188
157
|
if (entry.isIntersecting) {
|
189
158
|
paginationElement.classList.add("show-window");
|
190
|
-
document.querySelector(".comment-barrage").style.bottom = "-200px";
|
159
|
+
GLOBAL_CONFIG.comment.commentBarrage && (document.querySelector(".comment-barrage").style.bottom = "-200px");
|
191
160
|
} else {
|
192
161
|
paginationElement.classList.remove("show-window");
|
193
|
-
document.querySelector(".comment-barrage").style.bottom = "0px";
|
162
|
+
GLOBAL_CONFIG.comment.commentBarrage && (document.querySelector(".comment-barrage").style.bottom = "0px");
|
194
163
|
}
|
195
164
|
});
|
196
165
|
}
|
@@ -223,7 +192,7 @@ class toc {
|
|
223
192
|
const $tocContent = document.getElementById('toc-content')
|
224
193
|
const list = $article.querySelectorAll('h1,h2,h3,h4,h5,h6')
|
225
194
|
let detectItem = ''
|
226
|
-
|
195
|
+
function autoScroll(el) {
|
227
196
|
const activePosition = el.getBoundingClientRect().top
|
228
197
|
const sidebarScrollTop = $tocContent.scrollTop
|
229
198
|
if (activePosition > (document.documentElement.clientHeight - 100)) {
|
@@ -233,16 +202,19 @@ class toc {
|
|
233
202
|
$tocContent.scrollTop = sidebarScrollTop - 150
|
234
203
|
}
|
235
204
|
}
|
236
|
-
|
205
|
+
function findHeadPosition(top) {
|
237
206
|
if (top === 0) {
|
238
207
|
return false
|
239
208
|
}
|
209
|
+
|
240
210
|
let currentIndex = ''
|
241
|
-
|
211
|
+
|
212
|
+
list.forEach(function (ele, index) {
|
242
213
|
if (top > utils.getEleTop(ele) - 80) {
|
243
214
|
currentIndex = index
|
244
215
|
}
|
245
216
|
})
|
217
|
+
|
246
218
|
if (detectItem === currentIndex) return
|
247
219
|
detectItem = currentIndex
|
248
220
|
document.querySelectorAll('.toc .active').forEach((i) => {
|
@@ -250,19 +222,19 @@ class toc {
|
|
250
222
|
})
|
251
223
|
const activeitem = toc[detectItem]
|
252
224
|
if (activeitem) {
|
225
|
+
let parent = toc[detectItem].parentNode
|
253
226
|
activeitem.classList.add('active')
|
254
227
|
autoScroll(activeitem)
|
255
|
-
|
256
|
-
while (!parent.matches('.toc')) {
|
228
|
+
for (; !parent.matches('.toc'); parent = parent.parentNode) {
|
257
229
|
if (parent.matches('li')) parent.classList.add('active')
|
258
|
-
parent = parent.parentNode
|
259
230
|
}
|
260
231
|
}
|
261
232
|
}
|
262
|
-
window.tocScrollFn = utils.throttle(()
|
233
|
+
window.tocScrollFn = utils.throttle(function () {
|
263
234
|
const currentTop = window.scrollY || document.documentElement.scrollTop
|
264
235
|
findHeadPosition(currentTop)
|
265
236
|
}, 100)
|
237
|
+
|
266
238
|
window.addEventListener('scroll', tocScrollFn)
|
267
239
|
}
|
268
240
|
}
|
@@ -443,12 +415,12 @@ let sco = {
|
|
443
415
|
'light'
|
444
416
|
if (nowMode === 'light') {
|
445
417
|
document.documentElement.setAttribute('data-theme', 'dark')
|
446
|
-
saveToLocal.set('theme', 'dark', 0.
|
418
|
+
saveToLocal.set('theme', 'dark', 0.02);
|
447
419
|
utils.snackbarShow(GLOBAL_CONFIG.lang.theme.dark, false, 2000)
|
448
420
|
document.querySelector(".menu-darkmode-text").textContent = "深色模式";
|
449
421
|
} else {
|
450
422
|
document.documentElement.setAttribute('data-theme', 'light')
|
451
|
-
saveToLocal.set('theme', 'light', 0.
|
423
|
+
saveToLocal.set('theme', 'light', 0.02);
|
452
424
|
utils.snackbarShow(GLOBAL_CONFIG.lang.theme.light, false, 2000)
|
453
425
|
document.querySelector(".menu-darkmode-text").textContent = "浅色模式";
|
454
426
|
}
|
@@ -490,23 +462,15 @@ let sco = {
|
|
490
462
|
* 初始化
|
491
463
|
*/
|
492
464
|
initTheme: function () {
|
493
|
-
let isDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
document.documentElement.setAttribute('data-theme', cachedMode);
|
503
|
-
}
|
504
|
-
} catch (e) {
|
505
|
-
if (isDarkMode) {
|
506
|
-
saveToLocal.set('theme', 'dark', 0.5)
|
507
|
-
} else {
|
508
|
-
saveToLocal.set('theme', 'light', 0.5)
|
509
|
-
}
|
465
|
+
let isDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches
|
466
|
+
const cachedMode = saveToLocal.get('theme');
|
467
|
+
if (cachedMode === undefined) {
|
468
|
+
const nowMode =
|
469
|
+
isDarkMode ? 'dark' : 'light'
|
470
|
+
document.documentElement.setAttribute('data-theme', nowMode);
|
471
|
+
saveToLocal.set('theme', nowMode, 0.2);
|
472
|
+
} else {
|
473
|
+
document.documentElement.setAttribute('data-theme', cachedMode);
|
510
474
|
}
|
511
475
|
},
|
512
476
|
/**
|
@@ -547,14 +511,17 @@ let sco = {
|
|
547
511
|
* @param txt
|
548
512
|
*/
|
549
513
|
toTalk: function (txt) {
|
550
|
-
const
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
514
|
+
const inputs = ["#wl-edit", ".el-textarea__inner"]
|
515
|
+
for (let i = 0; i < inputs.length; i++) {
|
516
|
+
let el = document.querySelector(inputs[i])
|
517
|
+
if (el != null) {
|
518
|
+
el.dispatchEvent(new Event('input', { bubble: true, cancelable: true }))
|
519
|
+
el.value = '> ' + txt.replace(/\n/g, '\n> ') + '\n\n'
|
520
|
+
utils.scrollToDest(utils.getEleTop(document.getElementById('post-comment')), 300)
|
521
|
+
el.focus()
|
522
|
+
el.setSelectionRange(-1, -1)
|
523
|
+
}
|
524
|
+
}
|
558
525
|
const commentTips = document.querySelector("#comment-tips");
|
559
526
|
if (commentTips) {
|
560
527
|
commentTips.classList.add("show");
|
@@ -576,7 +543,7 @@ let sco = {
|
|
576
543
|
}
|
577
544
|
},
|
578
545
|
/**
|
579
|
-
*
|
546
|
+
* 图片添加底部展示信息
|
580
547
|
*/
|
581
548
|
addPhotoFigcaption: function () {
|
582
549
|
let images = document.querySelectorAll('#article-container img');
|
@@ -596,42 +563,39 @@ let sco = {
|
|
596
563
|
/**
|
597
564
|
* 下载图片并添加水印
|
598
565
|
*/
|
599
|
-
downloadImage:
|
600
|
-
rm.hideRightMenu();
|
566
|
+
downloadImage: function (imageUrl, filename = 'photo') {
|
601
567
|
if (rm.downloadimging) {
|
602
568
|
utils.snackbarShow("有正在进行中的下载,请稍后再试");
|
603
569
|
return;
|
604
570
|
}
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
img.src = url;
|
629
|
-
} catch (error) {
|
630
|
-
console.error(error);
|
631
|
-
utils.snackbarShow("下载图片时出错");
|
571
|
+
|
572
|
+
rm.hideRightMenu();
|
573
|
+
rm.downloadimging = true;
|
574
|
+
utils.snackbarShow("正在下载中,请稍后", false, 10000);
|
575
|
+
|
576
|
+
let img = new Image();
|
577
|
+
img.setAttribute("crossOrigin", "anonymous");
|
578
|
+
img.onload = function () {
|
579
|
+
let canvas = document.createElement("canvas");
|
580
|
+
canvas.width = img.width;
|
581
|
+
canvas.height = img.height;
|
582
|
+
let ctx = canvas.getContext("2d");
|
583
|
+
ctx.drawImage(img, 0, 0, img.width, img.height);
|
584
|
+
|
585
|
+
let dataUrl = canvas.toDataURL("image/png");
|
586
|
+
let link = document.createElement("a");
|
587
|
+
link.download = filename;
|
588
|
+
link.href = dataUrl;
|
589
|
+
|
590
|
+
let clickEvent = new MouseEvent("click");
|
591
|
+
link.dispatchEvent(clickEvent);
|
592
|
+
|
593
|
+
utils.snackbarShow("图片已添加盲水印,请遵守版权协议");
|
632
594
|
rm.downloadimging = false;
|
633
|
-
}
|
595
|
+
};
|
596
|
+
img.src = imageUrl;
|
634
597
|
},
|
598
|
+
|
635
599
|
/**
|
636
600
|
* 音乐播放暂停
|
637
601
|
*/
|
@@ -679,27 +643,6 @@ let sco = {
|
|
679
643
|
scrollToComment: function () {
|
680
644
|
utils.scrollToDest(utils.getEleTop(document.getElementById('post-comment')), 300)
|
681
645
|
},
|
682
|
-
/**
|
683
|
-
* 一些日子灰色页面
|
684
|
-
*/
|
685
|
-
setFest: function () {
|
686
|
-
const date = new Date();
|
687
|
-
const currentDate = `${date.getMonth() + 1}.${date.getDate()}`;
|
688
|
-
|
689
|
-
const specialDates = ['1.8', '9.9', '7.7', '9.18', '12.13'];
|
690
|
-
|
691
|
-
if (specialDates.includes(currentDate)) {
|
692
|
-
const css = `
|
693
|
-
html {
|
694
|
-
filter: grayscale(100%);
|
695
|
-
}
|
696
|
-
`;
|
697
|
-
|
698
|
-
const styleElement = document.createElement('style');
|
699
|
-
styleElement.textContent = css;
|
700
|
-
document.head.appendChild(styleElement);
|
701
|
-
}
|
702
|
-
},
|
703
646
|
/**
|
704
647
|
* 个人信息顶部文字更新
|
705
648
|
*/
|
@@ -710,11 +653,11 @@ let sco = {
|
|
710
653
|
const hours = timeNow.getHours();
|
711
654
|
const lang = GLOBAL_CONFIG.lang.sayhello;
|
712
655
|
const greetings = [
|
713
|
-
{start: 0, end: 5, text: lang.goodnight},
|
714
|
-
{start: 6, end: 10, text: lang.morning},
|
715
|
-
{start: 11, end: 14, text: lang.noon},
|
716
|
-
{start: 15, end: 18, text: lang.afternoon},
|
717
|
-
{start: 19, end: 24, text: lang.night},
|
656
|
+
{ start: 0, end: 5, text: lang.goodnight },
|
657
|
+
{ start: 6, end: 10, text: lang.morning },
|
658
|
+
{ start: 11, end: 14, text: lang.noon },
|
659
|
+
{ start: 15, end: 18, text: lang.afternoon },
|
660
|
+
{ start: 19, end: 24, text: lang.night },
|
718
661
|
];
|
719
662
|
for (let greeting of greetings) {
|
720
663
|
if (hours >= greeting.start && hours <= greeting.end) {
|
@@ -882,6 +825,35 @@ let sco = {
|
|
882
825
|
}
|
883
826
|
}
|
884
827
|
},
|
828
|
+
/**
|
829
|
+
* 初始化Header
|
830
|
+
* @param change
|
831
|
+
*/
|
832
|
+
initAdjust: function (change = false) {
|
833
|
+
const $blogName = document.getElementById('site-name')
|
834
|
+
let blogNameWidth = $blogName && $blogName.offsetWidth
|
835
|
+
const $menusEle = document.querySelector('#menus .menus_items')
|
836
|
+
let menusWidth = $menusEle && $menusEle.offsetWidth
|
837
|
+
const $searchEle = document.querySelector('#search-button')
|
838
|
+
let searchWidth = $searchEle && $searchEle.offsetWidth
|
839
|
+
if (change) {
|
840
|
+
blogNameWidth = $blogName && $blogName.offsetWidth
|
841
|
+
menusWidth = $menusEle && $menusEle.offsetWidth
|
842
|
+
searchWidth = $searchEle && $searchEle.offsetWidth
|
843
|
+
}
|
844
|
+
const $nav = document.getElementById('nav')
|
845
|
+
let t
|
846
|
+
if (window.innerWidth < 768) t = true
|
847
|
+
else t = blogNameWidth + menusWidth + searchWidth > $nav?.offsetWidth - 120
|
848
|
+
|
849
|
+
if (t) {
|
850
|
+
$nav?.classList.add('hide-menu')
|
851
|
+
} else {
|
852
|
+
$nav?.classList.remove('hide-menu')
|
853
|
+
}
|
854
|
+
|
855
|
+
document.getElementById('nav')?.classList.add('show')
|
856
|
+
},
|
885
857
|
/**
|
886
858
|
* 首页分页跳转
|
887
859
|
*/
|
@@ -904,6 +876,25 @@ let sco = {
|
|
904
876
|
document.getElementById("toPageButton").href = targetPageUrl;
|
905
877
|
}
|
906
878
|
},
|
879
|
+
addRandomCommentInfo: function () {
|
880
|
+
const e = `${GLOBAL_CONFIG.comment.randomInfoStart[Math.floor(Math.random() * GLOBAL_CONFIG.comment.randomInfoStart.length)]}${GLOBAL_CONFIG.comment.randomInfoEnd[Math.floor(Math.random() * GLOBAL_CONFIG.comment.randomInfoEnd.length)]}`;
|
881
|
+
|
882
|
+
const nameSelectors = ["#author", "input[name='comname']", "#inpName", "input[name='author']", "#ds-dialog-name", "#name", "input[name='nick']", "#comment_author"];
|
883
|
+
const emailSelectors = ["#mail", "#email", "input[name='commail']", "#inpEmail", "input[name='email']", "#ds-dialog-email", "input[name='mail']", "#comment_email"];
|
884
|
+
|
885
|
+
const nameElements = nameSelectors.map(selector => document.querySelector(selector)).filter(Boolean);
|
886
|
+
const emailElements = emailSelectors.map(selector => document.querySelector(selector)).filter(Boolean);
|
887
|
+
|
888
|
+
nameElements.forEach(element => {
|
889
|
+
element.value = e;
|
890
|
+
element.dispatchEvent(new Event("input"));
|
891
|
+
});
|
892
|
+
|
893
|
+
emailElements.forEach(element => {
|
894
|
+
element.value = "donotreply@examp.com";
|
895
|
+
element.dispatchEvent(new Event("input"));
|
896
|
+
});
|
897
|
+
}
|
907
898
|
}
|
908
899
|
|
909
900
|
/*
|
@@ -912,13 +903,13 @@ let sco = {
|
|
912
903
|
class hightlight {
|
913
904
|
static createEle(langEl, item) {
|
914
905
|
const fragment = document.createDocumentFragment()
|
915
|
-
const highlightCopyEle = '<i class="scoicon sco-copy-fill"></i>'
|
916
|
-
const highlightExpandEle = '<i class="scoicon sco-arrow-down expand"
|
906
|
+
const highlightCopyEle = GLOBAL_CONFIG.hightlight.copy ? '<i class="scoicon sco-copy-fill"></i>' : '<i></i>'
|
907
|
+
const highlightExpandEle = '<i class="scoicon sco-arrow-down expand"></i>'
|
917
908
|
|
918
909
|
const hlTools = document.createElement('div')
|
919
910
|
hlTools.className = `highlight-tools`
|
920
911
|
hlTools.innerHTML = highlightExpandEle + langEl + highlightCopyEle
|
921
|
-
let expand =
|
912
|
+
let expand = GLOBAL_CONFIG.hightlight.expand
|
922
913
|
hlTools.children[0].addEventListener('click', (e) => {
|
923
914
|
if (expand) {
|
924
915
|
hlTools.children[0].classList.add('closed')
|
@@ -954,11 +945,13 @@ class hightlight {
|
|
954
945
|
ele.innerHTML = '<i class="scoicon sco-show-line" style="font-size: 1.2rem"></i>'
|
955
946
|
ele.addEventListener('click', (e) => {
|
956
947
|
$table.setAttribute('style', `height: ${itemHeight}px`)
|
957
|
-
e.target.
|
948
|
+
e.target.classList.add('expand-done')
|
949
|
+
e.target.setAttribute('style', 'display:none')
|
958
950
|
})
|
959
951
|
fragment.appendChild(ele)
|
960
952
|
}
|
961
953
|
item.insertBefore(fragment, item.firstChild)
|
954
|
+
hlTools.children[0].click()
|
962
955
|
}
|
963
956
|
|
964
957
|
static init() {
|
@@ -1003,14 +996,14 @@ class tabs {
|
|
1003
996
|
document.querySelectorAll('#article-container .tabs .tab-to-top').forEach(function (item) {
|
1004
997
|
item.addEventListener('click', function () {
|
1005
998
|
utils.scrollToDest(utils.getEleTop(item.parentElement.parentElement.parentNode), 300)
|
999
|
+
|
1006
1000
|
})
|
1007
1001
|
})
|
1008
1002
|
}
|
1009
1003
|
}
|
1010
1004
|
|
1011
1005
|
window.refreshFn = () => {
|
1012
|
-
|
1013
|
-
initAdjust()
|
1006
|
+
sco.initAdjust()
|
1014
1007
|
scrollFn()
|
1015
1008
|
sidebarFn()
|
1016
1009
|
changeTimeFormat()
|
@@ -1018,7 +1011,6 @@ window.refreshFn = () => {
|
|
1018
1011
|
sco.addRuntime()
|
1019
1012
|
sco.hideCookie()
|
1020
1013
|
sco.addPhotoFigcaption()
|
1021
|
-
sco.setFest()
|
1022
1014
|
sco.setTimeState()
|
1023
1015
|
sco.tagPageActive()
|
1024
1016
|
sco.categoriesBarActive()
|
@@ -1028,26 +1020,19 @@ window.refreshFn = () => {
|
|
1028
1020
|
GLOBAL_CONFIG.lazyload.enable && sco.lazyloadImg()
|
1029
1021
|
GLOBAL_CONFIG.lightbox && sco.lightbox('')
|
1030
1022
|
GLOBAL_CONFIG.randomlinks && randomLinksList()
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
1034
|
-
PAGE_CONFIG.
|
1035
|
-
|
1036
|
-
GLOBAL_CONFIG.hightlight.enable && hightlight.init()
|
1037
|
-
tabs.init()
|
1038
|
-
}
|
1039
|
-
if (PAGE_CONFIG.is_home) {
|
1040
|
-
showTodayCard()
|
1041
|
-
sco.initbbtalk()
|
1042
|
-
}
|
1043
|
-
GLOBAL_CONFIG.covercolor && coverColor();
|
1023
|
+
PAGE_CONFIG.comment && initComment()
|
1024
|
+
PAGE_CONFIG.toc && toc.init();
|
1025
|
+
(PAGE_CONFIG.is_post || PAGE_CONFIG.is_page) && ((GLOBAL_CONFIG.hightlight.enable && hightlight.init()) || tabs.init())
|
1026
|
+
PAGE_CONFIG.is_home && (showTodayCard() || sco.initbbtalk())
|
1027
|
+
GLOBAL_CONFIG.covercolor.enable && coverColor()
|
1044
1028
|
sco.initConsoleState()
|
1045
|
-
|
1046
|
-
|
1047
|
-
GLOBAL_CONFIG.comment.
|
1048
|
-
|
1049
|
-
|
1050
|
-
|
1029
|
+
document.getElementById('history-baidu') && sco.card_history()
|
1030
|
+
document.getElementById('welcome-info') && sco.card_welcome()
|
1031
|
+
GLOBAL_CONFIG.comment.commentBarrage && PAGE_CONFIG.comment && initializeCommentBarrage()
|
1032
|
+
document.body.setAttribute('data-type', PAGE_CONFIG.page)
|
1033
|
+
PAGE_CONFIG.page === "music" && scoMusic.init()
|
1034
|
+
GLOBAL_CONFIG.music.enable && !document.querySelector('#Music-page') && document.removeEventListener('keydown', scoMusic.setKeydown)
|
1035
|
+
GLOBAL_CONFIG.ai.enable && PAGE_CONFIG.page === "post" && ScoAI.init()
|
1051
1036
|
}
|
1052
1037
|
|
1053
1038
|
sco.initTheme()
|
@@ -1056,10 +1041,6 @@ document.addEventListener('DOMContentLoaded', function () {
|
|
1056
1041
|
window.refreshFn()
|
1057
1042
|
})
|
1058
1043
|
|
1059
|
-
document.addEventListener('pjax:complete', () => {
|
1060
|
-
window.refreshFn()
|
1061
|
-
})
|
1062
|
-
|
1063
1044
|
window.onkeydown = function (e) {
|
1064
1045
|
123 === e.keyCode && utils.snackbarShow("开发者模式已打开,请遵循GPL协议", !1, 3e3)
|
1065
|
-
}
|
1046
|
+
}
|
@@ -0,0 +1,129 @@
|
|
1
|
+
var vh = window.innerHeight * 1;
|
2
|
+
var scoMusic = {
|
3
|
+
// 获取地址栏参数
|
4
|
+
// 创建URLSearchParams对象并传入URL中的查询字符串
|
5
|
+
params: new URLSearchParams(window.location.search),
|
6
|
+
extractValue: function (input) {
|
7
|
+
var valueRegex = /\("([^\s]+)"\)/g;
|
8
|
+
var match = valueRegex.exec(input);
|
9
|
+
return match[1];
|
10
|
+
},
|
11
|
+
changeMusicBg: function (isChangeBg = true) {
|
12
|
+
const MusicBg = document.getElementById("Music-bg")
|
13
|
+
const MusicLoading = document.getElementsByClassName("Music-loading")
|
14
|
+
|
15
|
+
if (isChangeBg) {
|
16
|
+
const musiccover = document.querySelector("#Music-page .aplayer-pic");
|
17
|
+
var img = new Image();
|
18
|
+
img.src = scoMusic.extractValue(musiccover.style.backgroundImage);
|
19
|
+
img.onload = function () {
|
20
|
+
MusicBg.style.backgroundImage = musiccover.style.backgroundImage;
|
21
|
+
};
|
22
|
+
} else {
|
23
|
+
let timer = setInterval(() => {
|
24
|
+
const musiccover = document.querySelector("#Music-page .aplayer-pic");
|
25
|
+
// 确保player加载完成
|
26
|
+
if (musiccover) {
|
27
|
+
MusicLoading[0].style.display = "none";
|
28
|
+
clearInterval(timer)
|
29
|
+
document.querySelector('meting-js')
|
30
|
+
.aplayer.volume(0.8, true);
|
31
|
+
|
32
|
+
scoMusic.addEventListenerChangeMusicBg();
|
33
|
+
MusicBg.style.display = "block";
|
34
|
+
}
|
35
|
+
}, 100)
|
36
|
+
}
|
37
|
+
},
|
38
|
+
lrcupdate: function () {
|
39
|
+
var aplayerLrcContents = document.querySelector('.aplayer-lrc-contents');
|
40
|
+
var currentLrc = aplayerLrcContents.querySelector('p.aplayer-lrc-current');
|
41
|
+
|
42
|
+
if (currentLrc) {
|
43
|
+
var currentIndex = Array.from(aplayerLrcContents.children)
|
44
|
+
.indexOf(currentLrc);
|
45
|
+
var translateYValue = -currentIndex * 80;
|
46
|
+
|
47
|
+
aplayerLrcContents.style.transform = 'translateY(' + translateYValue + 'px)';
|
48
|
+
}
|
49
|
+
},
|
50
|
+
buttonlist: function () {
|
51
|
+
document.querySelector(".aplayer-lrc")
|
52
|
+
.addEventListener("click", function () {
|
53
|
+
const aplayerList = document.querySelector(".aplayer-list");
|
54
|
+
|
55
|
+
if (aplayerList.classList.contains("aplayer-list-hide")) {
|
56
|
+
aplayerList.classList.remove("aplayer-list-hide");
|
57
|
+
} else {
|
58
|
+
aplayerList.classList.add("aplayer-list-hide");
|
59
|
+
}
|
60
|
+
});
|
61
|
+
},
|
62
|
+
addEventListenerChangeMusicBg: function () {
|
63
|
+
const aplayer = document.getElementById("Music-page").querySelector("meting-js").aplayer
|
64
|
+
aplayer.on('loadeddata', function () {
|
65
|
+
scoMusic.changeMusicBg();
|
66
|
+
});
|
67
|
+
aplayer.on('timeupdate', function () {
|
68
|
+
scoMusic.lrcupdate();
|
69
|
+
});
|
70
|
+
scoMusic.buttonlist();
|
71
|
+
},
|
72
|
+
getCustomPlayList: function () {
|
73
|
+
const MusicPage = document.getElementById("Music-page");
|
74
|
+
const playlistType = scoMusic.params.get("type") || "playlist";
|
75
|
+
|
76
|
+
if (scoMusic.params.get("id") && params.get("server")) {
|
77
|
+
var id = scoMusic.params.get("id")
|
78
|
+
var server = scoMusic.params.get("server")
|
79
|
+
MusicPage.innerHTML = `<meting-js id="${id}" server="${server}" type="${playlistType}" preload="auto" order="random"></meting-js>`;
|
80
|
+
} else {
|
81
|
+
MusicPage.innerHTML = `<meting-js id="${musicConfig.userId}" server="${musicConfig.userServer}" type="${musicConfig.userType}" preload="auto" order="random"></meting-js>`;
|
82
|
+
}
|
83
|
+
scoMusic.changeMusicBg(false);
|
84
|
+
},
|
85
|
+
/**
|
86
|
+
* 绑定键盘事件
|
87
|
+
* @param event
|
88
|
+
*/
|
89
|
+
setKeydown: function (event) {
|
90
|
+
const aplayer = document.querySelector('meting-js').aplayer
|
91
|
+
if (event.code === "Space") {
|
92
|
+
event.preventDefault();
|
93
|
+
aplayer.toggle();
|
94
|
+
}
|
95
|
+
if (event.keyCode === 39) {
|
96
|
+
event.preventDefault();
|
97
|
+
aplayer.skipForward();
|
98
|
+
}
|
99
|
+
if (event.keyCode === 37) {
|
100
|
+
event.preventDefault();
|
101
|
+
aplayer.skipBack();
|
102
|
+
}
|
103
|
+
if (event.keyCode === 38) {
|
104
|
+
if (musicConfig.volume <= 1) {
|
105
|
+
musicConfig.volume += 0.1;
|
106
|
+
aplayer.volume(musicConfig.volume, true);
|
107
|
+
}
|
108
|
+
}
|
109
|
+
if (event.keyCode === 40) {
|
110
|
+
if (musicConfig.volume >= 0) {
|
111
|
+
musicConfig.volume += -0.1;
|
112
|
+
aplayer.volume(musicConfig.volume, true);
|
113
|
+
}
|
114
|
+
}
|
115
|
+
},
|
116
|
+
init: function () {
|
117
|
+
document.documentElement.style.setProperty('--vh', `${vh}px`);
|
118
|
+
// 初始化
|
119
|
+
this.getCustomPlayList();
|
120
|
+
|
121
|
+
//热键控制音乐
|
122
|
+
document.addEventListener("keydown", scoMusic.setKeydown);
|
123
|
+
}
|
124
|
+
}
|
125
|
+
|
126
|
+
window.addEventListener('resize', () => {
|
127
|
+
let vh = window.innerHeight * 1;
|
128
|
+
document.documentElement.style.setProperty('--vh', `${vh}px`);
|
129
|
+
});
|