Skip to content

Commit

Permalink
Merge branch 'dev' of github.com:anzhiyu-c/hexo-theme-anzhiyu into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
anzhiyu-c committed Oct 31, 2023
2 parents cefa294 + 1e27c66 commit 94621f2
Show file tree
Hide file tree
Showing 22 changed files with 147 additions and 71 deletions.
19 changes: 18 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,23 @@ translate:
readmode: true

# 中控台
centerConsole: true
centerConsole:
enable: true
card_tags:
enable: false
limit: 40 # if set 0 will show all
color: false
sort_order: # Don't modify the setting unless you know how it works
highlightTags:
# - Hexo
# - 前端
card_archives:
enable: false
type: monthly # yearly or monthly
format: MMMM YYYY # eg: YYYY年MM月
order: -1 # Sort of order. 1, asc for ascending; -1, desc for descending
limit: 8 # if set 0 will show all
sort_order: # Don't modify the setting unless you know how it works

# dark mode
darkmode:
Expand Down Expand Up @@ -1054,6 +1070,7 @@ friends_vue:
enable: false
vue_js: https://npm.elemecdn.com/[email protected]/friends/index.4f887d95.js
apiurl: # 朋友圈后端地址
top_tips: 使用 友链朋友圈 订阅友链最新文章
top_background:

# 深色模式粒子效果canvas
Expand Down
28 changes: 15 additions & 13 deletions layout/includes/anzhiyu/console.pug
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,37 @@
.console-card-group
.console-card-group-left
!=partial('includes/widget/card_newest_comment', {}, {cache: true})
- const nav_console_music_enable = theme.nav_music.console_widescreen_music
.console-card-group-right
.console-card.tags
.card-content
if nav_console_music_enable
if theme.nav_music.enable && theme.nav_music.console_widescreen_music
.author-content-item-tips 音乐
span.author-content-item-title 灵魂的碰撞💥
else
.author-content-item-tips 兴趣点
span.author-content-item-title 寻找你感兴趣的领域
!=partial('includes/widget/card_tags', {}, {cache: true})
!=partial('includes/widget/card_console_tags', {}, {cache: true})
.console-card.history
.item-headline
i.anzhiyufont.anzhiyu-icon-box-archiv
span 文章
!=partial('includes/widget/card_archives', {}, {cache: true})
!=partial('includes/widget/card_console_archives', {}, {cache: true})
.button-group
.console-btn-item
a.darkmode_switchbutton(title='显示模式切换', href='javascript:void(0);')
i.anzhiyufont.anzhiyu-icon-moon
if theme.darkmode.enable
.console-btn-item
a.darkmode_switchbutton(title='显示模式切换', href='javascript:void(0);')
i.anzhiyufont.anzhiyu-icon-moon
.console-btn-item#consoleHideAside(onclick='anzhiyu.hideAsideBtn()', title='边栏显示控制')
a.asideSwitch
i.anzhiyufont.anzhiyu-icon-arrows-left-right
.console-btn-item.on#consoleCommentBarrage(onclick='anzhiyu.switchCommentBarrage()', title='热评开关')
a.commentBarrage
i.anzhiyufont.anzhiyu-icon-message
.console-btn-item#consoleMusic(onclick='anzhiyu.musicToggle()', title='音乐开关')
a.music-switch
i.anzhiyufont.anzhiyu-icon-music
if theme.comment_barrage_config.enable
.console-btn-item.on#consoleCommentBarrage(onclick='anzhiyu.switchCommentBarrage()', title='热评开关')
a.commentBarrage
i.anzhiyufont.anzhiyu-icon-message
if theme.nav_music.enable
.console-btn-item#consoleMusic(onclick='anzhiyu.musicToggle()', title='音乐开关')
a.music-switch
i.anzhiyufont.anzhiyu-icon-music
if theme.shortcutKey.enable
.console-btn-item#consoleKeyboard(onclick='anzhiyu.keyboardToggle()', title='快捷键开关')
a.keyboard-switch
Expand Down
10 changes: 6 additions & 4 deletions layout/includes/bbTimeList.pug
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
if site.data.essay
each i in site.data.essay
if i.home_essay
- let onclick_value = theme.pjax.enable ? `pjax.loadUrl("/essay/");` : '';
- let href_value = theme.pjax.enable ? 'javascript:void(0);' : `/essay/`;
#bbTimeList.bbTimeList.container
i.anzhiyufont.anzhiyu-icon-jike.bber-logo.fontbold(onclick=`pjax.loadUrl("/essay/")`,title="即刻短文", aria-hidden="true")
i.anzhiyufont.anzhiyu-icon-jike.bber-logo.fontbold(onclick=onclick_value, title="即刻短文", href=href_value, aria-hidden="true")
#bbtalk.swiper-container.swiper-no-swiping.essay_bar_swiper_container(tabindex="-1")
#bber-talk.swiper-wrapper(onclick=`pjax.loadUrl("/essay/")`)
#bber-talk.swiper-wrapper(onclick=onclick_value)
each i in site.data.essay
each item, index in i.essay_list
if index < 10
- var contentText = item.image ? item.content + ' [图片]' : (item.video ? item.content + ' [视频]' : item.content)
.li-style.swiper-slide= contentText
i.bber-gotobb.anzhiyufont.anzhiyu-icon-circle-arrow-right( onclick=`pjax.loadUrl("/essay/")`,title="查看全文")
a.li-style.swiper-slide(href=href_value)= contentText
a.bber-gotobb.anzhiyufont.anzhiyu-icon-circle-arrow-right( onclick=onclick_value, href=href_value, title="查看全文")

script(src=url_for(theme.home_top.swiper.swiper_js))
35 changes: 19 additions & 16 deletions layout/includes/footer.pug
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,24 @@
use(xlink:href=`#`+ item.icon)
else if (item.icon.startsWith("anzhiyu"))
i.anzhiyufont(class=`${item.icon}`)

if theme.footer.owner.enable && !theme.footer.footerBar.enable
- var nowYear = new Date().getFullYear()
if theme.footer.owner.since && theme.footer.owner.since != nowYear
.copyright!= `&copy;${theme.footer.owner.since} - ${nowYear} By ${config.author}`
else
.copyright!= `&copy;${nowYear} By ${config.author}`

- let work_img = theme.footer.runtime.work_img
- let work_description = theme.footer.runtime.work_description
if theme.footer.runtime.enable
#workboard
if work_img != null
img(src=`${work_img}`, alt=`${work_description}`, title=`${work_description}`, class="workSituationImg boardsign")
#runtimeTextTip
if theme.footer.custom_text
.footer_custom_text!=`${theme.footer.custom_text}`

if theme.footer.list.enable
- let projectList = theme.footer.list.project
#anzhiyu-footer
Expand All @@ -40,21 +58,6 @@
i.anzhiyufont.anzhiyu-icon-arrow-rotate-right
.footer-links#friend-links-in-footer

if theme.footer.owner.enable && !theme.footer.footerBar.enable
- var nowYear = new Date().getFullYear()
if theme.footer.owner.since && theme.footer.owner.since != nowYear
.copyright!= `&copy;${theme.footer.owner.since} - ${nowYear} By ${config.author}`
else
.copyright!= `&copy;${nowYear} By ${config.author}`

- let work_img = theme.footer.runtime.work_img
- let work_description = theme.footer.runtime.work_description
if theme.footer.runtime.enable
#workboard
img(src=`${work_img}`, alt=`${work_description}`, title=`${work_description}`, class="workSituationImg boardsign")
#runtimeTextTip
if theme.footer.custom_text
.footer_custom_text!=`${theme.footer.custom_text}`
if theme.footer.bdageitem.enable
p#ghbdages
each item in theme.footer.bdageitem.list
Expand Down Expand Up @@ -82,7 +85,7 @@ if theme.footer.footerBar && theme.footer.footerBar.enable
.footer-bar-right
each item in theme.footer.footerBar.linkList
a.footer-bar-link(href=url_for(item.link) title=item.text)=item.text
if theme.footer.footerBar.cc.enable
if theme.footer.footerBar.cc.enable
a.footer-bar-link.cc(href=url_for(theme.footer.footerBar.cc.link) title="cc协议")
i.anzhiyufont.anzhiyu-icon-copyright-line
i.anzhiyufont.anzhiyu-icon-creative-commons-by-line
Expand Down
12 changes: 7 additions & 5 deletions layout/includes/header/nav.pug
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ nav#nav
a#site-name(href=url_for('/') accesskey="h")
.title #[=config.title]
i.anzhiyufont.anzhiyu-icon-house-chimney
if (theme.nav.clock)
!=partial('includes/anzhiyu/clock', {}, {cache: true})

div.mask-name-container
#name-container
a#page-name(href="javascript:anzhiyu.scrollToDest(0, 500)") PAGE_NAME

#menus
!=partial('includes/header/menu_item', {}, {cache: true})
#nav-right
Expand All @@ -37,21 +39,21 @@ nav#nav
a.site-page.social-icon.search(href='javascript:void(0);', title='搜索🔍' accesskey="s")
i.anzhiyufont.anzhiyu-icon-magnifying-glass
span=' '+_p('search.title')

input#center-console(type="checkbox")
if theme.centerConsole
if theme.centerConsole.enable
label.widget(for="center-console" title=_p("中控台") onclick="anzhiyu.switchConsole();")
i.left
i.widget.center
i.widget.right

!=partial('includes/anzhiyu/console', {}, {cache:true})

div.nav-button#nav-totop
a.totopbtn(href='javascript:void(0);')
i.anzhiyufont.anzhiyu-icon-arrow-up
span#percent(onclick="anzhiyu.scrollToDest(0,500)") 0

#toggle-menu
a.site-page(href='javascript:void(0);' title="切换")
i.anzhiyufont.anzhiyu-icon-bars
Expand Down
2 changes: 0 additions & 2 deletions layout/includes/layout.pug
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ html(lang=config.language data-theme=theme.display_mode class=htmlClassHideAside
include ./music.pug
!=partial('includes/third-party/search/index', {}, {cache: true})
!=partial('includes/anzhiyu/rightmenu', {}, {cache:true})
if (theme.nav.clock)
!=partial('includes/anzhiyu/clock', {}, {cache:true})
include ./additional-js.pug

//- 弹窗通知
Expand Down
2 changes: 1 addition & 1 deletion layout/includes/page/album.pug
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
.banner-button-group
a.banner-button(onclick='pjax.loadUrl("/about/")')
i.anzhiyufont.anzhiyu-icon-arrow-circle-right(style='font-size: 1.5rem')
span.banner-button-text 关于我
span.banner-button-text 关于本人
.card-album
each i in site.data.album
.card(onclick=`pjax.loadUrl("${i.path_name}")`)
Expand Down
6 changes: 3 additions & 3 deletions layout/includes/page/essay.pug
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if site.data.essay
.tips=i.tips
.banner-button-group
a.banner-button(href=i.buttonLink)
i.anzhiyufont.anzhiyu-icon-arrow-circle-right(style='font-size: 1.3rem')
i.anzhiyufont.anzhiyu-icon-arrow-circle-right
span.banner-button-text=i.buttonText
#bber
section.timeline.page-1
Expand All @@ -35,7 +35,7 @@ if site.data.essay
iframe(style="position: absolute; width: 100%; height: 100%; left: 0; top: 0;margin: 0;border-radius: 12px;border: var(--style-border);" src=url_for(item.video[indey]) scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true")
else
a.bber-content-video(href=url_for(item.video[indey]) data-fancybox="gallery", data-caption="")
video(src=url_for(item.video[indey]))
video(src=url_for(item.video[indey]))
.bber-content-noimg
.bber-content-noimg
.bber-content-noimg
Expand Down Expand Up @@ -64,4 +64,4 @@ if site.data.essay
.bber-reply(onclick="rm.rightMenuCommentText(" + `'${item.content}'` + ")")
i.anzhiyufont.anzhiyu-icon-message
#bber-tips(style='color: var(--anzhiyu-secondtext);')
="- 只展示最近" + i.limit + "条短文 -"
="- 只展示最近" + i.limit + "条短文 -"
6 changes: 3 additions & 3 deletions layout/includes/page/fcircle.pug
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ if theme.friends_vue.enable
.author-content-item-tips 友链
span.author-content-item-title 最新文章订阅
.content-bottom
.tips 使用 友链朋友圈 订阅友链最新文章
.tips=theme.friends_vue.top_tips
.banner-button-group
a.banner-button(onclick='pjax.loadUrl("/about")')
i.anzhiyufont.anzhiyu-icon-arrow-circle-right(style='font-size: 1.5rem')
span.banner-button-text 关于我
i.anzhiyufont.anzhiyu-icon-arrow-circle-right(style='font-size: 22px; margin-right: 0.25rem')
span.banner-button-text 关于本人
.title-h2-a
.title-h2-a-left
h2(style='padding-top:0;margin:.6rem 0 .6rem') 🎣 钓鱼
Expand Down
13 changes: 12 additions & 1 deletion layout/includes/post/ptool.pug
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,17 @@ if !theme.disable_top_img && page.top_img !== false
a.share-button(target='_blank' href=`https://service.weibo.com/share/share.php?title=${site_title}&url=${url}&pic=${bg_img}` rel='external nofollow noreferrer noopener')
i.anzhiyufont.anzhiyu-icon-weibo
if theme.ptool.share_copyurl
script.
function copyCurrentPageUrl() {
var currentPageUrl = window.location.href;
var input = document.createElement("input");
input.setAttribute("value", currentPageUrl);
document.body.appendChild(input);
input.select();
input.setSelectionRange(0, 99999);
document.execCommand("copy");
document.body.removeChild(input);
}
.share-link.copyurl
#post-share-url.share-button(title='复制链接' onclick='rm.copyPageUrl()')
#post-share-url.share-button(title='复制链接' onclick='copyCurrentPageUrl()')
i.anzhiyufont.anzhiyu-icon-link
8 changes: 5 additions & 3 deletions layout/includes/third-party/runtime/runtime-js.pug
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@ script(async=true).
} else {
// 如果是下班时间,插入"安知鱼-下班啦.svg"图片
let img = document.querySelector("#workboard .workSituationImg");
img.src = "#{offduty_img}";
img.title = "#{offduty_description}";
img.alt = "#{offduty_description}";
if (img != null) {
img.src = "#{offduty_img}";
img.title = "#{offduty_description}";
img.alt = "#{offduty_description}";
}

currentTimeHtml = `本站居然运行了 ${dnum} 天<span id='runtime'> ${hnum} 小时 ${mnum} 分 ${snum} 秒 </span><i class='anzhiyufont anzhiyu-icon-heartbeat' style='color:red'></i>`;
}
Expand Down
4 changes: 3 additions & 1 deletion layout/includes/top/top.pug
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ if home_top_config.enable
.categoryGroup
each item in home_top_config.category
.categoryItem(style=`box-shadow:${item.shadow}`)
a.categoryButton(onclick=`pjax.loadUrl("${item.path}");` href='javascript:void(0);' class=`${item.class}`)
- let onclick_value = theme.pjax.enable ? `pjax.loadUrl("${item.path}");` : '';
- let href_value = theme.pjax.enable ? 'javascript:void(0);' : `${item.path}`;
a.categoryButton(onclick=onclick_value href=href_value class=`${item.class}`)
span.categoryButtonText=item.name
if (item.icon.startsWith("fa"))
i(class=`${item.icon}`)
Expand Down
8 changes: 8 additions & 0 deletions layout/includes/widget/card_console_archives.pug
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
if theme.centerConsole.card_archives.enable
.card-archives
- let type = theme.centerConsole.card_archives.type || 'monthly'
- let format = theme.centerConsole.card_archives.format || 'MMMM YYYY'
- let order = theme.centerConsole.card_archives.order || -1
- let limit = theme.centerConsole.card_archives.limit === 0 ? 0 : theme.centerConsole.card_archives.limit || 8
!= aside_archives({ type:type, format: format, order: order, limit: limit })
hr
10 changes: 10 additions & 0 deletions layout/includes/widget/card_console_tags.pug
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
if theme.centerConsole.card_tags.enable
if site.tags.length
.card-tags
.item-headline
- let tagLimit = theme.centerConsole.card_tags.limit === 0 ? 0 : theme.centerConsole.card_tags.limit || 40
if theme.centerConsole.card_tags.color
.card-tag-cloud!= cloudTags({source: site.tags, minfontsize: 1.05, maxfontsize: 1.05, limit: tagLimit, unit: 'rem', color: true, highlightTags: theme.centerConsole.card_tags.highlightTags})
else
.card-tag-cloud!= cloudTags({source: site.tags, minfontsize: 1.05, maxfontsize: 1.05, limit: tagLimit, unit: 'rem', color: false, highlightTags: theme.centerConsole.card_tags.highlightTags})
hr
5 changes: 4 additions & 1 deletion scripts/helpers/random.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
hexo.extend.generator.register("random", function (locals) {
const config = hexo.config.random || {};
const themeConfig = hexo.theme.config;
const pjaxEn = themeConfig.pjax.enable;
const randomNumberFriend = themeConfig.footer.list.randomFriends || 0;
const posts = [];
const link = locals.data.link || [];
Expand All @@ -18,7 +19,9 @@ hexo.extend.generator.register("random", function (locals) {

let result = `var posts=${JSON.stringify(
posts
)};function toRandomPost(){pjax.loadUrl('/'+posts[Math.floor(Math.random() * posts.length)]);};`;
)};function toRandomPost(){
${pjaxEn ? "pjax.loadUrl('/'+posts[Math.floor(Math.random() * posts.length)]);" : "window.location.href='/'+posts[Math.floor(Math.random() * posts.length)];"}
};`;

if (themeConfig.footer.list.enable && randomNumberFriend > 0) {
result += `var friend_link_list=${JSON.stringify(link_list)};
Expand Down
2 changes: 1 addition & 1 deletion source/css/_extra/home_top/categorygroup.css
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ a.categoryButton {
transition: all 0.8s cubic-bezier(0.39, 0.575, 0.565, 1);
transform: scale(1);
overflow: hidden;
font-family: PingFang SC, Hiragino Sans GB, Microsoft YaHei;
font-family: inherit;
}
.categoryButtonText {
padding-left: 21px;
Expand Down
2 changes: 1 addition & 1 deletion source/css/_extra/home_top/top_group_banner.css
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
-webkit-backdrop-filter: blur(20px);
transform: translateZ(0);
height: 40px;
width: 130px;
width: 118px;
justify-content: center;
}
.topGroup .banner-button i,
Expand Down
2 changes: 1 addition & 1 deletion source/css/_layout/404.styl
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
padding: 0.5rem
text-align: center
font-size: 14px
font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif
font-family: $font-family
+maxWidth768()
-webkit-box-flex: 1.1;
flex: 1.1 1 0%;
Expand Down
13 changes: 12 additions & 1 deletion source/css/_mode/readmode.styl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ if hexo-config('readmode')
.read-mode
--font-color: #4c4948
--readmode-light-color: #fff
--white: #4c4948
--white: var(--anzhiyu-white)
--light-grey: #4c4948
--gray: #d6dbdf
--hr-border: #d6dbdf
Expand Down Expand Up @@ -53,6 +53,17 @@ if hexo-config('readmode')
#aside-content
display: none

#post-firstinfo .meta-firstline
a.post-meta-original
color: var(--white) !important
a.post-meta-categories
color: var(--white) !important
a.article-meta__tags
color: var(--white) !important

#post-info #post-meta
color: var(--white) !important

#page-header.post-bg
background-color: transparent
background-image: none !important
Expand Down
Loading

0 comments on commit 94621f2

Please sign in to comment.