diff --git a/.github/stale.yml b/.github/stale.yml
index 9e65d06..355bbee 100644
--- a/.github/stale.yml
+++ b/.github/stale.yml
@@ -4,9 +4,12 @@ daysUntilStale: 30
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
+ - pinned
+ - security
- bug
- - documentation
- enhancement
+ - Solved
+ - documentation
# Label to use when marking an issue as stale
staleLabel: wontfix
# Comment to post when marking an issue as stale. Set to `false` to disable
@@ -15,4 +18,4 @@ markComment: >
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
-closeComment: false
+closeComment: false
\ No newline at end of file
diff --git a/README.md b/README.md
index a1162e4..6c4b6da 100644
--- a/README.md
+++ b/README.md
@@ -1,30 +1,15 @@
# hexo-theme-butterfly
-
+
-
-
-
-Demo: https://demo.jerryc.me/
+
+
+Demo: https://demo.jerryc.me/
JerryC: https://jerryc.me/
-
-
Based on [hexo-theme-melody](https://github.com/Molunerfinn/hexo-theme-melody) theme.
-> If you update to hexo 4.2.0,it will be something's wrong
->
-> ```
-> Error: Cannot find module 'cheerio'
-> ```
->
-> please install cheerio
->
-> ```
-> npm install cheerio@0.22.0 --save
-> ```
-
## Installation
Stable branch:
@@ -51,7 +36,7 @@ git clone -b dev https://github.com/jerryc127/hexo-theme-butterfly.git themes/Bu
## Documentation
- Documentation is [here](https://jerryc.me/posts/21cfbf15). it supports `zh-TW`
+Find in [hexo-theme-butterfly docs](https://docs.jerryc.me) and [JerryC](https://jerryc.me/posts/21cfbf15). it supports `zh-TW`
## Screenshots
diff --git a/README_CN.md b/README_CN.md
index 3f11bd4..e74e055 100644
--- a/README_CN.md
+++ b/README_CN.md
@@ -1,31 +1,19 @@
# hexo-theme-butterfly
-
+
-
-
+
+
Demo: https://demo.jerryc.me/
-
JerryC: https://jerryc.me/
+
一款基於[hexo-theme-melody](https://github.com/Molunerfinn/hexo-theme-melody)修改的主題
-> 如果升級到hexo 4.2.0 ,會出現報錯
->
-> ```
-> Error: Cannot find module 'cheerio'
-> ```
->
-> 請在博客根目錄安裝cheerio
->
-> ```
-> npm install cheerio@0.22.0 --save
-> ```
-
## 安裝
-在你的博客根目錄裏
+在你的博客根目錄裡
```
git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/Butterfly
@@ -48,7 +36,7 @@ theme: Butterfly
## 文檔
-可查看[這裏](https://jerryc.me/posts/21cfbf15)
+可查看[hexo-theme-butterfly docs](https://docs.jerryc.me) 和 [JerryC](https://jerryc.me/posts/21cfbf15)
## 截圖

diff --git a/_config.yml b/_config.yml
index 1330538..a60630f 100644
--- a/_config.yml
+++ b/_config.yml
@@ -42,9 +42,9 @@ code_word_wrap: false
# copy setting
# 是否禁止複製(如果禁止,highlight_copy的功能將無效)
-# copyright 複製的内容後面加上版權信息
+# copyright 複製的內容後面加上版權信息
copy:
- enable: true # true 開啓 / false 禁止
+ enable: true # true 開啟 / false 禁止
copyright: false
# social settings
@@ -96,43 +96,79 @@ katex:
per_page: false
hide_scrollbar: true
+# mermaid
+# see https://github.com/knsv/mermaid
+# -------------------------------
+mermaid:
+ enable: false
+ # built-in themes: default/forest/dark/neutral
+ theme: default
+
# Post info settings
# ---------------
-avatar: /img/avatar.png
+avatar:
+ img: /img/avatar.png
+ effect: false # 頭像會一直轉圈
# the banner image of index
-index_img: https://cdn.jsdelivr.net/gh/jerryc127/butterfly_cdn@2.1.0/top_img/index.jpg
+index_img:
# if the banner of page not setting,it will show the top_img
-default_top_img: https://cdn.jsdelivr.net/gh/jerryc127/butterfly_cdn@2.1.0/top_img/index.jpg
-
-# the default cover of the post
-default_cover: https://cdn.jsdelivr.net/gh/jerryc127/butterfly_cdn@2.1.0/top_img/default.png
+default_top_img: /img/index.jpg
# the banner image of archive page
-archive_img: https://cdn.jsdelivr.net/gh/jerryc127/butterfly_cdn@2.1.0/top_img/archive.jpg
+archive_img:
# the banner image of tag page
-tag_img: https://cdn.jsdelivr.net/gh/jerryc127/butterfly_cdn@2.1.0/top_img/tag.png
+# tag page, look like https://xxxxxxxxx.com/tags/butterfly
+tag_img:
# the banner image of category page
-category_img: https://cdn.jsdelivr.net/gh/jerryc127/butterfly_cdn@2.1.0/top_img/category.jpg
+# category page, look like https://xxxxxxxxx.com/categories/butterfly
+category_img:
-# 如果你有使用hexo-douban去生成movie界面,可配置這個
-movies_img: https://cdn.jsdelivr.net/gh/jerryc127/butterfly_cdn@2.1.0/top_img/movie.jpg
+# 如果你有使用hexo-douban,可配置這個
+# douban:
+# meta: false
+# movies_img:
+# books_img:
+# games_img:
+
+cover:
+ # 是否顯示文章封面
+ index_enable: true
+ aside_enable: true
+ archives_enable: true
+ # 封面顯示的位置
+ # 三個值可配置 left , right , both
+ position: both
+ # 當沒有設置cover時,默認的封面顯示
+ default_cover:
+ - /img/post.jpg
# if the photo link cannot connect,it will show that
lodding_bg:
- flink: /img/friend_404.gif #404后圖片
- post_page: /img/404.jpg #404后圖片
+ flink: /img/friend_404.gif #404後圖片
+ post_page: /img/404.jpg #404後圖片
# post: /img/loading.gif ##加載動畫
-post_meta:
- date_type: both # or created or updated 文章日期是创建日或者更新日或都显示
- categories: true # or false 是否显示分类
- tags: true # or false 是否显示标签
+# A simple 404 page
+error_404:
+ enable: false
+ subtitle: "Page Not Found"
+ background:
-# Please see doc for more details: https://jerryc.me/posts/21cfbf15/#字数统计
+post_meta:
+ page:
+ date_type: created # created or updated or both 主頁文章日期是創建日或者更新日或都顯示
+ categories: true # true or false 主頁是否顯示分類
+ tags: false # true or false 主頁是否顯示標籤
+ post:
+ date_type: both # created or updated or both 文章頁日期是創建日或者更新日或都顯示
+ categories: true # true or false 文章頁是否顯示分類
+ tags: true # true or false 文章頁是否顯示標籤
+
+# Please see doc for more details: https://jerryc.me/posts/21cfbf15/#字數統計
wordcount:
enable: false
@@ -146,6 +182,7 @@ auto_open_sidebar:
post_copyright:
enable: true
+ decode: false
license: CC BY-NC-SA 4.0
license_url: https://creativecommons.org/licenses/by-nc-sa/4.0/
@@ -178,22 +215,23 @@ addtoany:
#### Comments System ####
# ------------------------------------
-# Disqus 官方版評論系統
disqus:
enable: false
shortname:
count: false # top_img顯示評論數
-# Disqus.js 版評論系統,應對大陸長城的折中方案,兼容原版:https://github.com/SukkaW/DisqusJS
+# Disqus.js版評論系統,應對大陸長城的折中方案,兼容原版:https://github.com/SukkaW/DisqusJS
# API 申請地址:https://disqus.com/api/applications/
# 與 disqus 共用樣式
disqusjs:
- enable: false #開啓改爲 true
- shortname:
- siteName:
- apikey:
+ enable: false
+ shortname:
+ siteName:
+ apikey:
api: https://disqus.skk.moe/disqus/ #一般情況下無需修改 API 地址
- count: false # top_img顯示評論數
+ admin:
+ adminLabel:
+ count: true # top_img顯示評論數
laibili:
enable: false
@@ -206,8 +244,12 @@ gitalk:
repo:
owner:
admin:
- language: # en , zh-CN , zh-TW
- count: false # top_img顯示評論數
+ language: zh-CN # en , zh-CN , zh-TW
+ perPage: 10 # Pagination size, with maximum 100.
+ distractionFreeMode: false # Facebook-like distraction free mode.
+ pagerDirection: last # Comment sorting direction, available values are last and first.
+ createIssueManually: false # Gitalk will create a corresponding github issue for your every single page automatically
+ count: true # top_img顯示評論數
# valine comment system. https://valine.js.org
valine:
@@ -221,12 +263,25 @@ valine:
lang: en # i18n: zh-cn/en
placeholder: Please leave your footprints # valine comment input placeholder(like: Please leave your footprints )
guest_info: nick,mail,link #valine comment header info
+ recordIP: false # Record reviewer IP
+ serverURLs: # This configuration is suitable for domestic custom domain name users, overseas version will be automatically detected (no need to manually fill in)
bg: /img/comment_bg.png # valine background
- count: false # top_img顯示評論數
+ count: true # top_img顯示評論數
+
+# utterances
+# https://utteranc.es/
+utterances:
+ enable: false
+ repo:
+ # 可選 pathname/url/title/og:title
+ issue_term: pathname
+ # 可選 github-light/github-dark/github-dark-orange/icy-dark/dark-blue/photon-dark
+ light_theme: github-light
+ dark_theme: photon-dark
##### Footer Settings ####
# ------------------------------------
-since: 2019
+since: 2020
footer_custom_text:
@@ -275,16 +330,6 @@ baidu_site_verification:
# see http://zhanzhang.so.com/
qihu_site_verification:
-# 友情鏈接界面設置
-Flink:
- headline: 友情鏈接
- info_headline: 我的Blog資料
- name: Blog 名字: JerryC
- address: Blog 地址: https://jerryc.me/
- avatar: Blog 頭像: https://jerryc.me/img/avatar.png
- info: Blog 簡介: 今日事,今日畢
- comment: 如果需要交換友鏈,請留言
-
# 打賞按鈕
reward:
enable: true
@@ -300,7 +345,7 @@ reward:
related_post:
enable: true
limit: 6 # 顯示推薦文章數目
- date_type: created # or created or updated 文章日期顯示创建日或者更新日
+ date_type: created # or created or updated 文章日期顯示創建日或者更新日
#### 美化/效果 ####
#--------------------------------
@@ -315,20 +360,19 @@ related_post:
# button_hover: "#FF7242"
# text_selection: "#00c4b6"
# link_color: "#99a9bf"
-# meta_color: '#858585'
+# meta_color: "#858585"
# hr_color: "#A4D8FA"
-# read-mode-bg_color: '#FAF9DE'
-# inline-code-color: '#F47466'
+# code_foreground: "#F47466"
+# code_background: "rgba(27, 31, 35, .05)"
+# toc_color: "#00c4b6"
+# blockquote_padding_color: "#49b1f5"
+# blockquote_background_color: "#49b1f5"
# 主頁設置
# 默認top_img全屏,site_info在中間
# 使用默認, 都無需填寫(建議默認)
-index_top_img_height: #主頁top_img高度 例如 300px/300em/300rem 不能使用百分比
-
-# 主頁文章COVER顯示位置
-# 三個值可配置 left , right , both
-# left(全部圖片顯示在左邊),right(全部圖片顯示在右邊),both(左右左右順序顯示)
-index_post_cover: both
+index_site_info_top: # 主頁標題距離頂部距離 例如 300px/300em/300rem/10%
+index_top_img_height: # 主頁top_img高度 例如 300px/300em/300rem 不能使用百分比
# category和tag頁的UI設置
# index 值代表 UI將與首頁的UI一樣
@@ -347,7 +391,7 @@ background:
footer_bg: false
# 背景特效
-# 避免卡頓,建議只開啓一個
+# 避免卡頓,建議只開啟一個
# canvas_ribbon 禁止彩帶背景
# See: https://github.com/hustcc/ribbon.js
canvas_ribbon:
@@ -380,8 +424,8 @@ activate_power_mode:
shake: true # 抖動特效
# 鼠標點擊效果
-# 避免卡頓,建議只開啓一個
-# 點擊烟火特效
+# 避免卡頓,建議只開啟一個
+# 點擊煙火特效
fireworks:
enable: false
@@ -393,30 +437,17 @@ click_heart:
ClickShowText:
enable: false
text:
- - 富强
- - 民主
- - 文明
- - 和谐
- - 自由
- - 平等
- - 公正
- - 法治
- - 爱国
- - 敬业
- - 诚信
- - 友善
+ - 本人
+ - 超帥
fontSize: 15px
-# 頭像會一直轉圈
-avatar_effect: false
-
# 網站顯示模式
# light 默認模式
# dark 黑暗模式(不建議)
display_mode: light
-# 美化post頁顯示
-post_beautify:
+# 美化頁面顯示
+beautify:
enable: false
title-prefix-icon: '\f0c1'
title-prefix-icon-color: "#F47466"
@@ -440,29 +471,37 @@ hr:
icon-top: -20px
# 主頁subtitle
-# 打字效果
subtitle:
enable: true
+ # 打字效果
+ effect: true
+ # 循環或者只打字一次
+ loop: false
# source調用第三方服務
# source: false 關閉調用
# source: 1 調用金山詞霸的每日一句(簡體)
- # source: 2 調用一言网的一句話(簡體) #https://hitokoto.cn/
- # source: 3 調用一句网(簡體) http://yijuzhan.com/
+ # source: 2 調用一言網的一句話(簡體) #https://hitokoto.cn/
+ # source: 3 調用一句網(簡體) http://yijuzhan.com/
# source: 4 調用今日詩詞(簡體) https://www.jinrishici.com/
- # subtitle 會先顯示 source , 再顯示 sub 的内容
+ # subtitle 會先顯示 source , 再顯示 sub 的內容
source: false
# (如果有英文逗號' , ',請使用轉義字符 ,)
+ # 如果關閉打字效果,subtitle只會顯示sub的第一行文字
sub:
- 今日事,今日畢
- Never put off till tomorrow what you can do today
+# fontawesome圖標
+# 默認使用的是 fontawesome v4版本的圖標
+fontawesome_v5:
+ enable: false
+
#### 側邊欄 ####
#-------------------------------------
-# 手機頁面( 顯示寬度 < 768px )是否顯示aside内容
-aside_mobile: true
-
# 側邊欄顯示設置
aside:
+ enable: true
+ mobile: true # 手機頁面( 顯示寬度 < 768px )是否顯示aside內容
position: right # left or right
card_author: true
card_announcement: true
@@ -497,30 +536,31 @@ translate:
enable: true
# 默認按鈕顯示文字
default: 繁
- #网站默认语言,1: 繁體中文, 2: 简体中文
+ #網站默認語言,1: 繁體中文, 2: 簡體中文
defaultEncoding: 2
- #延迟时间,若不在前, 要设定延迟翻译时间, 如100表示100ms,默认为0
+ #延遲時間,若不在前, 要設定延遲翻譯時間, 如100表示100ms,默認為0
translateDelay: 0
- #博客网址
+ #博客網址
cookieDomain: "https://xxx/"
#當文字是簡體時,按鈕顯示的文字
msgToTraditionalChinese: "繁"
#當文字是繁體時,按鈕顯示的文字
- msgToSimplifiedChinese: "简"
+ msgToSimplifiedChinese: "簡"
#閲讀模式
readmode:
enable: true
-# 夜間模式
+# dark mode
darkmode:
enable: true
-
-# 自動切換 dark mode和 light mode
-# autoChangeMode: 1 跟隨系統而變化,不支持的瀏覽器/系統將按照時間晚上6點到早上6點之間切換為 dark mode
-# autoChangeMode: 2 只按照時間晚上6點到早上6點之間切換為 dark mode
-# autoChangeMode: false 取消自動切換
-autoChangeMode: false
+ # dark mode和 light mode切換按鈕
+ button: true
+ # 自動切換 dark mode和 light mode
+ # autoChangeMode: 1 跟隨系統而變化,不支持的瀏覽器/系統將按照時間晚上6點到早上6點之間切換為 dark mode
+ # autoChangeMode: 2 只按照時間晚上6點到早上6點之間切換為 dark mode
+ # autoChangeMode: false 取消自動切換
+ autoChangeMode: 1
#### other ####
#------------------------------------------------
@@ -556,6 +596,12 @@ baidu_push:
instantpage:
enable: true
+# https://github.com/vinta/pangu.js
+# 中英文之間添加空格
+pangu:
+ enable: false
+ field: page # page/post
+
# Note (Bootstrap Callout)
# https://muse.theme-next.org/docs/tag-plugins/note
note:
@@ -590,14 +636,15 @@ twitter_meta: true
# https://i.loli.net/2019/09/08/2wbFJEKloisRvhj.png
Open_Graph_meta: true
+# 開啟hexo自帶的緩存,加快生成速度
+fragment_cache: true
+
# CDN
# 網站必須
# 可根據需要自行添加js/css
CDN_USE:
css:
- /css/index.css
- - https://cdn.jsdelivr.net/npm/font-awesome@latest/css/font-awesome.min.css
- # - https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css #fontawesomeV5_css
js:
- https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js #/js/third-party/jquery.min.js
@@ -607,52 +654,65 @@ CDN_USE:
# CDN
# 非必要不要修改
CDN:
- #comments
- blueimp_md5: https://cdn.jsdelivr.net/npm/blueimp-md5@2.10.0/js/md5.min.js
+ # comments
+ blueimp_md5: https://cdn.jsdelivr.net/npm/blueimp-md5/js/md5.min.js
gitalk: https://cdn.jsdelivr.net/npm/gitalk@latest/dist/gitalk.min.js
gitalk_css: https://cdn.jsdelivr.net/npm/gitalk/dist/gitalk.min.css
valine: https://cdn.jsdelivr.net/npm/valine/dist/Valine.min.js
+ disqusjs: https://cdn.jsdelivr.net/npm/disqusjs@1.2/dist/disqus.js
+ disqusjs_css: https://cdn.jsdelivr.net/npm/disqusjs@1.2/dist/disqusjs.css
+ utterances: https://utteranc.es/client.js
# share
addtoany: https://static.addtoany.com/menu/page.js
sharejs: https://cdn.jsdelivr.net/npm/social-share.js/dist/js/social-share.min.js
sharejs_css: https://cdn.jsdelivr.net/npm/social-share.js/dist/css/share.min.css
- #search
+ # search
+ local_search: /js/search/local-search.js
+ algolia_js: /js/search/algolia.js
algolia_search: https://cdn.jsdelivr.net/npm/instantsearch.js@2.10.5/dist/instantsearch.min.js
algolia_search_css: https://cdn.jsdelivr.net/npm/instantsearch.js@2.10.5/dist/instantsearch.min.css
+ # math
mathjax: https://cdn.jsdelivr.net/npm/mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML
katex: https://cdn.jsdelivr.net/npm/katex@latest/dist/katex.min.css
katex_copytex: https://cdn.jsdelivr.net/npm/katex-copytex@latest/dist/katex-copytex.min.js
katex_copytex_css: https://cdn.jsdelivr.net/npm/katex-copytex@latest/dist/katex-copytex.min.css
+ mermaid: https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js
- #不蒜子計數器
+ # count
busuanzi: //busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js
- # 背景特效
- canvas_ribbon: https://cdn.jsdelivr.net/gh/jerryc127/butterfly_cdn@2.1.0/js/canvas-ribbon.js
- canvas_ribbon_piao: https://cdn.jsdelivr.net/gh/jerryc127/butterfly_cdn@2.1.0/js/piao.js
- canvas_nest: https://cdn.jsdelivr.net/gh/jerryc127/butterfly_cdn@2.1.0/js/canvas-nest.js
+ # background effect
+ canvas_ribbon: /js/third-party/canvas-ribbon.js
+ canvas_ribbon_piao: /js/third-party/piao.js
+ canvas_nest: /js/third-party/canvas-nest.js
lazyload: https://cdn.jsdelivr.net/npm/lazysizes@latest/lazysizes.min.js
instantpage: https://cdn.jsdelivr.net/npm/instant.page@latest/instantpage.min.js
-
typed: https://cdn.jsdelivr.net/npm/typed.js
js_cookies: https://cdn.jsdelivr.net/npm/js-cookie/dist/js.cookie.min.js
+ pangu: https://cdn.jsdelivr.net/npm/pangu/dist/browser/pangu.min.js
+ # photo
fancybox_css: https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css
fancybox: https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js
medium_zoom: https://cdn.jsdelivr.net/npm/medium-zoom/dist/medium-zoom.min.js
+ # snackbar
snackbar_css: https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.css
snackbar: https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.js
- #鼠标点击特效
+ # 鼠標點擊特效
anime: https://cdn.jsdelivr.net/npm/animejs@latest/anime.min.js
- activate_power_mode: https://cdn.jsdelivr.net/npm/activate-power-mode/dist/activate-power-mode.min.js
- fireworks: https://cdn.jsdelivr.net/gh/jerryc127/butterfly_cdn@2.1.0/js/fireworks.js
- click_heart: https://cdn.jsdelivr.net/gh/jerryc127/butterfly_cdn@2.1.0/js/click_heart.js
- ClickShowText: https://cdn.jsdelivr.net/gh/jerryc127/butterfly_cdn@2.1.0/js/ClickShowText.js
+ activate_power_mode: /js/third-party/activate-power-mode.js
+ fireworks: /js/third-party/fireworks.js
+ click_heart: /js/third-party/click_heart.js
+ ClickShowText: /js/third-party/ClickShowText.js
+
+ # fontawesome
+ fontawesome_v4: https://cdn.jsdelivr.net/npm/font-awesome@latest/css/font-awesome.min.css
+ fontawesome_v5: https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css
translate: /js/tw_cn.js
diff --git a/languages/default.yml b/languages/default.yml
index d74e13b..29894f9 100644
--- a/languages/default.yml
+++ b/languages/default.yml
@@ -19,7 +19,6 @@ page:
sticky: Sticky
no_title: No title
-archives: Archives
post:
created: Created
@@ -27,12 +26,13 @@ post:
wordcount: Word count
min2read: "Reading time: %s min"
page_pv: Post View
- comments: comments
+ comments: Comments
copyright:
author: Author
link: Link
copyright_notice: Copyright Notice
copyright_content: 'All articles in this blog are licensed under %s unless stating additionally.'
+ recommend: Recommend
search: Search
algolia_search:
@@ -71,11 +71,9 @@ aside:
donate: Donate
share: Share
-
bookmark:
title: Bookmark
-
rightside:
readmode_title: Read Mode
font_plus_title: Increase font size
@@ -101,5 +99,7 @@ Snackbar:
message_next: to bookmark this page
chs_to_cht: Traditional Chinese Activated Manually
cht_to_chs: Simplified Chinese Activated Manually
- day_to_night: Light Mode Activated Manually
- night_to_day: Dark Mode Activated Manually
+ day_to_night: Dark Mode Activated Manually
+ night_to_day: Light Mode Activated Manually
+
+error_title: Page not found
diff --git a/languages/en.yml b/languages/en.yml
index d79d1dc..29894f9 100644
--- a/languages/en.yml
+++ b/languages/en.yml
@@ -19,7 +19,6 @@ page:
sticky: Sticky
no_title: No title
-archives: Archives
post:
created: Created
@@ -27,12 +26,13 @@ post:
wordcount: Word count
min2read: "Reading time: %s min"
page_pv: Post View
- comments: comments
+ comments: Comments
copyright:
author: Author
link: Link
copyright_notice: Copyright Notice
copyright_content: 'All articles in this blog are licensed under %s unless stating additionally.'
+ recommend: Recommend
search: Search
algolia_search:
@@ -101,3 +101,5 @@ Snackbar:
cht_to_chs: Simplified Chinese Activated Manually
day_to_night: Dark Mode Activated Manually
night_to_day: Light Mode Activated Manually
+
+error_title: Page not found
diff --git a/languages/zh-CN.yml b/languages/zh-CN.yml
index e804c47..9b4e224 100644
--- a/languages/zh-CN.yml
+++ b/languages/zh-CN.yml
@@ -19,7 +19,6 @@ page:
sticky: 置顶
no_title: 无题
-archives: 时间轴
post:
created: 发表于
@@ -32,7 +31,9 @@ post:
author: 文章作者
link: 文章链接
copyright_notice: 版权声明
- copyright_content: '本博客所有文章除特别声明外,均采用 %s 许可协议。转载请注明来自 %s!'
+ copyright_content: '本博客所有文章除特别声明外,均采用
+ %s 许可协议。转载请注明来自 %s!'
+ recommend: 相关推荐
search: 搜索
algolia_search:
@@ -75,7 +76,6 @@ share: 分享
bookmark:
title: 添加书签
-
rightside:
readmode_title: 阅读模式
font_plus_title: 放大字体
@@ -103,3 +103,5 @@ Snackbar:
cht_to_chs: 你已切换为简体
day_to_night: 你已切换为深色模式
night_to_day: 你已切换为浅色模式
+
+error_title: 页面没有找到
diff --git a/languages/zh-TW.yml b/languages/zh-TW.yml
index 0bd13d5..8aad902 100644
--- a/languages/zh-TW.yml
+++ b/languages/zh-TW.yml
@@ -15,11 +15,10 @@ page:
articles: 文章總覽
tag: 標籤
category: 分類
- archives: 時間軸
+ archives: 歸檔
sticky: 置頂
no_title: 無題
-archives: 時間軸
post:
created: 發表於
@@ -34,6 +33,7 @@ post:
copyright_notice: 版權聲明
copyright_content: '本博客所有文章除特別聲明外,均採用
%s 許可協議。轉載請註明來自 %s!'
+ recommend: 相關推薦
search: 搜索
algolia_search:
@@ -76,7 +76,6 @@ share: 分享
bookmark:
title: 添加書籤
-
rightside:
readmode_title: 閲讀模式
font_plus_title: 放大字體
@@ -105,4 +104,6 @@ Snackbar:
day_to_night: 你已切換為深色模式
night_to_day: 你已切換為淺色模式
+error_title: 頁面沒有找到
+
diff --git a/layout/404.pug b/layout/404.pug
new file mode 100644
index 0000000..8ae9438
--- /dev/null
+++ b/layout/404.pug
@@ -0,0 +1,87 @@
+doctype html
+html(lang=config.language data-theme=theme.display_mode)
+ head
+ - var pageTitle = _p('error_title')
+ - var tabTitle = pageTitle + ' | ' + config.title
+ - var pageDescription = page.description || page.title || config.description
+ - var pageKeywords = Array.isArray(config.keywords) ? (config.keywords).join(','): ([]).join(',') || config.keywords
+ - var pageAuthor = config.email ? config.author + ',' + config.email : config.author
+ - var pageCopyright = config.copyright || config.author
+ - var without_html = url.replace('index.html', '')
+ - var top_img = theme.error_404.background || theme.default_top_img
+ - var bg_img = `background-image: url(${top_img})`
+
+
+ meta(charset='UTF-8')
+ meta(http-equiv="X-UA-Compatible" content="IE=edge")
+ meta(name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5")
+ title= tabTitle
+ meta(name="description" content=pageDescription)
+ if pageKeywords
+ meta(name="keywords" content=pageKeywords)
+ meta(name="author" content=pageAuthor)
+ meta(name="copyright" content=pageCopyright)
+ meta(name ="format-detection" content="telephone=no")
+ !=favicon_tag(theme.favicon || config.favicon)
+ //- 預解析
+ include includes/head/dns_prefetch.pug
+ //- 網站驗證
+ include includes/head/site_verification.pug
+ //- Open_Graph
+ include includes/head/Open_Graph.pug
+ //- PWA
+ if (theme.pwa && theme.pwa.enable)
+ include includes/head/pwa
+
+ script(src=url_for(theme.CDN.js_cookies))
+
+ if theme.darkmode.enable
+ include includes/head/darkmode.pug
+
+ each item in theme.CDN_USE.css
+ link(rel='stylesheet', href=url_for(item))
+
+ if theme.fontawesome_v5 && theme.fontawesome_v5.enable
+ link(rel='stylesheet', href=url_for(theme.CDN.fontawesome_v5))
+ else
+ link(rel='stylesheet', href=url_for(theme.CDN.fontawesome_v4))
+
+ if (theme.snackbar && theme.snackbar.enable)
+ link(rel='stylesheet', href=url_for(theme.CDN.snackbar_css))
+
+ if theme.canonical
+ link(rel="canonical" href=without_html)
+
+ if theme.algolia_search.enable
+ link(rel="stylesheet" type="text/css" href=url_for(theme.CDN.algolia_search_css))
+ script(src=url_for(theme.CDN.algolia_search) defer)
+
+ //- google_adsense
+ include includes/head/google_adsense.pug
+
+ //- analytics
+ include includes/head/analytics.pug
+
+ if theme.blog_title_font.font_link
+ link(rel='stylesheet', href=url_for(theme.blog_title_font.font_link))
+
+ include includes/head/config.pug
+ include includes/head/config_site.pug
+
+ body
+ if theme.fireworks && theme.fireworks.enable
+ canvas.fireworks
+ nav#nav.error-no-found(style=bg_img)
+ include includes/header/header.pug
+ #error_info.is-center
+ h1#error_title= '404'
+ #error_subtitle= theme.error_404.subtitle
+ include includes/mobile-sidebar/index.pug
+ include includes/rightside.pug
+ each item in theme.CDN_USE.js
+ script(src=url_for(item))
+ include includes/additional-js.pug
+ include includes/search/index.pug
+
+
+
diff --git a/layout/archive.pug b/layout/archive.pug
index 84d7cd7..faa485c 100644
--- a/layout/archive.pug
+++ b/layout/archive.pug
@@ -1,4 +1,3 @@
-
extends includes/layout.pug
block content
@@ -6,6 +5,4 @@ block content
#archive
.article-sort-title= _p('page.articles') + ' - ' + site.posts.length
+articleSort(page.posts)
- include includes/pagination.pug
- #aside_content.aside_content
- include includes/widget/index.pug
+ include includes/pagination.pug
\ No newline at end of file
diff --git a/layout/category.pug b/layout/category.pug
index aadf5b0..c8b5cb3 100644
--- a/layout/category.pug
+++ b/layout/category.pug
@@ -5,15 +5,10 @@ block content
include ./includes/mixins/UI.pug
#recent-posts.recent-posts.category_ui
+UI_NEW(page.posts)
- include includes/pagination.pug
- #aside_content.aside_content
- include includes/widget/index.pug
+ include includes/pagination.pug
else
include ./includes/mixins/article-sort.pug
#category
.article-sort-title= _p('page.category') + ' - ' + page.category
+articleSort(page.posts)
- include includes/pagination.pug
- #aside_content.aside_content
- include includes/widget/index.pug
-
\ No newline at end of file
+ include includes/pagination.pug
\ No newline at end of file
diff --git a/layout/flink.pug b/layout/flink.pug
index b88ac37..532dcc5 100644
--- a/layout/flink.pug
+++ b/layout/flink.pug
@@ -1,30 +1,20 @@
-.flink
- each i in site.data.link
- h1= i.class_name
- .post-cards
- ul.md-links
- each item in i.link_list
- li.md-links-item
- a(href=item.link title=item.name target="_blank")
- if theme.lazyload.enable
- img.lazyload(data-src=item.avatar onerror=`this.onerror=null;this.src='` + url_for(theme.lodding_bg.flink) + `'` alt=item.name )
- else
- img(src=item.avatar onerror=`this.onerror=null;this.src='` + url_for(theme.lodding_bg.flink) + `'` alt=item.name )
- .md-links-title= item.name
- .md-links-des= item.descr
-
- hr
- div
- h2= theme.Flink.info_headline
- ul
- li= theme.Flink.name
- li= theme.Flink.address
- li= theme.Flink.avatar
- li= theme.Flink.info
-
- hr
- .comment_int
- p.comment-word= theme.Flink.comment
-
+#page
+ .flink#article-container
+ each i in site.data.link
+ h2= i.class_name
+ .post-cards
+ .md-links
+ each item in i.link_list
+ .md-links-item
+ a(href=item.link title=item.name target="_blank")
+ if theme.lazyload.enable
+ img.lazyload(data-src=item.avatar onerror=`this.onerror=null;this.src='` + url_for(theme.lodding_bg.flink) + `'` alt=item.name )
+ else
+ img(src=item.avatar onerror=`this.onerror=null;this.src='` + url_for(theme.lodding_bg.flink) + `'` alt=item.name )
+ .md-links-title= item.name
+ .md-links-des= item.descr
+ != page.content
+ if page.comments !== false
+ include includes/comments/index.pug
diff --git a/layout/includes/additional-js.pug b/layout/includes/additional-js.pug
index dec18e5..9f7804a 100644
--- a/layout/includes/additional-js.pug
+++ b/layout/includes/additional-js.pug
@@ -26,12 +26,10 @@ if (theme.canvas_nest && theme.canvas_nest.enable)
include ./third-party/canvas-nest.pug
if theme.activate_power_mode.enable
- - var colorful = theme.activate_power_mode.colorful == false ? false : true
- - var shake = theme.activate_power_mode.shake == false ? false : true
script(src=url_for(theme.CDN.activate_power_mode))
script.
- POWERMODE.colorful = !{colorful};
- POWERMODE.shake = !{shake};
+ POWERMODE.colorful = #{theme.activate_power_mode.colorful};
+ POWERMODE.shake = #{theme.activate_power_mode.shake};
document.body.addEventListener('input', POWERMODE);
if theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv
@@ -50,5 +48,18 @@ if theme.click_heart && theme.click_heart.enable
if theme.ClickShowText && theme.ClickShowText.enable
script(src=url_for(theme.CDN.ClickShowText))
+if theme.pangu && theme.pangu.enable
+ include ./third-party/pangu.pug
+
+//- search
+if theme.algolia_search && theme.algolia_search.enable
+ script(src=url_for(theme.CDN.algolia_js))
+else if theme.local_search && theme.local_search.enable
+ script(src=url_for(theme.CDN.local_search))
+
+//- mermaid
+if theme.mermaid.enable
+ include ./math/mermaid.pug
+
if is_home()
include index-js.pug
\ No newline at end of file
diff --git a/layout/includes/comments/disqus.pug b/layout/includes/comments/disqus.pug
index 1e0c01c..e4c3937 100644
--- a/layout/includes/comments/disqus.pug
+++ b/layout/includes/comments/disqus.pug
@@ -1,13 +1,23 @@
-if theme.disqus && theme.disqus.enable
- #disqus_thread
- script.
- var unused = null;
- var disqus_config = function () {
- this.page.url = '!{ page.permalink }';
- this.page.identifier = '!{ page.path }';
- this.page.title = '!{ page.title }';
- }
+#disqus_thread
+script.
+ var disqus_config = function () {
+ this.page.url = '!{ page.permalink }';
+ this.page.identifier = '!{ page.path }';
+ this.page.title = '!{ page.title }';
+ };
+ (function() {
var d = document, s = d.createElement('script');
- s.src = "https://" + '!{theme.disqus.shortname}' +".disqus.com/embed.js";
- s.setAttribute('data-timestamp', '' + +new Date());
- (d.head || d.body).appendChild(s);
\ No newline at end of file
+ s.src = 'https://!{theme.disqus.shortname}.disqus.com/embed.js';
+ s.setAttribute('data-timestamp', +new Date());
+ (d.head || d.body).appendChild(s);
+ })();
+
+script.
+ function getDisqusCount() {
+ var d = document, s = d.createElement('script');
+ s.src = 'https://!{theme.disqus.shortname}.disqus.com/count.js';
+ s.id = 'dsq-count-scr';
+ (d.head || d.body).appendChild(s);
+ }
+
+ window.addEventListener('load', getDisqusCount, false);
\ No newline at end of file
diff --git a/layout/includes/comments/disqusjs.pug b/layout/includes/comments/disqusjs.pug
index aaa7504..8b9edbe 100644
--- a/layout/includes/comments/disqusjs.pug
+++ b/layout/includes/comments/disqusjs.pug
@@ -1,16 +1,23 @@
-if theme.disqusjs && theme.disqusjs.enable
- #disqus_thread
- link(href=('https://cdn.jsdelivr.net/npm/disqusjs@1.2/dist/disqusjs.css') rel='stylesheet')
- script(src=('https://cdn.jsdelivr.net/npm/disqusjs@1.2/dist/disqus.js'))
- script.
- var dsqjs = new DisqusJS({
- shortname: '!{theme.disqusjs.shortname}',
- siteName: "!{theme.disqusjs.siteName}",
- identifier: '!{ page.path }',
- url: '!{ page.permalink }',
- title: '!{ page.title }',
- api: '!{theme.disqusjs.api}',
- apikey: '!{theme.disqusjs.apikey}',
- admin: '',
- adminLabel: ''
- });
\ No newline at end of file
+#disqus_thread
+script(src=url_for(theme.CDN.disqusjs))
+script.
+ var dsqjs = new DisqusJS({
+ shortname: '!{theme.disqusjs.shortname}',
+ siteName: "!{theme.disqusjs.siteName}",
+ identifier: '!{ page.path }',
+ url: '!{ page.permalink }',
+ title: '!{ page.title }',
+ api: '!{theme.disqusjs.api}',
+ apikey: '!{theme.disqusjs.apikey}',
+ admin: '!{theme.disqusjs.admin}',
+ adminLabel: '!{theme.disqusjs.adminLabel}'
+ });
+
+script.
+ function getDisqusCount() {
+ var d = document, s = d.createElement('script');
+ s.src = 'https://!{theme.disqusjs.shortname}.disqus.com/count.js';
+ s.id = 'dsq-count-scr';
+ (d.head || d.body).appendChild(s);
+ }
+ window.addEventListener('load', getDisqusCount, false);
diff --git a/layout/includes/comments/gitalk.pug b/layout/includes/comments/gitalk.pug
index c2f27a6..d4551a2 100644
--- a/layout/includes/comments/gitalk.pug
+++ b/layout/includes/comments/gitalk.pug
@@ -1,20 +1,23 @@
-if theme.gitalk && theme.gitalk.enable
- #gitalk-container
- script.
- var gitalk = new Gitalk({
- clientID: '!{theme.gitalk.client_id}',
- clientSecret: '!{theme.gitalk.client_secret}',
- repo: '!{theme.gitalk.repo}',
- owner: '!{theme.gitalk.owner}',
- admin: '!{theme.gitalk.admin}',
- id: md5(decodeURI(location.pathname)),
- language: '!{theme.gitalk.language}',
- updateCountCallback: commentCount
- })
- gitalk.render('gitalk-container')
+#gitalk-container
+script.
+ var gitalk = new Gitalk({
+ clientID: '!{theme.gitalk.client_id}',
+ clientSecret: '!{theme.gitalk.client_secret}',
+ repo: '!{theme.gitalk.repo}',
+ owner: '!{theme.gitalk.owner}',
+ admin: ['!{theme.gitalk.admin}'],
+ id: md5(decodeURI(location.pathname)),
+ language: '!{theme.gitalk.language}',
+ perPage: '!{theme.gitalk.perPage}',
+ distractionFreeMode: !{theme.gitalk.distractionFreeMode},
+ pagerDirection: '!{theme.gitalk.pagerDirection}',
+ createIssueManually: !{theme.gitalk.createIssueManually},
+ updateCountCallback: commentCount
+ })
+ gitalk.render('gitalk-container')
- function commentCount(n){
- document.getElementsByClassName('gitalk-comment-count')[0].innerHTML= n
- }
+ function commentCount(n){
+ document.getElementsByClassName('gitalk-comment-count')[0].innerHTML= n
+ }
diff --git a/layout/includes/comments/index.pug b/layout/includes/comments/index.pug
index ac01ec5..030ae23 100644
--- a/layout/includes/comments/index.pug
+++ b/layout/includes/comments/index.pug
@@ -3,8 +3,10 @@
- var l = theme.laibili && theme.laibili.enable
- var gt = theme.gitalk && theme.gitalk.enable
- var v = theme.valine && theme.valine.enable
+- var u = theme.utterances && theme.utterances.enable
+- var isComment = d || dj || l || gt || v || u
-if d || dj || l || gt || v
+if isComment
hr
#post-comment
.comment_headling
@@ -19,4 +21,6 @@ if d || dj || l || gt || v
else if gt
include ./gitalk.pug
else if v
- include ./valine.pug
\ No newline at end of file
+ include ./valine.pug
+ else if u
+ include ./utterances.pug
\ No newline at end of file
diff --git a/layout/includes/comments/laibili.pug b/layout/includes/comments/laibili.pug
index 334aab8..cd0fc75 100644
--- a/layout/includes/comments/laibili.pug
+++ b/layout/includes/comments/laibili.pug
@@ -1,11 +1,10 @@
-if theme.laibili && theme.laibili.enable
- #lv-container(data-id="city" data-uid=theme.laibili.uid)
- script.
- (function(d, s) {
- var j, e = d.getElementsByTagName(s)[0];
- if (typeof LivereTower === 'function') { return; }
- j = d.createElement(s);
- j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
- j.async = true;
- e.parentNode.insertBefore(j, e);
- })(document, 'script');
+#lv-container(data-id="city" data-uid=theme.laibili.uid)
+ script.
+ (function(d, s) {
+ var j, e = d.getElementsByTagName(s)[0];
+ if (typeof LivereTower === 'function') { return; }
+ j = d.createElement(s);
+ j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
+ j.async = true;
+ e.parentNode.insertBefore(j, e);
+ })(document, 'script');
diff --git a/layout/includes/comments/utterances.pug b/layout/includes/comments/utterances.pug
new file mode 100644
index 0000000..acb865a
--- /dev/null
+++ b/layout/includes/comments/utterances.pug
@@ -0,0 +1,19 @@
+script#utterances_comment(src=theme.CDN.utterances
+ repo=theme.utterances.repo
+ issue-term=theme.utterances.issue_term
+ theme=theme.utterances.light_theme
+ crossorigin="anonymous"
+ async)
+script.
+ var themeNow = document.documentElement.getAttribute('data-theme') === 'dark' ? '#{theme.utterances.dark_theme}' : '#{theme.utterances.light_theme}'
+ document.getElementById('utterances_comment').setAttribute('theme',themeNow)
+
+ function utterancesTheme () {
+ var theme = document.documentElement.getAttribute('data-theme') === 'dark' ? '#{theme.utterances.dark_theme}' : '#{theme.utterances.light_theme}'
+ const message = {
+ type: 'set-theme',
+ theme: theme
+ };
+ const iframe = document.querySelector('.utterances-frame');
+ iframe.contentWindow.postMessage(message, 'https://utteranc.es');
+ }
diff --git a/layout/includes/comments/valine.pug b/layout/includes/comments/valine.pug
index 59a524f..71a771c 100644
--- a/layout/includes/comments/valine.pug
+++ b/layout/includes/comments/valine.pug
@@ -1,25 +1,23 @@
-if theme.valine && theme.valine.enable
- #vcomment.vcomment
- script(src=url_for(theme.CDN.valine))
- script.
- var notify = #{ theme.valine.notify } == true ? true : false;
- var verify = #{ theme.valine.verify } == true ? true : false;
- var GUEST_INFO = ['nick','mail','link'];
- var guest_info = '#{ theme.valine.guest_info }'.split(',').filter(function(item){
- return GUEST_INFO.indexOf(item) > -1
- });
- guest_info = guest_info.length == 0 ? GUEST_INFO :guest_info;
+#vcomment.vcomment
+script(src=url_for(theme.CDN.valine))
+script.
+ var GUEST_INFO = ['nick','mail','link'];
+ var guest_info = '#{ theme.valine.guest_info }'.split(',').filter(function(item){
+ return GUEST_INFO.indexOf(item) > -1
+ });
+ guest_info = guest_info.length == 0 ? GUEST_INFO :guest_info;
- window.valine = new Valine({
- el:'#vcomment',
- notify:notify,
- verify:verify,
- appId:'#{theme.valine.appId}',
- appKey:'#{theme.valine.appKey}',
- placeholder:'#{theme.valine.placeholder}',
- avatar:'#{theme.valine.avatar}',
- guest_info:guest_info,
- pageSize:'#{theme.valine.pageSize}',
- lang:'#{theme.valine.lang}',
- recordIP: true
- });
+ window.valine = new Valine({
+ el:'#vcomment',
+ notify: #{theme.valine.notify},
+ verify: #{theme.valine.verify},
+ appId: '#{theme.valine.appId}',
+ appKey: '#{theme.valine.appKey}',
+ placeholder: '#{theme.valine.placeholder}',
+ avatar: '#{theme.valine.avatar}',
+ meta: guest_info,
+ pageSize: '#{theme.valine.pageSize}',
+ lang: '#{theme.valine.lang}',
+ recordIP: #{theme.valine.recordIP},
+ serverURLs: '#{theme.valine.serverURLs}'
+ });
diff --git a/layout/includes/footer.pug b/layout/includes/footer.pug
index 81a7e46..30b238f 100644
--- a/layout/includes/footer.pug
+++ b/layout/includes/footer.pug
@@ -8,7 +8,7 @@
if theme.footer_copyright.enable
.framework-info
span= _p('footer.driven') + ' '
- a(href='http://hexo.io')
+ a(href='https://hexo.io')
span Hexo
span.footer-separator |
span= _p('footer.theme') + ' '
diff --git a/layout/includes/head.pug b/layout/includes/head.pug
index de8c8f4..ddbb16f 100644
--- a/layout/includes/head.pug
+++ b/layout/includes/head.pug
@@ -1,31 +1,31 @@
-if is_home()
- - var top_img = theme.index_img || theme.default_top_img
-else if is_archive()
- - var top_img = theme.archive_img || theme.default_top_img
-else if is_tag()
- - var top_img = theme.tag_img || theme.default_top_img
-else if is_category()
- - var top_img = theme.category_img || theme.default_top_img
-else if is_current('/movies/', [strict])
- - var top_img = theme.movies_img || theme.default_top_img
-else if !is_post()
- - var top_img = page.top_img || theme.default_top_img
+- var pageTitle = page.title || config.title || ''
+- if (is_archive()) pageTitle = _p('page.archives')
+- if (is_tag()) pageTitle = _p('page.tag') + ': ' + page.tag
+- if (is_category()) pageTitle = _p('page.category') + ': ' + page.category
+- if (is_month()) pageTitle += ': ' + page.month + '/' + page.year
+- if (is_year()) pageTitle += ': ' + page.year
+- var isSubtitle = config.subtitle ? ' - ' + config.subtitle : ''
+- var tabTitle = is_home() || !pageTitle ? config.title + isSubtitle : pageTitle + ' | ' + config.title
+- pageTitle ? '' : pageTitle = config.title || ''
-- var without_index = url.replace('index.html', '')
-- var without_html = without_index.replace('.html', '')
+- var pageDescription = page.description || page.title || config.description
+- var pageKeywords = Array.isArray(config.keywords) ? (config.keywords).join(','): ([]).join(',') || config.keywords
+- if (page.tags && page.tags.data) pageKeywords = page.tags.data.map(function(tag) {return tag.name;}).join(',')
+- var pageAuthor = config.email ? config.author + ',' + config.email : config.author
+- var pageCopyright = config.copyright || config.author
+- var without_html = url.replace('index.html', '')
-//- 預解析
-include ./head/dns_prefetch.pug
-
-//- PWA
-if (theme.pwa && theme.pwa.enable)
- include ./head/pwa.pug
-
-//- 網站驗證
-include ./head/site_verification.pug
-
-//- Open_Graph
-include ./head/Open_Graph.pug
+meta(charset='UTF-8')
+meta(http-equiv="X-UA-Compatible" content="IE=edge")
+meta(name="viewport" content="width=device-width,initial-scale=1")
+title= tabTitle
+meta(name="description" content=pageDescription)
+if pageKeywords
+ meta(name="keywords" content=pageKeywords)
+meta(name="author" content=pageAuthor)
+meta(name="copyright" content=pageCopyright)
+meta(name ="format-detection" content="telephone=no")
+!=favicon_tag(theme.favicon || config.favicon)
if theme.disable_baidu_transformation
meta(http-equiv="Cache-Control" content="no-transform")
@@ -34,14 +34,35 @@ if theme.disable_baidu_transformation
if page.hide == true
meta(name="robots" content="noindex")
+if theme.douban.meta && (is_current('/movies/', [strict]) || is_current('/books/', [strict]) || is_current('/games/', [strict]))
+ meta(name="referrer" content="no-referrer")
+
+//- 預解析
+!=partial('includes/head/dns_prefetch', {}, {cache:theme.fragment_cache})
+
+//- 網站驗證
+!=partial('includes/head/site_verification', {}, {cache:theme.fragment_cache})
+
+//- Open_Graph
+include ./head/Open_Graph.pug
+
+//- PWA
+if (theme.pwa && theme.pwa.enable)
+ !=partial('includes/head/pwa', {}, {cache:theme.fragment_cache})
+
script(src=url_for(theme.CDN.js_cookies))
-if (theme.darkmode && theme.darkmode.enable) || theme.autoChangeMode !== false
- include ./head/darkmode.pug
+if theme.darkmode.enable
+ !=partial('includes/head/darkmode', {}, {cache:theme.fragment_cache})
each item in theme.CDN_USE.css
link(rel='stylesheet', href=url_for(item))
+if theme.fontawesome_v5 && theme.fontawesome_v5.enable
+ link(rel='stylesheet', href=url_for(theme.CDN.fontawesome_v5))
+else
+ link(rel='stylesheet', href=url_for(theme.CDN.fontawesome_v4))
+
if (theme.fancybox && theme.fancybox.enable)
link(rel='stylesheet', href=url_for(theme.CDN.fancybox_css))
@@ -61,19 +82,18 @@ if theme.algolia_search.enable
link(rel="stylesheet" type="text/css" href=url_for(theme.CDN.algolia_search_css))
script(src=url_for(theme.CDN.algolia_search) defer)
-if (theme.gitalk && theme.gitalk.enable)
- link(rel="stylesheet" type="text/css" href=url_for(theme.CDN.gitalk_css))
- script(src=url_for(theme.CDN.gitalk))
- script(src=url_for(theme.CDN.blueimp_md5))
+//- comment css
+include ./head/comment.pug
//- google_adsense
-include ./head/google_adsense.pug
+!=partial('includes/head/google_adsense', {}, {cache:theme.fragment_cache})
//- analytics
-include ./head/analytics.pug
-
-if !is_post()
- link(rel="preload" href=url_for(top_img) as="image" )
+!=partial('includes/head/analytics', {}, {cache:theme.fragment_cache})
if theme.blog_title_font.font_link
- link(rel='stylesheet', href=url_for(theme.blog_title_font.font_link))
\ No newline at end of file
+ link(rel='stylesheet', href=url_for(theme.blog_title_font.font_link))
+
+//- global config
+!=partial('includes/head/config', {}, {cache:theme.fragment_cache})
+include ./head/config_site.pug
diff --git a/layout/includes/head/Open_Graph.pug b/layout/includes/head/Open_Graph.pug
index 54cecee..ff4a39b 100644
--- a/layout/includes/head/Open_Graph.pug
+++ b/layout/includes/head/Open_Graph.pug
@@ -1,19 +1,17 @@
-- var photo_check = is_post() ? page.cover || theme.avatar : theme.avatar
-- var photo_link = url_check (photo_check) ? photo_check : config.url + photo_check
- var contentType = is_post() ? 'article' : 'website'
//- twitter meta
if theme.twitter_meta
meta(name="twitter:card" content="summary")
- meta(name="twitter:title" content=pageTitle_no_include_blog_name)
+ meta(name="twitter:title" content=pageTitle)
meta(name="twitter:description" content=pageDescription)
- meta(name="twitter:image" content=photo_link)
+ meta(name="twitter:image" content=full_url_for(page.cover || theme.avatar.img))
//- Open_Graph
if theme.Open_Graph_meta
meta(property="og:type" content=contentType)
- meta(property="og:title" content=pageTitle_no_include_blog_name)
+ meta(property="og:title" content=pageTitle)
meta(property="og:url" content=without_html)
meta(property="og:site_name" content=config.title)
meta(property="og:description" content=pageDescription)
- meta(property="og:image" content=photo_link)
+ meta(property="og:image" content=full_url_for(page.cover || theme.avatar.img))
diff --git a/layout/includes/head/analytics.pug b/layout/includes/head/analytics.pug
index a0115f4..768b3e6 100644
--- a/layout/includes/head/analytics.pug
+++ b/layout/includes/head/analytics.pug
@@ -19,4 +19,4 @@ if theme.google_analytics
ga('send', 'pageview');
if theme.tencent_analytics
- script(src=`https://tajs.qq.com/stats?sId=` + theme.tencent_analytics charset="UTF-8")
+ script(src=`https://tajs.qq.com/stats?sId=${theme.tencent_analytics}` charset="UTF-8")
diff --git a/layout/includes/head/comment.pug b/layout/includes/head/comment.pug
new file mode 100644
index 0000000..91d5cf0
--- /dev/null
+++ b/layout/includes/head/comment.pug
@@ -0,0 +1,8 @@
+if (theme.disqusjs && theme.disqusjs.enable && page.comments !== false && !is_tag() && !is_category() && !is_archive() && !is_home())
+ link(rel="stylesheet" type="text/css" href=url_for(theme.CDN.disqusjs_css))
+
+if (theme.gitalk && theme.gitalk.enable && page.comments !== false && !is_tag() && !is_category() && !is_archive() && !is_home())
+ link(rel="stylesheet" type="text/css" href=url_for(theme.CDN.gitalk_css))
+ script(src=url_for(theme.CDN.gitalk))
+ script(src=url_for(theme.CDN.blueimp_md5))
+
diff --git a/layout/includes/config.pug b/layout/includes/head/config.pug
similarity index 90%
rename from layout/includes/config.pug
rename to layout/includes/head/config.pug
index 3bd7bb7..88a8633 100644
--- a/layout/includes/config.pug
+++ b/layout/includes/head/config.pug
@@ -76,12 +76,14 @@
})
}
+ var highlightCopy = theme.highlight_copy
+ var highlightLang = theme.highlight_lang
+ var highlightShrink = theme.highlight_shrink
var runtime = theme.runtimeshow.enable
var fancybox = theme.fancybox.enable
var medium_zoom = theme.medium_zoom.enable
var baiduPush = theme.baidu_push && theme.baidu_push.enable
- var isHome = is_home() ? true : false
- var isPost = is_post() ? true : false
+ var isFontAwesomeV5 = theme.fontawesome_v5 && theme.fontawesome_v5.enable
script.
@@ -108,8 +110,10 @@ script.
fancybox: !{fancybox},
Snackbar: !{Snackbar},
baiduPush: !{baiduPush},
- isHome: !{isHome},
- isPost: !{isPost}
+ highlightCopy: !{highlightCopy},
+ highlightLang: !{highlightLang},
+ highlightShrink: !{highlightShrink},
+ isFontAwesomeV5: !{isFontAwesomeV5}
}
diff --git a/layout/includes/head/config_site.pug b/layout/includes/head/config_site.pug
new file mode 100644
index 0000000..1e5ed9e
--- /dev/null
+++ b/layout/includes/head/config_site.pug
@@ -0,0 +1,6 @@
+script.
+ var GLOBAL_CONFIG_SITE = {
+ isPost: !{is_post()},
+ isHome: !{is_home()}
+ }
+
diff --git a/layout/includes/head/darkmode.pug b/layout/includes/head/darkmode.pug
index 72b1f16..e6adeab 100644
--- a/layout/includes/head/darkmode.pug
+++ b/layout/includes/head/darkmode.pug
@@ -1,25 +1,24 @@
script.
- const autoChangeMode = '#{theme.autoChangeMode}'
- var t = Cookies.get("theme");
+ const autoChangeMode = '#{theme.darkmode.autoChangeMode}'
+ var t = Cookies.get("theme")
if (autoChangeMode == '1'){
- const isDarkMode = window.matchMedia("(prefers-color-scheme: dark)").matches
- const isLightMode = window.matchMedia("(prefers-color-scheme: light)").matches
- const isNotSpecified = window.matchMedia("(prefers-color-scheme: no-preference)").matches
- const hasNoSupport = !isDarkMode && !isLightMode && !isNotSpecified
-
- if (t === undefined){
- if (isLightMode) activateLightMode()
- else if (isDarkMode) activateDarkMode()
- else if (isNotSpecified || hasNoSupport){
- console.log('You specified no preference for a color scheme or your browser does not support it. I Schedule dark mode during night time.')
- now = new Date();
- hour = now.getHours();
- isNight = hour < 6 || hour >= 18
- isNight ? activateDarkMode() : activateLightMode()
- }
- } else if (t == 'light') activateLightMode()
- else activateDarkMode()
+ const isDarkMode = window.matchMedia("(prefers-color-scheme: dark)").matches
+ const isLightMode = window.matchMedia("(prefers-color-scheme: light)").matches
+ const isNotSpecified = window.matchMedia("(prefers-color-scheme: no-preference)").matches
+ const hasNoSupport = !isDarkMode && !isLightMode && !isNotSpecified
+ if (t === undefined){
+ if (isLightMode) activateLightMode()
+ else if (isDarkMode) activateDarkMode()
+ else if (isNotSpecified || hasNoSupport){
+ console.log('You specified no preference for a color scheme or your browser does not support it. I Schedule dark mode during night time.')
+ now = new Date();
+ hour = now.getHours();
+ isNight = hour < 6 || hour >= 18
+ isNight ? activateDarkMode() : activateLightMode()
+ }
+ } else if (t == 'light') activateLightMode()
+ else activateDarkMode()
} else if (autoChangeMode == '2'){
now = new Date();
diff --git a/layout/includes/header.pug b/layout/includes/header.pug
deleted file mode 100644
index 28458d4..0000000
--- a/layout/includes/header.pug
+++ /dev/null
@@ -1,16 +0,0 @@
-header
- #page-header
- span#blog_name.pull_left
- a#site-name.blog_title(href=url_for('/')) #[=config.title]
- span.toggle-menu.pull_right.close
- a.site-page
- i.fa.fa-bars.fa-fw(aria-hidden="true")
- span.pull_right.menus
- .menus_items
- include menu_item.pug
-
- if (theme.algolia_search.enable || theme.local_search && theme.local_search.enable)
- span#search_button.pull_right
- a.site-page.social-icon.search
- i.fa.fa-search.fa-fw
- span=' '+_p('search')
diff --git a/layout/includes/header/header.pug b/layout/includes/header/header.pug
new file mode 100644
index 0000000..9346dd0
--- /dev/null
+++ b/layout/includes/header/header.pug
@@ -0,0 +1,15 @@
+#page-header
+ span#blog_name.pull_left
+ a#site-name.blog_title(href=url_for('/')) #[=config.title]
+ span.toggle-menu.pull_right.close
+ a.site-page
+ i.fa.fa-bars.fa-fw(aria-hidden="true")
+ span.pull_right.menus
+ .menus_items
+ include ./menu_item.pug
+
+ if (theme.algolia_search.enable || theme.local_search && theme.local_search.enable)
+ span#search_button.pull_right
+ a.site-page.social-icon.search
+ i.fa.fa-search.fa-fw
+ span=' '+_p('search')
diff --git a/layout/includes/header/index.pug b/layout/includes/header/index.pug
new file mode 100644
index 0000000..b3c9d9d
--- /dev/null
+++ b/layout/includes/header/index.pug
@@ -0,0 +1,45 @@
+if is_home()
+ - var top_img = theme.index_img || theme.default_top_img
+else if is_post()
+ - var top_img = page.top_img || page.cover || page.randomcover || theme.default_top_img
+else if is_archive()
+ - var top_img = theme.archive_img || theme.default_top_img
+else if is_tag()
+ - var top_img = theme.tag_img || theme.default_top_img
+else if is_category()
+ - var top_img = theme.category_img || theme.default_top_img
+else
+ - var top_img = page.top_img || theme.default_top_img
+
+if theme.douban
+ if is_current('/movies/', [strict])
+ - var top_img = theme.douban.movies_img || theme.default_top_img
+ else if is_current('/books/', [strict])
+ - var top_img = theme.douban.books_img || theme.default_top_img
+ else if is_current('/games/', [strict])
+ - var top_img = theme.douban.games_img || theme.default_top_img
+
+- var bg_img = top_img && top_img !== true ? `background-image: url(${top_img})` : ''
+- var site_title = is_archive() ? _p('page.archives') : page.title || page.tag || page.category || config.title
+- var isHomeClass = is_home() ? 'full_page' : 'not-index-bg'
+- is_post() ? isHomeClass = 'post-bg' : isHomeClass
+
+#nav(class=isHomeClass style=bg_img)
+ !=partial('includes/header/header', {}, {cache:theme.fragment_cache})
+ if is_home()
+ #site-info
+ h1#site_title=site_title
+ #site_subtitle
+ span#subtitle
+ if(theme.social)
+ #site_social_icons
+ each url, icon in theme.social
+ a.social-icon(href=url target="_blank")
+ i(class=icon aria-hidden="true")
+ #scroll_down
+ i.fa.fa-angle-down.scroll-down-effects
+ else if is_post()
+ include ./post-info.pug
+ else
+ #page_site-info
+ h1#site_title=site_title
diff --git a/layout/includes/menu_item.pug b/layout/includes/header/menu_item.pug
similarity index 100%
rename from layout/includes/menu_item.pug
rename to layout/includes/header/menu_item.pug
diff --git a/layout/includes/header/post-info.pug b/layout/includes/header/post-info.pug
new file mode 100644
index 0000000..86629b2
--- /dev/null
+++ b/layout/includes/header/post-info.pug
@@ -0,0 +1,65 @@
+#post-info
+ #post-title
+ .posttitle= page.title || _p('no_title')
+ #post-meta
+ if (theme.post_meta.post.date_type)
+ if (theme.post_meta.post.date_type === 'both')
+ time.post-meta__date
+ i.fa.fa-calendar.fa-fw(aria-hidden="true")
+ =' '+_p('post.created')+' '+date(page.date, config.date_format)
+ span.post-meta__separator |
+ i.fa.fa-history.fa-fw(aria-hidden="true")
+ =' '+_p('post.updated')+' '+date(page.updated, config.date_format)
+ else
+ - var date_type = theme.post_meta.post.date_type === 'updated' ? 'updated' : 'date'
+ time.post-meta__date #[i.fa.fa-calendar.fa-fw(aria-hidden="true")] #[=date(page[date_type], config.date_format)]
+
+ if (theme.post_meta.post.categories && page.categories.data.length > 0)
+ if (theme.post_meta.post.date_type)
+ span.post-meta__separator |
+ span
+ each item, index in page.categories.data
+ i.fa.fa-inbox.post-meta__icon.fa-fw(aria-hidden="true")
+ a(href=url_for(item.path)).post-meta__categories #[=item.name]
+ if (index < page.categories.data.length - 1)
+ i.fa.fa-angle-right.fa-fw(aria-hidden="true")
+ .post-meta-wordcount
+ if (theme.wordcount && theme.wordcount.enable)
+ - var wordCountIcon = theme.fontawesome_v5 && theme.fontawesome_v5.enable ? 'far fa-file-word' : 'fa fa-file-word-o'
+ i.post-meta__icon.fa-fw(class=wordCountIcon aria-hidden="true")
+ span= _p('post.wordcount') + ':'
+ span.word-count= wordcount(page.content)
+ span.post-meta__separator |
+ - var readCountIcon = theme.fontawesome_v5 && theme.fontawesome_v5.enable ? 'far fa-clock' : 'fa fa-clock-o'
+ i.post-meta__icon.fa-fw(class=readCountIcon aria-hidden="true")
+ span= _p('post.min2read', min2read(page.content, {cn: 350, en: 160}))
+ .post-meta-pv-cv
+ if (theme.wordcount && theme.wordcount.enable && theme.busuanzi.page_pv)
+ span.post-meta__separator |
+ if theme.busuanzi.page_pv
+ i.fa.fa-eye.post-meta__icon.fa-fw(aria-hidden="true")
+ span=_p('post.page_pv') + ':'
+ span#busuanzi_value_page_pv
+
+ - var commentCount = theme.fontawesome_v5 && theme.fontawesome_v5.enable ? 'far fa-comments' : 'fa fa-comment-o'
+ if ((theme.disqus && theme.disqus.enable && theme.disqus.count && page.comments !== false) || (theme.disqusjs && theme.disqusjs.enable && theme.disqusjs.count && page.comments !== false))
+ if (theme.busuanzi && theme.busuanzi.page_pv)
+ span.post-meta__separator |
+ i.post-meta__icon.fa-fw(class=commentCount aria-hidden="true")
+ span= _p('post.comments') + ':'
+ span.disqus-comment-count.comment-count
+ a(href=full_url_for(page.path) + '#disqus_thread')
+ if (theme.valine && theme.valine.enable && theme.valine.count && page.comments !== false)
+ if (theme.busuanzi && theme.busuanzi.page_pv)
+ span.post-meta__separator |
+ i.post-meta__icon.fa-fw(class=commentCount aria-hidden="true")
+ span= _p('post.comments') + ':'
+ a(href=url_for(page.path) + '#post-comment' itemprop="discussionUrl")
+ span.valine-comment-count.comment-count(data-xid=url_for(page.path) itemprop="commentCount")
+ if (theme.gitalk && theme.gitalk.enable && theme.gitalk.count && page.comments !== false)
+ if (theme.busuanzi && theme.busuanzi.page_pv)
+ span.post-meta__separator |
+ i.post-meta__icon.fa-fw(class=commentCount aria-hidden="true")
+ span= _p('post.comments') + ':'
+ a(href=url_for(page.path) + '#post-comment')
+ span.gitalk-comment-count.comment-count
diff --git a/layout/includes/index-js.pug b/layout/includes/index-js.pug
index 9c75317..cdbb734 100644
--- a/layout/includes/index-js.pug
+++ b/layout/includes/index-js.pug
@@ -1,90 +1,116 @@
if theme.subtitle.enable
- script(src=url_for(theme.CDN.typed))
- - var source = theme.subtitle.source
+ - let source = theme.subtitle.source
+ - let subtitleEffect = theme.subtitle.effect
- if source == '1' || source == '2'
- script(src="https://cdn.jsdelivr.net/npm/bluebird@3/js/browser/bluebird.min.js")
- script(src="https://cdn.jsdelivr.net/npm/whatwg-fetch@2.0.3/fetch.min.js")
+ if subtitleEffect
+ script(src=url_for(theme.CDN.typed))
if source == '1'
script.
+ let subtitleEffect = !{subtitleEffect}
fetch('https://api.ooopn.com/ciba/api.php',)
.then(function (res){
return res.json();
})
.then(function (data) {
- var sub = '!{theme.subtitle.sub}'.length == 0 ? new Array() : '!{theme.subtitle.sub}'.split(",");
- var both = sub.unshift(data['ciba-en'],data.ciba)
- var typed = new Typed(".subtitle", {
- strings: sub,
- startDelay: 300,
- typeSpeed: 100,
- loop: true,
- backSpeed: 50
- });
+ if (subtitleEffect){
+ let sub = '!{theme.subtitle.sub}'.length == 0 ? new Array() : '!{theme.subtitle.sub}'.split(",");
+ let both = sub.unshift(data['ciba-en'],data.ciba)
+ let typed = new Typed("#subtitle", {
+ strings: sub,
+ startDelay: 300,
+ typeSpeed: 150,
+ loop: !{theme.subtitle.loop},
+ backSpeed: 50
+ });
+ }else{
+ document.getElementById("subtitle").innerHTML = data['ciba-en']
+ }
})
.catch(function (err) {
console.error(err);
})
+
else if source == '2'
script.
+ let subtitleEffect = !{subtitleEffect}
fetch('https://v1.hitokoto.cn')
.then(function (res){
return res.json();
})
.then(function (data) {
- var sub = '!{theme.subtitle.sub}'.length == 0 ? new Array() : '!{theme.subtitle.sub}'.split(",");
- var both = sub.unshift(data.hitokoto)
- var typed = new Typed(".subtitle", {
- strings: sub,
- startDelay: 300,
- typeSpeed: 100,
- loop: true,
- backSpeed: 50
- });
+ if (subtitleEffect){
+ let from = '出自 ' + data.from
+ let sub = '!{theme.subtitle.sub}'.length == 0 ? new Array() : '!{theme.subtitle.sub}'.split(",");
+ let both = sub.unshift(data.hitokoto,from)
+ let typed = new Typed("#subtitle", {
+ strings: sub,
+ startDelay: 300,
+ typeSpeed: 150,
+ loop: !{theme.subtitle.loop},
+ backSpeed: 50
+ });
+ }else{
+ document.getElementById("subtitle").innerHTML = data.hitokoto
+ }
})
.catch(function (err) {
console.error(err);
})
+
else if source == "3"
script(type="text/javascript" src="http://yijuzhan.com/api/word.php?m=js")
script.
- var con = str[0];
- var author = "出自 " + str[1];
- var sub = '!{theme.subtitle.sub}'.length == 0 ? new Array() : '!{theme.subtitle.sub}'.split(",");
- var both = sub.unshift(con,author)
- var typed = new Typed(".subtitle", {
- strings: sub,
- startDelay: 300,
- typeSpeed: 100,
- loop: true,
- backSpeed: 50
- });
+ let subtitleEffect = !{subtitleEffect}
+ let con = str[0];
+ if (subtitleEffect){
+ let from = "出自 " + str[1];
+ let sub = '!{theme.subtitle.sub}'.length == 0 ? new Array() : '!{theme.subtitle.sub}'.split(",");
+ let both = sub.unshift(con,from)
+ let typed = new Typed("#subtitle", {
+ strings: sub,
+ startDelay: 300,
+ typeSpeed: 150,
+ loop: !{theme.subtitle.loop},
+ backSpeed: 50
+ });
+ }else{
+ document.getElementById("subtitle").innerHTML = con
+ }
+
else if source == '4'
script(type="text/javascript" src="https://sdk.jinrishici.com/v2/browser/jinrishici.js" charset="utf-8")
script.
+ let subtitleEffect = !{subtitleEffect}
jinrishici.load(function(result) {
- var sub = '!{theme.subtitle.sub}'.length == 0 ? new Array() : '!{theme.subtitle.sub}'.split(",");
- var content = result.data.content;
- var both = sub.unshift(content)
- var typed = new Typed(".subtitle", {
- strings: sub,
- startDelay: 300,
- typeSpeed: 100,
- loop: true,
- backSpeed: 50
- });
+ if (subtitleEffect){
+ let sub = '!{theme.subtitle.sub}'.length == 0 ? new Array() : '!{theme.subtitle.sub}'.split(",");
+ let content = result.data.content;
+ let both = sub.unshift(content)
+ let typed = new Typed("#subtitle", {
+ strings: sub,
+ startDelay: 300,
+ typeSpeed: 150,
+ loop: !{theme.subtitle.loop},
+ backSpeed: 50
+ });
+ }else{
+ document.getElementById("subtitle").innerHTML = result.data.content
+ }
})
-
+
else
+ - var subtitle = theme.subtitle.sub[0]
script.
- var typed = new Typed(".subtitle", {
- strings: '!{theme.subtitle.sub}'.split(","),
- startDelay: 300,
- typeSpeed: 100,
- loop: true,
- backSpeed: 50
- });
-
-
-
+ let subtitleEffect = !{subtitleEffect}
+ if (subtitleEffect){
+ let typed = new Typed("#subtitle", {
+ strings: '!{theme.subtitle.sub}'.split(","),
+ startDelay: 300,
+ typeSpeed: 150,
+ loop: !{theme.subtitle.loop},
+ backSpeed: 50
+ })
+ }else{
+ document.getElementById("subtitle").innerHTML = '!{subtitle}'
+ }
diff --git a/layout/includes/layout.pug b/layout/includes/layout.pug
index 5c8cb3f..a56961d 100644
--- a/layout/includes/layout.pug
+++ b/layout/includes/layout.pug
@@ -1,85 +1,46 @@
-
-- var pageTitle = page.title || config.subtitle || ''
-- if (is_archive()) pageTitle = _p('page.archives')
-- if (is_tag()) pageTitle = _p('page.tag') + ': ' + page.tag
-- if (is_category()) pageTitle = _p('page.category') + ': ' + page.category
-- if (is_month()) pageTitle += ': ' + page.month + '/' + page.year
-- if (is_year()) pageTitle += ': ' + page.year
-- var pageTitle_saved //- 暫時存儲pageTitle
-- var pageTitle_no_include_blog_name //- 存儲pageTitle, 不帶 " | ",meta用
-- var home_subtitle_true //有subtitle
-//- home時顯示config.title (JerryC),其他顯示 pageTitle。meta用
-- is_home() ? pageTitle_no_include_blog_name = config.title : pageTitle_no_include_blog_name = pageTitle
-//- 暫時存儲pageTitle
-- pageTitle ? pageTitle_saved = pageTitle + ' | ' + config.title : pageTitle_saved = config.title
-//- 是否有 config.subtitle 是各自显示
-- config.subtitle ? home_subtitle_true = ' - ' + config.subtitle : home_subtitle_true = ''
-//- home時pageTitle顯示 JerryC - subtitle,其他顯示 pageTitle | JerryC
-- is_home() ? pageTitle = config.title + home_subtitle_true : pageTitle = pageTitle_saved
-//- 判断keywords
-
-- var pageDescription = page.description || page.title || config.description
-- var pageKeywords = Array.isArray(config.keywords) ? (config.keywords).join(','): ([]).join(',') || config.keywords
-- if (page.tags && page.tags.data) pageKeywords = page.tags.data.map(function(tag) {return tag.name;}).join(',')
-- var pageAuthor = config.email ? config.author + ',' + config.email : config.author
-- var pageCopyright = config.copyright || config.author
+- var hideAside = !theme.aside.enable || page.aside === false ? 'hide-aside' : ''
+- var autoOpenSidebar = theme.auto_open_sidebar.enable === true ? 'on' : ''
doctype html
html(lang=config.language data-theme=theme.display_mode)
head
- meta(charset='UTF-8')
- meta(http-equiv="X-UA-Compatible" content="IE=edge")
- meta(name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5")
- title= pageTitle
- meta(name="description" content=pageDescription)
- if pageKeywords
- meta(name="keywords" content=pageKeywords)
- meta(name="author" content=pageAuthor)
- meta(name="copyright" content=pageCopyright)
- meta(name ="format-detection" content="telephone=no")
- !=favicon_tag(config.favicon || theme.favicon || '/favicon.ico')
include ./head.pug
- include ./config.pug
body
if theme.fireworks && theme.fireworks.enable
canvas.fireworks
- //- !=partial('includes/header.pug', {}, {cache: true})
- include ./header.pug
- include ./mobile-sidebar.pug
+ !=partial('includes/mobile-sidebar/index', {}, {cache:theme.fragment_cache})
+ if (is_post() && page.toc != false && theme.toc.enable)
+ i.fa.fa-arrow-right#toggle-sidebar(aria-hidden="true" class=autoOpenSidebar)
+ include ./sidebar.pug
#body-wrap
if theme.background
- - var source = theme.background
- - var is_photo = source.substring(3,0) === 'url' ? 'photo':'color'
+ - var is_photo = theme.background.substring(3,0) === 'url' ? 'photo':'color'
#web_bg(data-type=is_photo)
- if (is_post() && page.toc != false && theme.toc.enable)
- i.fa.fa-arrow-right#toggle-sidebar(aria-hidden="true")
- include ./sidebar.pug
+ include ./header/index.pug
+
if (!is_post())
- include ./nav.pug
- main#content-outer
- block top_img
- if (!is_post())
- #content-inner.layout_page
- if body
- div!= body
- else
- block content
- else
- #content-inner.layout.layout_post
- if body
- div!= body
- else
- block content
+ main#content-inner.layout_page(class=hideAside)
+ if body
+ div!= body
+ else
+ block content
+ include widget/index.pug
+ else
+ main#content-inner.layout_post
+ if body
+ div!= body
+ else
+ block content
- var footer_bg = theme.footer_bg == false ? '' : bg_img
- var is_bg = theme.footer_bg == false ? 'color' : 'photo'
footer#footer(style=footer_bg data-type=is_bg)
- include ./footer.pug
+ !=partial('includes/footer', {}, {cache:theme.fragment_cache})
include ./rightside.pug
+ !=partial('includes/search/index', {}, {cache:theme.fragment_cache})
each item in theme.CDN_USE.js
script(src=url_for(item))
include ./additional-js.pug
- include ./search/index.pug
diff --git a/layout/includes/math/mermaid.pug b/layout/includes/math/mermaid.pug
new file mode 100644
index 0000000..7984358
--- /dev/null
+++ b/layout/includes/math/mermaid.pug
@@ -0,0 +1,8 @@
+script.
+ if (document.getElementsByClassName('mermaid').length) {
+ loadScript('!{theme.CDN.mermaid}',function () {
+ mermaid.initialize({
+ theme: '!{theme.mermaid.theme}',
+ })
+ })
+ }
\ No newline at end of file
diff --git a/layout/includes/mixins/UI.pug b/layout/includes/mixins/UI.pug
index 9b71751..6292c82 100644
--- a/layout/includes/mixins/UI.pug
+++ b/layout/includes/mixins/UI.pug
@@ -1,36 +1,48 @@
mixin UI_NEW(posts)
- posts.each(function(article,index){
- .recent-post-item.article-container
+ .recent-post-item
- var link = article.link || article.path
- if index%2 == 0
- .post_cover.left_radius
- a(href=url_for(link) title=article.title || _p('no_title'))
- - var post_cover = article.cover
- if theme.lazyload.enable
- img.post_bg.lazyload(data-src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
- else
- img.post_bg(src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
- else
- .post_cover.right_radius
- a(href=url_for(link) title=article.title || _p('no_title'))
- - var post_cover = article.cover
- if theme.lazyload.enable
- img.post_bg.lazyload(data-src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
- else
- img.post_bg(src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
- .recent-post-info
- a.article-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.post-meta__date #[i.fa.fa-calendar(aria-hidden="true")] #[=date(article[date_type], config.date_format)]
- if (theme.post_meta.categories && article.categories.data.length > 0)
- span.article-meta
- span.article-meta__separator |
- each item, index in article.categories.data
- i.fa.fa-inbox.article-meta__icon(aria-hidden="true")
- a(href=url_for(item.path)).article-meta__categories #[=item.name]
- if (index < article.categories.data.length - 1)
- i.fa.fa-angle-right(aria-hidden="true")
+ - var post_cover = article.cover
+ - var title = article.title || _p('no_title')
+ - var leftOrRight = index%2 == 0 ? 'left_radius' : 'right_radius'
+ - var no_cover = article.cover === false || !theme.cover.index_enable ? 'no-cover' : ''
+ if post_cover && theme.cover.index_enable
+ .post_cover(class=leftOrRight)
+ a(href=url_for(link) title=title)
+ if theme.lazyload.enable
+ img.post_bg.lazyload(data-src=`${post_cover}` alt=title onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'`)
+ else
+ img.post_bg(src=`${post_cover}` alt=title onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'`)
+ .recent-post-info(class=no_cover)
+ a.article-title(href=url_for(link) title=title)= title
+ .article-meta-wrap
+ if (theme.post_meta.page.date_type)
+ if (theme.post_meta.page.date_type === 'both')
+ time.post-meta__date
+ i.fa.fa-calendar.fa-fw(aria-hidden="true")
+ =date(page.date, config.date_format)
+ span.article-meta__separator |
+ i.fa.fa-history.fa-fw(aria-hidden="true")
+ =date(page.updated, config.date_format)
+ else
+ - var date_type = theme.post_meta.post.date_type === 'updated' ? 'updated' : 'date'
+ time.post-meta__date #[i.fa.fa-calendar.fa-fw(aria-hidden="true")]#[=date(page[date_type], config.date_format)]
+ if (theme.post_meta.page.categories && article.categories.data.length > 0)
+ span.article-meta
+ span.article-meta__separator |
+ each item, index in article.categories.data
+ i.fa.fa-inbox.article-meta__icon(aria-hidden="true")
+ a(href=url_for(item.path)).article-meta__categories #[=item.name]
+ if (index < article.categories.data.length - 1)
+ i.fa.fa-angle-right(aria-hidden="true")
+ if (theme.post_meta.page.tags && article.tags.data.length > 0)
+ span.article-meta.tags
+ span.article-meta__separator |
+ each item, index in article.tags.data
+ i.fa.fa-tag.article-meta__icon(aria-hidden="true")
+ a(href=url_for(item.path)).article-meta__tags #[=item.name]
+ if (index < article.tags.data.length - 1)
+ span.article-meta__link -
if theme.auto_excerpt && theme.auto_excerpt.enable
- const content = strip_html(article.content)
- let expert = content.substring(0, theme.auto_excerpt.length)
diff --git a/layout/includes/mixins/article-sort.pug b/layout/includes/mixins/article-sort.pug
index 9b534b3..41801d1 100644
--- a/layout/includes/mixins/article-sort.pug
+++ b/layout/includes/mixins/article-sort.pug
@@ -3,13 +3,15 @@ mixin articleSort(posts)
- var year
- posts.each(function (article) {
- var tempYear = date(article.date, 'YYYY')
+ - var no_cover = article.cover === false || !theme.cover.archives_enable ? 'no-article-cover' : ''
if tempYear !== year
- year = tempYear
.article-sort-item.year= year
- .article-sort-item
- .article-sort-img
- a.article-sort-item__img(href=url_for(article.path))
- img(src=article.cover alt=article.title || 'No Title')
+ .article-sort-item(class=no_cover)
+ if article.cover && theme.cover.archives_enable
+ .article-sort-img
+ a.article-sort-item__img(href=url_for(article.path))
+ img(src=article.cover alt=article.title || 'No Title' onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'`)
.article-sort-post
a.article-sort-item__post(href=url_for(article.path))
i.fa.fa-clock-o(aria-hidden="true")
diff --git a/layout/includes/mobile-sidebar.pug b/layout/includes/mobile-sidebar.pug
deleted file mode 100644
index 5900134..0000000
--- a/layout/includes/mobile-sidebar.pug
+++ /dev/null
@@ -1,46 +0,0 @@
-#mobile-sidebar
- #menu_mask
- #mobile-sidebar-menus
- .mobile_author_icon
- img.avatar-img(src=url_for(theme.avatar) onerror=`onerror=null;src='${theme.lodding_bg.flink}'` alt="avatar")
- .mobile_post_data
- if site.posts.length
- .mobile_data_item.is-center
- .mobile_data_link
- a(href=url_for(config.archive_dir) + '/')
- .headline= _p('aside.articles')
- .length_num= site.posts.length
-
- if site.tags.length
- .mobile_data_item.is-center
- .mobile_data_link
- a(href=url_for(config.tag_dir) + '/' )
- .headline= _p('aside.tags')
- .length_num= site.tags.length
-
- if site.categories.length
- .mobile_data_item.is-center
- .mobile_data_link
- a(href=url_for(config.category_dir) + '/')
- .headline= _p('aside.categories')
- .length_num= site.categories.length
- hr
- .menus_items
- include menu_item.pug
-
-
-
- - const showToc = is_post() && page.toc != false && theme.toc.enable
- -
- let tocNumber
- if (page.toc_number !== undefined) tocNumber = page.toc_number
- else if (theme.toc.number !== undefined) tocNumber = theme.toc.number
- else tocNumber = true
- -
- if (showToc)
- #mobile-sidebar-toc
- .toc_mobile_headline= _p('sidebar.catalog')
- if (page.encrypt == true)
- .sidebar-toc__content.toc-div-class(style="display:none")!=toc(page.origin,{"class":"toc_mobile_items",list_number:tocNumber})
- else
- .sidebar-toc__content!=toc(page.content,{"class":"toc_mobile_items",list_number:tocNumber})
diff --git a/layout/includes/mobile-sidebar/index.pug b/layout/includes/mobile-sidebar/index.pug
new file mode 100644
index 0000000..511a77c
--- /dev/null
+++ b/layout/includes/mobile-sidebar/index.pug
@@ -0,0 +1,3 @@
+#mobile-sidebar
+ #menu_mask
+ include ../mobile-sidebar/mobile-menus.pug
\ No newline at end of file
diff --git a/layout/includes/mobile-sidebar/mobile-menus.pug b/layout/includes/mobile-sidebar/mobile-menus.pug
new file mode 100644
index 0000000..55580ec
--- /dev/null
+++ b/layout/includes/mobile-sidebar/mobile-menus.pug
@@ -0,0 +1,27 @@
+#mobile-sidebar-menus
+ .mobile_author_icon
+ img.avatar-img(src=url_for(theme.avatar.img) onerror=`onerror=null;src='${theme.lodding_bg.flink}'` alt="avatar")
+ .mobile_post_data
+ if site.posts.length
+ .mobile_data_item.is-center
+ .mobile_data_link
+ a(href=url_for(config.archive_dir) + '/')
+ .headline= _p('aside.articles')
+ .length_num= site.posts.length
+
+ if site.tags.length
+ .mobile_data_item.is-center
+ .mobile_data_link
+ a(href=url_for(config.tag_dir) + '/' )
+ .headline= _p('aside.tags')
+ .length_num= site.tags.length
+
+ if site.categories.length
+ .mobile_data_item.is-center
+ .mobile_data_link
+ a(href=url_for(config.category_dir) + '/')
+ .headline= _p('aside.categories')
+ .length_num= site.categories.length
+ hr
+ .menus_items
+ include ../header/menu_item.pug
diff --git a/layout/includes/nav.pug b/layout/includes/nav.pug
deleted file mode 100644
index c720584..0000000
--- a/layout/includes/nav.pug
+++ /dev/null
@@ -1,29 +0,0 @@
-
-- var bg_img = top_img && top_img !== true ? `background-image: url(${top_img})` : ''
-
-
-if is_home()
- nav#nav.full_page(style=bg_img)
- #site-info
- #site-title
- span.blogtitle= page.title || page.tag || page.category || config.title
- #site-sub-title
- span.subtitle
-
- if(theme.social)
- #site-social-icons
- each url, icon in theme.social
- a.social-icon(href=url target="_blank")
- i(class=icon aria-hidden="true")
-
- .scroll-down
- i.fa.fa-angle-down.scroll-down-effects
-
-else
- nav#nav.not_index_bg(style=bg_img)
- #page_site-info
- #site-title
- if (is_archive())
- span.blogtitle= _p('archives')
- else
- span.blogtitle= page.title || page.tag || page.category || config.title
\ No newline at end of file
diff --git a/layout/includes/page_tag.pug b/layout/includes/page_tag.pug
deleted file mode 100644
index e779798..0000000
--- a/layout/includes/page_tag.pug
+++ /dev/null
@@ -1,6 +0,0 @@
-- site.tags.sort('path').each(function (tags){
- - var fontSize = Math.floor(Math.random() * 15 + 15) + "px"; //15 ~ 30
- - var color = "rgb(" + Math.floor(Math.random() * 201) + ", " + Math.floor(Math.random() * 201) +", " + Math.floor(Math.random() * 201) +")"; // 0,0,0 -> 200,200,200
-
- a(href=url_for(tags.path) style='font-size:' + fontSize + ';color:' + color)=tags.name
--})
\ No newline at end of file
diff --git a/layout/includes/pagination.pug b/layout/includes/pagination.pug
index faaf001..33bf9ae 100644
--- a/layout/includes/pagination.pug
+++ b/layout/includes/pagination.pug
@@ -13,51 +13,27 @@ if(!is_post())
else
nav#pagination.pagination_post
if(page.prev)
- if(page.next)
- .prev-post.pull_left
- - var pagination_cover = page.prev.cover
- a(href=url_for(page.prev.path))
- if theme.lazyload.enable
- img.prev_cover.lazyload(data-src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` )
- else
- img.prev_cover(src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` )
-
+ - var hasPageNext = page.prev ? 'pull_left' : 'pull-full'
+ .prev-post(class=hasPageNext)
+ - var pagination_cover = page.prev.cover === false ? page.prev.randomcover : page.prev.cover
+ a(href=url_for(page.prev.path))
+ if theme.lazyload.enable
+ img.prev_cover.lazyload(data-src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` )
+ else
+ img.prev_cover(src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` )
+ .pagination-info
.label=_p('pagination.prev')
- .prev_info
- span=page.prev.title
- else
- .prev-post.pull-full
- - var pagination_cover = page.prev.cover
- a(href=url_for(page.prev.path))
- if theme.lazyload.enable
- img.prev_cover.lazyload(data-src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
- else
- img.prev_cover(src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
- .label=_p('pagination.prev')
- .prev_info
- span=page.prev.title
+ .prev_info=page.prev.title
if(page.next)
- if(page.prev)
- .next-post.pull_right
- - var pagination_cover = page.next.cover
- a(href=url_for(page.next.path))
- if theme.lazyload.enable
- img.next_cover.lazyload(data-src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
- else
- img.next_cover(src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
+ - var hasPagePrev = page.prev ? 'pull_right' : 'pull-full'
+ - var pagination_cover = page.next.cover == false ? page.next.randomcover : page.next.cover
+ .next-post(class=hasPagePrev)
+ a(href=url_for(page.next.path))
+ if theme.lazyload.enable
+ img.next_cover.lazyload(data-src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
+ else
+ img.next_cover(src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
+ .pagination-info
.label=_p('pagination.next')
- .next_info
- span=page.next.title
- else
- .next-post.pull-full
- - var pagination_cover = page.next.cover
- a(href=url_for(page.next.path))
- if theme.lazyload.enable
- img.next_cover.lazyload(data-src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
- else
- img.next_cover(src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
- .label=_p('pagination.next')
- .next_info
- span=page.next.title
-
+ .next_info=page.next.title
\ No newline at end of file
diff --git a/layout/includes/post/post-copyright.pug b/layout/includes/post/post-copyright.pug
new file mode 100644
index 0000000..ee8c659
--- /dev/null
+++ b/layout/includes/post/post-copyright.pug
@@ -0,0 +1,13 @@
+if (theme.post_copyright && theme.post_copyright.enable && page.copyright != false)
+ .post-copyright
+ .post-copyright__author
+ span.post-copyright-meta= _p('post.copyright.author') + ": "
+ span.post-copyright-info
+ a(href=`mailto:${config.email}`) #[=config.author]
+ .post-copyright__type
+ span.post-copyright-meta= _p('post.copyright.link') + ": "
+ span.post-copyright-info
+ a(href=url_for(page.permalink))= theme.post_copyright.decode ? decodeURI(page.permalink) : page.permalink
+ .post-copyright__notice
+ span.post-copyright-meta= _p('post.copyright.copyright_notice') + ": "
+ span.post-copyright-info!= _p('post.copyright.copyright_content', theme.post_copyright.license_url, theme.post_copyright.license, config.url, config.title)
diff --git a/layout/includes/reward.pug b/layout/includes/post/reward.pug
similarity index 100%
rename from layout/includes/reward.pug
rename to layout/includes/post/reward.pug
diff --git a/layout/includes/recent-posts.pug b/layout/includes/recent-posts.pug
index a5534a3..091bbd1 100644
--- a/layout/includes/recent-posts.pug
+++ b/layout/includes/recent-posts.pug
@@ -1,41 +1,52 @@
each article , index in page.posts.data
- .recent-post-item.article-container
+ .recent-post-item
- var link = article.link || article.path
- var title = article.title || _p('no_title')
- if index%2 == 0
- .post_cover.left_radius
- a(href=url_for(link) title=title)
- - var post_cover = article.cover
- if theme.lazyload.enable
- img.post_bg.lazyload(data-src=`${post_cover}` onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'` alt=title)
- else
- img.post_bg(src=`${post_cover}` onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'` alt=title)
- else
- .post_cover.right_radius
- a(href=url_for(link) title=title)
- - var post_cover = article.cover
- if theme.lazyload.enable
- img.post_bg.lazyload(data-src=`${post_cover}` onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'` alt=title)
- else
- img.post_bg(src=`${post_cover}` onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'` alt=title)
- .recent-post-info
+ - var leftOrRight = index%2 == 0 ? 'left_radius' : 'right_radius'
+ - var post_cover = article.cover
+ - var no_cover = article.cover === false || !theme.cover.index_enable ? 'no-cover' : ''
+ if post_cover && theme.cover.index_enable
+ .post_cover(class=leftOrRight)
+ a(href=url_for(link) title=title)
+ if theme.lazyload.enable
+ img.post_bg.lazyload(data-src=`${post_cover}` onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'` alt=title)
+ else
+ img.post_bg(src=`${post_cover}` onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'` alt=title)
+ .recent-post-info(class=no_cover)
a.article-title(href=url_for(link) title=title)= title
- if (article.top)
- span.article-meta
- i.fa.fa-thumb-tack.article-meta__icon.sticky
- span.sticky= _p('sticky')
- span.article-meta__separator(style="margin-right: 0.3rem") |
- if (theme.post_meta.date_type)
- - var date_type = theme.post_meta.date_type == 'updated' ? 'updated' : 'date'
- time.post-meta__date #[i.fa.fa-calendar(aria-hidden="true")] #[=date(article[date_type], config.date_format)]
- if (theme.post_meta.categories && article.categories.data.length > 0)
- span.article-meta
- span.article-meta__separator |
- each item, index in article.categories.data
- i.fa.fa-inbox.article-meta__icon(aria-hidden="true")
- a(href=url_for(item.path)).article-meta__categories #[=item.name]
- if (index < article.categories.data.length - 1)
- i.fa.fa-angle-right(aria-hidden="true")
+ .article-meta-wrap
+ if (article.top)
+ span.article-meta
+ i.fa.fa-thumb-tack.article-meta__icon.sticky
+ span.sticky= _p('sticky')
+ span.article-meta__separator |
+ if (theme.post_meta.page.date_type)
+ if (theme.post_meta.page.date_type === 'both')
+ time.post-meta__date
+ i.fa.fa-calendar.fa-fw(aria-hidden="true")
+ =date(page.date, config.date_format)
+ span.article-meta__separator |
+ i.fa.fa-history.fa-fw(aria-hidden="true")
+ =date(page.updated, config.date_format)
+ else
+ - var date_type = theme.post_meta.post.date_type === 'updated' ? 'updated' : 'date'
+ time.post-meta__date #[i.fa.fa-calendar.fa-fw(aria-hidden="true")]#[=date(page[date_type], config.date_format)]
+ if (theme.post_meta.page.categories && article.categories.data.length > 0)
+ span.article-meta
+ span.article-meta__separator |
+ each item, index in article.categories.data
+ i.fa.fa-inbox.article-meta__icon(aria-hidden="true")
+ a(href=url_for(item.path)).article-meta__categories #[=item.name]
+ if (index < article.categories.data.length - 1)
+ i.fa.fa-angle-right(aria-hidden="true")
+ if (theme.post_meta.page.tags && article.tags.data.length > 0)
+ span.article-meta.tags
+ span.article-meta__separator |
+ each item, index in article.tags.data
+ i.fa.fa-tag.article-meta__icon(aria-hidden="true")
+ a(href=url_for(item.path)).article-meta__tags #[=item.name]
+ if (index < article.tags.data.length - 1)
+ span.article-meta__link -
if theme.auto_excerpt && theme.auto_excerpt.enable
- const content = strip_html(article.content)
- let expert = content.substring(0, theme.auto_excerpt.length)
diff --git a/layout/includes/rightside.pug b/layout/includes/rightside.pug
index d7d5fa5..0c64a3e 100644
--- a/layout/includes/rightside.pug
+++ b/layout/includes/rightside.pug
@@ -7,13 +7,15 @@ section#rightside.rightside
i#font_minus.fa.fa-minus(title=_p('rightside.font_minus_title'))
if theme.translate && theme.translate.enable
a#translateLink.translate_chn_to_cht(href="javascript:translatePage();" title=_p('rightside.translate_title') target="_self")= theme.translate.default
- if theme.darkmode && theme.darkmode.enable
- - var display_mode = theme.display_mode == 'dark' ? 'fa fa-sun-o' : 'fa fa-moon-o'
+ if theme.darkmode.enable && theme.darkmode.button
+ - var lightModeIcon = theme.fontawesome_v5 && theme.fontawesome_v5.enable ? 'far fa-sun' : 'fa fa-sun-o'
+ - var darkModeIcon = theme.fontawesome_v5 && theme.fontawesome_v5.enable ? 'far fa-moon' : 'fa fa-moon-o'
+ - var display_mode = theme.display_mode == 'dark' ? lightModeIcon : darkModeIcon
i#darkmode.darkmode(class=display_mode title=_p('rightside.night_mode_title'))
#rightside-config-show
#rightside_config(title=_p("rightside.setting"))
i.fa.fa-cog(aria-hidden="true")
- if is_post() && page.comments !== false && (d || l || gt || v)
+ if is_post() && page.comments !== false && isComment
a#to_comment(href="#post-comment" title=_p("rightside.scroll_to_comment"))
i.scroll_to_comment.fa.fa-comments
if is_post() && page.toc != false && theme.toc.enable
diff --git a/layout/includes/search/local-search.pug b/layout/includes/search/local-search.pug
index 464e8c3..1262d55 100644
--- a/layout/includes/search/local-search.pug
+++ b/layout/includes/search/local-search.pug
@@ -3,7 +3,7 @@
#local-input-panel
#local-search-input
.local-search-box
- input(placeholder=_p("local_search.input_placeholder")).local-search-box--input
+ input(placeholder=_p("local_search.input_placeholder") type="text").local-search-box--input
hr
#local-search-results
#local-hits
diff --git a/layout/includes/share/share-js.pug b/layout/includes/share/share-js.pug
index 9f78e7b..ec12a88 100644
--- a/layout/includes/share/share-js.pug
+++ b/layout/includes/share/share-js.pug
@@ -1,4 +1,4 @@
if (theme.sharejs && theme.sharejs.enable)
- .social-share(data-image= page.cover|| theme.avatar data-sites= theme.sharejs.sites)
+ .social-share(data-image= page.cover|| theme.avatar.img data-sites= theme.sharejs.sites)
link(rel="stylesheet" href=url_for(theme.CDN.sharejs_css))
script(src=url_for(theme.CDN.sharejs))
\ No newline at end of file
diff --git a/layout/includes/sidebar.pug b/layout/includes/sidebar.pug
index 58b61a9..ac6d5be 100644
--- a/layout/includes/sidebar.pug
+++ b/layout/includes/sidebar.pug
@@ -1,7 +1,4 @@
-
-- var sidebar_class = theme.auto_open_sidebar.enable === true ? 'auto_open' : ''
-
-#sidebar(class=sidebar_class)
+#sidebar
- const showToc = is_post() && page.toc != false && theme.toc.enable
-
let tocNumber
diff --git a/layout/includes/third-party/canvas-ribbon.pug b/layout/includes/third-party/canvas-ribbon.pug
index b6e1806..9fc03fc 100644
--- a/layout/includes/third-party/canvas-ribbon.pug
+++ b/layout/includes/third-party/canvas-ribbon.pug
@@ -1,3 +1,3 @@
-script(id="ribbon" src=url_for(theme.CDN.canvas_ribbon) size=theme.canvas_ribbon.size
+script(defer id="ribbon" src=url_for(theme.CDN.canvas_ribbon) size=theme.canvas_ribbon.size
alpha=theme.canvas_ribbon.alpha zIndex=theme.canvas_ribbon.zIndex mobile=`${theme.canvas_ribbon.mobile}` data-click=`${theme.canvas_ribbon.click_to_change}`)
diff --git a/layout/includes/third-party/pangu.pug b/layout/includes/third-party/pangu.pug
new file mode 100644
index 0000000..a3ff318
--- /dev/null
+++ b/layout/includes/third-party/pangu.pug
@@ -0,0 +1,13 @@
+script(src=url_for(theme.CDN.pangu))
+if theme.pangu.field === 'post'
+ if is_post()
+ script.
+ document.addEventListener('DOMContentLoaded', function() {
+ pangu.spacingElementById('content-inner')
+ })
+else if theme.pangu.field === 'page'
+ script.
+ document.addEventListener('DOMContentLoaded', function() {
+ pangu.spacingElementById('content-inner')
+ })
+
diff --git a/layout/includes/widget/card_announcement.pug b/layout/includes/widget/card_announcement.pug
index edcecd5..4194cf4 100644
--- a/layout/includes/widget/card_announcement.pug
+++ b/layout/includes/widget/card_announcement.pug
@@ -3,4 +3,4 @@
.item-headline
i.fa.fa-bullhorn.card-announcement-animation(aria-hidden="true")
span= _p('aside.card_announcement')
- .announcement_content= theme.announcement.content
\ No newline at end of file
+ .announcement_content!= theme.announcement.content
\ No newline at end of file
diff --git a/layout/includes/widget/card_author.pug b/layout/includes/widget/card_author.pug
index f009bc8..426697d 100644
--- a/layout/includes/widget/card_author.pug
+++ b/layout/includes/widget/card_author.pug
@@ -1,26 +1,26 @@
.card-widget.card-info
.card-content
.card-info-avatar.is-center
- img.avatar-img(src=url_for(theme.avatar) onerror=`this.onerror=null;this.src='` + url_for(theme.lodding_bg.flink) + `'` alt="avatar")
+ img.avatar-img(src=url_for(theme.avatar.img) onerror=`this.onerror=null;this.src='` + url_for(theme.lodding_bg.flink) + `'` alt="avatar")
.author-info__name= config.author
.author-info__description= config.description
.card-info-data
if site.posts.length
.card-info-data-item.is-center
- a(href=url_for(config.archive_dir) + '/')
+ a(href=url_for(config.archive_dir))
.headline= _p('aside.articles')
.length_num= site.posts.length
if site.tags.length
.card-info-data-item.is-center
- a(href=url_for(config.tag_dir) + '/' )
+ a(href=url_for(config.tag_dir))
.headline= _p('aside.tags')
.length_num= site.tags.length
if site.categories.length
.card-info-data-item.is-center
- a(href=url_for(config.category_dir) + '/')
+ a(href=url_for(config.category_dir))
.headline= _p('aside.categories')
.length_num= site.categories.length
diff --git a/layout/includes/widget/card_recent_post.pug b/layout/includes/widget/card_recent_post.pug
index 036837b..d82fa17 100644
--- a/layout/includes/widget/card_recent_post.pug
+++ b/layout/includes/widget/card_recent_post.pug
@@ -8,17 +8,20 @@
.aside-recent-post
- var link = article.link || article.path
- var title = article.title || _p('no_title')
+ - var no_cover = article.cover === false || !theme.cover.aside_enable ? 'no-aside-cover' : ''
+ - var post_cover = article.cover
+
a(href=url_for(link))
- - var post_cover = article.cover
- .aside-post-cover
- if theme.lazyload.enable
- img.aside-post-bg.lazyload(data-src=`${post_cover}` onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'` title=title alt=title)
- else
- img.aside-post-bg(src=`${post_cover}` onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'` title=title alt=title)
- .aside-post-title
+ if post_cover && theme.cover.aside_enable
+ .aside-post-cover
+ if theme.lazyload.enable
+ img.aside-post-bg.lazyload(data-src=`${post_cover}` onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'` title=title alt=title)
+ else
+ img.aside-post-bg(src=`${post_cover}` onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'` title=title alt=title)
+ .aside-post-title(class=no_cover)
.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'
+ if (theme.post_meta.page.date_type)
+ - var date_type = theme.post_meta.page.date_type == 'updated' ? 'updated' : 'date'
time.aside-post_meta.post-meta__date #[=date(article[date_type], config.date_format)]
- })
diff --git a/layout/includes/widget/card_webinfo.pug b/layout/includes/widget/card_webinfo.pug
index a72f5da..17903af 100644
--- a/layout/includes/widget/card_webinfo.pug
+++ b/layout/includes/widget/card_webinfo.pug
@@ -1,7 +1,8 @@
+- var webinfoIcon = theme.fontawesome_v5 && theme.fontawesome_v5.enable ? 'fas fa-chart-line' : 'fa fa-line-chart'
.card-widget.card-webinfo
.card-content
.item-headline
- i.fa.fa-line-chart(aria-hidden="true")
+ i(class=webinfoIcon aria-hidden="true")
span= _p('aside.card_webinfo.headline')
.webinfo
.webinfo-item
diff --git a/layout/includes/widget/index.pug b/layout/includes/widget/index.pug
index ecceb98..1bd1b48 100644
--- a/layout/includes/widget/index.pug
+++ b/layout/includes/widget/index.pug
@@ -1,21 +1,17 @@
-if theme.aside.card_author
- include ./card_author.pug
-
-if theme.aside.card_announcement
- include ./card_announcement.pug
-
-if theme.aside.card_recent_post
- include ./card_recent_post.pug
-
-if theme.aside.card_categories
- include ./card_categories.pug
-
-if theme.aside.card_tags
- include ./card_tags.pug
-
-if theme.aside.card_archives
- include ./card_archives.pug
-
-if theme.aside.card_webinfo
- include ./card_webinfo.pug
-
\ No newline at end of file
+if theme.aside.enable
+ if page.aside !== false
+ #aside_content.aside_content
+ if theme.aside.card_author
+ !=partial('includes/widget/card_author', {}, {cache:theme.fragment_cache})
+ if theme.aside.card_announcement
+ !=partial('includes/widget/card_announcement', {}, {cache:theme.fragment_cache})
+ if theme.aside.card_recent_post
+ !=partial('includes/widget/card_recent_post', {}, {cache:theme.fragment_cache})
+ if theme.aside.card_categories
+ !=partial('includes/widget/card_categories', {}, {cache:theme.fragment_cache})
+ if theme.aside.card_tags
+ !=partial('includes/widget/card_tags', {}, {cache:theme.fragment_cache})
+ if theme.aside.card_archives
+ !=partial('includes/widget/card_archives', {}, {cache:theme.fragment_cache})
+ if theme.aside.card_webinfo
+ !=partial('includes/widget/card_webinfo', {}, {cache:theme.fragment_cache})
\ No newline at end of file
diff --git a/layout/index.pug b/layout/index.pug
index 094c7d4..36f6860 100644
--- a/layout/index.pug
+++ b/layout/index.pug
@@ -3,6 +3,4 @@ extends includes/layout.pug
block content
#recent-posts.recent-posts
include includes/recent-posts.pug
- include includes/pagination.pug
- #aside_content.aside_content
- include includes/widget/index.pug
\ No newline at end of file
+ include includes/pagination.pug
\ No newline at end of file
diff --git a/layout/page-tags.pug b/layout/page-tags.pug
new file mode 100644
index 0000000..47c569b
--- /dev/null
+++ b/layout/page-tags.pug
@@ -0,0 +1,14 @@
+.tag-cloud
+ .tag-cloud__title= _p('page.tag')
+ | -
+ span.tag-cloud__amount= site.tags.length
+ .tag-cloud-tags
+ - site.tags.sort('path').each(function (tags){
+ - var fontSize = Math.floor(Math.random() * 15 + 15) + "px"; //15 ~ 30
+ - var color = "rgb(" + Math.floor(Math.random() * 201) + ", " + Math.floor(Math.random() * 201) +", " + Math.floor(Math.random() * 201) +")"; // 0,0,0 -> 200,200,200
+ a(href=url_for(tags.path) style='font-size:' + fontSize + ';color:' + color)=tags.name
+ -})
+ if page.comments !== false
+ include includes/comments/index.pug
+
+
diff --git a/layout/page.pug b/layout/page.pug
index a59ecf1..19411b1 100644
--- a/layout/page.pug
+++ b/layout/page.pug
@@ -2,25 +2,11 @@ extends includes/layout.pug
block content
if page.type === 'tags'
- .tag-cloud
- .tag-cloud__title= _p('page.tag')
- | -
- span.tag-cloud__amount= site.tags.length
- .tag-cloud-tags
- include includes/page_tag.pug
- if page.comments !== false
- include includes/comments/index.pug
- #aside_content.aside_content
- include includes/widget/index.pug
-
+ include page-tags.pug
else if page.type === 'link'
include flink.pug
- if page.comments !== false
- include includes/comments/index.pug
- #aside_content.aside_content
- include includes/widget/index.pug
else if page.type === 'categories'
- #post-content.category-content
+ .category-content
.category-lists
.category__title= _p('page.category')
| -
@@ -28,14 +14,8 @@ block content
div!= list_categories()
if page.comments !== false
include includes/comments/index.pug
- #aside_content.aside_content
- include includes/widget/index.pug
else
- article#page
- h1= page.title
- .article-container!= page.content
- include includes/pagination.pug
+ #page
+ #article-container!= page.content
if page.comments !== false
- include includes/comments/index.pug
- #aside_content.aside_content
- include includes/widget/index.pug
+ include includes/comments/index.pug
\ No newline at end of file
diff --git a/layout/post.pug b/layout/post.pug
index d82aa36..b76c765 100644
--- a/layout/post.pug
+++ b/layout/post.pug
@@ -1,102 +1,21 @@
extends includes/layout.pug
-block top_img
- - var top_img = page.top_img || page.cover || theme.post_meta.top_img || theme.default_top_img
- - var bg_img = top_img !== true ? `background-image: url(${top_img})` : ''
- div#top-container(style=bg_img)
- #post-info
- #post-title
- .posttitle= page.title || _p('no_title')
- #post-meta
- if (theme.post_meta.date_type)
- if (theme.post_meta.date_type === 'both')
- time.post-meta__date
- i.fa.fa-calendar.fa-fw(aria-hidden="true")
- =' '+_p('post.created')+' '+date(page.date, config.date_format)
- span.post-meta__separator |
- i.fa.fa-history.fa-fw(aria-hidden="true")
- =' '+_p('post.updated')+' '+date(page.updated, config.date_format)
- else
- - var date_type = theme.post_meta.date_type === 'updated' ? 'updated' : 'date'
- time.post-meta__date #[i.fa.fa-calendar.fa-fw(aria-hidden="true")] #[=date(page[date_type], config.date_format)]
-
- if (theme.post_meta.categories && page.categories.data.length > 0)
- if (theme.post_meta.date_type)
- span.post-meta__separator |
- span
- each item, index in page.categories.data
- i.fa.fa-inbox.post-meta__icon.fa-fw(aria-hidden="true")
- a(href=url_for(item.path)).post-meta__categories #[=item.name]
- if (index < page.categories.data.length - 1)
- i.fa.fa-angle-right.fa-fw(aria-hidden="true")
- .post-meta-wordcount
- if (theme.wordcount && theme.wordcount.enable)
- i.fa.fa-file-word-o.post-meta__icon.fa-fw(aria-hidden="true")
- span= _p('post.wordcount') + ':'
- span.word-count= wordcount(page.content)
- span.post-meta__separator |
- i.fa.fa-clock-o.post-meta__icon.fa-fw(aria-hidden="true")
- span= _p('post.min2read', min2read(page.content, {cn: 350, en: 160}))
- .post-meta-pv-cv
- if (theme.wordcount && theme.wordcount.enable && theme.busuanzi.page_pv)
- span.post-meta__separator |
- if theme.busuanzi.page_pv
- span
- i.fa.fa-eye.post-meta__icon.fa-fw(aria-hidden="true")
- =_p('post.page_pv') + ':'
- span#busuanzi_value_page_pv
- if (theme.disqus && theme.disqus.enable && theme.disqus.count && page.comments !== false)
- if (theme.busuanzi && theme.busuanzi.page_pv)
- span.post-meta__separator |
- i.fa.fa-comment-o.post-meta__icon.fa-fw(aria-hidden="true")
- span= _p('post.comments') + ':'
- a(href=url_for(page.path) + '#post-comment')
- span.disqus-comment-count(data-disqus-url=page.permalink)
- if (theme.valine && theme.valine.enable && theme.valine.count && page.comments !== false)
- if (theme.busuanzi && theme.busuanzi.page_pv)
- span.post-meta__separator |
- i.fa.fa-comments-o.post-meta__icon.fa-fw(aria-hidden="true")
- span= _p('post.comments') + ':'
- a(href=url_for(page.path) + '#post-comment' itemprop="discussionUrl")
- span.valine-comment-count.comment-count(data-xid=url_for(page.path) itemprop="commentCount")
- if (theme.gitalk && theme.gitalk.enable && theme.gitalk.count && page.comments !== false)
- if (theme.busuanzi && theme.busuanzi.page_pv)
- span.post-meta__separator |
- i.fa.fa-comments-o.post-meta__icon.fa-fw(aria-hidden="true")
- span= _p('post.comments') + ':'
- a(href=url_for(page.path) + '#post-comment')
- span.gitalk-comment-count.comment-count
-
-
block content
article#post(class="")
- #post-content.article-container!= page.content
- if (theme.post_copyright && theme.post_copyright.enable && page.copyright != false)
- .post-copyright
- .post-copyright__author
- span.post-copyright-meta= _p('post.copyright.author') + ": "
- span.post-copyright-info
- a(href=`mailto:${config.email}`) #[=config.author]
- .post-copyright__type
- span.post-copyright-meta= _p('post.copyright.link') + ": "
- span.post-copyright-info
- a(href=url_for(page.permalink)) #[=page.permalink]
- .post-copyright__notice
- span.post-copyright-meta= _p('post.copyright.copyright_notice') + ": "
- span.post-copyright-info!= _p('post.copyright.copyright_content', theme.post_copyright.license_url, theme.post_copyright.license, config.url, config.title)
-
- .tag_share
- if (theme.post_meta.tags)
- .post-meta__tag-list
- each item, index in page.tags.data
- a(href=url_for(item.path)).post-meta__tags #[=item.name]
- include includes/share/index.pug
+ #article-container!=page.content
+ include includes/post/post-copyright.pug
+ .tag_share
+ if (theme.post_meta.post.tags)
+ .post-meta__tag-list
+ each item, index in page.tags.data
+ a(href=url_for(item.path)).post-meta__tags #[=item.name]
+ !=partial('includes/share/index', {}, {cache:theme.fragment_cache})
- if theme.reward.enable
- include includes/reward.pug
- include includes/pagination.pug
-
- if theme.related_post && theme.related_post.enable
- != related_posts(page,site.posts)
- if page.comments !== false
- include includes/comments/index.pug
\ No newline at end of file
+ if theme.reward.enable
+ !=partial('includes/post/reward', {}, {cache:theme.fragment_cache})
+ include includes/pagination.pug
+
+ if theme.related_post && theme.related_post.enable
+ != related_posts(page,site.posts)
+ if page.comments !== false
+ include includes/comments/index.pug
\ No newline at end of file
diff --git a/layout/tag.pug b/layout/tag.pug
index b90868f..ec2e31b 100644
--- a/layout/tag.pug
+++ b/layout/tag.pug
@@ -6,13 +6,9 @@ block content
#recent-posts.recent-posts
+UI_NEW(page.posts)
include includes/pagination.pug
- #aside_content.aside_content
- include includes/widget/index.pug
else
include ./includes/mixins/article-sort.pug
#tag
.article-sort-title= _p('page.tag') + ' - ' + page.tag
+articleSort(page.posts)
- include includes/pagination.pug
- #aside_content.aside_content
- include includes/widget/index.pug
+ include includes/pagination.pug
\ No newline at end of file
diff --git a/package.json b/package.json
index c0dd41d..e4c0363 100644
--- a/package.json
+++ b/package.json
@@ -1,5 +1,5 @@
{
"name": "hexo-theme-butterfly",
- "version": "2.1.0",
+ "version": "2.2.0",
"description": "A Hexo Theme: Butterfly"
}
\ No newline at end of file
diff --git a/scripts/events/404.js b/scripts/events/404.js
new file mode 100644
index 0000000..e091744
--- /dev/null
+++ b/scripts/events/404.js
@@ -0,0 +1,8 @@
+hexo.extend.generator.register('404', function(locals){
+ if (!hexo.theme.config.error_404.enable) return
+ return {
+ path: '404.html',
+ data: locals.posts,
+ layout: ['404']
+ }
+});
\ No newline at end of file
diff --git a/scripts/replace-config.js b/scripts/events/replace-config.js
similarity index 100%
rename from scripts/replace-config.js
rename to scripts/events/replace-config.js
diff --git a/scripts/hide_post.js b/scripts/filters/hide-post.js
similarity index 100%
rename from scripts/hide_post.js
rename to scripts/filters/hide-post.js
diff --git a/scripts/filters/post-lazyload.js b/scripts/filters/post-lazyload.js
new file mode 100644
index 0000000..e3c8177
--- /dev/null
+++ b/scripts/filters/post-lazyload.js
@@ -0,0 +1,30 @@
+'use strict';
+
+const fs = require('hexo-fs');
+const url_for = require('hexo-util').url_for.bind(hexo);
+
+function lazyProcess(htmlContent) {
+ var bg = url_for(hexo.theme.config.lodding_bg.post);
+ return htmlContent.replace(/
/gi, (str, p1, p2, p3) => {
+ if (/data-src/gi.test(str)) {
+ return str;
+ }
+ if (/class="(.*?)"/gi.test(str)){
+ str = str.replace(/class="(.*?)"/gi, (classStr, p1) => {
+ return classStr.replace(p1, `${p1} lazyload`);
+ })
+ str = str.replace(p2, `${bg}`)
+ return str.replace(p3, `${p3} data-src="${p2}"`);
+ }
+ str = str.replace(p2, `${bg}`)
+ return str.replace(p3, `${p3} class="lazyload" data-src="${p2}"`);
+ });
+}
+
+var processPost = function(data) {
+ if (!hexo.theme.config.lazyload.enable) return;
+ data.content = lazyProcess.call(this, data.content);
+ return data;
+};
+
+hexo.extend.filter.register('after_post_render', processPost);
\ No newline at end of file
diff --git a/scripts/filters/random-cover.js b/scripts/filters/random-cover.js
new file mode 100644
index 0000000..f660df1
--- /dev/null
+++ b/scripts/filters/random-cover.js
@@ -0,0 +1,23 @@
+hexo.extend.filter.register("before_post_render", function(data) {
+ if (data.cover == false) {
+ data.randomcover = random_cover();
+ return data;
+ }
+ data.cover = data.cover || random_cover();
+ return data;
+});
+
+var random_cover = function() {
+ var cover;
+ var num;
+ if (!Array.isArray(hexo.theme.config.cover.default_cover)) {
+ cover = hexo.theme.config.cover.default_cover;
+ return cover;
+ } else {
+ num = Math.floor(
+ Math.random() * hexo.theme.config.cover.default_cover.length
+ );
+ cover = hexo.theme.config.cover.default_cover[num];
+ return cover;
+ }
+};
diff --git a/scripts/gallery-tag.js b/scripts/gallery-tag.js
deleted file mode 100644
index 2aeb719..0000000
--- a/scripts/gallery-tag.js
+++ /dev/null
@@ -1,6 +0,0 @@
-function gallery(args, content) {
- return `
${hexo.render.renderSync({text: content, engine: 'markdown'})}
-
`;
-}
-
-hexo.extend.tag.register('gallery', gallery, {ends: true});
\ No newline at end of file
diff --git a/scripts/list_archives.js b/scripts/helpers/list-archives.js
similarity index 100%
rename from scripts/list_archives.js
rename to scripts/helpers/list-archives.js
diff --git a/scripts/related_post.js b/scripts/helpers/related-post.js
similarity index 82%
rename from scripts/related_post.js
rename to scripts/helpers/related-post.js
index 146e51d..455eff0 100644
--- a/scripts/related_post.js
+++ b/scripts/helpers/related-post.js
@@ -1,5 +1,3 @@
-const moment = require('moment');
-
hexo.extend.helper.register('related_posts', function (currentPost, allPosts) {
var relatedPosts = [];
currentPost.tags.forEach(function (tag) {
@@ -9,6 +7,7 @@ hexo.extend.helper.register('related_posts', function (currentPost, allPosts) {
title: post.title,
path: post.path,
cover: post.cover,
+ randomcover: post.randomcover,
weight: 1,
updated: post.updated,
created: post.date
@@ -32,17 +31,9 @@ hexo.extend.helper.register('related_posts', function (currentPost, allPosts) {
const config = hexo.theme.config;
var limit_num = config.related_post.limit || 6
- var lang = hexoConfig.language;
var date_type = config.related_post.date_type || 'created'
- var headline_lang;
- if (lang === 'zh-CN') {
- headline_lang = '相关推荐';
- } else if (lang === 'zh-TW') {
- headline_lang = '相關推薦';
- } else {
- headline_lang = 'Recommend';
- }
-
+ var headline_lang = this._p('post.recommend')
+
relatedPosts = relatedPosts.sort(compare('weight'));
var lazy_src = config.lazyload.enable ? lazy_src = 'data-src' : lazy_src = 'src'
var lazy_class = config.lazyload.enable ? lazy_class = 'lazyload' : lazy_class = ''
@@ -53,15 +44,13 @@ hexo.extend.helper.register('related_posts', function (currentPost, allPosts) {
result += ''
for (var i = 0; i < Math.min(relatedPosts.length, limit_num); i++) {
-
- var cover = relatedPosts[i].cover
-
+ var cover = relatedPosts[i].cover === false ? relatedPosts[i].randomcover : relatedPosts[i].cover
result += '
';
result += '
';
if (date_type == 'created') {
- result += '' + ' ' + date(relatedPosts[i].created) + '
'
+ result += '
' + ' ' + this.date(relatedPosts[i].created,hexoConfig.date_format) + '
'
} else {
- result += '
' + ' ' + date(relatedPosts[i].updated) + '
'
+ result += '
' + ' ' + this.date(relatedPosts[i].updated,hexoConfig.date_format) + '
'
}
result += '
' + relatedPosts[i].title + '
';
result += '
'
@@ -98,10 +87,4 @@ function compare(attr) {
var val2 = b[attr];
return val2 - val1;
}
-}
-
-function date(date) {
- var config = hexo.theme.config.rootConfig
- moment.locale(config.language)
- return moment(date).format(config.date_format)
-}
+}
\ No newline at end of file
diff --git a/scripts/highlight.js b/scripts/highlight.js
deleted file mode 100644
index c185bfb..0000000
--- a/scripts/highlight.js
+++ /dev/null
@@ -1,57 +0,0 @@
-'use strict';
-hexo.extend.filter.register('after_post_render', data => {
-
- const cheerio = require('cheerio');
-
- const $ = cheerio.load(data.content, {
- decodeEntities: false
- });
- var theme = hexo.theme.config;
-
- if (theme.highlight_shrink === 'none' && !theme.highlight_lang && !theme.highlight_copy) {
- return;
- }
-
- $('figure.highlight').wrap('
')
- var $highlight_layout = $('
')
-
- $('figure').before($highlight_layout)
-
- if (theme.highlight_shrink == true) {
- var $code_expand = $('
')
- $('.highlight-tools').append($code_expand)
- } else if (theme.highlight_shrink === false) {
- var $code_expand = $('
')
- $('.highlight-tools').append($code_expand)
- }
-
- if (theme.highlight_lang) {
- var $highlight_lang = $('
')
- $('.highlight-tools').append($highlight_lang)
- var lang_name_index;
- var lang_name;
- $('figure').each(function () {
- lang_name_index = lang_name = $(this).attr('class').split(' ')[1];
- if (lang_name_index == 'js')
- lang_name = 'Javascript'
- if (lang_name_index == 'md')
- lang_name = 'Markdown'
- if (lang_name_index == 'plain')
- lang_name = 'Code'
- if (lang_name_index == 'py')
- lang_name = 'Python'
-
- $(this).prev().find(".code_lang").text(lang_name)
-
- })
- }
-
- if (theme.highlight_copy) {
- var $copyIcon = $('
')
- var $notice = $('
')
- $('.highlight-tools').append($notice)
- $('.highlight-tools').append($copyIcon)
- }
-
- data.content = $.html();
-}, 100);
\ No newline at end of file
diff --git a/scripts/photo.js b/scripts/photo.js
deleted file mode 100644
index 94c0548..0000000
--- a/scripts/photo.js
+++ /dev/null
@@ -1,49 +0,0 @@
-'use strict'
-hexo.extend.filter.register('after_post_render', data => {
- const theme = hexo.theme.config;
-
- const cheerio = require('cheerio');
-
- const $ = cheerio.load(data.content, { decodeEntities: false });
-
- const images = $('img').not($('a>img'));
-
- if (theme.fancybox.enable) {
- images.each((i, o) => {
- var lazyload_src = $(o).attr('src') ? $(o).attr('src') : $(o).attr("data-src")
- var alt = $(o).attr('alt')
- if (alt !== undefined) {
- $(o).attr('title', alt)
- }
- var $a = $(
- '
'
- )
- $(o).wrap($a)
- });
-
- }
- if (theme.medium_zoom.enable) {
- var imgList = $(".justified-gallery img")
- if (imgList.length) {
- imgList.each((i, o) => {
- var $a = $('
')
- $(o).wrap($a)
- })
- }
- }
-
- if (!theme.medium_zoom.enable && !theme.fancybox.enable) {
- var imgList = $(".justified-gallery > p >img")
- if (imgList.length) {
- imgList.each((i, o) => {
- $(o).wrap('
')
- })
- }
- }
-
- data.content = $.html();
-}, 100);
\ No newline at end of file
diff --git a/scripts/post-lazyload.js b/scripts/post-lazyload.js
deleted file mode 100644
index 3ea43fc..0000000
--- a/scripts/post-lazyload.js
+++ /dev/null
@@ -1,25 +0,0 @@
-'use strict';
-const url_for = require('hexo-util').url_for.bind(hexo);
-
-hexo.extend.filter.register('after_post_render', data => {
- var theme = hexo.theme.config;
- var bg = theme.lodding_bg.post;
- if (!theme.lazyload.enable) return;
-
- const cheerio = require('cheerio');
-
- const $ = cheerio.load(data.content, {decodeEntities: false});
- const images = $('img').not($('.justified-gallery img'));
- if (!images.length) return;
-
- images.each((i, o) => {
- let src = $(o).attr('src');
- $(o).attr('data-src', src).removeAttr('src');
- if (bg){
- $(o).attr('src',url_for(bg))
- }
- $(o).addClass('lazyload');
- });
-
- data.content = $.html();
-}, 100);
\ No newline at end of file
diff --git a/scripts/random_cover.js b/scripts/random_cover.js
deleted file mode 100644
index daa7b3f..0000000
--- a/scripts/random_cover.js
+++ /dev/null
@@ -1,18 +0,0 @@
-hexo.extend.filter.register('before_post_render', function(data){
- data.cover = data.cover || random_cover()
- return data;
-});
-
-var random_cover = function () {
- var cover;
- var num;
- if (!Array.isArray(hexo.theme.config.default_cover)) {
- cover = hexo.theme.config.default_cover
- return cover
- } else {
- num = Math.floor(Math.random() * (hexo.theme.config.default_cover.length));
- cover = hexo.theme.config.default_cover[num];
- return cover
- }
-
-}
\ No newline at end of file
diff --git a/scripts/tags/gallery.js b/scripts/tags/gallery.js
new file mode 100644
index 0000000..b4bcd28
--- /dev/null
+++ b/scripts/tags/gallery.js
@@ -0,0 +1,27 @@
+const url_for = require('hexo-util').url_for.bind(hexo);
+
+function gallery(args, content) {
+ return `
${hexo.render.renderSync({text: content, engine: 'markdown'}).split('\n').join('')}
+
`;
+}
+
+function galleryGroup(args){
+ const name = args[0]
+ const desrc = args[1]
+ const url = url_for(args[2])
+ const img = url_for(args[3])
+
+ return `
+
+
+
+ ${name}
+ ${desrc}
+
+
+
+ `
+}
+
+hexo.extend.tag.register('gallery', gallery, {ends: true});
+hexo.extend.tag.register('galleryGroup', galleryGroup);
diff --git a/scripts/tags/hide.js b/scripts/tags/hide.js
new file mode 100644
index 0000000..fd8e19d
--- /dev/null
+++ b/scripts/tags/hide.js
@@ -0,0 +1,33 @@
+
+/**
+ * {% hideInline content,display,bg,color %}
+ * content不能包含當引號,可用 '
+ */
+function hideInline(args) {
+ args = args.join(' ').split(',')
+ let content = args[0].trim()
+ let display = args[1] || 'Click'
+ let bg = args[2] ==='' || typeof args[2] ==='undefined' ? '' : `background-color:${args[2]}`
+ let color = args[3] || '#fff'
+ return `
${display}
+ ${content}`
+}
+
+/**
+ * {% hideBlock display,bg,color %}
+ * content
+ * {% endhideBlock %}
+ */
+function hideBlock(args,content) {
+ args = args.join(' ').split(',')
+ let display = args[0] || 'Click'
+ let bg = args[1] ==='' || typeof args[2] ==='undefined' ? '' : `background-color:${args[2]}`
+ let color = args[2] || '#fff'
+
+ return `
${display}
+ ${hexo.render.renderSync({text: content, engine: 'markdown'}).split('\n').join('')} `
+
+}
+
+hexo.extend.tag.register('hideInline', hideInline);
+hexo.extend.tag.register('hideBlock', hideBlock, {ends: true});
\ No newline at end of file
diff --git a/scripts/tags/mermaid.js b/scripts/tags/mermaid.js
new file mode 100644
index 0000000..319310e
--- /dev/null
+++ b/scripts/tags/mermaid.js
@@ -0,0 +1,7 @@
+function mermaid(args, content) {
+ return `
+ ${content}
+
`;
+}
+
+hexo.extend.tag.register('mermaid', mermaid, {ends: true});
\ No newline at end of file
diff --git a/scripts/note.js b/scripts/tags/note.js
similarity index 100%
rename from scripts/note.js
rename to scripts/tags/note.js
diff --git a/scripts/url_check.js b/scripts/url_check.js
deleted file mode 100644
index 8206ffd..0000000
--- a/scripts/url_check.js
+++ /dev/null
@@ -1,8 +0,0 @@
-hexo.extend.helper.register('url_check', function (p) {
-
- let src = p ;
- let reg = /^https?/ig;
- return reg.test(src)
-
-
-})
\ No newline at end of file
diff --git a/source/css/_global/index.styl b/source/css/_global/index.styl
index f3327a7..7d48654 100644
--- a/source/css/_global/index.styl
+++ b/source/css/_global/index.styl
@@ -5,11 +5,12 @@ html
body
position: relative
min-height: 100%
- background: $white
+ background: $body-bg
color: $font-black
font-size: $font-size
font-family: $font-family
line-height: $text-line-height
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0)
if !hexo-config('copy.enable')
user-select: none
@@ -17,13 +18,6 @@ body
-webkit-user-select: none
-ms-user-select: none
-#body-wrap
- position: relative
- display: flex
- flex: 1 auto
- flex-direction: column
- transition: all .5s
-
*::-webkit-scrollbar
width: 8px
height: 8px
@@ -59,9 +53,6 @@ h6
code
font-size: inherit !important
-#content-outer
- flex: 1 auto
-
*
box-sizing: border-box
@@ -79,8 +70,7 @@ hr
position: relative
margin: 2rem auto
width: calc(100% - 4px)
- border: 2px dashed $pale-blue
- background: $white
+ border: 2px dashed lighten($theme-hr-color, 50%)
&:hover
&:before
@@ -91,54 +81,51 @@ hr
top: $hr-icon-top
left: 5%
z-index: 1
- color: $light-blue
+ color: $theme-hr-color
content: $hr-icon
- font: normal normal normal 14px / 1 FontAwesome
+ font-style: normal
+ font-variant: normal
font-size: 20px
+ line-height: 1
transition: all 1s ease-in-out
+ text-rendering: auto
+ -webkit-font-smoothing: antialiased
+
+ if hexo-config('fontawesome_v5') && hexo-config('fontawesome_v5.enable')
+ font-weight: 600
+ font-family: 'Font Awesome 5 Free'
+ else
+ font-weight: normal
+ font-family: FontAwesome
iframe
margin: 0 0 1rem
-// collapse/expand beautify
-details
- padding: .3rem
- border: 2px solid darken($light-grey, 10%)
-
- summary
- color: $theme-color
-
-// set
of to center-align
-// use class="not-code" to avoid conflicts because code also use tag
-.not-code
- margin: .5em
- padding: .5em
- border: thin silver solid
- text-align: center
-
table
+ display: block
overflow: auto
margin: 0 0 1rem
width: 100%
border-spacing: 0
border-collapse: collapse
+ empty-cells: show
thead
- background: alpha($a-link-color, 10%)
+ background: alpha($table-thead-bg, 10%)
th,
td
padding: .3rem .6rem
border: 1px solid darken($light-grey, 10%)
- vertical-align: top
+ vertical-align: middle
*::selection
- background: $selection
- color: $pale-grey
+ background: $theme-text-selection-color
+ color: #F7F7F7
-// 字體
-.full_page #site-title,
-.full_page #site-sub-title,
+// font
+#nav #site_title,
+#nav #site_subtitle,
#site-name,
#aside_content .author-info__name,
#aside_content .author-info__description
@@ -170,7 +157,7 @@ table
// button hover
.button--primary
- color: $ruby
+ color: $theme-button-hover-color
.button--animated
transition-duration: 1s
@@ -183,7 +170,7 @@ table
bottom: 0
left: 0
z-index: -1
- background: $ruby
+ background: $theme-button-hover-color
content: ''
transition-timing-function: ease-out
transition-duration: .5s
@@ -196,37 +183,10 @@ table
transition-timing-function: cubic-bezier(.45, 1.64, .47, .66)
transform: scaleX(1)
-// third-party
-.fireworks
- position: fixed
- z-index: -1
- z-index: 99999
- pointer-events: none
-
img[src=''],
img:not([src])
opacity: 0
-.justified-gallery
- margin: 1rem 0
-
- img
- opacity: 0
-
- .fancybox
- width: auto
- text-align: inherit
-
- .img-alt
- display: none
-
-.medium-zoom-image--opened
- z-index: 99999 !important
- margin: 0 !important
-
-.medium-zoom-overlay
- z-index: 99999 !important
-
// hexo tag video
.video-container
position: relative
@@ -243,16 +203,51 @@ img:not([src])
width: 100%
height: 100%
-.layout_page,
-.layout_post,
+// tag-hide
+.hide-inline,
+.hide-block
+ & > .hide-button
+ position: relative
+ z-index: 1
+ display: inline-block
+ padding: 0 1rem
+ background: $tag-hide-bg
+ text-align: center
+ cursor: pointer
+
+ &:hover
+ text-decoration: none !important
+
+ & > .hide-content
+ display: none
+
+.hide-inline
+ & > .hide-button
+ margin: 0 .3rem
+
+ & > .hide-content
+ margin: 0 .3rem
+
+.hide-block
+ margin: 0 0 .8rem
+
+.comment_headling
+ margin-bottom: 10px
+ font-weight: 700
+ font-size: 20px
+
+#content-inner,
#footer
animation: main 1s
-#nav,
-#top-container
- animation: header 1s
+#nav
+ animation: nav-effect 1s
-#site-title
+#page-header
+ animation: header-effect 1s
+
+#site_title,
+#site_subtitle
animation: titlescale 1s
canvas,
@@ -266,13 +261,33 @@ canvas,
.scroll-down-effects
animation: scroll-down-effect 1.5s infinite
-if hexo-config('avatar_effect') == true
+if hexo-config('avatar.effect') == true
.avatar-img
animation: avatar_turn_around 2s linear infinite
.reward-main
animation: donate_effcet .3s .1s ease both
+.tocOpenPc
+ .sidebar-toc__title
+ animation: tocsidebarLtoR .5s
+
+ .sidebar-toc__progress
+ animation: tocsidebarLtoR .7s
+
+ .sidebar-toc__content
+ animation: tocsidebarLtoR .9s
+
+.tocOpenMobile
+ .sidebar-toc__title
+ animation: tocsidebarRtoL .5s
+
+ .sidebar-toc__progress
+ animation: tocsidebarRtoL .5s
+
+ .sidebar-toc__content
+ animation: tocsidebarRtoL .7s
+
@keyframes scroll-down-effect
0%
top: 0
@@ -286,7 +301,7 @@ if hexo-config('avatar_effect') == true
top: 0
opacity: .4
-@keyframes header
+@keyframes nav-effect
0%
opacity: 0
transform: translateY(-50px)
@@ -295,6 +310,18 @@ if hexo-config('avatar_effect') == true
opacity: 1
transform: translateY(0)
+@keyframes header-effect
+ 0%
+ opacity: 0
+
+ 50%
+ opacity: 0
+ transform: translateY(-50px)
+
+ 100%
+ opacity: 1
+ transform: translateY(0)
+
@keyframes headerNoOpacity
0%
transform: translateY(-50px)
@@ -369,10 +396,23 @@ if hexo-config('avatar_effect') == true
50%
transform: scale(1.2)
-@media screen and (max-width: $bg)
- i#toggle-sidebar,
- #sidebar
- display: none
+@keyframes sidebarItem
+ 0%
+ transform: translateX(200px)
- body
- padding-left: 0 !important
+ 100%
+ transform: translateX(0)
+
+@keyframes tocsidebarRtoL
+ 0%
+ transform: translateX(200px)
+
+ 100%
+ transform: translateX(0)
+
+@keyframes tocsidebarLtoR
+ 0%
+ transform: translateX(-200px)
+
+ 100%
+ transform: translateX(0)
diff --git a/source/css/_highlight/highlight.styl b/source/css/_highlight/highlight.styl
index 58a77e0..12c81df 100644
--- a/source/css/_highlight/highlight.styl
+++ b/source/css/_highlight/highlight.styl
@@ -10,7 +10,6 @@ $code-block
padding: 0
background: $highlight-background
color: $highlight-foreground
- font-size: $code-font-size
line-height: $line-height-code-block
if wordWrap
@@ -28,7 +27,7 @@ blockquote
margin: 0 0 1rem
padding: .1rem .8rem
border-left: .2rem solid $blockquote-padding-color
- background-color: lighten($blockquote-padding-color, 33)
+ background-color: $blockquote-background-color
color: $blockquote-color
a
@@ -46,7 +45,7 @@ blockquote
padding: 0 .3em
content: '—'
-.article-container
+#article-container
pre,
code
font-family: $code-font !important
@@ -56,7 +55,8 @@ blockquote
background: $code-background
color: $code-foreground
word-wrap: break-word
- font-size: $code-font-size
+ word-break: break-word
+ overflow-wrap: break-word
pre
@extend $code-block
@@ -68,7 +68,7 @@ blockquote
color: $highlight-foreground
text-shadow: none
- .highlight
+ figure.highlight
@extend $code-block
position: relative
border-radius: 1px
@@ -101,6 +101,7 @@ blockquote
table
position: relative
+ display: table
margin: 0
width: auto
border: none
@@ -111,23 +112,11 @@ blockquote
figcaption
clearfix()
- position: absolute
- z-index: 1
- margin-bottom: 1em
- padding: .2rem 0 .2rem .7rem
- width: 100%
- height: 1.4em
+ padding: .3rem 0 .1rem .7rem
color: $highlight-foreground
font-size: 1em
line-height: 1em
- span
- float: left
- overflow: hidden
- max-width: 100%
- text-overflow: ellipsis
- white-space: nowrap
-
a
float: right
padding-right: 10px
@@ -136,15 +125,6 @@ blockquote
&:hover
border-bottom-color: $highlight-foreground
- &+table
- margin-top: 1.1rem
-
- &:before
- margin-top: -2.1rem
-
- &:after
- top: -2.1rem
-
.gutter pre
padding-right: .5rem
padding-left: .5rem
@@ -285,14 +265,12 @@ blockquote
.highlight-tools
position: relative
+ overflow: hidden
width: 100%
height: 1.4rem
background: darken($highlight-background, 5)
color: $highlight-foreground
font-size: 14px
- & + figure
- margin: 0 !important
-
.highlight-close
height: 0 !important
\ No newline at end of file
diff --git a/source/css/_layout/404.styl b/source/css/_layout/404.styl
new file mode 100644
index 0000000..0ffb194
--- /dev/null
+++ b/source/css/_layout/404.styl
@@ -0,0 +1,44 @@
+if hexo-config('error_404.enable')
+ #nav.error-no-found
+ display: flex
+ flex-direction: column
+ justify-content: center
+ height: 100vh
+
+ &:before
+ width: 100%
+ height: 100%
+ background-color: alpha($dark-black, .5)
+ content: ''
+
+ #error_info
+ position: absolute
+ padding: 0 4rem
+ width: 100%
+ letter-spacing: 3px
+ line-height: 1
+
+ #error_title,
+ #error_subtitle
+ margin: 0
+ padding: 0
+ color: $light-grey
+ letter-spacing: 5px
+ font-family: $site-name-font
+
+ #error_title
+ font-size: 10rem
+
+ #error_subtitle
+ font-size: 2rem
+
+ @media screen and (max-width: $sm)
+ #nav.error-no-found
+ #error_info
+ padding: 0 2rem
+
+ #error_title
+ font-size: 7rem !important
+
+ #error_subtitle
+ font-size: 1rem !important
diff --git a/source/css/_layout/aside.styl b/source/css/_layout/aside.styl
index 79f6af5..0276c21 100644
--- a/source/css/_layout/aside.styl
+++ b/source/css/_layout/aside.styl
@@ -1,11 +1,13 @@
#aside_content
width: 25%
+ .card-widget:not(:first-child)
+ margin-top: 1rem
+
.card-widget
overflow: hidden
- margin-top: 20px
border-radius: 8px
- background: $white
+ background: $card-bg
box-shadow: 0 4px 8px 6px rgba(7, 17, 27, .06)
transition: all .3s
@@ -15,11 +17,9 @@
.card-info
img
display: inline-block
- padding: 5px
- width: 120px
- height: 120px
+ width: 110px
+ height: 110px
border-radius: 70px
- vertical-align: top
transition: all .3s
&:hover
@@ -34,21 +34,18 @@
margin-top: -.3rem
.card-info-data
- display: flex
padding: .7rem 0
& > .card-info-data-item
- flex: 1 1
- min-width: 0
+ display: inline-block
+ width: 33.3%
a
- text-decoration: none
-
.headline
display: block
overflow: hidden
color: $font-black
- text-transform: uppercase
+ // text-transform: uppercase
text-overflow: ellipsis
white-space: nowrap
font-size: .7rem
@@ -77,8 +74,7 @@
z-index: 1
display: block
background-color: $light-blue
- color: $white
- text-decoration: none
+ color: $button-color
text-transform: uppercase
line-height: 1.6rem
@@ -96,7 +92,6 @@
.card-tag-cloud
a
- text-decoration: none
word-break: keep-all
&:hover
@@ -111,7 +106,6 @@
& > a
color: $font-black
- text-decoration: none
.aside-post-cover
float: left
@@ -134,7 +128,7 @@
.aside-post-title
.aside-post_meta
padding-left: 10px
- color: $theme-link-color
+ color: $theme-meta-color
font-size: .6rem
.aside-post_title
@@ -149,6 +143,10 @@
&:hover
color: $light-blue !important
+ &.no-aside-cover
+ .aside-post_title
+ height: auto
+
.card-archives ul.archive-list,
.card-categories ul.aside-category-item
margin: 0
@@ -164,19 +162,23 @@
&:hover
padding: .2rem .85rem
background-color: $light-blue
- color: #363636
a
- display: flex
color: $font-black
- text-decoration: none
span
+ display: inline-block
+ overflow: hidden
+ vertical-align: bottom
+ text-overflow: ellipsis
+ white-space: nowrap
+
&:first-child
- flex: auto
- overflow: hidden
- text-overflow: ellipsis
- white-space: nowrap
+ width: 80%
+
+ &:last-child
+ width: 20%
+ text-align: right
.card-categories
.aside-category-item
@@ -211,6 +213,10 @@
#aside_content
width: 100% !important
+ #aside_content
+ .card-widget:first-child
+ margin-top: 1rem
+
@media screen and (min-width: 900px)
#aside_content
.card-widget
@@ -219,7 +225,7 @@
else
margin-right: 15px
-if hexo-config('aside_mobile') == false
+if hexo-config('aside.mobile') == false
@media screen and (max-width: $sm)
#aside_content
display: none
diff --git a/source/css/_layout/category.styl b/source/css/_layout/category.styl
index 0287d0b..2150343 100644
--- a/source/css/_layout/category.styl
+++ b/source/css/_layout/category.styl
@@ -27,7 +27,7 @@
top: 0
left: 0
background: $light-blue
- color: $white
+ color: $card-bg
cursor: pointer
transition: all .3s ease-out
@@ -48,7 +48,7 @@
li
&:hover
&:before
- border-color: $ruby
+ border-color: $theme-button-hover-color
&:before
$w = .3rem
@@ -58,6 +58,6 @@
height: h = w
border: .5 * w solid $light-blue
border-radius: w
- background: $white
+ background: transparent
content: ''
line-height: h
diff --git a/source/css/_layout/comments.styl b/source/css/_layout/comments.styl
deleted file mode 100644
index 1204cda..0000000
--- a/source/css/_layout/comments.styl
+++ /dev/null
@@ -1,68 +0,0 @@
-#disqus_thread
- margin-top: 1rem
-
-.comment_headling
- margin-bottom: 10px
- font-weight: 700
- font-size: 20px
-
-// valine
-#vcomment
- font-size: inherit
-
- input
- font-size: .65rem
-
- button
- padding: .3rem 1rem
- border-color: #fff
- background-color: $light-blue
- color: #fff
- font-size: .7rem
-
- &:hover
- background-color: darken($light-blue, 40)
-
- textarea
- font-size: .7rem
-
- if hexo-config('valine.bg')
- background: url(hexo-config('valine.bg')) 100% 100% no-repeat
-
- .info
- display: none
-
- .vimg
- border: 0
-
- &:hover
- transform: rotate(540deg)
-
- .vcount
- font-size: .775rem
-
- .vnum
- font-size: 1.1rem
-
- .vsys
- font-size: 80%
-
- .vtime
- font-size: .65rem
-
- .vcontent
- font-size: 100%
-
- .vat
- padding: 0 .8rem
- border: 1px solid $cyan
- border-radius: 5px
- color: $cyan
- font-size: .7125rem
-
- &:hover
- background-color: alpha($cyan, .5)
-
- code,
- pre
- font-size: 98%
diff --git a/source/css/_layout/flink.styl b/source/css/_layout/flink.styl
index 2f6b90b..cd48474 100644
--- a/source/css/_layout/flink.styl
+++ b/source/css/_layout/flink.styl
@@ -1,11 +1,9 @@
-.flink
+.flink#article-container
.post-cards
margin: -10px 10px 0
.md-links
overflow: auto
- margin: 0 auto
- padding: 0
text-align: center
& > .md-links-item
@@ -13,11 +11,9 @@
float: left
overflow: hidden
margin: 20px 7px
- padding: 0
- width: calc(100% / 3 - 14px)
+ width: calc(100% / 3 - 15px)
height: 90px
border-radius: 8px
- list-style: none
line-height: 17px
transform: perspective(1px) translateZ(0)
@@ -45,15 +41,14 @@
transform: scale(1)
a
- color: #333
+ color: $font-color
text-decoration: none
img
float: left
- margin: 11px 10px
- padding: 4px
- width: 70px
- height: 70px
+ margin: 13px 0 0 10px
+ width: 65px
+ height: 65px
border-radius: 35px
transition: all .3s
@@ -74,18 +69,14 @@
white-space: nowrap
font-size: 13px
- .comment-word
- font-weight: bold
- font-size: 1.7em
-
@media screen and (max-width: 1100px)
.flink
.md-links
.md-links-item
- width: calc(50% - 14px) !important
+ width: calc(50% - 15px) !important
@media screen and (max-width: 600px)
.flink
.md-links
.md-links-item
- width: calc(100% - 14px) !important
+ width: calc(100% - 15px) !important
diff --git a/source/css/_layout/footer.styl b/source/css/_layout/footer.styl
index 0a224d6..23b7f4d 100644
--- a/source/css/_layout/footer.styl
+++ b/source/css/_layout/footer.styl
@@ -1,6 +1,5 @@
#footer
position: relative
- margin-top: 1rem
background: $light-blue
background-attachment: local
background-position: bottom
@@ -9,10 +8,8 @@
if hexo-config('footer_bg') != false
&:before
position: absolute
- top: 0
- right: 0
- bottom: 0
- left: 0
+ width: 100%
+ height: 100%
background-color: alpha($dark-black, .5)
content: ''
@@ -24,11 +21,11 @@
a
color: $light-grey
- text-decoration: none
cursor: pointer
&:hover
- color: $white
+ color: $theme-color
+ text-decoration: underline
.footer-separator
margin: 0 .2rem
diff --git a/source/css/_layout/gallery.styl b/source/css/_layout/gallery.styl
new file mode 100644
index 0000000..4d3103d
--- /dev/null
+++ b/source/css/_layout/gallery.styl
@@ -0,0 +1,109 @@
+figure.gallery-group
+ position: relative
+ float: left
+ overflow: hidden
+ margin: .3rem .2rem
+ width: calc(50% - .4rem)
+ height: 250px
+ border-radius: 8px
+ background: $dark-black
+ -webkit-transform: translate3d(0, 0, 0)
+
+ &:hover
+ img
+ opacity: .4
+ transform: translate3d(0, 0, 0)
+
+ .gallery-group-name::after
+ transform: translate3d(0, 0, 0)
+
+ p
+ opacity: 1
+ transform: translate3d(0, 0, 0)
+
+ img
+ position: relative
+ margin: 0 !important
+ max-width: none
+ width: calc(100% + 20px)
+ height: 250px
+ backface-visibility: hidden
+ opacity: .8
+ transition: opacity .35s, transform .35s
+ transform: translate3d(-10px, 0, 0)
+ object-fit: cover
+
+ figcaption
+ position: absolute
+ top: 0
+ left: 0
+ padding: 1.5rem
+ width: 100%
+ height: 100%
+ color: $gallery-color
+ text-transform: uppercase
+ backface-visibility: hidden
+
+ & > a
+ position: absolute
+ top: 0
+ right: 0
+ bottom: 0
+ left: 0
+ z-index: 1000
+ opacity: 0
+
+ p
+ display: -webkit-box
+ overflow: hidden
+ margin: 0
+ padding: .4rem 0 0
+ letter-spacing: 1px
+ font-size: .8rem
+ line-height: 1.5
+ opacity: 0
+ transition: opacity .35s, transform .35s
+ transform: translate3d(100%, 0, 0)
+ -webkit-line-clamp: 4
+ -webkit-box-orient: vertical
+
+ .gallery-group-name
+ position: relative
+ display: -webkit-box
+ overflow: hidden
+ margin: 0
+ padding: .4rem 0
+ font-weight: bold
+ font-size: 1.2rem
+ line-height: 1.5
+ -webkit-line-clamp: 2
+ -webkit-box-orient: vertical
+
+ &:after
+ position: absolute
+ bottom: 0
+ left: 0
+ width: 100%
+ height: 2px
+ background: $gallery-color
+ content: ''
+ transition: transform .35s
+ transform: translate3d(-100%, 0, 0)
+
+.gallery-group-main
+ overflow: auto
+ padding: 0 0 .8rem
+
+.justified-gallery
+ margin: 0 0 .8rem
+
+ img
+ opacity: 0
+
+ .fancybox
+ width: auto
+ text-align: inherit
+
+@media screen and (max-width: 600px)
+ figure.gallery-group
+ width: calc(100% - .4rem)
\ No newline at end of file
diff --git a/source/css/_layout/head.styl b/source/css/_layout/head.styl
index bf1e701..33e5f1e 100644
--- a/source/css/_layout/head.styl
+++ b/source/css/_layout/head.styl
@@ -1,21 +1,39 @@
#nav
position: relative
- margin-bottom: 1rem
width: 100%
background-color: $light-blue
background-attachment: local
- background-position: center
+ background-position: center center
background-size: cover
+ background-repeat: no-repeat
+ transition: all .5s
+ // index
&.full_page
- display: flex
- align-items: center
height: $index_top_img_height
- &.not_index_bg
- height: 20rem
+ #site-info
+ position: absolute
+ top: $index_site_info_top
+ padding: 0 .5rem
+ width: 100%
- #site-social-icons
+ #site_title,
+ #site_subtitle,
+ #scroll_down .scroll-down-effects
+ color: $light-grey
+ text-align: center
+ text-shadow: .1rem .1rem .2rem rgba(0, 0, 0, .15)
+ line-height: 1.5
+
+ #site_title
+ margin: 0
+ font-size: 1.3rem
+
+ #site_subtitle
+ font-size: .8rem
+
+ #site_social_icons
display: none
margin: 0 auto
width: 15rem
@@ -28,47 +46,83 @@
font-size: .9rem
cursor: pointer
- &:hover
- color: $white
-
-#site-info
- position: absolute
- width: 100%
-
-#site-title,
-#site-sub-title
- color: $light-grey
- text-align: center
- text-shadow: .1rem .1rem .2rem rgba(0, 0, 0, .15)
- line-height: 1.5
-
-#site-title
- font-weight: bold
- font-size: 1.3rem
-
-#site-sub-title
- font-size: .8rem
-
-#page_site-info
- position: absolute
- top: 10rem
- width: 100%
-
-.scroll-down
- position: absolute
- bottom: 0
- width: 100%
- height: 42px
- text-align: center
- font-size: 30px
- cursor: pointer
-
- .scroll-down-effects
+ #scroll_down
position: absolute
- color: $white
+ bottom: 0
+ width: 100%
+ cursor: pointer
-header
- position: relative
+ .scroll-down-effects
+ position: relative
+ width: 100%
+ font-size: 30px
+
+ // page
+ &.not-index-bg
+ height: 20rem
+
+ #page_site-info
+ position: absolute
+ top: 10rem
+ padding: 0 .5rem
+ width: 100%
+
+ // post
+ &.post-bg
+ height: 20rem
+
+ &:before
+ position: absolute
+ top: 0
+ left: 0
+ display: block
+ width: 100%
+ height: 100%
+ background-color: alpha($dark-black, .5)
+ content: ''
+
+ #post-info
+ position: absolute
+ bottom: 1.5rem
+ padding: 0 8%
+ width: 100%
+ color: $light-grey
+ text-align: left
+
+ #post-title
+ margin-bottom: .4rem
+ font-size: 1.5rem
+
+ .posttitle
+ display: -webkit-box
+ overflow: hidden
+ line-height: 1.5
+ -webkit-line-clamp: 3
+ -webkit-box-orient: vertical
+
+ #post-meta
+ .word-count,
+ #busuanzi_value_page_pv,
+ .comment-count
+ padding-left: .2rem
+
+ .post-meta
+ &__separator
+ margin: 0 .3rem
+
+ &__icon
+ margin-right: .2rem
+
+ &-pv-cv
+ display: inline-block
+
+ a
+ color: $light-grey
+ transition: all .3s ease-out
+
+ &:hover
+ color: $light-blue
+ text-decoration: underline
#page-header
position: absolute
@@ -79,7 +133,6 @@ header
height: 58px
border: none
font-size: 18px
- opacity: 0
transition: all .5s
.toggle-menu
@@ -95,7 +148,6 @@ header
a
color: $light-grey
- text-decoration: none
&:hover
color: $white
@@ -109,13 +161,14 @@ header
transition: transform .2s ease-in-out, opacity .2s ease-in-out
&.open-sidebar
- .site-page
- visibility: hidden
+ .menus,
+ #search_button
+ display: none
a,
#site-name,
.toggle-menu
- color: $light-black
+ color: $font-black
text-shadow: none
&:hover
@@ -129,7 +182,7 @@ header
background-color: $white !important
#site-name
- text-shadow: .1rem .1rem .2rem rgba(0, 0, 0, .15)
+ text-shadow: .1rem .1rem .2rem rgba($dark-black, .15)
font-weight: bold
cursor: pointer
@@ -163,7 +216,7 @@ header
transition: all .3s ease-in-out
&:hover
- &::after
+ &:after
width: 100%
.menus_item_child
@@ -174,7 +227,7 @@ header
padding: 0
width: max-content
background-color: alpha($white, .8)
- box-shadow: 0 5px 20px -4px rgba(0, 0, 0, .5)
+ box-shadow: 0 5px 20px -4px rgba($dark-black, .5)
animation: sub_menus .3s .1s ease both
&:before
@@ -194,7 +247,7 @@ header
background: $theme-color
a
- color: #3b3a3a
+ color: $font-black
text-shadow: none
#search_button
@@ -203,34 +256,50 @@ header
.site-page
position: relative
padding-bottom: .3rem
- text-shadow: .05rem .05rem .1rem rgba(0, 0, 0, .3)
+ text-shadow: .05rem .05rem .1rem rgba($dark-black, .3)
font-size: .7rem
cursor: pointer
@media screen and (min-width: $sm)
- #site-title
- font-size: 2rem
+ #nav
+ #site_title
+ font-size: 2rem
- #site-sub-title
- font-size: 1.2rem
+ #site_subtitle
+ font-size: 1.2rem
@media screen and (max-width: $sm)
#page-header
padding: 10px .8rem
#nav
- #site-social-icons
+ #site_social_icons
display: block
- &.not_index_bg
+ &.not-index-bg
height: 14rem
#page_site-info
top: 7rem
-@media screen and (max-width: $bg)
- #page-header
- &.fixed
- &.open-sidebar
- .site-page
- visibility: visible
\ No newline at end of file
+ &.post-bg
+ height: 18rem
+
+ & > #post-info
+ bottom: 1rem
+ padding: 0 5%
+
+ & > #post-title
+ font-size: 1.2rem
+
+ & > #post-meta
+ font-size: 90%
+
+ & > span
+ display: none
+
+ .post-meta-pv-cv
+ display: block
+
+ .post-meta__separator:first-child
+ display: none
\ No newline at end of file
diff --git a/source/css/_layout/mobile-sidebar.styl b/source/css/_layout/mobile-sidebar.styl
index 438fe51..a8f6583 100644
--- a/source/css/_layout/mobile-sidebar.styl
+++ b/source/css/_layout/mobile-sidebar.styl
@@ -7,23 +7,21 @@
left: 0
z-index: 102
display: none
- background: alpha($dark-black, .7)
+ background: alpha($dark-black, .8)
- #mobile-sidebar-menus,
- #mobile-sidebar-toc
+ #mobile-sidebar-menus
position: fixed
top: 0
- right: -254px
+ right: -250px
z-index: 103
display: block
+ overflow: hidden
overflow-y: scroll
width: 250px
height: 100%
- background: $white
- box-shadow: 0 0 4px alpha($dark-black, .27)
+ background: #f6f8fa
transition: all .5s
- #mobile-sidebar-menus
& > .mobile_author_icon
padding: 1.3rem 1.5rem 0
text-align: center
@@ -31,33 +29,33 @@
img
display: inline-block
padding: 0
- width: 120px
- height: 120px
+ width: 110px
+ height: 110px
border-radius: 70px
- vertical-align: top
transition: all .3s
.mobile_post_data
- display: flex
- justify-content: center
padding: .6rem .5rem 0
.mobile_data_item
- flex: 1
+ display: inline-block
+ width: 33.3%
- .mobile_data_link
- a
- text-decoration: none
+ .mobile_data_link
+ & > a > div
+ overflow: hidden
+ text-overflow: ellipsis
+ white-space: nowrap
- .length_num
- color: $dark-black
- font-size: .9rem
+ .length_num
+ color: $dark-black
+ font-size: .9rem
- .headline
- display: block
- color: $font-black
- text-transform: uppercase
- font-size: .7rem
+ .headline
+ display: block
+ color: $font-black
+ // text-transform: uppercase
+ font-size: .7rem
hr
margin: 1rem auto
@@ -74,7 +72,6 @@
margin: 0
padding: .3rem 1.5rem
color: $font-black
- text-decoration: none
text-overflow: ellipsis
text-shadow: none
white-space: nowrap
@@ -106,25 +103,4 @@
.menus_item_child
margin: 0
- list-style: none
-
- #mobile-sidebar-toc
- padding: 1rem .5rem 5rem .3rem
-
- ol,
- li
- margin: 0
- padding: 0 0 0 8px
- list-style: none
-
- .toc_mobile_headline
- text-align: center
- font-weight: bold
- font-size: 18px
-
- .toc_mobile_items-link
- color: $font-color
- text-decoration: none
-
- &:hover
- color: $light-blue
+ list-style: none
\ No newline at end of file
diff --git a/source/css/_layout/note.styl b/source/css/_layout/note.styl
index d026127..6920407 100644
--- a/source/css/_layout/note.styl
+++ b/source/css/_layout/note.styl
@@ -57,7 +57,12 @@
top: 13px
left: 15px
font-size: larger
- font-family: 'FontAwesome'
+
+ if hexo-config('fontawesome_v5') && hexo-config('fontawesome_v5.enable')
+ font-weight: 600
+ font-family: 'Font Awesome 5 Free'
+ else
+ font-family: 'FontAwesome'
&.default
if ($note-style == 'flat')
diff --git a/source/css/_layout/page.styl b/source/css/_layout/page.styl
index 877da46..7b79592 100644
--- a/source/css/_layout/page.styl
+++ b/source/css/_layout/page.styl
@@ -2,22 +2,24 @@
display: flex
align-items: flex-start
margin: 0 auto
- padding: 0 15px
+ padding: 2rem 15px
max-width: 1200px
// index
#recent-posts
width: 75%
+ & > .recent-post-item:not(:first-child)
+ margin-top: 1rem
+
& > .recent-post-item
display: flex
flex-direction: row
align-items: center
- margin-top: 20px
padding: 0
height: 280px
border-radius: 8px
- background: #fff
+ background: $card-bg
box-shadow: 0 4px 8px 6px rgba(7, 17, 27, .06)
transition: all .3s
@@ -27,20 +29,20 @@
img.post_bg
transform: scale(1.1)
- if hexo-config('index_post_cover') == 'both'
+ if hexo-config('cover.position') == 'both'
.left_radius
border-radius: 8px 0 0 8px
.right_radius
order: 2
border-radius: 0 8px 8px 0
- else if hexo-config('index_post_cover') == 'left'
+ else if hexo-config('cover.position') == 'left'
.left_radius
border-radius: 8px 0 0 8px
.right_radius
border-radius: 8px 0 0 8px
- else if hexo-config('index_post_cover') == 'right'
+ else if hexo-config('cover.position') == 'right'
.left_radius
order: 2
border-radius: 0 8px 8px 0
@@ -53,6 +55,7 @@
overflow: hidden
width: 45%
height: 280px
+ -webkit-mask-image: -webkit-radial-gradient(white, black)
img.post_bg
display: block
@@ -73,12 +76,14 @@
padding: 0 40px
width: 55%
+ &.no-cover
+ width: 100%
+
& > .article-title
display: -webkit-box
overflow: hidden
margin-bottom: .3rem
- color: $black
- text-decoration: none
+ color: $font-black
text-overflow: ellipsis
word-wrap: break-word
font-size: 1.2rem
@@ -90,36 +95,41 @@
&:hover
color: $light-blue !important
- & > time
- color: $grey
+ & > .article-meta-wrap
+ font-size: 95%
- & > .article-meta
- color: $grey
+ & > time
+ color: $theme-meta-color
+
+ & > .article-meta
+ color: $theme-meta-color
.sticky
- color: $theme-button-hover-color
+ color: $sticky-color
i
- margin: 0 .2rem 0 .3rem
+ margin: 0 .2rem 0 0
- .article-meta__separator
- margin-left: .3rem
+ .article-meta__separator,
+ .article-meta__link
+ margin: 0 .3rem
.fa-angle-right
- margin: 0 0 0 .3rem
+ margin: 0 .3rem
- a.article-meta__categories
- color: #858585
- text-decoration: none
+ a.article-meta__categories,
+ a.article-meta__tags
+ color: $theme-meta-color
&:hover
- color: #49b1f5 !important
+ color: $light-blue !important
+ text-decoration: underline
& > .content
display: -webkit-box
overflow: hidden
- margin-top: .5rem
- height: 90px
+ margin-top: .3rem
+ height: 85px
word-break: break-word
-webkit-line-clamp: 3
-webkit-box-orient: vertical
@@ -129,12 +139,11 @@
a
display: inline-block
padding: 0 .4rem
- text-decoration: none
cursor: pointer
transition: all .3s
&:hover
- color: $ruby !important
+ color: $theme-button-hover-color !important
transform: scale(1.1)
&__title
@@ -144,40 +153,29 @@
&-tags
text-align: center
-#tag,
-#category,
-#archive
- padding: 3rem
-
-.tag-cloud,
-#page,
-.category-content,
-.flink
- padding: 40px 44px 44px
-
-#page,
-.category-content,
-#archive,
-.tag-cloud,
-.flink,
-#tag,
-#category
- margin-top: 20px
- width: 75%
+.layout_post > #post,
+.layout_page > div:first-child:not(.recent-posts)
+ padding: 50px 40px
border-radius: 8px
- background: $white
+ background: $card-bg
box-shadow: 0 4px 8px 6px rgba(7, 17, 27, .06)
transition: all .3s
&:hover
box-shadow: 0 4px 12px 12px rgba(7, 17, 27, .15)
+.layout_page
+ & > div:first-child:not(.recent-posts)
+ width: 75%
+
.article-sort
+ margin-left: .5rem
padding-left: 1rem
- border-left: 2px solid $pale-blue
+ border-left: 2px solid lighten($light-blue, 20)
&-title
position: relative
+ margin-left: .5rem
padding-bottom: 1.2rem
padding-left: 1rem
font-size: 1.2rem
@@ -185,7 +183,7 @@
&:hover
&:before
- border-color: $ruby
+ border-color: $theme-button-hover-color
&:before
position: absolute
@@ -196,7 +194,7 @@
height: h = w
border: .5 * w solid $light-blue
border-radius: w
- background: $white
+ background: $card-bg
content: ''
line-height: h
transition: all .2s ease-in-out
@@ -208,17 +206,19 @@
z-index: 0
width: .1rem
height: 1.3rem
- background: $pale-blue
+ background: lighten($light-blue, 20)
content: ''
&-item
position: relative
margin: 0 0 1rem .5rem
+ width: 100%
+ height: 80px
transition: all .2s ease-in-out
&:hover
&:before
- border-color: $ruby
+ border-color: $theme-button-hover-color
&:before
$w = .3rem
@@ -229,12 +229,22 @@
height: h = w
border: .5 * w solid $light-blue
border-radius: w
- background: $white
+ background: $card-bg
content: ''
line-height: h
transition: all .2s ease-in-out
+ &.no-article-cover
+ display: flex
+ flex-direction: column
+ justify-content: center
+
+ .article-sort-post
+ padding: 0
+ width: 100%
+
&.year
+ height: auto
font-size: 1rem
&:hover
@@ -243,17 +253,15 @@
&:before
top: .7rem
- border-color: $ruby
+ border-color: $theme-button-hover-color
&__time
padding-left: .4rem
- color: $a-link-color
font-size: .7rem
&__title
display: -webkit-box
overflow: hidden
- height: 60px
color: $font-black
font-size: .75rem
transition: all .3s
@@ -276,23 +284,21 @@
transform: scale(1.1)
&__post
- text-decoration: none
- cursor: pointer
+ color: $theme-meta-color
&:hover
- color: $a-link-color
+ color: $theme-meta-color
&-img
- display: inline-block
+ float: left
overflow: hidden
width: 80px
height: 80px
&-post
- position: absolute
- top: 0
display: inline-block
- margin-left: 1rem
+ padding: 0 1rem
+ width: calc(100% - 80px)
.category-lists
padding: 1rem 0 1.5rem
@@ -304,12 +310,11 @@
.category-list
a
color: $font-black
- text-decoration: none
cursor: pointer
.category-list-count
margin-left: .4rem
- color: $a-link-color
+ color: $theme-meta-color
&:before
content: '('
@@ -317,19 +322,19 @@
&:after
content: ')'
+// 隱藏aside
+.hide-aside
+ max-width: 1000px
+
+ & > div
+ width: 100% !important
+
@media screen and (max-width: $sm)
.layout_page
- padding: 0 5px !important
+ padding: 1rem 5px !important
- #page,
- .category-content,
- #archive,
- .tag-cloud,
- .flink,
- #tag,
- #category
- margin: 0
- padding: 1.8rem 1.3rem
+ & > div:first-child:not(.recent-posts)
+ padding: 1.8rem .7rem
.category-lists
padding: 0
@@ -347,17 +352,17 @@
.recent-post-info
order: 2 !important
- padding: 30px 25px 18px !important
+ padding: 1rem 1rem 1.5rem
width: 100%
+ &.no-cover
+ padding: 1.5rem 1rem
+
.article-title
font-size: 1rem
- .article-meta.tags
- display: none
-
- &:first-child
- margin: 0
+ .content
+ height: auto
@media screen and (min-width: 900px)
if hexo-config('aside.position') == 'left'
@@ -366,17 +371,11 @@
.category-content,
#archive,
.tag-cloud,
- .flink,
#tag,
#category
order: 2
@media screen and (max-width: 900px)
- #page,
- .category-content,
- #archive,
- .tag-cloud,
- .flink,
- #tag,
- #category
- width: 100% !important
\ No newline at end of file
+ .layout_page
+ & > div:first-child:not(.recent-posts)
+ width: 100% !important
\ No newline at end of file
diff --git a/source/css/_layout/pagination.styl b/source/css/_layout/pagination.styl
index 0a4188c..f8935c8 100644
--- a/source/css/_layout/pagination.styl
+++ b/source/css/_layout/pagination.styl
@@ -6,9 +6,6 @@
.pagination
text-align: center
- .space
- color: $a-link-color
-
.page-number
display: inline-block
margin: 0 .2rem
@@ -19,71 +16,56 @@
cursor: pointer
&.current
- background: $cyan
- color: $white
+ background: $theme-paginator-color
+ color: $button-color
cursor: default
img.prev_cover,
img.next_cover
position: absolute
- top: 0
- left: 0
- padding: 0
width: 100%
height: 100%
- background-size: cover
opacity: .4
transition: all .6s
- pointer-events: none
object-fit: cover
+ .pagination-info
+ position: absolute
+ top: 50%
+ padding: 1rem 2rem
+ width: 100%
+ transform: translate(0, -50%)
+
.prev_info,
.next_info
- position: absolute
- bottom: 50px
- z-index: 100
- display: block
overflow: hidden
- width: 70%
- color: $white
+ color: $button-color
text-overflow: ellipsis
white-space: nowrap
- font-weight: 400
+ font-weight: 500
- .next_info
- right: 40px
- text-align: right
+ .next-post
+ .pagination-info
+ text-align: right
.pull-full
width: 100% !important
.prev-post .label,
.next-post .label
- position: absolute
- top: 50px
- z-index: 100
- display: block
color: alpha($white, .9)
text-transform: uppercase
font-size: 90%
- .next-post .label
- right: 40px
-
.prev-post,
.next-post
- float: left
width: 50%
a
position: relative
display: block
- float: left
overflow: hidden
- padding: 55px 40px
- width: 100%
height: 150px
- text-align: left
&:hover
img.prev_cover,
diff --git a/source/css/_layout/post.styl b/source/css/_layout/post.styl
index 215bf7b..93f9ae4 100644
--- a/source/css/_layout/post.styl
+++ b/source/css/_layout/post.styl
@@ -1,81 +1,18 @@
-if hexo-config('post_beautify.enable')
- headStyle(fontsize)
- padding-left: unit(fontsize + .3, 'rem')
+#article-container
+ if hexo-config('beautify.enable')
+ headStyle(fontsize)
+ padding-left: unit(fontsize + .4, 'rem')
- code
- font-size: unit(fontsize, 'rem')
+ code
+ font-size: unit(fontsize, 'rem')
- &:before
- top: calc(50% - unit(fontsize / 2 - .05, 'rem'))
- font-size: unit(fontsize, 'rem')
+ &:before
+ margin-left: unit((-(fontsize + .2)), 'rem')
+ font-size: unit(fontsize, 'rem')
- &:hover
- padding-left: unit(fontsize + .2, 'rem')
+ &:hover
+ padding-left: unit(fontsize + .6, 'rem')
-#top-container
- position: relative
- margin-bottom: 1rem
- height: 19rem
- background-color: $light-blue
- background-attachment: local
- background-position: center
- background-size: cover
-
- &:before
- position: absolute
- top: 0
- left: 0
- display: block
- width: 100%
- height: 100%
- background-color: alpha($dark-black, .5)
- content: ''
-
- a
- color: $light-grey
- text-decoration: none
- transition: all .3s ease-out
-
- &:hover
- text-decoration: underline
-
- & > #post-info
- position: absolute
- bottom: 1.5rem
- padding: 0 8%
- width: 100%
- color: $light-grey
- text-align: left
-
- #post-title
- margin-bottom: .4rem
- font-size: 1.5rem
-
- .posttitle
- display: -webkit-box
- overflow: hidden
- line-height: 1.5
- -webkit-line-clamp: 3
- -webkit-box-orient: vertical
-
- #post-meta
- .word-count,
- #busuanzi_value_page_pv,
- .comment-count
- padding-left: .2rem
-
- .post-meta
- &__separator
- margin: 0 .3rem
-
- &__icon
- margin-right: .2rem
-
- &-pv-cv
- display: inline-block
-
-#post-content
- if hexo-config('post_beautify.enable')
h1,
h2,
h3,
@@ -88,16 +25,23 @@ if hexo-config('post_beautify.enable')
&:before
position: absolute
top: calc(50% - .35rem)
- left: 0
color: $title-prefix-icon-color
content: $title-prefix-icon
- font: normal normal normal 14px / 1 FontAwesome
- font-size: .8rem
+ font-style: normal
+ font-variant: normal
+ line-height: 1
transition: all .2s ease-out
+ text-rendering: auto
+ -webkit-font-smoothing: antialiased
+
+ if hexo-config('fontawesome_v5') && hexo-config('fontawesome_v5.enable')
+ font-weight: 600
+ font-family: 'Font Awesome 5 Free'
+ else
+ font-weight: normal
+ font-family: FontAwesome
&:hover
- padding-left: 1.1rem
-
&:before
color: $light-blue
@@ -147,7 +91,7 @@ if hexo-config('post_beautify.enable')
top: 0
left: 0
background: $light-blue
- color: $white
+ color: $card-bg
cursor: pointer
transition: all .3s ease-out
@@ -168,7 +112,7 @@ if hexo-config('post_beautify.enable')
> li
&:hover
&:before
- border-color: $ruby
+ border-color: $theme-button-hover-color
&:before
$w = .3rem
@@ -178,7 +122,7 @@ if hexo-config('post_beautify.enable')
height: h = w
border: .5 * w solid $light-blue
border-radius: w
- background: $white
+ background: transparent
content: ''
line-height: h
else
@@ -201,14 +145,13 @@ if hexo-config('post_beautify.enable')
a
color: $a-link-color
+ text-decoration: none
+ word-wrap: break-word
transition: all .2s
+ overflow-wrap: break-word
&:hover
color: $light-blue
- text-decoration: none
-
- site-name
- text-decoration: none
a.fancybox
outline: none
@@ -219,7 +162,6 @@ a.fancybox
display: inline-block
width: 100%
text-align: center
- text-decoration: none
p
margin: 0 0 .8rem
@@ -240,14 +182,14 @@ img
transition: all .3s
transform: rotate(0)
- & + .code_lang
+ & + .code-lang
left: 30px
&.code-closed
transition: all .3s
transform: rotate(-90deg) !important
- .code_lang
+ .code-lang
position: absolute
left: 15px
z-index: 1
@@ -279,10 +221,6 @@ img
&:hover
color: darken($highlight-aqua, 20%)
-@media screen and (min-width: $md)
- .layout_post
- width: $content-large-width
-
.katex-wrap
overflow: auto
@@ -291,21 +229,14 @@ img
display: none
.layout_post
- margin: 40px auto
- padding: 50px
+ margin: 0 auto
+ padding: 2rem 15px
max-width: 1000px
- border-radius: 8px
- background: #fff
- box-shadow: 0 4px 8px 6px rgba(7, 17, 27, .06)
- transition: all .3s
-
- &:hover
- box-shadow: 0 4px 12px 12px rgba(7, 17, 27, .15)
img
display: block
- & >.tag_share
+ .tag_share
.post-meta
&__tag-list
display: inline-block
@@ -317,16 +248,14 @@ img
width: fit-content
border: 1px solid $light-blue
border-radius: .6rem
- background: $white
color: $light-blue
- text-decoration: none
font-size: 12px
cursor: pointer
transition: all .2s ease-in-out
&:hover
background: $light-blue
- color: $white
+ color: $button-color
.post_share
display: inline-block
@@ -344,7 +273,7 @@ img
font-size: 15px
line-height: 25px
- & > .post-copyright
+ .post-copyright
position: relative
margin: 2rem 0 .5rem
padding: .5rem .8rem
@@ -383,47 +312,29 @@ img
padding-left: .3rem
a
+ text-decoration: underline
word-break: break-word
- #post
- a
- color: $light-blue
- text-decoration: none
+ &:hover
+ text-decoration: none
- &:hover
- text-decoration: underline
+#article-container
+ a
+ color: $theme-link-color
- img
- margin: .8rem auto
+ &:hover
+ text-decoration: underline
+
+ img
+ margin: 0 auto .8rem
@media screen and (max-width: 1024px)
.layout_post
- margin: 0 15px
width: auto
@media screen and (max-width: $sm)
.layout_post
- margin: 0 5px
- padding: 1.8rem 1rem
+ padding: 1rem 5px
- #top-container
- height: 18rem
-
- & > #post-info
- bottom: 1rem
- padding: 0 5%
-
- & > #post-title
- font-size: 1.2rem
-
- & > #post-meta
- font-size: 90%
-
- & > span
- display: none
-
- .post-meta-pv-cv
- display: block
-
- .post-meta__separator:first-child
- display: none
+ & > #post
+ padding: 1.8rem .7rem
\ No newline at end of file
diff --git a/source/css/_layout/readmode.styl b/source/css/_layout/readmode.styl
deleted file mode 100644
index 6bb584c..0000000
--- a/source/css/_layout/readmode.styl
+++ /dev/null
@@ -1,93 +0,0 @@
-if hexo-config('readmode') && hexo-config('readmode.enable')
- .read-mode
- padding: 0 !important
- background: $pale-yellow
-
- #page-header
- #site-name,
- .site-page
- color: $font-black
- text-shadow: none
-
- .menus_item_child
- background-color: darken($pale-yellow, 3) !important
-
- & > li
- &:hover
- background-color: darken($pale-yellow, 10) !important
-
- #top-container
- height: 14rem
- background-color: $pale-yellow
- background-image: none !important
-
- a
- color: $font-black
-
- &:before
- opacity: 0
-
- & > #post-info
- padding: 0
- color: $font-black
- text-align: center
-
- #page-header
- &.fixed
- background: alpha(darken($pale-yellow, 5), .5)
- box-shadow: none
-
- &.open-sidebar
- .site-page
- visibility: visible
-
- .layout_post
- background: $pale-yellow
- box-shadow: none
-
- &:hover
- box-shadow: none
-
- .article-container
- pre,
- .highlight:not(.js-file-line-container)
- background: darken($pale-yellow, 5)
-
- .highlight
- display: block !important
-
- blockquote
- border-left: .2rem solid #d6dbdf
- background-color: rgba(102, 128, 153, .05)
-
- #rightside
- #darkmode
- display: none
-
- & > canvas
- display: none !important
-
- .code-area-wrap > .highlight-tools,
- #sidebar,
- #toggle-sidebar,
- #footer,
- .layout_post > div,
- .layout_post > hr,
- .layout_post > nav
- display: none
-
- hr
- border: 2px dashed #d6dbdf
- background: transparent
-
- &:before
- color: darken(#d6dbdf, 10)
-
- &::-webkit-scrollbar-thumb
- background: darken($pale-yellow, 10)
-
- *::-webkit-scrollbar-thumb
- background: darken($pale-yellow, 10)
-
- #web_bg
- background: none
diff --git a/source/css/_layout/relatedposts.styl b/source/css/_layout/relatedposts.styl
index bd8ac42..89ef159 100644
--- a/source/css/_layout/relatedposts.styl
+++ b/source/css/_layout/relatedposts.styl
@@ -1,74 +1,61 @@
.relatedPosts
- margin: 0 auto
margin-top: 1rem
- padding: 0
- width: 100%
-.relatedPosts_item
- position: relative
- float: left
- overflow: hidden
- margin: 5px
- width: calc(100% / 3 - 10px)
- height: 200px
- background: $dark-black
+ .relatedPosts_headline
+ margin-bottom: 5px
+ font-weight: 700
+ font-size: 20px
- &:hover
- .relatedPosts_cover
- opacity: .8
- transform: scale(1.1)
-
- a
- text-decoration: none
-
-.relatedPosts_cover
- position: absolute
- display: block
- margin: 0
- padding: 0
- width: 100%
- height: 100%
- border: 0
- opacity: .4
- transition: all .6s
- object-fit: cover
-
-.relatedPosts_main
- position: relative
- display: flex
- flex-direction: column
- justify-content: center
- margin: 0
- padding: 0 1rem
- height: 100%
- color: $white
-
- .relatedPosts_date
- display: block
- color: alpha($white, .9)
- font-size: 90%
-
- .relatedPosts_title
- display: -webkit-box
+ .relatedPosts_item
+ position: relative
+ float: left
overflow: hidden
- max-height: 60px
- -webkit-line-clamp: 2
- -webkit-box-orient: vertical
+ margin: 5px
+ width: calc(100% / 3 - 10px)
+ height: 200px
+ background: $dark-black
-.relatedPosts_headline
- margin-bottom: 5px
- font-weight: 700
- font-size: 20px
+ &:hover
+ .relatedPosts_cover
+ opacity: .8
+ transform: scale(1.1)
-.clear_both
- clear: both
+ .relatedPosts_cover
+ width: 100%
+ height: 100%
+ opacity: .4
+ transition: all .6s
+ object-fit: cover
+
+ .relatedPosts_main
+ position: absolute
+ top: 50%
+ padding: 0 1rem
+ width: 100%
+ color: $white
+ transform: translate(0, -50%)
+
+ .relatedPosts_date
+ color: $light-grey
+ font-size: 90%
+
+ .relatedPosts_title
+ display: -webkit-box
+ overflow: hidden
+ -webkit-line-clamp: 2
+ -webkit-box-orient: vertical
+
+ .clear_both
+ clear: both
@media screen and (max-width: 768px)
- .relatedPosts_item
- margin: 2px
- width: calc(100% / 2 - 4px)
- height: 150px
+ .relatedPosts
+ .relatedPosts_item
+ margin: 2px
+ width: calc(100% / 2 - 4px)
+ height: 150px
@media screen and (max-width: 480px)
- .relatedPosts_item
- width: calc(100% - 4px)
+ .relatedPosts
+ .relatedPosts_item
+ width: calc(100% - 4px)
diff --git a/source/css/_layout/reward.styl b/source/css/_layout/reward.styl
index 44244d1..291b474 100644
--- a/source/css/_layout/reward.styl
+++ b/source/css/_layout/reward.styl
@@ -9,7 +9,7 @@
display: inline-block
width: 100px
background: $light-blue
- color: $white
+ color: $button-color
text-align: center
line-height: 36px
cursor: pointer
@@ -34,7 +34,7 @@
padding: 20px 10px 8px
width: 320px
border-radius: 4px
- background: #f5f5f5
+ background: $reward-pop-up-bg
&:before
position: absolute
@@ -52,7 +52,7 @@
margin: 0 auto
width: 0
height: 0
- border-top: 13px solid #f5f5f5
+ border-top: 13px solid $reward-pop-up-bg
border-right: 13px solid transparent
border-left: 13px solid transparent
content: ''
@@ -70,5 +70,5 @@
.post-qr-code__desc
margin: -5px 0
- color: #858585
+ color: $reward-pop-up-color
text-align: center
diff --git a/source/css/_layout/rightside.styl b/source/css/_layout/rightside.styl
index f75903c..730788e 100644
--- a/source/css/_layout/rightside.styl
+++ b/source/css/_layout/rightside.styl
@@ -24,15 +24,14 @@
width: 30px
height: 30px
background-color: $light-blue
- color: $white
+ color: $button-color
text-align: center
- text-decoration: none
font-size: 16px
line-height: 29px
cursor: pointer
&:hover
- background-color: $ruby
+ background-color: $theme-button-hover-color
#rightside_config
i
diff --git a/source/css/_layout/sidebar.styl b/source/css/_layout/sidebar.styl
index 45b73db..823d203 100644
--- a/source/css/_layout/sidebar.styl
+++ b/source/css/_layout/sidebar.styl
@@ -1,16 +1,14 @@
#sidebar
position: fixed
top: 0
- left: -300px
+ left: -($sidebar-width)
z-index: 10
- overflow-y: auto
padding: 1rem 0 2rem .5rem
width: $sidebar-width
height: 100%
background: $sidebar-background
- box-shadow: -.25rem 0 .25rem rgba(232, 237, 250, .6) inset
+ box-shadow: -.25rem 0 .25rem rgba($sidebar-background, .6) inset
opacity: .9
- transition: ease-in-out .4s
.sidebar-toc
ol,
@@ -24,25 +22,29 @@
&__title
padding-right: .5rem
text-align: center
- font-size: unit(.9 * $rem, 'px')
+ font-size: 1.3em
+
+ &__content
+ overflow-y: scroll
+ padding-bottom: 5rem
+ height: 90vh
.toc-link
display: block
padding-left: .2rem
border-right: 3px solid transparent
- text-decoration: none
transition: all .2s ease-in-out
&.active
- border-right-color: darken($cyan, 20%)
- background: $cyan
- color: $white
+ border-right-color: darken($theme-toc-color, 20%)
+ background: $theme-toc-color
+ color: $sidebar-active-color
&__progress
position: relative
- margin-top: -.3rem
+ margin-bottom: .3rem
padding-left: .6rem
- color: $cyan
+ color: $theme-toc-color
.progress-notice
margin-right: .4rem
@@ -54,4 +56,19 @@
&-bar
width: 0
height: 1px
- background: $cyan
+ background: $theme-toc-color
+
+@media screen and (max-width: $bg)
+ i#toggle-sidebar
+ display: none
+
+ #sidebar
+ right: -($mobile-sidebar-width)
+ left: auto
+ z-index: 103
+ width: $mobile-sidebar-width
+ opacity: 1
+ transition: all .4s
+
+ .toc-child
+ display: block !important
\ No newline at end of file
diff --git a/source/css/_layout/third-party.styl b/source/css/_layout/third-party.styl
new file mode 100644
index 0000000..e5e6519
--- /dev/null
+++ b/source/css/_layout/third-party.styl
@@ -0,0 +1,88 @@
+if hexo-config('valine.enable')
+ // valine
+ #vcomment
+ button
+ padding: .3rem 1rem
+ border-color: $button-color
+ background-color: $light-blue
+ color: $button-color
+ font-size: .7rem
+
+ &:hover
+ background-color: $theme-button-hover-color
+
+ textarea
+ if hexo-config('valine.bg')
+ background: url(hexo-config('valine.bg')) 100% 100% no-repeat
+
+ .info
+ display: none
+
+ .vimg
+ border: 0
+
+ &:hover
+ transform: rotate(540deg)
+
+ .vat
+ padding: 0 .8rem
+ border: 1px solid $light-blue
+ border-radius: 5px
+ color: $light-blue
+ font-size: .7125rem
+
+ &:hover
+ background-color: $light-blue
+ color: $button-color
+
+if hexo-config('beautify.enable')
+ #article-container
+ .aplayer
+ ol,
+ ul
+ margin: 0
+ padding: 0
+
+ li
+ margin: 0
+ padding: 0 15px
+
+ &:before
+ content: none
+
+// third-party
+.fireworks
+ position: fixed
+ top: 0
+ left: 0
+ z-index: 999999
+ pointer-events: none
+
+.medium-zoom-image--opened
+ z-index: 99999 !important
+ margin: 0 !important
+
+.medium-zoom-overlay
+ z-index: 99999 !important
+
+.mermaid
+ overflow: auto
+ margin: 0 0 1rem
+ background: $white
+ text-align: center
+ opacity: 0
+ transition: all .3s
+
+ &[data-processed]
+ opacity: 1
+
+.utterances
+ max-width: 100%
+
+#gitalk-container
+ .gt-meta
+ margin: 0 0 .8em
+ padding: .3rem 0 .8em
+
+.has-jax
+ overflow: auto
\ No newline at end of file
diff --git a/source/css/_layout/z-darkmode.styl b/source/css/_mode/darkmode.styl
similarity index 85%
rename from source/css/_layout/z-darkmode.styl
rename to source/css/_mode/darkmode.styl
index 3411bb3..0730389 100644
--- a/source/css/_layout/z-darkmode.styl
+++ b/source/css/_mode/darkmode.styl
@@ -1,4 +1,4 @@
-if hexo-config('darkmode.enable') || hexo-config('autoChangeMode') == '1' || hexo-config('autoChangeMode') == '2'
+if hexo-config('darkmode.enable')
[data-theme='dark']
body
background-color: darken(#121212, 2)
@@ -20,21 +20,16 @@ if hexo-config('darkmode.enable') || hexo-config('autoChangeMode') == '1' || hex
background-color: alpha($dark-black, .7)
content: ''
- #archive,
- .tag-cloud,
- #tag,
- .category-content,
- #category,
- #page,
- .flink,
- .layout_post
- background: #121212
+ #nav,
+ .layout_post > #post,
+ .layout_page > div:first-child:not(.recent-posts)
+ background-color: #121212
#sidebar
background: #121212
box-shadow: -.25rem 0 .25rem #121212
- .article-container code
+ #article-container code
background: #2c2c2c
.recent-posts
@@ -46,7 +41,7 @@ if hexo-config('darkmode.enable') || hexo-config('autoChangeMode') == '1' || hex
#page-header
&.fixed
- background: #121212
+ background: alpha(#121212, .8)
box-shadow: 0 5px 6px -5px rgba(133, 133, 133, 0)
.toggle-menu,
@@ -65,14 +60,14 @@ if hexo-config('darkmode.enable') || hexo-config('autoChangeMode') == '1' || hex
color: alpha(#FFFFFF, .6)
// 代碼框
- .article-container pre,
- .article-container pre code
+ #article-container pre,
+ #article-container pre code
background-color: lighten(#121212, 2)
.highlight-tools
background: lighten(#121212, 3)
- .article-container .highlight:not(.js-file-line-container)
+ #article-container .highlight:not(.js-file-line-container)
background-color: lighten(#121212, 2)
.code pre,
@@ -97,9 +92,8 @@ if hexo-config('darkmode.enable') || hexo-config('autoChangeMode') == '1' || hex
&:before
color: alpha(#FFFFFF, .6)
- .layout_post >.tag_share .post-meta__tags
+ .layout_post .tag_share .post-meta__tags
border: 1px solid alpha(#FFFFFF, .6)
- background: 0
color: alpha(#FFFFFF, .6)
&:hover
@@ -118,7 +112,7 @@ if hexo-config('darkmode.enable') || hexo-config('autoChangeMode') == '1' || hex
// 音樂播放器
.aplayer
filter: brightness(.7)
- color: #000000
+ color: $dark-black
// 右下角按鈕
#rightside
@@ -150,7 +144,7 @@ if hexo-config('darkmode.enable') || hexo-config('autoChangeMode') == '1' || hex
background-color: lighten(#121212, 10) !important
img,
- iframe,
+ iframe:not(.utterances-frame),
.gist
filter: brightness(.7)
@@ -171,9 +165,8 @@ if hexo-config('darkmode.enable') || hexo-config('autoChangeMode') == '1' || hex
background: lighten(#121212, 20) !important
// 頭部
- #nav,
- #top-container
- &::before
+ #nav
+ &:before
position: absolute
top: 0
right: 0
@@ -186,11 +179,11 @@ if hexo-config('darkmode.enable') || hexo-config('autoChangeMode') == '1' || hex
#nav i,
#page-header a,
#page-header .toggle-menu,
- #top-container #post-meta,
- #top-container a,
+ #post-meta,
+ #post-meta a,
#footer-wrap,
#footer-wrap a
- color: alpha(#FFFFFF, .6)
+ color: alpha(#FFFFFF, .6) !important
.posttitle,
h1,
@@ -203,7 +196,7 @@ if hexo-config('darkmode.enable') || hexo-config('autoChangeMode') == '1' || hex
.recent-posts .post-meta__date,
.recent-posts .article-meta,
- .recent-posts .article-meta__categories,
+ .recent-posts a,
.post-reward .reward-button,
.fa-clipboard,
.gutter pre,
@@ -242,12 +235,6 @@ if hexo-config('darkmode.enable') || hexo-config('autoChangeMode') == '1' || hex
a
color: alpha(#FFFFFF, .6) !important
- #mobile-sidebar-toc
- background: #121212
-
- a
- color: alpha(#FFFFFF, .6) !important
-
// note
if hexo-config('note.style') == 'modern'
.note
@@ -301,11 +288,15 @@ if hexo-config('darkmode.enable') || hexo-config('autoChangeMode') == '1' || hex
.vsys
background: rgb(97, 106, 107) !important
- .vbtn
+ .vbtn,
+ .vat
border: 1px solid alpha(#FFFFFF, .6)
- background: rgb(45, 48, 53) !important
+ background: lighten(#121212, 5) !important
color: alpha(#FFFFFF, .6) !important
+ &:hover
+ background: lighten(#121212, 20) !important
+
.vwrap
border: 1px solid alpha(#FFFFFF, .6)
@@ -354,3 +345,26 @@ if hexo-config('darkmode.enable') || hexo-config('autoChangeMode') == '1' || hex
#algolia-search-results
.algolia-hit-item-link
color: alpha(#FFFFFF, .6)
+
+ if hexo-config('disqusjs.enable')
+ #disqus_thread
+ #dsqjs
+ .dsqjs-tab-active,
+ .dsqjs-no-comment
+ color: alpha(#FFFFFF, .6)
+
+ .dsqjs-order-label
+ background-color: lighten(#121212, 5)
+
+ .dsqjs-post-body
+ color: alpha(#FFFFFF, .6)
+
+ code,
+ pre
+ background: #2c2c2c
+
+ blockquote
+ color: alpha(#FFFFFF, .6)
+
+ .mermaid
+ filter: brightness(.7)
diff --git a/source/css/_mode/readmode.styl b/source/css/_mode/readmode.styl
new file mode 100644
index 0000000..c89cb92
--- /dev/null
+++ b/source/css/_mode/readmode.styl
@@ -0,0 +1,147 @@
+if hexo-config('readmode') && hexo-config('readmode.enable')
+ [data-theme='light']
+ .read-mode
+ background: #fff
+
+ #nav.post-bg
+ a
+ color: $font-black !important
+
+ #article-container
+ pre,
+ .highlight:not(.js-file-line-container)
+ background: #f7f7f7 !important
+
+ code
+ color: #4c4948
+
+ blockquote
+ border-left: .2rem solid #ddd
+ background-color: transparent
+
+ ol,
+ li
+ &:before
+ background: transparent
+ color: #4c4948
+
+ ul
+ >li
+ &:before
+ border: .2rem solid #90a4ae
+
+ hr
+ border: 2px dashed #d6dbdf
+ background: transparent
+
+ &:before
+ color: darken(#d6dbdf, 10)
+
+ .hide-button
+ background: darken(#d6dbdf, 10) !important
+
+ .note
+ border: 2px solid #eee
+ border-left-color: transparent
+ background-color: transparent
+
+ #mobile-sidebar-menus,
+ #rightside i,
+ #rightside a,
+ #rightside #rightside_config
+ background: darken(#d6dbdf, 10) !important
+
+ [data-theme='dark']
+ .read-mode
+ background: #0d0d0d
+
+ #article-container
+ code
+ color: rgba(255, 255, 255, .6)
+
+ blockquote
+ border-left: .2rem solid rgba(255, 255, 255, .6)
+ background-color: transparent
+
+ ol,
+ li
+ &:before
+ background: transparent
+ color: rgba(255, 255, 255, .6)
+
+ ul
+ >li
+ &:before
+ border: .15rem solid rgba(255, 255, 255, .6)
+
+ .note
+ border: 2px solid rgba(255, 255, 255, .6)
+ border-left-color: transparent
+ filter: none
+ background-color: transparent
+ color: rgba(255, 255, 255, .6)
+
+ .hide-button
+ background: #1f1f1f !important
+
+ .read-mode
+ #body-wrap
+ padding-left: 0 !important
+
+ #nav.post-bg
+ background-color: transparent
+ background-image: none !important
+
+ a
+ text-shadow: none !important
+
+ &:before
+ opacity: 0
+
+ & > #post-info
+ padding: 0
+ color: $font-black
+ text-align: center
+
+ .layout_post
+ > #post
+ background: transparent
+ box-shadow: none
+
+ &:hover
+ box-shadow: none
+
+ .highlight
+ display: block !important
+
+ #rightside
+ #darkmode
+ display: none
+
+ & > canvas
+ display: none !important
+
+ .code-area-wrap > .highlight-tools,
+ #footer,
+ #post > *:not(:first-child),
+ #to_comment,
+ #sidebar,
+ #toggle-sidebar,
+ #mobile-toc-button,
+ #page-header
+ display: none !important
+
+ #web_bg
+ background: none
+
+ #article-container
+ h1,
+ h2,
+ h3,
+ h4,
+ h5,
+ h6
+ padding: 0
+
+ &:before
+ content: ''
diff --git a/source/css/_search/algolia.styl b/source/css/_search/algolia.styl
index c76793a..6dab083 100644
--- a/source/css/_search/algolia.styl
+++ b/source/css/_search/algolia.styl
@@ -9,8 +9,9 @@
input
padding: .25rem .7rem
outline: none
- border: 2px solid $light-blue
+ border: 2px solid $search-color
border-radius: 2rem
+ background: $search-bg
font-size: 14px
.ais-hits--item.algolia-hit-item
@@ -19,7 +20,7 @@
&:hover
&:before
- border-color: $ruby
+ border-color: $theme-button-hover-color
&:before
$w = .3rem
@@ -28,9 +29,9 @@
left: 0
width: w = $w
height: h = w
- border: .5 * w solid $light-blue
+ border: .5 * w solid $search-color
border-radius: w
- background: $white
+ background: transparent
content: ''
line-height: h
transition: all .2s ease-in-out
@@ -38,12 +39,11 @@
a
display: block
color: $font-black
- text-decoration: none
font-size: 14px
cursor: pointer
&:hover
- color: $light-blue
+ color: $search-color
.ais-pagination.pagination
margin: .8rem 0 0
@@ -63,9 +63,8 @@
.ais-pagination--item.current
a
- background: $cyan
- color: $white
- text-decoration: none
+ background: $theme-paginator-color
+ color: #eee
cursor: default
.algolia-logo
diff --git a/source/css/_search/index.styl b/source/css/_search/index.styl
index 0d03253..bf3794e 100644
--- a/source/css/_search/index.styl
+++ b/source/css/_search/index.styl
@@ -7,26 +7,27 @@
margin-left: -15rem
padding: 1rem
width: 30rem
- background: $white
+ background: $search-bg
hr
margin: 1rem auto
span.search-close-button
position: absolute
- top: .5rem
- right: .5rem
+ top: .8rem
+ right: 1rem
color: $grey
+ font-size: 1rem
line-height: 1
cursor: pointer
transition: color .2s ease-in-out
&:hover
- color: $light-blue
+ color: $search-color
&__title
padding: 0 0 .7rem
- color: $light-blue
+ color: $search-color
font-size: 1rem
line-height: 1
@@ -38,9 +39,15 @@
left: 0
z-index: 1000
display: none
- background: rgba(0, 0, 0, .6)
+ background: rgba($dark-black, .6)
@media screen and (max-width: $sm)
.search-dialog
- margin-left: -45%
- width: 90%
+ top: 0
+ left: 0
+ margin: 0
+ width: 100%
+ height: 100%
+
+ .search-result-list
+ max-height: 100% !important
diff --git a/source/css/_search/local-search.styl b/source/css/_search/local-search.styl
index 94c8168..e1861f9 100644
--- a/source/css/_search/local-search.styl
+++ b/source/css/_search/local-search.styl
@@ -10,9 +10,11 @@
padding: .25rem .7rem
width: 100%
outline: none
- border: 2px solid $light-blue
+ border: 2px solid $search-color
border-radius: 2rem
+ background: $search-bg
font-size: 14px
+ -webkit-appearance: none
.local-search__hit-item
position: relative
@@ -20,7 +22,7 @@
&:hover
&:before
- border-color: $ruby
+ border-color: $theme-button-hover-color
&:before
$w = .3rem
@@ -29,9 +31,9 @@
left: 0
width: w = $w
height: h = w
- border: .5 * w solid $light-blue
+ border: .5 * w solid $search-color
border-radius: w
- background: $white
+ background: transparent
content: ''
line-height: h
transition: all .2s ease-in-out
@@ -39,12 +41,11 @@
a
display: block
color: $font-black
- text-decoration: none
font-size: 14px
cursor: pointer
&:hover
- color: $light-blue
+ color: $search-color
.local-search-stats__hr
display: none !important
diff --git a/source/css/_third-party/jquery.fancybox.min.css b/source/css/_third-party/jquery.fancybox.min.css
deleted file mode 100644
index ab39c7a..0000000
--- a/source/css/_third-party/jquery.fancybox.min.css
+++ /dev/null
@@ -1 +0,0 @@
-@charset "UTF-8";.fancybox-enabled{overflow:hidden}.fancybox-enabled body{overflow:visible;height:100%}.fancybox-is-hidden{position:absolute;top:-9999px;left:-9999px;visibility:hidden}.fancybox-container{position:fixed;top:0;left:0;width:100%;height:100%;z-index:99993;-webkit-tap-highlight-color:transparent;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-transform:translateZ(0);transform:translateZ(0)}.fancybox-container~.fancybox-container{z-index:99992}.fancybox-bg,.fancybox-inner,.fancybox-outer,.fancybox-stage{position:absolute;top:0;right:0;bottom:0;left:0}.fancybox-outer{overflow-y:auto;-webkit-overflow-scrolling:touch}.fancybox-bg{background:#1e1e1e;opacity:0;transition-duration:inherit;transition-property:opacity;transition-timing-function:cubic-bezier(.47,0,.74,.71)}.fancybox-is-open .fancybox-bg{opacity:.87;transition-timing-function:cubic-bezier(.22,.61,.36,1)}.fancybox-caption-wrap,.fancybox-infobar,.fancybox-toolbar{position:absolute;direction:ltr;z-index:99997;opacity:0;visibility:hidden;transition:opacity .25s,visibility 0s linear .25s;box-sizing:border-box}.fancybox-show-caption .fancybox-caption-wrap,.fancybox-show-infobar .fancybox-infobar,.fancybox-show-toolbar .fancybox-toolbar{opacity:1;visibility:visible;transition:opacity .25s,visibility 0s}.fancybox-infobar{top:0;left:50%;margin-left:-79px}.fancybox-infobar__body{display:inline-block;width:70px;line-height:44px;font-size:13px;font-family:Helvetica Neue,Helvetica,Arial,sans-serif;text-align:center;color:#ddd;background-color:rgba(30,30,30,.7);pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;-webkit-font-smoothing:subpixel-antialiased}.fancybox-toolbar{top:0;right:0}.fancybox-stage{overflow:hidden;direction:ltr;z-index:99994;-webkit-transform:translateZ(0)}.fancybox-slide{position:absolute;top:0;left:0;width:100%;height:100%;margin:0;padding:0;overflow:auto;outline:none;white-space:normal;box-sizing:border-box;text-align:center;z-index:99994;-webkit-overflow-scrolling:touch;display:none;-webkit-backface-visibility:hidden;backface-visibility:hidden;transition-property:opacity,-webkit-transform;transition-property:transform,opacity;transition-property:transform,opacity,-webkit-transform;-webkit-transform-style:preserve-3d;transform-style:preserve-3d}.fancybox-slide:before{content:"";display:inline-block;vertical-align:middle;height:100%;width:0}.fancybox-is-sliding .fancybox-slide,.fancybox-slide--current,.fancybox-slide--next,.fancybox-slide--previous{display:block}.fancybox-slide--image{overflow:visible}.fancybox-slide--image:before{display:none}.fancybox-slide--video .fancybox-content,.fancybox-slide--video iframe{background:#000}.fancybox-slide--map .fancybox-content,.fancybox-slide--map iframe{background:#e5e3df}.fancybox-slide--next{z-index:99995}.fancybox-slide>*{display:inline-block;position:relative;padding:24px;margin:44px 0;border-width:0;vertical-align:middle;text-align:left;background-color:#fff;overflow:auto;box-sizing:border-box}.fancybox-slide .fancybox-image-wrap{position:absolute;top:0;left:0;margin:0;padding:0;border:0;z-index:99995;background:transparent;cursor:default;overflow:visible;-webkit-transform-origin:top left;transform-origin:top left;background-size:100% 100%;background-repeat:no-repeat;-webkit-backface-visibility:hidden;backface-visibility:hidden}.fancybox-can-zoomOut .fancybox-image-wrap{cursor:zoom-out}.fancybox-can-zoomIn .fancybox-image-wrap{cursor:zoom-in}.fancybox-can-drag .fancybox-image-wrap{cursor:-webkit-grab;cursor:grab}.fancybox-is-dragging .fancybox-image-wrap{cursor:-webkit-grabbing;cursor:grabbing}.fancybox-image,.fancybox-spaceball{position:absolute;top:0;left:0;width:100%;height:100%;margin:0;padding:0;border:0;max-width:none;max-height:none}.fancybox-spaceball{z-index:1}.fancybox-slide--iframe .fancybox-content{padding:0;width:80%;height:80%;max-width:calc(100% - 100px);max-height:calc(100% - 88px);overflow:visible;background:#fff}.fancybox-iframe{display:block;padding:0;border:0;height:100%}.fancybox-error,.fancybox-iframe{margin:0;width:100%;background:#fff}.fancybox-error{padding:40px;max-width:380px;cursor:default}.fancybox-error p{margin:0;padding:0;color:#444;font:16px/20px Helvetica Neue,Helvetica,Arial,sans-serif}.fancybox-close-small{position:absolute;top:0;right:0;width:44px;height:44px;padding:0;margin:0;border:0;border-radius:0;outline:none;background:transparent;z-index:10;cursor:pointer}.fancybox-close-small:after{content:"×";position:absolute;top:5px;right:5px;width:30px;height:30px;font:20px/30px Arial,Helvetica Neue,Helvetica,sans-serif;color:#888;font-weight:300;text-align:center;border-radius:50%;border-width:0;background:#fff;transition:background .25s;box-sizing:border-box;z-index:2}.fancybox-close-small:focus:after{outline:1px dotted #888}.fancybox-close-small:hover:after{color:#555;background:#eee}.fancybox-slide--iframe .fancybox-close-small{top:0;right:-44px}.fancybox-slide--iframe .fancybox-close-small:after{background:transparent;font-size:35px;color:#aaa}.fancybox-slide--iframe .fancybox-close-small:hover:after{color:#fff}.fancybox-caption-wrap{bottom:0;left:0;right:0;padding:60px 30px 0;background:linear-gradient(180deg,transparent 0,rgba(0,0,0,.1) 20%,rgba(0,0,0,.2) 40%,rgba(0,0,0,.6) 80%,rgba(0,0,0,.8));pointer-events:none}.fancybox-caption{padding:30px 0;border-top:1px solid hsla(0,0%,100%,.4);font-size:14px;font-family:Helvetica Neue,Helvetica,Arial,sans-serif;color:#fff;line-height:20px;-webkit-text-size-adjust:none}.fancybox-caption a,.fancybox-caption button,.fancybox-caption select{pointer-events:all}.fancybox-caption a{color:#fff;text-decoration:underline}.fancybox-button{display:inline-block;position:relative;margin:0;padding:0;border:0;width:44px;height:44px;line-height:44px;text-align:center;background:transparent;color:#ddd;border-radius:0;cursor:pointer;vertical-align:top;outline:none}.fancybox-button[disabled]{cursor:default;pointer-events:none}.fancybox-button,.fancybox-infobar__body{background:rgba(30,30,30,.6)}.fancybox-button:hover:not([disabled]){color:#fff;background:rgba(0,0,0,.8)}.fancybox-button:after,.fancybox-button:before{content:"";pointer-events:none;position:absolute;background-color:currentColor;color:currentColor;opacity:.9;box-sizing:border-box;display:inline-block}.fancybox-button[disabled]:after,.fancybox-button[disabled]:before{opacity:.3}.fancybox-button--left:after,.fancybox-button--right:after{top:18px;width:6px;height:6px;background:transparent;border-top:2px solid currentColor;border-right:2px solid currentColor}.fancybox-button--left:after{left:20px;-webkit-transform:rotate(-135deg);transform:rotate(-135deg)}.fancybox-button--right:after{right:20px;-webkit-transform:rotate(45deg);transform:rotate(45deg)}.fancybox-button--left{border-bottom-left-radius:5px}.fancybox-button--right{border-bottom-right-radius:5px}.fancybox-button--close:after,.fancybox-button--close:before{content:"";display:inline-block;position:absolute;height:2px;width:16px;top:calc(50% - 1px);left:calc(50% - 8px)}.fancybox-button--close:before{-webkit-transform:rotate(45deg);transform:rotate(45deg)}.fancybox-button--close:after{-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}.fancybox-arrow{position:absolute;top:50%;margin:-50px 0 0;height:100px;width:54px;padding:0;border:0;outline:none;background:none;cursor:pointer;z-index:99995;opacity:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;transition:opacity .25s}.fancybox-arrow:after{content:"";position:absolute;top:28px;width:44px;height:44px;background-color:rgba(30,30,30,.8);background-image:url(data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjRkZGRkZGIiBoZWlnaHQ9IjQ4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSI0OCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4gICAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIvPiAgICA8cGF0aCBkPSJNMTIgNGwtMS40MSAxLjQxTDE2LjE3IDExSDR2MmgxMi4xN2wtNS41OCA1LjU5TDEyIDIwbDgtOHoiLz48L3N2Zz4=);background-repeat:no-repeat;background-position:50%;background-size:24px 24px}.fancybox-arrow--right{right:0}.fancybox-arrow--left{left:0;-webkit-transform:scaleX(-1);transform:scaleX(-1)}.fancybox-arrow--left:after,.fancybox-arrow--right:after{left:0}.fancybox-show-nav .fancybox-arrow{opacity:.6}.fancybox-show-nav .fancybox-arrow[disabled]{opacity:.3}.fancybox-loading{border:6px solid hsla(0,0%,39%,.4);border-top:6px solid hsla(0,0%,100%,.6);border-radius:100%;height:50px;width:50px;-webkit-animation:a .8s infinite linear;animation:a .8s infinite linear;background:transparent;position:absolute;top:50%;left:50%;margin-top:-25px;margin-left:-25px;z-index:99999}@-webkit-keyframes a{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes a{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fancybox-animated{transition-timing-function:cubic-bezier(0,0,.25,1)}.fancybox-fx-slide.fancybox-slide--previous{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0);opacity:0}.fancybox-fx-slide.fancybox-slide--next{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0);opacity:0}.fancybox-fx-slide.fancybox-slide--current{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}.fancybox-fx-fade.fancybox-slide--next,.fancybox-fx-fade.fancybox-slide--previous{opacity:0;transition-timing-function:cubic-bezier(.19,1,.22,1)}.fancybox-fx-fade.fancybox-slide--current{opacity:1}.fancybox-fx-zoom-in-out.fancybox-slide--previous{-webkit-transform:scale3d(1.5,1.5,1.5);transform:scale3d(1.5,1.5,1.5);opacity:0}.fancybox-fx-zoom-in-out.fancybox-slide--next{-webkit-transform:scale3d(.5,.5,.5);transform:scale3d(.5,.5,.5);opacity:0}.fancybox-fx-zoom-in-out.fancybox-slide--current{-webkit-transform:scaleX(1);transform:scaleX(1);opacity:1}.fancybox-fx-rotate.fancybox-slide--previous{-webkit-transform:rotate(-1turn);transform:rotate(-1turn);opacity:0}.fancybox-fx-rotate.fancybox-slide--next{-webkit-transform:rotate(1turn);transform:rotate(1turn);opacity:0}.fancybox-fx-rotate.fancybox-slide--current{-webkit-transform:rotate(0deg);transform:rotate(0deg);opacity:1}.fancybox-fx-circular.fancybox-slide--previous{-webkit-transform:scale3d(0,0,0) translate3d(-100%,0,0);transform:scale3d(0,0,0) translate3d(-100%,0,0);opacity:0}.fancybox-fx-circular.fancybox-slide--next{-webkit-transform:scale3d(0,0,0) translate3d(100%,0,0);transform:scale3d(0,0,0) translate3d(100%,0,0);opacity:0}.fancybox-fx-circular.fancybox-slide--current{-webkit-transform:scaleX(1) translateZ(0);transform:scaleX(1) translateZ(0);opacity:1}.fancybox-fx-tube.fancybox-slide--previous{-webkit-transform:translate3d(-100%,0,0) scale(.1) skew(-10deg);transform:translate3d(-100%,0,0) scale(.1) skew(-10deg)}.fancybox-fx-tube.fancybox-slide--next{-webkit-transform:translate3d(100%,0,0) scale(.1) skew(10deg);transform:translate3d(100%,0,0) scale(.1) skew(10deg)}.fancybox-fx-tube.fancybox-slide--current{-webkit-transform:translateZ(0) scale(1);transform:translateZ(0) scale(1)}@media (max-width:800px){.fancybox-infobar{left:0;margin-left:0}.fancybox-button--left,.fancybox-button--right{display:none!important}.fancybox-caption{padding:20px 0;margin:0}}.fancybox-button--fullscreen:before{width:15px;height:11px;left:calc(50% - 7px);top:calc(50% - 6px);border:2px solid;background:none}.fancybox-button--pause:before,.fancybox-button--play:before{top:calc(50% - 6px);left:calc(50% - 4px);background:transparent}.fancybox-button--play:before{width:0;height:0;border-top:6px inset transparent;border-bottom:6px inset transparent;border-left:10px solid;border-radius:1px}.fancybox-button--pause:before{width:7px;height:11px;border-style:solid;border-width:0 2px}.fancybox-button--thumbs,.fancybox-thumbs{display:none}@media (min-width:800px){.fancybox-button--thumbs{display:inline-block}.fancybox-button--thumbs span{font-size:23px}.fancybox-button--thumbs:before{width:3px;height:3px;top:calc(50% - 2px);left:calc(50% - 2px);box-shadow:0 -4px 0,-4px -4px 0,4px -4px 0,inset 0 0 0 32px,-4px 0 0,4px 0 0,0 4px 0,-4px 4px 0,4px 4px 0}.fancybox-thumbs{position:absolute;top:0;right:0;bottom:0;left:auto;width:220px;margin:0;padding:5px 5px 0 0;background:#fff;word-break:normal;-webkit-tap-highlight-color:transparent;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar;box-sizing:border-box;z-index:99995}.fancybox-show-thumbs .fancybox-thumbs{display:block}.fancybox-show-thumbs .fancybox-inner{right:220px}.fancybox-thumbs>ul{list-style:none;position:absolute;position:relative;width:100%;height:100%;margin:0;padding:0;overflow-x:hidden;overflow-y:auto;font-size:0}.fancybox-thumbs>ul>li{float:left;overflow:hidden;max-width:50%;padding:0;margin:0;width:105px;height:75px;position:relative;cursor:pointer;outline:none;border:5px solid transparent;border-top-width:0;border-right-width:0;-webkit-tap-highlight-color:transparent;-webkit-backface-visibility:hidden;backface-visibility:hidden;box-sizing:border-box}li.fancybox-thumbs-loading{background:rgba(0,0,0,.1)}.fancybox-thumbs>ul>li>img{position:absolute;top:0;left:0;min-width:100%;min-height:100%;max-width:none;max-height:none;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.fancybox-thumbs>ul>li:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:2px;border:4px solid #4ea7f9;z-index:99991;opacity:0;transition:all .2s cubic-bezier(.25,.46,.45,.94)}.fancybox-thumbs>ul>li.fancybox-thumbs-active:before{opacity:1}}
\ No newline at end of file
diff --git a/source/css/index.styl b/source/css/index.styl
index 732de73..a7df530 100644
--- a/source/css/index.styl
+++ b/source/css/index.styl
@@ -5,6 +5,7 @@
@import '_global'
@import '_highlight/highlight'
@import '_layout/*'
+@import '_mode/*'
// search
if hexo-config('algolia_search.enable')
diff --git a/source/css/var.styl b/source/css/var.styl
index 3476956..84d3429 100644
--- a/source/css/var.styl
+++ b/source/css/var.styl
@@ -1,184 +1,144 @@
-// Theme Global Color
-$theme-color = #49B1F5
-$theme-paginator-color = #00c4b6
-$theme-button-hover-color = #FF7242
-$theme-text-selection-color = #00c4b6
-$theme-meta-color = #858585
-$theme-link-color = #99a9bf
-$theme-hr-color = #A4D8FA
-$theme-read-mode-bg-color = #FAF9DE
-$inline-code-color = #F47466
-$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
-$site-name-font = "Titillium Web", Lato,PingFang SC, Hiragino Sans GB, "Microsoft JhengHei", "Microsoft YaHei", Helvetica Neue, Helvetica, Arial, sans-serif
-//hr icon
-$hr-icon = '\f0c4'
-$hr-icon-top = -10px
-$title-prefix-icon = '\f0c1'
-$title-prefix-icon-color = #F47466
+// color
+$bright-blue = #49B1F5
+$strong-cyan = #00c4b6
+$light-orange = #FF7242
+$light-red = #F47466
-if hexo-config("theme_color") && hexo-config("theme_color.enable")
- $theme-color = convert(hexo-config("theme_color.main")) || #49B1F5
- $theme-paginator-color = convert(hexo-config("theme_color.paginator")) || #00c4b6
- $theme-button-hover-color = convert(hexo-config("theme_color.button_hover")) || #FF7242
- $theme-text-selection-color = convert(hexo-config("theme_color.text_selection")) || #00c4b6
- $theme-link-color = convert(hexo-config("theme_color.link_color")) || #99a9bf
- $theme-meta-color = convert(hexo-config("theme_color.meta_color")) || #858585
- $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
- $inline-code-color = convert(hexo-config("theme_color.inline-code-color")) || #F47466
+$themeColorEnable = hexo-config('theme_color') && hexo-config('theme_color.enable')
+$theme-color = $themeColorEnable ? convert(hexo-config('theme_color.main')) : $bright-blue
+$theme-paginator-color = $themeColorEnable ? convert(hexo-config('theme_color.paginator')) : $strong-cyan
+$theme-button-hover-color = $themeColorEnable ? convert(hexo-config('theme_color.button_hover')) : $light-orange
+$theme-text-selection-color = $themeColorEnable ? convert(hexo-config('theme_color.text_selection')) : $strong-cyan
+$theme-link-color = $themeColorEnable ? convert(hexo-config('theme_color.link_color')) : $bright-blue
+$theme-hr-color = $themeColorEnable ? convert(hexo-config('theme_color.hr_color')) : $bright-blue
+$code-foreground = $themeColorEnable ? convert(hexo-config('theme_color.code_foreground')) : $light-red
+$code-background = $themeColorEnable ? convert(hexo-config('theme_color.code_background')) : rgba(27, 31, 35, .05)
+$theme-toc-color = $themeColorEnable ? convert(hexo-config('theme_color.toc_color')) : $strong-cyan
-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'
+// font
+$fontEnable = hexo-config('font') && hexo-config('font.enable')
+$font-family = $fontEnable ? 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 = $fontEnable ? convert(hexo-config('font.code-font')) : consolas, Menlo, "PingFang SC", "Microsoft YaHei", monospace, Helvetica Neue For Number
+$site-name-font = convert(hexo-config('blog_title_font.font-family')) || '"Titillium Web",Lato,PingFang SC, Hiragino Sans GB, "Microsoft JhengHei", "Microsoft YaHei", Helvetica Neue, Helvetica, Arial, sans-serif'
-if hexo-config("blog_title_font.font-family")
- $site-name-font = convert(hexo-config("blog_title_font.font-family")) || '"Titillium Web",Lato,PingFang SC, Hiragino Sans GB, "Microsoft JhengHei", "Microsoft YaHei", Helvetica Neue, Helvetica, Arial, sans-serif'
-
-
-if hexo-config("hr") && hexo-config("hr.enable")
- $hr-icon = hexo-config("hr.icon") || '\f0c4'
- $hr-icon-top = convert(hexo-config("hr.icon-top")) || -10px
-
-if hexo-config("post_beautify.enable")
- $title-prefix-icon = hexo-config("post_beautify.title-prefix-icon") || '\f0c1'
- $title-prefix-icon-color= convert(hexo-config("post_beautify.title-prefix-icon-color")) || #F47466
+//hr
+$hrEnable = hexo-config('hr') && hexo-config('hr.enable')
+$hr-icon = $hrEnable ? hexo-config('hr.icon') : '\f0c4'
+$hr-icon-top = $hrEnable ? convert(hexo-config('hr.icon-top')) : -10px
+//page beatutify
+$beautifyEnable = hexo-config('beautify.enable')
+$title-prefix-icon = $beautifyEnable ? hexo-config('beautify.title-prefix-icon') : '\f0c1'
+$title-prefix-icon-color = $beautifyEnable ? convert(hexo-config('beautify.title-prefix-icon-color')) : $light-red
// Global Variables
$font-size = 14px
$font-color = #1F2D3D
+$button-color = #fff
$rem = 20px
-$font-family = $font-family
-$code-font = $code-font
-$site-name-font = $site-name-font
$text-line-height = 2
$sm = 768px
$bg = 1024px
-$md = 1300px
-$lg = 1450px
+$web-bg = convert(hexo-config('background'))
+$index_top_img_height = convert(hexo-config('index_top_img_height')) || 100vh
+$index_site_info_top = convert(hexo-config('index_site_info_top')) || 43%
+// Global color & SVG
+$light-blue = $theme-color
+$dark-black = #000000
+$light-grey = #EEEEEE
+$grey = #858585
+$white = #FFFFFF
+$whitesmoke = #f5f5f5
+$font-black = #4C4948
+$card-bg = $white
+// code
+$code-font-family = $font-family
+$line-height-code-block = 20px
+$blockquote-color = #6a737d
+$blockquote-padding-color = $themeColorEnable ? convert(hexo-config('theme_color.blockquote_padding_color')) : #49B1F5
+$blockquote-background-color = $themeColorEnable ? alpha(convert(hexo-config('theme_color.blockquote_background_color')),.1) : alpha($blockquote-padding-color,.1)
+// page
+$body-bg = #fff
+$a-link-color = #99a9bf
+$sticky-color = $light-orange
+$theme-meta-color = $themeColorEnable ? convert(hexo-config('theme_color.meta_color')) : #858585
+// sidebar
$sidebar-icon-top = 20px
$sidebar-icon-left = $sidebar-icon-top - 4px
$sidebar-icon-size = 16px
-$web-bg = convert(hexo-config("background"))
-$index_top_img_height = convert(hexo-config('index_top_img_height')) || 100vh
-// Global color & SVG
-$pale-blue = $theme-hr-color
-$light-blue = $theme-color
-$blue = #1B9EF3
-$dark-blue = #0790E8
-$orange = #F1BE48
-$pale-green = #B4E1C1
-$light-green = #69C282
-$green = #44B363
-$dark-green = #379F54
-$pale-cyan = #D1F4F2
-$light-cyan = #8CE4DE
-$cyan = $theme-paginator-color
-$pale-red = #F9b9b3
-$light-red = #F47466
-$red = #F15140
-$dark-red = #E63E2C
-$ruby = $theme-button-hover-color
-$light-black = #3B3A3A
-$black = #2E2E2E
-$dark-black = #000000
-$pale-grey = #F7F7F7
-$light-grey = #EEEEEE
-$grey = $theme-meta-color
-$pale-yellow = $theme-read-mode-bg-color
-$white = #FFFFFF
-$whitesmoke = #f5f5f5;
-$dark-white = #F9F9F9
-$font-black = #4C4948
-$selection = $theme-text-selection-color
-
-// code
-$code-font-size = $font-size
-$code-font-family = $font-family
-$code-foreground = $inline-code-color
-$code-background = rgba(27, 31, 35, 0.05)
-$line-height-code-block = 20px
-$blockquote-color = #6a737d
-$blockquote-padding-color = $theme-color
-$blockquote-background-color = rgba(73, 177, 245,0.1)
-// page
-$content-width = 800px
-$content-large-width = 1000px
-$a-link-color = $theme-link-color
-$a-hover-color = #82AAFF
-$img-border-color = #eaeefb
-// sidebar
$sidebar-width = 300px
$sidebar-background = #f6f8fa
+$sidebar-active-color = #fff
+$mobile-sidebar-width = 250px
+// table
+$table-thead-bg = #99a9bf
+// reward
+$reward-pop-up-bg = #f5f5f5
+$reward-pop-up-color = #858585
+// search
+$search-bg = #f6f8fa
+$search-color = $theme-color
+//gallery
+$gallery-color = #fff
+// tag-hide
+$tag-hide-bg = $theme-color
+
+
// Note colors
// --------------------------------------------------
-hexo-config('note.light_bg_offset') is a 'unit' ? ($lbg = unit(hexo-config('note.light_bg_offset'),"%")) : ($lbg = 0);
-
+hexo-config('note.light_bg_offset') is a 'unit' ? ($lbg = unit(hexo-config('note.light_bg_offset'), '%')) : ($lbg = 0)
// Default
-$note-default-border = #777;
-$note-default-bg = lighten(spin($note-default-border, 0), 94% + $lbg);
-$note-default-text = $note-default-border;
-$note-default-icon = "\f0a9";
-
-$note-modern-default-border = #e1e1e1;
-$note-modern-default-bg = lighten(spin($note-modern-default-border, 10), 60% + ($lbg * 4));
-$note-modern-default-text = #666;
-$note-modern-default-hover = darken(spin($note-modern-default-text, -10), 32%);
-
+$note-default-border = #777
+$note-default-bg = lighten(spin($note-default-border, 0), 94% + $lbg)
+$note-default-text = $note-default-border
+$note-default-icon = '\f0a9'
+$note-modern-default-border = #e1e1e1
+$note-modern-default-bg = lighten(spin($note-modern-default-border, 10), 60% + ($lbg * 4))
+$note-modern-default-text = #666
+$note-modern-default-hover = darken(spin($note-modern-default-text, -10), 32%)
// Primary
-$note-primary-border = #6f42c1;
-$note-primary-bg = lighten(spin($note-primary-border, 10), 92% + $lbg);
-$note-primary-text = $note-primary-border;
-$note-primary-icon = "\f055";
-
-$note-modern-primary-border = #e1c2ff;
-$note-modern-primary-bg = lighten(spin($note-modern-primary-border, 10), 40% + ($lbg * 4));
-$note-modern-primary-text = #6f42c1;
-$note-modern-primary-hover = darken(spin($note-modern-primary-text, -10), 22%);
-
+$note-primary-border = #6f42c1
+$note-primary-bg = lighten(spin($note-primary-border, 10), 92% + $lbg)
+$note-primary-text = $note-primary-border
+$note-primary-icon = '\f055'
+$note-modern-primary-border = #e1c2ff
+$note-modern-primary-bg = lighten(spin($note-modern-primary-border, 10), 40% + ($lbg * 4))
+$note-modern-primary-text = #6f42c1
+$note-modern-primary-hover = darken(spin($note-modern-primary-text, -10), 22%)
// Info
-$note-info-border = #428bca;
-$note-info-bg = lighten(spin($note-info-border, -10), 91% + $lbg);
-$note-info-text = $note-info-border;
-$note-info-icon = "\f05a";
-
-$note-modern-info-border = #b3e5ef;
-$note-modern-info-bg = lighten(spin($note-modern-info-border, 10), 50% + ($lbg * 4));
-$note-modern-info-text = #31708f;
-$note-modern-info-hover = darken(spin($note-modern-info-text, -10), 32%);
-
+$note-info-border = #428bca
+$note-info-bg = lighten(spin($note-info-border, -10), 91% + $lbg)
+$note-info-text = $note-info-border
+$note-info-icon = '\f05a'
+$note-modern-info-border = #b3e5ef
+$note-modern-info-bg = lighten(spin($note-modern-info-border, 10), 50% + ($lbg * 4))
+$note-modern-info-text = #31708f
+$note-modern-info-hover = darken(spin($note-modern-info-text, -10), 32%)
// Success
-$note-success-border = #5cb85c;
-$note-success-bg = lighten(spin($note-success-border, 10), 90% + $lbg);
-$note-success-text = $note-success-border;
-$note-success-icon = "\f058";
-
-$note-modern-success-border = #d0e6be;
-$note-modern-success-bg = lighten(spin($note-modern-success-border, 10), 40% + ($lbg * 4));
-$note-modern-success-text = #3c763d;
-$note-modern-success-hover = darken(spin($note-modern-success-text, -10), 27%);
-
+$note-success-border = #5cb85c
+$note-success-bg = lighten(spin($note-success-border, 10), 90% + $lbg)
+$note-success-text = $note-success-border
+$note-success-icon = '\f058'
+$note-modern-success-border = #d0e6be
+$note-modern-success-bg = lighten(spin($note-modern-success-border, 10), 40% + ($lbg * 4))
+$note-modern-success-text = #3c763d
+$note-modern-success-hover = darken(spin($note-modern-success-text, -10), 27%)
// Warning
-$note-warning-border = #f0ad4e;
-$note-warning-bg = lighten(spin($note-warning-border, 10), 88% + $lbg);
-$note-warning-text = $note-warning-border;
-$note-warning-icon = "\f06a";
-
-$note-modern-warning-border = #fae4cd;
-$note-modern-warning-bg = lighten(spin($note-modern-warning-border, 10), 43% + ($lbg * 4));
-$note-modern-warning-text = #8a6d3b;
-$note-modern-warning-hover = darken(spin($note-modern-warning-text, -10), 18%);
-
+$note-warning-border = #f0ad4e
+$note-warning-bg = lighten(spin($note-warning-border, 10), 88% + $lbg)
+$note-warning-text = $note-warning-border
+$note-warning-icon = '\f06a'
+$note-modern-warning-border = #fae4cd
+$note-modern-warning-bg = lighten(spin($note-modern-warning-border, 10), 43% + ($lbg * 4))
+$note-modern-warning-text = #8a6d3b
+$note-modern-warning-hover = darken(spin($note-modern-warning-text, -10), 18%)
// Danger
-$note-danger-border = #d9534f;
-$note-danger-bg = lighten(spin($note-danger-border, -10), 92% + $lbg);
-$note-danger-text = $note-danger-border;
-$note-danger-icon = "\f056";
-
-$note-modern-danger-border = #ebcdd2;
-$note-modern-danger-bg = lighten(spin($note-modern-danger-border, 10), 35% + ($lbg * 4));
-$note-modern-danger-text = #a94442;
-$note-modern-danger-hover = darken(spin($note-modern-danger-text, -10), 22%);
-
+$note-danger-border = #d9534f
+$note-danger-bg = lighten(spin($note-danger-border, -10), 92% + $lbg)
+$note-danger-text = $note-danger-border
+$note-danger-icon = '\f056'
+$note-modern-danger-border = #ebcdd2
+$note-modern-danger-bg = lighten(spin($note-modern-danger-border, 10), 35% + ($lbg * 4))
+$note-modern-danger-text = #a94442
+$note-modern-danger-hover = darken(spin($note-modern-danger-text, -10), 22%)
diff --git a/source/img/404.jpg b/source/img/404.jpg
index eee9ac3..4bab3c3 100644
Binary files a/source/img/404.jpg and b/source/img/404.jpg differ
diff --git a/source/img/index.jpg b/source/img/index.jpg
new file mode 100644
index 0000000..6e18f89
Binary files /dev/null and b/source/img/index.jpg differ
diff --git a/source/img/post.jpg b/source/img/post.jpg
new file mode 100644
index 0000000..49a812c
Binary files /dev/null and b/source/img/post.jpg differ
diff --git a/source/js/main.js b/source/js/main.js
index 1971c5c..67b359b 100644
--- a/source/js/main.js
+++ b/source/js/main.js
@@ -1,6 +1,10 @@
$(function () {
const isSnackbar = GLOBAL_CONFIG.Snackbar !== undefined
const isTocContent = $('#sidebar .sidebar-toc__content').children().length > 0
+ const $pageHead = $('#page-header')
+ const $rightside = $('#rightside')
+ const $body = $('body')
+
/**
* 當menu過多時,自動適配,避免UI錯亂
*/
@@ -8,8 +12,9 @@ $(function () {
const blogNameWidth = $('#blog_name').width()
var mw = 0
- for (var i = 0; i < $('#page-header .menus_item').length; i++) {
- mw = mw + $('#page-header .menus_item').eq(i).outerWidth()
+ var $menusItem = $pageHead.find('.menus_item')
+ for (var i = 0; i < $menusItem.length; i++) {
+ mw = mw + $menusItem.eq(i).outerWidth()
}
/**
@@ -20,73 +25,68 @@ $(function () {
function isAdjust (n) {
var t
if (n === 1) {
- t = blogNameWidth + searchWidth + mw > $('#page-header').width() - 300
+ t = blogNameWidth + searchWidth + mw > $pageHead.width() - 300
} else if (n === 2) {
- t = blogNameWidth + searchWidth + mw > $('#page-header').width()
+ t = blogNameWidth + searchWidth + mw > $pageHead.width()
}
- if (t) {
- headerAdjust()
- } else {
- headerAdjustBack()
- }
+ if (t) headerAdjust()
+ else headerAdjustBack()
}
// 初始化header
- isAdjust(2)
- $('#page-header').css({ opacity: '1', animation: 'headerNoOpacity 1s' })
+ function initAjust () {
+ if (window.innerWidth < 768) headerAdjust()
+ else isAdjust(2)
+ }
+ initAjust()
function headerAdjust () {
- $('#page-header .toggle-menu').addClass('is_visible')
- $('#page-header .menus,.search span').addClass('is_invisible')
+ $pageHead.find('.toggle-menu').addClass('is_visible')
+ $pageHead.find('.menus').addClass('is_invisible')
+ $pageHead.find('#search_button span').addClass('is_invisible')
}
function headerAdjustBack () {
- $('#page-header .toggle-menu').removeClass('is_visible')
- $('#page-header .menus,.search span').removeClass('is_invisible')
+ $pageHead.find('.toggle-menu').removeClass('is_visible')
+ $pageHead.find('.menus').removeClass('is_invisible')
+ $pageHead.find('#search_button span').removeClass('is_invisible')
}
- $(window).bind('resize', function () {
- if (window.innerWidth > 768) {
- isAdjust(2)
- } else {
- headerAdjust()
+ $(window).on('resize', function () {
+ if (!$pageHead.hasClass('open-sidebar')) {
+ initAjust()
}
})
/**
- * pc時 設置主頁top_img 為 fixed
+ * windows時 設置主頁top_img 為 fixed
*/
- if (GLOBAL_CONFIG.isHome) {
- if (/Android|webOS|iPhone|iPod|iPad|BlackBerry/i.test(navigator.userAgent)) {} else {
- $('.full_page').css('background-attachment', 'fixed')
+ if (GLOBAL_CONFIG_SITE.isHome) {
+ var isSafari = /Safari/.test(navigator.userAgent) && !/Chrome/.test(navigator.userAgent)
+ if (!isSafari && isDesktop()) {
+ $('#nav').css('background-attachment', 'fixed')
}
}
/**
* 進入post頁sidebar處理
*/
- if (GLOBAL_CONFIG.isPost) {
- // sidebar 自動打開
- if ($('#sidebar').hasClass('auto_open') && isTocContent) {
- $('#toggle-sidebar').addClass('on')
- setTimeout(function () {
- $('#toggle-sidebar').addClass('on')
- openSidebar()
- }, 400)
- isAdjust(1)
- }
- // pc隱藏
- if (isTocContent) {
- $('#toggle-sidebar').css('opacity', '1')
- } else {
- $('#sidebar,#toggle-sidebar').css('display', 'none')
- }
- // mobile隱藏
- if ($('#mobile-sidebar-toc .sidebar-toc__content').children().length === 0) {
- $('#mobile-sidebar-toc,#mobile-toc-button').css('display', 'none')
- }
+ var isSidebarOpen = $('#toggle-sidebar').hasClass('on') && isTocContent
+ var isPcSidebarOpen = false
+ if (window.innerWidth > 1024 && isSidebarOpen) {
+ setTimeout(function () {
+ openSidebar()
+ }, 400)
+ }
+
+ // 當toc爲空時,隱藏toc按鈕
+ if (isTocContent) {
+ $('#toggle-sidebar').css('opacity', '1')
+ } else {
+ $('#toggle-sidebar').css('display', 'none')
+ $('#mobile-toc-button').css('display', 'none')
}
/**
@@ -94,52 +94,145 @@ $(function () {
*/
function closeSidebar () {
- $('#page-header').removeClass('open-sidebar')
- $('body').animate({
+ isPcSidebarOpen = false
+ $pageHead.removeClass('open-sidebar')
+ $('#sidebar').removeClass('tocOpenPc')
+ $('#body-wrap').animate({
paddingLeft: 0
}, 400)
- $('#sidebar').css('transform', 'translateX(0px)')
+ $('#sidebar').animate({
+ left: '-300px'
+ }, 400)
$('#toggle-sidebar').css({
transform: 'rotateZ(0deg)',
color: '#1F2D3D',
opacity: '1'
})
+ setTimeout(function () {
+ isAdjust(2)
+ }, 400)
}
function openSidebar () {
- $('#page-header').addClass('open-sidebar')
- $('body').animate({
+ isPcSidebarOpen = true
+ $pageHead.addClass('open-sidebar')
+ $('#sidebar').addClass('tocOpenPc')
+ $('#body-wrap').animate({
paddingLeft: 300
}, 400)
- $('#sidebar').css('transform', 'translateX(300px)')
+ $('#sidebar').animate({
+ left: 0
+ }, 400)
$('#toggle-sidebar').css({
transform: 'rotateZ(180deg)',
color: '#99a9bf',
opacity: '1'
})
+ var isAdjustTimeCount = window.setInterval(function () {
+ isAdjust(1)
+ }, 100)
+ setTimeout(function () {
+ clearInterval(isAdjustTimeCount)
+ }, 400)
}
$('#toggle-sidebar').on('click', function () {
- if (!isMobile() && $('#sidebar').is(':visible')) {
- var isOpen = $(this).hasClass('on')
- isOpen ? $(this).removeClass('on') : $(this).addClass('on')
- if (isOpen) {
- closeSidebar()
- setTimeout(function () {
- isAdjust(2)
- }, 500)
- } else {
- isAdjust(1)
- openSidebar()
+ var isOpen = $(this).hasClass('on')
+ isOpen ? $(this).removeClass('on') : $(this).addClass('on')
+ if (isOpen) {
+ closeSidebar()
+ } else {
+ openSidebar()
+ }
+ })
+
+ /**
+ * 手機menu和toc按鈕點擊
+ * 顯示menu和toc的sidebar
+ */
+
+ var $toggleMenu = $('.toggle-menu')
+ var $mobileSidevarMenus = $('#mobile-sidebar-menus')
+ var $mobileTocButton = $('#mobile-toc-button')
+ var $menuMask = $('#menu_mask')
+
+ function openMobileSidebar (name) {
+ sidebarPaddingR()
+ $('body').css('overflow', 'hidden')
+ $menuMask.fadeIn()
+
+ if (name === 'menu') {
+ $toggleMenu.removeClass('close').addClass('open')
+ $mobileSidevarMenus.css('transform', 'translate3d(-100%,0,0)')
+ var $mobileSidevarMenusChild = $mobileSidevarMenus.children()
+ for (i = 0; i <= $mobileSidevarMenusChild.length; i++) {
+ const duration = i / 5 + 0.2
+ $mobileSidevarMenusChild.eq(i).css('animation', 'sidebarItem ' + duration + 's')
}
}
+
+ if (name === 'toc') {
+ $mobileTocButton.removeClass('close').addClass('open')
+ $('#sidebar').addClass('tocOpenMobile')
+ $('#sidebar').css({ transform: 'translate3d(-100%,0,0)', left: '' })
+ }
+ }
+
+ function closeMobileSidebar (name) {
+ $('body').css({ overflow: '', 'padding-right': '' })
+ $menuMask.fadeOut()
+
+ if (name === 'menu') {
+ $toggleMenu.removeClass('open').addClass('close')
+ $mobileSidevarMenus.css('transform', '')
+ $('#mobile-sidebar-menus > div,#mobile-sidebar-menus > hr').css('animation', '')
+ }
+
+ if (name === 'toc') {
+ $mobileTocButton.removeClass('open').addClass('close')
+ $('#sidebar').removeClass('tocOpenMobile')
+ $('#sidebar').css({ transform: '' })
+ }
+ }
+
+ $toggleMenu.on('click', function () {
+ openMobileSidebar('menu')
+ })
+
+ $mobileTocButton.on('click', function () {
+ openMobileSidebar('toc')
+ })
+
+ $menuMask.on('click touchstart', function (e) {
+ if ($toggleMenu.hasClass('open')) {
+ closeMobileSidebar('menu')
+ }
+ if ($mobileTocButton.hasClass('open')) {
+ closeMobileSidebar('toc')
+ }
+ })
+
+ $(window).on('resize', function (e) {
+ if (!$toggleMenu.is(':visible')) {
+ if ($toggleMenu.hasClass('open')) closeMobileSidebar('menu')
+ }
+ })
+
+ const mql = window.matchMedia('(max-width: 1024px)')
+ mql.addListener(function (ev) {
+ if (ev.matches) {
+ if (isPcSidebarOpen === true) closeSidebar()
+ } else {
+ if ($('#toggle-sidebar').hasClass('on') && isTocContent) openSidebar()
+ if ($mobileTocButton.hasClass('open')) closeMobileSidebar('toc')
+ }
})
/**
* 首頁top_img底下的箭頭
*/
- $('.scroll-down').on('click', function () {
- scrollTo('#content-outer')
+ $('#scroll_down').on('click', function () {
+ scrollTo('#content-inner')
})
/**
@@ -164,85 +257,139 @@ $(function () {
})
/**
- * 代碼copy
- * copy function
+ * 代碼
*/
-
- function copy (text, ctx) {
- if (document.queryCommandSupported && document.queryCommandSupported('copy')) {
- try {
- document.execCommand('copy') // Security exception may be thrown by some browsers.
- if (isSnackbar) {
- snackbarShow(GLOBAL_CONFIG.copy.success)
- } else {
- $(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) {
- if (isSnackbar) {
- snackbarShow(GLOBAL_CONFIG.copy.success)
- } else {
- $(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 {
- if (isSnackbar) {
- snackbarShow(GLOBAL_CONFIG.copy.noSupport)
- } else {
- $(ctx).prev('.copy-notice').text(GLOBAL_CONFIG.copy.noSupport)
- }
- }
+ const isHighlightCopy = GLOBAL_CONFIG.highlightCopy
+ const isHighlightLang = GLOBAL_CONFIG.highlightLang
+ const isHighlightShrink = GLOBAL_CONFIG.highlightShrink
+ const $figureHighlight = $('figure.highlight')
+ if (isHighlightCopy || isHighlightLang || isHighlightShrink !== 'none') {
+ $figureHighlight.wrap('').before('')
}
- // click events
- $(document).on('click', '.code-area-wrap .fa-clipboard', function () {
- var selection = window.getSelection()
- var range = document.createRange()
- range.selectNodeContents($(this).parent().siblings('figure').find('.code pre')[0])
- selection.removeAllRanges()
- selection.addRange(range)
- var text = selection.toString()
- copy(text, this)
- selection.removeAllRanges()
- })
/**
* 代碼收縮
*/
- $(document).on('click', '.code-area-wrap .code-expand', function () {
- var $figure = $(this).parent().next()
+ const $highlightTools = $('.highlight-tools')
+ if (isHighlightShrink === true) {
+ $highlightTools.append('')
+ } else if (isHighlightShrink === false) {
+ $highlightTools.append('')
+ }
+
+ $(document).on('click', '.highlight-tools >.code-expand', function () {
+ var $table = $(this).parent().next()
if ($(this).hasClass('code-closed')) {
- $figure.slideDown(300)
+ $table.css('display', '')
$(this).removeClass('code-closed')
} else {
- $figure.slideUp(300)
+ $table.css('display', 'none')
$(this).addClass('code-closed')
}
})
+ /**
+ * 代碼語言
+ */
+ if (isHighlightLang) {
+ var langNameIndex, langName
+ $figureHighlight.each(function () {
+ langNameIndex = langName = $(this).attr('class').split(' ')[1]
+ if (langNameIndex === 'plain') langName = 'Code'
+ $(this).prev().append('' + langName + '
')
+ })
+ }
+ /**
+ * 代碼copy
+ * copy function
+ */
+ if (isHighlightCopy) {
+ $highlightTools.append('')
+ var copy = function (text, ctx) {
+ if (document.queryCommandSupported && document.queryCommandSupported('copy')) {
+ try {
+ document.execCommand('copy') // Security exception may be thrown by some browsers.
+ if (isSnackbar) {
+ snackbarShow(GLOBAL_CONFIG.copy.success)
+ } else {
+ $(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) {
+ if (isSnackbar) {
+ snackbarShow(GLOBAL_CONFIG.copy.success)
+ } else {
+ $(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 {
+ if (isSnackbar) {
+ snackbarShow(GLOBAL_CONFIG.copy.noSupport)
+ } else {
+ $(ctx).prev('.copy-notice').text(GLOBAL_CONFIG.copy.noSupport)
+ }
+ }
+ }
+
+ // click events
+ $(document).on('click', '.highlight-tools>.fa-clipboard', function () {
+ var selection = window.getSelection()
+ var range = document.createRange()
+ range.selectNodeContents($(this).parent().next().find('.code pre')[0])
+ selection.removeAllRanges()
+ selection.addRange(range)
+ var text = selection.toString()
+ copy(text, this)
+ selection.removeAllRanges()
+ })
+ }
+
+ /**
+ * justified-gallery 圖庫排版
+ */
+ var $justifiedGallery = $('.justified-gallery')
+ if ($justifiedGallery.length) {
+ var $imgList = $justifiedGallery.find('img')
+ $imgList.unwrap()
+ if ($imgList.length) {
+ $imgList.each(function (i, o) {
+ if ($(o).attr('data-src')) $(o).attr('src', $(o).attr('data-src'))
+ $(o).wrap('')
+ })
+ }
+ $('head').append('')
+ loadScript('https://cdn.jsdelivr.net/npm/justifiedGallery/dist/js/jquery.justifiedGallery.min.js', function () {
+ $justifiedGallery.not($('.hide-content .justified-gallery')).justifiedGallery({
+ rowHeight: 220,
+ margins: 4
+ })
+ })
+ }
+
/**
* fancybox和 mediumZoom
*/
@@ -250,6 +397,18 @@ $(function () {
var isMediumZoom = GLOBAL_CONFIG.medium_zoom
var isFancybox = GLOBAL_CONFIG.fancybox
if (isFancybox) {
+ var images = $('#article-container img:not(.gallery-group-img)').not($('a>img'))
+ images.each(function (i, o) {
+ var lazyloadSrc = $(o).attr('data-src') ? $(o).attr('data-src') : $(o).attr('src')
+ $(o).wrap(
+ ''
+ )
+ })
+
$().fancybox({
selector: '[data-fancybox]',
loop: true,
@@ -258,8 +417,8 @@ $(function () {
buttons: ['slideShow', 'fullScreen', 'thumbs', 'close']
})
} else if (isMediumZoom) {
- const zoom = mediumZoom(document.querySelectorAll(':not(a)>img'))
- zoom.on('open', event => {
+ const zoom = mediumZoom(document.querySelectorAll('#article-container :not(a)>img'))
+ zoom.on('open', function (event) {
const photoBg = $(document.documentElement).attr('data-theme') === 'dark' ? '#121212' : '#fff'
zoom.update({
background: photoBg
@@ -267,152 +426,33 @@ $(function () {
})
}
- /**
- * 手機menu和toc按鈕點擊
- * 顯示menu和toc的sidebar
- */
- function openMobileSidebar (name) {
- $('body').css('overflow', 'hidden')
- $('#body-wrap').css('transform', 'translateX(-250px)')
- $('#page-header').css('transform', 'translateX(-250px)')
- $('#page-header.fixed.visible').css('transform', 'translate3d(-250px, 100%, 0)')
- $('#rightside').css('transform', 'translateX(-288px)')
- $('#menu_mask').fadeIn()
-
- if (name === 'menu') {
- $('.toggle-menu').removeClass('close').addClass('open')
- $('#mobile-sidebar-menus').css({ transform: 'translateX(-254px)' })
- }
-
- if (name === 'toc') {
- $('#mobile-toc-button').removeClass('close').addClass('open')
- $('#mobile-sidebar-toc').css('transform', 'translateX(-254px)')
- }
- }
-
- function closeMobileSidebar (name) {
- $('body').css('overflow', '')
- $('#body-wrap').css('transform', '')
- $('#page-header').css('transform', '')
- $('#page-header.fixed.visible').css('transform', '')
- $('#rightside').css('transform', 'translateX(-38px)')
- $('#menu_mask').fadeOut()
-
- if (name === 'menu') {
- $('.toggle-menu').removeClass('open').addClass('close')
- $('#mobile-sidebar-menus').css({ transform: 'translateX(0)' })
- }
-
- if (name === 'toc') {
- $('#mobile-toc-button').removeClass('open').addClass('close')
- $('#mobile-sidebar-toc').css('transform', '')
- }
- }
-
- $('.toggle-menu').on('click', function () {
- if ($('.toggle-menu').hasClass('close')) {
- openMobileSidebar('menu')
- if ($('#toggle-sidebar').hasClass('on')) {
- $('body').css('padding-left', '0')
- $('#sidebar').css('transform', '')
- }
- }
- })
-
- $('#mobile-toc-button').on('click', function () {
- if ($('#mobile-toc-button').hasClass('close')) openMobileSidebar('toc')
- })
-
- $('#menu_mask').on('click touchstart', function (e) {
- if ($('.toggle-menu').hasClass('open')) {
- closeMobileSidebar('menu')
- if ($('#toggle-sidebar').hasClass('on')) {
- setTimeout(function () {
- openSidebar()
- }, 600)
- }
- }
- if ($('#mobile-toc-button').hasClass('open')) {
- closeMobileSidebar('toc')
- }
- })
-
- $(window).on('resize', function (e) {
- if (!$('.toggle-menu').is(':visible')) {
- if ($('.toggle-menu').hasClass('open')) closeMobileSidebar('menu')
- }
- if (!$('#mobile-toc-button').is(':visible')) {
- if ($('#mobile-toc-button').hasClass('open')) closeMobileSidebar('toc')
- }
- })
-
// 點擊toc,收起sidebar
- $('#mobile-sidebar-toc a').on('click', function () {
- closeMobileSidebar('toc')
- })
+ // $('.toc-link').on('click', function () {
+ // closeMobileSidebar('toc')
+ // })
- /**
- * scroll 滚动 toc
- */
var initTop = 0
- $('.toc-child').hide()
-
- // main of scroll
- $(window).scroll(throttle(function (event) {
+ $(window).scroll(function (event) {
var currentTop = $(this).scrollTop()
- if (!isMobile() && isTocContent) {
- // percentage inspired by hexo-theme-next
- scrollPercent(currentTop)
- // head position
- findHeadPosition(currentTop)
- autoScrollToc(currentTop)
- }
var isUp = scrollDirection(currentTop)
-
if (currentTop > 56) {
if (isUp) {
- if ($('#page-header').hasClass('visible')) $('#page-header').removeClass('visible')
+ if ($pageHead.hasClass('visible')) $pageHead.removeClass('visible')
} else {
- if (!$('#page-header').hasClass('visible')) $('#page-header').addClass('visible')
+ if (!$pageHead.hasClass('visible')) $pageHead.addClass('visible')
}
- $('#page-header').addClass('fixed')
+ $pageHead.addClass('fixed')
- if ($('#rightside').css('opacity') === '0') {
- $('#rightside').animate({}, function () {
- $(this).css({
- opacity: '1',
- transform: 'translateX(-38px)'
- })
- })
+ if ($rightside.css('opacity') === '0') {
+ $rightside.css({ opacity: '1', transform: 'translateX(-38px)' })
}
} else {
if (currentTop === 0) {
- $('#page-header').removeClass('fixed').removeClass('visible')
+ $pageHead.removeClass('fixed').removeClass('visible')
}
- $('#rightside').animate({}, function () {
- $('#rightside').css({
- opacity: '',
- transform: ''
- })
- })
+ $rightside.css({ opacity: '', transform: '' })
}
- }, 300))
-
- // go up smooth scroll
- $('#go-up').on('click', function () {
- scrollTo('body')
- })
-
- // head scroll
- // $('#post-content').find('h1,h2,h3,h4,h5,h6').on('click', function (e) {
- // scrollToHead('#' + $(this).attr('id'))
- // })
-
- // head scroll
- $('.toc-link').on('click', function (e) {
- e.preventDefault()
- scrollToHead($(this).attr('href'))
})
// find the scroll direction
@@ -422,94 +462,126 @@ $(function () {
return result
}
- // scroll to a head(anchor)
- function scrollToHead (anchor) {
- scrollTo(anchor)
- }
+ /**
+ * 點擊滾回頂部
+ */
+ $('#go-up').on('click', function () {
+ scrollTo('body')
+ })
- // expand toc-item
- function expandToc ($item) {
- if ($item.is(':visible')) {
- return
- }
- $item.fadeIn(400)
- }
+ /**
+ * toc
+ */
- function scrollPercent (currentTop) {
- var docHeight = $('#content-outer').height()
- var winHeight = $(window).height()
- var contentMath = (docHeight > winHeight) ? (docHeight - winHeight) : ($(document).height() - winHeight)
- var scrollPercent = (currentTop) / (contentMath)
- var scrollPercentRounded = Math.round(scrollPercent * 100)
- var percentage = (scrollPercentRounded > 100) ? 100 : scrollPercentRounded
- $('.progress-num').text(percentage)
- $('.sidebar-toc__progress-bar').animate({
- width: percentage + '%'
- }, 100)
- }
+ if (GLOBAL_CONFIG_SITE.isPost && isTocContent) {
+ $('.toc-child').hide()
- function updateAnchor (anchor) {
- if (window.history.replaceState && anchor !== window.location.hash) {
- window.history.replaceState(undefined, undefined, anchor)
- }
- }
+ // main of scroll
+ $(window).scroll(throttle(function (event) {
+ var currentTop = $(this).scrollTop()
+ scrollPercent(currentTop)
+ findHeadPosition(currentTop)
+ autoScrollToc(currentTop)
+ }, 100))
- // find head position & add active class
- // DOM Hierarchy:
- // ol.toc > (li.toc-item, ...)
- // li.toc-item > (a.toc-link, ol.toc-child > (li.toc-item, ...))
- function findHeadPosition (top) {
- // assume that we are not in the post page if no TOC link be found,
- // thus no need to update the status
- if ($('.toc-link').length === 0) {
- return false
- }
-
- var list = $('#post-content').find('h1,h2,h3,h4,h5,h6')
- var currentId = ''
- list.each(function () {
- var head = $(this)
- if (top > head.offset().top - 25) {
- currentId = '#' + $(this).attr('id')
+ // scroll
+ $('.toc-link').on('click', function (e) {
+ if (window.innerWidth <= 1024) {
+ closeMobileSidebar('toc')
+ } else {
+ e.preventDefault()
+ scrollTo($(this).attr('href'))
}
})
- if (currentId === '') {
- $('.toc-link').removeClass('active')
- $('.toc-child').hide()
+ // expand toc-item
+ var expandToc = function ($item) {
+ if ($item.is(':visible')) {
+ return
+ }
+ $item.fadeIn(400)
}
- var currentActive = $('.toc-link.active')
- if (currentId && currentActive.attr('href') !== currentId) {
- updateAnchor(currentId)
-
- $('.toc-link').removeClass('active')
- var _this = $('.toc-link[href="' + currentId + '"]')
- _this.addClass('active')
-
- var parents = _this.parents('.toc-child')
- // Returned list is in reverse order of the DOM elements
- // Thus `parents.last()` is the outermost .toc-child container
- // i.e. list of subsections
- var topLink = (parents.length > 0) ? parents.last() : _this
- expandToc(topLink.closest('.toc-item').find('.toc-child'))
- topLink
- // Find all top-level .toc-item containers, i.e. sections
- // excluding the currently active one
- .closest('.toc-item').siblings('.toc-item')
- // Hide their respective list of subsections
- .find('.toc-child').hide()
+ var scrollPercent = function (currentTop) {
+ var docHeight = $('#article-container').height()
+ var winHeight = $(window).height()
+ var contentMath = (docHeight > winHeight) ? (docHeight - winHeight) : ($(document).height() - winHeight)
+ var scrollPercent = (currentTop) / (contentMath)
+ var scrollPercentRounded = Math.round(scrollPercent * 100)
+ var percentage = (scrollPercentRounded > 100) ? 100
+ : (scrollPercentRounded <= 0) ? 0
+ : scrollPercentRounded
+ $('.progress-num').text(percentage)
+ $('.sidebar-toc__progress-bar').animate({
+ width: percentage + '%'
+ }, 100)
}
- }
- function autoScrollToc (currentTop) {
- if ($('.toc-link').hasClass('active')) {
- var activePosition = $('.active').offset().top
- var sidebarScrolltop = $('#sidebar').scrollTop()
- if (activePosition > (currentTop + $(window).height() - 50)) {
- $('#sidebar').scrollTop(sidebarScrolltop + 100)
- } else if (activePosition < currentTop + 50) {
- $('#sidebar').scrollTop(sidebarScrolltop - 100)
+ var updateAnchor = function (anchor) {
+ if (window.history.replaceState && anchor !== window.location.hash) {
+ window.history.replaceState(undefined, undefined, anchor)
+ }
+ }
+
+ // find head position & add active class
+ // DOM Hierarchy:
+ // ol.toc > (li.toc-item, ...)
+ // li.toc-item > (a.toc-link, ol.toc-child > (li.toc-item, ...))
+ var findHeadPosition = function (top) {
+ // assume that we are not in the post page if no TOC link be found,
+ // thus no need to update the status
+ if ($('.toc-link').length === 0) {
+ return false
+ }
+
+ var list = $('#article-container').find('h1,h2,h3,h4,h5,h6')
+ var currentId = ''
+ list.each(function () {
+ var head = $(this)
+ if (top > head.offset().top - 25) {
+ currentId = '#' + $(this).attr('id')
+ }
+ })
+
+ if (currentId === '') {
+ $('.toc-link').removeClass('active')
+ $('.toc-child').hide()
+ }
+
+ var currentActive = $('.toc-link.active')
+ if (currentId && currentActive.attr('href') !== currentId) {
+ updateAnchor(currentId)
+
+ $('.toc-link').removeClass('active')
+
+ var _this = $('.toc-link[href="' + currentId + '"]')
+ _this.addClass('active')
+
+ var parents = _this.parents('.toc-child')
+ // Returned list is in reverse order of the DOM elements
+ // Thus `parents.last()` is the outermost .toc-child container
+ // i.e. list of subsections
+ var topLink = (parents.length > 0) ? parents.last() : _this
+ expandToc(topLink.closest('.toc-item').find('.toc-child'))
+ topLink
+ // Find all top-level .toc-item containers, i.e. sections
+ // excluding the currently active one
+ .closest('.toc-item').siblings('.toc-item')
+ // Hide their respective list of subsections
+ .find('.toc-child').hide()
+ }
+ }
+
+ var autoScrollToc = function (currentTop) {
+ if ($('.toc-link').hasClass('active')) {
+ var activePosition = $('.active').offset().top
+ var sidebarScrolltop = $('#sidebar .sidebar-toc__content').scrollTop()
+ if (activePosition > (currentTop + $(window).height() - 100)) {
+ $('#sidebar .sidebar-toc__content').scrollTop(sidebarScrolltop + 100)
+ }
+ if (activePosition < currentTop + 100) {
+ $('#sidebar .sidebar-toc__content').scrollTop(sidebarScrolltop - 100)
+ }
}
}
}
@@ -518,45 +590,25 @@ $(function () {
* 閲讀模式
*/
$('#readmode').click(function () {
- var isDark = $(document.documentElement).attr('data-theme') === 'dark'
- var isNull = $(document.documentElement).attr('data-theme') === ''
$('body').toggleClass('read-mode')
- $('#to_comment').toggleClass('is_invisible')
- if (isNull) $(document.documentElement).attr('data-theme', 'dark')
- if (isDark) $(document.documentElement).attr('data-theme', '')
})
/**
* 字體調整
*/
-
- function fontAdjust (name) {
- var fontSizeRecord = parseFloat($('body').css('font-size'))
- var preSizeRecord = parseFloat($('pre').css('font-size'))
- var codeSizeRecord = parseFloat($('code').css('font-size'))
- if (name === 'plus') {
- $('body').css('font-size', fontSizeRecord + 1)
- $('pre').css('font-size', preSizeRecord + 1)
- $('code').css('font-size', codeSizeRecord + 1)
- } else {
- $('body').css('font-size', fontSizeRecord - 1)
- $('pre').css('font-size', preSizeRecord - 1)
- $('code').css('font-size', codeSizeRecord - 1)
- }
- }
-
$('#font_plus').click(function () {
- fontAdjust('plus')
+ $body.css('font-size', parseFloat($body.css('font-size')) + 1)
})
-
$('#font_minus').click(function () {
- fontAdjust('minus')
+ $body.css('font-size', parseFloat($body.css('font-size')) - 1)
})
/**
- * 手機端sub-menu 展開/收縮
+ * menu
+ * 側邊欄sub-menu 展開/收縮
+ * 解決menus在觸摸屏下,滑動屏幕menus_item_child不消失的問題(手機hover的bug)
*/
- $('.menus-expand').on('click', function () {
+ $('#mobile-sidebar-menus .menus-expand').on('click', function () {
if ($(this).hasClass('menus-closed')) {
$(this).parents('.menus_item').find('.menus_item_child').slideDown()
$(this).removeClass('menus-closed')
@@ -566,6 +618,13 @@ $(function () {
}
})
+ $(window).on('touchmove', function (e) {
+ var $menusChild = $('#page-header .menus_item_child')
+ if ($menusChild.is(':visible')) {
+ $menusChild.css('display', 'none')
+ }
+ })
+
/**
* rightside 點擊設置 按鈕 展開
*/
@@ -582,7 +641,7 @@ $(function () {
*/
var copyright = GLOBAL_CONFIG.copyright
if (copyright !== undefined) {
- document.body.oncopy = event => {
+ document.body.oncopy = function (event) {
event.preventDefault()
let textFont; const copyFont = window.getSelection(0).toString()
if (copyFont.length > 45) {
@@ -603,43 +662,22 @@ $(function () {
}
}
- /**
- * justified-gallery 圖庫排版
- */
-
- if ($('.justified-gallery').length) {
- $('.justified-gallery > p > .fancybox').unwrap()
- $('head').append('')
- loadScript('https://cdn.jsdelivr.net/npm/justifiedGallery@3.7.0/dist/js/jquery.justifiedGallery.min.js', function () {
- if (typeof ($.fn.justifiedGallery) === 'function') {
- $('.justified-gallery').justifiedGallery({
- rowHeight: 220,
- margins: 4
- })
- }
- })
- }
-
/**
* Darkmode
*/
-
+ var isFontAwesomeV5 = GLOBAL_CONFIG.isFontAwesomeV5
+ var $darkModeButtom = $('#darkmode')
if (typeof autoChangeMode !== 'undefined') {
- if (autoChangeMode === '1' || autoChangeMode === '2') {
- if (Cookies.get('theme') === 'dark') {
- changeLightIcon()
- } else {
- changeDarkIcon()
- }
- }
+ if (Cookies.get('theme') === 'dark') changeLightIcon()
+ else changeDarkIcon()
}
function changeLightIcon () {
- $('#darkmode').removeClass('fa-moon-o').addClass('fa-sun-o')
+ isFontAwesomeV5 ? $darkModeButtom.removeClass('fa-moon').addClass('fa-sun') : $darkModeButtom.removeClass('fa-moon-o').addClass('fa-sun-o')
}
function changeDarkIcon () {
- $('#darkmode').removeClass('fa-sun-o').addClass('fa-moon-o')
+ isFontAwesomeV5 ? $darkModeButtom.removeClass('fa-sun').addClass('fa-moon') : $darkModeButtom.removeClass('fa-sun-o').addClass('fa-moon-o')
}
function switchReadMode () {
@@ -647,22 +685,23 @@ $(function () {
if (nowMode === 'light') {
changeLightIcon()
activateDarkMode()
- Cookies.set('theme', 'dark', {
- expires: 2
- })
+ Cookies.set('theme', 'dark', { expires: 2 })
if (isSnackbar) snackbarShow(GLOBAL_CONFIG.Snackbar.day_to_night)
} else {
changeDarkIcon()
activateLightMode()
- Cookies.set('theme', 'light', {
- expires: 2
- })
+ Cookies.set('theme', 'light', { expires: 2 })
if (isSnackbar) snackbarShow(GLOBAL_CONFIG.Snackbar.night_to_day)
}
}
- $('#darkmode').click(function () {
+ $darkModeButtom.click(function () {
switchReadMode()
+ try {
+ utterancesTheme()
+ } catch (e) {
+ return false
+ }
})
/**
@@ -670,245 +709,21 @@ $(function () {
*/
if (GLOBAL_CONFIG.runtime) {
// get user config
- var startDate = $('#webinfo-runtime-count').attr('start_date')
+ var $runtimeCount = $('#webinfo-runtime-count')
+ var startDate = $runtimeCount.attr('start_date')
var showDateTime = function () {
var BirthDay = new Date(startDate)
var today = new Date()
var timeold = (today.getTime() - BirthDay.getTime())
- var msPerDay = 24 * 60 * 60 * 1000
- var eDaysold = timeold / msPerDay
- var daysold = Math.floor(eDaysold)
- $('.webinfo-runtime-count').text(daysold + ' ' + GLOBAL_CONFIG.runtime_unit)
+ var daysold = Math.floor(timeold / (24 * 60 * 60 * 1000))
+ $runtimeCount.text(daysold + ' ' + GLOBAL_CONFIG.runtime_unit)
}
-
var interval
showDateTime()
clearInterval(interval)
interval = setInterval(showDateTime, 10000)
}
- /**
- * 搜索
- */
-
- if (GLOBAL_CONFIG.localSearch === undefined && GLOBAL_CONFIG.algolia !== undefined) {
- $('a.social-icon.search').on('click', function () {
- openSearch()
- $('.ais-search-box--input').focus()
- })
- $('.search-mask, .search-close-button').on('click', closeSearch)
-
- var algolia = GLOBAL_CONFIG.algolia
- var isAlgoliaValid = algolia.appId && algolia.apiKey && algolia.indexName
- if (!isAlgoliaValid) {
- return console.error('Algolia setting is invalid!')
- }
- var search = instantsearch({
- appId: algolia.appId,
- apiKey: algolia.apiKey,
- indexName: algolia.indexName,
- searchParameters: {
- hitsPerPage: algolia.hits.per_page || 10
- },
- searchFunction: function (helper) {
- var searchInput = $('#algolia-search-input').find('input')
-
- if (searchInput.val()) {
- helper.search()
- }
- }
- })
-
- search.addWidget(
- instantsearch.widgets.searchBox({
- container: '#algolia-search-input',
- reset: false,
- magnifier: false,
- placeholder: GLOBAL_CONFIG.algolia.languages.input_placeholder
- })
- )
- search.addWidget(
- instantsearch.widgets.hits({
- container: '#algolia-hits',
- templates: {
- item: function (data) {
- var link = data.permalink ? data.permalink : (GLOBAL_CONFIG.root + data.path)
- return (
- '' +
- data._highlightResult.title.value +
- ''
- )
- },
- empty: function (data) {
- return (
- '' +
- GLOBAL_CONFIG.algolia.languages.hits_empty.replace(/\$\{query}/, data.query) +
- '
'
- )
- }
- },
- cssClasses: {
- item: 'algolia-hit-item'
- }
- })
- )
-
- search.addWidget(
- instantsearch.widgets.stats({
- container: '#algolia-stats',
- templates: {
- body: function (data) {
- var stats = GLOBAL_CONFIG.algolia.languages.hits_stats
- .replace(/\$\{hits}/, data.nbHits)
- .replace(/\$\{time}/, data.processingTimeMS)
- return (
- '
' +
- stats +
- '' +
- '
' +
- ''
- )
- }
- }
- })
- )
-
- search.addWidget(
- instantsearch.widgets.pagination({
- container: '#algolia-pagination',
- scrollTo: false,
- showFirstLast: false,
- labels: {
- first: '',
- last: '',
- previous: '',
- next: ''
- },
- cssClasses: {
- root: 'pagination',
- item: 'pagination-item',
- link: 'page-number',
- active: 'current',
- disabled: 'disabled-item'
- }
- })
- )
- search.start()
- }
- if (GLOBAL_CONFIG.localSearch !== undefined && GLOBAL_CONFIG.algolia === undefined) {
- $('a.social-icon.search').on('click', function () {
- var loadFlag = false
- openSearch()
- $('#local-search-input input').focus()
- if (!loadFlag) {
- localSearch(GLOBAL_CONFIG.localSearch.path)
- loadFlag = true
- }
- })
-
- $('.search-mask, .search-close-button').on('click', closeSearch)
-
- var localSearch = function (path) {
- $.ajax({
- url: GLOBAL_CONFIG.root + path,
- dataType: 'xml',
- success: function (xmlResponse) {
- // get the contents from search data
- var datas = $('entry', xmlResponse).map(function () {
- return {
- title: $('title', this).text(),
- content: $('content', this).text(),
- url: $('url', this).text()
- }
- }).get()
- var $input = $('#local-search-input input')[0]
- var $resultContent = $('#local-hits')[0]
- $input.addEventListener('input', function () {
- var str = ''
- var keywords = this.value.trim().toLowerCase().split(/[\s]+/)
- $resultContent.innerHTML = ''
- if (this.value.trim().length <= 0) {
- $('.local-search-stats__hr').hide()
- return
- }
- var count = 0
- // perform local searching
- datas.forEach(function (data) {
- var isMatch = true
- var dataTitle = data.title.trim().toLowerCase()
- var dataContent = data.content.trim().replace(/<[^>]+>/g, '').toLowerCase()
- var dataUrl = data.url
- var indexTitle = -1
- var indexContent = -1
- // only match artiles with not empty titles and contents
- if (dataTitle !== '' && dataContent !== '') {
- keywords.forEach(function (keyword, i) {
- indexTitle = dataTitle.indexOf(keyword)
- indexContent = dataContent.indexOf(keyword)
- if (indexTitle < 0 && indexContent < 0) {
- isMatch = false
- } else {
- if (indexContent < 0) {
- indexContent = 0
- }
- }
- })
- }
- // show search results
- if (isMatch) {
- str += '
'
- count += 1
- $('.local-search-stats__hr').show()
- }
- })
- if (count === 0) {
- str += '
' + GLOBAL_CONFIG.localSearch.languages.hits_empty.replace(/\$\{query}/, this.value.trim()) +
- '
'
- }
- $resultContent.innerHTML = str
- })
- }
- })
- }
- }
-
- function openSearch () {
- $('body').css('width', '100%')
- $('body').css('overflow', 'hidden')
-
- $('.search-dialog').css({
- display: 'block'
- })
-
- $('.search-mask').fadeIn()
-
- // shortcut: ESC
- document.addEventListener('keydown', function f (event) {
- if (event.code === 'Escape') {
- closeSearch()
- document.removeEventListener('keydown', f)
- }
- })
- }
-
- function closeSearch () {
- $('body').css('width', '')
- $('body').css('overflow', '')
- $('.search-dialog').css({
- animation: 'search_close .5s'
- })
- $('.search-dialog').animate({}, function () {
- setTimeout(function () {
- $('.search-dialog').css({
- animation: '',
- display: 'none'
- })
- }, 500)
- })
-
- $('.search-mask').fadeOut()
- }
-
if (GLOBAL_CONFIG.baiduPush) {
(function () {
var bp = document.createElement('script')
@@ -922,4 +737,19 @@ $(function () {
s.parentNode.insertBefore(bp, s)
})()
}
+
+ /**
+ * tag-hide
+ */
+ var $hideInline = $('.hide-button')
+ $hideInline.on('click', function (e) {
+ e.preventDefault()
+ $(this).hide()
+ var $hideContent = $(this).next('.hide-content')
+ $hideContent.show()
+ $hideContent.find('.justified-gallery').justifiedGallery({
+ rowHeight: 220,
+ margins: 4
+ })
+ })
})
diff --git a/source/js/search/algolia.js b/source/js/search/algolia.js
new file mode 100644
index 0000000..8f02459
--- /dev/null
+++ b/source/js/search/algolia.js
@@ -0,0 +1,133 @@
+$(function () {
+ $('a.social-icon.search').on('click', function () {
+ $('body').css({ width: '100%', overflow: 'hidden' })
+ $('.search-dialog').css('display', 'block')
+ $('.ais-search-box--input').focus()
+ $('.search-mask').fadeIn()
+ // shortcut: ESC
+ document.addEventListener('keydown', function f (event) {
+ if (event.code === 'Escape') {
+ closeSearch()
+ document.removeEventListener('keydown', f)
+ }
+ })
+ })
+
+ var closeSearch = function () {
+ $('body').css('width', '')
+ $('body').css('overflow', '')
+ $('.search-dialog').css({
+ animation: 'search_close .5s'
+ })
+
+ $('.search-dialog').animate({}, function () {
+ setTimeout(function () {
+ $('.search-dialog').css({
+ animation: '',
+ display: 'none'
+ })
+ }, 500)
+ })
+
+ $('.search-mask').fadeOut()
+ }
+ $('.search-mask, .search-close-button').on('click touchstart', closeSearch)
+
+ var algolia = GLOBAL_CONFIG.algolia
+ var isAlgoliaValid = algolia.appId && algolia.apiKey && algolia.indexName
+ if (!isAlgoliaValid) {
+ return console.error('Algolia setting is invalid!')
+ }
+
+ var search = instantsearch({
+ appId: algolia.appId,
+ apiKey: algolia.apiKey,
+ indexName: algolia.indexName,
+ searchParameters: {
+ hitsPerPage: algolia.hits.per_page || 10
+ },
+ searchFunction: function (helper) {
+ var searchInput = $('#algolia-search-input').find('input')
+
+ if (searchInput.val()) {
+ helper.search()
+ }
+ }
+ })
+
+ search.addWidget(
+ instantsearch.widgets.searchBox({
+ container: '#algolia-search-input',
+ reset: false,
+ magnifier: false,
+ placeholder: GLOBAL_CONFIG.algolia.languages.input_placeholder
+ })
+ )
+ search.addWidget(
+ instantsearch.widgets.hits({
+ container: '#algolia-hits',
+ templates: {
+ item: function (data) {
+ var link = data.permalink ? data.permalink : (GLOBAL_CONFIG.root + data.path)
+ return (
+ '
' +
+ data._highlightResult.title.value +
+ ''
+ )
+ },
+ empty: function (data) {
+ return (
+ '
' +
+ GLOBAL_CONFIG.algolia.languages.hits_empty.replace(/\$\{query}/, data.query) +
+ '
'
+ )
+ }
+ },
+ cssClasses: {
+ item: 'algolia-hit-item'
+ }
+ })
+ )
+
+ search.addWidget(
+ instantsearch.widgets.stats({
+ container: '#algolia-stats',
+ templates: {
+ body: function (data) {
+ var stats = GLOBAL_CONFIG.algolia.languages.hits_stats
+ .replace(/\$\{hits}/, data.nbHits)
+ .replace(/\$\{time}/, data.processingTimeMS)
+ return (
+ '
' +
+ stats +
+ '
' +
+ '
' +
+ ''
+ )
+ }
+ }
+ })
+ )
+
+ search.addWidget(
+ instantsearch.widgets.pagination({
+ container: '#algolia-pagination',
+ scrollTo: false,
+ showFirstLast: false,
+ labels: {
+ first: '
',
+ last: '
',
+ previous: '
',
+ next: '
'
+ },
+ cssClasses: {
+ root: 'pagination',
+ item: 'pagination-item',
+ link: 'page-number',
+ active: 'current',
+ disabled: 'disabled-item'
+ }
+ })
+ )
+ search.start()
+})
diff --git a/source/js/search/local-search.js b/source/js/search/local-search.js
new file mode 100644
index 0000000..efcec8a
--- /dev/null
+++ b/source/js/search/local-search.js
@@ -0,0 +1,104 @@
+$(function () {
+ var loadFlag = false
+ $('a.social-icon.search').on('click', function () {
+ $('body').css({ width: '100%', overflow: 'hidden' })
+ $('.search-dialog').css('display', 'block')
+ $('#local-search-input input').focus()
+ $('.search-mask').fadeIn()
+ if (!loadFlag) {
+ search(GLOBAL_CONFIG.localSearch.path)
+ loadFlag = true
+ }
+
+ // shortcut: ESC
+ document.addEventListener('keydown', function f (event) {
+ if (event.code === 'Escape') {
+ closeSearch()
+ document.removeEventListener('keydown', f)
+ }
+ })
+ })
+
+ var closeSearch = function () {
+ $('body').css('width', '')
+ $('body').css('overflow', '')
+ $('.search-dialog').css({
+ animation: 'search_close .5s'
+ })
+
+ $('.search-dialog').animate({}, function () {
+ setTimeout(function () {
+ $('.search-dialog').css({
+ animation: '',
+ display: 'none'
+ })
+ }, 500)
+ })
+
+ $('.search-mask').fadeOut()
+ }
+ $('.search-mask, .search-close-button').on('click touchstart', closeSearch)
+
+ function search (path) {
+ $.ajax({
+ url: GLOBAL_CONFIG.root + path,
+ dataType: 'xml',
+ success: function (xmlResponse) {
+ // get the contents from search data
+ var datas = $('entry', xmlResponse).map(function () {
+ return {
+ title: $('title', this).text(),
+ content: $('content', this).text(),
+ url: $('url', this).text()
+ }
+ }).get()
+ var $input = $('#local-search-input input')[0]
+ var $resultContent = $('#local-hits')[0]
+ $input.addEventListener('input', function () {
+ var str = '
'
+ var keywords = this.value.trim().toLowerCase().split(/[\s]+/)
+ $resultContent.innerHTML = ''
+ if (this.value.trim().length <= 0) {
+ $('.local-search-stats__hr').hide()
+ return
+ }
+ var count = 0
+ // perform local searching
+ datas.forEach(function (data) {
+ var isMatch = true
+ var dataTitle = data.title.trim().toLowerCase()
+ var dataContent = data.content.trim().replace(/<[^>]+>/g, '').toLowerCase()
+ var dataUrl = data.url
+ var indexTitle = -1
+ var indexContent = -1
+ // only match artiles with not empty titles and contents
+ if (dataTitle !== '' && dataContent !== '') {
+ keywords.forEach(function (keyword, i) {
+ indexTitle = dataTitle.indexOf(keyword)
+ indexContent = dataContent.indexOf(keyword)
+ if (indexTitle < 0 && indexContent < 0) {
+ isMatch = false
+ } else {
+ if (indexContent < 0) {
+ indexContent = 0
+ }
+ }
+ })
+ }
+ // show search results
+ if (isMatch) {
+ str += '
'
+ count += 1
+ $('.local-search-stats__hr').show()
+ }
+ })
+ if (count === 0) {
+ str += '
' + GLOBAL_CONFIG.localSearch.languages.hits_empty.replace(/\$\{query}/, this.value.trim()) +
+ '
'
+ }
+ $resultContent.innerHTML = str
+ })
+ }
+ })
+ }
+})
diff --git a/source/js/third-party/ClickShowText.js b/source/js/third-party/ClickShowText.js
new file mode 100644
index 0000000..d17ac76
--- /dev/null
+++ b/source/js/third-party/ClickShowText.js
@@ -0,0 +1,42 @@
+function co(){
+ var colorElements = "0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f";
+ var colorArray = colorElements.split(",");
+ var color ="#";
+ for(var i =0;i<6;i++){
+ color+=colorArray[Math.floor(Math.random()*16)];
+ }
+ return color;
+};
+var a_idx = 0;
+jQuery(document).ready(function($) {
+ $("body").click(function (e) {
+
+ var config = GLOBAL_CONFIG.ClickShowText;
+
+ /*这个数组中的每一个字符是你要浮动显示的词或句子,每次点击鼠标后按顺序出现*/
+ var a = config.text.split(",");
+ var $i = $("
").text(a[a_idx]);
+ a_idx = (a_idx + 1) % a.length;
+ var x = e.pageX,
+ y = e.pageY;
+ $i.css({
+ "z-index": 150,
+ "top": y - 20,
+ "left": x -40,
+ "position": "absolute",
+ "font-weight": "bold",
+ "color": co(),
+ "cursor": "default",
+ "font-size": config.fontSize || "inherit"
+ });
+ $("body").append($i);
+ $i.animate({
+ "top": y - 180,
+ "opacity": 0
+ },
+ 1500,
+ function() {
+ $i.remove();
+ });
+});
+});
\ No newline at end of file
diff --git a/source/js/third-party/activate-power-mode.js b/source/js/third-party/activate-power-mode.js
new file mode 100644
index 0000000..975190b
--- /dev/null
+++ b/source/js/third-party/activate-power-mode.js
@@ -0,0 +1 @@
+!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.POWERMODE=e():t.POWERMODE=e()}(this,(function(){return function(t){var e={};function o(n){if(e[n])return e[n].exports;var r=e[n]={exports:{},id:n,loaded:!1};return t[n].call(r.exports,r,r.exports,o),r.loaded=!0,r.exports}return o.m=t,o.c=e,o.p="",o(0)}([function(t,e,o){"use strict";var n=document.createElement("canvas");n.width=window.innerWidth,n.height=window.innerHeight,n.style.cssText="position:fixed;top:0;left:0;pointer-events:none;z-index:999999",window.addEventListener("resize",(function(){n.width=window.innerWidth,n.height=window.innerHeight})),document.body.appendChild(n);var r=n.getContext("2d"),i=[],a=0,d=!1;function l(t,e){return Math.random()*(e-t)+t}function c(t){if(p.colorful){var e=l(0,360);return"hsla("+l(e-10,e+10)+", 100%, "+l(50,80)+"%, 1)"}return window.getComputedStyle(t).color}function u(t,e,o){return{x:t,y:e,alpha:1,color:o,velocity:{x:2*Math.random()-1,y:2*Math.random()-3.5}}}function p(){for(var t=function(){var t,e=document.activeElement;if("TEXTAREA"===e.tagName||"INPUT"===e.tagName&&"text"===e.getAttribute("type")){var n=o(1)(e,e.selectionEnd);return t=e.getBoundingClientRect(),{x:n.left+t.left,y:n.top+t.top,color:c(e)}}var r=window.getSelection();if(r.rangeCount){var i=r.getRangeAt(0),a=i.startContainer;return a.nodeType===document.TEXT_NODE&&(a=a.parentNode),{x:(t=i.getBoundingClientRect()).left,y:t.top,color:c(a)}}return{x:0,y:0,color:"transparent"}}(),e=5+Math.round(10*Math.random());e--;)i[a]=u(t.x,t.y,t.color),a=(a+1)%500;if(p.shake){var n=1+2*Math.random(),r=n*(Math.random()>.5?-1:1),l=n*(Math.random()>.5?-1:1);document.body.style.marginLeft=r+"px",document.body.style.marginTop=l+"px",setTimeout((function(){document.body.style.marginLeft="",document.body.style.marginTop=""}),75)}d||requestAnimationFrame(f)}function f(){d=!0,r.clearRect(0,0,n.width,n.height);for(var t=!1,e=n.getBoundingClientRect(),o=0;o
parseInt(c.height)&&(l.overflowY="scroll"):l.overflow="hidden",d.textContent=t.value.substring(0,n),"INPUT"===t.nodeName&&(d.textContent=d.textContent.replace(/\s/g," "));var u=document.createElement("span");u.textContent=t.value.substring(n)||".",d.appendChild(u);var p={top:u.offsetTop+parseInt(c.borderTopWidth),left:u.offsetLeft+parseInt(c.borderLeftWidth)};return i?u.style.backgroundColor="#aaa":document.body.removeChild(d),p}void 0!==t&&void 0!==t.exports?t.exports=n:window.getCaretCoordinates=n}()}])}));
\ No newline at end of file
diff --git a/source/js/third-party/canvas-nest.js b/source/js/third-party/canvas-nest.js
new file mode 100644
index 0000000..50d3e87
--- /dev/null
+++ b/source/js/third-party/canvas-nest.js
@@ -0,0 +1,88 @@
+! function () {
+ var cn = document.getElementById('canvas_nest');
+ var mb = cn.getAttribute("mobile");
+
+ if (mb == 'false' && (/Android|webOS|iPhone|iPod|iPad|BlackBerry/i.test(navigator.userAgent))) {
+ return;
+ }
+
+ function o(w, v, i) {
+ return w.getAttribute(v) || i
+ }
+
+ function j(i) {
+ return document.getElementsByTagName(i)
+ }
+
+ function l() {
+ var i = j("script"),
+ w = i.length,
+ v = i[w - 1];
+ return {
+ l: w,
+ z: o(v, "zIndex", -1),
+ o: o(v, "opacity", 0.5),
+ c: o(v, "color", "0,0,0"),
+ n: o(v, "count", 99)
+ }
+ }
+
+ function k() {
+ r = u.width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth, n = u.height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight
+ }
+
+ function b() {
+ e.clearRect(0, 0, r, n);
+ var w = [f].concat(t);
+ var x, v, A, B, z, y;
+ t.forEach(function (i) {
+ i.x += i.xa, i.y += i.ya, i.xa *= i.x > r || i.x < 0 ? -1 : 1, i.ya *= i.y > n || i.y < 0 ? -1 : 1, e.fillRect(i.x - 0.5, i.y - 0.5, 1, 1);
+ for (v = 0; v < w.length; v++) {
+ x = w[v];
+ if (i !== x && null !== x.x && null !== x.y) {
+ B = i.x - x.x, z = i.y - x.y, y = B * B + z * z;
+ y < x.max && (x === f && y >= x.max / 2 && (i.x -= 0.03 * B, i.y -= 0.03 * z), A = (x.max - y) / x.max, e.beginPath(), e.lineWidth = A / 2, e.strokeStyle = "rgba(" + s.c + "," + (A + 0.2) + ")", e.moveTo(i.x, i.y), e.lineTo(x.x, x.y), e.stroke())
+ }
+ }
+ w.splice(w.indexOf(i), 1)
+ }), m(b)
+ }
+ var u = document.createElement("canvas"),
+ s = l(),
+ c = "c_n" + s.l,
+ e = u.getContext("2d"),
+ r, n, m = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (i) {
+ window.setTimeout(i, 1000 / 45)
+ },
+ a = Math.random,
+ f = {
+ x: null,
+ y: null,
+ max: 20000
+ };
+ u.id = c;
+ u.style.cssText = "position:fixed;top:0;left:0;z-index:" + s.z + ";opacity:" + s.o;
+ j("body")[0].appendChild(u);
+ k(), window.onresize = k;
+ window.onmousemove = function (i) {
+ i = i || window.event, f.x = i.clientX, f.y = i.clientY
+ }, window.onmouseout = function () {
+ f.x = null, f.y = null
+ };
+ for (var t = [], p = 0; s.n > p; p++) {
+ var h = a() * r,
+ g = a() * n,
+ q = 2 * a() - 1,
+ d = 2 * a() - 1;
+ t.push({
+ x: h,
+ y: g,
+ xa: q,
+ ya: d,
+ max: 6000
+ })
+ }
+ setTimeout(function () {
+ b()
+ }, 100)
+}();
\ No newline at end of file
diff --git a/source/js/third-party/canvas-ribbon.js b/source/js/third-party/canvas-ribbon.js
new file mode 100644
index 0000000..74bce99
--- /dev/null
+++ b/source/js/third-party/canvas-ribbon.js
@@ -0,0 +1,91 @@
+/**
+ * Copyright (c) 2016 hustcc
+ * License: MIT
+ * Version: v1.0.1
+ * GitHub: https://github.com/hustcc/ribbon.js
+ **/
+
+!(function () {
+
+ var script = document.getElementById('ribbon');
+ var mb = script.getAttribute("mobile");
+ if (mb == 'false' && (/Android|webOS|iPhone|iPod|iPad|BlackBerry/i.test(navigator.userAgent))) {
+ return;
+ }
+
+ config = {
+ z: attr(script, 'zIndex', -1), // z-index
+ a: attr(script, 'alpha', 0.6), // alpha
+ s: attr(script, 'size', 90), // size
+ c: attr(script, 'data-click', true) // click-to-change
+ }
+
+
+ function attr (node, attr, default_value) {
+ if (default_value === true) {
+ return node.getAttribute(attr) || default_value
+ }
+ return Number(node.getAttribute(attr)) || default_value
+ }
+
+ var canvas = document.createElement('canvas'),
+ g2d = canvas.getContext('2d'),
+ pr = window.devicePixelRatio || 1,
+ width = window.innerWidth,
+ height = window.innerHeight,
+ f = config.s,
+ q,
+ t,
+ m = Math,
+ r = 0,
+ pi = m.PI * 2,
+ cos = m.cos,
+ random = m.random
+ canvas.width = width * pr
+ canvas.height = height * pr
+ g2d.scale(pr, pr)
+ g2d.globalAlpha = config.a
+ canvas.style.cssText =
+ 'opacity: ' +
+ config.a +
+ ';position:fixed;top:0;left:0;z-index: ' +
+ config.z +
+ ';width:100%;height:100%;pointer-events:none;'
+ // create canvas
+ document.getElementsByTagName('body')[0].appendChild(canvas)
+
+ function redraw () {
+ g2d.clearRect(0, 0, width, height)
+ q = [{ x: 0, y: height * 0.7 + f }, { x: 0, y: height * 0.7 - f }]
+ while (q[1].x < width + f) draw(q[0], q[1])
+ }
+ function draw (i, j) {
+ g2d.beginPath()
+ g2d.moveTo(i.x, i.y)
+ g2d.lineTo(j.x, j.y)
+ var k = j.x + (random() * 2 - 0.25) * f,
+ n = line(j.y)
+ g2d.lineTo(k, n)
+ g2d.closePath()
+ r -= pi / -50
+ g2d.fillStyle =
+ '#' +
+ (
+ ((cos(r) * 127 + 128) << 16) |
+ ((cos(r + pi / 3) * 127 + 128) << 8) |
+ (cos(r + (pi / 3) * 2) * 127 + 128)
+ ).toString(16)
+ g2d.fill()
+ q[0] = q[1]
+ q[1] = { x: k, y: n }
+ }
+ function line (p) {
+ t = p + (random() * 2 - 1.1) * f
+ return t > height || t < 0 ? line(p) : t
+ }
+ if (config.c !== 'false') {
+ document.onclick = redraw
+ document.ontouchstart = redraw
+ }
+ redraw()
+})()
\ No newline at end of file
diff --git a/source/js/third-party/click_heart.js b/source/js/third-party/click_heart.js
new file mode 100644
index 0000000..21aeef9
--- /dev/null
+++ b/source/js/third-party/click_heart.js
@@ -0,0 +1,73 @@
+!(function(e, t, a) {
+ function r(e) {
+ var a = t.createElement("div");
+ (a.className = "heart"),
+ n.push({
+ el: a,
+ x: e.clientX - 5,
+ y: e.clientY - 5,
+ scale: 1,
+ alpha: 1,
+ color:
+ "rgb(" +
+ ~~(255 * Math.random()) +
+ "," +
+ ~~(255 * Math.random()) +
+ "," +
+ ~~(255 * Math.random()) +
+ ")"
+ }),
+ t.body.appendChild(a);
+ }
+ var n = [];
+ (e.requestAnimationFrame =
+ e.requestAnimationFrame ||
+ e.webkitRequestAnimationFrame ||
+ e.mozRequestAnimationFrame ||
+ e.oRequestAnimationFrame ||
+ e.msRequestAnimationFrame ||
+ function(e) {
+ setTimeout(e, 1e3 / 60);
+ }),
+ (function(e) {
+ var a = t.createElement("style");
+ a.type = "text/css";
+ try {
+ a.appendChild(t.createTextNode(e));
+ } catch (t) {
+ a.styleSheet.cssText = e;
+ }
+ t.getElementsByTagName("head")[0].appendChild(a);
+ })(
+ ".heart{width: 10px;height: 10px;position: fixed;background: #f00;transform: rotate(45deg);-webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);}.heart:after,.heart:before{content: '';width: inherit;height: inherit;background: inherit;border-radius: 50%;-webkit-border-radius: 50%;-moz-border-radius: 50%;position: fixed;}.heart:after{top: -5px;}.heart:before{left: -5px;}"
+ ),
+ (function() {
+ var t = "function" == typeof e.onclick && e.onclick;
+ e.onclick = function(e) {
+ t && t(), r(e);
+ };
+ })(),
+ (function e() {
+ for (var a = 0; a < n.length; a++)
+ n[a].alpha <= 0
+ ? (t.body.removeChild(n[a].el), n.splice(a, 1))
+ : (n[a].y--,
+ (n[a].scale += 0.004),
+ (n[a].alpha -= 0.013),
+ (n[a].el.style.cssText =
+ "left:" +
+ n[a].x +
+ "px;top:" +
+ n[a].y +
+ "px;opacity:" +
+ n[a].alpha +
+ ";transform:scale(" +
+ n[a].scale +
+ "," +
+ n[a].scale +
+ ") rotate(45deg);background:" +
+ n[a].color +
+ ";z-index:99999"));
+ requestAnimationFrame(e);
+ })();
+})(window, document);
diff --git a/source/js/third-party/fireworks.js b/source/js/third-party/fireworks.js
new file mode 100644
index 0000000..91993a7
--- /dev/null
+++ b/source/js/third-party/fireworks.js
@@ -0,0 +1,129 @@
+var canvasEl = document.querySelector('.fireworks')
+if (canvasEl) {
+ var ctx = canvasEl.getContext('2d')
+ var numberOfParticules = 30
+ var pointerX = 0
+ var pointerY = 0
+ // var tap = ('ontouchstart' in window || navigator.msMaxTouchPoints) ? 'touchstart' : 'mousedown'
+ // Fixed the mobile scroll
+ var tap = 'mousedown'
+ var colors = ['#FF1461', '#18FF92', '#5A87FF', '#FBF38C']
+
+ var setCanvasSize = debounce(function () {
+ canvasEl.width = window.innerWidth
+ canvasEl.height = window.innerHeight
+ canvasEl.style.width = window.innerWidth + 'px'
+ canvasEl.style.height = window.innerHeight + 'px'
+ canvasEl.getContext('2d').scale(1, 1)
+ }, 500)
+
+ var render = anime({
+ duration: Infinity,
+ update: function () {
+ ctx.clearRect(0, 0, canvasEl.width, canvasEl.height)
+ }
+ })
+
+ document.addEventListener(tap, function (e) {
+ if (e.target.id !== 'sidebar' && e.target.id !== 'toggle-sidebar' && e.target.nodeName !== 'A' && e.target.nodeName !== 'IMG') {
+ render.play()
+ updateCoords(e)
+ animateParticules(pointerX, pointerY)
+ }
+ }, false)
+
+ setCanvasSize()
+ window.addEventListener('resize', setCanvasSize, false)
+}
+
+function updateCoords (e) {
+ pointerX = (e.clientX || e.touches[0].clientX) - canvasEl.getBoundingClientRect().left
+ pointerY = e.clientY || e.touches[0].clientY - canvasEl.getBoundingClientRect().top
+}
+
+function setParticuleDirection (p) {
+ var angle = anime.random(0, 360) * Math.PI / 180
+ var value = anime.random(50, 180)
+ var radius = [-1, 1][anime.random(0, 1)] * value
+ return {
+ x: p.x + radius * Math.cos(angle),
+ y: p.y + radius * Math.sin(angle)
+ }
+}
+
+function createParticule (x, y) {
+ var p = {}
+ p.x = x
+ p.y = y
+ p.color = colors[anime.random(0, colors.length - 1)]
+ p.radius = anime.random(16, 32)
+ p.endPos = setParticuleDirection(p)
+ p.draw = function () {
+ ctx.beginPath()
+ ctx.arc(p.x, p.y, p.radius, 0, 2 * Math.PI, true)
+ ctx.fillStyle = p.color
+ ctx.fill()
+ }
+ return p
+}
+
+function createCircle (x, y) {
+ var p = {}
+ p.x = x
+ p.y = y
+ p.color = '#F00'
+ p.radius = 0.1
+ p.alpha = 0.5
+ p.lineWidth = 6
+ p.draw = function () {
+ ctx.globalAlpha = p.alpha
+ ctx.beginPath()
+ ctx.arc(p.x, p.y, p.radius, 0, 2 * Math.PI, true)
+ ctx.lineWidth = p.lineWidth
+ ctx.strokeStyle = p.color
+ ctx.stroke()
+ ctx.globalAlpha = 1
+ }
+ return p
+}
+
+function renderParticule (anim) {
+ for (var i = 0; i < anim.animatables.length; i++) {
+ anim.animatables[i].target.draw()
+ }
+}
+
+function animateParticules (x, y) {
+ var circle = createCircle(x, y)
+ var particules = []
+ for (var i = 0; i < numberOfParticules; i++) {
+ particules.push(createParticule(x, y))
+ }
+ anime.timeline().add({
+ targets: particules,
+ x: function (p) {
+ return p.endPos.x
+ },
+ y: function (p) {
+ return p.endPos.y
+ },
+ radius: 0.1,
+ duration: anime.random(1200, 1800),
+ easing: 'easeOutExpo',
+ update: renderParticule
+ })
+ .add({
+ targets: circle,
+ radius: anime.random(80, 160),
+ lineWidth: 0,
+ alpha: {
+ value: 0,
+ easing: 'linear',
+ duration: anime.random(600, 800)
+ },
+ duration: anime.random(1200, 1800),
+ easing: 'easeOutExpo',
+ update: renderParticule,
+ offset: 0
+ })
+}
\ No newline at end of file
diff --git a/source/js/third-party/piao.js b/source/js/third-party/piao.js
new file mode 100644
index 0000000..1e020ba
--- /dev/null
+++ b/source/js/third-party/piao.js
@@ -0,0 +1,334 @@
+
+ (function (name, factory) {
+ if (typeof window === "object") {
+ window[name] = factory()
+ }
+ })("Ribbons", function () {
+ var _w = window,
+ _b = document.body,
+ _d = document.documentElement;
+ var random = function () {
+ if (arguments.length === 1) {
+ if (Array.isArray(arguments[0])) {
+ var index = Math.round(random(0, arguments[0].length - 1));
+ return arguments[0][index]
+ }
+ return random(0, arguments[0])
+ } else if (arguments.length === 2) {
+ return Math.random() * (arguments[1] - arguments[0]) + arguments[0]
+ }
+ return 0
+ };
+ var screenInfo = function (e) {
+ var width = Math.max(0, _w.innerWidth || _d.clientWidth || _b.clientWidth || 0),
+ height = Math.max(0, _w.innerHeight || _d.clientHeight || _b.clientHeight || 0),
+ scrollx = Math.max(0, _w.pageXOffset || _d.scrollLeft || _b.scrollLeft || 0) - (_d.clientLeft || 0),
+ scrolly = Math.max(0, _w.pageYOffset || _d.scrollTop || _b.scrollTop || 0) - (_d.clientTop || 0);
+ return {
+ width: width,
+ height: height,
+ ratio: width / height,
+ centerx: width / 2,
+ centery: height / 2,
+ scrollx: scrollx,
+ scrolly: scrolly
+ }
+ };
+ var mouseInfo = function (e) {
+ var screen = screenInfo(e),
+ mousex = e ? Math.max(0, e.pageX || e.clientX || 0) : 0,
+ mousey = e ? Math.max(0, e.pageY || e.clientY || 0) : 0;
+ return {
+ mousex: mousex,
+ mousey: mousey,
+ centerx: mousex - screen.width / 2,
+ centery: mousey - screen.height / 2
+ }
+ };
+ var Point = function (x, y) {
+ this.x = 0;
+ this.y = 0;
+ this.set(x, y)
+ };
+ Point.prototype = {
+ constructor: Point,
+ set: function (x, y) {
+ this.x = x || 0;
+ this.y = y || 0
+ },
+ copy: function (point) {
+ this.x = point.x || 0;
+ this.y = point.y || 0;
+ return this
+ },
+ multiply: function (x, y) {
+ this.x *= x || 1;
+ this.y *= y || 1;
+ return this
+ },
+ divide: function (x, y) {
+ this.x /= x || 1;
+ this.y /= y || 1;
+ return this
+ },
+ add: function (x, y) {
+ this.x += x || 0;
+ this.y += y || 0;
+ return this
+ },
+ subtract: function (x, y) {
+ this.x -= x || 0;
+ this.y -= y || 0;
+ return this
+ },
+ clampX: function (min, max) {
+ this.x = Math.max(min, Math.min(this.x, max));
+ return this
+ },
+ clampY: function (min, max) {
+ this.y = Math.max(min, Math.min(this.y, max));
+ return this
+ },
+ flipX: function () {
+ this.x *= -1;
+ return this
+ },
+ flipY: function () {
+ this.y *= -1;
+ return this
+ }
+ };
+ var Factory = function (options) {
+ this._canvas = null;
+ this._context = null;
+ this._sto = null;
+ this._width = 0;
+ this._height = 0;
+ this._scroll = 0;
+ this._ribbons = [];
+ this._options = {
+ colorSaturation: "80%",
+ colorBrightness: "60%",
+ colorAlpha: 0.65,
+ colorCycleSpeed: 6,
+ verticalPosition: "center",
+ horizontalSpeed: 150,
+ ribbonCount: 5,
+ strokeSize: 5,
+ parallaxAmount: -0.5,
+ animateSections: true
+ };
+ this._onDraw = this._onDraw.bind(this);
+ this._onResize = this._onResize.bind(this);
+ this._onScroll = this._onScroll.bind(this);
+ this.setOptions(options);
+ this.init()
+ };
+ Factory.prototype = {
+ constructor: Factory,
+ setOptions: function (options) {
+ if (typeof options === "object") {
+ for (var key in options) {
+ if (options.hasOwnProperty(key)) {
+ this._options[key] = options[key]
+ }
+ }
+ }
+ },
+ init: function () {
+ try {
+ this._canvas = document.createElement("canvas");
+ this._canvas.style["display"] = "block";
+ this._canvas.style["position"] = "fixed";
+ this._canvas.style["margin"] = "0";
+ this._canvas.style["padding"] = "0";
+ this._canvas.style["border"] = "0";
+ this._canvas.style["outline"] = "0";
+ this._canvas.style["left"] = "0";
+ this._canvas.style["top"] = "0";
+ this._canvas.style["width"] = "100%";
+ this._canvas.style["height"] = "100%";
+ this._canvas.style["z-index"] = "-1";
+ this._onResize();
+ this._context = this._canvas.getContext("2d");
+ this._context.clearRect(0, 0, this._width, this._height);
+ this._context.globalAlpha = this._options.colorAlpha;
+ window.addEventListener("resize", this._onResize);
+ window.addEventListener("scroll", this._onScroll);
+ document.body.appendChild(this._canvas)
+ } catch (e) {
+ console.warn("Canvas Context Error: " + e.toString());
+ return
+ }
+ this._onDraw()
+ },
+ addRibbon: function () {
+ var dir = Math.round(random(1, 9)) > 5 ? "right" : "left",
+ stop = 1000,
+ hide = 200,
+ min = 0 - hide,
+ max = this._width + hide,
+ movex = 0,
+ movey = 0,
+ startx = dir === "right" ? min : max,
+ starty = Math.round(random(0, this._height));
+ if (/^(top|min)$/i.test(this._options.verticalPosition)) {
+ starty = 0 + hide
+ } else if (/^(middle|center)$/i.test(this._options.verticalPosition)) {
+ starty = this._height / 2
+ } else if (/^(bottom|max)$/i.test(this._options.verticalPosition)) {
+ starty = this._height - hide
+ }
+ var ribbon = [],
+ point1 = new Point(startx, starty),
+ point2 = new Point(startx, starty),
+ point3 = null,
+ color = Math.round(random(0, 360)),
+ delay = 0;
+ while (true) {
+ if (stop <= 0) break;
+ stop--;
+ movex = Math.round((Math.random() * 1 - 0.2) * this._options.horizontalSpeed);
+ movey = Math.round((Math.random() * 1 - 0.5) * (this._height * 0.25));
+ point3 = new Point();
+ point3.copy(point2);
+ if (dir === "right") {
+ point3.add(movex, movey);
+ if (point2.x >= max) break
+ } else if (dir === "left") {
+ point3.subtract(movex, movey);
+ if (point2.x <= min) break
+ }
+ ribbon.push({
+ point1: new Point(point1.x, point1.y),
+ point2: new Point(point2.x, point2.y),
+ point3: point3,
+ color: color,
+ delay: delay,
+ dir: dir,
+ alpha: 0,
+ phase: 0
+ });
+ point1.copy(point2);
+ point2.copy(point3);
+ delay += 4;
+ color += this._options.colorCycleSpeed
+ }
+ this._ribbons.push(ribbon)
+ },
+ _drawRibbonSection: function (section) {
+ if (section) {
+ if (section.phase >= 1 && section.alpha <= 0) {
+ return true
+ }
+ if (section.delay <= 0) {
+ section.phase += 0.02;
+ section.alpha = Math.sin(section.phase) * 1;
+ section.alpha = section.alpha <= 0 ? 0 : section.alpha;
+ section.alpha = section.alpha >= 1 ? 1 : section.alpha;
+ if (this._options.animateSections) {
+ var mod = Math.sin(1 + section.phase * Math.PI / 2) * 0.1;
+ if (section.dir === "right") {
+ section.point1.add(mod, 0);
+ section.point2.add(mod, 0);
+ section.point3.add(mod, 0)
+ } else {
+ section.point1.subtract(mod, 0);
+ section.point2.subtract(mod, 0);
+ section.point3.subtract(mod, 0)
+ }
+ section.point1.add(0, mod);
+ section.point2.add(0, mod);
+ section.point3.add(0, mod)
+ }
+ } else {
+ section.delay -= 0.5
+ }
+ var s = this._options.colorSaturation,
+ l = this._options.colorBrightness,
+ c = "hsla(" + section.color + ", " + s + ", " + l + ", " + section.alpha + " )";
+ this._context.save();
+ if (this._options.parallaxAmount !== 0) {
+ this._context.translate(0, this._scroll * this._options.parallaxAmount)
+ }
+ this._context.beginPath();
+ this._context.moveTo(section.point1.x, section.point1.y);
+ this._context.lineTo(section.point2.x, section.point2.y);
+ this._context.lineTo(section.point3.x, section.point3.y);
+ this._context.fillStyle = c;
+ this._context.fill();
+ if (this._options.strokeSize > 0) {
+ this._context.lineWidth = this._options.strokeSize;
+ this._context.strokeStyle = c;
+ this._context.lineCap = "round";
+ this._context.stroke()
+ }
+ this._context.restore()
+ }
+ return false
+ },
+ _onDraw: function () {
+ for (var i = 0, t = this._ribbons.length; i < t; ++i) {
+ if (!this._ribbons[i]) {
+ this._ribbons.splice(i, 1)
+ }
+ }
+ this._context.clearRect(0, 0, this._width, this._height);
+ for (var a = 0; a < this._ribbons.length; ++a) {
+ var ribbon = this._ribbons[a],
+ numSections = ribbon.length,
+ numDone = 0;
+ for (var b = 0; b < numSections; ++b) {
+ if (this._drawRibbonSection(ribbon[b])) {
+ numDone++
+ }
+ }
+ if (numDone >= numSections) {
+ this._ribbons[a] = null
+ }
+ }
+ if (this._ribbons.length < this._options.ribbonCount) {
+ this.addRibbon()
+ }
+ requestAnimationFrame(this._onDraw)
+ },
+ _onResize: function (e) {
+ var screen = screenInfo(e);
+ this._width = screen.width;
+ this._height = screen.height;
+ if (this._canvas) {
+ this._canvas.width = this._width;
+ this._canvas.height = this._height;
+ if (this._context) {
+ this._context.globalAlpha = this._options.colorAlpha
+ }
+ }
+ },
+ _onScroll: function (e) {
+ var screen = screenInfo(e);
+ this._scroll = screen.scrolly
+ }
+ };
+ return Factory
+ });
+
+ var cn = document.getElementById('ribbon_piao');
+ var mb = cn.getAttribute("mobile");
+
+ if ( mb == 'false' && (/Android|webOS|iPhone|iPod|iPad|BlackBerry/i.test(navigator.userAgent))) {
+
+ } else {
+ new Ribbons({
+ colorSaturation: "60%",
+ colorBrightness: "50%",
+ colorAlpha: 0.5,
+ colorCycleSpeed: 5,
+ verticalPosition: "random",
+ horizontalSpeed: 200,
+ ribbonCount: 3,
+ strokeSize: 0,
+ parallaxAmount: -0.2,
+ animateSections: true
+ });
+ }
+
diff --git a/source/js/tw_cn.js b/source/js/tw_cn.js
index eafc640..a663127 100644
--- a/source/js/tw_cn.js
+++ b/source/js/tw_cn.js
@@ -1,12 +1,12 @@
var translate = GLOBAL_CONFIG.translate;
var Snackbar_tl = GLOBAL_CONFIG.Snackbar;
-var defaultEncoding = translate.defaultEncoding; // 网站默认语言,1: 繁體中文, 2: 简体中文
-var translateDelay = translate.translateDelay; //延迟时间,若不在前, 要设定延迟翻译时间, 如100表示100ms,默认为0
-var cookieDomain = translate.cookieDomain; //更改为你的博客网址
-var msgToTraditionalChinese = translate.msgToTraditionalChinese; //此处可以更改为你想要显示的文字
-var msgToSimplifiedChinese = translate.msgToSimplifiedChinese; //同上,但两处均不建议更改
-var translateButtonId = "translateLink"; //默认互换id
+var defaultEncoding = translate.defaultEncoding; // 網站默認語言,1: 繁體中文, 2: 簡體中文
+var translateDelay = translate.translateDelay; //延遲時間,若不在前, 要設定延遲翻譯時間, 如100表示100ms,默認為0
+var cookieDomain = translate.cookieDomain; //更改為你的博客網址
+var msgToTraditionalChinese = translate.msgToTraditionalChinese; //此處可以更改為你想要顯示的文字
+var msgToSimplifiedChinese = translate.msgToSimplifiedChinese; //同上,但兩處均不建議更改
+var translateButtonId = "translateLink"; //默認互換id
var currentEncoding = defaultEncoding;
var targetEncodingCookie = "targetEncoding" + cookieDomain.replace(/\./g, "");
var targetEncoding =
@@ -71,10 +71,10 @@ function translatePage() {
}
}
function JTPYStr() {
- return "万与丑专业丛东丝丢两严丧个丬丰临为丽举么义乌乐乔习乡书买乱争于亏云亘亚产亩亲亵亸亿仅从仑仓仪们价众优伙会伛伞伟传伤伥伦伧伪伫体余佣佥侠侣侥侦侧侨侩侪侬俣俦俨俩俪俭债倾偬偻偾偿傥傧储傩儿兑兖党兰关兴兹养兽冁内冈册写军农冢冯冲决况冻净凄凉凌减凑凛几凤凫凭凯击凼凿刍划刘则刚创删别刬刭刽刿剀剂剐剑剥剧劝办务劢动励劲劳势勋勐勚匀匦匮区医华协单卖卢卤卧卫却卺厂厅历厉压厌厍厕厢厣厦厨厩厮县参叆叇双发变叙叠叶号叹叽吁后吓吕吗吣吨听启吴呒呓呕呖呗员呙呛呜咏咔咙咛咝咤咴咸哌响哑哒哓哔哕哗哙哜哝哟唛唝唠唡唢唣唤唿啧啬啭啮啰啴啸喷喽喾嗫呵嗳嘘嘤嘱噜噼嚣嚯团园囱围囵国图圆圣圹场坂坏块坚坛坜坝坞坟坠垄垅垆垒垦垧垩垫垭垯垱垲垴埘埙埚埝埯堑堕塆墙壮声壳壶壸处备复够头夸夹夺奁奂奋奖奥妆妇妈妩妪妫姗姜娄娅娆娇娈娱娲娴婳婴婵婶媪嫒嫔嫱嬷孙学孪宁宝实宠审宪宫宽宾寝对寻导寿将尔尘尧尴尸尽层屃屉届属屡屦屿岁岂岖岗岘岙岚岛岭岳岽岿峃峄峡峣峤峥峦崂崃崄崭嵘嵚嵛嵝嵴巅巩巯币帅师帏帐帘帜带帧帮帱帻帼幂幞干并广庄庆庐庑库应庙庞废庼廪开异弃张弥弪弯弹强归当录彟彦彻径徕御忆忏忧忾怀态怂怃怄怅怆怜总怼怿恋恳恶恸恹恺恻恼恽悦悫悬悭悯惊惧惨惩惫惬惭惮惯愍愠愤愦愿慑慭憷懑懒懔戆戋戏戗战戬户扎扑扦执扩扪扫扬扰抚抛抟抠抡抢护报担拟拢拣拥拦拧拨择挂挚挛挜挝挞挟挠挡挢挣挤挥挦捞损捡换捣据捻掳掴掷掸掺掼揸揽揿搀搁搂搅携摄摅摆摇摈摊撄撑撵撷撸撺擞攒敌敛数斋斓斗斩断无旧时旷旸昙昼昽显晋晒晓晔晕晖暂暧札术朴机杀杂权条来杨杩杰极构枞枢枣枥枧枨枪枫枭柜柠柽栀栅标栈栉栊栋栌栎栏树栖样栾桊桠桡桢档桤桥桦桧桨桩梦梼梾检棂椁椟椠椤椭楼榄榇榈榉槚槛槟槠横樯樱橥橱橹橼檐檩欢欤欧歼殁殇残殒殓殚殡殴毁毂毕毙毡毵氇气氢氩氲汇汉污汤汹沓沟没沣沤沥沦沧沨沩沪沵泞泪泶泷泸泺泻泼泽泾洁洒洼浃浅浆浇浈浉浊测浍济浏浐浑浒浓浔浕涂涌涛涝涞涟涠涡涢涣涤润涧涨涩淀渊渌渍渎渐渑渔渖渗温游湾湿溃溅溆溇滗滚滞滟滠满滢滤滥滦滨滩滪漤潆潇潋潍潜潴澜濑濒灏灭灯灵灾灿炀炉炖炜炝点炼炽烁烂烃烛烟烦烧烨烩烫烬热焕焖焘煅煳熘爱爷牍牦牵牺犊犟状犷犸犹狈狍狝狞独狭狮狯狰狱狲猃猎猕猡猪猫猬献獭玑玙玚玛玮环现玱玺珉珏珐珑珰珲琎琏琐琼瑶瑷璇璎瓒瓮瓯电画畅畲畴疖疗疟疠疡疬疮疯疱疴痈痉痒痖痨痪痫痴瘅瘆瘗瘘瘪瘫瘾瘿癞癣癫癯皑皱皲盏盐监盖盗盘眍眦眬着睁睐睑瞒瞩矫矶矾矿砀码砖砗砚砜砺砻砾础硁硅硕硖硗硙硚确硷碍碛碜碱碹磙礼祎祢祯祷祸禀禄禅离秃秆种积称秽秾稆税稣稳穑穷窃窍窑窜窝窥窦窭竖竞笃笋笔笕笺笼笾筑筚筛筜筝筹签简箓箦箧箨箩箪箫篑篓篮篱簖籁籴类籼粜粝粤粪粮糁糇紧絷纟纠纡红纣纤纥约级纨纩纪纫纬纭纮纯纰纱纲纳纴纵纶纷纸纹纺纻纼纽纾线绀绁绂练组绅细织终绉绊绋绌绍绎经绐绑绒结绔绕绖绗绘给绚绛络绝绞统绠绡绢绣绤绥绦继绨绩绪绫绬续绮绯绰绱绲绳维绵绶绷绸绹绺绻综绽绾绿缀缁缂缃缄缅缆缇缈缉缊缋缌缍缎缏缐缑缒缓缔缕编缗缘缙缚缛缜缝缞缟缠缡缢缣缤缥缦缧缨缩缪缫缬缭缮缯缰缱缲缳缴缵罂网罗罚罢罴羁羟羡翘翙翚耢耧耸耻聂聋职聍联聩聪肃肠肤肷肾肿胀胁胆胜胧胨胪胫胶脉脍脏脐脑脓脔脚脱脶脸腊腌腘腭腻腼腽腾膑臜舆舣舰舱舻艰艳艹艺节芈芗芜芦苁苇苈苋苌苍苎苏苘苹茎茏茑茔茕茧荆荐荙荚荛荜荞荟荠荡荣荤荥荦荧荨荩荪荫荬荭荮药莅莜莱莲莳莴莶获莸莹莺莼萚萝萤营萦萧萨葱蒇蒉蒋蒌蓝蓟蓠蓣蓥蓦蔷蔹蔺蔼蕲蕴薮藁藓虏虑虚虫虬虮虽虾虿蚀蚁蚂蚕蚝蚬蛊蛎蛏蛮蛰蛱蛲蛳蛴蜕蜗蜡蝇蝈蝉蝎蝼蝾螀螨蟏衅衔补衬衮袄袅袆袜袭袯装裆裈裢裣裤裥褛褴襁襕见观觃规觅视觇览觉觊觋觌觍觎觏觐觑觞触觯詟誉誊讠计订讣认讥讦讧讨让讪讫训议讯记讱讲讳讴讵讶讷许讹论讻讼讽设访诀证诂诃评诅识诇诈诉诊诋诌词诎诏诐译诒诓诔试诖诗诘诙诚诛诜话诞诟诠诡询诣诤该详诧诨诩诪诫诬语诮误诰诱诲诳说诵诶请诸诹诺读诼诽课诿谀谁谂调谄谅谆谇谈谊谋谌谍谎谏谐谑谒谓谔谕谖谗谘谙谚谛谜谝谞谟谠谡谢谣谤谥谦谧谨谩谪谫谬谭谮谯谰谱谲谳谴谵谶谷豮贝贞负贠贡财责贤败账货质贩贪贫贬购贮贯贰贱贲贳贴贵贶贷贸费贺贻贼贽贾贿赀赁赂赃资赅赆赇赈赉赊赋赌赍赎赏赐赑赒赓赔赕赖赗赘赙赚赛赜赝赞赟赠赡赢赣赪赵赶趋趱趸跃跄跖跞践跶跷跸跹跻踊踌踪踬踯蹑蹒蹰蹿躏躜躯车轧轨轩轪轫转轭轮软轰轱轲轳轴轵轶轷轸轹轺轻轼载轾轿辀辁辂较辄辅辆辇辈辉辊辋辌辍辎辏辐辑辒输辔辕辖辗辘辙辚辞辩辫边辽达迁过迈运还这进远违连迟迩迳迹适选逊递逦逻遗遥邓邝邬邮邹邺邻郁郄郏郐郑郓郦郧郸酝酦酱酽酾酿释里鉅鉴銮錾钆钇针钉钊钋钌钍钎钏钐钑钒钓钔钕钖钗钘钙钚钛钝钞钟钠钡钢钣钤钥钦钧钨钩钪钫钬钭钮钯钰钱钲钳钴钵钶钷钸钹钺钻钼钽钾钿铀铁铂铃铄铅铆铈铉铊铋铍铎铏铐铑铒铕铗铘铙铚铛铜铝铞铟铠铡铢铣铤铥铦铧铨铪铫铬铭铮铯铰铱铲铳铴铵银铷铸铹铺铻铼铽链铿销锁锂锃锄锅锆锇锈锉锊锋锌锍锎锏锐锑锒锓锔锕锖锗错锚锜锞锟锠锡锢锣锤锥锦锨锩锫锬锭键锯锰锱锲锳锴锵锶锷锸锹锺锻锼锽锾锿镀镁镂镃镆镇镈镉镊镌镍镎镏镐镑镒镕镖镗镙镚镛镜镝镞镟镠镡镢镣镤镥镦镧镨镩镪镫镬镭镮镯镰镱镲镳镴镶长门闩闪闫闬闭问闯闰闱闲闳间闵闶闷闸闹闺闻闼闽闾闿阀阁阂阃阄阅阆阇阈阉阊阋阌阍阎阏阐阑阒阓阔阕阖阗阘阙阚阛队阳阴阵阶际陆陇陈陉陕陧陨险随隐隶隽难雏雠雳雾霁霉霭靓静靥鞑鞒鞯鞴韦韧韨韩韪韫韬韵页顶顷顸项顺须顼顽顾顿颀颁颂颃预颅领颇颈颉颊颋颌颍颎颏颐频颒颓颔颕颖颗题颙颚颛颜额颞颟颠颡颢颣颤颥颦颧风飏飐飑飒飓飔飕飖飗飘飙飚飞飨餍饤饥饦饧饨饩饪饫饬饭饮饯饰饱饲饳饴饵饶饷饸饹饺饻饼饽饾饿馀馁馂馃馄馅馆馇馈馉馊馋馌馍馎馏馐馑馒馓馔馕马驭驮驯驰驱驲驳驴驵驶驷驸驹驺驻驼驽驾驿骀骁骂骃骄骅骆骇骈骉骊骋验骍骎骏骐骑骒骓骔骕骖骗骘骙骚骛骜骝骞骟骠骡骢骣骤骥骦骧髅髋髌鬓魇魉鱼鱽鱾鱿鲀鲁鲂鲄鲅鲆鲇鲈鲉鲊鲋鲌鲍鲎鲏鲐鲑鲒鲓鲔鲕鲖鲗鲘鲙鲚鲛鲜鲝鲞鲟鲠鲡鲢鲣鲤鲥鲦鲧鲨鲩鲪鲫鲬鲭鲮鲯鲰鲱鲲鲳鲴鲵鲶鲷鲸鲹鲺鲻鲼鲽鲾鲿鳀鳁鳂鳃鳄鳅鳆鳇鳈鳉鳊鳋鳌鳍鳎鳏鳐鳑鳒鳓鳔鳕鳖鳗鳘鳙鳛鳜鳝鳞鳟鳠鳡鳢鳣鸟鸠鸡鸢鸣鸤鸥鸦鸧鸨鸩鸪鸫鸬鸭鸮鸯鸰鸱鸲鸳鸴鸵鸶鸷鸸鸹鸺鸻鸼鸽鸾鸿鹀鹁鹂鹃鹄鹅鹆鹇鹈鹉鹊鹋鹌鹍鹎鹏鹐鹑鹒鹓鹔鹕鹖鹗鹘鹚鹛鹜鹝鹞鹟鹠鹡鹢鹣鹤鹥鹦鹧鹨鹩鹪鹫鹬鹭鹯鹰鹱鹲鹳鹴鹾麦麸黄黉黡黩黪黾";
+ return "萬與醜專業叢東絲丟兩嚴喪個丬豐臨為麗舉麼義烏樂喬習鄉書買亂爭於虧雲亙亞產畝親褻嚲億僅從侖倉儀們價眾優夥會傴傘偉傳傷倀倫傖偽佇體餘傭僉俠侶僥偵側僑儈儕儂俁儔儼倆儷儉債傾傯僂僨償儻儐儲儺兒兌兗黨蘭關興茲養獸囅內岡冊寫軍農冢馮沖決況凍淨淒涼凌減湊凜幾鳳鳧憑凱擊凼鑿芻劃劉則剛創刪別剗剄劊劌剴劑剮劍剝劇勸辦務勱動勵勁勞勢勳勐勩勻匭匱區醫華協單賣盧滷臥衛卻巹廠廳歷厲壓厭厙廁廂厴廈廚廄廝縣參靉靆雙發變敘疊葉號嘆嘰籲後嚇呂嗎唚噸聽啟吳嘸囈嘔嚦唄員咼嗆嗚詠咔嚨嚀噝吒咴鹹哌響啞噠嘵嗶噦譁噲嚌噥喲嘜嗊嘮啢嗩唣喚唿嘖嗇囀齧囉嘽嘯噴嘍嚳囁呵噯噓嚶囑嚕噼囂嚯團園囪圍圇國圖圓聖壙場阪壞塊堅壇壢壩塢墳墜壟壠壚壘墾垧堊墊埡墶壋塏堖塒壎堝埝垵塹墮壪牆壯聲殼壺壼處備復夠頭誇夾奪奩奐奮獎奧妝婦媽嫵嫗媯姍姜婁婭嬈嬌孌娛媧嫻嫿嬰嬋嬸媼嬡嬪嬙嬤孫學孿寧寶實寵審憲宮寬賓寢對尋導壽將爾塵堯尷屍盡層屓屜屆屬屢屨嶼歲豈嶇崗峴嶴嵐島嶺嶽崬巋嶨嶧峽嶢嶠崢巒嶗崍嶮嶄嶸嶔嵛嶁嵴巔鞏巰幣帥師幃帳簾幟帶幀幫幬幘幗冪襆幹並廣莊慶廬廡庫應廟龐廢廎廩開異棄張彌弳彎彈強歸當錄彠彥徹徑徠御憶懺憂愾懷態慫憮慪悵愴憐總懟懌戀懇惡慟懨愷惻惱惲悅愨懸慳憫驚懼慘懲憊愜慚憚慣愍慍憤憒願懾憖憷懣懶懍戇戔戲戧戰戩戶扎撲扦執擴捫掃揚擾撫拋摶摳掄搶護報擔擬攏揀擁攔擰撥擇掛摯攣掗撾撻挾撓擋撟掙擠揮撏撈損撿換搗據捻擄摑擲撣摻摜揸攬撳攙擱摟攪攜攝攄擺搖擯攤攖撐攆擷擼攛擻攢敵斂數齋斕鬥斬斷無舊時曠暘曇晝曨顯晉晒曉曄暈暉暫曖札術樸機殺雜權條來楊榪傑極構樅樞棗櫪梘棖槍楓梟櫃檸檉梔柵標棧櫛櫳棟櫨櫟欄樹棲樣欒桊椏橈楨檔榿橋樺檜槳樁夢檮棶檢櫺槨櫝槧欏橢樓欖櫬櫚櫸檟檻檳櫧橫檣櫻櫫櫥櫓櫞檐檁歡歟歐殲歿殤殘殞殮殫殯毆毀轂畢斃氈毿氌氣氫氬氳匯漢汙湯洶沓溝沒灃漚瀝淪滄渢溈滬沵濘淚澩瀧瀘濼瀉潑澤涇潔灑窪浹淺漿澆湞溮濁測澮濟瀏滻渾滸濃潯濜塗湧濤澇淶漣潿渦溳渙滌潤澗漲澀澱淵淥漬瀆漸澠漁瀋滲溫遊灣溼潰濺漵漊潷滾滯灩灄滿瀅濾濫灤濱灘澦漤瀠瀟瀲濰潛瀦瀾瀨瀕灝滅燈靈災燦煬爐燉煒熗點煉熾爍爛烴燭煙煩燒燁燴燙燼熱煥燜燾煅煳熘愛爺牘犛牽犧犢犟狀獷獁猶狽狍獮獰獨狹獅獪猙獄猻獫獵獼玀豬貓蝟獻獺璣璵瑒瑪瑋環現瑲璽珉珏琺瓏璫琿璡璉瑣瓊瑤璦璇瓔瓚甕甌電畫暢畲疇癤療瘧癘瘍癧瘡瘋皰痾癰痙癢瘂癆瘓癇痴癉瘮瘞瘻癟癱癮癭癩癬癲癯皚皺皸盞鹽監蓋盜盤瞘眥矓著睜睞瞼瞞矚矯磯礬礦碭碼磚硨硯碸礪礱礫礎硜硅碩硤磽磑礄確礆礙磧磣鹼碹磙禮禕禰禎禱禍稟祿禪離禿稈種積稱穢穠穭稅穌穩穡窮竊竅窯竄窩窺竇窶豎競篤筍筆筧箋籠籩築篳篩簹箏籌籤簡籙簀篋籜籮簞簫簣簍籃籬籪籟糴類秈糶糲粵糞糧糝餱緊縶糹糾紆紅紂纖紇約級紈纊紀紉緯紜紘純紕紗綱納紝縱綸紛紙紋紡紵紖紐紓線紺紲紱練組紳細織終縐絆紼絀紹繹經紿綁絨結絝繞絰絎繪給絢絳絡絕絞統綆綃絹繡綌綏絛繼綈績緒綾緓續綺緋綽鞝緄繩維綿綬繃綢綯綹綣綜綻綰綠綴緇緙緗緘緬纜緹緲緝縕繢緦綞緞緶線緱縋緩締縷編緡緣縉縛縟縝縫縗縞纏縭縊縑繽縹縵縲纓縮繆繅纈繚繕繒繮繾繰繯繳纘罌網羅罰罷羆羈羥羨翹翽翬耮耬聳恥聶聾職聹聯聵聰肅腸膚肷腎腫脹脅膽勝朧腖臚脛膠脈膾髒臍腦膿臠腳脫腡臉臘醃膕齶膩靦膃騰臏臢輿艤艦艙艫艱豔艹藝節羋薌蕪蘆蓯葦藶莧萇蒼苧蘇檾蘋莖蘢蔦塋煢繭荊薦薘莢蕘蓽蕎薈薺蕩榮葷滎犖熒蕁藎蓀蔭蕒葒葤藥蒞莜萊蓮蒔萵薟獲蕕瑩鶯蓴蘀蘿螢營縈蕭薩蔥蕆蕢蔣蔞藍薊蘺蕷鎣驀薔蘞藺藹蘄蘊藪藁蘚虜慮虛蟲虯蟣雖蝦蠆蝕蟻螞蠶蠔蜆蠱蠣蟶蠻蟄蛺蟯螄蠐蛻蝸蠟蠅蟈蟬蠍螻蠑螿蟎蠨釁銜補襯袞襖嫋褘襪襲襏裝襠褌褳襝褲襉褸襤襁襴見觀覎規覓視覘覽覺覬覡覿覥覦覯覲覷觴觸觶讋譽謄訁計訂訃認譏訐訌討讓訕訖訓議訊記訒講諱謳詎訝訥許訛論訩訟諷設訪訣證詁訶評詛識詗詐訴診詆謅詞詘詔詖譯詒誆誄試詿詩詰詼誠誅詵話誕詬詮詭詢詣諍該詳詫諢詡譸誡誣語誚誤誥誘誨誑說誦誒請諸諏諾讀諑誹課諉諛誰諗調諂諒諄誶談誼謀諶諜謊諫諧謔謁謂諤諭諼讒諮諳諺諦謎諞諝謨讜謖謝謠謗諡謙謐謹謾謫譾謬譚譖譙讕譜譎讞譴譫讖谷豶貝貞負貟貢財責賢敗賬貨質販貪貧貶購貯貫貳賤賁貰貼貴貺貸貿費賀貽賊贄賈賄貲賃賂贓資賅贐賕賑賚賒賦賭齎贖賞賜贔賙賡賠賧賴賵贅賻賺賽賾贗贊贇贈贍贏贛赬趙趕趨趲躉躍蹌跖躒踐躂蹺蹕躚躋踴躊蹤躓躑躡蹣躕躥躪躦軀車軋軌軒軑軔轉軛輪軟轟軲軻轤軸軹軼軤軫轢軺輕軾載輊轎輈輇輅較輒輔輛輦輩輝輥輞輬輟輜輳輻輯轀輸轡轅轄輾轆轍轔辭辯辮邊遼達遷過邁運還這進遠違連遲邇逕跡適選遜遞邐邏遺遙鄧鄺鄔郵鄒鄴鄰鬱郄郟鄶鄭鄆酈鄖鄲醞醱醬釅釃釀釋裡鉅鑑鑾鏨釓釔針釘釗釙釕釷釺釧釤鈒釩釣鍆釹鍚釵鈃鈣鈈鈦鈍鈔鍾鈉鋇鋼鈑鈐鑰欽鈞鎢鉤鈧鈁鈥鈄鈕鈀鈺錢鉦鉗鈷鉢鈳鉕鈽鈸鉞鑽鉬鉭鉀鈿鈾鐵鉑鈴鑠鉛鉚鈰鉉鉈鉍鈹鐸鉶銬銠鉺銪鋏鋣鐃銍鐺銅鋁銱銦鎧鍘銖銑鋌銩銛鏵銓鉿銚鉻銘錚銫鉸銥鏟銃鐋銨銀銣鑄鐒鋪鋙錸鋱鏈鏗銷鎖鋰鋥鋤鍋鋯鋨鏽銼鋝鋒鋅鋶鐦鐗銳銻鋃鋟鋦錒錆鍺錯錨錡錁錕錩錫錮鑼錘錐錦杴錈錇錟錠鍵鋸錳錙鍥鍈鍇鏘鍶鍔鍤鍬鍾鍛鎪鍠鍰鎄鍍鎂鏤鎡鏌鎮鎛鎘鑷鐫鎳鎿鎦鎬鎊鎰鎔鏢鏜鏍鏰鏞鏡鏑鏃鏇鏐鐔钁鐐鏷鑥鐓鑭鐠鑹鏹鐙鑊鐳鐶鐲鐮鐿鑔鑣鑞鑲長門閂閃閆閈閉問闖閏闈閒閎間閔閌悶閘鬧閨聞闥閩閭闓閥閣閡閫鬮閱閬闍閾閹閶鬩閿閽閻閼闡闌闃闠闊闋闔闐闒闕闞闤隊陽陰陣階際陸隴陳陘陝隉隕險隨隱隸雋難雛讎靂霧霽黴靄靚靜靨韃鞽韉鞴韋韌韍韓韙韞韜韻頁頂頃頇項順須頊頑顧頓頎頒頌頏預顱領頗頸頡頰頲頜潁熲頦頤頻頮頹頷頴穎顆題顒顎顓顏額顳顢顛顙顥纇顫顬顰顴風颺颭颮颯颶颸颼颻飀飄飆飈飛饗饜飣飢飥餳飩餼飪飫飭飯飲餞飾飽飼飿飴餌饒餉餄餎餃餏餅餑餖餓餘餒餕餜餛餡館餷饋餶餿饞饁饃餺餾饈饉饅饊饌饢馬馭馱馴馳驅馹駁驢駔駛駟駙駒騶駐駝駑駕驛駘驍罵駰驕驊駱駭駢驫驪騁驗騂駸駿騏騎騍騅騌驌驂騙騭騤騷騖驁騮騫騸驃騾驄驏驟驥驦驤髏髖髕鬢魘魎魚魛魢魷魨魯魴魺鮁鮃鯰鱸鮋鮓鮒鮊鮑鱟鮍鮐鮭鮚鮳鮪鮞鮦鰂鮜鱠鱭鮫鮮鮺鯗鱘鯁鱺鰱鰹鯉鰣鰷鯀鯊鯇鮶鯽鯒鯖鯪鯕鯫鯡鯤鯧鯝鯢鯰鯛鯨鰺鯴鯔鱝鰈鰏鱨鯷鰮鰃鰓鱷鰍鰒鰉鰁鱂鯿鰠鰲鰭鰨鰥鰩鰟鰜鰳鰾鱈鱉鰻鰵鱅鰼鱖鱔鱗鱒鱯鱤鱧鱣鳥鳩雞鳶鳴鳲鷗鴉鶬鴇鴆鴣鶇鸕鴨鴞鴦鴒鴟鴝鴛鷽鴕鷥鷙鴯鴰鵂鴴鵃鴿鸞鴻鵐鵓鸝鵑鵠鵝鵒鷳鵜鵡鵲鶓鵪鵾鵯鵬鵮鶉鶊鵷鷫鶘鶡鶚鶻鶿鶥鶩鷊鷂鶲鶹鶺鷁鶼鶴鷖鸚鷓鷚鷯鷦鷲鷸鷺鸇鷹鸌鸏鸛鸘鹺麥麩黃黌黶黷黲黽";
}
function FTPYStr() {
- return "萬與醜專業叢東絲丟兩嚴喪個爿豐臨為麗舉麼義烏樂喬習鄉書買亂爭於虧雲亙亞產畝親褻嚲億僅從侖倉儀們價眾優夥會傴傘偉傳傷倀倫傖偽佇體餘傭僉俠侶僥偵側僑儈儕儂俁儔儼倆儷儉債傾傯僂僨償儻儐儲儺兒兌兗黨蘭關興茲養獸囅內岡冊寫軍農塚馮衝決況凍淨淒涼淩減湊凜幾鳳鳧憑凱擊氹鑿芻劃劉則剛創刪別剗剄劊劌剴劑剮劍剝劇勸辦務勱動勵勁勞勢勳猛勩勻匭匱區醫華協單賣盧鹵臥衛卻巹廠廳曆厲壓厭厙廁廂厴廈廚廄廝縣參靉靆雙發變敘疊葉號歎嘰籲後嚇呂嗎唚噸聽啟吳嘸囈嘔嚦唄員咼嗆嗚詠哢嚨嚀噝吒噅鹹呱響啞噠嘵嗶噦嘩噲嚌噥喲嘜嗊嘮啢嗩唕喚呼嘖嗇囀齧囉嘽嘯噴嘍嚳囁嗬噯噓嚶囑嚕劈囂謔團園囪圍圇國圖圓聖壙場阪壞塊堅壇壢壩塢墳墜壟壟壚壘墾坰堊墊埡墶壋塏堖塒塤堝墊垵塹墮壪牆壯聲殼壺壼處備複夠頭誇夾奪奩奐奮獎奧妝婦媽嫵嫗媯姍薑婁婭嬈嬌孌娛媧嫻嫿嬰嬋嬸媼嬡嬪嬙嬤孫學孿寧寶實寵審憲宮寬賓寢對尋導壽將爾塵堯尷屍盡層屭屜屆屬屢屨嶼歲豈嶇崗峴嶴嵐島嶺嶽崠巋嶨嶧峽嶢嶠崢巒嶗崍嶮嶄嶸嶔崳嶁脊巔鞏巰幣帥師幃帳簾幟帶幀幫幬幘幗冪襆幹並廣莊慶廬廡庫應廟龐廢廎廩開異棄張彌弳彎彈強歸當錄彠彥徹徑徠禦憶懺憂愾懷態慫憮慪悵愴憐總懟懌戀懇惡慟懨愷惻惱惲悅愨懸慳憫驚懼慘懲憊愜慚憚慣湣慍憤憒願懾憖怵懣懶懍戇戔戲戧戰戩戶紮撲扡執擴捫掃揚擾撫拋摶摳掄搶護報擔擬攏揀擁攔擰撥擇掛摯攣掗撾撻挾撓擋撟掙擠揮撏撈損撿換搗據撚擄摑擲撣摻摜摣攬撳攙擱摟攪攜攝攄擺搖擯攤攖撐攆擷擼攛擻攢敵斂數齋斕鬥斬斷無舊時曠暘曇晝曨顯晉曬曉曄暈暉暫曖劄術樸機殺雜權條來楊榪傑極構樅樞棗櫪梘棖槍楓梟櫃檸檉梔柵標棧櫛櫳棟櫨櫟欄樹棲樣欒棬椏橈楨檔榿橋樺檜槳樁夢檮棶檢欞槨櫝槧欏橢樓欖櫬櫚櫸檟檻檳櫧橫檣櫻櫫櫥櫓櫞簷檁歡歟歐殲歿殤殘殞殮殫殯毆毀轂畢斃氈毿氌氣氫氬氳彙漢汙湯洶遝溝沒灃漚瀝淪滄渢溈滬濔濘淚澩瀧瀘濼瀉潑澤涇潔灑窪浹淺漿澆湞溮濁測澮濟瀏滻渾滸濃潯濜塗湧濤澇淶漣潿渦溳渙滌潤澗漲澀澱淵淥漬瀆漸澠漁瀋滲溫遊灣濕潰濺漵漊潷滾滯灩灄滿瀅濾濫灤濱灘澦濫瀠瀟瀲濰潛瀦瀾瀨瀕灝滅燈靈災燦煬爐燉煒熗點煉熾爍爛烴燭煙煩燒燁燴燙燼熱煥燜燾煆糊溜愛爺牘犛牽犧犢強狀獷獁猶狽麅獮獰獨狹獅獪猙獄猻獫獵獼玀豬貓蝟獻獺璣璵瑒瑪瑋環現瑲璽瑉玨琺瓏璫琿璡璉瑣瓊瑤璦璿瓔瓚甕甌電畫暢佘疇癤療瘧癘瘍鬁瘡瘋皰屙癰痙癢瘂癆瘓癇癡癉瘮瘞瘺癟癱癮癭癩癬癲臒皚皺皸盞鹽監蓋盜盤瞘眥矓著睜睞瞼瞞矚矯磯礬礦碭碼磚硨硯碸礪礱礫礎硜矽碩硤磽磑礄確鹼礙磧磣堿镟滾禮禕禰禎禱禍稟祿禪離禿稈種積稱穢穠穭稅穌穩穡窮竊竅窯竄窩窺竇窶豎競篤筍筆筧箋籠籩築篳篩簹箏籌簽簡籙簀篋籜籮簞簫簣簍籃籬籪籟糴類秈糶糲粵糞糧糝餱緊縶糸糾紆紅紂纖紇約級紈纊紀紉緯紜紘純紕紗綱納紝縱綸紛紙紋紡紵紖紐紓線紺絏紱練組紳細織終縐絆紼絀紹繹經紿綁絨結絝繞絰絎繪給絢絳絡絕絞統綆綃絹繡綌綏絛繼綈績緒綾緓續綺緋綽緔緄繩維綿綬繃綢綯綹綣綜綻綰綠綴緇緙緗緘緬纜緹緲緝縕繢緦綞緞緶線緱縋緩締縷編緡緣縉縛縟縝縫縗縞纏縭縊縑繽縹縵縲纓縮繆繅纈繚繕繒韁繾繰繯繳纘罌網羅罰罷羆羈羥羨翹翽翬耮耬聳恥聶聾職聹聯聵聰肅腸膚膁腎腫脹脅膽勝朧腖臚脛膠脈膾髒臍腦膿臠腳脫腡臉臘醃膕齶膩靦膃騰臏臢輿艤艦艙艫艱豔艸藝節羋薌蕪蘆蓯葦藶莧萇蒼苧蘇檾蘋莖蘢蔦塋煢繭荊薦薘莢蕘蓽蕎薈薺蕩榮葷滎犖熒蕁藎蓀蔭蕒葒葤藥蒞蓧萊蓮蒔萵薟獲蕕瑩鶯蓴蘀蘿螢營縈蕭薩蔥蕆蕢蔣蔞藍薊蘺蕷鎣驀薔蘞藺藹蘄蘊藪槁蘚虜慮虛蟲虯蟣雖蝦蠆蝕蟻螞蠶蠔蜆蠱蠣蟶蠻蟄蛺蟯螄蠐蛻蝸蠟蠅蟈蟬蠍螻蠑螿蟎蠨釁銜補襯袞襖嫋褘襪襲襏裝襠褌褳襝褲襇褸襤繈襴見觀覎規覓視覘覽覺覬覡覿覥覦覯覲覷觴觸觶讋譽謄訁計訂訃認譏訐訌討讓訕訖訓議訊記訒講諱謳詎訝訥許訛論訩訟諷設訪訣證詁訶評詛識詗詐訴診詆謅詞詘詔詖譯詒誆誄試詿詩詰詼誠誅詵話誕詬詮詭詢詣諍該詳詫諢詡譸誡誣語誚誤誥誘誨誑說誦誒請諸諏諾讀諑誹課諉諛誰諗調諂諒諄誶談誼謀諶諜謊諫諧謔謁謂諤諭諼讒諮諳諺諦謎諞諝謨讜謖謝謠謗諡謙謐謹謾謫譾謬譚譖譙讕譜譎讞譴譫讖穀豶貝貞負貟貢財責賢敗賬貨質販貪貧貶購貯貫貳賤賁貰貼貴貺貸貿費賀貽賊贄賈賄貲賃賂贓資賅贐賕賑賚賒賦賭齎贖賞賜贔賙賡賠賧賴賵贅賻賺賽賾贗讚贇贈贍贏贛赬趙趕趨趲躉躍蹌蹠躒踐躂蹺蹕躚躋踴躊蹤躓躑躡蹣躕躥躪躦軀車軋軌軒軑軔轉軛輪軟轟軲軻轤軸軹軼軤軫轢軺輕軾載輊轎輈輇輅較輒輔輛輦輩輝輥輞輬輟輜輳輻輯轀輸轡轅轄輾轆轍轔辭辯辮邊遼達遷過邁運還這進遠違連遲邇逕跡適選遜遞邐邏遺遙鄧鄺鄔郵鄒鄴鄰鬱郤郟鄶鄭鄆酈鄖鄲醞醱醬釅釃釀釋裏钜鑒鑾鏨釓釔針釘釗釙釕釷釺釧釤鈒釩釣鍆釹鍚釵鈃鈣鈈鈦鈍鈔鍾鈉鋇鋼鈑鈐鑰欽鈞鎢鉤鈧鈁鈥鈄鈕鈀鈺錢鉦鉗鈷缽鈳鉕鈽鈸鉞鑽鉬鉭鉀鈿鈾鐵鉑鈴鑠鉛鉚鈰鉉鉈鉍鈹鐸鉶銬銠鉺銪鋏鋣鐃銍鐺銅鋁銱銦鎧鍘銖銑鋌銩銛鏵銓鉿銚鉻銘錚銫鉸銥鏟銃鐋銨銀銣鑄鐒鋪鋙錸鋱鏈鏗銷鎖鋰鋥鋤鍋鋯鋨鏽銼鋝鋒鋅鋶鐦鐧銳銻鋃鋟鋦錒錆鍺錯錨錡錁錕錩錫錮鑼錘錐錦鍁錈錇錟錠鍵鋸錳錙鍥鍈鍇鏘鍶鍔鍤鍬鍾鍛鎪鍠鍰鎄鍍鎂鏤鎡鏌鎮鎛鎘鑷鐫鎳鎿鎦鎬鎊鎰鎔鏢鏜鏍鏰鏞鏡鏑鏃鏇鏐鐔钁鐐鏷鑥鐓鑭鐠鑹鏹鐙鑊鐳鐶鐲鐮鐿鑔鑣鑞鑲長門閂閃閆閈閉問闖閏闈閑閎間閔閌悶閘鬧閨聞闥閩閭闓閥閣閡閫鬮閱閬闍閾閹閶鬩閿閽閻閼闡闌闃闠闊闋闔闐闒闕闞闤隊陽陰陣階際陸隴陳陘陝隉隕險隨隱隸雋難雛讎靂霧霽黴靄靚靜靨韃鞽韉韝韋韌韍韓韙韞韜韻頁頂頃頇項順須頊頑顧頓頎頒頌頏預顱領頗頸頡頰頲頜潁熲頦頤頻頮頹頷頴穎顆題顒顎顓顏額顳顢顛顙顥纇顫顬顰顴風颺颭颮颯颶颸颼颻飀飄飆飆飛饗饜飣饑飥餳飩餼飪飫飭飯飲餞飾飽飼飿飴餌饒餉餄餎餃餏餅餑餖餓餘餒餕餜餛餡館餷饋餶餿饞饁饃餺餾饈饉饅饊饌饢馬馭馱馴馳驅馹駁驢駔駛駟駙駒騶駐駝駑駕驛駘驍罵駰驕驊駱駭駢驫驪騁驗騂駸駿騏騎騍騅騌驌驂騙騭騤騷騖驁騮騫騸驃騾驄驏驟驥驦驤髏髖髕鬢魘魎魚魛魢魷魨魯魴魺鮁鮃鯰鱸鮋鮓鮒鮊鮑鱟鮍鮐鮭鮚鮳鮪鮞鮦鰂鮜鱠鱭鮫鮮鮺鯗鱘鯁鱺鰱鰹鯉鰣鰷鯀鯊鯇鮶鯽鯒鯖鯪鯕鯫鯡鯤鯧鯝鯢鯰鯛鯨鯵鯴鯔鱝鰈鰏鱨鯷鰮鰃鰓鱷鰍鰒鰉鰁鱂鯿鰠鼇鰭鰨鰥鰩鰟鰜鰳鰾鱈鱉鰻鰵鱅鰼鱖鱔鱗鱒鱯鱤鱧鱣鳥鳩雞鳶鳴鳲鷗鴉鶬鴇鴆鴣鶇鸕鴨鴞鴦鴒鴟鴝鴛鴬鴕鷥鷙鴯鴰鵂鴴鵃鴿鸞鴻鵐鵓鸝鵑鵠鵝鵒鷳鵜鵡鵲鶓鵪鶤鵯鵬鵮鶉鶊鵷鷫鶘鶡鶚鶻鶿鶥鶩鷊鷂鶲鶹鶺鷁鶼鶴鷖鸚鷓鷚鷯鷦鷲鷸鷺鸇鷹鸌鸏鸛鸘鹺麥麩黃黌黶黷黲黽";
+ return "萬與醜專業叢東絲丟兩嚴喪個爿豐臨為麗舉麼義烏樂喬習鄉書買亂爭於虧雲亙亞產畝親褻嚲億僅從侖倉儀們價眾優夥會傴傘偉傳傷倀倫傖偽佇體餘傭僉俠侶僥偵側僑儈儕儂俁儔儼倆儷儉債傾傯僂僨償儻儐儲儺兒兌兗黨蘭關興茲養獸囅內岡冊寫軍農塚馮衝決況凍淨淒涼淩減湊凜幾鳳鳧憑凱擊氹鑿芻劃劉則剛創刪別剗剄劊劌剴劑剮劍剝劇勸辦務勱動勵勁勞勢勳猛勩勻匭匱區醫華協單賣盧鹵臥衛卻巹廠廳曆厲壓厭厙廁廂厴廈廚廄廝縣參靉靆雙發變敘疊葉號歎嘰籲後嚇呂嗎唚噸聽啟吳嘸囈嘔嚦唄員咼嗆嗚詠哢嚨嚀噝吒噅鹹呱響啞噠嘵嗶噦嘩噲嚌噥喲嘜嗊嘮啢嗩唕喚呼嘖嗇囀齧囉嘽嘯噴嘍嚳囁嗬噯噓嚶囑嚕劈囂謔團園囪圍圇國圖圓聖壙場阪壞塊堅壇壢壩塢墳墜壟壟壚壘墾坰堊墊埡墶壋塏堖塒塤堝墊垵塹墮壪牆壯聲殼壺壼處備複夠頭誇夾奪奩奐奮獎奧妝婦媽嫵嫗媯姍薑婁婭嬈嬌孌娛媧嫻嫿嬰嬋嬸媼嬡嬪嬙嬤孫學孿寧寶實寵審憲宮寬賓寢對尋導壽將爾塵堯尷屍盡層屭屜屆屬屢屨嶼歲豈嶇崗峴嶴嵐島嶺嶽崠巋嶨嶧峽嶢嶠崢巒嶗崍嶮嶄嶸嶔崳嶁脊巔鞏巰幣帥師幃帳簾幟帶幀幫幬幘幗冪襆幹並廣莊慶廬廡庫應廟龐廢廎廩開異棄張彌弳彎彈強歸當錄彠彥徹徑徠禦憶懺憂愾懷態慫憮慪悵愴憐總懟懌戀懇惡慟懨愷惻惱惲悅愨懸慳憫驚懼慘懲憊愜慚憚慣湣慍憤憒願懾憖怵懣懶懍戇戔戲戧戰戩戶紮撲扡執擴捫掃揚擾撫拋摶摳掄搶護報擔擬攏揀擁攔擰撥擇掛摯攣掗撾撻挾撓擋撟掙擠揮撏撈損撿換搗據撚擄摑擲撣摻摜摣攬撳攙擱摟攪攜攝攄擺搖擯攤攖撐攆擷擼攛擻攢敵斂數齋斕鬥斬斷無舊時曠暘曇晝曨顯晉晒曉曄暈暉暫曖劄術樸機殺雜權條來楊榪傑極構樅樞棗櫪梘棖槍楓梟櫃檸檉梔柵標棧櫛櫳棟櫨櫟欄樹棲樣欒棬椏橈楨檔榿橋樺檜槳樁夢檮棶檢欞槨櫝槧欏橢樓欖櫬櫚櫸檟檻檳櫧橫檣櫻櫫櫥櫓櫞簷檁歡歟歐殲歿殤殘殞殮殫殯毆毀轂畢斃氈毿氌氣氫氬氳彙漢汙湯洶遝溝沒灃漚瀝淪滄渢溈滬濔濘淚澩瀧瀘濼瀉潑澤涇潔灑窪浹淺漿澆湞溮濁測澮濟瀏滻渾滸濃潯濜塗湧濤澇淶漣潿渦溳渙滌潤澗漲澀澱淵淥漬瀆漸澠漁瀋滲溫遊灣濕潰濺漵漊潷滾滯灩灄滿瀅濾濫灤濱灘澦濫瀠瀟瀲濰潛瀦瀾瀨瀕灝滅燈靈災燦煬爐燉煒熗點煉熾爍爛烴燭煙煩燒燁燴燙燼熱煥燜燾煆糊溜愛爺牘犛牽犧犢強狀獷獁猶狽麅獮獰獨狹獅獪猙獄猻獫獵獼玀豬貓蝟獻獺璣璵瑒瑪瑋環現瑲璽瑉玨琺瓏璫琿璡璉瑣瓊瑤璦璿瓔瓚甕甌電畫暢佘疇癤療瘧癘瘍鬁瘡瘋皰屙癰痙癢瘂癆瘓癇痴癉瘮瘞瘺癟癱癮癭癩癬癲臒皚皺皸盞鹽監蓋盜盤瞘眥矓著睜睞瞼瞞矚矯磯礬礦碭碼磚硨硯碸礪礱礫礎硜矽碩硤磽磑礄確鹼礙磧磣堿鏇滾禮禕禰禎禱禍稟祿禪離禿稈種積稱穢穠穭稅穌穩穡窮竊竅窯竄窩窺竇窶豎競篤筍筆筧箋籠籩築篳篩簹箏籌簽簡籙簀篋籜籮簞簫簣簍籃籬籪籟糴類秈糶糲粵糞糧糝餱緊縶糸糾紆紅紂纖紇約級紈纊紀紉緯紜紘純紕紗綱納紝縱綸紛紙紋紡紵紖紐紓線紺絏紱練組紳細織終縐絆紼絀紹繹經紿綁絨結絝繞絰絎繪給絢絳絡絕絞統綆綃絹繡綌綏絛繼綈績緒綾緓續綺緋綽緔緄繩維綿綬繃綢綯綹綣綜綻綰綠綴緇緙緗緘緬纜緹緲緝縕繢緦綞緞緶線緱縋緩締縷編緡緣縉縛縟縝縫縗縞纏縭縊縑繽縹縵縲纓縮繆繅纈繚繕繒韁繾繰繯繳纘罌網羅罰罷羆羈羥羨翹翽翬耮耬聳恥聶聾職聹聯聵聰肅腸膚膁腎腫脹脅膽勝朧腖臚脛膠脈膾髒臍腦膿臠腳脫腡臉臘醃膕齶膩靦膃騰臏臢輿艤艦艙艫艱豔艸藝節羋薌蕪蘆蓯葦藶莧萇蒼薴蘇檾蘋莖蘢蔦塋煢繭荊薦薘莢蕘蓽蕎薈薺蕩榮葷滎犖熒蕁藎蓀蔭蕒葒葤藥蒞蓧萊蓮蒔萵薟獲蕕瑩鶯蓴蘀蘿螢營縈蕭薩蔥蕆蕢蔣蔞藍薊蘺蕷鎣驀薔蘞藺藹蘄蘊藪槁蘚虜慮虛蟲虯蟣雖蝦蠆蝕蟻螞蠶蠔蜆蠱蠣蟶蠻蟄蛺蟯螄蠐蛻蝸蠟蠅蟈蟬蠍螻蠑螿蟎蠨釁銜補襯袞襖嫋褘襪襲襏裝襠褌褳襝褲襇褸襤繈襴見觀覎規覓視覘覽覺覬覡覿覥覦覯覲覷觴觸觶讋譽謄訁計訂訃認譏訐訌討讓訕訖訓議訊記訒講諱謳詎訝訥許訛論訩訟諷設訪訣證詁訶評詛識詗詐訴診詆謅詞詘詔詖譯詒誆誄試詿詩詰詼誠誅詵話誕詬詮詭詢詣諍該詳詫諢詡譸誡誣語誚誤誥誘誨誑說誦誒請諸諏諾讀諑誹課諉諛誰諗調諂諒諄誶談誼謀諶諜謊諫諧謔謁謂諤諭諼讒諮諳諺諦謎諞諝謨讜謖謝謠謗諡謙謐謹謾謫譾謬譚譖譙讕譜譎讞譴譫讖穀豶貝貞負貟貢財責賢敗賬貨質販貪貧貶購貯貫貳賤賁貰貼貴貺貸貿費賀貽賊贄賈賄貲賃賂贓資賅贐賕賑賚賒賦賭齎贖賞賜贔賙賡賠賧賴賵贅賻賺賽賾贗讚贇贈贍贏贛赬趙趕趨趲躉躍蹌蹠躒踐躂蹺蹕躚躋踴躊蹤躓躑躡蹣躕躥躪躦軀車軋軌軒軑軔轉軛輪軟轟軲軻轤軸軹軼軤軫轢軺輕軾載輊轎輈輇輅較輒輔輛輦輩輝輥輞輬輟輜輳輻輯轀輸轡轅轄輾轆轍轔辭辯辮邊遼達遷過邁運還這進遠違連遲邇逕跡適選遜遞邐邏遺遙鄧鄺鄔郵鄒鄴鄰鬱郤郟鄶鄭鄆酈鄖鄲醞醱醬釅釃釀釋裡鉅鑒鑾鏨釓釔針釘釗釙釕釷釺釧釤鈒釩釣鍆釹鍚釵鈃鈣鈈鈦鈍鈔鍾鈉鋇鋼鈑鈐鑰欽鈞鎢鉤鈧鈁鈥鈄鈕鈀鈺錢鉦鉗鈷缽鈳鉕鈽鈸鉞鑽鉬鉭鉀鈿鈾鐵鉑鈴鑠鉛鉚鈰鉉鉈鉍鈹鐸鉶銬銠鉺銪鋏鋣鐃銍鐺銅鋁銱銦鎧鍘銖銑鋌銩銛鏵銓鉿銚鉻銘錚銫鉸銥鏟銃鐋銨銀銣鑄鐒鋪鋙錸鋱鏈鏗銷鎖鋰鋥鋤鍋鋯鋨鏽銼鋝鋒鋅鋶鐦鐧銳銻鋃鋟鋦錒錆鍺錯錨錡錁錕錩錫錮鑼錘錐錦鍁錈錇錟錠鍵鋸錳錙鍥鍈鍇鏘鍶鍔鍤鍬鍾鍛鎪鍠鍰鎄鍍鎂鏤鎡鏌鎮鎛鎘鑷鐫鎳鎿鎦鎬鎊鎰鎔鏢鏜鏍鏰鏞鏡鏑鏃鏇鏐鐔钁鐐鏷鑥鐓鑭鐠鑹鏹鐙鑊鐳鐶鐲鐮鐿鑔鑣鑞鑲長門閂閃閆閈閉問闖閏闈閑閎間閔閌悶閘鬧閨聞闥閩閭闓閥閣閡閫鬮閱閬闍閾閹閶鬩閿閽閻閼闡闌闃闠闊闋闔闐闒闕闞闤隊陽陰陣階際陸隴陳陘陝隉隕險隨隱隸雋難雛讎靂霧霽黴靄靚靜靨韃鞽韉韝韋韌韍韓韙韞韜韻頁頂頃頇項順須頊頑顧頓頎頒頌頏預顱領頗頸頡頰頲頜潁熲頦頤頻頮頹頷頴穎顆題顒顎顓顏額顳顢顛顙顥纇顫顬顰顴風颺颭颮颯颶颸颼颻飀飄飆飆飛饗饜飣饑飥餳飩餼飪飫飭飯飲餞飾飽飼飿飴餌饒餉餄餎餃餏餅餑餖餓餘餒餕餜餛餡館餷饋餶餿饞饁饃餺餾饈饉饅饊饌饢馬馭馱馴馳驅馹駁驢駔駛駟駙駒騶駐駝駑駕驛駘驍罵駰驕驊駱駭駢驫驪騁驗騂駸駿騏騎騍騅騌驌驂騙騭騤騷騖驁騮騫騸驃騾驄驏驟驥驦驤髏髖髕鬢魘魎魚魛魢魷魨魯魴魺鮁鮃鯰鱸鮋鮓鮒鮊鮑鱟鮍鮐鮭鮚鮳鮪鮞鮦鰂鮜鱠鱭鮫鮮鮺鯗鱘鯁鱺鰱鰹鯉鰣鰷鯀鯊鯇鮶鯽鯒鯖鯪鯕鯫鯡鯤鯧鯝鯢鯰鯛鯨鯵鯴鯔鱝鰈鰏鱨鯷鰮鰃鰓鱷鰍鰒鰉鰁鱂鯿鰠鼇鰭鰨鰥鰩鰟鰜鰳鰾鱈鱉鰻鰵鱅鰼鱖鱔鱗鱒鱯鱤鱧鱣鳥鳩雞鳶鳴鳲鷗鴉鶬鴇鴆鴣鶇鸕鴨鴞鴦鴒鴟鴝鴛鴬鴕鷥鷙鴯鴰鵂鴴鵃鴿鸞鴻鵐鵓鸝鵑鵠鵝鵒鷳鵜鵡鵲鶓鵪鶤鵯鵬鵮鶉鶊鵷鷫鶘鶡鶚鶻鶿鶥鶩鷊鷂鶲鶹鶺鷁鶼鶴鷖鸚鷓鷚鷯鷦鷲鷸鷺鸇鷹鸌鸏鸛鸘鹺麥麩黃黌黶黷黲黽";
}
function Traditionalized(cc) {
var str = "";
diff --git a/source/js/utils.js b/source/js/utils.js
index 8035168..038bc5e 100644
--- a/source/js/utils.js
+++ b/source/js/utils.js
@@ -1,7 +1,3 @@
-/**
- * function
- */
-
function debounce (func, wait, immediate) {
var timeout
return function () {
@@ -52,11 +48,33 @@ function throttle (func, wait, options) {
return throttled
}
+function sidebarPaddingR() {
+ let innerWidth = window.innerWidth
+ let clientWidth = document.body.clientWidth
+ let paddingRight = innerWidth - clientWidth
+ if (innerWidth !== clientWidth) {
+ $('body').css('padding-right', paddingRight)
+ }
+}
+
+// iPadOS
+function isIpad () {
+ return navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1
+}
+
+function isTMobile () {
+ var ua = navigator.userAgent
+ var pa = /iPad|iPhone|iPod|Android|Opera Mini|BlackBerry|webOS|UCWEB|Blazer|PSP|IEMobile|Symbian/g
+ return window.screen.width < 992 && pa.test(ua)
+}
+
function isMobile () {
- var check = false;
- (function (a) { if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4))) check = true })(navigator.userAgent || navigator.vendor || window.opera)
- return check
-};
+ return this.isIpad() || this.isTMobile()
+}
+
+function isDesktop () {
+ return !this.isMobile()
+}
function scrollTo (name) {
var scrollOffset = $(name).offset()
@@ -104,3 +122,5 @@ window.debounce = debounce
window.throttle = throttle
window.isMobile = isMobile
+
+window.loadScript = loadScript