update
This commit is contained in:
parent
917bf99170
commit
cbac326975
24
_config.yml
24
_config.yml
|
@ -16,23 +16,13 @@ open_graph:
|
||||||
######## Sidebar ########
|
######## Sidebar ########
|
||||||
sidebar:
|
sidebar:
|
||||||
logo:
|
logo:
|
||||||
avatar:
|
avatar: '[config.avatar](/about/)' # you can set avatar link in _config.yml or '[https://xxx.png](/about/)'
|
||||||
src: # default is config.avatar
|
title: '[config.title](/)' # you can set html tag like: '[<img no-lazy height="32px" src="xxx"/>](/)'
|
||||||
href: # set your user center page like: '/about/'
|
|
||||||
title: # default is config.title, you can set html tag like: '<img no-lazy height="32px" src="xxx"/>'
|
|
||||||
menu:
|
menu:
|
||||||
post:
|
post: '[btn.blog](/)'
|
||||||
title: btn.blog
|
wiki: '[btn.wiki](/wiki/)'
|
||||||
url: /
|
friends: # '[友链](/friends/)'
|
||||||
wiki:
|
about: # '[关于](/about/)'
|
||||||
title: btn.wiki
|
|
||||||
url: /wiki/
|
|
||||||
friends:
|
|
||||||
title: 友链
|
|
||||||
url: /friends/
|
|
||||||
about:
|
|
||||||
title: 关于
|
|
||||||
url: /about/
|
|
||||||
# Sidebar widgets
|
# Sidebar widgets
|
||||||
widgets:
|
widgets:
|
||||||
# default layout in home/wiki/categories/tags/archives pages
|
# default layout in home/wiki/categories/tags/archives pages
|
||||||
|
@ -151,7 +141,7 @@ plugins:
|
||||||
|
|
||||||
# https://scrollrevealjs.org/api/reveal.html
|
# https://scrollrevealjs.org/api/reveal.html
|
||||||
scrollreveal:
|
scrollreveal:
|
||||||
enable: true
|
enable: #true
|
||||||
js: https://cdn.jsdelivr.net/npm/scrollreveal@4.0.7/dist/scrollreveal.min.js
|
js: https://cdn.jsdelivr.net/npm/scrollreveal@4.0.7/dist/scrollreveal.min.js
|
||||||
distance: 8px
|
distance: 8px
|
||||||
duration: 500 # ms
|
duration: 500 # ms
|
||||||
|
|
|
@ -4,15 +4,15 @@ function layoutMainMenu() {
|
||||||
el += '<nav class="menu">'
|
el += '<nav class="menu">'
|
||||||
for (let id of Object.keys(theme.sidebar.menu)) {
|
for (let id of Object.keys(theme.sidebar.menu)) {
|
||||||
let item = theme.sidebar.menu[id];
|
let item = theme.sidebar.menu[id];
|
||||||
if (item.url == undefined || item.url.length == 0) {
|
if (item == undefined || item.length == 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
el += '<a class="nav-item';
|
el += '<a class="nav-item';
|
||||||
if (id == page.menu_id) {
|
if (id == page.menu_id) {
|
||||||
el += ' active';
|
el += ' active';
|
||||||
}
|
}
|
||||||
el += '" href="' + url_for(item.url) + '">';
|
el += '" href="' + url_for(md_link(item)) + '">';
|
||||||
el += __(item.title);
|
el += __(md_text(item));
|
||||||
el += '</a>';
|
el += '</a>';
|
||||||
}
|
}
|
||||||
el += '</nav>';
|
el += '</nav>';
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
<div class='logo-wrap'>
|
<div class='logo-wrap'>
|
||||||
<% if (theme.sidebar.logo.avatar.src || config.avatar) { %>
|
<% if (md_text(theme.sidebar.logo.avatar)) { %>
|
||||||
<a class='avatar' href='<%- theme.sidebar.logo.avatar.href || "/" %>'><img no-lazy src='<%- theme.sidebar.logo.avatar.src || config.avatar %>'/></a>
|
<a class='avatar' href='<%- url_for(md_link(theme.sidebar.logo.avatar) || "/") %>'><img no-lazy src='<%- md_text(theme.sidebar.logo.avatar) %>'/></a>
|
||||||
|
<% } %>
|
||||||
|
<% if (md_text(theme.sidebar.logo.title)) { %>
|
||||||
|
<a class='title' href='<%- url_for(md_link(theme.sidebar.logo.title) || "/") %>'><%- md_text(theme.sidebar.logo.title) %></a>
|
||||||
<% } %>
|
<% } %>
|
||||||
<a class='title' href='/'><%- theme.sidebar.logo.title || config.title %></a>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
/**
|
||||||
|
* md_link(theme.sidebar.menu['home']) is '/'
|
||||||
|
* md_text(theme.sidebar.menu['home']) is 'Home'
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
hexo.extend.helper.register('md_text', function(args) {
|
||||||
|
if (args == undefined) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
let tmp = args.split('](');
|
||||||
|
if (tmp.length > 1) {
|
||||||
|
tmp = tmp[0];
|
||||||
|
if (tmp.length > 1) {
|
||||||
|
tmp = tmp.substring(1, tmp.length);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (tmp == 'config.title') {
|
||||||
|
tmp = hexo.config.title;
|
||||||
|
} else if (tmp == 'config.avatar') {
|
||||||
|
tmp = hexo.config.avatar;
|
||||||
|
}
|
||||||
|
return tmp;
|
||||||
|
});
|
||||||
|
|
||||||
|
hexo.extend.helper.register('md_link', function(args) {
|
||||||
|
if (args == undefined) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
let tmp = args.split('](');
|
||||||
|
if (tmp.length > 1) {
|
||||||
|
tmp = tmp[1];
|
||||||
|
if (tmp.length > 1) {
|
||||||
|
tmp = tmp.substring(0, tmp.length-1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return tmp;
|
||||||
|
});
|
|
@ -20,6 +20,11 @@ trans2($op1, $op2)
|
||||||
-webkit-transition: $op1 0.2s ease-out, $op2 0.2s ease-out
|
-webkit-transition: $op1 0.2s ease-out, $op2 0.2s ease-out
|
||||||
-o-transition: $op1 0.2s ease-out, $op2 0.2s ease-out
|
-o-transition: $op1 0.2s ease-out, $op2 0.2s ease-out
|
||||||
|
|
||||||
|
trans2pro($op1, $t1, $op2, $t2)
|
||||||
|
transition: $op1 $t1 ease-out, $op2 $t2 ease-out
|
||||||
|
-moz-transition: $op1 $t1 ease-out, $op2 $t2 ease-out
|
||||||
|
-webkit-transition: $op1 $t1 ease-out, $op2 $t2 ease-out
|
||||||
|
-o-transition: $op1 $t1 ease-out, $op2 $t2 ease-out
|
||||||
|
|
||||||
txt-ellipsis()
|
txt-ellipsis()
|
||||||
white-space: nowrap
|
white-space: nowrap
|
||||||
|
|
|
@ -38,14 +38,13 @@ nav.cap
|
||||||
align-items: center
|
align-items: center
|
||||||
flex-direction: row
|
flex-direction: row
|
||||||
&:not([style]) a
|
&:not([style]) a
|
||||||
color: var(--text-p1)
|
color: $color-link
|
||||||
&[style] a
|
&[style] a
|
||||||
color: inherit
|
color: inherit
|
||||||
span.sep
|
span.sep
|
||||||
color: var(--text-p3)
|
color: var(--text-p3)
|
||||||
// a.cap:hover
|
a.cap:hover
|
||||||
// color: $color-cat-hover
|
color: $color-hover
|
||||||
// text-decoration: underline
|
|
||||||
div#post-meta
|
div#post-meta
|
||||||
margin-top: 2px
|
margin-top: 2px
|
||||||
|
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
img
|
|
||||||
max-width 100%
|
|
||||||
&.lazyload:not(.placeholder)
|
|
||||||
transition opacity .5s ease-out 0s
|
|
||||||
&:not(.loaded)
|
|
||||||
opacity: 0
|
|
||||||
&.loaded
|
|
||||||
opacity: 1
|
|
||||||
if hexo-config('plugins.lazyload.blurIn') == true
|
|
||||||
transition filter .25s ease-out 0s
|
|
||||||
&:not(.loaded)
|
|
||||||
filter blur(8px)
|
|
||||||
&.loaded
|
|
||||||
filter none
|
|
|
@ -4,8 +4,6 @@
|
||||||
.post-title
|
.post-title
|
||||||
margin: 0.5rem 0
|
margin: 0.5rem 0
|
||||||
line-height: 1.2
|
line-height: 1.2
|
||||||
color: var(--text-p2)
|
|
||||||
font-weight: 500
|
|
||||||
a
|
a
|
||||||
color: inherit
|
color: inherit
|
||||||
&:hover
|
&:hover
|
||||||
|
@ -13,5 +11,8 @@
|
||||||
&.read
|
&.read
|
||||||
color: var(--text-p3)
|
color: var(--text-p3)
|
||||||
font-size: $fs14
|
font-size: $fs14
|
||||||
|
font-weight: 500
|
||||||
&.unread
|
&.unread
|
||||||
|
color: var(--text-p1)
|
||||||
font-size: 1.75rem
|
font-size: 1.75rem
|
||||||
|
font-weight: 400
|
||||||
|
|
|
@ -70,7 +70,8 @@
|
||||||
height: 240px
|
height: 240px
|
||||||
@media screen and (max-width: $device-mobile-m)
|
@media screen and (max-width: $device-mobile-m)
|
||||||
height: 200px
|
height: 200px
|
||||||
trans1: transform 1s
|
&:not(.lazyload)
|
||||||
|
trans1: transform 1s
|
||||||
.post-list .post-card.post:hover
|
.post-list .post-card.post:hover
|
||||||
.post-title
|
.post-title
|
||||||
color: $color-hover
|
color: $color-hover
|
||||||
|
@ -92,7 +93,8 @@
|
||||||
align-items: center
|
align-items: center
|
||||||
img
|
img
|
||||||
object-fit: contain
|
object-fit: contain
|
||||||
trans1 transform 0.75s
|
img:not(.lazyload)
|
||||||
|
trans1: transform 0.75s
|
||||||
.post-list .post-card.wiki article .excerpt
|
.post-list .post-card.wiki article .excerpt
|
||||||
margin: 1rem
|
margin: 1rem
|
||||||
min-width: 220px
|
min-width: 220px
|
||||||
|
|
|
@ -30,6 +30,8 @@
|
||||||
background: $color-hover
|
background: $color-hover
|
||||||
img
|
img
|
||||||
object-fit: cover
|
object-fit: cover
|
||||||
|
width: 100%
|
||||||
|
height: 100%
|
||||||
.title
|
.title
|
||||||
font-size: 1.75rem
|
font-size: 1.75rem
|
||||||
font-weight: 900
|
font-weight: 900
|
||||||
|
@ -79,7 +81,7 @@ nav.menu
|
||||||
margin: 1rem 0 2rem 0
|
margin: 1rem 0 2rem 0
|
||||||
.widget-header
|
.widget-header
|
||||||
display: flex
|
display: flex
|
||||||
font-size: 1rem
|
font-size: 1.25rem
|
||||||
color: var(--text-meta)
|
color: var(--text-meta)
|
||||||
justify-content: space-between
|
justify-content: space-between
|
||||||
align-items: center
|
align-items: center
|
||||||
|
@ -90,8 +92,6 @@ nav.menu
|
||||||
background: var(--site-bg)
|
background: var(--site-bg)
|
||||||
padding: 2px 0
|
padding: 2px 0
|
||||||
z-index 1
|
z-index 1
|
||||||
.name
|
|
||||||
font-size: 1rem
|
|
||||||
.cap-action
|
.cap-action
|
||||||
hover-block 4px 4px
|
hover-block 4px 4px
|
||||||
line-height: 0
|
line-height: 0
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
@import "common/*"
|
@import "common/*"
|
||||||
|
|
||||||
// 根据主题配置加载
|
// 根据主题配置加载
|
||||||
|
if hexo-config('plugins.lazyload.enable')
|
||||||
|
@import 'lazyload'
|
||||||
if hexo-config('plugins.swiper.enable')
|
if hexo-config('plugins.swiper.enable')
|
||||||
@import 'swiper'
|
@import 'swiper'
|
||||||
if hexo-config('plugins.scrollreveal.enable')
|
if hexo-config('plugins.scrollreveal.enable')
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
if hexo-config('plugins.lazyload.blurIn') == true
|
||||||
|
img.lazyload:not(.placeholder)
|
||||||
|
trans2pro: transform 0.75s filter 0.25s
|
||||||
|
&:not(.loaded)
|
||||||
|
filter blur(8px)
|
||||||
|
&.loaded
|
||||||
|
filter none
|
||||||
|
else
|
||||||
|
img.lazyload:not(.placeholder)
|
||||||
|
trans2pro: transform 0.75s opacity 0.5s
|
||||||
|
&:not(.loaded)
|
||||||
|
opacity: 0
|
||||||
|
&.loaded
|
||||||
|
opacity: 1
|
Loading…
Reference in New Issue