Skip to content

Commit

Permalink
Merge pull request #363 from everfu/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
everfu authored Aug 18, 2024
2 parents 742cb13 + 3500702 commit 1ba9b32
Show file tree
Hide file tree
Showing 22 changed files with 431 additions and 220 deletions.
510 changes: 384 additions & 126 deletions _config.yml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion layout/includes/console.pug
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ div#console
div.console-btn-item.on#consoleCommentBarrage(onclick="sco.switchCommentBarrage()")
span.commentBarrage
i.solitude.fa-solid.fa-comment
div.console-mask(onclick="sco.hideConsole()")
div.console-mask(onclick="sco.hideConsole()")
22 changes: 8 additions & 14 deletions layout/includes/footer.pug
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
- var { information , group } = theme.footer

if theme.post.footer.enable && is_post()
div#st-footer-bar
div.footer-logo
Expand All @@ -11,24 +13,23 @@ if theme.post.footer.enable && is_post()
if theme.post.footer.button.enable
a.footer-bar-link(href=url_for(theme.post.footer.button.url))= theme.post.footer.button.name
div#footer_deal
- var leftInfo = theme.footer && theme.footer.information && theme.footer.information.left || {}
- var rightInfo = theme.footer && theme.footer.information && theme.footer.information.right || {}
- var leftInfo = information.left
- var rightInfo = information.right

each value, label in leftInfo
- var array = value.split('||')
a.deal_link(href=url_for(trim(array[0])), title=label)
i.solitude(class=array[1])

if theme.footer.information.author
if information.author
div#footer_mini_logo.nolazyload.footer_mini_logo(title=_p('nav.backtop'), onclick="sco.toTop()")
img(src=theme.site.icon, alt=_p('nav.backtop'))
img(src=information.author, alt=_p('nav.backtop'))

each value, label in rightInfo
- var array = value.split('||')
a.deal_link(href=url_for(trim(array[0])), title=label)
i.solitude(class=array[1])
div#st-footer
- var group = theme.footer && theme.footer.group ? theme.footer.group : {}

each value, x in group
div.footer-group
Expand Down Expand Up @@ -57,17 +58,10 @@ div#footer-bar
each item in theme.footer.links
a.footer-bar-link(href=url_for(item.url), alt=item.name)!= item.name
if theme.footer.license
a.footer-bar-link.cc(href=url_for(theme.footer.license), aria-label = 'copyright')
a.footer-bar-link.cc(href=url_for(theme.footer.license))
i.solitude.fa-solid.fa-copyright
i.solitude.fa-brands.fa-creative-commons-by
i.solitude.fa-brands.fa-creative-commons-nc
i.solitude.fa-brands.fa-creative-commons-nd
if theme.footer.privacy
div.needEndHide#cookies-window
div.cookies-window-title= __('cookies.title')
div.cookies-window-content
span.cookies-tip= __('cookies.tip')
a.cookies-link(href=url_for(theme.footer.privacy), title=_p('cookies.privacy'))
i.solitude.fa-solid.fa-circle-chevron-right
if theme.comment.use && theme.comment.commentBarrage
div.comment-barrage.needEndHide
div.comment-barrage.needEndHide
4 changes: 2 additions & 2 deletions layout/includes/head.pug
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ meta(name="viewport" content="width=device-width, initial-scale=1")

title= title + subtitle
noscript= _p('head.noscript')
link(rel="icon", href=url_for(theme.site.siteIcon))
link(rel="icon", href=url_for(theme.site.icon))

// index.css
link(rel="stylesheet", href=url_for(theme.cdn.main_css))
Expand All @@ -29,4 +29,4 @@ include ./inject/head.pug
include ./head/config.pug

// page-config head
include ./head/page_config
include ./head/page_config
4 changes: 2 additions & 2 deletions layout/includes/head/opengraph.pug
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
if theme.OpenGraph.enable
-
const coverVal = page.cover || theme.site.siteIcon
const coverVal = page.cover || theme.site.icon
let ogOption = {
type: is_post() ? 'article' : 'website',
image: coverVal ? full_url_for(coverVal) : '',
Expand All @@ -10,4 +10,4 @@ if theme.OpenGraph.enable
!= open_graph(ogOption)
meta(name="description" content=page_description())
else
meta(name="description" content=page_description())
meta(name="description" content=page_description())
4 changes: 2 additions & 2 deletions layout/includes/head/pwa.pug
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ else
meta(name="apple-mobile-web-app-capable", content=config.title)
meta(name="theme-color", content="var(--efu-main)")
meta(name="apple-mobile-web-app-status-bar-style", content="var(--efu-main)")
link(rel="bookmark", href=url_for(theme.site.siteIcon))
link(rel="apple-touch-icon", href=url_for(theme.site.siteIcon), sizes="180x180")
link(rel="bookmark", href=url_for(theme.site.icon))
link(rel="apple-touch-icon", href=url_for(theme.site.icon), sizes="180x180")
2 changes: 1 addition & 1 deletion layout/includes/layout.pug
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ html(lang=config.language, data-theme="light")

// music
if theme.capsule.enable
include ./widgets/third-party/music.pug
include ./widgets/third-party/music.pug
6 changes: 4 additions & 2 deletions layout/includes/loading.pug
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@ script.
if (!preloader.isLoaded) {
document.getElementById('loading-box').classList.add('loaded');
preloader.isLoaded = true;
preloader.togglePaceDone();
}
},
initLoading: () => {
document.getElementById('loading-box').classList.remove('loaded');
preloader.isLoaded = false;
preloader.togglePaceDone();
},
removePaceDone: () => {
document.getElementById('body').classList = 'pace-done';
togglePaceDone: () => {
document.getElementById('body').className = preloader.isLoaded ? 'pace-done' : '';
}
}

Expand Down
2 changes: 1 addition & 1 deletion layout/includes/page/categories.pug
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ h1.page-title= _p('page.category')
span.tags-punctuation
i.solitude.fa-solid.fa-hashtag
= item.name
span.tagsPageCount= item.length
span.tagsPageCount= item.length
2 changes: 1 addition & 1 deletion layout/includes/page/tags.pug
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ h1.page-title= __('page.tag')
span.tags-punctuation
i.solitude.fa-solid.fa-hashtag
= tag.name
span.tagsPageCount= tag.length
span.tagsPageCount= tag.length
2 changes: 1 addition & 1 deletion layout/includes/widgets/third-party/pjax.pug
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ script.
if (e.request.status === 404) {
pjax.loadUrl('/404.html')
}
})
})
7 changes: 2 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hexo-theme-solitude",
"version": "2.0.7",
"version": "2.0.8",
"description": "A beautiful, powerful, and efficient Hexo theme developed by EverFu.",
"main": "package.json",
"scripts": {
Expand Down Expand Up @@ -28,8 +28,5 @@
},
"homepage": "https://everfu.github.io/Solitude/",
"author": "Hexo-Theme-Solitude<o@everfu.org>",
"license": "MIT",
"devDependencies": {
"@types/node": "^22.0.0"
}
"license": "MIT"
}
2 changes: 1 addition & 1 deletion plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pjax:
twikoo:
name: twikoo
file: dist/twikoo.all.min.js
version: 1.6.38
version: 1.6.39
waline_js:
name: '@waline/client'
file: dist/waline.js
Expand Down
2 changes: 1 addition & 1 deletion scripts/filter/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ function getRandomInt(min, max) {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min)) + min;
}
}
2 changes: 1 addition & 1 deletion scripts/helper/getArchiveLength.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ hexo.extend.helper.register('getArchiveLength', function (type) {
archive[postdate] = (archive[postdate] || 0) + 1;
}
return archive;
});
});
3 changes: 3 additions & 0 deletions source/css/_comments/twikoo.styl
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,9 @@ button.el-button.tk-cancel.el-button--default.el-button--small
border-radius 8px !important
color var(--efu-fontcolor) !important

.tk-replies .tk-content span:first-child
font-size inherit
color black

.OwO
&.OwO-open
Expand Down
46 changes: 0 additions & 46 deletions source/css/_layout/footer.styl
Original file line number Diff line number Diff line change
Expand Up @@ -230,49 +230,3 @@

> div > div.footer-bar-left > span
margin-right 1rem

#cookies-window
min-width 300px
background var(--efu-maskbgdeep)
color var(--efu-fontcolor)
padding 8px 16px
display flex
flex-direction column
bottom 20px
right 20px
position fixed
border-radius 12px
transition .3s
z-index 8
user-select none
backdrop-filter saturate(180%) blur(20px)
transform translateZ(0)
border var(--style-border)
animation barrageIn .6s cubic-bezier(.42, 0, .3, 1.11)

+maxWidth1300()
display none

&.cw-hide
opacity 0
animation barrageOut .6s cubic-bezier(.42, 0, .3, 1.11)
z-index -1

.cookies-window-title
padding-bottom 4px
border-bottom var(--style-border)
font-size 12px
font-weight 700

.cookies-window-content
font-size 14px
display flex
justify-content space-around
align-items center

.cookies-link
margin-left: 10px
font-size: 16px

i.solitude
font-size 16px
14 changes: 12 additions & 2 deletions source/css/_layout/sidebar.styl
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,17 @@
margin-bottom 60px

a
color var(--efu-fontcolor) !important
color var(--efu-fontcolor)
padding 2px 8px 2px 12px
border-radius 8px
border var(--style-border-always)
background var(--efu-card-bg)
font-size 14px !important

&:hover
background var(--efu-main)
color var(--efu-white)

sup
opacity .6
margin-left 4px
Expand All @@ -200,6 +204,12 @@

span.darkmode_switchbutton
padding 4px 8px
cursor pointer
transition all .5s ease 0s

&:hover
background var(--efu-main)
color var(--efu-white)

[data-theme="dark"] &
background var(--efu-orange)
Expand Down Expand Up @@ -237,4 +247,4 @@
color var(--efu-fontcolor)

#toggle-sidebar
bottom 80px
bottom 80px
1 change: 1 addition & 0 deletions source/css/_page/_home/home-top.styl
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
transition .3s
position relative
box-shadow var(--efu-shadow-border)
min-width fit-content

&:nth-last-child(2):nth-child(1),
&:nth-last-child(1):nth-child(2)
Expand Down
3 changes: 2 additions & 1 deletion source/css/_page/recentcomment.styl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ div.console_recentcomments
.comment-card
position relative
width calc(100% / 3 - 8px)
min-width fit-content
background var(--efu-card-bg)
border-radius 12px
border var(--style-border-always)
Expand Down Expand Up @@ -85,4 +86,4 @@ span.comment-user
time.comment-time
font-size 12px
color var(--efu-secondtext)
margin-left auto
margin-left auto
Binary file removed source/img/recent_c.avif
Binary file not shown.
11 changes: 1 addition & 10 deletions source/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,6 @@ const sco = {
lastSayHello: "",
wasPageHidden: false,
musicPlaying: false,
hideCookie() {
const cookiesWindow = document.getElementById("cookies-window");
if (cookiesWindow) {
setTimeout(() => {
cookiesWindow.classList.add("cw-hide");
setTimeout(() => cookiesWindow.style.display = "none", 1000);
}, 3000);
}
},
scrollTo(elementId) {
const targetElement = document.getElementById(elementId);
if (targetElement) {
Expand Down Expand Up @@ -673,7 +664,7 @@ window.refreshFn = () => {
document.body.setAttribute('data-type', page);
sco.changeTimeFormat(document.querySelectorAll(timeSelector));
runtime && sco.addRuntime();
[scrollFn, sidebarFn, sco.hideCookie, sco.addPhotoFigcaption, sco.setTimeState, sco.tagPageActive, sco.categoriesBarActive, sco.listenToPageInputPress, sco.addNavBackgroundInit, sco.refreshWaterFall].forEach(fn => fn());
[scrollFn, sidebarFn, sco.addPhotoFigcaption, sco.setTimeState, sco.tagPageActive, sco.categoriesBarActive, sco.listenToPageInputPress, sco.addNavBackgroundInit, sco.refreshWaterFall].forEach(fn => fn());
lazyload.enable && utils.lazyloadImg();
lightbox && utils.lightbox(document.querySelectorAll("#article-container img:not(.flink-avatar,.gallery-group img)"));
randomlink && randomLinksList();
Expand Down

0 comments on commit 1ba9b32

Please sign in to comment.