Merge branch 'v1.2' into myblog

i18n
xaoxuu 5 years ago
commit 5f951133bd
  1. 154
      _config.yml
  2. 3
      languages/en.yml
  3. 5
      languages/zh-CN.yml
  4. 5
      languages/zh-HK.yml
  5. 5
      languages/zh-TW.yml
  6. 2
      layout/_partial/article.ejs
  7. 8
      layout/_partial/footer.ejs
  8. 6
      layout/_partial/head.ejs
  9. 15
      layout/_partial/header.ejs
  10. 28
      layout/_partial/scripts.ejs
  11. 4
      layout/_partial/side.ejs
  12. 2
      layout/_third-party/comments.ejs
  13. 4
      layout/_third-party/share.ejs
  14. 4
      layout/_widget/author.ejs
  15. 2
      layout/_widget/header.ejs
  16. 2
      layout/_widget/tagcloud.ejs
  17. 2
      layout/archive.ejs
  18. 75
      layout/blog.ejs
  19. 2
      layout/category.ejs
  20. 67
      layout/index.ejs
  21. 19
      layout/layout.ejs
  22. 2
      layout/links.ejs
  23. 2
      layout/page.ejs
  24. 2
      layout/post.ejs
  25. 2
      layout/tag.ejs
  26. 18
      source/js/app.js
  27. 67
      source/less/_base.less
  28. 20
      source/less/_header.less

@ -1,13 +1,7 @@
# 这一页的内容可以修改值,但是不要删除行。初次使用主题请务必阅读官方文档!!!
# 这一页的内容可以修改值,但是不要删除行。初次使用主题请务必阅读官方文档!!!
# 这一页的内容可以修改值,但是不要删除行。初次使用主题请务必阅读官方文档!!!
############################### 基本信息 ###############################
info:
name: Material X
docs: https://xaoxuu.com/wiki/material-x/
# 主题的CDN地址。如需启用CDN,请在主目录的config中设置,详见文档。
cdn: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-material-x@19.3.31/
@ -33,7 +27,7 @@ services:
qrcode: true # 需要安装插件 npm i -S hexo-helper-qrcode
############################### 杂项 ###############################
############################### 默认值 ###############################
# 音乐控件的默认配置,如果sidebar或者page里没有提供,就取这里的参数
music:
color: '#1BCDFC' # 主题色
@ -44,12 +38,152 @@ music:
volume: 0.7 # 音量, 0~1
autoplay: false # 自动播放
# 友链页头像占位图
loading_img: https://cdn.jsdelivr.net/gh/xaoxuu/assets@master/avatar/avatar.png
# Search
############################### 自定义 ###############################
# 主页封面
home_cover:
title: xaoxuu
search_placeholder: 'la víspera de la tormenta'
# 主页封面菜单
menu:
- name: 近期文章
icon: fas fa-clock
url: '#posts'
- name: 开源库
icon: fas fa-code-branch
url: https://github.com/xaoxuu/
- name: 应用程序
icon: fas fa-cube
url: https://xaoxuu.com/projects/
- name: 归档
icon: fas fa-archive
url: archives/
- name: 关于
icon: fas fa-info-circle
url: about/
# 导航栏菜单
menu:
- name: Cocoa Dev
icon: fab fa-apple
url: categories/cocoa-dev/
- name: Dev
icon: fas fa-laptop-code
url: categories/dev/
- name: Life
icon: fas fa-coffee
url: categories/life/
# 侧边栏小部件
sidebar:
- widget: author
avatar: https://cdn.jsdelivr.net/gh/xaoxuu/assets@master/avatar/avatar.png
social: true
- widget: toc
- widget: list
icon: fas fa-map-signs
title: 站内导航
rows:
- name: 开源项目
icon: fas fa-flask
url: https://xaoxuu.com/projects/
- name: 文章归档
icon: fas fa-archive
url: archives/
- name: 我的友链
icon: fas fa-link
url: friends/
- name: 歌单分享
icon: fas fa-compact-disc
url: music/
- name: 关于小站
icon: fas fa-info-circle
url: about/
- widget: category
more:
icon: fas fa-expand-arrows-alt
url: categories/
- widget: tagcloud
icon: fas fa-fire
more:
icon: fas fa-expand-arrows-alt
url: tags/
- widget: related_posts
- widget: music
icon: fas fa-compact-disc
title: "最近在听"
more:
icon: far fa-heart
url: https://music.163.com/#/user/home?id=63035382
server: netease # netease(网易云音乐)tencent(QQ音乐) xiami(虾米) kugou(酷狗)
type: playlist # song (单曲) album (专辑) playlist (歌单) search (搜索)
id: 2615636388 # 歌曲/专辑/歌单 ID
# 社交信息
social:
- icon: fas fa-rss
url: atom.xml
- icon: fas fa-envelope
url: mailto:me@xaoxuu.com
- icon: fab fa-github
url: https://github.com/xaoxuu
- icon: fas fa-headphones-alt
url: https://music.163.com/#/user/home?id=63035382
# 分享按钮
share:
- id: qq
name: QQ好友
img: https://cdn.jsdelivr.net/gh/xaoxuu/assets@19.1.9/logo/128/qq.png
- id: qzone
name: QQ空间
img: https://cdn.jsdelivr.net/gh/xaoxuu/assets@19.1.9/logo/128/qzone.png
- id: qrcode
name: 微信
img: https://cdn.jsdelivr.net/gh/xaoxuu/assets@19.1.9/logo/128/wechat.png
- id: weibo
name: 微博
img: https://cdn.jsdelivr.net/gh/xaoxuu/assets@19.1.9/logo/128/weibo.png
- id: qrcode
name: QRcode
img: https://cdn.jsdelivr.net/gh/xaoxuu/assets@19.1.9/logo/128/qrcode.png
# footer: 页脚文字,支持markdown
############################### 评论 ###############################
# disqus_shortname: xaoxuu
# livere_uid:
# valine
valine:
enable: true # 如果你想用Valine评论系统,请设置enable为true
# 还需要在根目录配置文件中添加下面这三行内容
# leancloud:
# app_id: 你的appId
# app_key: 你的appKey
guest_info: nick,mail,link #valine comment header info
placeholder: 快来评论吧~ # valine comment input placeholder(like: Please leave your footprints )
avatar: mp # gravatar style https://valine.js.org/avatar
pageSize: 20 # comment list page size
verify: false # valine verify code (true/false)
notify: false # valine mail notify (true/false)
lang: zh-cn
highlight: false
############################### 杂项,请勿删除 ###############################
# 搜索配置
search:
enable: true
service: hexo
@ -67,6 +201,6 @@ search:
# baidu
baidu_api_id:
# Less
# Less渲染
less:
compress: true

@ -1,7 +1,7 @@
sidebar:
category: Categories
tagcloud: Hot Tags
toc: Table of Contents
toc: TOC
related_posts: Related Posts
post:
top: Top
@ -28,7 +28,6 @@ footer:
times: times
search:
placeholder: Search
placeholder_home: ' '
symbol:
comma: ", "
period: ". "

@ -1,7 +1,7 @@
sidebar:
category: 所有分类
category: 文章分类
tagcloud: 热门标签
toc: 目录
toc: 文目录
related_posts: 相关文章
post:
top: 置顶
@ -28,7 +28,6 @@ footer:
times:
search:
placeholder: 搜索
placeholder_home: 'la víspera de la tormenta'
symbol:
comma: ","
period: "。"

@ -1,7 +1,7 @@
sidebar:
category: 所有分類
category: 文章分類
tagcloud: 熱門標籤
toc: 目錄
toc: 文目錄
related_posts: 相關文章
post:
top: 置頂
@ -28,7 +28,6 @@ footer:
  times:
search:
placeholder: 搜尋
placeholder_home: ' '
symbol:
comma: ","
period: "。"

@ -1,7 +1,7 @@
sidebar:
category: 所有分類
category: 文章分類
tagcloud: 熱門標籤
toc: 目錄
toc: 文目錄
related_posts: 相關文章
post:
top: 置頂
@ -28,7 +28,6 @@ footer:
times:
search:
placeholder: 搜尋
placeholder_home: ' '
symbol:
comma: ","
period: "。"

@ -25,7 +25,7 @@
%>
<%- items.join(' ') %>
<% } %>
<% if (theme.services && theme.services.share == true && (config.share || config.mob) && (!page.meta || page.meta.share != false)) { %>
<% if (theme.services && theme.services.share == true && theme.share && (!page.meta || page.meta.share != false)) { %>
<%- partial('../_third-party/share') %>
<% } %>
</div>

@ -1,13 +1,13 @@
<footer id="footer" class="clearfix">
<% if (config.footer) { %>
<% if (theme.footer) { %>
<div class="footer">
<%- markdown(config.footer) %>
<%- markdown(theme.footer) %>
</div>
<br>
<%}%>
<% if (config.social) { %>
<% if (theme.social) { %>
<div class="social-wrapper">
<% (config.social||[]).forEach(function(value){ %>
<% (theme.social||[]).forEach(function(value){ %>
<% if (value.url && value.icon) { %>
<a href="<%= url_for(value.url) %>" class="social <%- value.icon %> flat-btn" target="_blank" rel="external"></a>
<%}%>

@ -59,12 +59,8 @@
<link rel="shortcut icon" type='image/x-icon' href="<%- url_for(config.favicon) %>">
<% } %>
<% if (theme.services && theme.services.cdn == true && config.theme_cdn) { %>
<% if (config.theme_cdn == true) { %>
<% if (theme.services.cdn == true) { %>
<%- css(theme.info.cdn + 'css/style.css') %>
<% } else if (config.theme_cdn.length > 0) { %>
<%- css(config.theme_cdn + 'css/style.css') %>
<% } %>
<% } else { %>
<%- css('style.css') %>
<% } %>

@ -1,8 +1,9 @@
<div id="loading-bar-wrapper">
<div id="loading-bar" class="<%= theme.style %>"></div>
</div>
<header class="l_header <%= theme.style %>">
<div id="loading-bar-wrapper">
<div id="loading-bar" class="<%= theme.style %>"></div>
</div>
<div class='wrapper'>
<div class="nav-main container container--flex">
<a class="logo flat-box" href='<%= url_for("/") %>' >
@ -14,8 +15,8 @@
</a>
<div class='menu'>
<ul class='h-list'>
<% if (config.menu) { %>
<% (config.menu || []).forEach(function(value){ %>
<% if (theme.menu) { %>
<% (theme.menu || []).forEach(function(value){ %>
<li>
<a id="<%= url_for(value.url).replace(/\/|%/g, "")?url_for(value.url).replace(/\/|%/g, ""):"home" %>"
class="nav flat-box" href="<%= url_for(value.url) %>">
@ -56,8 +57,8 @@
<header>
<nav class="menu">
<ul>
<% if (config.menu) { %>
<% (config.menu || []).forEach(function(value){ %>
<% if (theme.menu) { %>
<% (theme.menu || []).forEach(function(value){ %>
<li>
<a id="<%= url_for(value.url).replace(/\/|%/g, "")?url_for(value.url).replace(/\/|%/g, ""):"home" %>" class="nav flat-box" href="<%= url_for(value.url) %>">
<i class='<%= value.icon %> fa-fw'></i>&nbsp;<%= __('navbar.'+value.name) == ('navbar.'+value.name) ? value.name : __('navbar.'+value.name) %>

@ -70,7 +70,7 @@
if (config.livere_uid) {
enableLivere = true;
}
if (config.valine && config.valine.app_id && config.valine.app_key) {
if (theme.valine && theme.valine.enable && config.leancloud) {
enableValine = true;
}
}
@ -115,11 +115,11 @@
<% } %>
<script>
var GUEST_INFO = ['nick','mail','link'];
var guest_info = '<%= config.valine.guest_info %>'.split(',').filter(function(item){
var guest_info = '<%= theme.valine.guest_info %>'.split(',').filter(function(item){
return GUEST_INFO.indexOf(item) > -1
});
var notify = '<%= config.valine.notify %>' == true;
var verify = '<%= config.valine.verify %>' == true;
var notify = '<%= theme.valine.notify %>' == true;
var verify = '<%= theme.valine.verify %>' == true;
var valine = new Valine();
valine.init({
el: '#valine_container',
@ -129,24 +129,20 @@
<% if(page.valine && page.valine.path) { %>
path: "<%= page.valine.path %>",
<% } %>
appId: "<%= config.valine.app_id %>",
appKey: "<%= config.valine.app_key %>",
placeholder: "<%= (page.valine && page.valine.placeholder) ? page.valine.placeholder : config.valine.placeholder %>",
pageSize:'<%= config.valine.pageSize %>',
avatar:'<%= config.valine.avatar %>',
lang:'<%= config.valine.lang %>',
highlight:'<%= config.valine.highlight %>'
appId: "<%= config.leancloud.app_id %>",
appKey: "<%= config.leancloud.app_key %>",
placeholder: "<%= (page.valine && page.valine.placeholder) ? page.valine.placeholder : theme.valine.placeholder %>",
pageSize:'<%= theme.valine.pageSize %>',
avatar:'<%= theme.valine.avatar %>',
lang:'<%= theme.valine.lang %>',
highlight:'<%= theme.valine.highlight %>'
})
</script>
<% } %>
<% if (theme.services.cdn == true && config.theme_cdn) { %>
<% if (config.theme_cdn == true) { %>
<% if (theme.services.cdn == true) { %>
<%- js([theme.info.cdn + 'js/app.js', theme.info.cdn + 'js/search.js']) %>
<% } else if (config.theme_cdn.length > 0) { %>
<%- js([config.theme_cdn + 'js/app.js', config.theme_cdn + 'js/search.js']) %>
<% } %>
<% } else { %>
<%- js(['js/app.js', 'js/search.js']) %>
<% } %>

@ -1,9 +1,9 @@
<aside class='l_side'>
<% if (config.widgets && config.widgets.length){ %>
<% if (theme.sidebar && theme.sidebar.length){ %>
<%
let supportWidgets = ['author', 'category', 'list', 'music', 'tagcloud', 'toc', 'plain', 'related_posts'];
%>
<% config.widgets.forEach(function(item){ %>
<% theme.sidebar.forEach(function(item){ %>
<% if (item.enable != false){ %>
<% let widget_name = item.widget ? item.widget : 'plain'; %>
<% if (supportWidgets.indexOf(widget_name) > -1){ %>

@ -10,7 +10,7 @@
if (config.livere_uid) {
enableLivere = true;
}
if (config.valine && config.valine.app_id && config.valine.app_key) {
if (theme.valine && theme.valine.enable && config.leancloud) {
enableValine = true;
}
}

@ -1,8 +1,8 @@
<% if (theme.services && theme.services.share == true && (config.share || config.mob) && page.layout == 'post' && page.share != false) { %>
<% if (theme.services && theme.services.share == true && theme.share && page.layout == 'post' && page.share != false) { %>
<div class="new-meta-item share -mob-share-list">
<i class="fas fa-share-alt" aria-hidden="true"></i>
<div class="-mob-share-list share-body">
<% ((config.share || config.mob.list)||[]).forEach(function(item){ %>
<% (theme.share||[]).forEach(function(item){ %>
<% if (item.id == 'qrcode' && theme.services.qrcode == true){ %>
<a class='qrcode' rel="external nofollow noopener noreferrer" href='<%- qrcode(url) %>'>
<% if (item.img){ %>

@ -19,9 +19,9 @@
<% } %>
</div>
<% } %>
<% if (item.social == true && config.social) { %>
<% if (item.social == true && theme.social) { %>
<div class="social-wrapper">
<% (config.social||[]).forEach(function(value){ %>
<% (theme.social||[]).forEach(function(value){ %>
<% if (value.url && value.icon) { %>
<a href="<%- url_for(value.url) %>" class="social flat-btn" target="_blank" rel="external"><i class="social <%- value.icon %>" aria-hidden="true"></i></a>
<%}%>

@ -7,7 +7,7 @@
<% if (item.widget == 'toc') { %>
<div class='wrapper'><a class="s-toc rightBtn" rel="external nofollow noopener noreferrer" href="javascript:void(0)"><i class="fas fa-thumbtack fa-fw"></i></a></div>
<% } else if(item.more && item.more.url) { %>
<a class="rightBtn<%- item.more.animate ? ' ' + item.more.animate : '' %>" target="_blank"
<a class="rightBtn<%- item.more.animate ? ' ' + item.more.animate : '' %>"
rel="external nofollow noopener noreferrer"
href="<%- url_for(item.more.url) %>"
title="<%- item.more.url %>">

@ -1,6 +1,6 @@
<% if (site.tags.length){ %>
<section class='<%- item.widget %>'>
<%- partial('header', {item: item, defIcon: 'fas fa-hashtag', defTitle: __('sidebar.tagcloud')}) %>
<%- partial('header', {item: item, defIcon: 'fas fa-fire', defTitle: __('sidebar.tagcloud')}) %>
<div class='content <%= theme.style %>'>
<%- tagcloud(site.tags, {
min_font: 14,

@ -1,5 +1,3 @@
<%- partial('_partial/header', null, {cache: !config.relative_link, path: path}) %>
<div class='l_main'>
<% if (page.year || page.month) { %>
<%- partial('_partial/archive') %>

@ -0,0 +1,75 @@
<div class='l_main'>
<% if (site.posts && site.posts.length > 0) { %>
<section class="post-list">
<% if (page.prev == 0) { %>
<% site.posts.each(function(post){ %>
<% if (post.top) { %>
<div class='post-wrapper'>
<%- partial('_partial/post', {post: post}) %>
</div>
<% } %>
<% }) %>
<% } %>
<% site.posts.sort(config.index_generator.order_by).each(function(post){ %>
<% if (!post.top) { %>
<div class='post-wrapper'>
<%- partial('_partial/post', {post: post}) %>
</div>
<% } %>
<% }) %>
</section>
<% if (page.total > 1) { %>
<br>
<div class="prev-next">
<div class="prev-next">
<% if (page.prev != 0) { %>
<a class="prev" rel="prev" href="<%= url_for(page.prev_link) %>">
<section class="post prev" >
<i class="fas fa-chevron-left" aria-hidden="true"></i>&nbsp;<%- __('post.prev_page') %>&nbsp;
</section>
</a>
<% } %>
<p class="current">
<%= page.current%> / <%= page.total%>
</p>
<% if (page.next != 0) { %>
<a class="next" rel="next" href="<%= url_for(page.next_link) %>">
<section class="post next">
&nbsp;<%- __('post.next_page') %>&nbsp;<i class="fas fa-chevron-right" aria-hidden="true"></i>
</section>
</a>
<% } %>
</div>
</div>
<% } %>
<% } %>
<% if (page.posts && page.posts.length > 0) { %>
<!-- 根据主题中的设置决定是否在archive中针对摘要部分的MathJax公式加载mathjax.js文件 -->
<%
var need_mathjax = false;
page.posts.each(function(post){
if (post.mathjax){
if (post.mathjax != "internal") {
need_mathjax = true;
}
}
});
%>
<% if (need_mathjax){ %>
<%- partial('_partial/mathjax') %>
<% } %>
<% } %>
</div>
<%- partial('_partial/side') %>
<%- partial('_partial/footer', null, {cache: !config.relative_link}) %>

@ -1,4 +1,4 @@
<%- partial('_partial/header', null, {cache: !config.relative_link, path: path}) %>
<div class='l_main'>
<%- partial('_partial/archive') %>
</div>

@ -1,26 +1,49 @@
<div class='home-cover'>
<h1 class='title'>xaoxuu</h1>
<br>
<% if (theme.search.enable === true) { %>
<div class="m_search">
<form name="searchform" class="form u-search-form">
<input type="text" class="input u-search-input" placeholder="<%- __('search.placeholder_home') %>" />
<span class="icon"><i class="fas fa-search fa-fw"></i></span>
</form>
<div class="home-wrapper">
<% if (page.prev == 0) { %>
<div class='home-cover'>
<h1 class='title'><%- theme.home_cover.title %></h1>
<br>
<% if (theme.search.enable === true) { %>
<div class="m_search">
<form name="searchform" class="form u-search-form">
<input type="text" class="input u-search-input" placeholder="<%- theme.home_cover.search_placeholder %>" />
<span class="icon"><i class="fas fa-search fa-fw"></i></span>
</form>
</div>
<% } %>
<div class='menu'>
<ul class='h-list'>
<% if (theme.home_cover.menu) { %>
<% (theme.home_cover.menu || []).forEach(function(value){ %>
<li>
<% if (value.url == '#posts') { %>
<a id="<%= url_for(value.url).replace(/\/|%/g, "")?url_for(value.url).replace(/\/|%/g, ""):"home" %>"
class="posts" >
<i class='<%= value.icon %> fa-fw'></i>&nbsp;<%= __('navbar.'+value.name) == ('navbar.'+value.name) ? value.name : __('navbar.'+value.name) %>
</a>
<% } else { %>
<a id="<%= url_for(value.url).replace(/\/|%/g, "")?url_for(value.url).replace(/\/|%/g, ""):"home" %>"
class="nav home" href="<%= url_for(value.url) %>" >
<i class='<%= value.icon %> fa-fw'></i>&nbsp;<%= __('navbar.'+value.name) == ('navbar.'+value.name) ? value.name : __('navbar.'+value.name) %>
</a>
<% } %>
</li>
<%})%>
<% } %>
</ul>
</div>
</div>
<% } %>
<div class='menu'>
<ul class='h-list'>
<% if (config.menu) { %>
<% (config.menu || []).forEach(function(value){ %>
<li>
<a id="<%= url_for(value.url).replace(/\/|%/g, "")?url_for(value.url).replace(/\/|%/g, ""):"home" %>"
class="nav flat-box" href="<%= url_for(value.url) %>">
<i class='<%= value.icon %> fa-fw'></i>&nbsp;<%= __('navbar.'+value.name) == ('navbar.'+value.name) ? value.name : __('navbar.'+value.name) %>
</a>
</li>
<%})%>
<% } %>
</ul>
<%- partial('_partial/header', null, {cache: !config.relative_link, path: path}) %>
</div>
<div class="l_body" id='posts'>
<div class='container clearfix'>
<div class='l_main'>
<%- partial('_partial/archive') %>
</div>
<%- partial('_partial/side') %>
<%- partial('_partial/footer', null, {cache: !config.relative_link}) %>
<script>setLoadingBarProgress(60);</script>
</div>
<a class="s-top fas fa-arrow-up fa-fw" href='javascript:void(0)'></a>
</div>

@ -2,13 +2,20 @@
<html>
<%- partial('_partial/head') %>
<body>
<div class="l_body">
<div class='container clearfix'>
<% if (is_home()) { %>
<%- body %>
<script>setLoadingBarProgress(60);</script>
</div>
<a class="s-top fas fa-arrow-up fa-fw" href='javascript:void(0)'></a>
</div>
<% } else { %>
<%- partial('_partial/header', null, {cache: !config.relative_link, path: path}) %>
<div class="l_body">
<div class='container clearfix'>
<%- body %>
<script>setLoadingBarProgress(60);</script>
</div>
<a class="s-top fas fa-arrow-up fa-fw" href='javascript:void(0)'></a>
</div>
<% } %>
<%- partial('_partial/scripts') %>
<script>setLoadingBarProgress(100);</script>
</body>

@ -1,4 +1,4 @@
<%- partial('_partial/header', null, {cache: !config.relative_link, path: path}) %>
<div class='l_main'>
<article id="<%= page.layout %>" class="post white-box article-type-<%= page.layout %>" itemscope itemprop="blogPost">
<%- partial('_partial/meta',{post:page}) %>

@ -1,4 +1,4 @@
<%- partial('_partial/header', null, {cache: !config.relative_link, path: path}) %>
<div class='l_main'>
<%- partial('_partial/article', {post: page, index: false}) %>
</div>

@ -1,4 +1,4 @@
<%- partial('_partial/header', null, {cache: !config.relative_link, path: path}) %>
<div class='l_main'>
<%- partial('_partial/article', {post: page, index: false}) %>
</div>

@ -1,4 +1,4 @@
<%- partial('_partial/header', null, {cache: !config.relative_link, path: path}) %>
<div class='l_main'>
<%- partial('_partial/archive') %>
</div>

@ -13,6 +13,7 @@ var customSearch;
function setBackToTop(){
const $top = $('.s-top', '.l_body');
let pos = document.body.scrollTop;
const $header = $('.l_header', '.home-wrapper');
$(document, window).scroll(() => {
const scrollTop = $(window).scrollTop();
const del = scrollTop - pos;
@ -28,8 +29,14 @@ var customSearch;
pos = scrollTop;
$top.removeClass('show').removeClass('hl');
}
$top.click(()=>scrolltoElement(document.body));
if (scrollTop > 400) {
$header.addClass('show');
} else {
$header.removeClass('show');
}
});
$top.click(()=>scrolltoElement(document.body));
}
function setHeader() {
@ -63,6 +70,8 @@ var customSearch;
$toc.click((e) => { e.stopPropagation(); $tocTarget.toggleClass('active'); });
} else $toc.remove();
}
function setHeaderMenu() {
@ -219,6 +228,13 @@ var customSearch;
$('#loading-bar-wrapper').fadeOut(500);
}, 300);
// posts
const $postsBtn = $('.menu .posts');
const $postsTarget = $('.l_body');
if ($postsBtn.length && $postsTarget) {
$postsBtn.click(e => { e.preventDefault(); e.stopPropagation(); scrolltoElement($postsTarget); });
}
if (SEARCH_SERVICE === 'google') {
customSearch = new GoogleCustomSearch({
apiKey: GOOGLE_CUSTOM_SEARCH_API_KEY,

@ -14,7 +14,6 @@ html {
color: @color_text_main;
width: 100%;
height: 100%;
padding-top: @height_navbar;
font-family: @fontfamily_base;
font-size: @fontsize_base;
line-height: 1.5rem;
@ -44,16 +43,15 @@ body {
}
.home-cover{
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100vh;
// background: white;
// height: 100vh - @height_navbar - @gap;
height: ~"calc(100vh - @{gap} - @{height_navbar})";
display: flex;
flex-wrap: wrap;
flex-direction: column;
// background: white;
margin-bottom: 2*@gap;
align-items: center;
align-self: center;
@ -95,48 +93,47 @@ body {
.input {
display:block;
font-size: @fontsize_base;
line-height: @height_navbar - @gap;
line-height: @fontsize_base*2.2;
margin: 0;
width: 100%;
color: fade(@color_text_in_header, 60%);
padding-left: @fontsize_base + @gap - 2px;
padding-left: @fontsize_base + @gap;
padding-top: 2px;
@media(max-width: @on_phone){
padding-left: @fontsize_base + @gap - 2px;
padding-left: @fontsize_base + @gap;
}
height: @height_navbar - @gap;
line-height: @height_navbar - @gap;
font-family: @fontfamily_base;
border: none;
border-radius: @border_radius_searchbar;
background: fade(@theme_cardbg, 15%);
background: white;
box-sizing: border-box;
-webkit-appearance: none;
box-shadow: none;
border: 1px dashed transparent;
.enable-trans();
color: fade(@theme_main, 60%);
border-radius: @height_navbar;
~ .icon{
color: fade(@color_text_in_header, 60%);
line-height: @fontsize_base*2.2+4px;
padding-left: 2px;
padding-top: 2px;
color: fade(@color_text_main, 80%);
}
.set-placeholder({color: fade(@color_text_in_header, 60%)});
.set-placeholder({color: fade(@color_text_main, 80%)});
&:hover{
border: 1px dashed fade(@color_text_in_header, 60%);
border: 1px dashed @theme_main;
}
&:focus {
~ .icon{
color: @color_text_in_header;
color: @theme_main;
}
color: @color_text_in_header;
border: 1px solid fade(@color_text_in_header, 60%);
// .set-placeholder({color: @black});
color: @theme_main;
border: 1px solid @theme_main;
}
}
}
background: @theme_cardbg;
&, a{
color: @theme_main;
}
box-shadow: @boxshadow_card_normal; // 适合白色导航栏背景
.menu{
margin-top: 4vh;
ul {
@ -180,28 +177,7 @@ body {
}
}
}
.m_search {
.input {
color: fade(@theme_main, 60%);
background: @theme_background;
~ .icon{
color: fade(@theme_main, 60%);
}
.set-placeholder({color: fade(@theme_main, 60%)});
&:hover{
border: 1px dashed fade(@theme_main, 60%);
}
&:focus {
~ .icon{
color: @theme_main;
}
color: @theme_main;
background: fade(@theme_main, 15%);
border: 1px solid fade(@theme_main, 60%);
}
}
}
}
@ -484,9 +460,10 @@ ul.h-list {
.l_body {
position: relative;
padding: 2*@gap @gap @gap;
margin: @gap;
margin-top: @height_navbar + @gap;
@media(max-width: @on_phone) {
padding: @gap 0 @gap;
margin: @height_navbar+@gap 0 @gap;
border-radius: 0;
}
.s-top{

@ -1,19 +1,22 @@
.l_header {
position:fixed;
position: fixed;
z-index: 9999;
top:0;
left:0;
width:100%;
top: 0;
left: 0;
overflow: hidden;
width: 100%;
font-size: @fontsize_base;
line-height: @height_navbar;
height: @height_navbar;
overflow: hidden;
font-family: @fontfamily_base;
padding: 0 @gap;
margin-bottom: @gap;
.wrapper{
padding: auto @gap;
.enable-trans();
}
.wrapper.sub{
.enable-trans();
transform: translateY(-@height_navbar);
@ -336,3 +339,12 @@
}
}
}
.home-wrapper{
.l_header{
.enable-trans(0.5s);
transform: translateY(-1.5*@height_navbar);
&.show{
transform: translateY(0);
}
}
}

Loading…
Cancel
Save