mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-12 22:17:06 +08:00
1. fix Traditional Chinese and Simplified Chinese Conversion
2. Add the option to hidden the aside items #2 3. Add the option to change subtitle 4. Add the option to change the font 5. fix read-mode and night-mode 6. fix the bugs of the cover #2
This commit is contained in:
@@ -19,6 +19,8 @@ git clone https://github.com/jerryc127/hexo-theme-butterfly.git themes/Butterfly
|
|||||||
theme: Butterfly
|
theme: Butterfly
|
||||||
```
|
```
|
||||||
|
|
||||||
|
>如果你没有pug以及stylus的渲染器,请下载安装: npm install hexo-renderer-jade hexo-renderer-stylus --save or yarn add hexo-renderer-jade hexo-renderer-stylus
|
||||||
|
|
||||||
## 文档
|
## 文档
|
||||||
可查看[这里](https://molunerfinn.com/hexo-theme-melody-doc/zh-Hans/#%E7%89%B9%E6%80%A7)
|
可查看[这里](https://molunerfinn.com/hexo-theme-melody-doc/zh-Hans/#%E7%89%B9%E6%80%A7)
|
||||||
|
|
||||||
@@ -36,6 +38,7 @@ comments:
|
|||||||
reward:
|
reward:
|
||||||
description:
|
description:
|
||||||
top_img:
|
top_img:
|
||||||
|
cover: (封面)
|
||||||
---
|
---
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
73
_config.yml
73
_config.yml
@@ -27,7 +27,7 @@ menu:
|
|||||||
# Favicon
|
# Favicon
|
||||||
# use my-favicon.ico to avoid duplicate favicon of melody theme
|
# use my-favicon.ico to avoid duplicate favicon of melody theme
|
||||||
# ---------------
|
# ---------------
|
||||||
favicon: /img/favicon.png
|
favicon: /img/favicon.ico
|
||||||
|
|
||||||
# PWA
|
# PWA
|
||||||
# See https://github.com/JLHwung/hexo-offline
|
# See https://github.com/JLHwung/hexo-offline
|
||||||
@@ -46,6 +46,7 @@ favicon: /img/favicon.png
|
|||||||
# Highlight theme
|
# Highlight theme
|
||||||
# ---------------
|
# ---------------
|
||||||
highlight_theme: light
|
highlight_theme: light
|
||||||
|
highlight_copy: true
|
||||||
|
|
||||||
code_word_wrap: false
|
code_word_wrap: false
|
||||||
|
|
||||||
@@ -74,7 +75,7 @@ algolia_search:
|
|||||||
# Please see doc for more details: https://molunerfinn.com/hexo-theme-melody-doc/#/third-party-support?id=local-search
|
# Please see doc for more details: https://molunerfinn.com/hexo-theme-melody-doc/#/third-party-support?id=local-search
|
||||||
# ---------------
|
# ---------------
|
||||||
local_search:
|
local_search:
|
||||||
enable: true
|
enable: false
|
||||||
labels:
|
labels:
|
||||||
input_placeholder: Search for Posts
|
input_placeholder: Search for Posts
|
||||||
hits_empty: "We didn't find any results for the search: ${query}" # if there are no result
|
hits_empty: "We didn't find any results for the search: ${query}" # if there are no result
|
||||||
@@ -234,7 +235,7 @@ disqus:
|
|||||||
|
|
||||||
# valine comment system. https://valine.js.org
|
# valine comment system. https://valine.js.org
|
||||||
valine:
|
valine:
|
||||||
enable: false # if you want use valine,please set this value is ture
|
enable: false # if you want use valine,please set this value is true
|
||||||
appId: # leancloud application app id
|
appId: # leancloud application app id
|
||||||
appKey: # leancloud application app key
|
appKey: # leancloud application app key
|
||||||
notify: false # valine mail notify (true/false) https://github.com/xCss/Valine/wiki
|
notify: false # valine mail notify (true/false) https://github.com/xCss/Valine/wiki
|
||||||
@@ -305,22 +306,17 @@ Flink:
|
|||||||
|
|
||||||
flinks:
|
flinks:
|
||||||
[
|
[
|
||||||
{'name': '夢魘小棧',
|
{'name': 'JerryC',
|
||||||
'link': 'https://blog.ihoey.com',
|
'link': 'https://jerryc.me/',
|
||||||
'avatar': 'https://cdn.dode.top/avatar.png',
|
'avatar': 'https://jerryc.me/img/avatar.png',
|
||||||
'descr': '心,若沒有棲息的地方,到哪裏都是流浪......'},
|
'descr': '今日事,今日畢'},
|
||||||
{'name': '冰峯博客',
|
{'name': 'molunerfinn',
|
||||||
'link':'https://www.ad-s.cn/',
|
'link':'https://molunerfinn.com',
|
||||||
'avatar': 'https://secure.gravatar.com/avatar/4074cd3e035c6e5796f6c263ef8ef0b8?s=56&d=wavatar&r=g',
|
'avatar': 'https://blog-1251750343.cos.ap-beijing.myqcloud.com/blog/avatar.jpeg',
|
||||||
'descr': '男人就應該保持冷靜,沸騰的水只會被蒸發掉。'}
|
'descr': 'For MElody'}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
## chinese traditional to Simplified
|
|
||||||
translate:
|
|
||||||
enable: true
|
|
||||||
|
|
||||||
|
|
||||||
runtimeshow:
|
runtimeshow:
|
||||||
enable: true
|
enable: true
|
||||||
start_date: 6/7/2018 00:00:00
|
start_date: 6/7/2018 00:00:00
|
||||||
@@ -366,15 +362,54 @@ canvas_ribbon_piao:
|
|||||||
enable: true
|
enable: true
|
||||||
|
|
||||||
|
|
||||||
# 避免重复网址分散seo
|
# 避免重複網址分散seo
|
||||||
canonical: true
|
canonical: true
|
||||||
|
|
||||||
# 禁止百度转码
|
# 禁止百度轉碼
|
||||||
disable_baidu_transformation: true
|
disable_baidu_transformation: true
|
||||||
|
|
||||||
twitter_meta: true
|
twitter_meta: true
|
||||||
Open_Graph_meta: true
|
Open_Graph_meta: true
|
||||||
|
|
||||||
|
#閲讀模式
|
||||||
readmode:
|
readmode:
|
||||||
enable: true
|
enable: true
|
||||||
|
|
||||||
|
font:
|
||||||
|
enable: false
|
||||||
|
font-family: Lato, Helvetica Neue For Number, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, PingFang SC, Hiragino Sans GB,"Microsoft JhengHei", "MicrMicrosoft YaHei", Helvetica Neue, Helvetica, Arial, sans-serif
|
||||||
|
code-font: consolas, Menlo, "PingFang SC", "Microsoft JhengHei","Microsoft YaHei", monospace, Helvetica Neue For Number
|
||||||
|
|
||||||
|
# 主頁subtitle
|
||||||
|
subtitle:
|
||||||
|
enable: true
|
||||||
|
sub1: 今日事,今日畢
|
||||||
|
sub2: Never put off till tomorrow what you can do today
|
||||||
|
|
||||||
|
#側邊欄顯示設置
|
||||||
|
aside:
|
||||||
|
card_author: true
|
||||||
|
card_announcement: true
|
||||||
|
card_recent_post: true
|
||||||
|
card_categories: true
|
||||||
|
card_tags: true
|
||||||
|
card_archives: true
|
||||||
|
card_webinfo: true
|
||||||
|
|
||||||
|
|
||||||
|
## chinese traditional to Simplified
|
||||||
|
translate:
|
||||||
|
enable: true
|
||||||
|
# 默認按鈕顯示文字
|
||||||
|
default: 簡
|
||||||
|
#网站默认语言,1: 繁體中文, 2: 简体中文
|
||||||
|
defaultEncoding: 1
|
||||||
|
#延迟时间,若不在前, 要设定延迟翻译时间, 如100表示100ms,默认为0
|
||||||
|
translateDelay: 0
|
||||||
|
#博客网址
|
||||||
|
cookieDomain: "https://jerryc.me/"
|
||||||
|
#當文字是簡體時,按鈕顯示的文字
|
||||||
|
msgToTraditionalChinese: "繁"
|
||||||
|
#當文字是繁體時,按鈕顯示的文字
|
||||||
|
msgToSimplifiedChinese: "简"
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@ post:
|
|||||||
created: Created
|
created: Created
|
||||||
updated: Updated
|
updated: Updated
|
||||||
wordcount: Word count
|
wordcount: Word count
|
||||||
min2read: 'Reading time: %s min'
|
min2read: "Reading time: %s min"
|
||||||
page_pv: Post View
|
page_pv: Post View
|
||||||
copyright:
|
copyright:
|
||||||
author: Author
|
author: Author
|
||||||
@@ -33,7 +33,6 @@ post:
|
|||||||
copyright_notice: Copyright Notice
|
copyright_notice: Copyright Notice
|
||||||
copyright_content: 'All articles in this blog are licensed under <a href="%s">%s</a> unless stating additionally.'
|
copyright_content: 'All articles in this blog are licensed under <a href="%s">%s</a> unless stating additionally.'
|
||||||
|
|
||||||
|
|
||||||
search: Search
|
search: Search
|
||||||
algolia_search:
|
algolia_search:
|
||||||
input_placeholder: Search for Posts
|
input_placeholder: Search for Posts
|
||||||
@@ -57,7 +56,7 @@ aside:
|
|||||||
tags: Tags
|
tags: Tags
|
||||||
categories: Categories
|
categories: Categories
|
||||||
card_announcement: Announcement
|
card_announcement: Announcement
|
||||||
card_categories: Categories
|
card_categories: Categories
|
||||||
card_tags: Tags
|
card_tags: Tags
|
||||||
card_archives: Archives
|
card_archives: Archives
|
||||||
card_recent_post: Recent Post
|
card_recent_post: Recent Post
|
||||||
@@ -71,3 +70,15 @@ aside:
|
|||||||
|
|
||||||
donate: Donate
|
donate: Donate
|
||||||
share: Share
|
share: Share
|
||||||
|
|
||||||
|
bookmark:
|
||||||
|
title: Bookmark
|
||||||
|
message_prev: Press
|
||||||
|
message_next: to bookmark this page
|
||||||
|
|
||||||
|
rightside:
|
||||||
|
readmode_title: Read Mode
|
||||||
|
font_plus_title: Increase font size
|
||||||
|
font_minus_title: Decrease font size
|
||||||
|
translate_title: Traditional Chinese and Simplified Chinese Conversion
|
||||||
|
night_mode_title: Dark Mode
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ post:
|
|||||||
created: Created
|
created: Created
|
||||||
updated: Updated
|
updated: Updated
|
||||||
wordcount: Word count
|
wordcount: Word count
|
||||||
min2read: 'Reading time: %s min'
|
min2read: "Reading time: %s min"
|
||||||
page_pv: Post View
|
page_pv: Post View
|
||||||
copyright:
|
copyright:
|
||||||
author: Author
|
author: Author
|
||||||
@@ -33,7 +33,6 @@ post:
|
|||||||
copyright_notice: Copyright Notice
|
copyright_notice: Copyright Notice
|
||||||
copyright_content: 'All articles in this blog are licensed under <a href="%s">%s</a> unless stating additionally.'
|
copyright_content: 'All articles in this blog are licensed under <a href="%s">%s</a> unless stating additionally.'
|
||||||
|
|
||||||
|
|
||||||
search: Search
|
search: Search
|
||||||
algolia_search:
|
algolia_search:
|
||||||
input_placeholder: Search for Posts
|
input_placeholder: Search for Posts
|
||||||
@@ -57,7 +56,7 @@ aside:
|
|||||||
tags: Tags
|
tags: Tags
|
||||||
categories: Categories
|
categories: Categories
|
||||||
card_announcement: Announcement
|
card_announcement: Announcement
|
||||||
card_categories: Categories
|
card_categories: Categories
|
||||||
card_tags: Tags
|
card_tags: Tags
|
||||||
card_archives: Archives
|
card_archives: Archives
|
||||||
card_recent_post: Recent Post
|
card_recent_post: Recent Post
|
||||||
@@ -69,6 +68,16 @@ aside:
|
|||||||
site_uv_name: UV
|
site_uv_name: UV
|
||||||
site_pv_name: PV
|
site_pv_name: PV
|
||||||
|
|
||||||
|
|
||||||
donate: Donate
|
donate: Donate
|
||||||
share: Share
|
share: Share
|
||||||
|
bookmark:
|
||||||
|
title: Bookmark
|
||||||
|
message_prev: Press
|
||||||
|
message_next: to bookmark this page
|
||||||
|
|
||||||
|
rightside:
|
||||||
|
readmode_title: Read Mode
|
||||||
|
font_plus_title: Increase font size
|
||||||
|
font_minus_title: Decrease font size
|
||||||
|
translate_title: Traditional Chinese and Simplified Chinese Conversion
|
||||||
|
night_mode_title: Dark Mode
|
||||||
@@ -25,7 +25,7 @@ post:
|
|||||||
created: 发表于
|
created: 发表于
|
||||||
updated: 更新于
|
updated: 更新于
|
||||||
wordcount: 字数总计
|
wordcount: 字数总计
|
||||||
min2read: '阅读时长: %s 分钟'
|
min2read: "阅读时长: %s 分钟"
|
||||||
page_pv: 阅读量
|
page_pv: 阅读量
|
||||||
copyright:
|
copyright:
|
||||||
author: 文章作者
|
author: 文章作者
|
||||||
@@ -69,6 +69,16 @@ aside:
|
|||||||
site_uv_name: 本站访客数
|
site_uv_name: 本站访客数
|
||||||
site_pv_name: 本站总访问量
|
site_pv_name: 本站总访问量
|
||||||
|
|
||||||
|
|
||||||
donate: 打赏
|
donate: 打赏
|
||||||
share: 分享
|
share: 分享
|
||||||
|
bookmark:
|
||||||
|
title: 添加书签
|
||||||
|
message_prev: 按
|
||||||
|
message_next: 键将本页加入书签
|
||||||
|
|
||||||
|
rightside:
|
||||||
|
readmode_title: 阅读模式
|
||||||
|
font_plus_title: 放大字体
|
||||||
|
font_minus_title: 缩小字体
|
||||||
|
translate_title: 简繁转换
|
||||||
|
night_mode_title: 夜间模式
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ post:
|
|||||||
updated: 更新於
|
updated: 更新於
|
||||||
wordcount: 字數總計
|
wordcount: 字數總計
|
||||||
commentcount: 評論數
|
commentcount: 評論數
|
||||||
min2read: '閲讀時長: %s 分鐘'
|
min2read: "閲讀時長: %s 分鐘"
|
||||||
page_pv: 閲讀量
|
page_pv: 閲讀量
|
||||||
copyright:
|
copyright:
|
||||||
author: 文章作者
|
author: 文章作者
|
||||||
@@ -74,6 +74,16 @@ aside:
|
|||||||
site_uv_name: 本站訪客數
|
site_uv_name: 本站訪客數
|
||||||
site_pv_name: 本站總訪問量
|
site_pv_name: 本站總訪問量
|
||||||
|
|
||||||
|
|
||||||
donate: 打賞
|
donate: 打賞
|
||||||
share: 分享
|
share: 分享
|
||||||
|
bookmark:
|
||||||
|
title: 添加書籤
|
||||||
|
message_prev: 按
|
||||||
|
message_next: 鍵將本頁加入書籤
|
||||||
|
|
||||||
|
rightside:
|
||||||
|
readmode_title: 閲讀模式
|
||||||
|
font_plus_title: 放大字體
|
||||||
|
font_minus_title: 縮小字體
|
||||||
|
translate_title: 簡繁轉換
|
||||||
|
night_mode_title: 夜間模式
|
||||||
@@ -10,40 +10,6 @@ if (theme.local_search && theme.local_search.enable)
|
|||||||
script(async src=url_for('/js/search/local-search.js'))
|
script(async src=url_for('/js/search/local-search.js'))
|
||||||
|
|
||||||
|
|
||||||
if theme.translate && theme.translate.enable
|
|
||||||
script(src=url_for('/js/tw_cn.js'))
|
|
||||||
script.
|
|
||||||
$(document).ready(function() {
|
|
||||||
initializeChineseConversion();
|
|
||||||
});
|
|
||||||
function simplifyTextInPage(simplified) {
|
|
||||||
if (simplified) {
|
|
||||||
$(document.body).t2s();
|
|
||||||
$('#translateLink').addClass('simplified');
|
|
||||||
$('#translateLink').text('繁');
|
|
||||||
} else {
|
|
||||||
$(document.body).s2t();
|
|
||||||
$('#translateLink').removeClass('simplified');
|
|
||||||
$('#translateLink').text('簡');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function initializeChineseConversion() {
|
|
||||||
var simplified = +Cookies.get('simplified');
|
|
||||||
// ?lang=zh-Hans, ?lang=zh-Hant
|
|
||||||
var scriptCode = /[?&;]lang=[^&;]*(Han[st])/i.exec(window.location.search);
|
|
||||||
if (scriptCode) {
|
|
||||||
simplified = +(scriptCode[1].match(/Hans/i) != null);
|
|
||||||
Cookies.set('simplified', simplified, {expires: 7, path: '/'});
|
|
||||||
}
|
|
||||||
simplifyTextInPage(simplified);
|
|
||||||
$('#translateLink').click(function() {
|
|
||||||
simplified = +!simplified;
|
|
||||||
Cookies.set('simplified', simplified, {expires: 7, path: '/'});
|
|
||||||
simplifyTextInPage(simplified);
|
|
||||||
$(this).blur();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if theme.nightshift.enable
|
if theme.nightshift.enable
|
||||||
script(src=url_for('js/nightshift.js'))
|
script(src=url_for('js/nightshift.js'))
|
||||||
|
|
||||||
@@ -60,39 +26,24 @@ if theme.activate_power_mode.enable
|
|||||||
POWERMODE.shake = true; // turn off shake
|
POWERMODE.shake = true; // turn off shake
|
||||||
document.body.addEventListener('input', POWERMODE);
|
document.body.addEventListener('input', POWERMODE);
|
||||||
|
|
||||||
|
if theme.translate && theme.translate.enable
|
||||||
|
script(src=url_for('/js/tw_cn.js'))
|
||||||
|
script.
|
||||||
|
translateInitilization()
|
||||||
|
|
||||||
|
|
||||||
|
if is_home() && theme.subtitle.enable
|
||||||
|
|
||||||
//- script(src="https://unpkg.com/aos@next/dist/aos.js")
|
|
||||||
//- script.
|
|
||||||
//- $(".recent-post-item,.card_widget,#archive,.tag-cloud,#tag,.category-content,#category,#page,.flink").attr("data-aos","slide-up");
|
|
||||||
//- AOS.init();
|
|
||||||
|
|
||||||
|
|
||||||
script(src="https://cdn.jsdelivr.net/npm/instant.page@1.2.2/instantpage.min.js" type="module")
|
|
||||||
|
|
||||||
//- if is_post()
|
|
||||||
//- script(src="https://cdn.jsdelivr.net/npm/typed.js@2.0.9")
|
|
||||||
//- script.
|
|
||||||
//- var typed = new Typed("#typed", {
|
|
||||||
//- stringsElement: '#post-title-effects',
|
|
||||||
//- typeSpeed: 150,
|
|
||||||
//- loop: true,
|
|
||||||
//- backSpeed: 100
|
|
||||||
//- });
|
|
||||||
|
|
||||||
if is_home()
|
|
||||||
script(src="https://cdn.jsdelivr.net/npm/typed.js@2.0.9")
|
script(src="https://cdn.jsdelivr.net/npm/typed.js@2.0.9")
|
||||||
script.
|
script.
|
||||||
var typed = new Typed(".subtitle", {
|
var typed = new Typed(".subtitle", {
|
||||||
strings: ["今日事,今日畢", "Never put off till tomorrow what you can do today"],
|
strings: ['!{theme.subtitle.sub1}','!{theme.subtitle.sub2}'],
|
||||||
startDelay: 300,
|
startDelay: 300,
|
||||||
typeSpeed: 100,
|
typeSpeed: 100,
|
||||||
loop: true,
|
loop: true,
|
||||||
backSpeed: 50
|
backSpeed: 50
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if is_home()
|
||||||
script.
|
script.
|
||||||
//首頁fullpage
|
//首頁fullpage
|
||||||
function alignContent() {
|
function alignContent() {
|
||||||
@@ -130,3 +81,4 @@ if is_home()
|
|||||||
|
|
||||||
|
|
||||||
script(async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js")
|
script(async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js")
|
||||||
|
script(src="https://cdn.jsdelivr.net/npm/instant.page@1.2.2/instantpage.min.js" type="module")
|
||||||
|
|||||||
@@ -1,125 +1,132 @@
|
|||||||
.card_widget.card-author
|
if theme.aside.card_author
|
||||||
.card-content
|
.card_widget.card-author
|
||||||
.post_data
|
.card-content
|
||||||
.data-item.text-center
|
.post_data
|
||||||
img.lozad(data-src=theme.avatar || url_for('/img/avatar.png') onerror=`onerror=null;src='${theme.lodding_bg.flink}'`)
|
|
||||||
p.author-info__name.text-center= config.author
|
|
||||||
p.author-info__description.text-center= config.description
|
|
||||||
|
|
||||||
.post_data.data_config
|
|
||||||
if site.posts.length
|
|
||||||
.data-item.text-center
|
.data-item.text-center
|
||||||
.data_link
|
img.lozad(data-src=theme.avatar || url_for('/img/avatar.png') onerror=`onerror=null;src='${theme.lodding_bg.flink}'`)
|
||||||
a(href=url_for(config.archive_dir) + '/')
|
p.author-info__name.text-center= config.author
|
||||||
p.headline= _p('aside.articles')
|
p.author-info__description.text-center= config.description
|
||||||
p.length_num= site.posts.length
|
|
||||||
|
|
||||||
if site.tags.length
|
|
||||||
.data-item.text-center
|
|
||||||
.data_link
|
|
||||||
a(href=url_for(config.tag_dir) + '/' )
|
|
||||||
p.headline= _p('aside.tags')
|
|
||||||
p.length_num= site.tags.length
|
|
||||||
|
|
||||||
if site.categories.length
|
|
||||||
.data-item.text-center
|
|
||||||
.data_link
|
|
||||||
a(href=url_for(config.category_dir) + '/')
|
|
||||||
p.headline= _p('aside.categories')
|
|
||||||
p.length_num= site.categories.length
|
|
||||||
|
|
||||||
.post_data.text-center
|
|
||||||
a#bookmark-it.data-item.bookmark.bookmarke--primary.bookmark--animated(href="javascript:;" title= _p('aside.card_bookmark') )= _p('aside.card_bookmark') || 'Follow Me'
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(theme.social)
|
|
||||||
.post_data.data_config
|
.post_data.data_config
|
||||||
#aside-social-icons
|
if site.posts.length
|
||||||
each url, icon in theme.social
|
.data-item.text-center
|
||||||
a.social-icon.data-item(href=url target="_blank")
|
.data_link
|
||||||
i(class=icon)
|
a(href=url_for(config.archive_dir) + '/')
|
||||||
|
p.headline= _p('aside.articles')
|
||||||
|
p.length_num= site.posts.length
|
||||||
|
|
||||||
.card_widget.card-announcement
|
if site.tags.length
|
||||||
.card-content
|
.data-item.text-center
|
||||||
.item_headline
|
.data_link
|
||||||
i.fa.fa-bullhorn.card-announcement-animation(aria-hidden="true")
|
a(href=url_for(config.tag_dir) + '/' )
|
||||||
span= _p('aside.card_announcement')
|
p.headline= _p('aside.tags')
|
||||||
.announcement_content= theme.announcement.content
|
p.length_num= site.tags.length
|
||||||
|
|
||||||
.card_widget.card-recent-post
|
if site.categories.length
|
||||||
.card-content
|
.data-item.text-center
|
||||||
.item_headline
|
.data_link
|
||||||
i.fa.fa-history(aria-hidden="true")
|
a(href=url_for(config.category_dir) + '/')
|
||||||
span= _p('aside.card_recent_post')
|
p.headline= _p('aside.categories')
|
||||||
.aside_recent_item
|
p.length_num= site.categories.length
|
||||||
- site.posts.sort('date', -1).limit(5).each(function(article){
|
|
||||||
.aside_recent_post
|
|
||||||
- var link = article.link || article.path
|
|
||||||
a(href=url_for(link))
|
|
||||||
- var post_cover = article.cover
|
|
||||||
- var default_post_cover = theme.default_cover
|
|
||||||
.aside_post_cover
|
|
||||||
if (post_cover)
|
|
||||||
img.aside_post_bg.lozad(data-src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` title=article.title || _p('no_title'))
|
|
||||||
else
|
|
||||||
img.aside_post_bg.lozad(data-src=`${default_post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` title=article.title || _p('no_title'))
|
|
||||||
div#aside_title
|
|
||||||
.aside_post_title(href=url_for(link) title=article.title || _p('no_title'))= article.title || _p('no_title')
|
|
||||||
if (theme.post_meta.date_type)
|
|
||||||
- var date_type = theme.post_meta.date_type == 'updated' ? 'updated' : 'date'
|
|
||||||
time.aside_post_meta.post-meta__date #[=date(article[date_type], config.date_format)]
|
|
||||||
|
|
||||||
- })
|
.post_data.text-center
|
||||||
|
a#bookmark-it.data-item.bookmark.bookmarke--primary.bookmark--animated(href="javascript:;" title= _p('aside.card_bookmark') )= _p('aside.card_bookmark') || 'Follow Me'
|
||||||
|
|
||||||
.card_widget.card-categories
|
|
||||||
.card-content
|
|
||||||
.item_headline
|
|
||||||
i.fa.fa-folder-open(aria-hidden="true")
|
|
||||||
span= _p('aside.card_categories')
|
|
||||||
ul.aside_category_item
|
|
||||||
- site.categories.sort('name').each(function(category){
|
|
||||||
li.aside_category_list
|
|
||||||
a.aside_category_list_link(href='/' + `${category.path}`)
|
|
||||||
span.aside_category_list_name= category.name
|
|
||||||
span.aside_category_list_length= category.length
|
|
||||||
- })
|
|
||||||
|
|
||||||
.card_widget.card-tags
|
|
||||||
.card-content
|
|
||||||
.item_headline
|
|
||||||
i.fa.fa-tags(aria-hidden="true")
|
|
||||||
span= _p('aside.card_tags')
|
|
||||||
.card-tag-cloud!= tagcloud({min_font: 16, max_font: 24, amount: 200, color: true, start_color: '#999', end_color: '#000'})
|
|
||||||
|
|
||||||
.card_widget.card-archives
|
if(theme.social)
|
||||||
.card-content
|
.post_data.data_config
|
||||||
.item_headline
|
#aside-social-icons
|
||||||
i.fa.fa-archive(aria-hidden="true")
|
each url, icon in theme.social
|
||||||
span= _p('aside.card_archives')
|
a.social-icon.data-item(href=url target="_blank")
|
||||||
div.archives_item!= list_archives({type:'monthly',format: 'YYYY年MM月'})
|
i(class=icon)
|
||||||
|
|
||||||
.card_widget.card-webinfo
|
if theme.aside.card_announcement
|
||||||
.card-content
|
.card_widget.card-announcement
|
||||||
.item_headline
|
.card-content
|
||||||
i.fa.fa-line-chart(aria-hidden="true")
|
.item_headline
|
||||||
span= _p('aside.card_webinfo.headline')
|
i.fa.fa-bullhorn.card-announcement-animation(aria-hidden="true")
|
||||||
.webinfo
|
span= _p('aside.card_announcement')
|
||||||
.webinfo_item
|
.announcement_content= theme.announcement.content
|
||||||
.webinfo_article_name= _p('aside.card_webinfo.article_name') + " :"
|
|
||||||
.webinfo_article_count= site.posts.length
|
if theme.aside.card_recent_post
|
||||||
if theme.runtimeshow.enable
|
.card_widget.card-recent-post
|
||||||
|
.card-content
|
||||||
|
.item_headline
|
||||||
|
i.fa.fa-history(aria-hidden="true")
|
||||||
|
span= _p('aside.card_recent_post')
|
||||||
|
.aside_recent_item
|
||||||
|
- site.posts.sort('date', -1).limit(5).each(function(article){
|
||||||
|
.aside_recent_post
|
||||||
|
- var link = article.link || article.path
|
||||||
|
a(href=url_for(link))
|
||||||
|
- var post_cover = article.cover
|
||||||
|
- var default_post_cover = theme.default_cover
|
||||||
|
.aside_post_cover
|
||||||
|
if (post_cover)
|
||||||
|
img.aside_post_bg.lozad(data-src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` title=article.title || _p('no_title'))
|
||||||
|
else
|
||||||
|
img.aside_post_bg.lozad(data-src=`${default_post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` title=article.title || _p('no_title'))
|
||||||
|
div#aside_title
|
||||||
|
.aside_post_title(href=url_for(link) title=article.title || _p('no_title'))= article.title || _p('no_title')
|
||||||
|
if (theme.post_meta.date_type)
|
||||||
|
- var date_type = theme.post_meta.date_type == 'updated' ? 'updated' : 'date'
|
||||||
|
time.aside_post_meta.post-meta__date #[=date(article[date_type], config.date_format)]
|
||||||
|
|
||||||
|
- })
|
||||||
|
|
||||||
|
if theme.aside.card_categories
|
||||||
|
.card_widget.card-categories
|
||||||
|
.card-content
|
||||||
|
.item_headline
|
||||||
|
i.fa.fa-folder-open(aria-hidden="true")
|
||||||
|
span= _p('aside.card_categories')
|
||||||
|
ul.aside_category_item
|
||||||
|
- site.categories.sort('name').each(function(category){
|
||||||
|
li.aside_category_list
|
||||||
|
a.aside_category_list_link(href='/' + `${category.path}`)
|
||||||
|
span.aside_category_list_name= category.name
|
||||||
|
span.aside_category_list_length= category.length
|
||||||
|
- })
|
||||||
|
|
||||||
|
if theme.aside.card_tags
|
||||||
|
.card_widget.card-tags
|
||||||
|
.card-content
|
||||||
|
.item_headline
|
||||||
|
i.fa.fa-tags(aria-hidden="true")
|
||||||
|
span= _p('aside.card_tags')
|
||||||
|
.card-tag-cloud!= tagcloud({min_font: 16, max_font: 24, amount: 200, color: true, start_color: '#999', end_color: '#000'})
|
||||||
|
|
||||||
|
if theme.aside.card_archives
|
||||||
|
.card_widget.card-archives
|
||||||
|
.card-content
|
||||||
|
.item_headline
|
||||||
|
i.fa.fa-archive(aria-hidden="true")
|
||||||
|
span= _p('aside.card_archives')
|
||||||
|
div.archives_item!= list_archives({type:'monthly',format: 'YYYY年MM月'})
|
||||||
|
|
||||||
|
if theme.aside.card_webinfo
|
||||||
|
.card_widget.card-webinfo
|
||||||
|
.card-content
|
||||||
|
.item_headline
|
||||||
|
i.fa.fa-line-chart(aria-hidden="true")
|
||||||
|
span= _p('aside.card_webinfo.headline')
|
||||||
|
.webinfo
|
||||||
.webinfo_item
|
.webinfo_item
|
||||||
.webinfo_runtime_name= _p('aside.card_webinfo.runtime_name') + " :"
|
.webinfo_article_name= _p('aside.card_webinfo.article_name') + " :"
|
||||||
#webinfo_runtime_count.webinfo_runtime_count
|
.webinfo_article_count= site.posts.length
|
||||||
script#runtionshow(src=url_for('js/runtimeshow.js') start_date=theme.runtimeshow.start_date)
|
if theme.runtimeshow.enable
|
||||||
|
.webinfo_item
|
||||||
|
.webinfo_runtime_name= _p('aside.card_webinfo.runtime_name') + " :"
|
||||||
|
#webinfo_runtime_count.webinfo_runtime_count
|
||||||
|
script#runtionshow(src=url_for('js/runtimeshow.js') start_date=theme.runtimeshow.start_date)
|
||||||
|
|
||||||
if theme.busuanzi.site_uv
|
if theme.busuanzi.site_uv
|
||||||
.webinfo_item
|
.webinfo_item
|
||||||
.webinfo_site_uv_name= _p('aside.card_webinfo.site_uv_name') + " :"
|
.webinfo_site_uv_name= _p('aside.card_webinfo.site_uv_name') + " :"
|
||||||
.webinfo_site_uv_count#busuanzi_value_site_uv
|
.webinfo_site_uv_count#busuanzi_value_site_uv
|
||||||
if theme.busuanzi.site_pv
|
if theme.busuanzi.site_pv
|
||||||
.webinfo_item
|
.webinfo_item
|
||||||
.webinfo_site_name= _p('aside.card_webinfo.site_pv_name') + " :"
|
.webinfo_site_name= _p('aside.card_webinfo.site_pv_name') + " :"
|
||||||
.webinfo_site_pv_count#busuanzi_value_site_pv
|
.webinfo_site_pv_count#busuanzi_value_site_pv
|
||||||
|
|
||||||
|
|||||||
@@ -26,14 +26,39 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (theme.translate && theme.translate.enable){
|
||||||
|
var defaultEncoding;
|
||||||
|
translate = JSON.stringify({
|
||||||
|
defaultEncoding: theme.translate.defaultEncoding,
|
||||||
|
translateDelay: theme.translate.translateDelay,
|
||||||
|
cookieDomain: theme.translate.cookieDomain,
|
||||||
|
msgToTraditionalChinese: theme.translate.msgToTraditionalChinese,
|
||||||
|
msgToSimplifiedChinese: theme.translate.msgToSimplifiedChinese
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
script.
|
script.
|
||||||
var GLOBAL_CONFIG = {
|
var GLOBAL_CONFIG = {
|
||||||
root: '!{config.root}',
|
root: '!{config.root}',
|
||||||
algolia: !{algolia},
|
algolia: !{algolia},
|
||||||
localSearch: !{localSearch},
|
localSearch: !{localSearch},
|
||||||
|
translate: !{translate},
|
||||||
|
highlight_copy: '!{theme.highlight_copy}',
|
||||||
copy: {
|
copy: {
|
||||||
success: '!{_p("copy.success")}',
|
success: '!{_p("copy.success")}',
|
||||||
error: '!{_p("copy.error")}',
|
error: '!{_p("copy.error")}',
|
||||||
noSupport: '!{_p("copy.noSupport")}'
|
noSupport: '!{_p("copy.noSupport")}'
|
||||||
|
},
|
||||||
|
bookmark: {
|
||||||
|
title: '!{_p("bookmark.title")}',
|
||||||
|
message_prev: '!{_p("bookmark.message_prev")}',
|
||||||
|
message_next: '!{_p("bookmark.message_next")}'
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -52,8 +52,7 @@ if (theme.gitalk && theme.gitalk.enable)
|
|||||||
script(src="https://cdn.jsdelivr.net/npm/gitalk@latest/dist/gitalk.min.js")
|
script(src="https://cdn.jsdelivr.net/npm/gitalk@latest/dist/gitalk.min.js")
|
||||||
script(src="https://cdn.jsdelivr.net/npm/blueimp-md5@2.10.0/js/md5.min.js")
|
script(src="https://cdn.jsdelivr.net/npm/blueimp-md5@2.10.0/js/md5.min.js")
|
||||||
|
|
||||||
//- if (theme.pwa && theme.pwa.enable)
|
|
||||||
//- link(rel="manifest" href=theme.pwa.manifest)
|
|
||||||
|
|
||||||
if (theme.pwa && theme.pwa.enable)
|
if (theme.pwa && theme.pwa.enable)
|
||||||
link(rel="manifest" href=theme.pwa.manifest)
|
link(rel="manifest" href=theme.pwa.manifest)
|
||||||
@@ -69,8 +68,6 @@ if (theme.pwa && theme.pwa.enable)
|
|||||||
link(rel="icon" type="image/png" sizes="16x16" href=theme.pwa.favicon_16_16)
|
link(rel="icon" type="image/png" sizes="16x16" href=theme.pwa.favicon_16_16)
|
||||||
if(theme.pwa.mask_icon)
|
if(theme.pwa.mask_icon)
|
||||||
link(rel="mask-icon" href=theme.pwa.mask_icon color="#5bbad5")
|
link(rel="mask-icon" href=theme.pwa.mask_icon color="#5bbad5")
|
||||||
if(theme.pwa.shortcut_icon)
|
|
||||||
link(rel="shortcut icon", href=theme.pwa.shortcut_icon)
|
|
||||||
|
|
||||||
|
|
||||||
if theme.baidu_analytics
|
if theme.baidu_analytics
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ html(lang=config.language)
|
|||||||
meta(name="author" content=pageAuthor)
|
meta(name="author" content=pageAuthor)
|
||||||
meta(name="copyright" content=pageCopyright)
|
meta(name="copyright" content=pageCopyright)
|
||||||
meta(name ="format-detection" content="telephone=no")
|
meta(name ="format-detection" content="telephone=no")
|
||||||
//- !=favicon_tag(config.favicon || theme.favicon || '/favicon.ico')
|
!=favicon_tag(config.favicon || theme.favicon || '/favicon.ico')
|
||||||
if theme.stylesheets !== undefined && theme.stylesheets.length > 0
|
if theme.stylesheets !== undefined && theme.stylesheets.length > 0
|
||||||
each url in theme.stylesheets
|
each url in theme.stylesheets
|
||||||
link(rel='stylesheet', href=url_for(url))
|
link(rel='stylesheet', href=url_for(url))
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
section#rightside.rightside
|
section#rightside.rightside
|
||||||
if theme.readmode.enable && is_post()
|
if theme.readmode.enable && is_post()
|
||||||
i#readmode.fa.fa-book
|
i#readmode.fa.fa-book(title=_p('rightside.readmode_title'))
|
||||||
i#font_plus.fa.fa-plus
|
i#font_plus.fa.fa-plus(title=_p('rightside.font_plus_title'))
|
||||||
i#font_minus.fa.fa-minus
|
i#font_minus.fa.fa-minus(title=_p('rightside.font_minus_title'))
|
||||||
if page.comments !== false && !is_home() && !is_archive()
|
|
||||||
i#to_comment.fa.fa-comments-o
|
|
||||||
if theme.translate && theme.translate.enable
|
if theme.translate && theme.translate.enable
|
||||||
a#translateLink.translate_chn_to_cht=theme.translate.show
|
a#translateLink.translate_chn_to_cht(href="javascript:translatePage();" title=_p('rightside.translate_title'))= theme.translate.default
|
||||||
if theme.nightshift.enable
|
if theme.nightshift.enable
|
||||||
i#nightshift.fa.fa-moon-o.nightshift
|
i#nightshift.fa.fa-moon-o.nightshift(title=_p('rightside.night_mode_title'))
|
||||||
|
|||||||
@@ -24,8 +24,10 @@ hexo.extend.helper.register('related_posts', function(currentPost, allPosts){
|
|||||||
var result = '<div class="relatedPosts_headling"><i class="fa fa-thumbs-up" aria-hidden="true"></i><span> 相關文章</span></div><div class="relatedPosts_list">';
|
var result = '<div class="relatedPosts_headling"><i class="fa fa-thumbs-up" aria-hidden="true"></i><span> 相關文章</span></div><div class="relatedPosts_list">';
|
||||||
relatedPosts = relatedPosts.sort(compare('weight'));
|
relatedPosts = relatedPosts.sort(compare('weight'));
|
||||||
for (var i = 0; i < Math.min(relatedPosts.length, 6); i++) {
|
for (var i = 0; i < Math.min(relatedPosts.length, 6); i++) {
|
||||||
|
|
||||||
|
var cover = relatedPosts[i].cover || hexo.theme.config.default_cover || data.melody.default_cover
|
||||||
result += '<div class="relatedPosts_item"><a href="/' + relatedPosts[i].path + '">';
|
result += '<div class="relatedPosts_item"><a href="/' + relatedPosts[i].path + '">';
|
||||||
result += '<img class="relatedPosts_cover lozad" data-src="' + relatedPosts[i].cover + '">';
|
result += '<img class="relatedPosts_cover lozad" data-src="' + cover + '">';
|
||||||
result += '<div class="relatedPosts_title">' + relatedPosts[i].title + '</div>';
|
result += '<div class="relatedPosts_title">' + relatedPosts[i].title + '</div>';
|
||||||
result += '</a></div>'
|
result += '</a></div>'
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -261,17 +261,6 @@ table
|
|||||||
cursor: pointer
|
cursor: pointer
|
||||||
padding-top: 6px
|
padding-top: 6px
|
||||||
|
|
||||||
#to_comment
|
|
||||||
width: 30px
|
|
||||||
height: 30px
|
|
||||||
background-color: #49b1f5
|
|
||||||
color: #e3e8ee
|
|
||||||
text-align: center
|
|
||||||
font-size: 17px
|
|
||||||
display: block
|
|
||||||
margin-bottom: 2px
|
|
||||||
cursor: pointer
|
|
||||||
padding-top: 6px
|
|
||||||
|
|
||||||
a
|
a
|
||||||
&:hover
|
&:hover
|
||||||
|
|||||||
236
source/css/_layout/nightshift.styl
Normal file
236
source/css/_layout/nightshift.styl
Normal file
@@ -0,0 +1,236 @@
|
|||||||
|
if hexo-config("nightshift") && hexo-config("nightshift.enable")
|
||||||
|
.night-mode
|
||||||
|
footer
|
||||||
|
background: #2d3035
|
||||||
|
|
||||||
|
#sidebar
|
||||||
|
background: #2d3035 !important
|
||||||
|
box-shadow: -0.25rem 0 0.25rem #2d3035 !important
|
||||||
|
|
||||||
|
&::-webkit-scrollbar-thumb
|
||||||
|
background: lighten(#2d3035,5)
|
||||||
|
|
||||||
|
if hexo-config("local_search") && hexo-config("local_search.enable")
|
||||||
|
#local-search
|
||||||
|
background: #2d3035
|
||||||
|
.local-search-box--input
|
||||||
|
background: #2d3035
|
||||||
|
color: #99a9bf
|
||||||
|
|
||||||
|
.search-result-title
|
||||||
|
color: #99a9bf
|
||||||
|
if hexo-config("algolia_search.enable")
|
||||||
|
#algolia-search
|
||||||
|
background: #2d3035
|
||||||
|
.ais-search-box--input
|
||||||
|
background: #2d3035
|
||||||
|
color: #99a9bf
|
||||||
|
|
||||||
|
#algolia-search-results
|
||||||
|
.algolia-hit-item-link
|
||||||
|
color: #99a9bf !important
|
||||||
|
|
||||||
|
h1, h2, h3, h4, h5, h6
|
||||||
|
color: #99a9bf
|
||||||
|
|
||||||
|
.article-container code
|
||||||
|
background: #616a6b
|
||||||
|
color: #99a9bf
|
||||||
|
|
||||||
|
// 評論
|
||||||
|
#vcomment
|
||||||
|
*
|
||||||
|
color: #99a9bf !important
|
||||||
|
|
||||||
|
.vsys
|
||||||
|
background: rgb(97, 106, 107) !important
|
||||||
|
|
||||||
|
.vbtn
|
||||||
|
background: rgb(45, 48, 53) !important
|
||||||
|
color: #99a9bf !important
|
||||||
|
|
||||||
|
.recent-post-item .article-title
|
||||||
|
color: #99a9bf
|
||||||
|
|
||||||
|
#page-header
|
||||||
|
&.fixed
|
||||||
|
background: #2d3035
|
||||||
|
box-shadow: 0 5px 6px -5px rgba(133,133,133,0)
|
||||||
|
|
||||||
|
a,
|
||||||
|
.toggle-menu,
|
||||||
|
#site-name
|
||||||
|
color: #99a9bf
|
||||||
|
|
||||||
|
blockquote
|
||||||
|
border-left: 0.2rem solid #7A5353
|
||||||
|
color: #99a9bf
|
||||||
|
|
||||||
|
hr
|
||||||
|
background: 0
|
||||||
|
border: 2px dashed #616A6B
|
||||||
|
&:before
|
||||||
|
color: #99a9bf
|
||||||
|
|
||||||
|
.post-meta__tags
|
||||||
|
background: 0
|
||||||
|
border: 1px solid #99a9bf
|
||||||
|
color: #99a9bf
|
||||||
|
|
||||||
|
|
||||||
|
.post-copyright
|
||||||
|
border: 1px solid #99a9bf
|
||||||
|
|
||||||
|
*
|
||||||
|
color: #99a9bf
|
||||||
|
|
||||||
|
.article-container .highlight
|
||||||
|
background-color: #1B2631
|
||||||
|
.code pre
|
||||||
|
background-color: #1B2631
|
||||||
|
|
||||||
|
.gutter pre
|
||||||
|
background: #1C2833
|
||||||
|
|
||||||
|
|
||||||
|
&:after
|
||||||
|
background: rgb(27, 38, 59)
|
||||||
|
|
||||||
|
table
|
||||||
|
&:after,.copy-notice
|
||||||
|
background: rgb(27, 38, 59)
|
||||||
|
|
||||||
|
&::-webkit-scrollbar-thumb
|
||||||
|
background: lighten(#1B2631,10)
|
||||||
|
|
||||||
|
.copy-notice
|
||||||
|
background: rgb(27, 38, 59)
|
||||||
|
|
||||||
|
.post-cards,.md-links-item
|
||||||
|
// background: #2d3035
|
||||||
|
a
|
||||||
|
color: #99a9bf
|
||||||
|
|
||||||
|
.aplayer
|
||||||
|
color: #000000
|
||||||
|
filter: brightness(0.6)
|
||||||
|
|
||||||
|
.article-sort-item__title
|
||||||
|
color: #99a9bf
|
||||||
|
|
||||||
|
.category-list
|
||||||
|
a
|
||||||
|
color: #99a9bf
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.translate_chn_to_cht,
|
||||||
|
.nightshift,
|
||||||
|
#readmode
|
||||||
|
background-color: #2d3035 !important
|
||||||
|
|
||||||
|
img
|
||||||
|
filter: brightness(0.6)
|
||||||
|
|
||||||
|
.layout_post
|
||||||
|
background:#2d3035
|
||||||
|
|
||||||
|
canvas
|
||||||
|
display: none !important
|
||||||
|
|
||||||
|
#aside_content
|
||||||
|
.card_widget
|
||||||
|
background:#2d3035 !important
|
||||||
|
.headline,
|
||||||
|
.length_num,
|
||||||
|
.aside_post_title,
|
||||||
|
.aside_category_list_link,
|
||||||
|
.archive-list-link,
|
||||||
|
.social-icon
|
||||||
|
color: #99a9bf !important
|
||||||
|
|
||||||
|
#bookmark-it
|
||||||
|
background: #616a6b !important
|
||||||
|
|
||||||
|
#archive,
|
||||||
|
.tag-cloud,
|
||||||
|
#tag,
|
||||||
|
.category-content,
|
||||||
|
#category,
|
||||||
|
#page,
|
||||||
|
.flink
|
||||||
|
background:#2d3035
|
||||||
|
|
||||||
|
#nav,
|
||||||
|
#top-container
|
||||||
|
&::before
|
||||||
|
content: ""
|
||||||
|
position: absolute
|
||||||
|
top: 0
|
||||||
|
bottom: 0
|
||||||
|
left: 0
|
||||||
|
right: 0
|
||||||
|
background-color: rgba(0,0,0,.6)
|
||||||
|
|
||||||
|
.layout_page
|
||||||
|
.post-meta__date,
|
||||||
|
.article-meta__separator,
|
||||||
|
.article-meta__categories,
|
||||||
|
i
|
||||||
|
color: #99a9bf
|
||||||
|
|
||||||
|
#site-info .blogtitle,
|
||||||
|
span.subtitle,
|
||||||
|
#post-info .posttitle,
|
||||||
|
#post-info #post-meta,
|
||||||
|
#site-social-icons i,
|
||||||
|
#top-container a
|
||||||
|
color: rgba(238,238,238,.6)
|
||||||
|
|
||||||
|
//打賞 分享
|
||||||
|
.post-reward
|
||||||
|
.reward-buttom
|
||||||
|
background-color: #616a6b
|
||||||
|
.post_share
|
||||||
|
filter: brightness(0.6)
|
||||||
|
img
|
||||||
|
filter: brightness(1)
|
||||||
|
|
||||||
|
&::-webkit-scrollbar-thumb
|
||||||
|
background: lighten(#2d3035,5)
|
||||||
|
|
||||||
|
@media screen and (max-width: 768px)
|
||||||
|
.night-mode
|
||||||
|
color: #99a9bf
|
||||||
|
background-color: rgb(45, 48, 53)
|
||||||
|
|
||||||
|
#page-header
|
||||||
|
.menus
|
||||||
|
a
|
||||||
|
color: #99a9bf
|
||||||
|
background: #2d3035
|
||||||
|
&.fixed
|
||||||
|
.menu-icon-first,
|
||||||
|
.menu-icon-second,
|
||||||
|
.menu-icon-third
|
||||||
|
background-color: #99a9bf;
|
||||||
|
|
||||||
|
|
||||||
|
@media screen and (min-width: 768px)
|
||||||
|
.night-mode
|
||||||
|
color: #99a9bf
|
||||||
|
background-color: #2d3032
|
||||||
|
|
||||||
|
.recent-post-item
|
||||||
|
background: #2d3035 !important
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -13,7 +13,6 @@
|
|||||||
|
|
||||||
#post
|
#post
|
||||||
overflow: hidden
|
overflow: hidden
|
||||||
text-align: justify
|
|
||||||
|
|
||||||
&-meta
|
&-meta
|
||||||
text-shadow: 0.1rem 0.1rem 0.2rem rgba(0, 0, 0, 0.15)
|
text-shadow: 0.1rem 0.1rem 0.2rem rgba(0, 0, 0, 0.15)
|
||||||
|
|||||||
@@ -1,99 +1,103 @@
|
|||||||
.read-mode
|
if hexo-config("readmode") && hexo-config("readmode.enable")
|
||||||
background: $pale-yellow
|
.read-mode
|
||||||
padding: 0 !important
|
|
||||||
|
|
||||||
#sidebar,
|
|
||||||
#toggle-sidebar
|
|
||||||
display: none
|
|
||||||
|
|
||||||
#top-container
|
|
||||||
background-image: none !important
|
|
||||||
height: 14rem
|
|
||||||
background-color: $pale-yellow
|
|
||||||
|
|
||||||
a
|
|
||||||
color: #4c4948
|
|
||||||
|
|
||||||
|
|
||||||
&:before
|
|
||||||
opacity: 0
|
|
||||||
|
|
||||||
#site-name,
|
|
||||||
.site-page
|
|
||||||
text-shadow: none
|
|
||||||
color: #4c4948
|
|
||||||
|
|
||||||
#post-info
|
|
||||||
text-align: center
|
|
||||||
padding: 0
|
|
||||||
color: #4c4948
|
|
||||||
|
|
||||||
#post-title,
|
|
||||||
#post-meta
|
|
||||||
text-shadow: none
|
|
||||||
|
|
||||||
#page-header
|
|
||||||
&.fixed
|
|
||||||
background: none
|
|
||||||
box-shadow: none
|
|
||||||
|
|
||||||
&.open-sidebar
|
|
||||||
.site-page
|
|
||||||
display: inline-block
|
|
||||||
opacity: 1
|
|
||||||
|
|
||||||
.toggle-menu
|
|
||||||
.menu-icon-first,
|
|
||||||
.menu-icon-second,
|
|
||||||
.menu-icon-third
|
|
||||||
background-color: #4c4948
|
|
||||||
|
|
||||||
.layout_post
|
|
||||||
box-shadow: none
|
|
||||||
background: $pale-yellow
|
background: $pale-yellow
|
||||||
|
padding: 0 !important
|
||||||
|
|
||||||
&:hover
|
#sidebar,
|
||||||
box-shadow: none
|
#toggle-sidebar
|
||||||
|
|
||||||
.article-container
|
|
||||||
pre,
|
|
||||||
.highlight
|
|
||||||
background: darken($pale-yellow,5);
|
|
||||||
|
|
||||||
.highlight
|
|
||||||
&:after
|
|
||||||
background: darken($pale-yellow,10);
|
|
||||||
table
|
|
||||||
&:after
|
|
||||||
background: darken($pale-yellow,10);
|
|
||||||
|
|
||||||
|
|
||||||
blockquote
|
|
||||||
border-left: 0.2rem solid #d6dbdf
|
|
||||||
background-color: rgba(102,128,153,.05)
|
|
||||||
|
|
||||||
#rightside
|
|
||||||
#to_comment,#nightshift
|
|
||||||
display: none
|
display: none
|
||||||
|
|
||||||
canvas
|
#top-container
|
||||||
display: none !important
|
background-image: none !important
|
||||||
|
height: 14rem
|
||||||
|
background-color: $pale-yellow
|
||||||
|
|
||||||
footer,
|
a
|
||||||
#post-comment,
|
color: #4c4948
|
||||||
hr,
|
|
||||||
.relatedPosts,
|
|
||||||
#pagination,
|
|
||||||
.post-reward,
|
|
||||||
.tag_share,
|
|
||||||
.post-copyright
|
|
||||||
display: none
|
|
||||||
|
|
||||||
&::-webkit-scrollbar-thumb
|
|
||||||
background: darken($pale-yellow,15)
|
|
||||||
|
|
||||||
*::-webkit-scrollbar-thumb
|
&:before
|
||||||
background: darken($pale-yellow,15)
|
opacity: 0
|
||||||
|
|
||||||
|
#site-name,
|
||||||
|
.site-page
|
||||||
|
text-shadow: none
|
||||||
|
color: #4c4948
|
||||||
|
|
||||||
|
#post-info
|
||||||
|
text-align: center
|
||||||
|
padding: 0
|
||||||
|
color: #4c4948
|
||||||
|
|
||||||
|
#post-title,
|
||||||
|
#post-meta
|
||||||
|
text-shadow: none
|
||||||
|
|
||||||
|
#page-header
|
||||||
|
&.fixed
|
||||||
|
background: none
|
||||||
|
box-shadow: none
|
||||||
|
|
||||||
|
&.open-sidebar
|
||||||
|
.site-page
|
||||||
|
display: inline-block
|
||||||
|
opacity: 1
|
||||||
|
|
||||||
|
.toggle-menu
|
||||||
|
.menu-icon-first,
|
||||||
|
.menu-icon-second,
|
||||||
|
.menu-icon-third
|
||||||
|
background-color: #4c4948
|
||||||
|
|
||||||
|
.layout_post
|
||||||
|
box-shadow: none
|
||||||
|
background: $pale-yellow
|
||||||
|
|
||||||
|
&:hover
|
||||||
|
box-shadow: none
|
||||||
|
|
||||||
|
.article-container
|
||||||
|
pre,
|
||||||
|
.highlight
|
||||||
|
background: darken($pale-yellow,5);
|
||||||
|
|
||||||
|
.highlight
|
||||||
|
&:after
|
||||||
|
background: darken($pale-yellow,10);
|
||||||
|
table
|
||||||
|
&:after
|
||||||
|
background: darken($pale-yellow,10);
|
||||||
|
|
||||||
|
|
||||||
|
blockquote
|
||||||
|
border-left: 0.2rem solid #d6dbdf
|
||||||
|
background-color: rgba(102,128,153,.05)
|
||||||
|
|
||||||
|
#rightside
|
||||||
|
#nightshift
|
||||||
|
display: none
|
||||||
|
|
||||||
|
canvas
|
||||||
|
display: none !important
|
||||||
|
|
||||||
|
footer,
|
||||||
|
#post-comment,
|
||||||
|
hr,
|
||||||
|
.relatedPosts,
|
||||||
|
#pagination,
|
||||||
|
.post-reward,
|
||||||
|
.tag_share,
|
||||||
|
.post-copyright
|
||||||
|
display: none
|
||||||
|
|
||||||
|
&::-webkit-scrollbar-thumb
|
||||||
|
background: darken($pale-yellow,15)
|
||||||
|
|
||||||
|
*::-webkit-scrollbar-thumb
|
||||||
|
background: darken($pale-yellow,15)
|
||||||
|
|
||||||
|
.copy-notice
|
||||||
|
background: darken($pale-yellow,10)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,9 +5,6 @@
|
|||||||
@import "_global"
|
@import "_global"
|
||||||
@import "_highlight/highlight"
|
@import "_highlight/highlight"
|
||||||
@import "_layout/*"
|
@import "_layout/*"
|
||||||
@import "other"
|
|
||||||
if hexo-config("nightshift.enable")
|
|
||||||
@import "nightshift"
|
|
||||||
|
|
||||||
// search
|
// search
|
||||||
if hexo-config("algolia_search.enable")
|
if hexo-config("algolia_search.enable")
|
||||||
|
|||||||
@@ -1,236 +0,0 @@
|
|||||||
.night-mode
|
|
||||||
footer
|
|
||||||
background: #2d3035
|
|
||||||
|
|
||||||
#sidebar
|
|
||||||
background: #2d3035 !important
|
|
||||||
box-shadow: -0.25rem 0 0.25rem #2d3035 !important
|
|
||||||
|
|
||||||
&::-webkit-scrollbar-thumb
|
|
||||||
background: lighten(#2d3035,5)
|
|
||||||
|
|
||||||
if hexo-config("local_search") && hexo-config("local_search.enable")
|
|
||||||
#local-search
|
|
||||||
background: #2d3035
|
|
||||||
.local-search-box--input
|
|
||||||
background: #2d3035
|
|
||||||
color: #99a9bf
|
|
||||||
|
|
||||||
.search-result-title
|
|
||||||
color: #99a9bf
|
|
||||||
if hexo-config("algolia_search.enable")
|
|
||||||
#algolia-search
|
|
||||||
background: #2d3035
|
|
||||||
.ais-search-box--input
|
|
||||||
background: #2d3035
|
|
||||||
color: #99a9bf
|
|
||||||
|
|
||||||
#algolia-search-results
|
|
||||||
.algolia-hit-item-link
|
|
||||||
color: #99a9bf !important
|
|
||||||
|
|
||||||
h1, h2, h3, h4, h5, h6
|
|
||||||
color: #99a9bf
|
|
||||||
|
|
||||||
.article-container code
|
|
||||||
background: #616a6b
|
|
||||||
color: #99a9bf
|
|
||||||
|
|
||||||
// 評論
|
|
||||||
#vcomment
|
|
||||||
*
|
|
||||||
color: #99a9bf !important
|
|
||||||
|
|
||||||
.vsys
|
|
||||||
background: rgb(97, 106, 107) !important
|
|
||||||
|
|
||||||
.vbtn
|
|
||||||
background: rgb(45, 48, 53) !important
|
|
||||||
color: #99a9bf !important
|
|
||||||
|
|
||||||
.recent-post-item .article-title
|
|
||||||
color: #99a9bf
|
|
||||||
|
|
||||||
#page-header
|
|
||||||
&.fixed
|
|
||||||
background: #2d3035
|
|
||||||
box-shadow: 0 5px 6px -5px rgba(133,133,133,0)
|
|
||||||
|
|
||||||
a,
|
|
||||||
.toggle-menu,
|
|
||||||
#site-name
|
|
||||||
color: #99a9bf
|
|
||||||
|
|
||||||
blockquote
|
|
||||||
border-left: 0.2rem solid #7A5353
|
|
||||||
color: #99a9bf
|
|
||||||
|
|
||||||
hr
|
|
||||||
background: 0
|
|
||||||
border: 2px dashed #616A6B
|
|
||||||
&:before
|
|
||||||
color: #99a9bf
|
|
||||||
|
|
||||||
.post-meta__tags
|
|
||||||
background: 0
|
|
||||||
border: 1px solid #99a9bf
|
|
||||||
color: #99a9bf
|
|
||||||
|
|
||||||
|
|
||||||
.post-copyright
|
|
||||||
border: 1px solid #99a9bf
|
|
||||||
|
|
||||||
*
|
|
||||||
color: #99a9bf
|
|
||||||
|
|
||||||
.article-container .highlight
|
|
||||||
background-color: #1B2631
|
|
||||||
.code pre
|
|
||||||
background-color: #1B2631
|
|
||||||
|
|
||||||
.gutter pre
|
|
||||||
background: #1C2833
|
|
||||||
|
|
||||||
|
|
||||||
&:after
|
|
||||||
background: rgb(27, 38, 59)
|
|
||||||
|
|
||||||
table
|
|
||||||
&:after,.copy-notice
|
|
||||||
background: rgb(27, 38, 59)
|
|
||||||
|
|
||||||
&::-webkit-scrollbar-thumb
|
|
||||||
background: lighten(#1B2631,10)
|
|
||||||
|
|
||||||
.copy-notice
|
|
||||||
background: rgb(27, 38, 59)
|
|
||||||
|
|
||||||
.post-cards,.md-links-item
|
|
||||||
// background: #2d3035
|
|
||||||
a
|
|
||||||
color: #99a9bf
|
|
||||||
|
|
||||||
.aplayer
|
|
||||||
color: #000000
|
|
||||||
filter: brightness(0.6)
|
|
||||||
|
|
||||||
.article-sort-item__title
|
|
||||||
color: #99a9bf
|
|
||||||
|
|
||||||
.category-list
|
|
||||||
a
|
|
||||||
color: #99a9bf
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.translate_chn_to_cht,
|
|
||||||
.nightshift,
|
|
||||||
#to_comment,
|
|
||||||
#readmode
|
|
||||||
background-color: #2d3035 !important
|
|
||||||
|
|
||||||
img
|
|
||||||
filter: brightness(0.6)
|
|
||||||
|
|
||||||
.layout_post
|
|
||||||
background:#2d3035
|
|
||||||
|
|
||||||
canvas
|
|
||||||
display: none !important
|
|
||||||
|
|
||||||
#aside_content
|
|
||||||
.card_widget
|
|
||||||
background:#2d3035 !important
|
|
||||||
.headline,
|
|
||||||
.length_num,
|
|
||||||
.aside_post_title,
|
|
||||||
.aside_category_list_link,
|
|
||||||
.archive-list-link,
|
|
||||||
.social-icon
|
|
||||||
color: #99a9bf !important
|
|
||||||
|
|
||||||
#bookmark-it
|
|
||||||
background: #616a6b !important
|
|
||||||
|
|
||||||
#archive,
|
|
||||||
.tag-cloud,
|
|
||||||
#tag,
|
|
||||||
.category-content,
|
|
||||||
#category,
|
|
||||||
#page,
|
|
||||||
.flink
|
|
||||||
background:#2d3035
|
|
||||||
|
|
||||||
#nav,
|
|
||||||
#top-container
|
|
||||||
&::before
|
|
||||||
content: ""
|
|
||||||
position: absolute
|
|
||||||
top: 0
|
|
||||||
bottom: 0
|
|
||||||
left: 0
|
|
||||||
right: 0
|
|
||||||
background-color: rgba(0,0,0,.6)
|
|
||||||
|
|
||||||
.layout_page
|
|
||||||
.post-meta__date,
|
|
||||||
.article-meta__separator,
|
|
||||||
.article-meta__categories,
|
|
||||||
i
|
|
||||||
color: #99a9bf
|
|
||||||
|
|
||||||
#site-info .blogtitle,
|
|
||||||
span.subtitle,
|
|
||||||
#post-info .posttitle,
|
|
||||||
#post-info #post-meta,
|
|
||||||
#site-social-icons i,
|
|
||||||
#top-container a
|
|
||||||
color: rgba(238,238,238,.6)
|
|
||||||
|
|
||||||
//打賞 分享
|
|
||||||
.post-reward
|
|
||||||
.reward-buttom
|
|
||||||
background-color: #616a6b
|
|
||||||
.post_share
|
|
||||||
filter: brightness(0.6)
|
|
||||||
img
|
|
||||||
filter: brightness(1)
|
|
||||||
|
|
||||||
&::-webkit-scrollbar-thumb
|
|
||||||
background: lighten(#2d3035,5)
|
|
||||||
|
|
||||||
@media screen and (max-width: 768px)
|
|
||||||
.night-mode
|
|
||||||
color: #99a9bf
|
|
||||||
background-color: rgb(45, 48, 53)
|
|
||||||
|
|
||||||
#page-header
|
|
||||||
.menus
|
|
||||||
a
|
|
||||||
color: #99a9bf
|
|
||||||
background: #2d3035
|
|
||||||
&.fixed
|
|
||||||
.menu-icon-first,
|
|
||||||
.menu-icon-second,
|
|
||||||
.menu-icon-third
|
|
||||||
background-color: #99a9bf;
|
|
||||||
|
|
||||||
|
|
||||||
@media screen and (min-width: 768px)
|
|
||||||
.night-mode
|
|
||||||
color: #99a9bf
|
|
||||||
background-color: #2d3032
|
|
||||||
|
|
||||||
.recent-post-item
|
|
||||||
background: #2d3035 !important
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -7,6 +7,9 @@ $theme-meta-color = #858585
|
|||||||
$theme-link-color = #99a9bf
|
$theme-link-color = #99a9bf
|
||||||
$theme-hr-color = #A4D8FA
|
$theme-hr-color = #A4D8FA
|
||||||
$theme-read-mode-bg-color = #FAF9DE
|
$theme-read-mode-bg-color = #FAF9DE
|
||||||
|
$font-family= Lato, Helvetica Neue For Number, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, PingFang SC, Hiragino Sans GB, "Microsoft YaHei", Helvetica Neue, Helvetica, Arial, sans-serif
|
||||||
|
$code-font = consolas, Menlo, "PingFang SC", "Microsoft YaHei", monospace, Helvetica Neue For Number
|
||||||
|
|
||||||
|
|
||||||
if hexo-config("theme_color") && hexo-config("theme_color.enable")
|
if hexo-config("theme_color") && hexo-config("theme_color.enable")
|
||||||
$theme-color = convert(hexo-config("theme_color.main")) || #49B1F5
|
$theme-color = convert(hexo-config("theme_color.main")) || #49B1F5
|
||||||
@@ -18,12 +21,16 @@ if hexo-config("theme_color") && hexo-config("theme_color.enable")
|
|||||||
$theme-hr-color = convert(hexo-config("theme_color.hr_color")) || #A4D8FA
|
$theme-hr-color = convert(hexo-config("theme_color.hr_color")) || #A4D8FA
|
||||||
$theme-read-mode-bg-color = convert(hexo-config("theme_color.read-mode-bg_color")) || #FAF9DE
|
$theme-read-mode-bg-color = convert(hexo-config("theme_color.read-mode-bg_color")) || #FAF9DE
|
||||||
|
|
||||||
|
if hexo-config("font") && hexo-config("font.enable")
|
||||||
|
$font-family = convert(hexo-config("font.font-family")) || 'Lato, Helvetica Neue For Number, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, PingFang SC, Hiragino Sans GB, "Microsoft YaHei", Helvetica Neue, Helvetica, Arial, sans-serif'
|
||||||
|
$code-font = convert(hexo-config("font.code-font")) || 'consolas, Menlo, "PingFang SC", "Microsoft YaHei", monospace, Helvetica Neue For Number'
|
||||||
|
|
||||||
// Global Variables
|
// Global Variables
|
||||||
$font-size = 14px
|
$font-size = 14px
|
||||||
$font-color = #1F2D3D
|
$font-color = #1F2D3D
|
||||||
$rem = 20px
|
$rem = 20px
|
||||||
$font-family = Lato, Helvetica Neue For Number, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, PingFang SC, Hiragino Sans GB, "Microsoft JhengHei","Microsoft YaHei", Helvetica Neue, Helvetica, Arial, sans-serif
|
$font-family = $font-family
|
||||||
$code-font = consolas, Menlo, "PingFang SC", "Microsoft JhengHei","Microsoft YaHei", monospace, Helvetica Neue For Number
|
$code-font = $code-font
|
||||||
$text-line-height = 2
|
$text-line-height = 2
|
||||||
$sm = 768px
|
$sm = 768px
|
||||||
$bg = 1024px
|
$bg = 1024px
|
||||||
|
|||||||
@@ -86,12 +86,6 @@ $(function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------
|
||||||
//側邊欄comment
|
|
||||||
$("#to_comment").on("click", function () {
|
|
||||||
|
|
||||||
scrollTo('#post-comment')
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
$(".scroll-down").on("click", function () {
|
$(".scroll-down").on("click", function () {
|
||||||
|
|
||||||
@@ -177,8 +171,8 @@ $(function () {
|
|||||||
} else { // webkit - safari/chrome
|
} else { // webkit - safari/chrome
|
||||||
// alert('按 ' + (navigator.userAgent.toLowerCase().indexOf('mac') != -1 ? 'Command/Cmd' : 'CTRL') + ' + D 鍵將本頁加入書籤.');
|
// alert('按 ' + (navigator.userAgent.toLowerCase().indexOf('mac') != -1 ? 'Command/Cmd' : 'CTRL') + ' + D 鍵將本頁加入書籤.');
|
||||||
$.fancyConfirm({
|
$.fancyConfirm({
|
||||||
title: "添加書籤?",
|
title: GLOBAL_CONFIG.bookmark.title + '?',
|
||||||
message: '按 ' + (navigator.userAgent.toLowerCase().indexOf('mac') != -1 ? 'Command/Cmd' : 'CTRL') + ' + D 鍵將本頁加入書籤.',
|
message: GLOBAL_CONFIG.bookmark.message_prev + (navigator.userAgent.toLowerCase().indexOf('mac') != -1 ? 'Command/Cmd' : 'CTRL') + '+ D ' + GLOBAL_CONFIG.bookmark.message_next + '.',
|
||||||
okButton: "OK",
|
okButton: "OK",
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -188,55 +182,64 @@ $(function () {
|
|||||||
//-------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------
|
||||||
//代码copy
|
//代码copy
|
||||||
// Add copy icon
|
// Add copy icon
|
||||||
// $('figure.highlight').wrap('<div class="code-area-wrap"></div>')
|
|
||||||
// var $copyIcon = $('<i class="fa fa-clipboard" aria-hidden="true"></i>')
|
|
||||||
// var $notice = $('<div class="copy-notice"></div>')
|
|
||||||
// $('.code-area-wrap').prepend($copyIcon)
|
|
||||||
// $('.code-area-wrap').prepend($notice)
|
|
||||||
// // copy function
|
|
||||||
// function copy(text, ctx) {
|
|
||||||
// if (document.queryCommandSupported && document.queryCommandSupported('copy')) {
|
|
||||||
// try {
|
|
||||||
// document.execCommand('copy') // Security exception may be thrown by some browsers.
|
|
||||||
// $(ctx).prev('.copy-notice')
|
|
||||||
// .text(GLOBAL_CONFIG.copy.success)
|
|
||||||
// .velocity({
|
|
||||||
// translateX: -30,
|
|
||||||
// opacity: 1
|
|
||||||
// }, {
|
|
||||||
// loop: 1,
|
|
||||||
// duration: 750,
|
|
||||||
// easing: 'easeOutQuint'
|
|
||||||
// })
|
|
||||||
// } catch (ex) {
|
|
||||||
// $(ctx).prev('.copy-notice')
|
|
||||||
// .text(GLOBAL_CONFIG.copy.error)
|
|
||||||
// .velocity({
|
|
||||||
// translateX: -30,
|
|
||||||
// opacity: 1
|
|
||||||
// }, {
|
|
||||||
// loop: 1,
|
|
||||||
// duration: 750,
|
|
||||||
// easing: 'easeOutQuint'
|
|
||||||
// })
|
|
||||||
// return false
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// $(ctx).prev('.copy-notice').text(GLOBAL_CONFIG.copy.noSupport)
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// // click events
|
|
||||||
// $('.code-area-wrap .fa-clipboard').on('click', function () {
|
|
||||||
// var selection = window.getSelection()
|
|
||||||
// var range = document.createRange()
|
|
||||||
// range.selectNodeContents($(this).siblings('figure').find('.code pre')[0])
|
|
||||||
// selection.removeAllRanges()
|
|
||||||
// selection.addRange(range)
|
|
||||||
// var text = selection.toString()
|
|
||||||
// copy(text, this)
|
|
||||||
// selection.removeAllRanges()
|
|
||||||
// })
|
|
||||||
|
|
||||||
|
var highlight_copy = GLOBAL_CONFIG.highlight_copy
|
||||||
|
if (highlight_copy == 'true') {
|
||||||
|
$('figure.highlight').wrap('<div class="code-area-wrap"></div>')
|
||||||
|
var $copyIcon = $('<i class="fa fa-clipboard" aria-hidden="true"></i>')
|
||||||
|
var $notice = $('<div class="copy-notice"></div>')
|
||||||
|
$('.code-area-wrap').prepend($copyIcon)
|
||||||
|
$('.code-area-wrap').prepend($notice)
|
||||||
|
// copy function
|
||||||
|
function copy(text, ctx) {
|
||||||
|
if (document.queryCommandSupported && document.queryCommandSupported('copy')) {
|
||||||
|
try {
|
||||||
|
document.execCommand('copy') // Security exception may be thrown by some browsers.
|
||||||
|
$(ctx).prev('.copy-notice')
|
||||||
|
.text(GLOBAL_CONFIG.copy.success)
|
||||||
|
.animate({
|
||||||
|
opacity: 1,
|
||||||
|
right: 30
|
||||||
|
}, 450, function () {
|
||||||
|
setTimeout(function () {
|
||||||
|
$(ctx).prev('.copy-notice').animate({
|
||||||
|
opacity: 0,
|
||||||
|
right: 0
|
||||||
|
}, 650)
|
||||||
|
}, 400)
|
||||||
|
})
|
||||||
|
} catch (ex) {
|
||||||
|
$(ctx).prev('.copy-notice')
|
||||||
|
.text(GLOBAL_CONFIG.copy.error)
|
||||||
|
.animate({
|
||||||
|
opacity: 1,
|
||||||
|
right: 30
|
||||||
|
}, 650, function () {
|
||||||
|
setTimeout(function () {
|
||||||
|
$(ctx).prev('.copy-notice').animate({
|
||||||
|
opacity: 0,
|
||||||
|
right: 0
|
||||||
|
}, 650)
|
||||||
|
}, 400)
|
||||||
|
})
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$(ctx).prev('.copy-notice').text(GLOBAL_CONFIG.copy.noSupport)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// click events
|
||||||
|
$('.code-area-wrap .fa-clipboard').on('click', function () {
|
||||||
|
var selection = window.getSelection()
|
||||||
|
var range = document.createRange()
|
||||||
|
range.selectNodeContents($(this).siblings('figure').find('.code pre')[0])
|
||||||
|
selection.removeAllRanges()
|
||||||
|
selection.addRange(range)
|
||||||
|
var text = selection.toString()
|
||||||
|
copy(text, this)
|
||||||
|
selection.removeAllRanges()
|
||||||
|
})
|
||||||
|
}
|
||||||
//---------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------
|
||||||
//fancybox
|
//fancybox
|
||||||
var imgList = $(".recent-post-info img");
|
var imgList = $(".recent-post-info img");
|
||||||
@@ -517,8 +520,7 @@ $(function () {
|
|||||||
$('body').toggleClass('read-mode');
|
$('body').toggleClass('read-mode');
|
||||||
$('#font_plus,#font_minus').toggleClass('is_visible');
|
$('#font_plus,#font_minus').toggleClass('is_visible');
|
||||||
|
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$('body').toggleClass('read-mode');
|
$('body').toggleClass('read-mode');
|
||||||
$('#font_plus,#font_minus').toggleClass('is_visible');
|
$('#font_plus,#font_minus').toggleClass('is_visible');
|
||||||
}
|
}
|
||||||
@@ -526,16 +528,14 @@ $(function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
//閲讀模式下字體調整
|
//閲讀模式下字體調整
|
||||||
$("#font_plus").click(function () {
|
$("#font_plus").click(function () {
|
||||||
var font_size_record = parseFloat($('body').css('font-size'))
|
var font_size_record = parseFloat($('body').css('font-size'))
|
||||||
$('body').css('font-size',font_size_record + 1)
|
$('body').css('font-size', font_size_record + 1)
|
||||||
}
|
});
|
||||||
);
|
|
||||||
|
|
||||||
$("#font_minus").click(function () {
|
$("#font_minus").click(function () {
|
||||||
var font_size_record = parseFloat($('body').css('font-size'))
|
var font_size_record = parseFloat($('body').css('font-size'))
|
||||||
$('body').css('font-size',font_size_record - 1)
|
$('body').css('font-size', font_size_record - 1)
|
||||||
}
|
});
|
||||||
);
|
|
||||||
});
|
});
|
||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user