mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-10 21:17:07 +08:00
V2.0.0
Breaking change 1. 手機端界面卡片化,同時,手機端也可以顯示側邊欄的內容 2. 修復當menu過多時,header界面出現錯亂的bug。當menu過多時,會變為sidebar模式 3. 增加medium-zoom大圖查看模式 4. 增加鼠標點擊特效:文字和愛心 兩個點擊特效 5. 主頁subtitle可以調用第三方api(金山詞霸每日一句、一言網的一句話、一句網、今日詩詞) 6. 添加 snackbar 彈窗 7. 修改nightshift為darkmode,darkmode可隨系統設置而自動切換,可設置隨時間而切換darkmode 8. 修復hexo自帶的標籤外掛(Tag Plugins)顯示bug(Block Quote、Code Block With caption、Gist、Youtube、Vimeo) 9. 主題所需要的css和js可根據需要配置CDN 10. 更改darkmode的加載方式,網站設置dark mode後,現在進入網頁不會在'閃'一下 11. 背景特效和背景圖片在手機界面也會顯示 12. 增加justified-gallery圖片顯示(Tag Plugins) Feature 1. 文章頁面,字數統計、閲讀時長和閲讀量前面添加icon 2. 更改懶加載js 3. 升級typed.js/instantpage.js到最新版 4. 搜索和右下角按鈕添加退出特效 Fixed 1. 修復在 Hexo 4.0.0下,一些按鈕點擊會跳出一個空白頁的bug 2. 修復在 Hexo 4.0.0下,分頁按鈕出現代碼的bug 3. 修復當沒有設置評論時,右下角依舊出現'直達評論'按鈕的bug 4. 優化sidebar的打開速度 5. 修復文章頁標題左右邊距不平等的bug 6. 修復keywords讀取的bug 7. 修復當post/page 內容為空時,footer位置錯亂的bug 8. 修復在手機safari,toc sidebar底部內容被遮擋的bug 9. 完善Dark mode,一些界面的配色 10. 修復 card-archives 查看更多 跳轉bug Remove 1. 移除Gitment 2. 移除Gallery
This commit is contained in:
11
README.md
11
README.md
@@ -1,5 +1,11 @@
|
|||||||
# hexo-theme-butterfly
|
# hexo-theme-butterfly
|
||||||
|
|
||||||
|
<img alt="Version" src="https://img.shields.io/badge/release-2.0.0-blue"/>
|
||||||
|
<a href="https://jerryc.me"><img alt="Author" src="https://img.shields.io/badge/author-JerryC-blur"/></a>
|
||||||
|
<a href="https://hexo.io"><img alt="Hexo" src="https://img.shields.io/badge/hexo-3.0+-0e83c"/></a>
|
||||||
|
<a href="https://nodejs.org/"><img alt="node.js" src="https://img.shields.io/badge/node.js-6.0%2B-43853d"/></a>
|
||||||
|
|
||||||
|
|
||||||
[预览](https://jerryc.me/)
|
[预览](https://jerryc.me/)
|
||||||
|
|
||||||
一款基于[hexo-theme-melody](https://github.com/Molunerfinn/hexo-theme-melody)修改的主题
|
一款基于[hexo-theme-melody](https://github.com/Molunerfinn/hexo-theme-melody)修改的主题
|
||||||
@@ -25,12 +31,11 @@ git clone -b dev https://github.com/jerryc127/hexo-theme-butterfly.git themes/Bu
|
|||||||
theme: Butterfly
|
theme: Butterfly
|
||||||
```
|
```
|
||||||
|
|
||||||
>如果你没有pug以及stylus的渲染器,请下载安装: npm install hexo-renderer-jade hexo-renderer-stylus --save or yarn add hexo-renderer-jade hexo-renderer-stylus
|
>如果你没有pug以及stylus的渲染器,请下载安装: npm install hexo-renderer-pug hexo-renderer-stylus --save or yarn add hexo-renderer-pug hexo-renderer-stylus
|
||||||
|
|
||||||
## 文档
|
## 文档
|
||||||
|
|
||||||
可查看或[这里](https://docs.jerryc.me/)或[这里](https://jerryc.me/posts/21cfbf15)
|
可查看[这里](https://jerryc.me/posts/21cfbf15)
|
||||||
|
|
||||||
|
|
||||||
## 截图
|
## 截图
|
||||||

|

|
||||||
|
|||||||
221
_config.yml
221
_config.yml
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
# Main menu navigation
|
# Main menu navigation
|
||||||
# ---------------
|
# ---------------
|
||||||
# format: xxx: 連結 || icon
|
# format: xxx: 連結 || icon
|
||||||
@@ -16,7 +15,6 @@ menu:
|
|||||||
- Music || /music/ || fa fa-music
|
- Music || /music/ || fa fa-music
|
||||||
- Movie || /movies/ || fa fa-film
|
- Movie || /movies/ || fa fa-film
|
||||||
|
|
||||||
|
|
||||||
# Favicon
|
# Favicon
|
||||||
# ---------------
|
# ---------------
|
||||||
favicon: /img/favicon.ico
|
favicon: /img/favicon.ico
|
||||||
@@ -32,8 +30,6 @@ favicon: /img/favicon.ico
|
|||||||
# favicon_32_32: /img/pwa/32.png
|
# favicon_32_32: /img/pwa/32.png
|
||||||
# favicon_16_16: /img/pwa/16.png
|
# favicon_16_16: /img/pwa/16.png
|
||||||
# mask_icon: /img/pwa/safari-pinned-tab.svg
|
# mask_icon: /img/pwa/safari-pinned-tab.svg
|
||||||
# shortcut_icon: /img/favicon.ico
|
|
||||||
|
|
||||||
|
|
||||||
# Highlight theme
|
# Highlight theme
|
||||||
# ---------------
|
# ---------------
|
||||||
@@ -48,7 +44,7 @@ code_word_wrap: false
|
|||||||
# 是否禁止複製(如果禁止,highlight_copy的功能將無效)
|
# 是否禁止複製(如果禁止,highlight_copy的功能將無效)
|
||||||
# copyright 複製的内容後面加上版權信息
|
# copyright 複製的内容後面加上版權信息
|
||||||
copy:
|
copy:
|
||||||
enable: false # true 開啓 / false 禁止
|
enable: true # true 開啓 / false 禁止
|
||||||
copyright: false
|
copyright: false
|
||||||
|
|
||||||
# social settings
|
# social settings
|
||||||
@@ -57,6 +53,7 @@ copy:
|
|||||||
# ---------------
|
# ---------------
|
||||||
social:
|
social:
|
||||||
fa fa-github: https://github.com/jerryc127
|
fa fa-github: https://github.com/jerryc127
|
||||||
|
fa fa-envelope: mailto:xxxxxxxx@gmail.com
|
||||||
fa fa-rss: /atom.xml
|
fa fa-rss: /atom.xml
|
||||||
|
|
||||||
#### search ####
|
#### search ####
|
||||||
@@ -86,17 +83,13 @@ local_search:
|
|||||||
# ---------------
|
# ---------------
|
||||||
mathjax:
|
mathjax:
|
||||||
enable: false
|
enable: false
|
||||||
cdn: https://cdn.jsdelivr.net/npm/mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML
|
|
||||||
|
|
||||||
# KaTeX
|
# KaTeX
|
||||||
# ---------------
|
# ---------------
|
||||||
katex:
|
katex:
|
||||||
enable: false
|
enable: false
|
||||||
cdn:
|
|
||||||
css: https://cdn.jsdelivr.net/npm/katex@latest/dist/katex.min.css
|
|
||||||
hide_scrollbar: true
|
hide_scrollbar: true
|
||||||
|
|
||||||
|
|
||||||
#### Analysis ####
|
#### Analysis ####
|
||||||
# ---------------
|
# ---------------
|
||||||
# baidu_analytics:
|
# baidu_analytics:
|
||||||
@@ -105,41 +98,21 @@ katex:
|
|||||||
google_analytics:
|
google_analytics:
|
||||||
|
|
||||||
|
|
||||||
# stylesheets loaded in the <head>
|
|
||||||
# ---------------
|
|
||||||
stylesheets:
|
|
||||||
- /css/index.css
|
|
||||||
|
|
||||||
# scripts loaded in the end of the body
|
|
||||||
# ---------------
|
|
||||||
scripts:
|
|
||||||
- /js/utils.js
|
|
||||||
- /js/main.js
|
|
||||||
|
|
||||||
# cdn for third-party library
|
|
||||||
# ---------------
|
|
||||||
cdn:
|
|
||||||
css:
|
|
||||||
fontawesome: https://cdn.jsdelivr.net/npm/font-awesome@latest/css/font-awesome.min.css
|
|
||||||
# fontawesomeV5: https://use.fontawesome.com/releases/v5.8.1/css/all.css
|
|
||||||
fancybox: https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css
|
|
||||||
js:
|
|
||||||
jquery: https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js
|
|
||||||
fancybox: https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js
|
|
||||||
js-cookies: https://cdn.jsdelivr.net/npm/js-cookie@2/src/js.cookie.min.js
|
|
||||||
|
|
||||||
# Post info settings
|
# Post info settings
|
||||||
# ---------------
|
# ---------------
|
||||||
# avatar: /img/avatar.png
|
# avatar: /img/avatar.png
|
||||||
avatar: https://cdn.jsdelivr.net/gh/jerryc127/CDN@latest/Photo/avatar.png
|
avatar: https://cdn.jsdelivr.net/gh/jerryc127/CDN@latest/Photo/avatar.png
|
||||||
|
|
||||||
# the banner image of index
|
# the banner image of index
|
||||||
# if the banner of another page not setting,it will show the top_img
|
|
||||||
top_img: https://i.loli.net/2019/05/22/5ce53eb6dc82757840.jpg
|
top_img: https://i.loli.net/2019/05/22/5ce53eb6dc82757840.jpg
|
||||||
|
# 以下鏈接是動態壁紙,每次刷新會更換
|
||||||
|
# https://source.unsplash.com/collection/collectionid/1600x900
|
||||||
|
# https://uploadbeta.com/api/pictures/random/?key=BingEverydayWallpaperPicture
|
||||||
|
# https://api.dujin.org/bing/1920.php
|
||||||
|
# https://api.dujin.org/bing/1366.php
|
||||||
|
|
||||||
#the banner image of post
|
# if the banner of page not setting,it will show the top_img
|
||||||
# if the post not set the post cover and post top image, it will show it
|
default_top_img: https://cdn.jsdelivr.net/gh/jerryc127/CDN/img/top_img_index.jpg
|
||||||
post_img: https://cdn.jsdelivr.net/gh/jerryc127/CDN@latest/Photo/post.png
|
|
||||||
|
|
||||||
# the default cover of the post
|
# the default cover of the post
|
||||||
default_cover: https://cdn.jsdelivr.net/gh/jerryc127/CDN@latest/cover/default_bg.png
|
default_cover: https://cdn.jsdelivr.net/gh/jerryc127/CDN@latest/cover/default_bg.png
|
||||||
@@ -153,6 +126,9 @@ tag_img: https://cdn.jsdelivr.net/gh/jerryc127/CDN/img/tag-bg.png
|
|||||||
# the banner image of category page
|
# the banner image of category page
|
||||||
category_img: https://cdn.jsdelivr.net/gh/jerryc127/CDN/img/category-bg
|
category_img: https://cdn.jsdelivr.net/gh/jerryc127/CDN/img/category-bg
|
||||||
|
|
||||||
|
# 如果你有使用hexo-douban去生成movie界面,可配置這個
|
||||||
|
movies_img: https://cdn.jsdelivr.net/gh/jerryc127/CDN/Photo/movie.jpg
|
||||||
|
|
||||||
# if the photo link cannot connect,it will show that
|
# if the photo link cannot connect,it will show that
|
||||||
lodding_bg:
|
lodding_bg:
|
||||||
flink: /img/friend_404.gif
|
flink: /img/friend_404.gif
|
||||||
@@ -185,7 +161,6 @@ auto_excerpt:
|
|||||||
enable: true
|
enable: true
|
||||||
length: 150
|
length: 150
|
||||||
|
|
||||||
|
|
||||||
#### Share System ####
|
#### Share System ####
|
||||||
# -----------------------------------------
|
# -----------------------------------------
|
||||||
addThis:
|
addThis:
|
||||||
@@ -215,15 +190,8 @@ disqus:
|
|||||||
shortname:
|
shortname:
|
||||||
|
|
||||||
# laibili:
|
# laibili:
|
||||||
# enable: false
|
# enable: false
|
||||||
# uid:
|
# uid:
|
||||||
|
|
||||||
# gitment
|
|
||||||
# enable: false
|
|
||||||
# owner:
|
|
||||||
# repo:
|
|
||||||
# client_id:
|
|
||||||
# client_secret:
|
|
||||||
|
|
||||||
# gitalk:
|
# gitalk:
|
||||||
# enable: false
|
# enable: false
|
||||||
@@ -266,7 +234,6 @@ ICP:
|
|||||||
text:
|
text:
|
||||||
icon: /img/icp.png
|
icon: /img/icp.png
|
||||||
|
|
||||||
|
|
||||||
#### 站長驗證 ####
|
#### 站長驗證 ####
|
||||||
# Google Webmaster tools verification setting
|
# Google Webmaster tools verification setting
|
||||||
# See: https://www.google.com/webmasters/
|
# See: https://www.google.com/webmasters/
|
||||||
@@ -284,7 +251,6 @@ baidu_site_verification:
|
|||||||
# see http://zhanzhang.so.com/
|
# see http://zhanzhang.so.com/
|
||||||
qihu_site_verification:
|
qihu_site_verification:
|
||||||
|
|
||||||
|
|
||||||
# 友情鏈接界面設置
|
# 友情鏈接界面設置
|
||||||
Flink:
|
Flink:
|
||||||
headline: 友情鏈接
|
headline: 友情鏈接
|
||||||
@@ -335,14 +301,12 @@ related_post:
|
|||||||
index_site_info_top: #主頁標題距離頂部距離 例如 300px/300em/300rem/10%
|
index_site_info_top: #主頁標題距離頂部距離 例如 300px/300em/300rem/10%
|
||||||
index_top_img_height: #主頁top_img高度 例如 300px/300em/300rem 不能使用百分比
|
index_top_img_height: #主頁top_img高度 例如 300px/300em/300rem 不能使用百分比
|
||||||
|
|
||||||
|
|
||||||
# category和tag頁的UI設置
|
# category和tag頁的UI設置
|
||||||
# index 值代表 UI將與首頁的UI一樣
|
# index 值代表 UI將與首頁的UI一樣
|
||||||
# 默認跟archives頁面UI一樣
|
# 默認跟archives頁面UI一樣
|
||||||
category_ui: # 留空或index
|
category_ui: # 留空或index
|
||||||
tag_ui: # 留空或index
|
tag_ui: # 留空或index
|
||||||
|
|
||||||
|
|
||||||
# 設置網站背景
|
# 設置網站背景
|
||||||
# 可設置圖片 或者 顔色
|
# 可設置圖片 或者 顔色
|
||||||
# 圖片格式 background: url(http://xxxxxx.com/xxx.jpg)
|
# 圖片格式 background: url(http://xxxxxx.com/xxx.jpg)
|
||||||
@@ -353,8 +317,9 @@ background:
|
|||||||
# footer是否顯示圖片背景(與top_img一致)
|
# footer是否顯示圖片背景(與top_img一致)
|
||||||
footer_bg: false
|
footer_bg: false
|
||||||
|
|
||||||
|
# 背景特效
|
||||||
# canvas_ribbon 靜止彩帶背景
|
# 避免卡頓,建議只開啓一個
|
||||||
|
# canvas_ribbon 禁止彩帶背景
|
||||||
# See: https://github.com/hustcc/ribbon.js
|
# See: https://github.com/hustcc/ribbon.js
|
||||||
canvas_ribbon:
|
canvas_ribbon:
|
||||||
enable: false
|
enable: false
|
||||||
@@ -362,10 +327,12 @@ canvas_ribbon:
|
|||||||
alpha: 0.6
|
alpha: 0.6
|
||||||
zIndex: -1
|
zIndex: -1
|
||||||
click_to_change: false
|
click_to_change: false
|
||||||
|
mobile: false # false 手機端不顯示 true 手機端顯示
|
||||||
|
|
||||||
# 動態彩帶
|
# 動態彩帶
|
||||||
canvas_ribbon_piao:
|
canvas_ribbon_piao:
|
||||||
enable: false
|
enable: false
|
||||||
|
mobile: false # false 手機端不顯示 true 手機端顯示
|
||||||
|
|
||||||
# canvas_nest
|
# canvas_nest
|
||||||
# https://github.com/hustcc/canvas-nest.js
|
# https://github.com/hustcc/canvas-nest.js
|
||||||
@@ -375,23 +342,47 @@ canvas_nest:
|
|||||||
opacity: 0.7 # the opacity of line (0~1), default: 0.5.
|
opacity: 0.7 # the opacity of line (0~1), default: 0.5.
|
||||||
zIndex: -1 # z-index property of the background, default: -1.
|
zIndex: -1 # z-index property of the background, default: -1.
|
||||||
count: 99 # the number of lines, default: 99.
|
count: 99 # the number of lines, default: 99.
|
||||||
script: https://cdn.jsdelivr.net/gh/jerryc127/CDN/js/canvas-nest.js # or /js/third-party/canvas-nest.js
|
mobile: false # false 手機端不顯示 true 手機端顯示
|
||||||
|
|
||||||
# 打字效果
|
# 打字效果
|
||||||
activate_power_mode:
|
activate_power_mode:
|
||||||
enable: false
|
enable: false
|
||||||
|
|
||||||
# 鼠標點擊效果
|
# 鼠標點擊效果
|
||||||
|
# 避免卡頓,建議只開啓一個
|
||||||
|
# 點擊烟火特效
|
||||||
fireworks:
|
fireworks:
|
||||||
enable: false
|
enable: false
|
||||||
|
|
||||||
|
# 點擊出現愛心
|
||||||
|
click_heart:
|
||||||
|
enable: false
|
||||||
|
|
||||||
|
# 點擊出現文字,文字可自行修改
|
||||||
|
ClickShowText:
|
||||||
|
enable: false
|
||||||
|
text:
|
||||||
|
- 富强
|
||||||
|
- 民主
|
||||||
|
- 文明
|
||||||
|
- 和谐
|
||||||
|
- 自由
|
||||||
|
- 平等
|
||||||
|
- 公正
|
||||||
|
- 法治
|
||||||
|
- 爱国
|
||||||
|
- 敬业
|
||||||
|
- 诚信
|
||||||
|
- 友善
|
||||||
|
fontSize: 15px
|
||||||
|
|
||||||
# 頭像會一直轉圈
|
# 頭像會一直轉圈
|
||||||
avatar_effect: false
|
avatar_effect: false
|
||||||
|
|
||||||
# 網站顯示模式
|
# 網站顯示模式
|
||||||
# day 默認模式
|
# light 默認模式
|
||||||
# night 黑暗模式(不建議)
|
# dark 黑暗模式(不建議)
|
||||||
display_mode: day
|
display_mode: light
|
||||||
|
|
||||||
# 美化post頁顯示
|
# 美化post頁顯示
|
||||||
post_beautify:
|
post_beautify:
|
||||||
@@ -419,15 +410,22 @@ hr:
|
|||||||
|
|
||||||
# 主頁subtitle
|
# 主頁subtitle
|
||||||
# 打字效果
|
# 打字效果
|
||||||
# (如果有英文逗號' , ',請使用轉義字符 ,)
|
|
||||||
subtitle:
|
subtitle:
|
||||||
enable: true
|
enable: true
|
||||||
|
# source調用第三方服務
|
||||||
|
# source: false 關閉調用
|
||||||
|
# source: 1 調用金山詞霸的每日一句(簡體)
|
||||||
|
# source: 2 調用一言网的一句話(簡體) #https://hitokoto.cn/
|
||||||
|
# source: 3 調用一句网(簡體) http://yijuzhan.com/
|
||||||
|
# source: 4 調用今日詩詞(簡體) https://www.jinrishici.com/
|
||||||
|
# subtitle 會先顯示 source , 再顯示 sub 的内容
|
||||||
|
source: false
|
||||||
|
# (如果有英文逗號' , ',請使用轉義字符 ,)
|
||||||
sub:
|
sub:
|
||||||
- 今日事,今日畢
|
- 今日事,今日畢
|
||||||
- Never put off till tomorrow what you can do today
|
- Never put off till tomorrow what you can do today
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### 側邊欄 ####
|
#### 側邊欄 ####
|
||||||
#-------------------------------------
|
#-------------------------------------
|
||||||
# 側邊欄顯示設置
|
# 側邊欄顯示設置
|
||||||
@@ -459,7 +457,6 @@ runtimeshow:
|
|||||||
enable: true
|
enable: true
|
||||||
start_date: 6/7/2018 00:00:00
|
start_date: 6/7/2018 00:00:00
|
||||||
|
|
||||||
|
|
||||||
#### 右下角按鈕 ####
|
#### 右下角按鈕 ####
|
||||||
#----------------------------------------------
|
#----------------------------------------------
|
||||||
# 簡繁轉換
|
# 簡繁轉換
|
||||||
@@ -478,18 +475,39 @@ translate:
|
|||||||
#當文字是繁體時,按鈕顯示的文字
|
#當文字是繁體時,按鈕顯示的文字
|
||||||
msgToSimplifiedChinese: "简"
|
msgToSimplifiedChinese: "简"
|
||||||
|
|
||||||
# 夜間模式
|
|
||||||
nightshift:
|
|
||||||
enable: true
|
|
||||||
|
|
||||||
#閲讀模式
|
#閲讀模式
|
||||||
readmode:
|
readmode:
|
||||||
enable: true
|
enable: true
|
||||||
|
|
||||||
|
# 夜間模式
|
||||||
|
darkmode:
|
||||||
|
enable: true
|
||||||
|
|
||||||
|
# 自動切換 dark mode和 light mode
|
||||||
|
# autoChangeMode: 1 跟隨系統而變化,不支持的瀏覽器/系統將按照時間晚上6點到早上6點之間切換為 dark mode
|
||||||
|
# autoChangeMode: 2 只按照時間晚上6點到早上6點之間切換為 dark mode
|
||||||
|
# autoChangeMode: false 取消自動切換
|
||||||
|
autoChangeMode: false
|
||||||
|
|
||||||
#### other ####
|
#### other ####
|
||||||
#------------------------------------------------
|
#------------------------------------------------
|
||||||
|
|
||||||
|
# 圖片大圖查看模式
|
||||||
|
# 默認為 fancybox http://fancyapps.com/fancybox/3/
|
||||||
|
# 可以選擇改爲 medium_zoom https://github.com/francoischalifour/medium-zoom
|
||||||
|
medium_zoom:
|
||||||
|
enable: false
|
||||||
|
|
||||||
|
# Snackbar 彈窗
|
||||||
|
# https://github.com/polonel/SnackBar
|
||||||
|
# position 彈窗位置
|
||||||
|
# 可選 top-left / top-center / top-right / bottom-left / bottom-center / bottom-right
|
||||||
|
snackbar:
|
||||||
|
enable: false
|
||||||
|
position: bottom-left
|
||||||
|
bg_light: '#49b1f5' #light mode時彈窗背景
|
||||||
|
bg_dark: '#2d3035' #dark mode時彈窗背景
|
||||||
|
|
||||||
#百度推送
|
#百度推送
|
||||||
baidu_push:
|
baidu_push:
|
||||||
enable: false
|
enable: false
|
||||||
@@ -507,7 +525,7 @@ note:
|
|||||||
# - modern bs-callout new (v2-v3) alert style.
|
# - modern bs-callout new (v2-v3) alert style.
|
||||||
# - flat flat callout style with background, like on Mozilla or StackOverflow.
|
# - flat flat callout style with background, like on Mozilla or StackOverflow.
|
||||||
# - disabled disable all CSS styles import of note tag.
|
# - disabled disable all CSS styles import of note tag.
|
||||||
style: simple
|
style: flat
|
||||||
icons: true
|
icons: true
|
||||||
border_radius: 3
|
border_radius: 3
|
||||||
# Offset lighter of background in % for modern and flat styles (modern: -12 | 12; flat: -18 | 6).
|
# Offset lighter of background in % for modern and flat styles (modern: -12 | 12; flat: -18 | 6).
|
||||||
@@ -515,9 +533,9 @@ note:
|
|||||||
light_bg_offset: 0
|
light_bg_offset: 0
|
||||||
|
|
||||||
# 圖片懶加載
|
# 圖片懶加載
|
||||||
|
# https://github.com/aFarkas/lazysizes
|
||||||
lazyload:
|
lazyload:
|
||||||
enable: true
|
enable: true
|
||||||
script: https://cdn.jsdelivr.net/npm/lozad/dist/lozad.min.js
|
|
||||||
|
|
||||||
# 避免重複網址分散seo
|
# 避免重複網址分散seo
|
||||||
canonical: true
|
canonical: true
|
||||||
@@ -532,3 +550,76 @@ twitter_meta: true
|
|||||||
# facebook QQ 等 分享自動帶上樣式
|
# facebook QQ 等 分享自動帶上樣式
|
||||||
# https://i.loli.net/2019/09/08/2wbFJEKloisRvhj.png
|
# https://i.loli.net/2019/09/08/2wbFJEKloisRvhj.png
|
||||||
Open_Graph_meta: true
|
Open_Graph_meta: true
|
||||||
|
|
||||||
|
|
||||||
|
# CDN
|
||||||
|
# 網站必須
|
||||||
|
# 可根據需要自行添加js/css
|
||||||
|
CDN_USE:
|
||||||
|
css:
|
||||||
|
- /css/index.css
|
||||||
|
- https://cdn.jsdelivr.net/npm/font-awesome@latest/css/font-awesome.min.css
|
||||||
|
# - https://use.fontawesome.com/releases/v5.8.1/css/all.css #fontawesomeV5_css
|
||||||
|
|
||||||
|
js:
|
||||||
|
- https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js #/js/third-party/jquery.min.js
|
||||||
|
- /js/utils.js
|
||||||
|
- /js/main.js
|
||||||
|
|
||||||
|
|
||||||
|
# CDN
|
||||||
|
# 非必要不要修改
|
||||||
|
CDN:
|
||||||
|
#comments
|
||||||
|
blueimp-md5: https://cdn.jsdelivr.net/npm/blueimp-md5@2.10.0/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
|
||||||
|
|
||||||
|
# share
|
||||||
|
addtoany: https://static.addtoany.com/menu/page.js
|
||||||
|
sharejs: https://cdn.jsdelivr.net/npm/social-share.js@1.0.16/dist/js/social-share.min.js
|
||||||
|
sharejs_css: https://cdn.jsdelivr.net/npm/social-share.js@1.0.16/dist/css/share.min.css
|
||||||
|
|
||||||
|
#search
|
||||||
|
algolia_search: https://cdn.jsdelivr.net/npm/instantsearch.js@2.1.1/dist/instantsearch.min.js
|
||||||
|
algolia_search_css: https://cdn.jsdelivr.net/npm/instantsearch.js@2.1.1/dist/instantsearch.min.css
|
||||||
|
algolia_js: /js/search/algolia.js
|
||||||
|
local_search: /js/search/local-search.js
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
#不蒜子計數器
|
||||||
|
busuanzi: //busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js
|
||||||
|
|
||||||
|
# 背景特效
|
||||||
|
canvas_ribbon: /js/third-party/canvas-ribbon.js # https://cdn.jsdelivr.net/gh/jerryc127/butterfly_cdn@latest/js/canvas-ribbon.js
|
||||||
|
canvas_ribbon_piao: /js/third-party/piao.js # https://cdn.jsdelivr.net/gh/jerryc127/butterfly_cdn@latest/js/piao.js
|
||||||
|
canvas_nest: /js/third-party/canvas-nest.js # https://cdn.jsdelivr.net/gh/jerryc127/butterfly_cdn@latest/js/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
|
||||||
|
|
||||||
|
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 #/js/third-party/jquery.fancybox.min.js
|
||||||
|
medium_zoom: https://cdn.jsdelivr.net/npm/medium-zoom/dist/medium-zoom.min.js
|
||||||
|
|
||||||
|
snackbar_css: https://cdn.jsdelivr.net/npm/node-snackbar@0.1.15/dist/snackbar.min.css
|
||||||
|
snackbar: https://cdn.jsdelivr.net/npm/node-snackbar@0.1.15/dist/snackbar.min.js
|
||||||
|
|
||||||
|
#鼠标点击特效
|
||||||
|
anime: https://cdn.jsdelivr.net/npm/animejs@latest/anime.min.js #/js/third-party/anime.min.js
|
||||||
|
activate_power_mode: /js/third-party/activate-power-mode.js # https://cdn.jsdelivr.net/gh/jerryc127/butterfly_cdn@latest/js/activate-power-mode.js
|
||||||
|
fireworks: /js/third-party/fireworks.js # https://cdn.jsdelivr.net/gh/jerryc127/butterfly_cdn@latest/js/fireworks.js
|
||||||
|
click_heart: /js/third-party/click_heart.js # https://cdn.jsdelivr.net/gh/jerryc127/butterfly_cdn@latest/js/click_heart.js
|
||||||
|
ClickShowText: /js/third-party/ClickShowText.js # https://cdn.jsdelivr.net/gh/jerryc127/butterfly_cdn@latest/js/ClickShowText.js
|
||||||
|
|
||||||
|
translate: /js/tw_cn.js
|
||||||
|
runtimeshow: js/runtimeshow.js
|
||||||
|
|
||||||
|
|||||||
@@ -73,8 +73,7 @@ share: Share
|
|||||||
|
|
||||||
bookmark:
|
bookmark:
|
||||||
title: Bookmark
|
title: Bookmark
|
||||||
message_prev: Press
|
|
||||||
message_next: to bookmark this page
|
|
||||||
|
|
||||||
rightside:
|
rightside:
|
||||||
readmode_title: Read Mode
|
readmode_title: Read Mode
|
||||||
@@ -94,3 +93,12 @@ copy_copyright:
|
|||||||
link: Link
|
link: Link
|
||||||
source: Source
|
source: Source
|
||||||
info: Copyright is owned by the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please indicate the source.
|
info: Copyright is owned by the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please indicate the source.
|
||||||
|
|
||||||
|
Snackbar:
|
||||||
|
bookmark:
|
||||||
|
message_prev: Press
|
||||||
|
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
|
||||||
|
|||||||
@@ -72,8 +72,6 @@ donate: Donate
|
|||||||
share: Share
|
share: Share
|
||||||
bookmark:
|
bookmark:
|
||||||
title: Bookmark
|
title: Bookmark
|
||||||
message_prev: Press
|
|
||||||
message_next: to bookmark this page
|
|
||||||
|
|
||||||
rightside:
|
rightside:
|
||||||
readmode_title: Read Mode
|
readmode_title: Read Mode
|
||||||
@@ -93,3 +91,12 @@ copy_copyright:
|
|||||||
link: Link
|
link: Link
|
||||||
source: Source
|
source: Source
|
||||||
info: Copyright is owned by the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please indicate the source.
|
info: Copyright is owned by the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please indicate the source.
|
||||||
|
|
||||||
|
Snackbar:
|
||||||
|
bookmark:
|
||||||
|
message_prev: Press
|
||||||
|
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
|
||||||
|
|||||||
@@ -73,8 +73,7 @@ donate: 打赏
|
|||||||
share: 分享
|
share: 分享
|
||||||
bookmark:
|
bookmark:
|
||||||
title: 添加书签
|
title: 添加书签
|
||||||
message_prev: 按
|
|
||||||
message_next: 键将本页加入书签
|
|
||||||
|
|
||||||
rightside:
|
rightside:
|
||||||
readmode_title: 阅读模式
|
readmode_title: 阅读模式
|
||||||
@@ -94,3 +93,12 @@ copy_copyright:
|
|||||||
link: 链接
|
link: 链接
|
||||||
source: 来源
|
source: 来源
|
||||||
info: 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
|
info: 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
|
||||||
|
|
||||||
|
Snackbar:
|
||||||
|
bookmark:
|
||||||
|
message_prev: 按
|
||||||
|
message_next: 键将本页加入书签
|
||||||
|
chs_to_cht: 你已切换为繁体
|
||||||
|
cht_to_chs: 你已切换为简体
|
||||||
|
day_to_night: 你已切换为深色模式
|
||||||
|
night_to_day: 你已切换为浅色模式
|
||||||
|
|||||||
@@ -74,8 +74,7 @@ donate: 打賞
|
|||||||
share: 分享
|
share: 分享
|
||||||
bookmark:
|
bookmark:
|
||||||
title: 添加書籤
|
title: 添加書籤
|
||||||
message_prev: 按
|
|
||||||
message_next: 鍵將本頁加入書籤
|
|
||||||
|
|
||||||
rightside:
|
rightside:
|
||||||
readmode_title: 閲讀模式
|
readmode_title: 閲讀模式
|
||||||
@@ -95,3 +94,14 @@ copy_copyright:
|
|||||||
link: 鏈接
|
link: 鏈接
|
||||||
source: 來源
|
source: 來源
|
||||||
info: 著作權歸作者所有。商業轉載請聯繫作者獲得授權,非商業轉載請註明出處。
|
info: 著作權歸作者所有。商業轉載請聯繫作者獲得授權,非商業轉載請註明出處。
|
||||||
|
|
||||||
|
Snackbar:
|
||||||
|
bookmark:
|
||||||
|
message_prev: 按
|
||||||
|
message_next: 鍵將本頁加入書籤
|
||||||
|
chs_to_cht: 你已切換為繁體
|
||||||
|
cht_to_chs: 你已切換為簡體
|
||||||
|
day_to_night: 你已切換為深色模式
|
||||||
|
night_to_day: 你已切換為淺色模式
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
li.md-links-item
|
li.md-links-item
|
||||||
a(href=item.link title=item.name target="_blank")
|
a(href=item.link title=item.name target="_blank")
|
||||||
if theme.lazyload.enable
|
if theme.lazyload.enable
|
||||||
img.lozad(data-src=item.avatar onerror=`onerror=null;src='${theme.lodding_bg.flink}'` height="72px")
|
img.lazyload(data-src=item.avatar onerror=`onerror=null;src='${theme.lodding_bg.flink}'` height="72px")
|
||||||
else
|
else
|
||||||
img(src=item.avatar onerror=`onerror=null;src='${theme.lodding_bg.flink}'` height="72px")
|
img(src=item.avatar onerror=`onerror=null;src='${theme.lodding_bg.flink}'` height="72px")
|
||||||
div(class="md-links-title")= item.name
|
div(class="md-links-title")= item.name
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
extends includes/layout.pug
|
|
||||||
|
|
||||||
block content
|
|
||||||
include includes/gallery/layout.pug
|
|
||||||
@@ -1,20 +1,25 @@
|
|||||||
|
if (theme.medium_zoom && theme.medium_zoom.enable)
|
||||||
|
script(src=url_for(theme.CDN.medium_zoom))
|
||||||
|
else
|
||||||
|
script(src=url_for(theme.CDN.fancybox))
|
||||||
|
|
||||||
if (theme.algolia_search.enable)
|
if (theme.algolia_search.enable)
|
||||||
script(async src=url_for('/js/search/algolia.js'))
|
script(async src=url_for(theme.CDN.algolia_js))
|
||||||
if (theme.mathjax && theme.mathjax.enable)
|
if (theme.mathjax && theme.mathjax.enable)
|
||||||
if(!is_tag() && !is_category() && !is_archive())
|
if(!is_tag() && !is_category() && !is_archive() && !is_home())
|
||||||
include ./third-party/mathjax.pug
|
include ./third-party/mathjax.pug
|
||||||
if (theme.katex && theme.katex.enable)
|
if (theme.katex && theme.katex.enable)
|
||||||
if(!is_tag() && !is_category() && !is_archive())
|
if(!is_tag() && !is_category() && !is_archive() && !is_home())
|
||||||
include ./third-party/katex.pug
|
include ./third-party/katex.pug
|
||||||
if (theme.local_search && theme.local_search.enable)
|
if (theme.local_search && theme.local_search.enable)
|
||||||
script(async src=url_for('/js/search/local-search.js'))
|
script(async src=url_for(theme.CDN.local_search))
|
||||||
|
|
||||||
if theme.fireworks && theme.fireworks.enable
|
if theme.fireworks && theme.fireworks.enable
|
||||||
script(src='https://cdn.jsdelivr.net/npm/animejs@latest/anime.min.js')
|
script(src=url_for(theme.CDN.anime))
|
||||||
script(src=url_for('/js/third-party/fireworks.js'))
|
script(src=url_for(theme.CDN.fireworks))
|
||||||
|
|
||||||
if theme.nightshift.enable
|
if (theme.snackbar && theme.snackbar.enable)
|
||||||
script(src=url_for('js/nightshift.js'))
|
script(src=url_for(theme.CDN.snackbar))
|
||||||
|
|
||||||
if (theme.canvas_ribbon && theme.canvas_ribbon.enable)
|
if (theme.canvas_ribbon && theme.canvas_ribbon.enable)
|
||||||
include ./third-party/canvas-ribbon.pug
|
include ./third-party/canvas-ribbon.pug
|
||||||
@@ -29,55 +34,32 @@ if theme.baidu_push && theme.baidu_push.enable
|
|||||||
script(src=url_for('js/baidupush.js'))
|
script(src=url_for('js/baidupush.js'))
|
||||||
|
|
||||||
if theme.activate_power_mode.enable
|
if theme.activate_power_mode.enable
|
||||||
script(src=url_for('js/activate-power-mode.js'))
|
script(src=url_for(theme.CDN.activate_power_mode))
|
||||||
script.
|
script.
|
||||||
POWERMODE.colorful = true; // make power mode colorful
|
POWERMODE.colorful = true; // make power mode colorful
|
||||||
POWERMODE.shake = true; // turn off shake
|
POWERMODE.shake = true; // turn off shake
|
||||||
document.body.addEventListener('input', POWERMODE);
|
document.body.addEventListener('input', POWERMODE);
|
||||||
|
|
||||||
if theme.translate && theme.translate.enable
|
if theme.translate && theme.translate.enable
|
||||||
script(src=url_for('/js/tw_cn.js'))
|
script(src=url_for(theme.CDN.translate))
|
||||||
script.
|
script.
|
||||||
translateInitilization()
|
translateInitilization()
|
||||||
|
|
||||||
|
if is_home()
|
||||||
if is_home() && theme.subtitle.enable
|
include index-js.pug
|
||||||
script(src="https://cdn.jsdelivr.net/npm/typed.js@2.0.9")
|
|
||||||
script.
|
|
||||||
var typed = new Typed(".subtitle", {
|
|
||||||
strings: '!{theme.subtitle.sub}'.split(","),
|
|
||||||
startDelay: 300,
|
|
||||||
typeSpeed: 100,
|
|
||||||
loop: true,
|
|
||||||
backSpeed: 50
|
|
||||||
});
|
|
||||||
|
|
||||||
if theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv
|
if theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv
|
||||||
script(async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js")
|
script(async src=url_for(theme.CDN.busuanzi))
|
||||||
|
|
||||||
if theme.instantpage.enable
|
if theme.instantpage.enable
|
||||||
script(src="https://cdn.jsdelivr.net/npm/instant.page@1.2.2/instantpage.min.js" type="module")
|
script(src=url_for(theme.CDN.instantpage) type="module")
|
||||||
|
|
||||||
if theme.lazyload.enable
|
if theme.lazyload.enable
|
||||||
script(src=url_for(theme.lazyload.script))
|
script(src=url_for(theme.CDN.lazyload) async="")
|
||||||
script.
|
|
||||||
const observer = lozad(); // lazy loads elements with default selector as '.lozad'
|
|
||||||
observer.observe();
|
|
||||||
|
|
||||||
if is_home() && !theme.index_top_img_height && !theme.index_site_info_top
|
//- 鼠標特效
|
||||||
script.
|
if theme.click_heart && theme.click_heart.enable
|
||||||
//首頁fullpage
|
script(src=url_for(theme.CDN.click_heart))
|
||||||
function alignContent() {
|
|
||||||
for (var n = $(window).height(), e = document.querySelectorAll(".full_page"), i = 0; i < e.length; i++)
|
|
||||||
e[i].style.height = n + "px";
|
|
||||||
$("#site-info").each(function () {
|
|
||||||
var x = $(this).height();
|
|
||||||
$(this).css("top", (n-x)/2)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
alignContent();
|
|
||||||
|
|
||||||
$(window).bind("resize", function () {
|
|
||||||
alignContent()
|
|
||||||
})
|
|
||||||
|
|
||||||
|
if theme.ClickShowText && theme.ClickShowText.enable
|
||||||
|
script(src=url_for(theme.CDN.ClickShowText))
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
if theme.gitment && theme.gitment.enable
|
|
||||||
#gitment-container
|
|
||||||
script.
|
|
||||||
var gitment = new Gitment({
|
|
||||||
id: md5(decodeURI(location.pathname)),
|
|
||||||
owner: '!{theme.gitment.owner}',
|
|
||||||
repo: '!{theme.gitment.repo}',
|
|
||||||
oauth: {
|
|
||||||
client_id: '!{theme.gitment.client_id}',
|
|
||||||
client_secret: '!{theme.gitment.client_secret}'
|
|
||||||
}
|
|
||||||
})
|
|
||||||
gitment.render('gitment-container')
|
|
||||||
@@ -1,35 +1,19 @@
|
|||||||
if theme.disqus && theme.disqus.enable
|
- var d = theme.disqus && theme.disqus.enable
|
||||||
|
- var l = theme.laibili && theme.laibili.enable
|
||||||
|
- var gt = theme.gitalk && theme.gitalk.enable
|
||||||
|
- var v = theme.valine && theme.valine.enable
|
||||||
|
|
||||||
|
if d || l || gt || v
|
||||||
hr
|
hr
|
||||||
#post-comment
|
#post-comment
|
||||||
.comment_headling
|
.comment_headling
|
||||||
i.fa.fa-comments.fa-fw(aria-hidden="true")
|
i.fa.fa-comments.fa-fw(aria-hidden="true")
|
||||||
span= ' ' + _p('comment')
|
span= ' ' + _p('comment')
|
||||||
|
if d
|
||||||
include ./disqus.pug
|
include ./disqus.pug
|
||||||
else if theme.laibili && theme.laibili.enable
|
else if l
|
||||||
hr
|
|
||||||
#post-comment
|
|
||||||
.comment_headling
|
|
||||||
i.fa.fa-comments.fa-fw(aria-hidden="true")
|
|
||||||
span= ' ' + _p('comment')
|
|
||||||
include ./laibili.pug
|
include ./laibili.pug
|
||||||
else if theme.gitment && theme.gitment.enable
|
else if gt
|
||||||
hr
|
|
||||||
#post-comment
|
|
||||||
.comment_headling
|
|
||||||
i.fa.fa-comments.fa-fw(aria-hidden="true")
|
|
||||||
span= ' ' + _p('comment')
|
|
||||||
include ./gitment.pug
|
|
||||||
else if theme.gitalk && theme.gitalk.enable
|
|
||||||
hr
|
|
||||||
#post-comment
|
|
||||||
.comment_headling
|
|
||||||
i.fa.fa-comments.fa-fw(aria-hidden="true")
|
|
||||||
span= ' ' + _p('comment')
|
|
||||||
include ./gitalk.pug
|
include ./gitalk.pug
|
||||||
else if theme.valine && theme.valine.enable
|
else if v
|
||||||
hr
|
|
||||||
#post-comment
|
|
||||||
.comment_headling
|
|
||||||
i.fa.fa-comments.fa-fw(aria-hidden="true")
|
|
||||||
span= ' ' + _p('comment')
|
|
||||||
include ./valine.pug
|
include ./valine.pug
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
if theme.valine && theme.valine.enable
|
if theme.valine && theme.valine.enable
|
||||||
#vcomment.vcomment
|
#vcomment.vcomment
|
||||||
script(src='https://cdn.jsdelivr.net/npm/valine/dist/Valine.min.js')
|
script(src=url_for(theme.CDN.valine))
|
||||||
script.
|
script.
|
||||||
var notify = #{ theme.valine.notify } == true ? true : false;
|
var notify = #{ theme.valine.notify } == true ? true : false;
|
||||||
var verify = #{ theme.valine.verify } == true ? true : false;
|
var verify = #{ theme.valine.verify } == true ? true : false;
|
||||||
|
|||||||
@@ -49,9 +49,34 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
var copy_copyright_js = theme.copy.enable && theme.copy.copyright
|
var copy_copyright_js = theme.copy.enable && theme.copy.copyright;
|
||||||
|
|
||||||
|
var ClickShowText = 'undefined';
|
||||||
|
if (theme.ClickShowText && theme.ClickShowText.enable) {
|
||||||
|
ClickShowText = JSON.stringify({
|
||||||
|
text: theme.ClickShowText.text.join(","),
|
||||||
|
fontSize: theme.ClickShowText.fontSize
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var Snackbar = 'undefined';
|
||||||
|
if (theme.snackbar && theme.snackbar.enable) {
|
||||||
|
Snackbar = JSON.stringify({
|
||||||
|
bookmark: {
|
||||||
|
title: _p("Snackbar.bookmark.title"),
|
||||||
|
message_prev: _p("Snackbar.bookmark.message_prev"),
|
||||||
|
message_next: _p("Snackbar.bookmark.message_next")
|
||||||
|
},
|
||||||
|
chs_to_cht: _p("Snackbar.chs_to_cht"),
|
||||||
|
cht_to_chs: _p("Snackbar.cht_to_chs"),
|
||||||
|
day_to_night: _p("Snackbar.day_to_night"),
|
||||||
|
night_to_day: _p("Snackbar.night_to_day"),
|
||||||
|
bgLight: theme.snackbar.bg_light,
|
||||||
|
bgDark: theme.snackbar.bg_dark,
|
||||||
|
position: theme.snackbar.position,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
script.
|
script.
|
||||||
var GLOBAL_CONFIG = {
|
var GLOBAL_CONFIG = {
|
||||||
@@ -68,13 +93,16 @@ script.
|
|||||||
noSupport: '!{_p("copy.noSupport")}'
|
noSupport: '!{_p("copy.noSupport")}'
|
||||||
},
|
},
|
||||||
bookmark: {
|
bookmark: {
|
||||||
title: '!{_p("bookmark.title")}',
|
title: '!{_p("Snackbar.bookmark.title")}',
|
||||||
message_prev: '!{_p("bookmark.message_prev")}',
|
message_prev: '!{_p("Snackbar.bookmark.message_prev")}',
|
||||||
message_next: '!{_p("bookmark.message_next")}'
|
message_next: '!{_p("Snackbar.bookmark.message_next")}'
|
||||||
},
|
},
|
||||||
runtime_unit: '!{_p("runtime_unit")}',
|
runtime_unit: '!{_p("runtime_unit")}',
|
||||||
copyright: !{copyright},
|
copyright: !{copyright},
|
||||||
copy_copyright_js: !{copy_copyright_js}
|
copy_copyright_js: !{copy_copyright_js},
|
||||||
|
ClickShowText: !{ClickShowText},
|
||||||
|
medium_zoom: '!{theme.medium_zoom.enable}',
|
||||||
|
Snackbar: !{Snackbar}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
48
layout/includes/darkmode.pug
Normal file
48
layout/includes/darkmode.pug
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
script.
|
||||||
|
const autoChangeMode = '#{theme.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()
|
||||||
|
|
||||||
|
|
||||||
|
} else if (autoChangeMode == '2'){
|
||||||
|
now = new Date();
|
||||||
|
hour = now.getHours();
|
||||||
|
isNight = hour < 6 || hour >= 18
|
||||||
|
if(t === undefined) isNight? activateDarkMode() : activateLightMode()
|
||||||
|
else if (t === 'light') activateLightMode()
|
||||||
|
else activateDarkMode()
|
||||||
|
} else {
|
||||||
|
if ( t == 'dark' ) activateDarkMode()
|
||||||
|
else if ( t == 'light') activateLightMode()
|
||||||
|
}
|
||||||
|
|
||||||
|
function activateDarkMode(){
|
||||||
|
document.documentElement.setAttribute('data-theme', 'dark')
|
||||||
|
if (document.querySelector('meta[name="theme-color"]') !== null){
|
||||||
|
document.querySelector('meta[name="theme-color"]').setAttribute('content','#000')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function activateLightMode(){
|
||||||
|
document.documentElement.setAttribute('data-theme', 'light')
|
||||||
|
if (document.querySelector('meta[name="theme-color"]') !== null){
|
||||||
|
document.querySelector('meta[name="theme-color"]').setAttribute('content','#fff')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
#footer
|
#footer-wrap
|
||||||
- var now = new Date()
|
- var now = new Date()
|
||||||
- var nowYear = now.getFullYear()
|
- var nowYear = now.getFullYear()
|
||||||
if theme.since && theme.since != nowYear
|
if theme.since && theme.since != nowYear
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
#gallery!= page.content
|
|
||||||
@@ -1,61 +1,25 @@
|
|||||||
|
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 without_index = url.replace('index.html', '')
|
- var without_index = url.replace('index.html', '')
|
||||||
- var without_html = without_index.replace('.html', '')
|
- var without_html = without_index.replace('.html', '')
|
||||||
- var photo_check = is_post() ? page.cover || theme.avatar : theme.avatar
|
- 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 photo_link = url_check (photo_check) ? photo_check : config.url + photo_check
|
||||||
|
|
||||||
meta(http-equiv="x-dns-prefetch-control" content="on")
|
//- 預解析
|
||||||
if theme.canonical
|
link(rel="preconnect" href="//cdn.jsdelivr.net")
|
||||||
link(rel="canonical" href=without_html)
|
|
||||||
|
|
||||||
if theme.twitter_meta
|
|
||||||
meta(name="twitter:card" content="summary_large_image")
|
|
||||||
meta(name="twitter:title" content=pageTitle_no_include_blog_name)
|
|
||||||
meta(name="twitter:description" content=pageDescription)
|
|
||||||
meta(name="twitter:image" content=photo_link)
|
|
||||||
|
|
||||||
if theme.Open_Graph_meta
|
|
||||||
if is_post()
|
|
||||||
meta(property="og:type" content="article")
|
|
||||||
else
|
|
||||||
meta(property="og:type" content="website")
|
|
||||||
|
|
||||||
meta(property="og:title" content=pageTitle_no_include_blog_name)
|
|
||||||
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)
|
|
||||||
|
|
||||||
if theme.disable_baidu_transformation
|
|
||||||
meta(http-equiv="Cache-Control" content="no-transform")
|
|
||||||
meta(http-equiv="Cache-Control" content="no-siteapp")
|
|
||||||
|
|
||||||
if is_post()
|
|
||||||
if(page.prev)
|
|
||||||
link(rel="prev" title=page.prev.title href=url_for(page.prev.permalink) )
|
|
||||||
if(page.next)
|
|
||||||
link(rel="next" title=page.next.title href=url_for(page.next.permalink) )
|
|
||||||
|
|
||||||
|
|
||||||
if theme.algolia_search.enable
|
|
||||||
link(rel="dns-prefetch" href="https://cdn.jsdelivr.net")
|
|
||||||
link(rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/instantsearch.js@2.1.1/dist/instantsearch.min.css")
|
|
||||||
script(src="https://cdn.jsdelivr.net/npm/instantsearch.js@2.1.1/dist/instantsearch.min.js" defer)
|
|
||||||
|
|
||||||
if (theme.gitment && theme.gitment.enable)
|
|
||||||
link(rel="dns-prefetch" href="https://unpkg.com")
|
|
||||||
link(rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/gitment/style/default.min.css")
|
|
||||||
script(src="https://cdn.jsdelivr.net/npm/gitment/dist/gitment.browser.min.js")
|
|
||||||
script(src="https://cdn.jsdelivr.net/npm/blueimp-md5@2.10.0/js/md5.min.js")
|
|
||||||
if (theme.gitalk && theme.gitalk.enable)
|
|
||||||
link(rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/gitalk/dist/gitalk.min.css")
|
|
||||||
if(theme.gitalk.js)
|
|
||||||
script(src=theme.gitalk.js)
|
|
||||||
else
|
|
||||||
script(src="https://cdn.jsdelivr.net/npm/gitalk@latest/dist/gitalk.min.js")
|
|
||||||
script(src="https://cdn.jsdelivr.net/npm/blueimp-md5@2.10.0/js/md5.min.js")
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//- PWA
|
||||||
if (theme.pwa && theme.pwa.enable)
|
if (theme.pwa && theme.pwa.enable)
|
||||||
link(rel="manifest" href=theme.pwa.manifest)
|
link(rel="manifest" href=theme.pwa.manifest)
|
||||||
if(theme.pwa.theme_color)
|
if(theme.pwa.theme_color)
|
||||||
@@ -71,28 +35,7 @@ if (theme.pwa && theme.pwa.enable)
|
|||||||
if(theme.pwa.mask_icon)
|
if(theme.pwa.mask_icon)
|
||||||
link(rel="mask-icon" href=theme.pwa.mask_icon color="#5bbad5")
|
link(rel="mask-icon" href=theme.pwa.mask_icon color="#5bbad5")
|
||||||
|
|
||||||
|
//- 網站驗證
|
||||||
if theme.baidu_analytics
|
|
||||||
link(rel="dns-prefetch" href="https://hm.baidu.com")
|
|
||||||
script.
|
|
||||||
var _hmt = _hmt || [];
|
|
||||||
(function() {
|
|
||||||
var hm = document.createElement("script");
|
|
||||||
hm.src = "https://hm.baidu.com/hm.js?!{theme.baidu_analytics}";
|
|
||||||
var s = document.getElementsByTagName("script")[0];
|
|
||||||
s.parentNode.insertBefore(hm, s);
|
|
||||||
})();
|
|
||||||
if theme.google_analytics
|
|
||||||
link(rel="dns-prefetch" href="https://www.google-analytics.com")
|
|
||||||
script.
|
|
||||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
|
||||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
|
||||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
|
||||||
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
|
||||||
|
|
||||||
ga('create', '!{theme.google_analytics}', 'auto');
|
|
||||||
ga('send', 'pageview');
|
|
||||||
|
|
||||||
if theme.google_site_verification
|
if theme.google_site_verification
|
||||||
meta(name="google-site-verification" content=theme.google_site_verification)
|
meta(name="google-site-verification" content=theme.google_site_verification)
|
||||||
|
|
||||||
@@ -105,20 +48,83 @@ if theme.baidu_site_verification
|
|||||||
if theme.qihu_site_verification
|
if theme.qihu_site_verification
|
||||||
meta(name="360-site-verification" content=theme.qihu_site_verification)
|
meta(name="360-site-verification" content=theme.qihu_site_verification)
|
||||||
|
|
||||||
|
//- twitter meta
|
||||||
|
if theme.twitter_meta
|
||||||
|
meta(name="twitter:card" content="summary_large_image")
|
||||||
|
meta(name="twitter:title" content=pageTitle_no_include_blog_name)
|
||||||
|
meta(name="twitter:description" content=pageDescription)
|
||||||
|
meta(name="twitter:image" content=photo_link)
|
||||||
|
|
||||||
- var preload_archive_img = theme.archive_img ||theme.top_img || config.top_img
|
//- Open_Graph
|
||||||
- var preload_tag_img = theme.tag_img ||theme.top_img || config.top_img
|
if theme.Open_Graph_meta
|
||||||
- var preload_category_img = theme.category_img ||theme.top_img || config.top_img
|
- var contentType = is_post() ? 'article' : 'website'
|
||||||
- var preload_img = page.top_img || theme.top_img || config.top_img
|
meta(property="og:type" content=contentType)
|
||||||
|
meta(property="og:title" content=pageTitle_no_include_blog_name)
|
||||||
|
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)
|
||||||
|
|
||||||
if (is_archive() && preload_archive_img)
|
if theme.disable_baidu_transformation
|
||||||
link(rel="preload" href=url_for(preload_archive_img) as="image" )
|
meta(http-equiv="Cache-Control" content="no-transform")
|
||||||
else if (is_tag() && preload_tag_img)
|
meta(http-equiv="Cache-Control" content="no-siteapp")
|
||||||
link(rel="preload" href=url_for(preload_tag_img) as="image" )
|
|
||||||
else if (is_category() && preload_category_img)
|
script(src=url_for(theme.CDN.js_cookies))
|
||||||
link(rel="preload" href=url_for(preload_category_img) as="image" )
|
|
||||||
else if (!is_post() && preload_img)
|
if (theme.darkmode && theme.darkmode.enable) || theme.autoChangeMode !== false
|
||||||
link(rel="preload" href=url_for(preload_img) as="image" )
|
include ./darkmode
|
||||||
|
|
||||||
|
each item in theme.CDN_USE.css
|
||||||
|
link(rel='stylesheet', href=url_for(item))
|
||||||
|
|
||||||
|
if (theme.medium_zoom && !theme.medium_zoom.enable)
|
||||||
|
link(rel='stylesheet', href=url_for(theme.CDN.fancybox_css))
|
||||||
|
|
||||||
|
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 is_post()
|
||||||
|
if(page.prev)
|
||||||
|
link(rel="prev" title=page.prev.title href=url_for(page.prev.permalink) )
|
||||||
|
if(page.next)
|
||||||
|
link(rel="next" title=page.next.title href=url_for(page.next.permalink) )
|
||||||
|
|
||||||
|
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(gitalk_css))
|
||||||
|
script(src=url_for(theme.CDN.gitalk))
|
||||||
|
script(src=url_for(theme.CDN.blueimp-md5))
|
||||||
|
|
||||||
|
if theme.baidu_analytics
|
||||||
|
link(rel="dns-prefetch" href="https://hm.baidu.com")
|
||||||
|
script.
|
||||||
|
var _hmt = _hmt || [];
|
||||||
|
(function() {
|
||||||
|
var hm = document.createElement("script");
|
||||||
|
hm.src = "https://hm.baidu.com/hm.js?!{theme.baidu_analytics}";
|
||||||
|
var s = document.getElementsByTagName("script")[0];
|
||||||
|
s.parentNode.insertBefore(hm, s);
|
||||||
|
})();
|
||||||
|
|
||||||
|
if theme.google_analytics
|
||||||
|
link(rel="dns-prefetch" href="https://www.google-analytics.com")
|
||||||
|
script.
|
||||||
|
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||||
|
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||||
|
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||||
|
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
||||||
|
|
||||||
|
ga('create', '!{theme.google_analytics}', 'auto');
|
||||||
|
ga('send', 'pageview');
|
||||||
|
|
||||||
|
if !is_post()
|
||||||
|
link(rel="preload" href=url_for(top_img) as="image" )
|
||||||
|
|
||||||
if theme.blog_title_font.font_link
|
if theme.blog_title_font.font_link
|
||||||
link(rel='stylesheet', href=url_for(theme.blog_title_font.font_link))
|
link(rel='stylesheet', href=url_for(theme.blog_title_font.font_link))
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
#header
|
#header
|
||||||
#page-header
|
#page-header
|
||||||
span#blog_name.pull-left
|
span#blog_name.pull_left
|
||||||
a#site-name.blog_title(href=url_for('/')) #[=config.title]
|
a#site-name.blog_title(href=url_for('/')) #[=config.title]
|
||||||
i.fa.fa-bars.fa-fw.toggle-menu.pull-right.close(aria-hidden="true")
|
i.fa.fa-bars.fa-fw.toggle-menu.pull_right.close(aria-hidden="true")
|
||||||
span.pull-right.menus
|
span.pull_right.menus
|
||||||
.menus_items
|
.menus_items
|
||||||
include menu_item.pug
|
include menu_item.pug
|
||||||
span#search_button.pull-right
|
span#search_button.pull_right
|
||||||
if (theme.algolia_search.enable || theme.local_search && theme.local_search.enable)
|
if (theme.algolia_search.enable || theme.local_search && theme.local_search.enable)
|
||||||
a.site-page.social-icon.search
|
a.site-page.social-icon.search
|
||||||
i.fa.fa-search.fa-fw
|
i.fa.fa-search.fa-fw
|
||||||
|
|||||||
113
layout/includes/index-js.pug
Normal file
113
layout/includes/index-js.pug
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
script.
|
||||||
|
if (/Android|webOS|iPhone|iPod|iPad|BlackBerry/i.test(navigator.userAgent)) {} else {
|
||||||
|
$('.full_page .nav_bg').css('background-attachment', 'fixed');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if theme.subtitle.enable
|
||||||
|
script(src=url_for(theme.CDN.typed))
|
||||||
|
- var source = theme.subtitle.source
|
||||||
|
|
||||||
|
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 source == '1'
|
||||||
|
script.
|
||||||
|
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
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(function (err) {
|
||||||
|
console.error(err);
|
||||||
|
})
|
||||||
|
else if source == '2'
|
||||||
|
script.
|
||||||
|
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
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.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
|
||||||
|
});
|
||||||
|
else if source == '4'
|
||||||
|
script(type="text/javascript" src="https://sdk.jinrishici.com/v2/browser/jinrishici.js")
|
||||||
|
script.
|
||||||
|
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
|
||||||
|
});
|
||||||
|
})
|
||||||
|
|
||||||
|
else
|
||||||
|
script.
|
||||||
|
var typed = new Typed(".subtitle", {
|
||||||
|
strings: '!{theme.subtitle.sub}'.split(","),
|
||||||
|
startDelay: 300,
|
||||||
|
typeSpeed: 100,
|
||||||
|
loop: true,
|
||||||
|
backSpeed: 50
|
||||||
|
});
|
||||||
|
|
||||||
|
if !theme.index_top_img_height && !theme.index_site_info_top
|
||||||
|
script.
|
||||||
|
//首頁fullpage
|
||||||
|
function alignContent() {
|
||||||
|
for (var n = $(window).height(), e = document.querySelectorAll(".full_page"), i = 0; i < e.length; i++)
|
||||||
|
e[i].style.height = n + "px";
|
||||||
|
$("#site-info").each(function () {
|
||||||
|
var x = $(this).height();
|
||||||
|
$(this).css("top", (n-x)/2)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
alignContent();
|
||||||
|
|
||||||
|
$(window).bind("resize", function () {
|
||||||
|
alignContent()
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -23,11 +23,9 @@
|
|||||||
- if (page.tags && page.tags.data) pageKeywords = page.tags.data.map(function(tag) {return tag.name;}).join(',')
|
- 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 pageAuthor = config.email ? config.author + ',' + config.email : config.author
|
||||||
- var pageCopyright = config.copyright || config.author
|
- var pageCopyright = config.copyright || config.author
|
||||||
- var body_class = theme.display_mode == 'night' ? 'night-mode' : ''
|
|
||||||
|
|
||||||
|
|
||||||
doctype html
|
doctype html
|
||||||
html(lang=config.language)
|
html(lang=config.language data-theme=theme.display_mode)
|
||||||
head
|
head
|
||||||
meta(charset='UTF-8')
|
meta(charset='UTF-8')
|
||||||
meta(http-equiv="X-UA-Compatible" content="IE=edge")
|
meta(http-equiv="X-UA-Compatible" content="IE=edge")
|
||||||
@@ -39,22 +37,18 @@ html(lang=config.language)
|
|||||||
meta(name="copyright" content=pageCopyright)
|
meta(name="copyright" content=pageCopyright)
|
||||||
meta(name ="format-detection" content="telephone=no")
|
meta(name ="format-detection" content="telephone=no")
|
||||||
!=favicon_tag(config.favicon || theme.favicon || '/favicon.ico')
|
!=favicon_tag(config.favicon || theme.favicon || '/favicon.ico')
|
||||||
if theme.stylesheets !== undefined && theme.stylesheets.length > 0
|
|
||||||
each url in theme.stylesheets
|
|
||||||
link(rel='stylesheet', href=url_for(url))
|
|
||||||
each item in theme.cdn.css
|
|
||||||
if item !== undefined
|
|
||||||
link(rel='stylesheet', href=item)
|
|
||||||
include ./head.pug
|
include ./head.pug
|
||||||
include ./config.pug
|
include ./config.pug
|
||||||
body(class=body_class)
|
body
|
||||||
if theme.fireworks && theme.fireworks.enable
|
if theme.fireworks && theme.fireworks.enable
|
||||||
canvas.fireworks
|
canvas.fireworks
|
||||||
include ./header.pug
|
include ./header.pug
|
||||||
include ./mobile-sidebar.pug
|
include ./mobile-sidebar.pug
|
||||||
#body-wrap
|
#body-wrap
|
||||||
if theme.background
|
if theme.background
|
||||||
#web_bg
|
- var source = theme.background
|
||||||
|
- var is_photo = source.substring(3,0) === 'url' ? 'photo':'color'
|
||||||
|
#web_bg(data-type=is_photo)
|
||||||
if (is_post() && page.toc != false && theme.toc.enable)
|
if (is_post() && page.toc != false && theme.toc.enable)
|
||||||
i.fa.fa-arrow-right#toggle-sidebar(aria-hidden="true")
|
i.fa.fa-arrow-right#toggle-sidebar(aria-hidden="true")
|
||||||
include ./sidebar.pug
|
include ./sidebar.pug
|
||||||
@@ -76,16 +70,11 @@ html(lang=config.language)
|
|||||||
block content
|
block content
|
||||||
|
|
||||||
- var footer_bg = theme.footer_bg == false ? '' : bg_img
|
- var footer_bg = theme.footer_bg == false ? '' : bg_img
|
||||||
footer(style=footer_bg)
|
footer#footer(style=footer_bg)
|
||||||
include ./footer.pug
|
include ./footer.pug
|
||||||
include ./rightside.pug
|
include ./rightside.pug
|
||||||
each item in theme.cdn.js
|
each item in theme.CDN_USE.js
|
||||||
if item !== undefined
|
|
||||||
script(src=url_for(item))
|
script(src=url_for(item))
|
||||||
if theme.scripts !== undefined && theme.scripts.length > 0
|
|
||||||
//- scripts list from config.yml
|
|
||||||
each url in theme.scripts
|
|
||||||
script(src=url_for(url))
|
|
||||||
include ./additional-js.pug
|
include ./additional-js.pug
|
||||||
include ./search/index.pug
|
include ./search/index.pug
|
||||||
|
|
||||||
|
|||||||
@@ -16,5 +16,3 @@ each value, label in theme.menu
|
|||||||
a.site-page(href=trim(i.split('||')[1]))
|
a.site-page(href=trim(i.split('||')[1]))
|
||||||
i.fa-fw(class=trim(i.split('||')[2]))
|
i.fa-fw(class=trim(i.split('||')[2]))
|
||||||
span=' '+trim(i.split('||')[0])
|
span=' '+trim(i.split('||')[0])
|
||||||
script.
|
|
||||||
document.body.addEventListener('touchstart', function(){ });
|
|
||||||
|
|||||||
@@ -3,19 +3,19 @@ mixin UI_NEW(posts)
|
|||||||
.recent-post-item.article-container
|
.recent-post-item.article-container
|
||||||
- var link = article.link || article.path
|
- var link = article.link || article.path
|
||||||
if index%2 == 0
|
if index%2 == 0
|
||||||
.post_cover.is_left
|
.post_cover.pull_left.left_radius
|
||||||
a(href=url_for(link) title=article.title || _p('no_title'))
|
a(href=url_for(link) title=article.title || _p('no_title'))
|
||||||
- var post_cover = article.cover
|
- var post_cover = article.cover
|
||||||
if theme.lazyload.enable
|
if theme.lazyload.enable
|
||||||
img.post_bg.lozad(data-src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
img.post_bg.lazyload(data-src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
||||||
else
|
else
|
||||||
img.post_bg(src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
img.post_bg(src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
||||||
else
|
else
|
||||||
.post_cover.is_right
|
.post_cover.pull_right.right_radius
|
||||||
a(href=url_for(link) title=article.title || _p('no_title'))
|
a(href=url_for(link) title=article.title || _p('no_title'))
|
||||||
- var post_cover = article.cover
|
- var post_cover = article.cover
|
||||||
if theme.lazyload.enable
|
if theme.lazyload.enable
|
||||||
img.post_bg.lozad(data-src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
img.post_bg.lazyload(data-src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
||||||
else
|
else
|
||||||
img.post_bg(src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
img.post_bg(src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
||||||
.recent-post-info
|
.recent-post-info
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#menu_mask
|
#menu_mask
|
||||||
#mobile-sidebar-menus
|
#mobile-sidebar-menus
|
||||||
.mobile_author_icon
|
.mobile_author_icon
|
||||||
img.lozad.avatar_img(src=url_for(theme.avatar) onerror=`onerror=null;src='${theme.lodding_bg.flink}'`)
|
img.lazyload.avatar_img(src=url_for(theme.avatar) onerror=`onerror=null;src='${theme.lodding_bg.flink}'`)
|
||||||
.mobile_post_data
|
.mobile_post_data
|
||||||
if site.posts.length
|
if site.posts.length
|
||||||
.mobile_data_item.is_center
|
.mobile_data_item.is_center
|
||||||
|
|||||||
@@ -1,11 +1,3 @@
|
|||||||
if is_archive()
|
|
||||||
- var top_img = theme.archive_img ||theme.top_img || config.top_img
|
|
||||||
else if is_tag()
|
|
||||||
- var top_img = theme.tag_img ||theme.top_img || config.top_img
|
|
||||||
else if is_category()
|
|
||||||
- var top_img = theme.category_img ||theme.top_img || config.top_img
|
|
||||||
else
|
|
||||||
- var top_img = page.top_img||theme.top_img || config.top_img
|
|
||||||
|
|
||||||
- var bg_img = top_img && top_img !== true ? `background-image: url(${top_img})` : ''
|
- var bg_img = top_img && top_img !== true ? `background-image: url(${top_img})` : ''
|
||||||
|
|
||||||
|
|||||||
@@ -14,11 +14,11 @@ else
|
|||||||
nav#pagination.pagination_post
|
nav#pagination.pagination_post
|
||||||
if(page.prev)
|
if(page.prev)
|
||||||
if(page.next)
|
if(page.next)
|
||||||
.prev-post.pull-left
|
.prev-post.pull_left
|
||||||
- var pagination_cover = page.prev.cover
|
- var pagination_cover = page.prev.cover
|
||||||
a(href=url_for(page.prev.path))
|
a(href=url_for(page.prev.path))
|
||||||
if theme.lazyload.enable
|
if theme.lazyload.enable
|
||||||
img.prev_cover.lozad(data-src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` )
|
img.prev_cover.lazyload(data-src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` )
|
||||||
else
|
else
|
||||||
img.prev_cover(src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` )
|
img.prev_cover(src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` )
|
||||||
|
|
||||||
@@ -30,7 +30,7 @@ else
|
|||||||
- var pagination_cover = page.prev.cover
|
- var pagination_cover = page.prev.cover
|
||||||
a(href=url_for(page.prev.path))
|
a(href=url_for(page.prev.path))
|
||||||
if theme.lazyload.enable
|
if theme.lazyload.enable
|
||||||
img.prev_cover.lozad(data-src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
img.prev_cover.lazyload(data-src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
||||||
else
|
else
|
||||||
img.prev_cover(src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
img.prev_cover(src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
||||||
.label=_p('pagination.prev')
|
.label=_p('pagination.prev')
|
||||||
@@ -39,11 +39,11 @@ else
|
|||||||
|
|
||||||
if(page.next)
|
if(page.next)
|
||||||
if(page.prev)
|
if(page.prev)
|
||||||
.next-post.pull-right
|
.next-post.pull_right
|
||||||
- var pagination_cover = page.next.cover
|
- var pagination_cover = page.next.cover
|
||||||
a(href=url_for(page.next.path))
|
a(href=url_for(page.next.path))
|
||||||
if theme.lazyload.enable
|
if theme.lazyload.enable
|
||||||
img.next_cover.lozad(data-src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
img.next_cover.lazyload(data-src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
||||||
else
|
else
|
||||||
img.next_cover(src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
img.next_cover(src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
||||||
.label=_p('pagination.next')
|
.label=_p('pagination.next')
|
||||||
@@ -54,7 +54,7 @@ else
|
|||||||
- var pagination_cover = page.next.cover
|
- var pagination_cover = page.next.cover
|
||||||
a(href=url_for(page.next.path))
|
a(href=url_for(page.next.path))
|
||||||
if theme.lazyload.enable
|
if theme.lazyload.enable
|
||||||
img.next_cover.lozad(data-src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
img.next_cover.lazyload(data-src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
||||||
else
|
else
|
||||||
img.next_cover(src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
img.next_cover(src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
||||||
.label=_p('pagination.next')
|
.label=_p('pagination.next')
|
||||||
|
|||||||
@@ -2,19 +2,19 @@ each article , index in page.posts.data
|
|||||||
.recent-post-item.article-container
|
.recent-post-item.article-container
|
||||||
- var link = article.link || article.path
|
- var link = article.link || article.path
|
||||||
if index%2 == 0
|
if index%2 == 0
|
||||||
.post_cover.is_left
|
.post_cover.pull_left.left_radius
|
||||||
a(href=url_for(link) title=article.title || _p('no_title'))
|
a(href=url_for(link) title=article.title || _p('no_title'))
|
||||||
- var post_cover = article.cover
|
- var post_cover = article.cover
|
||||||
if theme.lazyload.enable
|
if theme.lazyload.enable
|
||||||
img.post_bg.lozad(data-src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
img.post_bg.lazyload(data-src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
||||||
else
|
else
|
||||||
img.post_bg(src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
img.post_bg(src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
||||||
else
|
else
|
||||||
.post_cover.is_right
|
.post_cover.pull_right.right_radius
|
||||||
a(href=url_for(link) title=article.title || _p('no_title'))
|
a(href=url_for(link) title=article.title || _p('no_title'))
|
||||||
- var post_cover = article.cover
|
- var post_cover = article.cover
|
||||||
if theme.lazyload.enable
|
if theme.lazyload.enable
|
||||||
img.post_bg.lozad(data-src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
img.post_bg.lazyload(data-src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
||||||
else
|
else
|
||||||
img.post_bg(src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
img.post_bg(src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
||||||
.recent-post-info
|
.recent-post-info
|
||||||
|
|||||||
@@ -6,6 +6,6 @@
|
|||||||
ul.reward-all
|
ul.reward-all
|
||||||
each item in theme.reward.QR_code
|
each item in theme.reward.QR_code
|
||||||
li.reward-item
|
li.reward-item
|
||||||
img.lozad.post-qr-code__img(src=(item.itemlist||item).img)
|
img.lazyload.post-qr-code__img(src=(item.itemlist||item).img)
|
||||||
.post-qr-code__desc=(item.itemlist||item).text
|
.post-qr-code__desc=(item.itemlist||item).text
|
||||||
|
|
||||||
|
|||||||
@@ -5,14 +5,14 @@ section#rightside.rightside
|
|||||||
i#font_plus.fa.fa-plus(title=_p('rightside.font_plus_title'))
|
i#font_plus.fa.fa-plus(title=_p('rightside.font_plus_title'))
|
||||||
i#font_minus.fa.fa-minus(title=_p('rightside.font_minus_title'))
|
i#font_minus.fa.fa-minus(title=_p('rightside.font_minus_title'))
|
||||||
if theme.translate && theme.translate.enable
|
if theme.translate && theme.translate.enable
|
||||||
a#translateLink.translate_chn_to_cht(href="javascript:translatePage();" title=_p('rightside.translate_title'))= theme.translate.default
|
a#translateLink.translate_chn_to_cht(href="javascript:translatePage();" title=_p('rightside.translate_title') target="_self")= theme.translate.default
|
||||||
if theme.nightshift && theme.nightshift.enable
|
if theme.darkmode && theme.darkmode.enable
|
||||||
- var display_mode = theme.display_mode == 'night'? 'fa fa-sun-o' : 'fa fa-moon-o'
|
- var display_mode = theme.display_mode == 'dark' ? 'fa fa-sun-o' : 'fa fa-moon-o'
|
||||||
i#nightshift.nightshift(class=display_mode title=_p('rightside.night_mode_title'))
|
i#darkmode.darkmode(class=display_mode title=_p('rightside.night_mode_title'))
|
||||||
#rightside-config-show
|
#rightside-config-show
|
||||||
#rightside_config(title=_p("rightside.setting"))
|
#rightside_config(title=_p("rightside.setting"))
|
||||||
i.fa.fa-cog(aria-hidden="true")
|
i.fa.fa-cog(aria-hidden="true")
|
||||||
if is_post() && page.comments !== false
|
if is_post() && page.comments !== false && (d || l || gt || v)
|
||||||
a#to_comment(href="#post-comment" title=_p("rightside.scroll_to_comment"))
|
a#to_comment(href="#post-comment" title=_p("rightside.scroll_to_comment"))
|
||||||
i.scroll_to_comment.fa.fa-comments
|
i.scroll_to_comment.fa.fa-comments
|
||||||
if is_post() && page.toc != false && theme.toc.enable
|
if is_post() && page.toc != false && theme.toc.enable
|
||||||
|
|||||||
@@ -4,6 +4,6 @@
|
|||||||
a(class="a2a_button_" + name)
|
a(class="a2a_button_" + name)
|
||||||
|
|
||||||
a.a2a_dd(href="https://www.addtoany.com/share")
|
a.a2a_dd(href="https://www.addtoany.com/share")
|
||||||
script(async src="https://static.addtoany.com/menu/page.js")
|
script(async src=url_for(theme.CDN.addtoany))
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
if (theme.sharejs && theme.sharejs.enable)
|
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 data-sites= theme.sharejs.sites)
|
||||||
link(rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js@1.0.16/dist/css/share.min.css")
|
link(rel="stylesheet" href=url_for(theme.CDN.sharejs_css))
|
||||||
script(src="https://cdn.jsdelivr.net/npm/social-share.js@1.0.16/dist/js/social-share.min.js")
|
script(src=url_for(theme.CDN.sharejs))
|
||||||
2
layout/includes/third-party/canvas-nest.pug
vendored
2
layout/includes/third-party/canvas-nest.pug
vendored
@@ -1 +1 @@
|
|||||||
script(color=theme.canvas_nest.color opacity=theme.canvas_nest.opacity zIndex=theme.canvas_nest.zIndex count=theme.canvas_nest.count src=url_for(theme.canvas_nest.script))
|
script#canvas_nest(color=theme.canvas_nest.color opacity=theme.canvas_nest.opacity zIndex=theme.canvas_nest.zIndex count=theme.canvas_nest.count mobile=`${theme.canvas_nest.mobile}` src=url_for(theme.CDN.canvas_nest))
|
||||||
@@ -1 +1 @@
|
|||||||
script(id="ribbon" src=url_for('https://cdn.jsdelivr.net/gh/jerryc127/CDN@latest/js/piao.js'))
|
script(id="ribbon_piao" mobile=`${theme.canvas_ribbon_piao.mobile}` src=url_for(theme.CDN.canvas_ribbon_piao))
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
script(id="ribbon" src=url_for('/js/third-party/canvas-ribbon.js') size=theme.canvas_ribbon.size
|
script(id="ribbon" src=url_for(theme.CDN.canvas_ribbon) size=theme.canvas_ribbon.size
|
||||||
alpha=theme.canvas_ribbon.alpha zIndex=theme.canvas_ribbon.zIndex data-click=`${theme.canvas_ribbon.click_to_change}`)
|
alpha=theme.canvas_ribbon.alpha zIndex=theme.canvas_ribbon.zIndex mobile=`${theme.canvas_ribbon.mobile}` data-click=`${theme.canvas_ribbon.click_to_change}`)
|
||||||
|
|
||||||
|
|||||||
4
layout/includes/third-party/katex.pug
vendored
4
layout/includes/third-party/katex.pug
vendored
@@ -1,6 +1,6 @@
|
|||||||
link(rel="stylesheet" type="text/css" href=theme.katex.cdn.css)
|
link(rel="stylesheet" type="text/css" href=theme.katex.cdn.css)
|
||||||
script(src='https://cdn.jsdelivr.net/npm/katex-copytex@latest/dist/katex-copytex.min.js')
|
script(src=url_for(theme.CDN.katex_copytex))
|
||||||
link(rel="stylesheet" type="text/css" href='https://cdn.jsdelivr.net/npm/katex-copytex@latest/dist/katex-copytex.min.css')
|
link(rel="stylesheet" type="text/css" href=theme.CDN.katex_copytex_css)
|
||||||
script.
|
script.
|
||||||
$(function () {
|
$(function () {
|
||||||
$('span.katex-display').wrap('<div class="katex-wrap"></div>')
|
$('span.katex-display').wrap('<div class="katex-wrap"></div>')
|
||||||
|
|||||||
2
layout/includes/third-party/mathjax.pug
vendored
2
layout/includes/third-party/mathjax.pug
vendored
@@ -24,4 +24,4 @@ script(type="text/x-mathjax-config").
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
script(src=theme.mathjax.cdn)
|
script(src=theme.CDN.mathjax)
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
.card-content
|
.card-content
|
||||||
.post_data
|
.post_data
|
||||||
.data-item.is_center
|
.data-item.is_center
|
||||||
img.lozad.avatar_img(src=url_for(theme.avatar) onerror=`onerror=null;src='${theme.lodding_bg.flink}'`)
|
img.lazyload.avatar_img(src=url_for(theme.avatar) onerror=`onerror=null;src='${theme.lodding_bg.flink}'`)
|
||||||
p.author-info__name.is_center= config.author
|
p.author-info__name.is_center= config.author
|
||||||
p.author-info__description.is_center= config.description
|
p.author-info__description.is_center= config.description
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
p.length_num= site.categories.length
|
p.length_num= site.categories.length
|
||||||
|
|
||||||
.post_data.is_center
|
.post_data.is_center
|
||||||
a#bookmark-it.data-item.bookmark.bookmarke--primary.bookmark--animated(href="javascript:;" title= _p('aside.card_bookmark') )
|
a#bookmark-it.data-item.bookmark.bookmarke--primary.bookmark--animated(href="javascript:;" title= _p('aside.card_bookmark') target="_self")
|
||||||
i.fa.fa-bookmark(aria-hidden="true")
|
i.fa.fa-bookmark(aria-hidden="true")
|
||||||
span= _p('aside.card_bookmark') || 'Follow Me'
|
span= _p('aside.card_bookmark') || 'Follow Me'
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
- var post_cover = article.cover
|
- var post_cover = article.cover
|
||||||
.aside_post_cover
|
.aside_post_cover
|
||||||
if theme.lazyload.enable
|
if theme.lazyload.enable
|
||||||
img.aside_post_bg.lozad(data-src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` title=article.title || _p('no_title'))
|
img.aside_post_bg.lazyload(data-src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` title=article.title || _p('no_title'))
|
||||||
else
|
else
|
||||||
img.aside_post_bg(src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` title=article.title || _p('no_title'))
|
img.aside_post_bg(src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` title=article.title || _p('no_title'))
|
||||||
div#aside_title
|
div#aside_title
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
.webinfo_item
|
.webinfo_item
|
||||||
.webinfo_runtime_name= _p('aside.card_webinfo.runtime_name') + " :"
|
.webinfo_runtime_name= _p('aside.card_webinfo.runtime_name') + " :"
|
||||||
#webinfo_runtime_count.webinfo_runtime_count
|
#webinfo_runtime_count.webinfo_runtime_count
|
||||||
script#runtionshow(src=url_for('js/runtimeshow.js') start_date=theme.runtimeshow.start_date)
|
script#runtionshow(src=url_for(theme.CDN.runtimeshow) start_date=theme.runtimeshow.start_date)
|
||||||
|
|
||||||
if theme.busuanzi.site_uv
|
if theme.busuanzi.site_uv
|
||||||
.webinfo_item
|
.webinfo_item
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
extends includes/layout.pug
|
extends includes/layout.pug
|
||||||
|
|
||||||
block top_img
|
block top_img
|
||||||
- var top_img = page.top_img || page.cover || theme.post_meta.top_img || theme.post_img || theme.top_img || config.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})` : ''
|
- var bg_img = top_img !== true ? `background-image: url(${top_img})` : ''
|
||||||
div#top-container(style=bg_img)
|
div#top-container(style=bg_img)
|
||||||
#post-info
|
#post-info
|
||||||
#post-title
|
#post-title
|
||||||
.posttitle=page.title || _p('no_title')
|
.posttitle= page.title || _p('no_title')
|
||||||
#post-meta
|
#post-meta
|
||||||
if (theme.post_meta.date_type)
|
if (theme.post_meta.date_type)
|
||||||
if (theme.post_meta.date_type === 'both')
|
if (theme.post_meta.date_type === 'both')
|
||||||
@@ -31,13 +31,16 @@ block top_img
|
|||||||
i.fa.fa-angle-right(aria-hidden="true")
|
i.fa.fa-angle-right(aria-hidden="true")
|
||||||
.post-meta-wordcount
|
.post-meta-wordcount
|
||||||
if (theme.wordcount && theme.wordcount.enable)
|
if (theme.wordcount && theme.wordcount.enable)
|
||||||
|
i.fa.fa-file-word-o.post-meta__icon(aria-hidden="true")
|
||||||
span= _p('post.wordcount') + ': '
|
span= _p('post.wordcount') + ': '
|
||||||
span.word-count= wordcount(page.content)
|
span.word-count= wordcount(page.content)
|
||||||
span.post-meta__separator |
|
span.post-meta__separator |
|
||||||
|
i.fa.fa-clock-o.post-meta__icon(aria-hidden="true")
|
||||||
span= _p('post.min2read', min2read(page.content, {cn: 350, en: 160}))
|
span= _p('post.min2read', min2read(page.content, {cn: 350, en: 160}))
|
||||||
if (theme.wordcount && theme.wordcount.enable && theme.busuanzi.page_pv)
|
if (theme.wordcount && theme.wordcount.enable && theme.busuanzi.page_pv)
|
||||||
span.post-meta__separator |
|
span.post-meta__separator |
|
||||||
if theme.busuanzi.page_pv
|
if theme.busuanzi.page_pv
|
||||||
|
i.fa.fa-eye.post-meta__icon(aria-hidden="true")
|
||||||
span= _p('post.page_pv') + ': '
|
span= _p('post.page_pv') + ': '
|
||||||
span#busuanzi_value_page_pv
|
span#busuanzi_value_page_pv
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "hexo-theme-melody",
|
"name": "hexo-theme-melody",
|
||||||
"version": "1.2.2",
|
"version": "2.0.0",
|
||||||
"description": "A Hexo Theme: Butterfly"
|
"description": "A Hexo Theme: Butterfly"
|
||||||
}
|
}
|
||||||
@@ -1,16 +1,6 @@
|
|||||||
hexo.extend.tag.register('gallery', args => {
|
function gallery(args, content) {
|
||||||
const url = args[0]
|
return `<div class="justified-gallery">${hexo.render.renderSync({text: content, engine: 'markdown'})}
|
||||||
const title = args[1] || 'No title'
|
</div>`;
|
||||||
return `
|
}
|
||||||
<div
|
|
||||||
class="gallery-item"
|
hexo.extend.tag.register('gallery', gallery, {ends: true});
|
||||||
style="background-image: url('${url}')"
|
|
||||||
data-title="${title}"
|
|
||||||
data-url="${url}"
|
|
||||||
>
|
|
||||||
<div class="gallery-item__title">
|
|
||||||
${title}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
`
|
|
||||||
})
|
|
||||||
@@ -100,7 +100,7 @@ hexo.extend.helper.register('list_archives', function (options = {}) {
|
|||||||
|
|
||||||
if (data.length > limit) {
|
if (data.length > limit) {
|
||||||
result += `<li class="${className}-list-item">`;
|
result += `<li class="${className}-list-item">`;
|
||||||
result += `<a class="${className}-list-link is_center" href="${archiveDir}" >`;
|
result += `<a class="${className}-list-link is_center" href="` + '/' + `${archiveDir}" >`;
|
||||||
result += more_button;
|
result += more_button;
|
||||||
result += '</a>';
|
result += '</a>';
|
||||||
result += '</li>';
|
result += '</li>';
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
let cheerio;
|
|
||||||
hexo.extend.filter.register('after_post_render', data => {
|
hexo.extend.filter.register('after_post_render', data => {
|
||||||
var theme = hexo.theme.config;
|
var theme = hexo.theme.config;
|
||||||
if (!theme.lazyload.enable) return;
|
if (!theme.lazyload.enable) return;
|
||||||
|
|
||||||
if (!cheerio) cheerio = require('cheerio');
|
const cheerio = require('cheerio');
|
||||||
|
|
||||||
const $ = cheerio.load(data.content, {decodeEntities: false});
|
const $ = cheerio.load(data.content, {decodeEntities: false});
|
||||||
const images = $('img');
|
const images = $('img');
|
||||||
@@ -13,7 +12,7 @@ hexo.extend.filter.register('after_post_render', data => {
|
|||||||
images.each((i, o) => {
|
images.each((i, o) => {
|
||||||
let src = $(o).attr('src');
|
let src = $(o).attr('src');
|
||||||
$(o).attr('data-src', src).removeAttr('src');
|
$(o).attr('data-src', src).removeAttr('src');
|
||||||
$(o).addClass('lozad');
|
$(o).addClass('lazyload');
|
||||||
});
|
});
|
||||||
|
|
||||||
data.content = $.html();
|
data.content = $.html();
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ hexo.extend.helper.register('related_posts', function (currentPost, allPosts) {
|
|||||||
|
|
||||||
relatedPosts = relatedPosts.sort(compare('weight'));
|
relatedPosts = relatedPosts.sort(compare('weight'));
|
||||||
var lazy_src = hexo.theme.config.lazyload.enable ? lazy_src = 'data-src' : lazy_src = 'src'
|
var lazy_src = hexo.theme.config.lazyload.enable ? lazy_src = 'data-src' : lazy_src = 'src'
|
||||||
var lazy_class = hexo.theme.config.lazyload.enable ? lazy_class = 'lozad' : lazy_class = ''
|
var lazy_class = hexo.theme.config.lazyload.enable ? lazy_class = 'lazyload' : lazy_class = ''
|
||||||
|
|
||||||
if (relatedPosts.length > 0) {
|
if (relatedPosts.length > 0) {
|
||||||
result += '<div class="relatedPosts">'
|
result += '<div class="relatedPosts">'
|
||||||
|
|||||||
@@ -19,6 +19,13 @@ body
|
|||||||
-webkit-user-select: none
|
-webkit-user-select: none
|
||||||
-ms-user-select: none
|
-ms-user-select: none
|
||||||
|
|
||||||
|
#body-wrap
|
||||||
|
position relative
|
||||||
|
flex: 1 auto
|
||||||
|
display: flex
|
||||||
|
flex-direction: column
|
||||||
|
transition: all .3s
|
||||||
|
|
||||||
*::-webkit-scrollbar
|
*::-webkit-scrollbar
|
||||||
width: 8px
|
width: 8px
|
||||||
height: 8px
|
height: 8px
|
||||||
@@ -160,10 +167,10 @@ table
|
|||||||
.is_hidden
|
.is_hidden
|
||||||
overflow: hidden
|
overflow: hidden
|
||||||
|
|
||||||
.pull-left
|
.pull_left
|
||||||
float: left
|
float: left
|
||||||
|
|
||||||
.pull-right
|
.pull_right
|
||||||
float: right
|
float: right
|
||||||
|
|
||||||
.fireworks
|
.fireworks
|
||||||
@@ -171,12 +178,9 @@ table
|
|||||||
z-index: -1
|
z-index: -1
|
||||||
pointer-events: none
|
pointer-events: none
|
||||||
|
|
||||||
// 去掉加載黑框
|
|
||||||
img[src=""],img:not([src])
|
|
||||||
opacity: 0
|
|
||||||
|
|
||||||
#body-wrap
|
.fireworks
|
||||||
transition: all .3s
|
z-index: 99999
|
||||||
|
|
||||||
@media screen and (max-width: $bg)
|
@media screen and (max-width: $bg)
|
||||||
i#toggle-sidebar,
|
i#toggle-sidebar,
|
||||||
@@ -185,3 +189,184 @@ img[src=""],img:not([src])
|
|||||||
|
|
||||||
body
|
body
|
||||||
padding-left: 0 !important
|
padding-left: 0 !important
|
||||||
|
|
||||||
|
|
||||||
|
// 懶加載
|
||||||
|
.lazyload,
|
||||||
|
.lazyloading
|
||||||
|
opacity: 0
|
||||||
|
|
||||||
|
.lazyloaded
|
||||||
|
opacity: 1
|
||||||
|
transition: opacity 0.3s
|
||||||
|
|
||||||
|
img[src=""],img:not([src])
|
||||||
|
opacity: 0
|
||||||
|
|
||||||
|
.justified-gallery
|
||||||
|
img
|
||||||
|
opacity 0
|
||||||
|
.fancybox
|
||||||
|
width: auto
|
||||||
|
text-align: inherit
|
||||||
|
.img-alt
|
||||||
|
display: none
|
||||||
|
|
||||||
|
.medium-zoom-image--opened
|
||||||
|
margin: 0 !important
|
||||||
|
z-index: 99999 !important
|
||||||
|
|
||||||
|
.medium-zoom-overlay
|
||||||
|
z-index: 99999 !important
|
||||||
|
|
||||||
|
// hexo tag video
|
||||||
|
.video-container
|
||||||
|
position: relative
|
||||||
|
padding-top: 56.25%
|
||||||
|
height: 0
|
||||||
|
overflow: hidden
|
||||||
|
margin-bottom: 0.8rem
|
||||||
|
|
||||||
|
iframe
|
||||||
|
position: absolute
|
||||||
|
top: 0
|
||||||
|
left: 0
|
||||||
|
width: 100%
|
||||||
|
height: 100%
|
||||||
|
margin-top: 0
|
||||||
|
|
||||||
|
|
||||||
|
.layout_page,
|
||||||
|
.layout_post,
|
||||||
|
#footer
|
||||||
|
animation: main 1s
|
||||||
|
|
||||||
|
#nav,
|
||||||
|
#top-container
|
||||||
|
animation: header 1s
|
||||||
|
|
||||||
|
#site-title
|
||||||
|
animation: titlescale 1s
|
||||||
|
|
||||||
|
canvas,
|
||||||
|
#web_bg
|
||||||
|
animation: to_show 4s
|
||||||
|
|
||||||
|
.card-announcement-animation
|
||||||
|
animation: announ_animation .8s linear infinite
|
||||||
|
color: #FF0000
|
||||||
|
|
||||||
|
.scroll-down-effects
|
||||||
|
animation: scroll-down-effect 1.5s infinite
|
||||||
|
|
||||||
|
if hexo-config("avatar_effect") == true
|
||||||
|
.avatar_img
|
||||||
|
animation: avatar_turn_around 2s linear infinite
|
||||||
|
|
||||||
|
.reward-main
|
||||||
|
animation: donate_effcet .3s .1s ease both
|
||||||
|
|
||||||
|
#rightside-config-hide
|
||||||
|
animation: rightside_in_animate .3s
|
||||||
|
|
||||||
|
@keyframes scroll-down-effect
|
||||||
|
0%
|
||||||
|
opacity: 0.4
|
||||||
|
top: 0
|
||||||
|
50%
|
||||||
|
opacity: 1
|
||||||
|
top: -16px
|
||||||
|
100%
|
||||||
|
opacity: 0.4
|
||||||
|
top: 0
|
||||||
|
|
||||||
|
@keyframes header
|
||||||
|
0%
|
||||||
|
opacity: 0
|
||||||
|
transform: translateY(-50px)
|
||||||
|
100%
|
||||||
|
opacity: 1
|
||||||
|
transform: translateY(0)
|
||||||
|
|
||||||
|
@keyframes headerNoOpacity
|
||||||
|
0%
|
||||||
|
transform: translateY(-50px)
|
||||||
|
100%
|
||||||
|
transform: translateY(0)
|
||||||
|
|
||||||
|
@keyframes main
|
||||||
|
0%
|
||||||
|
opacity: 0
|
||||||
|
transform: translateY(50px)
|
||||||
|
100%
|
||||||
|
opacity: 1
|
||||||
|
transform: translateY(0)
|
||||||
|
|
||||||
|
@keyframes titlescale
|
||||||
|
0%
|
||||||
|
opacity: 0
|
||||||
|
transform: scale(0.7)
|
||||||
|
100%
|
||||||
|
opacity: 1
|
||||||
|
transform: scale(1)
|
||||||
|
|
||||||
|
@keyframes search_close
|
||||||
|
0%
|
||||||
|
opacity: 1
|
||||||
|
transform: scale(1)
|
||||||
|
100%
|
||||||
|
opacity: 0
|
||||||
|
transform: scale(0.7)
|
||||||
|
|
||||||
|
@keyframes to_show
|
||||||
|
0%
|
||||||
|
opacity: 0
|
||||||
|
100%
|
||||||
|
opacity: 1
|
||||||
|
|
||||||
|
@keyframes avatar_turn_around
|
||||||
|
from
|
||||||
|
transform: rotate(0deg)
|
||||||
|
to
|
||||||
|
transform: rotate(360deg)
|
||||||
|
|
||||||
|
@keyframes sub_menus
|
||||||
|
0%
|
||||||
|
opacity: 0
|
||||||
|
transform: translateY(10px)
|
||||||
|
100%
|
||||||
|
opacity: 1
|
||||||
|
transform: translateY(0)
|
||||||
|
|
||||||
|
@keyframes donate_effcet
|
||||||
|
0%
|
||||||
|
opacity: 0
|
||||||
|
transform: translateY(-20px)
|
||||||
|
100%
|
||||||
|
opacity: 1
|
||||||
|
transform: translateY(0)
|
||||||
|
|
||||||
|
@keyframes announ_animation
|
||||||
|
0%,to
|
||||||
|
transform: scale(1)
|
||||||
|
50%
|
||||||
|
transform: scale(1.2)
|
||||||
|
|
||||||
|
@keyframes rightside_in_animate
|
||||||
|
0%
|
||||||
|
transform: translateX(28px)
|
||||||
|
100%
|
||||||
|
transform: translateX(0)
|
||||||
|
|
||||||
|
@keyframes rightside_out_animate
|
||||||
|
0%
|
||||||
|
transform: translateX(0)
|
||||||
|
100%
|
||||||
|
transform: translateX(28px)
|
||||||
|
|
||||||
|
@keyframes right_to_left
|
||||||
|
0%
|
||||||
|
transform: translateX(100px)
|
||||||
|
100%
|
||||||
|
transform: translateX(0)
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,17 @@ blockquote
|
|||||||
color: $blockquote-color
|
color: $blockquote-color
|
||||||
background-color: lighten($blockquote-padding-color,33)
|
background-color: lighten($blockquote-padding-color,33)
|
||||||
|
|
||||||
|
p
|
||||||
|
margin: 0 !important
|
||||||
|
padding: 0.5rem 0
|
||||||
|
|
||||||
|
footer
|
||||||
|
padding: 0 0 0.5rem 0
|
||||||
|
cite
|
||||||
|
&:before
|
||||||
|
content: "—"
|
||||||
|
padding: 0 .3em
|
||||||
|
|
||||||
.article-container
|
.article-container
|
||||||
pre,
|
pre,
|
||||||
code
|
code
|
||||||
@@ -49,11 +60,7 @@ blockquote
|
|||||||
color: $highlight-foreground
|
color: $highlight-foreground
|
||||||
text-shadow: none
|
text-shadow: none
|
||||||
|
|
||||||
.highlight
|
figure.highlight
|
||||||
@extend $code-block
|
|
||||||
position: relative
|
|
||||||
border-radius: 1px
|
|
||||||
|
|
||||||
&:after
|
&:after
|
||||||
position: absolute
|
position: absolute
|
||||||
top: 0
|
top: 0
|
||||||
@@ -63,6 +70,11 @@ blockquote
|
|||||||
background: darken($highlight-background, 5)
|
background: darken($highlight-background, 5)
|
||||||
content: ""
|
content: ""
|
||||||
|
|
||||||
|
.highlight
|
||||||
|
@extend $code-block
|
||||||
|
position: relative
|
||||||
|
border-radius: 1px
|
||||||
|
|
||||||
pre
|
pre
|
||||||
margin: 0
|
margin: 0
|
||||||
padding: 8px 0
|
padding: 8px 0
|
||||||
|
|||||||
@@ -72,7 +72,7 @@
|
|||||||
#bookmark-it
|
#bookmark-it
|
||||||
margin-top: .2rem
|
margin-top: .2rem
|
||||||
height: 1.6rem
|
height: 1.6rem
|
||||||
background: $light-blue
|
background-color: $light-blue
|
||||||
color: #fff
|
color: #fff
|
||||||
text-decoration: none
|
text-decoration: none
|
||||||
line-height: 1.6rem
|
line-height: 1.6rem
|
||||||
@@ -83,10 +83,10 @@
|
|||||||
span
|
span
|
||||||
padding-left: 10px
|
padding-left: 10px
|
||||||
|
|
||||||
.toggle_change--primary,.bookmark--primary
|
.bookmark--primary
|
||||||
color: $ruby
|
color: $ruby
|
||||||
|
|
||||||
.toggle_change--animated,.bookmark--animated
|
.bookmark--animated
|
||||||
transition-property: color
|
transition-property: color
|
||||||
transition-duration: 1s
|
transition-duration: 1s
|
||||||
|
|
||||||
@@ -130,28 +130,18 @@
|
|||||||
span
|
span
|
||||||
margin-left: 10px
|
margin-left: 10px
|
||||||
|
|
||||||
.card-tag-cloud a
|
.card-tag-cloud
|
||||||
|
a
|
||||||
text-decoration: none
|
text-decoration: none
|
||||||
position: relative
|
position: relative
|
||||||
padding-bottom: 0.3rem
|
padding-bottom: 0.3rem
|
||||||
word-break: keep-all
|
word-break: keep-all
|
||||||
|
|
||||||
&::after
|
|
||||||
position: absolute
|
|
||||||
bottom: 0
|
|
||||||
left: 0
|
|
||||||
z-index: -1
|
|
||||||
width: 0
|
|
||||||
height: 3px
|
|
||||||
background-color: lighten($theme-color, 30%)
|
|
||||||
content: ""
|
|
||||||
transition: all 0.3s ease-in-out
|
|
||||||
|
|
||||||
&:hover
|
&:hover
|
||||||
color: $light-blue !important
|
color: $light-blue !important
|
||||||
|
|
||||||
&::after
|
// &::after
|
||||||
width: 100%
|
// width: 100%
|
||||||
|
|
||||||
.aside_recent_item
|
.aside_recent_item
|
||||||
margin: 10px 0 -15px 0
|
margin: 10px 0 -15px 0
|
||||||
@@ -223,6 +213,10 @@
|
|||||||
text-decoration: none
|
text-decoration: none
|
||||||
color: $font-black
|
color: $font-black
|
||||||
padding: 0.2rem 1rem
|
padding: 0.2rem 1rem
|
||||||
|
transition: .2s
|
||||||
|
|
||||||
|
&:hover
|
||||||
|
padding: 0.2rem 0.85rem
|
||||||
|
|
||||||
.aside_category_list_name,.archive-list-link
|
.aside_category_list_name,.archive-list-link
|
||||||
white-space: nowrap
|
white-space: nowrap
|
||||||
@@ -260,61 +254,6 @@
|
|||||||
float: right
|
float: right
|
||||||
display: inline-block
|
display: inline-block
|
||||||
|
|
||||||
// bookmark 樣式
|
|
||||||
.fc-container .fancybox-bg
|
|
||||||
background: #eee
|
|
||||||
|
|
||||||
.fancybox-is-open.fc-container .fancybox-bg
|
|
||||||
opacity: 0.95
|
|
||||||
|
|
||||||
.fc-content
|
|
||||||
margin: 20px
|
|
||||||
max-width: 550px
|
|
||||||
padding: 50px
|
|
||||||
box-shadow: 10px 10px 60px -25px
|
|
||||||
border-radius: 4px
|
|
||||||
|
|
||||||
.fc-content h3
|
|
||||||
margin-top: 0
|
|
||||||
font-size: 1.6em
|
|
||||||
letter-spacing: normal
|
|
||||||
|
|
||||||
.fc-content p
|
|
||||||
color: #666
|
|
||||||
line-height: 1.5
|
|
||||||
|
|
||||||
.fc-content p:last-child
|
|
||||||
margin-bottom: 0
|
|
||||||
|
|
||||||
/* Custom animation */
|
|
||||||
.fancybox-fx-material.fancybox-slide--previous,
|
|
||||||
.fancybox-fx-material.fancybox-slide--next
|
|
||||||
transform: translateY(-60px) scale(1.1)
|
|
||||||
opacity: 0
|
|
||||||
|
|
||||||
.fancybox-fx-material.fancybox-slide--current
|
|
||||||
opacity: 1
|
|
||||||
transform: translateY(0) scale(1)
|
|
||||||
|
|
||||||
.bookmark-ok
|
|
||||||
background: #FF6666
|
|
||||||
border-width: 0
|
|
||||||
color: #fff
|
|
||||||
text-decoration: none
|
|
||||||
padding: 7px 20px
|
|
||||||
line-height: 1.5
|
|
||||||
border-radius: 20px
|
|
||||||
text-transform: uppercase
|
|
||||||
font-family: 'Montserrat', 'Helvetica Neue', Helvetica, Arial, sans-serif
|
|
||||||
font-size: 80%
|
|
||||||
font-weight: 700
|
|
||||||
margin: 5px 5px 5px 0
|
|
||||||
display: inline-block
|
|
||||||
cursor: pointer
|
|
||||||
outline: none
|
|
||||||
transition: all .2s ease-in-out
|
|
||||||
user-select: none
|
|
||||||
|
|
||||||
@media screen and (max-width: 900px)
|
@media screen and (max-width: 900px)
|
||||||
.layout_page
|
.layout_page
|
||||||
flex-direction: column
|
flex-direction: column
|
||||||
|
|||||||
@@ -63,3 +63,4 @@
|
|||||||
|
|
||||||
code, pre
|
code, pre
|
||||||
font-size: 98%
|
font-size: 98%
|
||||||
|
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
width: 70px
|
width: 70px
|
||||||
height: 70px
|
height: 70px
|
||||||
border: 0px solid #eaeefb
|
border: 0px solid #eaeefb
|
||||||
|
transition: all .3s
|
||||||
|
|
||||||
&:hover
|
&:hover
|
||||||
img
|
img
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
footer
|
#footer
|
||||||
margin-top: 1rem
|
margin-top: 1rem
|
||||||
background: $light-blue
|
background: $light-blue
|
||||||
background-attachment: local
|
background-attachment: local
|
||||||
@@ -20,7 +20,7 @@ footer
|
|||||||
background-image: linear-gradient(234deg, #394245 0%, #000 100%)
|
background-image: linear-gradient(234deg, #394245 0%, #000 100%)
|
||||||
|
|
||||||
|
|
||||||
#footer
|
#footer-wrap
|
||||||
padding: 1.2rem 1rem 1rem
|
padding: 1.2rem 1rem 1rem
|
||||||
color: $light-grey
|
color: $light-grey
|
||||||
text-align: center
|
text-align: center
|
||||||
|
|||||||
@@ -81,6 +81,7 @@
|
|||||||
border: none
|
border: none
|
||||||
font-size: 18px
|
font-size: 18px
|
||||||
transition: all .3s
|
transition: all .3s
|
||||||
|
opacity: 0
|
||||||
|
|
||||||
.toggle-menu
|
.toggle-menu
|
||||||
display: none
|
display: none
|
||||||
@@ -108,8 +109,7 @@
|
|||||||
|
|
||||||
&.open-sidebar
|
&.open-sidebar
|
||||||
.site-page
|
.site-page
|
||||||
display: none
|
visibility: hidden
|
||||||
opacity: 0
|
|
||||||
|
|
||||||
a,
|
a,
|
||||||
#site-name,
|
#site-name,
|
||||||
@@ -154,12 +154,13 @@
|
|||||||
.menus_item_child
|
.menus_item_child
|
||||||
position: absolute
|
position: absolute
|
||||||
background-color: alpha($white, 0.8)
|
background-color: alpha($white, 0.8)
|
||||||
padding: 8px 10px
|
|
||||||
border-radius: 5px
|
border-radius: 5px
|
||||||
box-shadow: 0 5px 20px -4px rgba(0,0,0,.5)
|
box-shadow: 0 5px 20px -4px rgba(0,0,0,.5)
|
||||||
display: none
|
display: none
|
||||||
opacity: 1
|
opacity: 1
|
||||||
animation: sub_menus .3s .1s ease both
|
animation: sub_menus .3s .1s ease both
|
||||||
|
padding: 0
|
||||||
|
margin-top: 10px
|
||||||
|
|
||||||
&:before
|
&:before
|
||||||
content: ""
|
content: ""
|
||||||
@@ -174,10 +175,23 @@
|
|||||||
li
|
li
|
||||||
list-style: none
|
list-style: none
|
||||||
text-align: center
|
text-align: center
|
||||||
|
padding: 0px 10px
|
||||||
|
|
||||||
|
&:first-child
|
||||||
|
padding: 6px 10px 0
|
||||||
|
|
||||||
|
&:last-child
|
||||||
|
padding: 0px 10px 6px
|
||||||
|
|
||||||
|
&:hover
|
||||||
|
a,i
|
||||||
|
color: $theme-color
|
||||||
|
|
||||||
a
|
a
|
||||||
color: #3b3a3a
|
color: #3b3a3a
|
||||||
text-shadow: none
|
text-shadow: none
|
||||||
|
#search_button
|
||||||
|
padding: 0 0 0 0.7rem
|
||||||
|
|
||||||
.site-page
|
.site-page
|
||||||
position: relative
|
position: relative
|
||||||
@@ -186,6 +200,7 @@
|
|||||||
font-size: 0.7rem
|
font-size: 0.7rem
|
||||||
cursor: pointer
|
cursor: pointer
|
||||||
|
|
||||||
|
#page-header .menus_item > .site-page
|
||||||
&::after
|
&::after
|
||||||
position: absolute
|
position: absolute
|
||||||
bottom: 0
|
bottom: 0
|
||||||
@@ -214,15 +229,27 @@
|
|||||||
#page-header
|
#page-header
|
||||||
padding: 10px 0.8rem
|
padding: 10px 0.8rem
|
||||||
|
|
||||||
.menus
|
#nav
|
||||||
display: none
|
#site-social-icons
|
||||||
|
|
||||||
.toggle-menu
|
|
||||||
display: block
|
display: block
|
||||||
|
|
||||||
.search
|
&.not_index_bg
|
||||||
span
|
height: 14rem
|
||||||
display none
|
|
||||||
|
#page_site-info
|
||||||
|
top: 7rem
|
||||||
|
|
||||||
|
#top-container
|
||||||
|
height: 14rem
|
||||||
|
|
||||||
|
#post-info
|
||||||
|
bottom: 1rem
|
||||||
|
padding: 0 5%
|
||||||
|
|
||||||
|
.mobile_hidden
|
||||||
|
display: none
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@media screen and (max-width: $bg)
|
@media screen and (max-width: $bg)
|
||||||
#page-header
|
#page-header
|
||||||
|
|||||||
@@ -23,8 +23,9 @@
|
|||||||
z-index: 103
|
z-index: 103
|
||||||
overflow-y: scroll
|
overflow-y: scroll
|
||||||
display: block
|
display: block
|
||||||
transition: all .3s
|
transition: transform .3s
|
||||||
display: none
|
opacity: 0
|
||||||
|
will-change: transform
|
||||||
|
|
||||||
#mobile-sidebar-menus
|
#mobile-sidebar-menus
|
||||||
.mobile_author_icon
|
.mobile_author_icon
|
||||||
@@ -110,11 +111,11 @@
|
|||||||
margin: 0
|
margin: 0
|
||||||
|
|
||||||
#mobile-sidebar-toc
|
#mobile-sidebar-toc
|
||||||
padding: 15px 10px
|
padding: 1rem 0.5rem 5rem 0.3rem
|
||||||
|
|
||||||
ol,li
|
ol,li
|
||||||
list-style: none
|
list-style: none
|
||||||
padding: 0 0 0 5px
|
padding: 0 0 0 8px
|
||||||
margin: 0
|
margin: 0
|
||||||
|
|
||||||
|
|
||||||
@@ -144,14 +145,22 @@
|
|||||||
transform: translate3d(-288px, 0, 0) !important
|
transform: translate3d(-288px, 0, 0) !important
|
||||||
|
|
||||||
.open-mobile-menus
|
.open-mobile-menus
|
||||||
|
padding-left: 0 !important
|
||||||
|
|
||||||
#mobile-sidebar
|
#mobile-sidebar
|
||||||
#mobile-sidebar-menus
|
#mobile-sidebar-menus
|
||||||
transform: translateX(-254px)
|
transform: translateX(-254px)
|
||||||
|
opacity: 1
|
||||||
|
|
||||||
|
// pc界面打開mobile-menus需關閉sidebar
|
||||||
|
#sidebar
|
||||||
|
left: -300px !important
|
||||||
|
|
||||||
.open-mobile-toc
|
.open-mobile-toc
|
||||||
#mobile-sidebar
|
#mobile-sidebar
|
||||||
#mobile-sidebar-toc
|
#mobile-sidebar-toc
|
||||||
transform: translateX(-254px)
|
transform: translateX(-254px)
|
||||||
|
opacity: 1
|
||||||
|
|
||||||
@media screen and (max-width: $sm)
|
@media screen and (max-width: $sm)
|
||||||
#mobile-sidebar-menus
|
#mobile-sidebar-menus
|
||||||
@@ -162,3 +171,4 @@
|
|||||||
display: block !important
|
display: block !important
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,293 +0,0 @@
|
|||||||
if hexo-config("nightshift") && hexo-config("nightshift.enable")
|
|
||||||
.night-mode
|
|
||||||
color: #99a9bf
|
|
||||||
background-color: #2d3032
|
|
||||||
|
|
||||||
#sidebar
|
|
||||||
background: #2d3035 !important
|
|
||||||
box-shadow: -0.25rem 0 0.25rem #2d3035 !important
|
|
||||||
|
|
||||||
&::-webkit-scrollbar-thumb
|
|
||||||
background: lighten(#2d3035,5)
|
|
||||||
|
|
||||||
#toggle-sidebar
|
|
||||||
color: #99a9bf !important
|
|
||||||
|
|
||||||
if hexo-config("local_search") && hexo-config("local_search.enable")
|
|
||||||
#local-search
|
|
||||||
background: #2d3035
|
|
||||||
.local-search-box--input
|
|
||||||
background: #2d3035
|
|
||||||
color: #99a9bf
|
|
||||||
|
|
||||||
.search-result-title
|
|
||||||
color: #99a9bf
|
|
||||||
if hexo-config("algolia_search.enable")
|
|
||||||
#algolia-search
|
|
||||||
background: #2d3035
|
|
||||||
.ais-search-box--input
|
|
||||||
background: #2d3035
|
|
||||||
color: #99a9bf
|
|
||||||
|
|
||||||
#algolia-search-results
|
|
||||||
.algolia-hit-item-link
|
|
||||||
color: #99a9bf !important
|
|
||||||
|
|
||||||
h1, h2, h3, h4, h5, h6
|
|
||||||
color: #99a9bf
|
|
||||||
|
|
||||||
.article-container code
|
|
||||||
background: #616a6b
|
|
||||||
color: #99a9bf
|
|
||||||
|
|
||||||
// 評論
|
|
||||||
#vcomment
|
|
||||||
p,a,textarea,.vemoji-btn,.vpreview-btn,input,path,.vcount,.vnum,.vtime,.vsys,.vsys,.vnick
|
|
||||||
color: #99a9bf !important
|
|
||||||
|
|
||||||
.vsys
|
|
||||||
background: rgb(97, 106, 107) !important
|
|
||||||
|
|
||||||
.vbtn
|
|
||||||
background: rgb(45, 48, 53) !important
|
|
||||||
color: #99a9bf !important
|
|
||||||
border: 1px solid #99a9bf
|
|
||||||
|
|
||||||
.vwrap
|
|
||||||
border: 1px solid #99a9bf
|
|
||||||
|
|
||||||
input
|
|
||||||
border-bottom: 1px dashed #616a6b
|
|
||||||
|
|
||||||
.vh
|
|
||||||
border-bottom: 1px dashed #616a6b
|
|
||||||
|
|
||||||
pre
|
|
||||||
background-color: #2d3035
|
|
||||||
border: 1px solid #99a9bf
|
|
||||||
|
|
||||||
.vcontent.expand:before
|
|
||||||
background: linear-gradient(180deg,hsla(0, 0%, 0%, 0),hsl(218, 8%, 19%))
|
|
||||||
|
|
||||||
.vcontent.expand:after
|
|
||||||
background: hsla(204, 5%, 22%, 1)
|
|
||||||
|
|
||||||
.recent-post-item
|
|
||||||
background: #2d3032 !important
|
|
||||||
|
|
||||||
.article-title,
|
|
||||||
a
|
|
||||||
color: #99a9bf !important
|
|
||||||
|
|
||||||
#page-header
|
|
||||||
&.fixed
|
|
||||||
background: #2d3035
|
|
||||||
box-shadow: 0 5px 6px -5px rgba(133,133,133,0)
|
|
||||||
|
|
||||||
a,
|
|
||||||
.toggle-menu,
|
|
||||||
#site-name
|
|
||||||
color: #99a9bf
|
|
||||||
|
|
||||||
blockquote
|
|
||||||
border-left: 0.2rem solid #7A5353
|
|
||||||
color: #99a9bf
|
|
||||||
background-color: #2f3d49
|
|
||||||
|
|
||||||
hr
|
|
||||||
background: 0
|
|
||||||
border: 2px dashed #616A6B
|
|
||||||
&:before
|
|
||||||
color: #99a9bf
|
|
||||||
|
|
||||||
.post-meta__tags
|
|
||||||
background: 0
|
|
||||||
border: 1px solid #99a9bf
|
|
||||||
color: #99a9bf
|
|
||||||
|
|
||||||
|
|
||||||
.post-copyright
|
|
||||||
border: 1px solid #99a9bf
|
|
||||||
|
|
||||||
*
|
|
||||||
color: #99a9bf
|
|
||||||
|
|
||||||
.article-container .highlight
|
|
||||||
background-color: #1B2631
|
|
||||||
.code pre
|
|
||||||
background-color: #1B2631
|
|
||||||
|
|
||||||
.gutter pre
|
|
||||||
background: #1C2833
|
|
||||||
|
|
||||||
|
|
||||||
&:after
|
|
||||||
background: rgb(27, 38, 59)
|
|
||||||
|
|
||||||
table
|
|
||||||
&:after,.copy-notice
|
|
||||||
background: rgb(27, 38, 59)
|
|
||||||
|
|
||||||
&::-webkit-scrollbar-thumb
|
|
||||||
background: lighten(#1B2631,10)
|
|
||||||
|
|
||||||
.copy-notice
|
|
||||||
background: rgb(27, 38, 59)
|
|
||||||
|
|
||||||
.post-cards,.md-links-item
|
|
||||||
a
|
|
||||||
color: #99a9bf
|
|
||||||
|
|
||||||
.aplayer
|
|
||||||
color: #000000
|
|
||||||
filter: brightness(0.6)
|
|
||||||
|
|
||||||
.article-sort-item__title
|
|
||||||
color: #99a9bf
|
|
||||||
|
|
||||||
.category-list
|
|
||||||
a
|
|
||||||
color: #99a9bf
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.translate_chn_to_cht,
|
|
||||||
.nightshift,
|
|
||||||
#readmode,
|
|
||||||
#to_comment,
|
|
||||||
#font_plus,
|
|
||||||
#font_minus,
|
|
||||||
#rightside_config,
|
|
||||||
#go-up,
|
|
||||||
#mobile-toc-button
|
|
||||||
background-color: #2d3035 !important
|
|
||||||
|
|
||||||
img
|
|
||||||
filter: brightness(0.6)
|
|
||||||
|
|
||||||
.layout_post
|
|
||||||
background:#2d3035
|
|
||||||
|
|
||||||
canvas
|
|
||||||
display: none !important
|
|
||||||
|
|
||||||
#aside_content
|
|
||||||
.card_widget
|
|
||||||
background:#2d3035 !important
|
|
||||||
.headline,
|
|
||||||
.length_num,
|
|
||||||
.aside_post_title,
|
|
||||||
.aside_category_list_link,
|
|
||||||
.archive-list-link,
|
|
||||||
.social-icon
|
|
||||||
color: #99a9bf !important
|
|
||||||
|
|
||||||
#bookmark-it
|
|
||||||
background: #616a6b !important
|
|
||||||
|
|
||||||
#archive,
|
|
||||||
.tag-cloud,
|
|
||||||
#tag,
|
|
||||||
.category-content,
|
|
||||||
#category,
|
|
||||||
#page,
|
|
||||||
.flink
|
|
||||||
background:#2d3035
|
|
||||||
|
|
||||||
#nav,
|
|
||||||
#top-container,
|
|
||||||
footer
|
|
||||||
&::before
|
|
||||||
content: ""
|
|
||||||
position: absolute
|
|
||||||
top: 0
|
|
||||||
bottom: 0
|
|
||||||
left: 0
|
|
||||||
right: 0
|
|
||||||
background-color: rgba(0,0,0,.6)
|
|
||||||
|
|
||||||
.layout_page
|
|
||||||
.post-meta__date,
|
|
||||||
.article-meta__separator,
|
|
||||||
.article-meta__categories,
|
|
||||||
i
|
|
||||||
color: #99a9bf
|
|
||||||
|
|
||||||
#site-info .blogtitle,
|
|
||||||
span.subtitle,
|
|
||||||
#site-title,
|
|
||||||
#post-info .posttitle,
|
|
||||||
#post-info #post-meta,
|
|
||||||
#site-social-icons i,
|
|
||||||
#top-container a,
|
|
||||||
#footer,
|
|
||||||
#footer a,
|
|
||||||
#page-header a,
|
|
||||||
#page-header .toggle-menu
|
|
||||||
color: rgba(238,238,238,.6)
|
|
||||||
|
|
||||||
#footer
|
|
||||||
background-color: #2d3032
|
|
||||||
|
|
||||||
//打賞 分享
|
|
||||||
.post-reward
|
|
||||||
.reward-button
|
|
||||||
background-color: #616a6b
|
|
||||||
.post_share
|
|
||||||
filter: brightness(0.6)
|
|
||||||
img
|
|
||||||
filter: brightness(1)
|
|
||||||
|
|
||||||
&::-webkit-scrollbar-thumb
|
|
||||||
background: lighten(#2d3035,5)
|
|
||||||
|
|
||||||
#web_bg
|
|
||||||
background-color: #2d3032
|
|
||||||
|
|
||||||
#hbe-security
|
|
||||||
label
|
|
||||||
color: #99a9bf !important
|
|
||||||
input
|
|
||||||
background-color: #616a6b
|
|
||||||
|
|
||||||
|
|
||||||
#mobile-sidebar
|
|
||||||
#mobile-sidebar-menus
|
|
||||||
background: #2d3035
|
|
||||||
|
|
||||||
.headline
|
|
||||||
color: #99a9bf !important
|
|
||||||
|
|
||||||
.length_num
|
|
||||||
color: darken(#99a9bf,10) !important
|
|
||||||
a
|
|
||||||
color: #99a9bf !important
|
|
||||||
|
|
||||||
#mobile-sidebar-toc
|
|
||||||
background: #2d3035
|
|
||||||
a
|
|
||||||
color: #99a9bf !important
|
|
||||||
|
|
||||||
|
|
||||||
#page-header
|
|
||||||
.menus_item_child
|
|
||||||
background-color: #2d3035 !important
|
|
||||||
|
|
||||||
&:before
|
|
||||||
border-color: transparent transparent #2d3035 !important
|
|
||||||
|
|
||||||
li
|
|
||||||
a
|
|
||||||
color: #99a9bf
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,90 +1,78 @@
|
|||||||
galleryItemStyle(w, h)
|
.layout_page
|
||||||
.gallery
|
display: flex
|
||||||
&-item
|
margin: 0 auto
|
||||||
width: w
|
max-width: 1200px
|
||||||
height: unit(h, "rem")
|
align-items: flex-start
|
||||||
|
padding: 0 15px
|
||||||
|
|
||||||
&__title
|
//index
|
||||||
transform: translate3d(0, unit(h, "rem"), 0)
|
#recent-posts
|
||||||
|
width: 75%
|
||||||
|
|
||||||
|
.recent-post-item
|
||||||
|
padding: 0
|
||||||
|
box-shadow: 0 4px 8px 6px rgba(7,17,27,0.06)
|
||||||
|
border-radius: 8px
|
||||||
|
transition: all 0.3s
|
||||||
|
background: #fff
|
||||||
|
margin-top: 20px
|
||||||
|
height: 280px
|
||||||
|
|
||||||
&:hover
|
&:hover
|
||||||
.gallery-item__title
|
-webkit-box-shadow: 0 4px 12px 12px rgba(7,17,27,0.15)
|
||||||
transform: translate3d(0, unit(h - 1.5, "rem"), 0)
|
box-shadow: 0 4px 12px 12px rgba(7,17,27,0.15)
|
||||||
|
|
||||||
.recent-post-item
|
img.post_bg
|
||||||
.content
|
transform:scale(1.1)
|
||||||
margin-top: 0.5rem
|
|
||||||
|
|
||||||
p
|
.left_radius
|
||||||
word-break: break-word
|
border-top-left-radius: 8px
|
||||||
|
border-bottom-left-radius: 8px
|
||||||
|
|
||||||
|
.right_radius
|
||||||
|
border-top-right-radius: 8px
|
||||||
|
border-bottom-right-radius: 8px
|
||||||
|
|
||||||
ol,
|
.post_cover
|
||||||
ul
|
width: 45%
|
||||||
margin-top: 0.4rem
|
height: 280px
|
||||||
padding: 0 0 0 0.8rem
|
overflow: hidden
|
||||||
list-style: none
|
|
||||||
counter-reset: li
|
|
||||||
|
|
||||||
p
|
.post_bg
|
||||||
|
border: 0
|
||||||
|
transition: all .6s
|
||||||
|
display: block
|
||||||
|
width: 100%
|
||||||
|
height: 100%
|
||||||
|
padding: 0
|
||||||
margin: 0
|
margin: 0
|
||||||
|
object-fit: cover
|
||||||
ol,
|
|
||||||
ul
|
|
||||||
padding-left: 0.5rem
|
|
||||||
|
|
||||||
li
|
|
||||||
position: relative
|
|
||||||
margin: 0.2rem 0
|
|
||||||
padding: 0.1rem 0.5rem 0.1rem 1.5rem
|
|
||||||
|
|
||||||
&:hover
|
&:hover
|
||||||
&:before
|
transform:scale(1.1)
|
||||||
transform: rotate(360deg)
|
|
||||||
|
|
||||||
&:before
|
.recent-post-info
|
||||||
position: absolute
|
padding: 50px 40px
|
||||||
top: 0
|
display: inline-block
|
||||||
left: 0
|
width: 55%
|
||||||
background: $light-blue
|
overflow hidden
|
||||||
color: $white
|
|
||||||
cursor: pointer
|
|
||||||
transition: all 0.3s ease-out
|
|
||||||
|
|
||||||
ol
|
|
||||||
li
|
|
||||||
&:before
|
|
||||||
margin-top: 0.2rem
|
|
||||||
width: w = 1.2rem
|
|
||||||
height: h = w
|
|
||||||
border-radius: 0.5 * w
|
|
||||||
content: counter(li)
|
|
||||||
counter-increment: li
|
|
||||||
text-align: center
|
|
||||||
font-size: 0.6rem
|
|
||||||
line-height: h
|
|
||||||
|
|
||||||
ul
|
a.article-meta__categories
|
||||||
li
|
text-decoration: none
|
||||||
|
color: #858585
|
||||||
|
|
||||||
&:hover
|
&:hover
|
||||||
&:before
|
color: #49b1f5 !important
|
||||||
border-color: $ruby
|
|
||||||
|
|
||||||
&:before
|
.content
|
||||||
$w = 0.3rem
|
display: -webkit-box
|
||||||
top: 10px
|
-webkit-line-clamp: 3
|
||||||
margin-left: 0.45rem
|
-webkit-box-orient: vertical
|
||||||
width: w = $w
|
overflow: hidden
|
||||||
height: h = w
|
height: 90px
|
||||||
border: 0.5 * w solid $light-blue
|
margin-top: 0.5rem
|
||||||
border-radius: w
|
word-break: break-word
|
||||||
background: $white
|
|
||||||
content: ""
|
|
||||||
line-height: h
|
|
||||||
|
|
||||||
.article-type
|
|
||||||
margin-left: 0.3rem
|
|
||||||
color: $grey
|
|
||||||
|
|
||||||
.article-meta
|
.article-meta
|
||||||
color: $grey
|
color: $grey
|
||||||
@@ -121,7 +109,6 @@ galleryItemStyle(w, h)
|
|||||||
word-wrap: break-word
|
word-wrap: break-word
|
||||||
|
|
||||||
&:hover
|
&:hover
|
||||||
// border-bottom: 1px solid $light-blue
|
|
||||||
color: $light-blue !important
|
color: $light-blue !important
|
||||||
|
|
||||||
.tag-cloud
|
.tag-cloud
|
||||||
@@ -150,6 +137,30 @@ galleryItemStyle(w, h)
|
|||||||
#archive
|
#archive
|
||||||
padding: 3rem 3rem 3rem
|
padding: 3rem 3rem 3rem
|
||||||
|
|
||||||
|
#page,
|
||||||
|
.category-content,
|
||||||
|
.flink
|
||||||
|
padding: 40px 44px 44px
|
||||||
|
|
||||||
|
|
||||||
|
#page,
|
||||||
|
.category-content,
|
||||||
|
#archive,
|
||||||
|
.tag-cloud,
|
||||||
|
.flink,
|
||||||
|
#tag,
|
||||||
|
#category
|
||||||
|
box-shadow: 0 4px 8px 6px rgba(7,17,27,.06)
|
||||||
|
border-radius: 8px
|
||||||
|
transition: all .3s
|
||||||
|
background: #fff
|
||||||
|
margin-top: 20px
|
||||||
|
width: 75%
|
||||||
|
|
||||||
|
&:hover
|
||||||
|
box-shadow: 0 4px 12px 12px rgba(7,17,27,0.15)
|
||||||
|
|
||||||
|
|
||||||
.article-sort
|
.article-sort
|
||||||
padding-left: 1rem
|
padding-left: 1rem
|
||||||
border-left: 2px solid $pale-blue
|
border-left: 2px solid $pale-blue
|
||||||
@@ -296,48 +307,50 @@ galleryItemStyle(w, h)
|
|||||||
&:after
|
&:after
|
||||||
content: ")"
|
content: ")"
|
||||||
|
|
||||||
.gallery
|
|
||||||
&-item
|
|
||||||
position: relative
|
|
||||||
display: inline-block
|
|
||||||
overflow: hidden
|
|
||||||
margin: 0.4rem
|
|
||||||
width: 6rem
|
|
||||||
height: 6rem
|
|
||||||
background-position: 50% 50%
|
|
||||||
background-size: cover
|
|
||||||
background-repeat: no-repeat
|
|
||||||
cursor: pointer
|
|
||||||
transition: all 0.2s ease-in-out
|
|
||||||
|
|
||||||
&__title
|
|
||||||
position: absolute
|
|
||||||
overflow: hidden
|
|
||||||
padding: 0 0.4rem
|
|
||||||
width: 100%
|
|
||||||
height: 1.5rem
|
|
||||||
background: rgba(0, 0, 0, 0.5)
|
|
||||||
color: $pale-blue
|
|
||||||
text-align: center
|
|
||||||
text-overflow: ellipsis
|
|
||||||
white-space: nowrap
|
|
||||||
line-height: 1.5rem
|
|
||||||
transition: 0.2s ease-in-out
|
|
||||||
transform: translate3d(0, 6rem, 0)
|
|
||||||
|
|
||||||
&:hover
|
|
||||||
.gallery-item__title
|
|
||||||
transform: translate3d(0, 4.5rem, 0)
|
|
||||||
|
|
||||||
@media screen and (max-width: $sm)
|
@media screen and (max-width: $sm)
|
||||||
|
.layout_page
|
||||||
|
padding: 0 5px !important
|
||||||
|
|
||||||
|
#page,
|
||||||
|
.category-content,
|
||||||
|
#archive,
|
||||||
|
.tag-cloud,
|
||||||
|
.flink,
|
||||||
|
#tag,
|
||||||
|
#category
|
||||||
|
padding: 1.8rem 1.3rem
|
||||||
|
margin-top: 10px
|
||||||
|
|
||||||
|
.category-lists
|
||||||
|
padding: 0
|
||||||
|
|
||||||
|
#recent-posts
|
||||||
.recent-post-item
|
.recent-post-item
|
||||||
|
height: auto !important
|
||||||
|
|
||||||
|
.post_cover
|
||||||
|
width: 100%
|
||||||
|
height: 230px
|
||||||
|
border-radius: 8px 8px 0 0
|
||||||
|
|
||||||
|
.recent-post-info
|
||||||
|
padding: 30px 25px 18px!important
|
||||||
|
width: 100%
|
||||||
|
|
||||||
.article-title
|
.article-title
|
||||||
font-size: 1rem
|
font-size: 1rem
|
||||||
|
|
||||||
.article-meta.tags
|
.article-meta.tags
|
||||||
display: none
|
display: none
|
||||||
|
|
||||||
galleryItemStyle(calc(50% - 22px), 6)
|
&:first-child
|
||||||
|
margin-top: 10px
|
||||||
|
|
||||||
@media screen and (min-width: $md)
|
@media screen and (min-width: 900px)
|
||||||
galleryItemStyle(8rem, 8)
|
if hexo-config("aside.position") == "left"
|
||||||
|
#recent-posts,#page,.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
|
||||||
@@ -72,13 +72,17 @@ if hexo-config("post_beautify.enable")
|
|||||||
width: 100%
|
width: 100%
|
||||||
color: $light-grey
|
color: $light-grey
|
||||||
text-align: left
|
text-align: left
|
||||||
padding-left: 8%
|
padding: 0 8%
|
||||||
position: absolute
|
position: absolute
|
||||||
bottom: 1.5rem
|
bottom: 1.5rem
|
||||||
|
|
||||||
#post-title
|
#post-title
|
||||||
text-shadow: 0.1rem 0.1rem 0.2rem rgba(0, 0, 0, 0.15)
|
text-shadow: 0.1rem 0.1rem 0.2rem rgba(0, 0, 0, 0.15)
|
||||||
font-size: 1.5rem
|
font-size: 1.5rem
|
||||||
|
margin-bottom: 0.4rem
|
||||||
|
|
||||||
|
.posttitle
|
||||||
|
line-height: 1.5
|
||||||
|
|
||||||
i.fa.fa-angle-right
|
i.fa.fa-angle-right
|
||||||
margin: 0 0.3rem 0 0.2rem
|
margin: 0 0.3rem 0 0.2rem
|
||||||
@@ -108,12 +112,8 @@ if hexo-config("post_beautify.enable")
|
|||||||
background: $light-blue
|
background: $light-blue
|
||||||
color: $white
|
color: $white
|
||||||
|
|
||||||
.layout
|
|
||||||
margin: 0 auto
|
|
||||||
max-width: 1000px
|
|
||||||
|
|
||||||
#post-content
|
#post-content
|
||||||
margin-bottom: 1rem
|
|
||||||
|
|
||||||
if hexo-config("post_beautify.enable")
|
if hexo-config("post_beautify.enable")
|
||||||
h1,
|
h1,
|
||||||
@@ -321,7 +321,7 @@ img
|
|||||||
|
|
||||||
.post-copyright
|
.post-copyright
|
||||||
position: relative
|
position: relative
|
||||||
margin-bottom: 0.4rem
|
margin: 1rem 0 0.5rem 0
|
||||||
padding: 0.5rem 0.8rem
|
padding: 0.5rem 0.8rem
|
||||||
border: 1px solid $light-grey
|
border: 1px solid $light-grey
|
||||||
transition: box-shadow 0.3s ease-in-out
|
transition: box-shadow 0.3s ease-in-out
|
||||||
@@ -359,13 +359,7 @@ img
|
|||||||
|
|
||||||
|
|
||||||
@media screen and (max-width: $sm)
|
@media screen and (max-width: $sm)
|
||||||
.layout
|
|
||||||
margin: 0 30px
|
|
||||||
width: auto
|
|
||||||
|
|
||||||
#top-container
|
#top-container
|
||||||
// background-attachment: local
|
|
||||||
|
|
||||||
#post-title
|
#post-title
|
||||||
font-size: 1rem
|
font-size: 1rem
|
||||||
|
|
||||||
@@ -374,7 +368,7 @@ img
|
|||||||
|
|
||||||
|
|
||||||
@media screen and (min-width: $md)
|
@media screen and (min-width: $md)
|
||||||
.layout
|
.layout_post
|
||||||
width: $content-large-width
|
width: $content-large-width
|
||||||
|
|
||||||
.katex-wrap
|
.katex-wrap
|
||||||
@@ -394,10 +388,6 @@ img
|
|||||||
font-size: 1em
|
font-size: 1em
|
||||||
|
|
||||||
|
|
||||||
@media screen and (max-width: 1024px)
|
|
||||||
.layout
|
|
||||||
margin: 0 15px
|
|
||||||
width: auto
|
|
||||||
|
|
||||||
.layout_post
|
.layout_post
|
||||||
padding: 50px
|
padding: 50px
|
||||||
@@ -405,8 +395,8 @@ img
|
|||||||
border-radius: 8px
|
border-radius: 8px
|
||||||
transition: all 0.3s
|
transition: all 0.3s
|
||||||
background: #fff
|
background: #fff
|
||||||
margin-top: 40px
|
margin: 40px auto
|
||||||
margin-bottom: 40px
|
max-width: 1000px
|
||||||
|
|
||||||
&:hover
|
&:hover
|
||||||
box-shadow: 0 4px 12px 12px rgba(7,17,27,0.15)
|
box-shadow: 0 4px 12px 12px rgba(7,17,27,0.15)
|
||||||
@@ -444,15 +434,13 @@ img
|
|||||||
text-decoration: none
|
text-decoration: none
|
||||||
color: $light-blue
|
color: $light-blue
|
||||||
|
|
||||||
h1
|
h1,
|
||||||
margin: 0.8rem 0
|
|
||||||
|
|
||||||
h2,
|
h2,
|
||||||
h3,
|
h3,
|
||||||
h4,
|
h4,
|
||||||
h5,
|
h5,
|
||||||
h6
|
h6
|
||||||
margin: 1rem 0 0.5rem 0
|
margin: 1rem 0 0.8rem 0
|
||||||
|
|
||||||
img
|
img
|
||||||
margin: 0 auto 0.8rem
|
margin: 0 auto 0.8rem
|
||||||
@@ -461,16 +449,19 @@ img
|
|||||||
p
|
p
|
||||||
margin: 0 0 0.8rem 0
|
margin: 0 0 0.8rem 0
|
||||||
|
|
||||||
|
iframe,.note
|
||||||
|
margin: 0 0 0.8rem 0
|
||||||
|
|
||||||
table,.note
|
.layout_post,
|
||||||
margin: 0.8rem 0
|
.layout_page
|
||||||
|
opacity: 1
|
||||||
|
|
||||||
figure
|
@media screen and (max-width: 1024px)
|
||||||
margin: 0.8rem 0
|
.layout_post
|
||||||
|
margin: 0 15px
|
||||||
|
width: auto
|
||||||
|
|
||||||
table
|
@media screen and (max-width:768px)
|
||||||
margin: 0
|
.layout_post
|
||||||
|
padding: 1.8rem 1rem
|
||||||
blockquote
|
margin: 30px 5px
|
||||||
p
|
|
||||||
margin: 0.5rem 0
|
|
||||||
|
|||||||
@@ -76,13 +76,13 @@ if hexo-config("readmode") && hexo-config("readmode.enable")
|
|||||||
background-color: rgba(102,128,153,.05)
|
background-color: rgba(102,128,153,.05)
|
||||||
|
|
||||||
#rightside
|
#rightside
|
||||||
#nightshift
|
#darkmode
|
||||||
display: none
|
display: none
|
||||||
|
|
||||||
canvas
|
canvas
|
||||||
display: none !important
|
display: none !important
|
||||||
|
|
||||||
footer,
|
#footer,
|
||||||
#post-comment,
|
#post-comment,
|
||||||
hr,
|
hr,
|
||||||
.relatedPosts,
|
.relatedPosts,
|
||||||
|
|||||||
@@ -6,14 +6,13 @@
|
|||||||
opacity 0
|
opacity 0
|
||||||
|
|
||||||
#rightside-config-hide
|
#rightside-config-hide
|
||||||
transition: all .3s
|
|
||||||
display none
|
display none
|
||||||
|
|
||||||
#readmode,
|
#readmode,
|
||||||
#font_plus,
|
#font_plus,
|
||||||
#font_minus,
|
#font_minus,
|
||||||
#to_comment,
|
#to_comment,
|
||||||
.nightshift,
|
.darkmode,
|
||||||
#mobile-toc-button,
|
#mobile-toc-button,
|
||||||
#go-up,
|
#go-up,
|
||||||
#rightside_config
|
#rightside_config
|
||||||
|
|||||||
@@ -10,6 +10,8 @@
|
|||||||
background: $sidebar-background
|
background: $sidebar-background
|
||||||
box-shadow: -0.25rem 0 0.25rem rgba(232, 237, 250, 0.6) inset
|
box-shadow: -0.25rem 0 0.25rem rgba(232, 237, 250, 0.6) inset
|
||||||
opacity: 0.9
|
opacity: 0.9
|
||||||
|
will-change: transform
|
||||||
|
transition: transform .2s
|
||||||
|
|
||||||
.sidebar-toc
|
.sidebar-toc
|
||||||
ol,
|
ol,
|
||||||
|
|||||||
300
source/css/_layout/z-darkmode.styl
Normal file
300
source/css/_layout/z-darkmode.styl
Normal file
@@ -0,0 +1,300 @@
|
|||||||
|
[data-theme="dark"]
|
||||||
|
body
|
||||||
|
color: #99a9bf
|
||||||
|
background-color: #2d3032
|
||||||
|
|
||||||
|
&::-webkit-scrollbar-thumb
|
||||||
|
background: lighten(#2d3035,5)
|
||||||
|
|
||||||
|
#sidebar
|
||||||
|
background: #2d3035
|
||||||
|
box-shadow: -0.25rem 0 0.25rem #2d3035
|
||||||
|
|
||||||
|
&::-webkit-scrollbar-thumb
|
||||||
|
background: lighten(#2d3035,5)
|
||||||
|
|
||||||
|
if hexo-config("local_search") && hexo-config("local_search.enable")
|
||||||
|
#local-search
|
||||||
|
background: #2d3035
|
||||||
|
.local-search-box--input
|
||||||
|
background: #2d3035
|
||||||
|
color: #99a9bf
|
||||||
|
|
||||||
|
.search-result-title
|
||||||
|
color: #99a9bf
|
||||||
|
if hexo-config("algolia_search.enable")
|
||||||
|
#algolia-search
|
||||||
|
background: #2d3035
|
||||||
|
.ais-search-box--input
|
||||||
|
background: #2d3035
|
||||||
|
color: #99a9bf
|
||||||
|
|
||||||
|
#algolia-search-results
|
||||||
|
.algolia-hit-item-link
|
||||||
|
color: #99a9bf
|
||||||
|
|
||||||
|
.article-container code
|
||||||
|
background: #616a6b
|
||||||
|
color: #99a9bf
|
||||||
|
|
||||||
|
if hexo-config('valine') && hexo-config('valine.enable')
|
||||||
|
// 評論
|
||||||
|
#vcomment
|
||||||
|
p,a,textarea,.vemoji-btn,.vpreview-btn,input,path,.vcount,.vnum,.vtime,.vsys,.vsys,.vnick
|
||||||
|
color: #99a9bf !important
|
||||||
|
|
||||||
|
.vsys
|
||||||
|
background: rgb(97, 106, 107) !important
|
||||||
|
|
||||||
|
.vbtn
|
||||||
|
background: rgb(45, 48, 53) !important
|
||||||
|
color: #99a9bf !important
|
||||||
|
border: 1px solid #99a9bf
|
||||||
|
|
||||||
|
.vwrap
|
||||||
|
border: 1px solid #99a9bf
|
||||||
|
|
||||||
|
input
|
||||||
|
border-bottom: 1px dashed #616a6b
|
||||||
|
|
||||||
|
.vh
|
||||||
|
border-bottom: 1px dashed #616a6b
|
||||||
|
|
||||||
|
pre
|
||||||
|
background-color: #2d3035
|
||||||
|
border: 1px solid #99a9bf
|
||||||
|
|
||||||
|
.vcontent.expand:before
|
||||||
|
background: linear-gradient(180deg,hsla(0, 0%, 0%, 0),hsl(218, 8%, 19%))
|
||||||
|
|
||||||
|
.vcontent.expand:after
|
||||||
|
background: hsla(204, 5%, 22%, 1)
|
||||||
|
|
||||||
|
.recent-posts
|
||||||
|
.recent-post-item
|
||||||
|
background: #2d3032 !important
|
||||||
|
|
||||||
|
.article-title
|
||||||
|
color: #99a9bf !important
|
||||||
|
|
||||||
|
#page-header
|
||||||
|
&.fixed
|
||||||
|
background: #2d3035
|
||||||
|
box-shadow: 0 5px 6px -5px rgba(133,133,133,0)
|
||||||
|
|
||||||
|
a,
|
||||||
|
.toggle-menu,
|
||||||
|
#site-name
|
||||||
|
color: #99a9bf
|
||||||
|
|
||||||
|
blockquote
|
||||||
|
color: #99a9bf
|
||||||
|
background-color: lighten(#2d3035,10)
|
||||||
|
|
||||||
|
hr
|
||||||
|
background: 0
|
||||||
|
border: 2px dashed #616A6B
|
||||||
|
&:before
|
||||||
|
color: #99a9bf
|
||||||
|
|
||||||
|
.post-meta__tags
|
||||||
|
background: 0
|
||||||
|
border: 1px solid #99a9bf
|
||||||
|
color: #99a9bf
|
||||||
|
|
||||||
|
.post-copyright
|
||||||
|
border: 1px solid #99a9bf
|
||||||
|
|
||||||
|
*
|
||||||
|
color: #99a9bf
|
||||||
|
|
||||||
|
.article-container pre
|
||||||
|
background-color: lighten(#2d3035, 2)
|
||||||
|
|
||||||
|
.article-container .highlight:not(.js-file-line-container)
|
||||||
|
background-color: lighten(#2d3035, 2)
|
||||||
|
.code pre
|
||||||
|
background-color: lighten(#2d3035, 2)
|
||||||
|
|
||||||
|
.gutter pre
|
||||||
|
background: lighten(#2d3035, 3)
|
||||||
|
|
||||||
|
&:after
|
||||||
|
background: lighten(#2d3035, 3)
|
||||||
|
|
||||||
|
table
|
||||||
|
&:after,.copy-notice
|
||||||
|
background: lighten(#2d3035, 3)
|
||||||
|
|
||||||
|
&::-webkit-scrollbar-thumb
|
||||||
|
background: lighten(#2d3035, 8)
|
||||||
|
|
||||||
|
.copy-notice
|
||||||
|
background: lighten(#2d3035, 3)
|
||||||
|
|
||||||
|
.aplayer
|
||||||
|
color: #000000
|
||||||
|
filter: brightness(0.6)
|
||||||
|
|
||||||
|
.translate_chn_to_cht,
|
||||||
|
.darkmode,
|
||||||
|
#readmode,
|
||||||
|
#to_comment,
|
||||||
|
#font_plus,
|
||||||
|
#font_minus,
|
||||||
|
#rightside_config,
|
||||||
|
#go-up,
|
||||||
|
#mobile-toc-button
|
||||||
|
background-color: lighten(#2d3035,10) !important
|
||||||
|
color: #99a9bf !important
|
||||||
|
|
||||||
|
&:hover
|
||||||
|
background: lighten(#2d3035,20) !important
|
||||||
|
|
||||||
|
.md-links-item:before,
|
||||||
|
.aside_category_list:hover,
|
||||||
|
.archive-list-item:hover,
|
||||||
|
#bookmark-it,
|
||||||
|
.reward-button,
|
||||||
|
.reward-all,
|
||||||
|
.note
|
||||||
|
background-color: lighten(#2d3035,10) !important
|
||||||
|
|
||||||
|
img,iframe,.gist
|
||||||
|
filter: brightness(0.7)
|
||||||
|
|
||||||
|
#aside_content
|
||||||
|
.card_widget
|
||||||
|
background:#2d3035 !important
|
||||||
|
.headline,
|
||||||
|
.length_num,
|
||||||
|
.aside_post_title,
|
||||||
|
.aside_category_list_link,
|
||||||
|
.archive-list-link,
|
||||||
|
.social-icon
|
||||||
|
color: #99a9bf !important
|
||||||
|
|
||||||
|
#archive,
|
||||||
|
.tag-cloud,
|
||||||
|
#tag,
|
||||||
|
.category-content,
|
||||||
|
#category,
|
||||||
|
#page,
|
||||||
|
.flink,
|
||||||
|
.layout_post,
|
||||||
|
#footer-wrap
|
||||||
|
background:#2d3035
|
||||||
|
|
||||||
|
#nav,
|
||||||
|
#top-container,
|
||||||
|
#footer
|
||||||
|
&::before
|
||||||
|
content: ""
|
||||||
|
position: absolute
|
||||||
|
top: 0
|
||||||
|
bottom: 0
|
||||||
|
left: 0
|
||||||
|
right: 0
|
||||||
|
background-color: rgba(0,0,0,0.7)
|
||||||
|
|
||||||
|
#nav span,
|
||||||
|
#nav i,
|
||||||
|
#page-header a,
|
||||||
|
#page-header .toggle-menu,
|
||||||
|
#top-container #post-meta,
|
||||||
|
#top-container a,
|
||||||
|
.posttitle,
|
||||||
|
#footer-wrap,
|
||||||
|
#footer-wrap a
|
||||||
|
color: lighten(#99a9bf,10)
|
||||||
|
|
||||||
|
.recent-posts .post-meta__date,
|
||||||
|
.recent-posts .article-meta,
|
||||||
|
.recent-posts .article-meta__categories,
|
||||||
|
h1, h2, h3, h4, h5, h6,
|
||||||
|
.prev_info,
|
||||||
|
.next_info,
|
||||||
|
.post-reward .reward-button,
|
||||||
|
.fa-clipboard,
|
||||||
|
.gutter pre,
|
||||||
|
#bookmark-it,
|
||||||
|
.copy-notice,
|
||||||
|
.md-links-item a,
|
||||||
|
.category-list-link
|
||||||
|
color: #99a9bf !important
|
||||||
|
|
||||||
|
.article-sort-item__title
|
||||||
|
color: #99a9bf
|
||||||
|
&:hover
|
||||||
|
color: #49b1f5
|
||||||
|
|
||||||
|
//打賞 分享
|
||||||
|
.post-reward
|
||||||
|
.reward-all:after
|
||||||
|
border-top: 13px solid lighten(#2d3035,10) !important
|
||||||
|
|
||||||
|
|
||||||
|
#web_bg[data-type=color]
|
||||||
|
background: #2d3032
|
||||||
|
|
||||||
|
#web_bg[data-type=photo]:before
|
||||||
|
content: ""
|
||||||
|
position: absolute
|
||||||
|
top: 0
|
||||||
|
bottom: 0
|
||||||
|
left: 0
|
||||||
|
right: 0
|
||||||
|
background-color: rgba(0,0,0,0.8)
|
||||||
|
|
||||||
|
#hbe-security
|
||||||
|
label
|
||||||
|
color: #99a9bf !important
|
||||||
|
input
|
||||||
|
background-color: #616a6b
|
||||||
|
|
||||||
|
|
||||||
|
#mobile-sidebar
|
||||||
|
#mobile-sidebar-menus
|
||||||
|
background: #2d3035
|
||||||
|
|
||||||
|
.headline
|
||||||
|
color: #99a9bf !important
|
||||||
|
|
||||||
|
.length_num
|
||||||
|
color: darken(#99a9bf,10) !important
|
||||||
|
a
|
||||||
|
color: #99a9bf !important
|
||||||
|
|
||||||
|
#mobile-sidebar-toc
|
||||||
|
background: #2d3035
|
||||||
|
a
|
||||||
|
color: #99a9bf !important
|
||||||
|
|
||||||
|
#page-header
|
||||||
|
.menus_item_child
|
||||||
|
background-color: #2d3035 !important
|
||||||
|
|
||||||
|
&:before
|
||||||
|
border-color: transparent transparent #2d3035 !important
|
||||||
|
|
||||||
|
li
|
||||||
|
a
|
||||||
|
color: #99a9bf
|
||||||
|
|
||||||
|
.bookmark--animated:before
|
||||||
|
background: lighten(#2d3035,20) !important
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,302 +0,0 @@
|
|||||||
#recent-posts
|
|
||||||
width: 75%
|
|
||||||
|
|
||||||
.recent-post-item
|
|
||||||
padding: 0
|
|
||||||
box-shadow: 0 4px 8px 6px rgba(7,17,27,0.06)
|
|
||||||
border-radius: 8px
|
|
||||||
transition: all 0.3s
|
|
||||||
background: #fff
|
|
||||||
margin-top: 20px
|
|
||||||
height: 280px
|
|
||||||
|
|
||||||
&:hover
|
|
||||||
-webkit-box-shadow: 0 4px 12px 12px rgba(7,17,27,0.15)
|
|
||||||
box-shadow: 0 4px 12px 12px rgba(7,17,27,0.15)
|
|
||||||
|
|
||||||
img.post_bg
|
|
||||||
transform:scale(1.1)
|
|
||||||
|
|
||||||
.is_left
|
|
||||||
float: left
|
|
||||||
border-top-left-radius: 8px
|
|
||||||
border-bottom-left-radius: 8px
|
|
||||||
|
|
||||||
.is_right
|
|
||||||
float: right
|
|
||||||
border-top-right-radius: 8px
|
|
||||||
border-bottom-right-radius: 8px
|
|
||||||
|
|
||||||
.post_cover
|
|
||||||
width: 45%
|
|
||||||
height: 280px
|
|
||||||
overflow: hidden
|
|
||||||
|
|
||||||
img.post_bg
|
|
||||||
border: 0
|
|
||||||
transition: all .6s
|
|
||||||
display: block
|
|
||||||
width: 100%
|
|
||||||
height: 100%
|
|
||||||
padding: 0
|
|
||||||
margin: 0
|
|
||||||
object-fit: cover
|
|
||||||
|
|
||||||
&:hover
|
|
||||||
transform:scale(1.1)
|
|
||||||
|
|
||||||
#pagination
|
|
||||||
margin-top: 2rem
|
|
||||||
|
|
||||||
.recent-post-info
|
|
||||||
padding: 50px 40px
|
|
||||||
display: inline-block
|
|
||||||
width: 55%
|
|
||||||
overflow hidden
|
|
||||||
|
|
||||||
|
|
||||||
a.article-meta__categories
|
|
||||||
text-decoration: none
|
|
||||||
color: #858585
|
|
||||||
|
|
||||||
&:hover
|
|
||||||
color: #49b1f5 !important
|
|
||||||
|
|
||||||
.content
|
|
||||||
display: -webkit-box
|
|
||||||
-webkit-line-clamp: 3
|
|
||||||
-webkit-box-orient: vertical
|
|
||||||
overflow: hidden
|
|
||||||
height: 90px
|
|
||||||
|
|
||||||
.layout_page
|
|
||||||
display: flex
|
|
||||||
margin: 0 auto
|
|
||||||
max-width: 1200px
|
|
||||||
align-items: flex-start
|
|
||||||
padding: 0 15px
|
|
||||||
|
|
||||||
|
|
||||||
#page,.category-content,.flink
|
|
||||||
padding: 40px 44px 44px
|
|
||||||
|
|
||||||
#page,.category-content,#archive,.tag-cloud,.flink,#tag,#category
|
|
||||||
box-shadow: 0 4px 8px 6px rgba(7,17,27,.06)
|
|
||||||
border-radius: 8px
|
|
||||||
transition: all .3s
|
|
||||||
background: #fff
|
|
||||||
margin-top: 20px
|
|
||||||
width: 75%
|
|
||||||
|
|
||||||
.card_widget,#archive,.tag-cloud,#tag,.category-content,#category,#page,.flink
|
|
||||||
|
|
||||||
&:hover
|
|
||||||
box-shadow: 0 4px 12px 12px rgba(7,17,27,0.15)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@media screen and (min-width: 900px)
|
|
||||||
if hexo-config("aside.position") == "left"
|
|
||||||
#recent-posts,#page,.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
|
|
||||||
|
|
||||||
|
|
||||||
@media screen and (max-width:768px)
|
|
||||||
#web_bg
|
|
||||||
display: none
|
|
||||||
|
|
||||||
.recent-post-item
|
|
||||||
height: auto !important
|
|
||||||
border-radius: 8px
|
|
||||||
|
|
||||||
.post_cover
|
|
||||||
width: 100% !important
|
|
||||||
height: 230px !important
|
|
||||||
border-radius: 8px !important
|
|
||||||
|
|
||||||
.recent-post-item,#page,.tag-cloud,.flink
|
|
||||||
margin-top: 1px
|
|
||||||
|
|
||||||
.recent-post-item,#page,.category-content,.tag-cloud,.flink
|
|
||||||
box-shadow: none !important
|
|
||||||
background: none !important
|
|
||||||
padding: 0px 20px 0 !important
|
|
||||||
|
|
||||||
&:hover
|
|
||||||
-webkit-box-shadow: none
|
|
||||||
box-shadow: none
|
|
||||||
|
|
||||||
#archive,#category,#tag
|
|
||||||
box-shadow: none !important
|
|
||||||
background: none !important
|
|
||||||
padding: 0px 30px 0 !important
|
|
||||||
|
|
||||||
|
|
||||||
.layout_post
|
|
||||||
padding: 0 20px 0
|
|
||||||
border-radius: 0
|
|
||||||
-webkit-box-shadow: none
|
|
||||||
box-shadow: none
|
|
||||||
background: none
|
|
||||||
margin: 0
|
|
||||||
|
|
||||||
&:hover
|
|
||||||
-webkit-box-shadow: none
|
|
||||||
box-shadow: none
|
|
||||||
|
|
||||||
.layout_page
|
|
||||||
padding: 0 !important
|
|
||||||
|
|
||||||
#aside_content
|
|
||||||
display: none !important
|
|
||||||
|
|
||||||
.category-lists
|
|
||||||
padding: 0
|
|
||||||
|
|
||||||
#recent-posts
|
|
||||||
.recent-post-info
|
|
||||||
padding: 20px 10px !important
|
|
||||||
width: 100%
|
|
||||||
|
|
||||||
#pagination
|
|
||||||
margin-bottom: 0
|
|
||||||
|
|
||||||
#nav
|
|
||||||
#site-social-icons
|
|
||||||
display: block
|
|
||||||
|
|
||||||
&.not_index_bg
|
|
||||||
height: 14rem
|
|
||||||
|
|
||||||
#page_site-info
|
|
||||||
top: 7rem
|
|
||||||
|
|
||||||
#top-container
|
|
||||||
height: 14rem
|
|
||||||
|
|
||||||
#post-info
|
|
||||||
bottom: 1rem
|
|
||||||
padding-left: 5%
|
|
||||||
|
|
||||||
.mobile_hidden
|
|
||||||
display: none
|
|
||||||
|
|
||||||
|
|
||||||
canvas
|
|
||||||
display: none !important
|
|
||||||
|
|
||||||
|
|
||||||
.layout_page,
|
|
||||||
.layout_post,
|
|
||||||
footer
|
|
||||||
animation: main 1s
|
|
||||||
|
|
||||||
#nav,
|
|
||||||
#top-container,
|
|
||||||
#page-header
|
|
||||||
animation: header 1s
|
|
||||||
|
|
||||||
#site-title
|
|
||||||
animation: titlescale 1s
|
|
||||||
|
|
||||||
canvas,
|
|
||||||
#web_bg
|
|
||||||
animation: to_show 4s
|
|
||||||
|
|
||||||
.card-announcement-animation
|
|
||||||
animation: announ_animation .8s linear infinite
|
|
||||||
color: #FF0000
|
|
||||||
|
|
||||||
.scroll-down-effects
|
|
||||||
animation: scroll-down-effect 1.5s infinite
|
|
||||||
|
|
||||||
if hexo-config("avatar_effect") == true
|
|
||||||
.avatar_img
|
|
||||||
animation: avatar_turn_around 2s linear infinite
|
|
||||||
|
|
||||||
.reward-main
|
|
||||||
animation: donate_effcet .3s .1s ease both
|
|
||||||
|
|
||||||
.rightside-in
|
|
||||||
animation: rightside_in_animate .3s
|
|
||||||
display: block !important
|
|
||||||
|
|
||||||
@keyframes scroll-down-effect
|
|
||||||
0%
|
|
||||||
opacity: 0.4
|
|
||||||
top: 0
|
|
||||||
50%
|
|
||||||
opacity: 1
|
|
||||||
top: -16px
|
|
||||||
100%
|
|
||||||
opacity: 0.4
|
|
||||||
top: 0
|
|
||||||
|
|
||||||
@keyframes header
|
|
||||||
0%
|
|
||||||
opacity: 0
|
|
||||||
transform: translateY(-50px)
|
|
||||||
100%
|
|
||||||
opacity: 1
|
|
||||||
transform: translateY(0)
|
|
||||||
|
|
||||||
@keyframes main
|
|
||||||
0%
|
|
||||||
opacity: 0
|
|
||||||
transform: translateY(50px)
|
|
||||||
100%
|
|
||||||
opacity: 1
|
|
||||||
transform: translateY(0)
|
|
||||||
|
|
||||||
@keyframes titlescale
|
|
||||||
0%
|
|
||||||
opacity: 0
|
|
||||||
transform: scale(0.7)
|
|
||||||
100%
|
|
||||||
opacity: 1
|
|
||||||
transform: scale(1)
|
|
||||||
|
|
||||||
@keyframes to_show
|
|
||||||
0%
|
|
||||||
opacity: 0
|
|
||||||
100%
|
|
||||||
opacity: 1
|
|
||||||
|
|
||||||
@keyframes avatar_turn_around
|
|
||||||
from
|
|
||||||
transform: rotate(0deg)
|
|
||||||
to
|
|
||||||
transform: rotate(360deg)
|
|
||||||
|
|
||||||
@keyframes sub_menus
|
|
||||||
0%
|
|
||||||
opacity: 0
|
|
||||||
transform: translateY(10px)
|
|
||||||
100%
|
|
||||||
opacity: 1
|
|
||||||
transform: translateY(0)
|
|
||||||
|
|
||||||
@keyframes donate_effcet
|
|
||||||
0%
|
|
||||||
opacity: 0
|
|
||||||
transform: translateY(-20px)
|
|
||||||
100%
|
|
||||||
opacity: 1
|
|
||||||
transform: translateY(0)
|
|
||||||
|
|
||||||
@keyframes announ_animation
|
|
||||||
0%,to
|
|
||||||
transform: scale(1)
|
|
||||||
50%
|
|
||||||
transform: scale(1.2)
|
|
||||||
|
|
||||||
@keyframes rightside_in_animate
|
|
||||||
0%
|
|
||||||
transform: translateX(28px)
|
|
||||||
100%
|
|
||||||
transform: translateX(0)
|
|
||||||
|
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
#algolia-search
|
#algolia-search
|
||||||
|
animation: titlescale 0.5s
|
||||||
|
|
||||||
.ais-search-box
|
.ais-search-box
|
||||||
margin: 0 auto
|
margin: 0 auto
|
||||||
max-width: 100%
|
max-width: 100%
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
#local-search
|
#local-search
|
||||||
|
animation: titlescale 0.5s
|
||||||
|
|
||||||
.local-search-box
|
.local-search-box
|
||||||
margin: 0 auto
|
margin: 0 auto
|
||||||
max-width: 100%
|
max-width: 100%
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 68 KiB |
1
source/img/post_loadding.svg
Normal file
1
source/img/post_loadding.svg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<svg width="200px" height="200px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" class="lds-pacman" style="background: none;"><g ng-attr-style="display:{{config.showBean}}" style="display:block"><circle cx="74.5405" cy="50" r="4" ng-attr-fill="{{config.c2}}" fill="#a3d9ef"><animate attributeName="cx" calcMode="linear" values="95;35" keyTimes="0;1" dur="0.8" begin="-0.536s" repeatCount="indefinite"></animate><animate attributeName="fill-opacity" calcMode="linear" values="0;1;1" keyTimes="0;0.2;1" dur="0.8" begin="-0.536s" repeatCount="indefinite"></animate></circle><circle cx="94.9405" cy="50" r="4" ng-attr-fill="{{config.c2}}" fill="#a3d9ef"><animate attributeName="cx" calcMode="linear" values="95;35" keyTimes="0;1" dur="0.8" begin="-0.264s" repeatCount="indefinite"></animate><animate attributeName="fill-opacity" calcMode="linear" values="0;1;1" keyTimes="0;0.2;1" dur="0.8" begin="-0.264s" repeatCount="indefinite"></animate></circle><circle cx="54.7405" cy="50" r="4" ng-attr-fill="{{config.c2}}" fill="#a3d9ef"><animate attributeName="cx" calcMode="linear" values="95;35" keyTimes="0;1" dur="0.8" begin="0s" repeatCount="indefinite"></animate><animate attributeName="fill-opacity" calcMode="linear" values="0;1;1" keyTimes="0;0.2;1" dur="0.8" begin="0s" repeatCount="indefinite"></animate></circle></g><g ng-attr-transform="translate({{config.showBeanOffset}} 0)" transform="translate(-15 0)"><path d="M50 50L20 50A30 30 0 0 0 80 50Z" ng-attr-fill="{{config.c1}}" fill="#82bbe4" transform="rotate(29.6108 50 50)"><animateTransform attributeName="transform" type="rotate" calcMode="linear" values="0 50 50;45 50 50;0 50 50" keyTimes="0;0.5;1" dur="0.8s" begin="0s" repeatCount="indefinite"></animateTransform></path><path d="M50 50L20 50A30 30 0 0 1 80 50Z" ng-attr-fill="{{config.c1}}" fill="#82bbe4" transform="rotate(-29.6108 50 50)"><animateTransform attributeName="transform" type="rotate" calcMode="linear" values="0 50 50;-45 50 50;0 50 50" keyTimes="0;0.5;1" dur="0.8s" begin="0s" repeatCount="indefinite"></animateTransform></path></g></svg>
|
||||||
|
After Width: | Height: | Size: 2.1 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 106 KiB |
@@ -1,34 +1,80 @@
|
|||||||
$(function () {
|
$(function () {
|
||||||
|
|
||||||
|
const is_Snackbar = GLOBAL_CONFIG.Snackbar !== undefined ? true : false
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 當menu過多時,自動適配,避免UI錯亂
|
||||||
|
*/
|
||||||
|
const ph_width = $("#page-header").width()
|
||||||
|
const search_width = $('#search_button').outerWidth()
|
||||||
|
var mw = 0;
|
||||||
|
for (var i = 0; i < $('#page-header .menus_item').length; i++) {
|
||||||
|
mw = mw + $('#page-header .menus_item').eq(i).outerWidth()
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($('#page-header').height() > 37 || window.innerWidth < 7) {
|
||||||
|
header_adjust()
|
||||||
|
}
|
||||||
|
|
||||||
|
function header_adjust() {
|
||||||
|
$("#page-header .toggle-menu").addClass("is_visible")
|
||||||
|
$("#page-header .menus,.search span").addClass("is_invisible")
|
||||||
|
}
|
||||||
|
|
||||||
|
function header_adjust_back() {
|
||||||
|
$("#page-header .toggle-menu").removeClass("is_visible")
|
||||||
|
$("#page-header .menus,.search span").removeClass("is_invisible")
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 傳入 1 sidebar打開時
|
||||||
|
* 傳入 2 正常狀態下
|
||||||
|
* 傳入 3 resize時使用
|
||||||
|
*/
|
||||||
|
function is_adjust(n) {
|
||||||
|
var t;
|
||||||
|
if (n == '1') {
|
||||||
|
t = $('#blog_name').width() + search_width + mw > $("#page-header").width() - 300 ? true : false
|
||||||
|
} else if (n == '2') {
|
||||||
|
t = $('#blog_name').width() + search_width + mw > $("#page-header").width() ? true : false
|
||||||
|
} else if (n == "3") {
|
||||||
|
t = $('#blog_name').width() + search_width + mw > $("#page-header").width() ? true : false
|
||||||
|
}
|
||||||
|
if (t) {
|
||||||
|
header_adjust()
|
||||||
|
} else {
|
||||||
|
header_adjust_back()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$(window).bind("resize", function () {
|
||||||
|
if (window.innerWidth > 768) {
|
||||||
|
is_adjust(3)
|
||||||
|
} else {
|
||||||
|
header_adjust()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
$('#page-header').css({'opacity':'1', 'animation':'headerNoOpacity .7s'})
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 進入post頁sidebar自動打開
|
* 進入post頁sidebar自動打開
|
||||||
*/
|
*/
|
||||||
if ($('#sidebar').hasClass('auto_open')) {
|
if ($('#sidebar').hasClass('auto_open')) {
|
||||||
if ($(".sidebar-toc__content").children().length > 0) {
|
if ($(".sidebar-toc__content").children().length > 0) {
|
||||||
|
$('#toggle-sidebar').addClass('on')
|
||||||
$(".layout_post").animate({}, function () {
|
$(".layout_post").animate({}, function () {
|
||||||
{
|
{
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
$('#page-header').addClass('open-sidebar')
|
$("#toggle-sidebar").addClass('on');
|
||||||
$("#toggle-sidebar").addClass('on')
|
open_sidebar()
|
||||||
$('body').animate({
|
}, 300);
|
||||||
paddingLeft: 300
|
|
||||||
}, 200)
|
|
||||||
|
|
||||||
$('#sidebar').animate({
|
is_adjust(1)
|
||||||
left: 0
|
|
||||||
}, 200)
|
|
||||||
|
|
||||||
$('#toggle-sidebar').animate({}, function () {
|
|
||||||
$('#toggle-sidebar').css({
|
|
||||||
'transform': 'rotateZ(180deg)',
|
|
||||||
'color': '#99a9bf',
|
|
||||||
'opacity': "1"
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
}, 200);
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
} else
|
} else
|
||||||
$("#toggle-sidebar").css("display", "none")
|
$("#toggle-sidebar").css("display", "none")
|
||||||
} else {
|
} else {
|
||||||
@@ -39,55 +85,65 @@ $(function () {
|
|||||||
/**
|
/**
|
||||||
* 點擊左下角箭頭,顯示sidebar
|
* 點擊左下角箭頭,顯示sidebar
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
function close_sidebar() {
|
||||||
|
$('#page-header').removeClass('open-sidebar')
|
||||||
|
$('body').animate({
|
||||||
|
paddingLeft: 0
|
||||||
|
}, 200)
|
||||||
|
|
||||||
|
$('#sidebar').animate({}, function () {
|
||||||
|
$('#sidebar').css('transform', 'translateX(0px)')
|
||||||
|
})
|
||||||
|
|
||||||
|
$('#toggle-sidebar').animate({}, function () {
|
||||||
|
$('#toggle-sidebar').css({
|
||||||
|
'transform': 'rotateZ(0deg)',
|
||||||
|
'color': '#1F2D3D',
|
||||||
|
'opacity': "1"
|
||||||
|
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function open_sidebar() {
|
||||||
|
$('#page-header').addClass('open-sidebar')
|
||||||
|
$('body').animate({
|
||||||
|
paddingLeft: 300
|
||||||
|
}, 200)
|
||||||
|
|
||||||
|
$('#sidebar').animate({}, function () {
|
||||||
|
$('#sidebar').css('transform', 'translateX(300px)')
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
$('#toggle-sidebar').animate({}, function () {
|
||||||
|
$('#toggle-sidebar').css({
|
||||||
|
'transform': 'rotateZ(180deg)',
|
||||||
|
'color': '#99a9bf',
|
||||||
|
'opacity': "1"
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
$('#toggle-sidebar').on('click', function () {
|
$('#toggle-sidebar').on('click', function () {
|
||||||
|
|
||||||
if (!isMobile() && $('#sidebar').is(':visible')) {
|
if (!isMobile() && $('#sidebar').is(':visible')) {
|
||||||
var isOpen = $(this).hasClass('on')
|
var isOpen = $(this).hasClass('on')
|
||||||
isOpen ? $(this).removeClass('on') : $(this).addClass('on')
|
isOpen ? $(this).removeClass('on') : $(this).addClass('on')
|
||||||
if (isOpen) {
|
if (isOpen) {
|
||||||
$('#page-header').removeClass('open-sidebar')
|
close_sidebar()
|
||||||
$('body').animate({
|
setTimeout(function () {
|
||||||
paddingLeft: 0
|
is_adjust(2)
|
||||||
}, 200)
|
}, 300)
|
||||||
|
|
||||||
$('#sidebar').animate({
|
|
||||||
left: -300
|
|
||||||
}, 200)
|
|
||||||
|
|
||||||
$('#toggle-sidebar').animate({}, function () {
|
|
||||||
$('#toggle-sidebar').css({
|
|
||||||
'transform': 'rotateZ(0deg)',
|
|
||||||
'color': '#1F2D3D'
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$('#page-header').addClass('open-sidebar')
|
is_adjust(1)
|
||||||
$('body').animate({
|
open_sidebar()
|
||||||
paddingLeft: 300
|
|
||||||
}, 200)
|
|
||||||
|
|
||||||
$('#sidebar').animate({
|
|
||||||
left: 0
|
|
||||||
}, 200)
|
|
||||||
|
|
||||||
$('#toggle-sidebar').animate({}, function () {
|
|
||||||
$('#toggle-sidebar').css({
|
|
||||||
'transform': 'rotateZ(180deg)',
|
|
||||||
'color': '#99a9bf'
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
/**
|
|
||||||
* 首頁fullpage添加
|
|
||||||
* 添加class
|
|
||||||
*/
|
|
||||||
if (/Android|webOS|iPhone|iPod|iPad|BlackBerry/i.test(navigator.userAgent)) {} else {
|
|
||||||
$('.full_page .nav_bg').css('background-attachment', 'fixed');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 首頁top_img底下的箭頭
|
* 首頁top_img底下的箭頭
|
||||||
@@ -100,40 +156,7 @@ $(function () {
|
|||||||
/**
|
/**
|
||||||
* BOOKMARK 書簽
|
* BOOKMARK 書簽
|
||||||
*/
|
*/
|
||||||
$.fancyConfirm = function (opts) {
|
$('#bookmark-it').on("click", function () {
|
||||||
opts = $.extend(true, {
|
|
||||||
title: 'Are you sure?',
|
|
||||||
message: '',
|
|
||||||
okButton: 'OK',
|
|
||||||
noButton: 'Cancel',
|
|
||||||
callback: $.noop
|
|
||||||
}, opts || {});
|
|
||||||
|
|
||||||
$.fancybox.open({
|
|
||||||
type: 'html',
|
|
||||||
src: '<div class="fc-content">' +
|
|
||||||
'<h3>' + opts.title + '</h3>' +
|
|
||||||
'<p>' + opts.message + '</p>' +
|
|
||||||
'<p class="is_right">' +
|
|
||||||
'<button data-value="1" data-fancybox-close class="bookmark-ok">' + opts.okButton + '</button>' +
|
|
||||||
'</p>' +
|
|
||||||
'</div>',
|
|
||||||
opts: {
|
|
||||||
animationDuration: 350,
|
|
||||||
animationEffect: 'material',
|
|
||||||
modal: true,
|
|
||||||
baseTpl: '<div class="fancybox-container fc-container" role="dialog" tabindex="-1">' +
|
|
||||||
'<div class="fancybox-bg"></div>' +
|
|
||||||
'<div class="fancybox-inner">' +
|
|
||||||
'<div class="fancybox-stage"></div>' +
|
|
||||||
'</div>' +
|
|
||||||
'</div>',
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
$('#bookmark-it').click(
|
|
||||||
function () {
|
|
||||||
if (window.sidebar && window.sidebar.addPanel) { // Mozilla Firefox Bookmark
|
if (window.sidebar && window.sidebar.addPanel) { // Mozilla Firefox Bookmark
|
||||||
window.sidebar.addPanel(document.title, window.location.href, '');
|
window.sidebar.addPanel(document.title, window.location.href, '');
|
||||||
} else if (window.external && ('AddFavorite' in window.external)) { // IE Favorite
|
} else if (window.external && ('AddFavorite' in window.external)) { // IE Favorite
|
||||||
@@ -142,13 +165,12 @@ $(function () {
|
|||||||
this.title = document.title;
|
this.title = document.title;
|
||||||
return true;
|
return true;
|
||||||
} else { // webkit - safari/chrome
|
} else { // webkit - safari/chrome
|
||||||
// alert('按 ' + (navigator.userAgent.toLowerCase().indexOf('mac') != -1 ? 'Command/Cmd' : 'CTRL') + ' + D 鍵將本頁加入書籤.');
|
if (is_Snackbar) {
|
||||||
$.fancyConfirm({
|
var bookmarkText = GLOBAL_CONFIG.Snackbar.bookmark.message_prev + ' ' + (navigator.userAgent.toLowerCase().indexOf('mac') != -1 ? 'Command/Cmd' : 'CTRL') + '+ D ' + GLOBAL_CONFIG.Snackbar.bookmark.message_next + '.';
|
||||||
title: GLOBAL_CONFIG.bookmark.title + '?',
|
snackbarShow(bookmarkText)
|
||||||
message: GLOBAL_CONFIG.bookmark.message_prev + (navigator.userAgent.toLowerCase().indexOf('mac') != -1 ? 'Command/Cmd' : 'CTRL') + '+ D ' + GLOBAL_CONFIG.bookmark.message_next + '.',
|
} else {
|
||||||
okButton: "OK",
|
alert(GLOBAL_CONFIG.bookmark.message_prev + ' ' + (navigator.userAgent.toLowerCase().indexOf('mac') != -1 ? 'Command/Cmd' : 'CTRL') + '+ D ' + GLOBAL_CONFIG.bookmark.message_next + '.');
|
||||||
});
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -169,6 +191,9 @@ $(function () {
|
|||||||
if (document.queryCommandSupported && document.queryCommandSupported('copy')) {
|
if (document.queryCommandSupported && document.queryCommandSupported('copy')) {
|
||||||
try {
|
try {
|
||||||
document.execCommand('copy') // Security exception may be thrown by some browsers.
|
document.execCommand('copy') // Security exception may be thrown by some browsers.
|
||||||
|
if (is_Snackbar) {
|
||||||
|
snackbarShow(GLOBAL_CONFIG.copy.success)
|
||||||
|
} else {
|
||||||
$(ctx).prev('.copy-notice')
|
$(ctx).prev('.copy-notice')
|
||||||
.text(GLOBAL_CONFIG.copy.success)
|
.text(GLOBAL_CONFIG.copy.success)
|
||||||
.animate({
|
.animate({
|
||||||
@@ -182,7 +207,11 @@ $(function () {
|
|||||||
}, 650)
|
}, 650)
|
||||||
}, 400)
|
}, 400)
|
||||||
})
|
})
|
||||||
|
}
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
|
if (is_Snackbar) {
|
||||||
|
snackbarShow(GLOBAL_CONFIG.copy.success)
|
||||||
|
} else {
|
||||||
$(ctx).prev('.copy-notice')
|
$(ctx).prev('.copy-notice')
|
||||||
.text(GLOBAL_CONFIG.copy.error)
|
.text(GLOBAL_CONFIG.copy.error)
|
||||||
.animate({
|
.animate({
|
||||||
@@ -198,10 +227,15 @@ $(function () {
|
|||||||
})
|
})
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (is_Snackbar) {
|
||||||
|
snackbarShow(GLOBAL_CONFIG.copy.noSupport)
|
||||||
} else {
|
} else {
|
||||||
$(ctx).prev('.copy-notice').text(GLOBAL_CONFIG.copy.noSupport)
|
$(ctx).prev('.copy-notice').text(GLOBAL_CONFIG.copy.noSupport)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// click events
|
// click events
|
||||||
$('.code-area-wrap .fa-clipboard').on('click', function () {
|
$('.code-area-wrap .fa-clipboard').on('click', function () {
|
||||||
var selection = window.getSelection()
|
var selection = window.getSelection()
|
||||||
@@ -251,20 +285,25 @@ $(function () {
|
|||||||
$('.code-area-wrap').prepend($code_expand)
|
$('.code-area-wrap').prepend($code_expand)
|
||||||
$('.code-area-wrap .code-expand').on('click', function () {
|
$('.code-area-wrap .code-expand').on('click', function () {
|
||||||
if ($(this).hasClass('code-closed')) {
|
if ($(this).hasClass('code-closed')) {
|
||||||
|
$(this).siblings('figure').find('figcaption').show();
|
||||||
$(this).siblings('figure').find('table').show();
|
$(this).siblings('figure').find('table').show();
|
||||||
$(this).removeClass('code-closed');
|
$(this).removeClass('code-closed');
|
||||||
} else {
|
} else {
|
||||||
|
$(this).siblings('figure').find('figcaption').hide();
|
||||||
$(this).siblings('figure').find('table').hide();
|
$(this).siblings('figure').find('table').hide();
|
||||||
$(this).addClass('code-closed');
|
$(this).addClass('code-closed');
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fancybox
|
* fancybox和 medium_zoom
|
||||||
*/
|
*/
|
||||||
var imgList = $(".recent-post-info img").not('.no-fancybox');
|
|
||||||
|
var medium_zoom = GLOBAL_CONFIG.medium_zoom;
|
||||||
|
if (medium_zoom == 'false') {
|
||||||
|
var imgList = $("#post-content img").not('.no-fancybox');
|
||||||
if (imgList.length === 0) {
|
if (imgList.length === 0) {
|
||||||
imgList = $("#post-content img").not('.no-fancybox');
|
imgList = $(".justified-gallery img").not('.no-fancybox');
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var i = 0; i < imgList.length; i++) {
|
for (var i = 0; i < imgList.length; i++) {
|
||||||
@@ -278,12 +317,14 @@ $(function () {
|
|||||||
'" class="fancybox"></a>'
|
'" class="fancybox"></a>'
|
||||||
)
|
)
|
||||||
|
|
||||||
var alt = imgList[i].alt
|
|
||||||
var $wrap = $(imgList[i]).wrap($a)
|
var $wrap = $(imgList[i]).wrap($a)
|
||||||
|
|
||||||
|
var alt = imgList[i].alt
|
||||||
if (alt) {
|
if (alt) {
|
||||||
$wrap.after('<div class="img-alt">' + alt + '</div>')
|
$wrap.after('<div class="img-alt">' + alt + '</div>')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$().fancybox({
|
$().fancybox({
|
||||||
selector: "[data-fancybox]",
|
selector: "[data-fancybox]",
|
||||||
loop: true,
|
loop: true,
|
||||||
@@ -292,28 +333,22 @@ $(function () {
|
|||||||
// wheel: false,
|
// wheel: false,
|
||||||
buttons: ["slideShow", "fullScreen", "thumbs", "close"]
|
buttons: ["slideShow", "fullScreen", "thumbs", "close"]
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
var galleryItem = $(".gallery-item");
|
var imgList = $(".justified-gallery img");
|
||||||
var galleryList = [];
|
if (imgList.length) {
|
||||||
galleryItem.each(function (idx, elem) {
|
for (var i = 0; i < imgList.length; i++) {
|
||||||
galleryList.push({
|
var $a = $('<div></div>')
|
||||||
src: $(elem).data("url"),
|
var $wrap = $(imgList[i]).wrap($a)
|
||||||
opts: {
|
}
|
||||||
caption: $(elem).data("title")
|
}
|
||||||
|
|
||||||
|
const zoom = mediumZoom(document.querySelectorAll('#post img,.justified-gallery img'))
|
||||||
|
zoom.on('open', event => {
|
||||||
|
let photoBg = $(document.documentElement).attr('data-theme') == 'dark' ? '#2d3032' : '#fff'
|
||||||
|
zoom.update({ background: photoBg })
|
||||||
|
})
|
||||||
}
|
}
|
||||||
});
|
|
||||||
});
|
|
||||||
galleryItem.on("click", function () {
|
|
||||||
$.fancybox.open(
|
|
||||||
galleryList, {
|
|
||||||
loop: true,
|
|
||||||
transitionEffect: "slide"
|
|
||||||
},
|
|
||||||
galleryItem.index(this)
|
|
||||||
);
|
|
||||||
return false;
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 手機menu和toc按鈕點擊
|
* 手機menu和toc按鈕點擊
|
||||||
@@ -341,6 +376,9 @@ $(function () {
|
|||||||
$(".toggle-menu").removeClass("close").addClass("open");
|
$(".toggle-menu").removeClass("close").addClass("open");
|
||||||
$('body').addClass("open-mobile-menus");
|
$('body').addClass("open-mobile-menus");
|
||||||
$('#menu_mask').fadeIn();
|
$('#menu_mask').fadeIn();
|
||||||
|
if ($('#toggle-sidebar').hasClass('on')) {
|
||||||
|
close_sidebar()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
@@ -354,9 +392,16 @@ $(function () {
|
|||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
$('#menu_mask').on('click touchstart', function () {
|
$('#menu_mask').on('click touchstart', function (e) {
|
||||||
mobile_menu_close()
|
mobile_menu_close()
|
||||||
mobile_toc_close()
|
mobile_toc_close()
|
||||||
|
|
||||||
|
if ($('#toggle-sidebar').hasClass('on')) {
|
||||||
|
setTimeout(function () {
|
||||||
|
open_sidebar()
|
||||||
|
}, 300)
|
||||||
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
$(window).on('resize', function (e) {
|
$(window).on('resize', function (e) {
|
||||||
@@ -389,16 +434,15 @@ $(function () {
|
|||||||
// head position
|
// head position
|
||||||
findHeadPosition(currentTop)
|
findHeadPosition(currentTop)
|
||||||
auto_scroll_toc(currentTop)
|
auto_scroll_toc(currentTop)
|
||||||
|
|
||||||
}
|
}
|
||||||
var isUp = scrollDirection(currentTop)
|
var isUp = scrollDirection(currentTop)
|
||||||
|
|
||||||
if (currentTop > 56) {
|
if (currentTop > 56) {
|
||||||
if (isUp) {
|
if (isUp) {
|
||||||
$('#page-header').hasClass('visible') ? $('#page-header').removeClass('visible') : console.log()
|
$('#page-header').hasClass('visible') ? $('#page-header').removeClass('visible') : ''
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$('#page-header').hasClass('visible') ? console.log() : $('#page-header').addClass('visible')
|
$('#page-header').hasClass('visible') ? '' : $('#page-header').addClass('visible')
|
||||||
}
|
}
|
||||||
$('#page-header').addClass('fixed')
|
$('#page-header').addClass('fixed')
|
||||||
|
|
||||||
@@ -424,7 +468,7 @@ $(function () {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}, 50, 100))
|
}, 300))
|
||||||
|
|
||||||
// go up smooth scroll
|
// go up smooth scroll
|
||||||
$('#go-up').on('click', function () {
|
$('#go-up').on('click', function () {
|
||||||
@@ -546,8 +590,8 @@ $(function () {
|
|||||||
* 閲讀模式
|
* 閲讀模式
|
||||||
*/
|
*/
|
||||||
$("#readmode").click(function () {
|
$("#readmode").click(function () {
|
||||||
if (Cookies.get("night-mode") == "night") {
|
if (Cookies.get("theme") == "dark") {
|
||||||
$('body').toggleClass('night-mode');
|
$(document.documentElement).attr('data-theme') == 'dark' ? $(document.documentElement).attr('data-theme','') : $(document.documentElement).attr('data-theme','dark')
|
||||||
$('body').toggleClass('read-mode');
|
$('body').toggleClass('read-mode');
|
||||||
$('#to_comment').toggleClass('is_invisible');
|
$('#to_comment').toggleClass('is_invisible');
|
||||||
} else {
|
} else {
|
||||||
@@ -594,10 +638,10 @@ $(function () {
|
|||||||
*/
|
*/
|
||||||
$('.menus-expand').on('click', function () {
|
$('.menus-expand').on('click', function () {
|
||||||
if ($(this).hasClass('menus-closed')) {
|
if ($(this).hasClass('menus-closed')) {
|
||||||
$(this).parents('.menus_item').find('.menus_item_child').show();
|
$(this).parents('.menus_item').find('.menus_item_child').slideDown();
|
||||||
$(this).removeClass('menus-closed');
|
$(this).removeClass('menus-closed');
|
||||||
} else {
|
} else {
|
||||||
$(this).parents('.menus_item').find('.menus_item_child').hide();
|
$(this).parents('.menus_item').find('.menus_item_child').slideUp();
|
||||||
$(this).addClass('menus-closed');
|
$(this).addClass('menus-closed');
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -606,7 +650,24 @@ $(function () {
|
|||||||
* rightside 點擊設置 按鈕 展開
|
* rightside 點擊設置 按鈕 展開
|
||||||
*/
|
*/
|
||||||
$('#rightside_config').on('click', function () {
|
$('#rightside_config').on('click', function () {
|
||||||
$('#rightside-config-hide').toggleClass("rightside-in")
|
if ($('#rightside-config-hide').hasClass("rightside-in")) {
|
||||||
|
$('#rightside-config-hide').css("animation", "rightside_out_animate .3s");
|
||||||
|
$('#rightside-config-hide').removeClass("rightside-in")
|
||||||
|
$("#rightside-config-hide").animate({}, function () {
|
||||||
|
setTimeout(function () {
|
||||||
|
$('#rightside-config-hide').css({
|
||||||
|
"animation": "",
|
||||||
|
"display": ""
|
||||||
|
})
|
||||||
|
}, 300)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
$('#rightside-config-hide').addClass("rightside-in")
|
||||||
|
$("#rightside-config-hide").animate({}, function () {
|
||||||
|
$('#rightside-config-hide').css("display", "block")
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -661,4 +722,83 @@ $(function () {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* justified-gallery 圖庫排版
|
||||||
|
*/
|
||||||
|
|
||||||
|
if ($('.justified-gallery').length) {
|
||||||
|
$('.justified-gallery img').each((i, o) => {
|
||||||
|
let src = $(o).attr('data-src');
|
||||||
|
$(o).attr('src', src)
|
||||||
|
})
|
||||||
|
$('.justified-gallery > p > .fancybox,.justified-gallery > p > div').unwrap();
|
||||||
|
$('head').append('<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/justifiedGallery@3.7.0/dist/css/justifiedGallery.min.css">');
|
||||||
|
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
|
||||||
|
*/
|
||||||
|
|
||||||
|
// if (autoChangeMode == '1') {
|
||||||
|
// window.matchMedia("(prefers-color-scheme: dark)").addListener(function (e) {
|
||||||
|
// if (e.matches) {
|
||||||
|
// activateDarkMode()
|
||||||
|
// change_light_icon()
|
||||||
|
// Cookies.remove('theme')
|
||||||
|
// } else {
|
||||||
|
// activateLightMode()
|
||||||
|
// change_dark_icon()
|
||||||
|
// Cookies.remove('theme')
|
||||||
|
// }
|
||||||
|
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
|
||||||
|
if (autoChangeMode == '1' || autoChangeMode == '2') {
|
||||||
|
if (Cookies.get("theme") == "dark") {
|
||||||
|
change_light_icon()
|
||||||
|
} else {
|
||||||
|
change_dark_icon()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function change_light_icon() {
|
||||||
|
$("#darkmode").removeClass("fa-moon-o").addClass("fa-sun-o");
|
||||||
|
}
|
||||||
|
|
||||||
|
function change_dark_icon() {
|
||||||
|
$("#darkmode").removeClass("fa-sun-o").addClass("fa-moon-o");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function switchReadMode() {
|
||||||
|
|
||||||
|
var nowMode = document.documentElement.getAttribute('data-theme') === 'dark' ? 'dark' : 'light'
|
||||||
|
|
||||||
|
if ( nowMode == 'light') {
|
||||||
|
change_light_icon()
|
||||||
|
activateDarkMode()
|
||||||
|
Cookies.set('theme','dark', { expires: 2 })
|
||||||
|
if (is_Snackbar) snackbarShow(GLOBAL_CONFIG.Snackbar.day_to_night)
|
||||||
|
}else{
|
||||||
|
change_dark_icon()
|
||||||
|
activateLightMode()
|
||||||
|
Cookies.set('theme','light', { expires: 2 })
|
||||||
|
if (is_Snackbar) snackbarShow(GLOBAL_CONFIG.Snackbar.night_to_day)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#darkmode").click(function () {
|
||||||
|
switchReadMode();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
$(function () {
|
|
||||||
changeReadModel();
|
|
||||||
|
|
||||||
function switchReadMode() {
|
|
||||||
var next_mode = $("body").hasClass("night-mode") ? "day" : "night";
|
|
||||||
Cookies.set("night-mode", next_mode, {
|
|
||||||
expires: 7,
|
|
||||||
path: '/'
|
|
||||||
});
|
|
||||||
changeReadModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
function changeReadModel() {
|
|
||||||
|
|
||||||
if (Cookies.get("night-mode") == null)
|
|
||||||
return
|
|
||||||
|
|
||||||
if (Cookies.get("night-mode") == "night") {
|
|
||||||
$("body").addClass("night-mode");
|
|
||||||
$("#nightshift").removeClass("fa-moon-o").addClass("fa-sun-o");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 非夜間模式
|
|
||||||
if (Cookies.get("night-mode") == "day") {
|
|
||||||
$("body").removeClass("night-mode");
|
|
||||||
$("#nightshift").removeClass("fa-sun-o").addClass("fa-moon-o");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$("#nightshift").click(function () {
|
|
||||||
switchReadMode();
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
});
|
|
||||||
@@ -2,7 +2,6 @@
|
|||||||
var start_date = document.getElementById("runtionshow").getAttribute("start_date")
|
var start_date = document.getElementById("runtionshow").getAttribute("start_date")
|
||||||
|
|
||||||
function show_date_time() {
|
function show_date_time() {
|
||||||
window.setTimeout("show_date_time()", 1000);
|
|
||||||
BirthDay=new Date(start_date);
|
BirthDay=new Date(start_date);
|
||||||
today=new Date();
|
today=new Date();
|
||||||
timeold=(today.getTime()-BirthDay.getTime());
|
timeold=(today.getTime()-BirthDay.getTime());
|
||||||
@@ -12,5 +11,9 @@ function show_date_time() {
|
|||||||
webinfo_runtime_count.innerHTML= daysold + " " + GLOBAL_CONFIG.runtime_unit
|
webinfo_runtime_count.innerHTML= daysold + " " + GLOBAL_CONFIG.runtime_unit
|
||||||
}
|
}
|
||||||
|
|
||||||
show_date_time()
|
var interval;
|
||||||
|
show_date_time();
|
||||||
|
clearInterval(interval);
|
||||||
|
interval = setInterval(show_date_time, 10000);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,8 +5,7 @@ $(function () {
|
|||||||
|
|
||||||
$('.search-dialog').animate({}, function () {
|
$('.search-dialog').animate({}, function () {
|
||||||
$('.search-dialog').css({
|
$('.search-dialog').css({
|
||||||
'display': 'block',
|
'display': 'block'
|
||||||
'animation': 'titlescale 0.5s'
|
|
||||||
}),300
|
}),300
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -22,12 +21,20 @@ $(function () {
|
|||||||
})
|
})
|
||||||
|
|
||||||
var closeSearch = function () {
|
var closeSearch = function () {
|
||||||
$('body').css('overflow', 'auto')
|
$('body').css('width', '')
|
||||||
|
$('body').css('overflow', '')
|
||||||
|
$('.search-dialog').css({
|
||||||
|
'animation': 'search_close .5s'
|
||||||
|
})
|
||||||
|
|
||||||
$('.search-dialog').animate({}, function () {
|
$('.search-dialog').animate({}, function () {
|
||||||
|
|
||||||
|
setTimeout(function () {
|
||||||
$('.search-dialog').css({
|
$('.search-dialog').css({
|
||||||
|
'animation': '',
|
||||||
'display': 'none'
|
'display': 'none'
|
||||||
})
|
})
|
||||||
|
},500)
|
||||||
})
|
})
|
||||||
|
|
||||||
$('.search-mask').fadeOut();
|
$('.search-mask').fadeOut();
|
||||||
@@ -102,7 +109,7 @@ $(function () {
|
|||||||
return (
|
return (
|
||||||
'<hr>' +
|
'<hr>' +
|
||||||
stats +
|
stats +
|
||||||
'<span class="algolia-logo pull-right">' +
|
'<span class="algolia-logo pull_right">' +
|
||||||
' <img src="' + GLOBAL_CONFIG.root + 'img/algolia.svg" alt="Algolia" />' +
|
' <img src="' + GLOBAL_CONFIG.root + 'img/algolia.svg" alt="Algolia" />' +
|
||||||
'</span>'
|
'</span>'
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -5,8 +5,7 @@ $(function () {
|
|||||||
$('body').css('overflow', 'hidden')
|
$('body').css('overflow', 'hidden')
|
||||||
$('.search-dialog').animate({}, function () {
|
$('.search-dialog').animate({}, function () {
|
||||||
$('.search-dialog').css({
|
$('.search-dialog').css({
|
||||||
'display': 'block',
|
'display': 'block'
|
||||||
'animation': 'titlescale 0.5s'
|
|
||||||
}),300
|
}),300
|
||||||
})
|
})
|
||||||
$('#local-search-input input').focus()
|
$('#local-search-input input').focus()
|
||||||
@@ -27,12 +26,22 @@ $(function () {
|
|||||||
})
|
})
|
||||||
|
|
||||||
var closeSearch = function () {
|
var closeSearch = function () {
|
||||||
$('body').css('overflow', 'auto')
|
$('body').css('width', '')
|
||||||
$('.search-dialog').animate({}, function () {
|
$('body').css('overflow', '')
|
||||||
$('.search-dialog').css({
|
$('.search-dialog').css({
|
||||||
|
'animation': 'search_close .5s'
|
||||||
|
})
|
||||||
|
|
||||||
|
$('.search-dialog').animate({}, function () {
|
||||||
|
|
||||||
|
setTimeout(function () {
|
||||||
|
$('.search-dialog').css({
|
||||||
|
'animation': '',
|
||||||
'display': 'none'
|
'display': 'none'
|
||||||
})
|
})
|
||||||
|
},500)
|
||||||
})
|
})
|
||||||
|
|
||||||
$('.search-mask').fadeOut();
|
$('.search-mask').fadeOut();
|
||||||
}
|
}
|
||||||
$('.search-mask, .search-close-button').on('click', closeSearch)
|
$('.search-mask, .search-close-button').on('click', closeSearch)
|
||||||
|
|||||||
42
source/js/third-party/ClickShowText.js
vendored
Normal file
42
source/js/third-party/ClickShowText.js
vendored
Normal file
@@ -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 = $("<span/>").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();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
93
source/js/third-party/canvas-nest.js
vendored
93
source/js/third-party/canvas-nest.js
vendored
@@ -1,11 +1,88 @@
|
|||||||
!function(){
|
! function () {
|
||||||
var userAgentInfo = navigator.userAgent;
|
var cn = document.getElementById('canvas_nest');
|
||||||
var Agents = ["iPad", "iPhone", "Android",
|
var mb = cn.getAttribute("mobile");
|
||||||
"SymbianOS", "Windows Phone",
|
|
||||||
"iPod", "webOS", "BlackBerry", "IEMobile"];
|
if (mb == 'false' && (/Android|webOS|iPhone|iPod|iPad|BlackBerry/i.test(navigator.userAgent))) {
|
||||||
for (var v = 0; v < Agents.length; v++) {
|
|
||||||
if (userAgentInfo.indexOf(Agents[v]) > 0) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function o(w, v, i) {
|
||||||
|
return w.getAttribute(v) || i
|
||||||
}
|
}
|
||||||
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)}();
|
|
||||||
|
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)
|
||||||
|
}();
|
||||||
22
source/js/third-party/canvas-ribbon.js
vendored
22
source/js/third-party/canvas-ribbon.js
vendored
@@ -4,17 +4,15 @@
|
|||||||
* Version: v1.0.1
|
* Version: v1.0.1
|
||||||
* GitHub: https://github.com/hustcc/ribbon.js
|
* GitHub: https://github.com/hustcc/ribbon.js
|
||||||
**/
|
**/
|
||||||
// changed by Molunerfinn
|
|
||||||
!(function () {
|
!(function () {
|
||||||
function attr (node, attr, default_value) {
|
|
||||||
if (default_value === true) {
|
var script = document.getElementById('ribbon');
|
||||||
return node.getAttribute(attr) || default_value
|
var mb = script.getAttribute("mobile");
|
||||||
}
|
if (mb == 'false' && (/Android|webOS|iPhone|iPod|iPad|BlackBerry/i.test(navigator.userAgent))) {
|
||||||
return Number(node.getAttribute(attr)) || default_value
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// get user config
|
|
||||||
var script = document.getElementById('ribbon'),
|
|
||||||
config = {
|
config = {
|
||||||
z: attr(script, 'zIndex', -1), // z-index
|
z: attr(script, 'zIndex', -1), // z-index
|
||||||
a: attr(script, 'alpha', 0.6), // alpha
|
a: attr(script, 'alpha', 0.6), // alpha
|
||||||
@@ -22,6 +20,14 @@
|
|||||||
c: attr(script, 'data-click', true) // click-to-change
|
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'),
|
var canvas = document.createElement('canvas'),
|
||||||
g2d = canvas.getContext('2d'),
|
g2d = canvas.getContext('2d'),
|
||||||
pr = window.devicePixelRatio || 1,
|
pr = window.devicePixelRatio || 1,
|
||||||
|
|||||||
1
source/js/third-party/click_heart.js
vendored
Normal file
1
source/js/third-party/click_heart.js
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
!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+=.004,n[a].alpha-=.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);
|
||||||
64
source/js/third-party/piao.js
vendored
64
source/js/third-party/piao.js
vendored
@@ -1,12 +1,13 @@
|
|||||||
(function(name, factory) {
|
|
||||||
|
(function (name, factory) {
|
||||||
if (typeof window === "object") {
|
if (typeof window === "object") {
|
||||||
window[name] = factory()
|
window[name] = factory()
|
||||||
}
|
}
|
||||||
})("Ribbons", function() {
|
})("Ribbons", function () {
|
||||||
var _w = window,
|
var _w = window,
|
||||||
_b = document.body,
|
_b = document.body,
|
||||||
_d = document.documentElement;
|
_d = document.documentElement;
|
||||||
var random = function() {
|
var random = function () {
|
||||||
if (arguments.length === 1) {
|
if (arguments.length === 1) {
|
||||||
if (Array.isArray(arguments[0])) {
|
if (Array.isArray(arguments[0])) {
|
||||||
var index = Math.round(random(0, arguments[0].length - 1));
|
var index = Math.round(random(0, arguments[0].length - 1));
|
||||||
@@ -18,7 +19,7 @@
|
|||||||
}
|
}
|
||||||
return 0
|
return 0
|
||||||
};
|
};
|
||||||
var screenInfo = function(e) {
|
var screenInfo = function (e) {
|
||||||
var width = Math.max(0, _w.innerWidth || _d.clientWidth || _b.clientWidth || 0),
|
var width = Math.max(0, _w.innerWidth || _d.clientWidth || _b.clientWidth || 0),
|
||||||
height = Math.max(0, _w.innerHeight || _d.clientHeight || _b.clientHeight || 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),
|
scrollx = Math.max(0, _w.pageXOffset || _d.scrollLeft || _b.scrollLeft || 0) - (_d.clientLeft || 0),
|
||||||
@@ -33,7 +34,7 @@
|
|||||||
scrolly: scrolly
|
scrolly: scrolly
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var mouseInfo = function(e) {
|
var mouseInfo = function (e) {
|
||||||
var screen = screenInfo(e),
|
var screen = screenInfo(e),
|
||||||
mousex = e ? Math.max(0, e.pageX || e.clientX || 0) : 0,
|
mousex = e ? Math.max(0, e.pageX || e.clientX || 0) : 0,
|
||||||
mousey = e ? Math.max(0, e.pageY || e.clientY || 0) : 0;
|
mousey = e ? Math.max(0, e.pageY || e.clientY || 0) : 0;
|
||||||
@@ -44,60 +45,60 @@
|
|||||||
centery: mousey - screen.height / 2
|
centery: mousey - screen.height / 2
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var Point = function(x, y) {
|
var Point = function (x, y) {
|
||||||
this.x = 0;
|
this.x = 0;
|
||||||
this.y = 0;
|
this.y = 0;
|
||||||
this.set(x, y)
|
this.set(x, y)
|
||||||
};
|
};
|
||||||
Point.prototype = {
|
Point.prototype = {
|
||||||
constructor: Point,
|
constructor: Point,
|
||||||
set: function(x, y) {
|
set: function (x, y) {
|
||||||
this.x = x || 0;
|
this.x = x || 0;
|
||||||
this.y = y || 0
|
this.y = y || 0
|
||||||
},
|
},
|
||||||
copy: function(point) {
|
copy: function (point) {
|
||||||
this.x = point.x || 0;
|
this.x = point.x || 0;
|
||||||
this.y = point.y || 0;
|
this.y = point.y || 0;
|
||||||
return this
|
return this
|
||||||
},
|
},
|
||||||
multiply: function(x, y) {
|
multiply: function (x, y) {
|
||||||
this.x *= x || 1;
|
this.x *= x || 1;
|
||||||
this.y *= y || 1;
|
this.y *= y || 1;
|
||||||
return this
|
return this
|
||||||
},
|
},
|
||||||
divide: function(x, y) {
|
divide: function (x, y) {
|
||||||
this.x /= x || 1;
|
this.x /= x || 1;
|
||||||
this.y /= y || 1;
|
this.y /= y || 1;
|
||||||
return this
|
return this
|
||||||
},
|
},
|
||||||
add: function(x, y) {
|
add: function (x, y) {
|
||||||
this.x += x || 0;
|
this.x += x || 0;
|
||||||
this.y += y || 0;
|
this.y += y || 0;
|
||||||
return this
|
return this
|
||||||
},
|
},
|
||||||
subtract: function(x, y) {
|
subtract: function (x, y) {
|
||||||
this.x -= x || 0;
|
this.x -= x || 0;
|
||||||
this.y -= y || 0;
|
this.y -= y || 0;
|
||||||
return this
|
return this
|
||||||
},
|
},
|
||||||
clampX: function(min, max) {
|
clampX: function (min, max) {
|
||||||
this.x = Math.max(min, Math.min(this.x, max));
|
this.x = Math.max(min, Math.min(this.x, max));
|
||||||
return this
|
return this
|
||||||
},
|
},
|
||||||
clampY: function(min, max) {
|
clampY: function (min, max) {
|
||||||
this.y = Math.max(min, Math.min(this.y, max));
|
this.y = Math.max(min, Math.min(this.y, max));
|
||||||
return this
|
return this
|
||||||
},
|
},
|
||||||
flipX: function() {
|
flipX: function () {
|
||||||
this.x *= -1;
|
this.x *= -1;
|
||||||
return this
|
return this
|
||||||
},
|
},
|
||||||
flipY: function() {
|
flipY: function () {
|
||||||
this.y *= -1;
|
this.y *= -1;
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var Factory = function(options) {
|
var Factory = function (options) {
|
||||||
this._canvas = null;
|
this._canvas = null;
|
||||||
this._context = null;
|
this._context = null;
|
||||||
this._sto = null;
|
this._sto = null;
|
||||||
@@ -125,7 +126,7 @@
|
|||||||
};
|
};
|
||||||
Factory.prototype = {
|
Factory.prototype = {
|
||||||
constructor: Factory,
|
constructor: Factory,
|
||||||
setOptions: function(options) {
|
setOptions: function (options) {
|
||||||
if (typeof options === "object") {
|
if (typeof options === "object") {
|
||||||
for (var key in options) {
|
for (var key in options) {
|
||||||
if (options.hasOwnProperty(key)) {
|
if (options.hasOwnProperty(key)) {
|
||||||
@@ -134,7 +135,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
init: function() {
|
init: function () {
|
||||||
try {
|
try {
|
||||||
this._canvas = document.createElement("canvas");
|
this._canvas = document.createElement("canvas");
|
||||||
this._canvas.style["display"] = "block";
|
this._canvas.style["display"] = "block";
|
||||||
@@ -161,7 +162,7 @@
|
|||||||
}
|
}
|
||||||
this._onDraw()
|
this._onDraw()
|
||||||
},
|
},
|
||||||
addRibbon: function() {
|
addRibbon: function () {
|
||||||
var dir = Math.round(random(1, 9)) > 5 ? "right" : "left",
|
var dir = Math.round(random(1, 9)) > 5 ? "right" : "left",
|
||||||
stop = 1000,
|
stop = 1000,
|
||||||
hide = 200,
|
hide = 200,
|
||||||
@@ -215,7 +216,7 @@
|
|||||||
}
|
}
|
||||||
this._ribbons.push(ribbon)
|
this._ribbons.push(ribbon)
|
||||||
},
|
},
|
||||||
_drawRibbonSection: function(section) {
|
_drawRibbonSection: function (section) {
|
||||||
if (section) {
|
if (section) {
|
||||||
if (section.phase >= 1 && section.alpha <= 0) {
|
if (section.phase >= 1 && section.alpha <= 0) {
|
||||||
return true
|
return true
|
||||||
@@ -266,7 +267,7 @@
|
|||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
},
|
},
|
||||||
_onDraw: function() {
|
_onDraw: function () {
|
||||||
for (var i = 0, t = this._ribbons.length; i < t; ++i) {
|
for (var i = 0, t = this._ribbons.length; i < t; ++i) {
|
||||||
if (!this._ribbons[i]) {
|
if (!this._ribbons[i]) {
|
||||||
this._ribbons.splice(i, 1)
|
this._ribbons.splice(i, 1)
|
||||||
@@ -291,7 +292,7 @@
|
|||||||
}
|
}
|
||||||
requestAnimationFrame(this._onDraw)
|
requestAnimationFrame(this._onDraw)
|
||||||
},
|
},
|
||||||
_onResize: function(e) {
|
_onResize: function (e) {
|
||||||
var screen = screenInfo(e);
|
var screen = screenInfo(e);
|
||||||
this._width = screen.width;
|
this._width = screen.width;
|
||||||
this._height = screen.height;
|
this._height = screen.height;
|
||||||
@@ -303,14 +304,21 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
_onScroll: function(e) {
|
_onScroll: function (e) {
|
||||||
var screen = screenInfo(e);
|
var screen = screenInfo(e);
|
||||||
this._scroll = screen.scrolly
|
this._scroll = screen.scrolly
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return Factory
|
return Factory
|
||||||
});
|
});
|
||||||
new Ribbons({
|
|
||||||
|
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%",
|
colorSaturation: "60%",
|
||||||
colorBrightness: "50%",
|
colorBrightness: "50%",
|
||||||
colorAlpha: 0.5,
|
colorAlpha: 0.5,
|
||||||
@@ -321,4 +329,6 @@ new Ribbons({
|
|||||||
strokeSize: 0,
|
strokeSize: 0,
|
||||||
parallaxAmount: -0.2,
|
parallaxAmount: -0.2,
|
||||||
animateSections: true
|
animateSections: true
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
var translate = GLOBAL_CONFIG.translate
|
var translate = GLOBAL_CONFIG.translate
|
||||||
|
var Snackbar_tl = GLOBAL_CONFIG.Snackbar
|
||||||
|
|
||||||
var defaultEncoding = translate.defaultEncoding; // 网站默认语言,1: 繁體中文, 2: 简体中文
|
var defaultEncoding = translate.defaultEncoding; // 网站默认语言,1: 繁體中文, 2: 简体中文
|
||||||
var translateDelay = translate.translateDelay; //延迟时间,若不在前, 要设定延迟翻译时间, 如100表示100ms,默认为0
|
var translateDelay = translate.translateDelay; //延迟时间,若不在前, 要设定延迟翻译时间, 如100表示100ms,默认为0
|
||||||
@@ -10,6 +11,8 @@ var currentEncoding = defaultEncoding;
|
|||||||
var targetEncodingCookie = "targetEncoding" + cookieDomain.replace(/\./g, "");
|
var targetEncodingCookie = "targetEncoding" + cookieDomain.replace(/\./g, "");
|
||||||
var targetEncoding = (Cookies.get(targetEncodingCookie) == null ? defaultEncoding: Cookies.get(targetEncodingCookie));
|
var targetEncoding = (Cookies.get(targetEncodingCookie) == null ? defaultEncoding: Cookies.get(targetEncodingCookie));
|
||||||
var translateButtonObject;
|
var translateButtonObject;
|
||||||
|
var is_Snackbar = GLOBAL_CONFIG.Snackbar !== undefined ? true : false
|
||||||
|
|
||||||
function translateText(txt) {
|
function translateText(txt) {
|
||||||
if (txt == "" || txt == null) return "";
|
if (txt == "" || txt == null) return "";
|
||||||
if (currentEncoding == 1 && targetEncoding == 2) return Simplized(txt);
|
if (currentEncoding == 1 && targetEncoding == 2) return Simplized(txt);
|
||||||
@@ -39,6 +42,7 @@ function translatePage() {
|
|||||||
path: '/'
|
path: '/'
|
||||||
});
|
});
|
||||||
translateBody()
|
translateBody()
|
||||||
|
if (is_Snackbar) snackbarShow(Snackbar_tl.cht_to_chs)
|
||||||
} else if (targetEncoding == 2) {
|
} else if (targetEncoding == 2) {
|
||||||
currentEncoding = 2;
|
currentEncoding = 2;
|
||||||
targetEncoding = 1;
|
targetEncoding = 1;
|
||||||
@@ -48,6 +52,7 @@ function translatePage() {
|
|||||||
path: '/'
|
path: '/'
|
||||||
});
|
});
|
||||||
translateBody()
|
translateBody()
|
||||||
|
if (is_Snackbar) snackbarShow(Snackbar_tl.chs_to_cht)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function JTPYStr() {
|
function JTPYStr() {
|
||||||
|
|||||||
@@ -1,37 +1,37 @@
|
|||||||
function debounce(func, wait, immediate) {
|
function throttle(func, wait, options) {
|
||||||
var timeout
|
var timeout, context, args, result;
|
||||||
return function () {
|
var previous = 0;
|
||||||
var context = this
|
if (!options) options = {};
|
||||||
var args = arguments
|
|
||||||
var later = function () {
|
|
||||||
timeout = null
|
|
||||||
if (!immediate) func.apply(context, args)
|
|
||||||
}
|
|
||||||
var callNow = immediate && !timeout
|
|
||||||
clearTimeout(timeout)
|
|
||||||
timeout = setTimeout(later, wait)
|
|
||||||
if (callNow) func.apply(context, args)
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
function throttle(func, wait, mustRun) {
|
var later = function() {
|
||||||
var timeout
|
previous = options.leading === false ? 0 : new Date().getTime();
|
||||||
var startTime = new Date()
|
timeout = null;
|
||||||
|
func.apply(context, args);
|
||||||
|
if (!timeout) context = args = null;
|
||||||
|
};
|
||||||
|
|
||||||
return function () {
|
var throttled = function() {
|
||||||
var context = this
|
var now = new Date().getTime();
|
||||||
var args = arguments
|
if (!previous && options.leading === false) previous = now;
|
||||||
var curTime = new Date()
|
var remaining = wait - (now - previous);
|
||||||
|
context = this;
|
||||||
|
args = arguments;
|
||||||
|
if (remaining <= 0 || remaining > wait) {
|
||||||
|
if (timeout) {
|
||||||
|
clearTimeout(timeout);
|
||||||
|
timeout = null;
|
||||||
|
}
|
||||||
|
previous = now;
|
||||||
|
func.apply(context, args);
|
||||||
|
if (!timeout) context = args = null;
|
||||||
|
} else if (!timeout && options.trailing !== false) {
|
||||||
|
timeout = setTimeout(later, remaining);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return throttled;
|
||||||
|
}
|
||||||
|
|
||||||
clearTimeout(timeout)
|
|
||||||
if (curTime - startTime >= mustRun) {
|
|
||||||
func.apply(context, args)
|
|
||||||
startTime = curTime
|
|
||||||
} else {
|
|
||||||
timeout = setTimeout(func, wait)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
function isMobile() {
|
function isMobile() {
|
||||||
var check = false;
|
var check = false;
|
||||||
@@ -46,7 +46,41 @@ function scrollTo(name) {
|
|||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
window.debounce = debounce
|
function loadScript(url, callback) {
|
||||||
|
var script = document.createElement("script")
|
||||||
|
script.type = "text/javascript";
|
||||||
|
if (script.readyState) { //IE
|
||||||
|
script.onreadystatechange = function () {
|
||||||
|
if (script.readyState == "loaded" ||
|
||||||
|
script.readyState == "complete") {
|
||||||
|
script.onreadystatechange = null;
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
} else { //Others
|
||||||
|
script.onload = function () {
|
||||||
|
callback();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
script.src = url;
|
||||||
|
document.body.appendChild(script);
|
||||||
|
};
|
||||||
|
|
||||||
|
function snackbarShow(text, showAction, duration) {
|
||||||
|
var showAction = (typeof showAction !== 'undefined') ? showAction : false;
|
||||||
|
var duration = (typeof duration !== 'undefined') ? duration : 2000;
|
||||||
|
var position = GLOBAL_CONFIG.Snackbar.position
|
||||||
|
var bg = document.documentElement.getAttribute('data-theme') === 'light' ? GLOBAL_CONFIG.Snackbar.bgLight : GLOBAL_CONFIG.Snackbar.bgDark
|
||||||
|
Snackbar.show({
|
||||||
|
text: text,
|
||||||
|
backgroundColor: bg,
|
||||||
|
showAction: showAction,
|
||||||
|
duration: duration,
|
||||||
|
pos: position
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
window.throttle = throttle
|
window.throttle = throttle
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user