mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-10-04 06:22:00 +08:00
label: 3.4.0 發佈
improvement: js優化
This commit is contained in:
1 parent
6fda7ef004
commit
d82f69e83b
4 files changed
+10
-32
No files matched your search
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hexo-theme-butterfly",
|
"name": "hexo-theme-butterfly",
|
||||||
"version": "3.4.0-b6",
|
"version": "3.4.0",
|
||||||
"description": "A Simple and Card UI Design theme for Hexo",
|
"description": "A Simple and Card UI Design theme for Hexo",
|
||||||
"main": "package.json",
|
"main": "package.json",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 KiB |
+3
-5
@@ -383,9 +383,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
const contentMath = (docHeight > winHeight) ? (docHeight - winHeight) : (document.documentElement.scrollHeight - winHeight)
|
const contentMath = (docHeight > winHeight) ? (docHeight - winHeight) : (document.documentElement.scrollHeight - winHeight)
|
||||||
const scrollPercent = (currentTop - headerHeight) / (contentMath)
|
const scrollPercent = (currentTop - headerHeight) / (contentMath)
|
||||||
const scrollPercentRounded = Math.round(scrollPercent * 100)
|
const scrollPercentRounded = Math.round(scrollPercent * 100)
|
||||||
const percentage = (scrollPercentRounded > 100) ? 100
|
const percentage = (scrollPercentRounded > 100) ? 100 : (scrollPercentRounded <= 0) ? 0 : scrollPercentRounded
|
||||||
: (scrollPercentRounded <= 0) ? 0
|
|
||||||
: scrollPercentRounded
|
|
||||||
$cardToc.setAttribute('progress-percentage', percentage)
|
$cardToc.setAttribute('progress-percentage', percentage)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -687,7 +685,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
|
|
||||||
if (!$tabItem.classList.contains('active')) {
|
if (!$tabItem.classList.contains('active')) {
|
||||||
const $tabContent = $tabItem.parentNode.nextElementSibling
|
const $tabContent = $tabItem.parentNode.nextElementSibling
|
||||||
btf.siblings($tabItem, 'active')[0].classList.remove('active')
|
btf.siblings($tabItem, '.active')[0].classList.remove('active')
|
||||||
$tabItem.classList.add('active')
|
$tabItem.classList.add('active')
|
||||||
const tabId = $this.getAttribute('data-href').replace('#', '')
|
const tabId = $this.getAttribute('data-href').replace('#', '')
|
||||||
const childList = [...$tabContent.children]
|
const childList = [...$tabContent.children]
|
||||||
@@ -753,7 +751,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
|
|
||||||
const addPostOutdateNotice = function () {
|
const addPostOutdateNotice = function () {
|
||||||
const data = GLOBAL_CONFIG.noticeOutdate
|
const data = GLOBAL_CONFIG.noticeOutdate
|
||||||
var diffDay = btf.diffDate(GLOBAL_CONFIG_SITE.postUpdate)
|
const diffDay = btf.diffDate(GLOBAL_CONFIG_SITE.postUpdate)
|
||||||
if (diffDay >= data.limitDay) {
|
if (diffDay >= data.limitDay) {
|
||||||
const ele = document.createElement('div')
|
const ele = document.createElement('div')
|
||||||
ele.className = 'post-outdate-notice'
|
ele.className = 'post-outdate-notice'
|
||||||
|
|||||||
Loaded 3 of 4 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user