Skip to content

Commit

Permalink
Merge pull request #296 from valor-x/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
everfu committed Jun 1, 2024
2 parents 8d3c2a8 + 421861c commit 29ac64d
Show file tree
Hide file tree
Showing 13 changed files with 38 additions and 19 deletions.
3 changes: 2 additions & 1 deletion languages/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ random: Random
upload: 'datetime: '
totalk: You don't need to delete blank lines, just type in your comments.
loading: Loading...
day: ' days'

theme:
dark: Dark
Expand Down Expand Up @@ -71,7 +72,7 @@ nav:

award:
thanks: Thanks
tipping: Tipping
tipping: Sponsor
title: List of appreciation

search:
Expand Down
3 changes: 2 additions & 1 deletion languages/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ random: Random
upload: 'datetime: '
totalk: You don't need to delete blank lines, just type in your comments.
loading: Loading...
day: ' days'

theme:
dark: Dark
Expand Down Expand Up @@ -71,7 +72,7 @@ nav:

award:
thanks: Thanks
tipping: Tipping
tipping: Sponsor
title: List of appreciation

search:
Expand Down
1 change: 1 addition & 0 deletions languages/zh-CN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ random: 随便逛逛
upload: 发布时间:
totalk: 无需删除空行,直接输入评论即可
loading: 加载中...
day: ''

# Language: 简体中文
theme:
Expand Down
1 change: 1 addition & 0 deletions languages/zh-TW.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ random: 随便逛逛
upload: 發佈時間:
totalk: 無需刪除空行,直接輸入評論即可
loading: 加載中...
day: ''

# Language: 繁體中文 (台灣)
theme:
Expand Down
1 change: 1 addition & 0 deletions layout/includes/head/config.pug
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
min: _p('time.min'),
month: _p('time.month')
},
day: _p('day'),
f12: _p('f12'),
totalk: _p('totalk')
}
Expand Down
2 changes: 1 addition & 1 deletion layout/includes/inject/head.pug
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ include ../head/pwa.pug

script.
console.log(
"%c Program: Hexo %c Theme: Solitude %c Version: v1.11.2",
"%c Program: Hexo %c Theme: Solitude %c Version: v1.11.3",
"border-radius:5px 0 0 5px;padding: 5px 10px;color:white;background:#ff3842;",
"padding: 5px 10px;color:white;background:#3e9f50;",
"padding: 5px 10px;color:white;background:#0084ff;border-radius:0 5px 5px 0",
Expand Down
2 changes: 1 addition & 1 deletion layout/includes/widgets/third-party/comments/artalk.pug
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ script.
})
const $content = comment.getRender().$content
GLOBAL_CONFIG.lightbox && utils.lightbox($content.querySelectorAll('img:not([atk-emoticon])'))
sco.owoBig({body: '.atk-grp', item: '.atk-item'})
})
sco.owoBig({body: '.atk-grp', item: '.atk-item'})
!{commentBarrage} && barrageArtalk(array)
})
const destroyArtalk = () => artalkItem.destroy()
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hexo-theme-solitude",
"version": "1.11.2",
"version": "1.11.3",
"description": "A beautiful, powerful, and efficient Hexo theme developed by EverFu.",
"main": "package.json",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion source/css/_layout/aside.styl
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
position relative
overflow hidden
margin-top .5rem
padding 1rem 1.2rem
padding .5rem .7rem

&:hover
box-shadow var(--efu-shadow-border)
Expand Down
1 change: 0 additions & 1 deletion source/css/_layout/console.styl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
margin-right .5rem
width 40%
height 100%
min-width fit-content

+maxWidth1300()
display none
Expand Down
4 changes: 4 additions & 0 deletions source/css/_search/local-search.styl
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@
color var(--efu-fontcolor)
caret-color var(--efu-theme)

::placeholder
color var(--efu-gray)
opacity .5

#search-mask
position fixed
inset 0
Expand Down
27 changes: 15 additions & 12 deletions source/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ let sco = {
*/
addRuntime: function () {
let el = document.getElementById('runtimeshow')
el && GLOBAL_CONFIG.runtime && (el.innerText = utils.timeDiff(new Date(GLOBAL_CONFIG.runtime), new Date()) + GLOBAL_CONFIG.lang.time.day)
el && GLOBAL_CONFIG.runtime && (el.innerText = utils.timeDiff(new Date(GLOBAL_CONFIG.runtime), new Date()) + GLOBAL_CONFIG.lang.day)
},
/**
* toTalk
Expand Down Expand Up @@ -775,32 +775,35 @@ class tabs {
}

static clickFnOfTabs() {
document.querySelectorAll('#article-container .tab > button').forEach(item => {
item.addEventListener('click', e => {
const $tabItem = e.target.parentNode
document.querySelectorAll('#article-container .tab > button').forEach(function (item) {
item.addEventListener('click', function (e) {
const that = this
const $tabItem = that.parentNode
if (!$tabItem.classList.contains('active')) {
const $tabContent = $tabItem.parentNode.nextElementSibling
const $siblings = $tabItem.parentNode.querySelector('.active')
const $siblings = utils.siblings($tabItem, '.active')[0]
$siblings && $siblings.classList.remove('active')
$tabItem.classList.add('active')
const tabId = e.target.getAttribute('data-href').replace('#', '')
Array.from($tabContent.children).forEach(item => {
item.id === tabId ? item.classList.add('active') : item.classList.remove('active')
const tabId = that.getAttribute('data-href').replace('#', '')
const childList = [...$tabContent.children]
childList.forEach(item => {
if (item.id === tabId) item.classList.add('active')
else item.classList.remove('active')
})
}
})
})
}

static backToTop() {
document.querySelectorAll('#article-container .tabs .tab-to-top').forEach(item => {
item.addEventListener('click', () => {
utils.scrollToDest(utils.getEleTop(item.closest('.tabs')), 300)
document.querySelectorAll('#article-container .tabs .tab-to-top').forEach(function (item) {
item.addEventListener('click', function () {
utils.scrollToDest(utils.getEleTop(item.parentElement.parentElement.parentNode), 300)

})
})
}
}

// 页面刷新
window.refreshFn = () => {
const {is_home, is_page, page, is_post} = PAGE_CONFIG;
Expand Down
8 changes: 8 additions & 0 deletions source/js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@
}
return actualTop;
},
siblings: (ele, selector) => {
return [...ele.parentNode.children].filter((child) => {
if (selector) {
return child !== ele && child.matches(selector)
}
return child !== ele
})
},
randomNum: (length) => {
return Math.floor(Math.random() * length)
},
Expand Down

0 comments on commit 29ac64d

Please sign in to comment.