Skip to content

Commit

Permalink
Merge pull request #10 from theme-kaze/devel
Browse files Browse the repository at this point in the history
🔖  new version: 1.0.5
  • Loading branch information
songhn233 authored Aug 21, 2020
2 parents 511a4be + dcd26c4 commit f053dd5
Show file tree
Hide file tree
Showing 14 changed files with 72 additions and 33 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,4 @@ jobs:
npm install
npm publish
env:
NODE_AUTH_TOKEN: '${{ secrets.npm_token }}'


NODE_AUTH_TOKEN: '${{ secrets.npm_token }}'
6 changes: 6 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ toc:
showListNumber: false
maxDepth: 6
minDepth: 1

copyright:
enable: true
writer: # if writer is empty we will use config.author as writer
declare: 本博客所有文章除特别声明外,均采用<a target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">CC BY-NC-SA 4.0 协议</a>。转载请注明出处!
style: warning # the style uses note warning | danger | primary | info | success
#------------------------
# Footer
#------------------------
Expand Down
6 changes: 3 additions & 3 deletions layout/_partial/footer.ejs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<footer class="footer">
<div class="footer-container">
<div class="copyright">
<div>
<span id="copyYear">Copyright ©
<div>
<div class="footer-dsc">
<span>Copyright ©
<% if(theme.footer.copyYear) { %>
<%- theme.footer.copyYear %> -
<% } %>
Expand Down
2 changes: 1 addition & 1 deletion layout/_partial/nav.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
<% for(const menu in theme.menus) { %>
<a href="<%= theme.menus[menu] %>" class="navbar-menu-item"><%- __(menu + '.title') %> </a>
<% } %>
<a class="navbar-menu-item" id="dark"><i class="iconfont icon-weather"></i></a>
<a class="navbar-menu-item darknavbar" id="dark"><i class="iconfont icon-weather"></i></a>
</div>
</nav>
3 changes: 3 additions & 0 deletions layout/_partial/scrollbutton.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@
</a>
<a role="button" id="popbutton" class="basebutton">
<i class="iconfont icon-expand button-icon"></i>
</a>
<a role="button" id="darkbutton" class="basebutton darkwidget">
<i class="iconfont icon-weather button-icon"></i>
</a>
9 changes: 9 additions & 0 deletions layout/post.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@
<div id="section" class="post-content">
<%- page.content %>
</div>
<div>
<% if(theme.copyright.enable) { %>
<div class="post-note note-<%= theme.copyright.style || "warning" %> copyright" style="margin-top: 42px">
<p><span style="font-weight: bold;">作者:</span><a target="_blank" rel="nofollow noopener noreferrer" href="<%= config.url + '/about' %>"><%= theme.copyright.writer || theme.author || config.author%></a></p>
<p><span style="font-weight: bold;">文章链接:</span><a target="_blank" rel="nofollow noopener noreferrer" href="<%= page.permalink %>"><%= page.permalink %></a></p>
<p><span style="font-weight: bold;">版权声明:</span><%- theme.copyright.declare %></p>
</div>
<% } %>
</div>
</article>
<%- partial('_partial/pagination',{
prev_label: __("prev_post.title"), next_label:__("next_post.title"),
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-kaze",
"version": "1.0.4",
"version": "1.0.5",
"description": "hexo-theme-kaze",
"main": "index.js",
"scripts": {
Expand Down
5 changes: 4 additions & 1 deletion source/css/_base/reset.styl
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,7 @@ pre
background-clip: padding-box
::-webkit-scrollbar-thumb
background-color: $divider-color
border-radius: 0.3rem
border-radius: 0.3rem
@media (max-width : 742px)
#dark
display: none
4 changes: 2 additions & 2 deletions source/css/_pages/rewrite.styl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.comment-card
.comment-card-title
color: $ml-font-color
margin-bottom: 12px
font-size: $ml-font-size
margin-bottom: 16px
.widget-title
font-size: $lg-font-size
font-weight: bold
Expand Down
7 changes: 7 additions & 0 deletions source/css/_pages/widgets/button.styl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@
right: 32px
.button-icon
font-size: $sm-font-size
#darkbutton
display: none
opacity: 0
bottom: 32px
right: 32px
.button-icon
font-size: $md-font-size
.postbutton
cursor: pointer
background-color: var(--link-color)
Expand Down
5 changes: 1 addition & 4 deletions source/css/_pages/widgets/footer.styl
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,8 @@
color: var(--info-text-color)
display: block
justify-content: space-between
.copyright
display: flex
justify-content: center
margin-bottom: 6px
.footer-dsc
margin-bottom: 6px
display: flex
justify-content: center
a
Expand Down
8 changes: 8 additions & 0 deletions source/css/_pages/widgets/post.styl
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ mjx-container
border-left-style: solid
p
margin-bottom: 0
.copyright
a
color: var(--text-color)
font-weight: bold
p
+ p
margin-top: 8px

.note-default
background-color: var(--blockquote-color)
border-left-color: var(--border-color)
Expand Down
27 changes: 26 additions & 1 deletion source/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@ see theme at https://github.com/0x4qE/hexo-theme-Kaze
`);
// darkmode.js
// reverse button
const darkControlButton = document.getElementById('dark');
const scrollWidth = document.body.scrollWidth || document.documentElement.scrollWidth;
let darkControlButton = null;
if (scrollWidth <= 742) {
darkControlButton = document.querySelector('.darkwidget');
} else {
darkControlButton = document.querySelector('.darknavbar');
}

darkControlButton.addEventListener('click', () => {
setDarkmode(reverseDarkModeSetting());
});
Expand Down Expand Up @@ -80,6 +87,24 @@ const reversePopButton = () => {
}, 100);
}
}
const darkButton = document.querySelector('.darkwidget');
if (scrollWidth <= 742) {
if (darkButton.style.display === 'flex') {
darkButton.style.bottom = '32px';
darkButton.style.opacity = '0';
darkButton.style.transform = 'none';
setTimeout(() => {
darkButton.style.display = 'none';
}, 100);
} else {
darkButton.style.display = 'flex';
reverseButton.style.transform = 'rotate(90deg)';
setTimeout(() => {
darkButton.style.bottom = '138px';
darkButton.style.opacity = '1';
}, 100);
}
}
};
setTimeout(() => {
document.getElementById('popbutton').onclick = reversePopButton;
Expand Down
17 changes: 0 additions & 17 deletions version.md

This file was deleted.

0 comments on commit f053dd5

Please sign in to comment.