22 Commits

Author SHA1 Message Date
shenyu
9c53a603f3 1.9.5-0 2021-08-03 17:01:02 +08:00
shenyu
a9db32d0cb 🐛 fix: blank space on firefox 2021-08-03 16:59:39 +08:00
shenyu
3ff73f9805 1.9.4-0 2021-07-29 14:26:46 +08:00
shenyu
5969d1a456 1.9.3 2021-07-23 13:46:11 +08:00
shenyu
219bb6db37 🎨 style: code format 2021-07-23 13:45:50 +08:00
shenyu
e0f4461fe5 🗑️ remove jquery-2.0.3.min.js 2021-07-23 13:28:34 +08:00
shenyu
20332ad8f2 ⬆️ chore: upgrade jquery 2021-07-23 13:26:32 +08:00
shenyu
8229b7436f 1.9.2 2021-07-23 11:49:13 +08:00
shenyu
c24db5e371 feat: Encrypt 2021-07-23 11:47:30 +08:00
shenyu
8b6074fef4 1.9.2-0 2021-07-01 10:17:43 +08:00
shenyu
3d4a4fcc7e 💄 add image caption 2021-07-01 10:14:42 +08:00
shenyu
a842da9697 1.9.1 2021-06-28 14:36:44 +08:00
shenyu
72c4fd9761 💄 fix: toc style 2021-06-28 14:27:23 +08:00
shenyu
f1c3083f09 🔧 2021-06-21 17:11:35 +08:00
shenyu
a29108efdc 1.9.0 2021-06-08 09:41:00 +08:00
shenyu
c679fd6256 📝 docs 2021-05-31 10:24:23 +08:00
shenyu
49dfb78503 📝 update 2021-05-30 11:08:08 +08:00
shenyu
809d54eae2 1.8.24 2021-05-29 10:58:17 +08:00
shenyu
e76f208516 ️ bundle assets by rollup 2021-05-29 10:57:34 +08:00
shenyu
aad79d1baa ✏️ README.md 2021-05-24 11:45:14 +08:00
shenyu
221c637409 Merge branch 'master' of https://github.com/Shen-Yu/hexo-theme-ayer 2021-05-24 11:29:54 +08:00
Eric Shen
3fa2e339c5 Update README.md 2021-05-18 10:19:02 +08:00
34 changed files with 585 additions and 372 deletions

View File

@@ -1,5 +0,0 @@
{
"plugins": {
"autoprefixer": true
}
}

112
README.md
View File

@@ -27,7 +27,7 @@
<a href="https://github.com/Shen-Yu/hexo-theme-ayer/releases" target="_blank" rel="noopener noreferrer"> <a href="https://github.com/Shen-Yu/hexo-theme-ayer/releases" target="_blank" rel="noopener noreferrer">
<img alt="GitHub repo size" src="https://img.shields.io/github/repo-size/Shen-Yu/hexo-theme-ayer?color=b37feb"> <img alt="GitHub repo size" src="https://img.shields.io/github/repo-size/Shen-Yu/hexo-theme-ayer?color=b37feb">
</a> </a>
<a href="https://github.com/Shen-Yu/hexo-theme-ayer/blob/master/LICENSE" target="_blank" rel="noopener noreferrer"><img alt="LICENSE" src="https://img.shields.io/badge/LICENSE-SATA-yellow"> <a href="https://github.com/Shen-Yu/hexo-theme-ayer/blob/master/LICENSE" target="_blank" rel="noopener noreferrer"><img alt="LICENSE" src="https://img.shields.io/badge/LICENSE-SATA-6ccab8">
</a> </a>
</p> </p>
@@ -35,8 +35,8 @@
:ocean: Ayer is a clean and elegant theme for Hexo, also fast, powerful and responsive. It contains many awesome features, It's perfect for your blog, "Ayer" means "water" in Malaysian and "yesterday" in Spanish. If you have any queries or advice during the process of using, Please contact me! shenyu@hotmail.com :ocean: Ayer is a clean and elegant theme for Hexo, also fast, powerful and responsive. It contains many awesome features, It's perfect for your blog, "Ayer" means "water" in Malaysian and "yesterday" in Spanish. If you have any queries or advice during the process of using, Please contact me! shenyu@hotmail.com
<b>收藏本主题请点右上角Star谢谢~~ </b> <b>注:收藏本主题请点右上角 Star谢谢~~ </b>
<b>如果你想给主题添砖加瓦可以点右上角Fork然后给此仓库提交PR</b> <b>如果你想给主题添砖加瓦,可以点右上角 Fork然后给此仓库提交 PR</b>
### [Preview 预览](https://shen-yu.gitee.io) ### [Preview 预览](https://shen-yu.gitee.io)
@@ -48,37 +48,38 @@
## Install ## Install
### For hexo < 5.0
``` shell
git clone https://github.com/Shen-Yu/hexo-theme-ayer.git themes/ayer
```
### For hexo >= 5.0 ### For hexo >= 5.0
``` shell ```shell
npm i hexo-theme-ayer -S npm i hexo-theme-ayer -S
``` ```
- If this theme is newly installed, a `_config.ayer.yml` file will be generated in the root directory after the installation is complete, and you can directly edit the `_config.ayer.yml` file for configuration. - If this theme is newly installed, a `_config.ayer.yml` file will be generated in the root directory after the installation is complete, and you can directly edit the `_config.ayer.yml` file for configuration.
- If it is a theme upgrade, you can use the configuration method of hexo < 5.0, or you can move the original configuration file to the root directory and rename it to `_config.ayer.yml`. - If it is a theme upgrade, you can use the configuration method of hexo < 5.0, or you can move the original configuration file to the root directory and rename it to `_config.ayer.yml`.
### For hexo < 5.0
```shell
git clone https://github.com/Shen-Yu/hexo-theme-ayer.git themes/ayer
```
## Enable ## Enable
Modify `theme` setting in `_config.yml` to `ayer` Modify `theme` setting in `_config.yml` to `ayer`
``` yml ```yml
theme: ayer theme: ayer
``` ```
## Update ## Update
``` bash ```bash
cd themes/ayer cd themes/ayer
git pull git pull
``` ```
## Multi Language Support ## Multi Language Support
zh-CN中文简体 enEnglish zh-TW中文繁体 ja日本語 esEspañol deDeutsch frFrançais ruРусский ko한국어 viTiếng Việt nlNederlands nonorsk ptPortuguês zh-CN中文简体 enEnglish zh-TW中文繁体 ja日本語 esEspañol deDeutsch frFrançais ruРусский ko한국어 viTiếng Việt nlNederlands nonorsk ptPortuguês
English is default languge, if you want to change, modify `language` option in `_config.yml` file in your Hexo blog's root folder. English is default languge, if you want to change, modify `language` option in `_config.yml` file in your Hexo blog's root folder.
@@ -87,7 +88,7 @@ English is default languge, if you want to change, modify `language` option in `
let me know if you have any questions. let me know if you have any questions.
``` yml ```yml
# Menu-Sidebar # Menu-Sidebar
menu: menu:
Home: / Home: /
@@ -169,7 +170,7 @@ word_count:
# type0-close reward 1-only open in article which you have configured reward:true 2-open in all articles # type0-close reward 1-only open in article which you have configured reward:true 2-open in all articles
reward_type: 2 reward_type: 2
# reward word # reward word
reward_wording: 'Buy me a cup of coffee~' reward_wording: "Buy me a cup of coffee~"
# qrcode image path # qrcode image path
alipay: /images/alipay.jpg alipay: /images/alipay.jpg
# qrcode image path # qrcode image path
@@ -222,9 +223,9 @@ cnzz:
url: # url: #
# Google Analytics # Google Analytics
google_analytics: '' google_analytics: ""
# Baidu Analytics # Baidu Analytics
baidu_analytics: '' baidu_analytics: ""
# Mathjax Support # Mathjax Support
mathjax: true mathjax: true
@@ -239,9 +240,6 @@ katex:
# since year # since year
since: 2019 since: 2019
# pageFooter (Set true can let more people know this theme, Thanks!)
pageFooter: true
# only for chinese website # only for chinese website
# ICP # ICP
icp: icp:
@@ -308,19 +306,36 @@ twikoo:
# See: https://github.com/MiniValine/MiniValine # See: https://github.com/MiniValine/MiniValine
minivaline: minivaline:
enable: false enable: false
md: true serverURL: https://minivaline.your-domain.com
# more options https://minivaline.js.org/docs/cn/#/Options
backend: waline # advertisement
serverURL: https://waline.vercel.app # if there is an "ad" word in photo or urlit may blocked by adblock or any other browser extensions
ads:
ad_1:
title: vultr优惠vps
img: https://cdn.jsdelivr.net/gh/Shen-Yu/cdn/img/vultr.png
url: https://www.vultr.com/?ref=8630075
width: 300
ad_2:
title: 云服务器全球购低至2折
img: https://cdn.jsdelivr.net/gh/Shen-Yu/cdn/img/ten_2.jpg
url: https://curl.qcloud.com/kvO7hb43
width: 300
# encrypt settings
lock:
enable: false
password: 123456
``` ```
## Plugins ## Plugins
+ [hexo-generator-search](https://github.com/wzpan/hexo-generator-search) (for Local Search) - [hexo-generator-search](https://github.com/wzpan/hexo-generator-search) (for Local Search)
```yml ```yml
$ npm install hexo-generator-searchdb --save $ npm install hexo-generator-searchdb --save
``` ```
Then add the plugin configuration in hexo's configuration file `_config.yml` (note: not the theme's configuration file): Then add the plugin configuration in hexo's configuration file `_config.yml` (note: not the theme's configuration file):
```yml ```yml
@@ -331,7 +346,7 @@ minivaline:
format: html format: html
``` ```
+ [hexo-generator-feed](https://github.com/hexojs/hexo-generator-feed) (for RSS) - [hexo-generator-feed](https://github.com/hexojs/hexo-generator-feed) (for RSS)
```yml ```yml
$ npm install hexo-generator-feed --save $ npm install hexo-generator-feed --save
@@ -351,18 +366,22 @@ minivaline:
order_by: -date order_by: -date
``` ```
+ [hexo-generator-index-pin-top](https://github.com/netcan/hexo-generator-index-pin-top) (for Sticky Post) - [hexo-generator-index-pin-top](https://github.com/netcan/hexo-generator-index-pin-top) (for Sticky Post)
``` bash ```bash
$ npm uninstall hexo-generator-index --save $ npm uninstall hexo-generator-index --save
$ npm install hexo-generator-index-pin-top --save $ npm install hexo-generator-index-pin-top --save
``` ```
## Categories ## Categories
``` bash
```bash
hexo new page categories hexo new page categories
``` ```
Then paste following codes to file: /source/categories/index.md Then paste following codes to file: /source/categories/index.md
``` md
```md
--- ---
title: categories title: categories
type: categories type: categories
@@ -371,33 +390,36 @@ layout: "categories"
``` ```
## Tags ## Tags
Same as categories. Same as categories.
## Friend Links ## Friend Links
``` bash
```bash
hexo new page friends hexo new page friends
``` ```
Then paste following codes to file: /source/friends/index.md Then paste following codes to file: /source/friends/index.md
``` md
```md
--- ---
title: friends title: friends
type: friends type: friends
layout: "friends" layout: "friends"
--- ---
``` ```
Then edit `friends_link` in `_config.yml` Then edit `friends_link` in `_config.yml`
## Gallery ## Gallery
Need to write in the head of the markdown, this is not a good way to write, I hope to get a better way to write on github. Need to write in the head of the markdown, this is not a good way to write, I hope to get a better way to write on github.
``` md ```md
--- ---
title: Gallery title: Gallery
albums: [ albums: [["img_url", "img_caption"], ["img_url", "img_caption"]]
["img_url","img_caption"],
["img_url","img_caption"]
]
--- ---
``` ```
@@ -405,15 +427,16 @@ albums: [
Use Tocbot to parse the title tags (h1~h6) in the content and insert the directory. Use Tocbot to parse the title tags (h1~h6) in the content and insert the directory.
+ ayer/_config.yml - ayer/\_config.yml
``` bash ```bash
# Toc # Toc
toc: true toc: true
``` ```
+ If Toc is turned on in ayer/_config.yml, then Tocbot will generate a Toc article directory in the title tag of each blog parsing content, but not all blogs require Toc, so in the Front-matter section of markdown Can be closed:
``` md - If Toc is turned on in ayer/\_config.yml, then Tocbot will generate a Toc article directory in the title tag of each blog parsing content, but not all blogs require Toc, so in the Front-matter section of markdown Can be closed:
```md
--- ---
no_toc: true no_toc: true
--- ---
@@ -433,7 +456,6 @@ This project exists thanks to all the people who contribute.
[![Stargazers over time](https://starchart.cc/Shen-Yu/hexo-theme-ayer.svg)](https://starchart.cc/Shen-Yu/hexo-theme-ayer) [![Stargazers over time](https://starchart.cc/Shen-Yu/hexo-theme-ayer.svg)](https://starchart.cc/Shen-Yu/hexo-theme-ayer)
## License ## License
<a src="https://github.com/Shen-Yu/hexo-theme-ayer">Ayer</a> by <a href="https://github.com/Shen-Yu">Eric-Shen</a> is licensed under <a rel="license" href="https://github.com/Shen-Yu/hexo-theme-ayer/blob/master/LICENSE">SATA-License</a>. <a src="https://github.com/Shen-Yu/hexo-theme-ayer">Ayer</a> by <a href="https://github.com/Shen-Yu">Eric-Shen</a> is licensed under <a rel="license" href="https://github.com/Shen-Yu/hexo-theme-ayer/blob/master/LICENSE">SATA-License</a>.
@@ -441,11 +463,11 @@ This project exists thanks to all the people who contribute.
The basic idea is, whenever using a project using SATA license, people shall star/like/+1 that project and thank the author. Just imagine Google stared your project and send you a thank-you letter because they used your project in github! The basic idea is, whenever using a project using SATA license, people shall star/like/+1 that project and thank the author. Just imagine Google stared your project and send you a thank-you letter because they used your project in github!
<br> <br>
本项目采用<a rel="license" href="https://github.com/Shen-Yu/hexo-theme-ayer/blob/master/LICENSE">SATA</a>开源协议在遵守MIT许可证的前提下你应该马不停蹄的给这个开源项目“点个赞”比如github右上角的star然后你应该感谢这个开源项目的作者作者信息可以在许可证头部的版权声明部分找到。<br> 本项目采用<a rel="license" href="https://github.com/Shen-Yu/hexo-theme-ayer/blob/master/LICENSE">SATA</a>开源协议,在遵守 MIT 许可证的前提下,你应该马不停蹄的给这个开源项目“点个赞”,比如 github 右上角的 star然后你应该感谢这个开源项目的作者作者信息可以在许可证头部的版权声明部分找到。<br>
下面是几条SATA作者推荐的感谢途径也是SATA包含的内容 下面是几条 SATA 作者推荐的感谢途径,也是 SATA 包含的内容:
- 给你使用的开源项目的作者发个Email和他交个朋友 - 给你使用的开源项目的作者发个 Email和他交个朋友
- 提出你在使用过程中发现的BUG或者提一些建设性的意见 - 提出你在使用过程中发现的 BUG 或者提一些建设性的意见
- 告诉你的朋友们这是一个多棒的开源项目 - 告诉你的朋友们这是一个多棒的开源项目
- 当然,你也可以只是在心里默默的感激,不用让全世界都知道 - 当然,你也可以只是在心里默默的感激,不用让全世界都知道

View File

@@ -166,9 +166,6 @@ mermaid:
# 网站成立年份(默认为 2019若填入年份小于当前年份则显示为 2018-2019 类似的格式) # 网站成立年份(默认为 2019若填入年份小于当前年份则显示为 2018-2019 类似的格式)
since: 2015 since: 2015
# 是否显示页脚信息(建议保留)
pageFooter: true
# ICP备案信息尾部显示 # ICP备案信息尾部显示
icp: icp:
enable: false enable: false
@@ -242,12 +239,17 @@ minivaline:
# 可以根据需要自行增加ad_3ad_4...留空则不显示建议图片和url不要带ad等关键词否则可能会被adblock等插件屏蔽 # 可以根据需要自行增加ad_3ad_4...留空则不显示建议图片和url不要带ad等关键词否则可能会被adblock等插件屏蔽
ads: ads:
ad_1: ad_1:
title: 腾讯云限时秒杀 title: 服务器限时秒杀
img: https://cdn.jsdelivr.net/gh/Shen-Yu/cdn/img/ten_1.jpg img: https://cdn.jsdelivr.net/gh/Shen-Yu/cdn/img/ten_1.jpg
url: https://curl.qcloud.com/ezctH6FU
width: 300
ad_2:
title: 云服务器全球购低至2折
img: https://cdn.jsdelivr.net/gh/Shen-Yu/cdn/img/ten_2.jpg
url: https://curl.qcloud.com/kvO7hb43 url: https://curl.qcloud.com/kvO7hb43
width: 300 width: 300
ad_2:
title: vultr优惠vps
img: https://cdn.jsdelivr.net/gh/Shen-Yu/cdn/img/vultr.png
url: https://www.vultr.com/?ref=8630075
width: 300
# 网站开启加密访问,密码可设置任何字符
lock:
enable: false
password: 123456

View File

@@ -30,3 +30,9 @@ post:
sticky: Oben sticky: Oben
copyright_title: Copyright-Hinweis copyright_title: Copyright-Hinweis
copyright_content: Sofern nicht anders angegeben, liegt das Urheberrecht aller Artikel in diesem Blog beim Autor. Nachdruck bitte Quelle angeben! copyright_content: Sofern nicht anders angegeben, liegt das Urheberrecht aller Artikel in diesem Blog beim Autor. Nachdruck bitte Quelle angeben!
lock:
lock_info: Please enter password
lock_error: Incorrect password, please try again
confirm_text: Ok
cancel_text: Cancel

View File

@@ -30,3 +30,9 @@ post:
sticky: Sticky sticky: Sticky
copyright_title: Copyright copyright_title: Copyright
copyright_content: Copyright is owned by the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please indicate the source. copyright_content: Copyright is owned by the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please indicate the source.
lock:
lock_info: Please enter password
lock_error: Incorrect password, please try again
confirm_text: Ok
cancel_text: Cancel

View File

@@ -30,3 +30,9 @@ post:
sticky: Sticky sticky: Sticky
copyright_title: Copyright copyright_title: Copyright
copyright_content: Copyright is owned by the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please indicate the source. copyright_content: Copyright is owned by the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please indicate the source.
lock:
lock_info: Please enter password
lock_error: Incorrect password, please try again
confirm_text: Ok
cancel_text: Cancel

View File

@@ -30,3 +30,9 @@ post:
sticky: Arriba sticky: Arriba
copyright_title: Derechos de autor copyright_title: Derechos de autor
copyright_content: Los derechos de autor son propiedad del autor. Para reimpresiones comerciales, comuníquese con el autor para obtener autorización. Para reimpresiones no comerciales, indique la fuente. copyright_content: Los derechos de autor son propiedad del autor. Para reimpresiones comerciales, comuníquese con el autor para obtener autorización. Para reimpresiones no comerciales, indique la fuente.
lock:
lock_info: Please enter password
lock_error: Incorrect password, please try again
confirm_text: Ok
cancel_text: Cancel

View File

@@ -30,3 +30,9 @@ post:
sticky: Haut sticky: Haut
copyright_title: Avis de copyright copyright_title: Avis de copyright
copyright_content: Le droit d'auteur appartient à l'auteur. Pour les réimpressions commerciales, veuillez contacter l'auteur pour autorisation. Pour les réimpressions non commerciales, veuillez indiquer la source. copyright_content: Le droit d'auteur appartient à l'auteur. Pour les réimpressions commerciales, veuillez contacter l'auteur pour autorisation. Pour les réimpressions non commerciales, veuillez indiquer la source.
lock:
lock_info: Please enter password
lock_error: Incorrect password, please try again
confirm_text: Ok
cancel_text: Cancel

View File

@@ -30,3 +30,9 @@ post:
sticky: 上へ sticky: 上へ
copyright_title: 著作権表示 copyright_title: 著作権表示
copyright_content: 著作権は著者が所有しています。商業版の複製については、承認について著者に連絡してください。非商業版の複製については、出典を明記してください。 copyright_content: 著作権は著者が所有しています。商業版の複製については、承認について著者に連絡してください。非商業版の複製については、出典を明記してください。
lock:
lock_info: Please enter password
lock_error: Incorrect password, please try again
confirm_text: Ok
cancel_text: Cancel

View File

@@ -30,3 +30,9 @@ post:
sticky: sticky:
copyright_title: 저작권 고지 copyright_title: 저작권 고지
copyright_content: 저작권은 저자가 소유합니다. 상업용 재 인쇄의 경우 승인을 위해 저자에게 문의하십시오. 비상업적 재 인쇄의 경우 출처를 명시하십시오. copyright_content: 저작권은 저자가 소유합니다. 상업용 재 인쇄의 경우 승인을 위해 저자에게 문의하십시오. 비상업적 재 인쇄의 경우 출처를 명시하십시오.
lock:
lock_info: Please enter password
lock_error: Incorrect password, please try again
confirm_text: Ok
cancel_text: Cancel

View File

@@ -30,3 +30,9 @@ post:
sticky: Sticky sticky: Sticky
copyright_title: Copyright melding copyright_title: Copyright melding
copyright_content: Copyright is eigendom van de auteur. Neem voor commerciële herdrukken contact op met de auteur voor autorisatie. Geef de bron aan voor niet-commerciële herdrukken. copyright_content: Copyright is eigendom van de auteur. Neem voor commerciële herdrukken contact op met de auteur voor autorisatie. Geef de bron aan voor niet-commerciële herdrukken.
lock:
lock_info: Please enter password
lock_error: Incorrect password, please try again
confirm_text: Ok
cancel_text: Cancel

View File

@@ -30,3 +30,9 @@ post:
sticky: Sticky sticky: Sticky
copyright_title: Opphavsrett copyright_title: Opphavsrett
copyright_content: Opphavsrett eies av forfatteren. For kommersielle opptrykk, vennligst kontakt forfatteren for godkjenning. For ikke-kommersiell uttrykk, vennligst oppgi kilden. copyright_content: Opphavsrett eies av forfatteren. For kommersielle opptrykk, vennligst kontakt forfatteren for godkjenning. For ikke-kommersiell uttrykk, vennligst oppgi kilden.
lock:
lock_info: Please enter password
lock_error: Incorrect password, please try again
confirm_text: Ok
cancel_text: Cancel

View File

@@ -30,3 +30,9 @@ post:
sticky: Sticky sticky: Sticky
copyright_title: direito autoral copyright_title: direito autoral
copyright_content: Os direitos autorais são de propriedade do autor. Para reimpressões comerciais, entre em contato com o autor para obter autorização. Para reimpressões não comerciais, indique a fonte. copyright_content: Os direitos autorais são de propriedade do autor. Para reimpressões comerciais, entre em contato com o autor para obter autorização. Para reimpressões não comerciais, indique a fonte.
lock:
lock_info: Please enter password
lock_error: Incorrect password, please try again
confirm_text: Ok
cancel_text: Cancel

View File

@@ -30,3 +30,9 @@ post:
sticky: липкий sticky: липкий
copyright_title: Авторские права copyright_title: Авторские права
copyright_content: Авторские права принадлежат автору. Для коммерческих перепечаток, пожалуйста, свяжитесь с автором для авторизации. Для некоммерческих перепечаток, пожалуйста, укажите источник. copyright_content: Авторские права принадлежат автору. Для коммерческих перепечаток, пожалуйста, свяжитесь с автором для авторизации. Для некоммерческих перепечаток, пожалуйста, укажите источник.
lock:
lock_info: Please enter password
lock_error: Incorrect password, please try again
confirm_text: Ok
cancel_text: Cancel

View File

@@ -30,3 +30,9 @@ post:
sticky: dính sticky: dính
copyright_title: Bản quyền copyright_title: Bản quyền
copyright_content: Bản quyền thuộc sở hữu của tác giả. Đối với tái bản thương mại, xin vui lòng liên hệ với tác giả cho phép. Đối với tái bản phi thương mại, xin vui lòng cho biết nguồn. copyright_content: Bản quyền thuộc sở hữu của tác giả. Đối với tái bản thương mại, xin vui lòng liên hệ với tác giả cho phép. Đối với tái bản phi thương mại, xin vui lòng cho biết nguồn.
lock:
lock_info: Please enter password
lock_error: Incorrect password, please try again
confirm_text: Ok
cancel_text: Cancel

View File

@@ -30,3 +30,9 @@ post:
sticky: 置顶 sticky: 置顶
copyright_title: 版权声明 copyright_title: 版权声明
copyright_content: 本博客所有文章除特别声明外,著作权归作者所有。转载请注明出处! copyright_content: 本博客所有文章除特别声明外,著作权归作者所有。转载请注明出处!
lock:
lock_info: 请输入访问密码
lock_error: 密码错误,请重试
confirm_text: 确定
cancel_text: 取消

View File

@@ -30,3 +30,9 @@ post:
sticky: 置頂 sticky: 置頂
copyright_title: 版權聲明 copyright_title: 版權聲明
copyright_content: 本博客所有文章除特別聲明外,著作權歸作者所有。轉載請註明出處! copyright_content: 本博客所有文章除特別聲明外,著作權歸作者所有。轉載請註明出處!
lock:
lock_info: 請輸入訪問密碼
lock_error: 密碼錯誤,請重試
confirm_text: 確定
cancel_text: 取消

View File

@@ -1,4 +1,4 @@
<%- js('/js/jquery-2.0.3.min') %> <%- js('/js/lazyload.min') %> <%- js('/js/jquery-3.6.0.min') %> <%- js('/js/lazyload.min') %>
<!-- Tocbot --> <!-- Tocbot -->
<% if (theme.toc && is_post() && !page.no_toc){ %> <%- js('/js/tocbot.min') %> <% if (theme.toc && is_post() && !page.no_toc){ %> <%- js('/js/tocbot.min') %>
<script> <script>

View File

@@ -40,10 +40,21 @@
<script src="https://cdn.jsdelivr.net/npm/pace-js@1.0.2/pace.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/pace-js@1.0.2/pace.min.js"></script>
<% } %> <%- partial('google-analytics') %> <%- partial('baidu-analytics') <% } %> <%- partial('google-analytics') %> <%- partial('baidu-analytics')
%> %>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@sweetalert2/theme-bulma@5.0.1/bulma.min.css"
/>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11.0.19/dist/sweetalert2.min.js"></script>
<!-- mermaid --> <!-- mermaid -->
<% if (theme.mermaid.enable) { %> <% if (theme.mermaid.enable) { %>
<script src="<%= theme.mermaid.cdn %>"></script> <script src="<%= theme.mermaid.cdn %>"></script>
<% } %> <% } %>
<style>
.swal2-styled.swal2-confirm {
font-size: 1.6rem;
}
</style>
</head> </head>
</html> </html>
</html> </html>

37
layout/_partial/lock.ejs Normal file
View File

@@ -0,0 +1,37 @@
<% if (theme.lock.enable){ %>
<script>
const password = "<%= theme.lock.password %>";
const lock_password = window.sessionStorage.getItem("lock_password");
console.log(password, lock_password);
if (lock_password !== password) {
Swal.fire({
title: "<%= __('lock.lock_info') %>",
input: "text",
inputAttributes: {
autocapitalize: "off",
},
showCancelButton: false,
showLoaderOnConfirm: true,
allowOutsideClick: false,
confirmButtonText: "<%= __('lock.confirm_text') %>",
}).then((result) => {
console.log(result);
if (result.isConfirmed) {
console.log(password);
if (result.value === password) {
window.sessionStorage.setItem("lock_password", result.value);
} else {
Swal.fire({
icon: "error",
title: "<%= __('lock.lock_error') %>",
confirmButtonText: "<%= __('lock.confirm_text') %>",
allowOutsideClick: false,
}).then(() => {
window.location.reload();
});
}
}
});
}
</script>
<% } %>

View File

@@ -21,10 +21,10 @@
<main class="content on"> <main class="content on">
<%- body %> <%- body %>
<%- partial('_partial/footer', null, {cache: !config.relative_link}) %> <%- partial('_partial/footer', null, {cache: !config.relative_link}) %>
<div class="float_btns">
<%- partial('_partial/totop') %>
</div>
</main> </main>
<div class="float_btns">
<%- partial('_partial/float-btns') %>
</div>
<aside class="sidebar on"> <aside class="sidebar on">
<%- partial('_partial/sidebar') %> <%- partial('_partial/sidebar') %>
</aside> </aside>
@@ -34,6 +34,7 @@
<% if (theme.music&&theme.music.enable){ %> <% if (theme.music&&theme.music.enable){ %>
<%- partial('_partial/music') %> <%- partial('_partial/music') %>
<% } %> <% } %>
<%- partial('_partial/lock') %>
</div> </div>
</body> </body>

View File

@@ -1,10 +1,10 @@
{ {
"name": "hexo-theme-ayer", "name": "hexo-theme-ayer",
"version": "1.8.23", "version": "1.9.5-0",
"description": "a clean and elegant theme for hexo.", "description": "a clean and elegant theme for hexo.",
"scripts": { "scripts": {
"dev": "parcel serve source-src/main.js -d source/dist", "dev": "rollup -c -w",
"build": "rimraf source/dist && parcel build source-src/main.js -d source/dist --no-source-maps", "build": "rollup -c",
"postinstall": "node ./move_config.js", "postinstall": "node ./move_config.js",
"test": "stylint source-src/css/style.styl -c .stylintrc" "test": "stylint source-src/css/style.styl -c .stylintrc"
}, },
@@ -28,9 +28,9 @@
"homepage": "https://shen-yu.gitee.io/", "homepage": "https://shen-yu.gitee.io/",
"devDependencies": { "devDependencies": {
"autoprefixer": "^9.8.6", "autoprefixer": "^9.8.6",
"cssnano": "^4.1.10", "rollup": "^2.50.2",
"parcel-bundler": "^1.12.5", "rollup-plugin-styles": "^3.14.1",
"postcss-modules": "^1.5.0", "rollup-plugin-terser": "^7.0.2",
"stylint": "^2.0.0" "stylint": "^2.0.0"
} }
} }

16
rollup.config.js Normal file
View File

@@ -0,0 +1,16 @@
import autoprefixer from "autoprefixer";
import styles from "rollup-plugin-styles";
import { terser } from "rollup-plugin-terser";
export default {
input: "source-src/main.js",
output: {
dir: "source/dist",
format: "iife",
assetFileNames: "[name][extname]",
},
plugins: [
styles({ mode: "extract", minimize: true, plugins: [autoprefixer()] }),
terser(),
],
};

View File

@@ -73,7 +73,7 @@
margin-right 0.5em margin-right 0.5em
margin-left 1em margin-left 1em
.caption .caption
color color-grey color froth
display block display block
font-size 0.9em font-size 0.9em
margin-top 0.5em margin-top 0.5em
@@ -267,6 +267,8 @@ $article-share-link
background google-color background google-color
text-shadow 0 1px darken(google-color, 20%) text-shadow 0 1px darken(google-color, 20%)
.pswp__caption__center
text-align center !important
@import "tocbot" @import "tocbot"
@import "gallery" @import "gallery"

View File

@@ -8,9 +8,25 @@
opacity .95 opacity .95
max-width 255px max-width 255px
border-radius 8px border-radius 8px
> .toc-list >.toc-list
position relative position relative
overflow hidden overflow-x hidden
overflow-y scroll
max-height 70vh
>.toc-list::-webkit-scrollbar
width 4px
  >.toc-list::-webkit-scrollbar-thumb
border-radius 10px
-webkit-box-shadow inset 0 0 5px rgba(0,0,0,0.2)
background rgba(0,0,0,0.2)
  >.toc-list::-webkit-scrollbar-track
-webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2)
border-radius: 0
background: rgba(0,0,0,0.1)
.toc-list .toc-list

View File

@@ -15,7 +15,7 @@
}, searchAnimDuration); }, searchAnimDuration);
}; };
$(".nav-item-search").click(() => { $(".nav-item-search").on("click", () => {
if (isSearchAnim) return; if (isSearchAnim) return;
startSearchAnim(); startSearchAnim();
$searchWrap.addClass("on"); $searchWrap.addClass("on");
@@ -24,7 +24,7 @@
}); });
}); });
$(document).mouseup((e) => { $(document).on("mouseup", (e) => {
const _con = $(".local-search"); const _con = $(".local-search");
if (!_con.is(e.target) && _con.has(e.target).length === 0) { if (!_con.is(e.target) && _con.has(e.target).length === 0) {
$searchWrap.removeClass("on"); $searchWrap.removeClass("on");
@@ -32,7 +32,7 @@
}); });
// Not recommended in mobile, /search.xml is actually large. // Not recommended in mobile, /search.xml is actually large.
if ($(".local-search").size()) { if ($(".local-search").length) {
$.getScript("/js/search.js", function () { $.getScript("/js/search.js", function () {
searchFunc("/search.xml", "local-search-input", "local-search-result"); searchFunc("/search.xml", "local-search-input", "local-search-result");
}); });
@@ -67,7 +67,7 @@
}; };
// Share // Share
$(".share-outer").click(() => $(".share-wrap").fadeToggle()); $(".share-outer").on("click", () => $(".share-wrap").fadeToggle());
// Lazyload // Lazyload
$("img.lazy").lazyload({ $("img.lazy").lazyload({
@@ -82,7 +82,7 @@
// ScrollDown // ScrollDown
$(document).ready(function ($) { $(document).ready(function ($) {
$(".anchor").click(function (e) { $(".anchor").on("click", function (e) {
e.preventDefault(); e.preventDefault();
$("main").animate({ scrollTop: $(".cover").height() }, "smooth"); $("main").animate({ scrollTop: $(".cover").height() }, "smooth");
}); });
@@ -102,7 +102,7 @@
// Show and hide the scroll to top link based on scroll position // Show and hide the scroll to top link based on scroll position
scrollElem.hide(); scrollElem.hide();
$(".content").scroll(function () { $(".content").on("scroll", () => {
const scrollTop = $(".content").scrollTop(); const scrollTop = $(".content").scrollTop();
if (scrollTop > upperLimit) { if (scrollTop > upperLimit) {
$(scrollElem).stop().fadeTo(200, 0.6); // fade back in $(scrollElem).stop().fadeTo(200, 0.6); // fade back in
@@ -112,28 +112,41 @@
}); });
// Scroll to top animation on click // Scroll to top animation on click
$(scrollElem).click(function () { $(scrollElem).on("click", () => {
$(".content").animate({ scrollTop: 0 }, scrollSpeed); $(".content").animate({ scrollTop: 0 }, scrollSpeed);
return false; return false;
}); });
})(); })();
// Caption
$(".article-entry").each(function (i) {
$(this)
.find("img")
.each(function () {
if ($(this).parent().is("a")) return;
const { alt } = this;
if (alt) $(this).after('<span class="caption">' + alt + "</span>");
});
});
// Mobile Nav // Mobile Nav
const $content = $(".content"), const $content = $(".content"),
$sidebar = $(".sidebar"); $sidebar = $(".sidebar");
$(".navbar-toggle").on("click", function () { $(".navbar-toggle").on("click", () => {
$(".content,.sidebar").addClass("anim"); $(".content,.sidebar").addClass("anim");
$content.toggleClass("on"); $content.toggleClass("on");
$sidebar.toggleClass("on"); $sidebar.toggleClass("on");
}); });
// Reward // Reward
$("#reward-btn").click(() => { $("#reward-btn").on("click", () => {
$("#reward").fadeIn(150); $("#reward").fadeIn(150);
$("#mask").fadeIn(150); $("#mask").fadeIn(150);
}); });
$("#reward .close, #mask").click(() => { $("#reward .close, #mask").on("click", () => {
$("#mask").fadeOut(100); $("#mask").fadeOut(100);
$("#reward").fadeOut(100); $("#reward").fadeOut(100);
}); });
@@ -146,7 +159,7 @@
$("body").removeClass("darkmode"); $("body").removeClass("darkmode");
$("#todark i").removeClass("ri-sun-line").addClass("ri-moon-line"); $("#todark i").removeClass("ri-sun-line").addClass("ri-moon-line");
} }
$("#todark").click(() => { $("#todark").on("click", () => {
if (sessionStorage.getItem("darkmode") == 1) { if (sessionStorage.getItem("darkmode") == 1) {
$("body").removeClass("darkmode"); $("body").removeClass("darkmode");
$("#todark i").removeClass("ri-sun-line").addClass("ri-moon-line"); $("#todark i").removeClass("ri-sun-line").addClass("ri-moon-line");

View File

@@ -1,3 +1,3 @@
import './css/style.styl' import "./css/style.styl";
import './js/ayer' import "./js/ayer";
import './js/share' import "./js/share";

File diff suppressed because one or more lines are too long

10
source/dist/main.js vendored
View File

@@ -1,9 +1 @@
parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"MiQR":[function(require,module,exports) { !function(){"use strict";var e;function t(e,t){e=e.replace(/<%-sUrl%>/g,encodeURIComponent(t.sUrl)).replace(/<%-sTitle%>/g,encodeURIComponent(t.sTitle)).replace(/<%-sDesc%>/g,encodeURIComponent(t.sDesc)).replace(/<%-sPic%>/g,encodeURIComponent(t.sPic));window.open(e)}function o(){$(".wx-share-modal").removeClass("in ready"),$("#share-mask").hide()}function s(e,o){"weibo"===e?t("http://service.weibo.com/share/share.php?url=<%-sUrl%>&title=<%-sTitle%>&pic=<%-sPic%>",o):"qq"===e?t("http://connect.qq.com/widget/shareqq/index.html?url=<%-sUrl%>&title=<%-sTitle%>&source=<%-sDesc%>",o):"douban"===e?t("https://www.douban.com/share/service?image=<%-sPic%>&href=<%-sUrl%>&name=<%-sTitle%>&text=<%-sDesc%>",o):"qzone"===e?t("http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=<%-sUrl%>&title=<%-sTitle%>&pics=<%-sPic%>&summary=<%-sDesc%>",o):"facebook"===e?t("https://www.facebook.com/sharer/sharer.php?u=<%-sUrl%>",o):"twitter"===e?t("https://twitter.com/intent/tweet?text=<%-sTitle%>&url=<%-sUrl%>",o):"google"===e?t("https://plus.google.com/share?url=<%-sUrl%>",o):"weixin"===e&&($(".wx-share-modal").addClass("in ready"),$("#share-mask").show())}!function(e){let t=e(".search-form-wrap"),o=!1;e(".nav-item-search").on("click",(()=>{var s;o||(o=!0,t.addClass("on"),s=function(){e(".local-search-input").focus()},setTimeout((function(){o=!1,s&&s()}),200))})),e(document).on("mouseup",(o=>{const s=e(".local-search");s.is(o.target)||0!==s.has(o.target).length||t.removeClass("on")})),e(".local-search").length&&e.getScript("/js/search.js",(function(){searchFunc("/search.xml","local-search-input","local-search-result")})),e(".share-outer").on("click",(()=>e(".share-wrap").fadeToggle())),e("img.lazy").lazyload({effect:"fadeIn"}),e("#gallery").justifiedGallery({rowHeight:200,margins:5}),e(document).ready((function(e){e(".anchor").on("click",(function(t){t.preventDefault(),e("main").animate({scrollTop:e(".cover").height()},"smooth")}))})),(()=>{const t=e("#totop");t.hide(),e(".content").on("scroll",(()=>{e(".content").scrollTop()>1e3?e(t).stop().fadeTo(200,.6):e(t).stop().fadeTo(200,0)})),e(t).on("click",(()=>(e(".content").animate({scrollTop:0},1e3),!1)))})(),e(".article-entry").each((function(t){e(this).find("img").each((function(){if(e(this).parent().is("a"))return;const{alt:t}=this;t&&e(this).after('<span class="caption">'+t+"</span>")}))}));const s=e(".content"),r=e(".sidebar");e(".navbar-toggle").on("click",(()=>{e(".content,.sidebar").addClass("anim"),s.toggleClass("on"),r.toggleClass("on")})),e("#reward-btn").on("click",(()=>{e("#reward").fadeIn(150),e("#mask").fadeIn(150)})),e("#reward .close, #mask").on("click",(()=>{e("#mask").fadeOut(100),e("#reward").fadeOut(100)})),1==sessionStorage.getItem("darkmode")?(e("body").addClass("darkmode"),e("#todark i").removeClass("ri-moon-line").addClass("ri-sun-line")):(e("body").removeClass("darkmode"),e("#todark i").removeClass("ri-sun-line").addClass("ri-moon-line")),e("#todark").on("click",(()=>{1==sessionStorage.getItem("darkmode")?(e("body").removeClass("darkmode"),e("#todark i").removeClass("ri-sun-line").addClass("ri-moon-line"),sessionStorage.removeItem("darkmode")):(e("body").addClass("darkmode"),e("#todark i").removeClass("ri-moon-line").addClass("ri-sun-line"),sessionStorage.setItem("darkmode",1))}));console.log("%c%s%c%s%c%s","background-color: #49b1f5; color: #fff; padding: 8px; font-size: 14px;","主题不错⭐star 支持一下 ->","background-color: #ffbca2; padding: 8px; font-size: 14px;","https://github.com/Shen-Yu/hexo-theme-ayer","background-color: #eaf8ff;","\n\n _ __ _______ _____ \n / \\ \\ \\ / / ____| _ \\ \n / _ \\ \\ V /| _| | |_) | \n / ___ \\ | | | |___| _ < \n /_/ \\_\\ _| |_____|_| \\__\\ \n")}(jQuery),e={id:"JGjrOr2rebvP6q2a",ck:"JGjrOr2rebvP6q2a"},function(t){var o=window,s=document,r=e,n="".concat("https:"===s.location.protocol?"https://":"http://","sdk.51.la/js-sdk-pro.min.js"),a=s.createElement("script"),c=s.getElementsByTagName("script")[0];a.type="text/javascript",a.setAttribute("charset","UTF-8"),a.async=!0,a.src=n,a.id="LA_COLLECT",r.d=a;var i=function(){o.LA.ids.push(r)};o.LA?o.LA.ids&&i():(o.LA=e,o.LA.ids=[],i()),c.parentNode.insertBefore(a,c)}();(()=>{let e=document.querySelectorAll(".share-sns");if(!e||0===e.length)return;let t=window.location.href,r=document.querySelector("title").innerHTML,n=document.querySelectorAll(".article-entry img").length?document.querySelector(".article-entry img").getAttribute("src"):"";""===n||/^(http:|https:)?\/\//.test(n)||(n=window.location.origin+n),e.forEach((e=>{e.onclick=o=>{s(e.getAttribute("data-type"),{sUrl:t,sPic:n,sTitle:r,sDesc:r})}})),document.querySelector("#mask").onclick=o,document.querySelector(".modal-close").onclick=o})()}();
},{}],"jSg4":[function(require,module,exports) {
!function(e){var o=e(".search-form-wrap"),a=!1;e(".nav-item-search").click(function(){var n;a||(a=!0,o.addClass("on"),n=function(){e(".local-search-input").focus()},setTimeout(function(){a=!1,n&&n()},200))}),e(document).mouseup(function(a){var n=e(".local-search");n.is(a.target)||0!==n.has(a.target).length||o.removeClass("on")}),e(".local-search").size()&&e.getScript("/js/search.js",function(){searchFunc("/search.xml","local-search-input","local-search-result")});var n;e(".share-outer").click(function(){return e(".share-wrap").fadeToggle()}),e("img.lazy").lazyload({effect:"fadeIn"}),e("#gallery").justifiedGallery({rowHeight:200,margins:5}),e(document).ready(function(e){e(".anchor").click(function(o){o.preventDefault(),e("main").animate({scrollTop:e(".cover").height()},"smooth")})}),(n=e("#totop")).hide(),e(".content").scroll(function(){e(".content").scrollTop()>1e3?e(n).stop().fadeTo(200,.6):e(n).stop().fadeTo(200,0)}),e(n).click(function(){return e(".content").animate({scrollTop:0},1e3),!1});var t=e(".content"),r=e(".sidebar");e(".navbar-toggle").on("click",function(){e(".content,.sidebar").addClass("anim"),t.toggleClass("on"),r.toggleClass("on")}),e("#reward-btn").click(function(){e("#reward").fadeIn(150),e("#mask").fadeIn(150)}),e("#reward .close, #mask").click(function(){e("#mask").fadeOut(100),e("#reward").fadeOut(100)}),1==sessionStorage.getItem("darkmode")?(e("body").addClass("darkmode"),e("#todark i").removeClass("ri-moon-line").addClass("ri-sun-line")):(e("body").removeClass("darkmode"),e("#todark i").removeClass("ri-sun-line").addClass("ri-moon-line")),e("#todark").click(function(){1==sessionStorage.getItem("darkmode")?(e("body").removeClass("darkmode"),e("#todark i").removeClass("ri-sun-line").addClass("ri-moon-line"),sessionStorage.removeItem("darkmode")):(e("body").addClass("darkmode"),e("#todark i").removeClass("ri-moon-line").addClass("ri-sun-line"),sessionStorage.setItem("darkmode",1))});console.log("%c%s%c%s%c%s","background-color: #49b1f5; color: #fff; padding: 8px; font-size: 14px;","主题不错⭐star 支持一下 ->","background-color: #ffbca2; padding: 8px; font-size: 14px;","https://github.com/Shen-Yu/hexo-theme-ayer","background-color: #eaf8ff;","\n\n _ __ _______ _____ \n / \\ \\ \\ / / ____| _ \\ \n / _ \\ \\ V /| _| | |_) | \n / ___ \\ | | | |___| _ < \n /_/ \\_\\ _| |_____|_| \\__\\ \n")}(jQuery),function(e){"use strict";!function(o){var a=window,n=document,t=e,r="".concat("https:"===n.location.protocol?"https://":"http://","sdk.51.la/js-sdk-pro.min.js"),s=n.createElement("script"),c=n.getElementsByTagName("script")[0];s.type="text/javascript",s.setAttribute("charset","UTF-8"),s.async=!0,s.src=r,s.id="LA_COLLECT",t.d=s;var i=function(){a.LA.ids.push(t)};a.LA?a.LA.ids&&i():(a.LA=e,a.LA.ids=[],i()),c.parentNode.insertBefore(s,c)}()}({id:"JGjrOr2rebvP6q2a",ck:"JGjrOr2rebvP6q2a"});
},{}],"BNiz":[function(require,module,exports) {
function e(e,t){e=e.replace(/<%-sUrl%>/g,encodeURIComponent(t.sUrl)).replace(/<%-sTitle%>/g,encodeURIComponent(t.sTitle)).replace(/<%-sDesc%>/g,encodeURIComponent(t.sDesc)).replace(/<%-sPic%>/g,encodeURIComponent(t.sPic));window.open(e)}function t(){$(".wx-share-modal").addClass("in ready"),$("#share-mask").show()}function s(){$(".wx-share-modal").removeClass("in ready"),$("#share-mask").hide()}function o(s,o){"weibo"===s?e("http://service.weibo.com/share/share.php?url=<%-sUrl%>&title=<%-sTitle%>&pic=<%-sPic%>",o):"qq"===s?e("http://connect.qq.com/widget/shareqq/index.html?url=<%-sUrl%>&title=<%-sTitle%>&source=<%-sDesc%>",o):"douban"===s?e("https://www.douban.com/share/service?image=<%-sPic%>&href=<%-sUrl%>&name=<%-sTitle%>&text=<%-sDesc%>",o):"qzone"===s?e("http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=<%-sUrl%>&title=<%-sTitle%>&pics=<%-sPic%>&summary=<%-sDesc%>",o):"facebook"===s?e("https://www.facebook.com/sharer/sharer.php?u=<%-sUrl%>",o):"twitter"===s?e("https://twitter.com/intent/tweet?text=<%-sTitle%>&url=<%-sUrl%>",o):"google"===s?e("https://plus.google.com/share?url=<%-sUrl%>",o):"weixin"===s&&t()}var r=function(){var e=document.querySelectorAll(".share-sns");if(e&&0!==e.length){var t=window.location.href,r=document.querySelector("title").innerHTML,c=document.querySelectorAll(".article-entry img").length?document.querySelector(".article-entry img").getAttribute("src"):"";""===c||/^(http:|https:)?\/\//.test(c)||(c=window.location.origin+c),e.forEach(function(e){e.onclick=function(s){o(e.getAttribute("data-type"),{sUrl:t,sPic:c,sTitle:r,sDesc:r})}}),document.querySelector("#mask").onclick=s,document.querySelector(".modal-close").onclick=s}};r();
},{}],"epB2":[function(require,module,exports) {
"use strict";require("./css/style.styl"),require("./js/ayer"),require("./js/share");
},{"./css/style.styl":"MiQR","./js/ayer":"jSg4","./js/share":"BNiz"}]},{},["epB2"], null)

View File

@@ -43,7 +43,7 @@ function setParticuleDirection(p) {
let radius = [-1, 1][anime.random(0, 1)] * value; let radius = [-1, 1][anime.random(0, 1)] * value;
return { return {
x: p.x + radius * Math.cos(angle), x: p.x + radius * Math.cos(angle),
y: p.y + radius * Math.sin(angle) y: p.y + radius * Math.sin(angle),
}; };
} }
@@ -113,7 +113,7 @@ function animateParticules(x, y) {
radius: 0.1, radius: 0.1,
duration: anime.random(minAnimeDuration, maxAnimeDuration), duration: anime.random(minAnimeDuration, maxAnimeDuration),
easing: "easeOutExpo", easing: "easeOutExpo",
update: renderParticule update: renderParticule,
}) })
.add({ .add({
targets: circle, targets: circle,
@@ -122,12 +122,12 @@ function animateParticules(x, y) {
alpha: { alpha: {
value: 0, value: 0,
easing: "linear", easing: "linear",
duration: anime.random(600, 800) duration: anime.random(600, 800),
}, },
duration: anime.random(1200, 1800), duration: anime.random(1200, 1800),
easing: "easeOutExpo", easing: "easeOutExpo",
update: renderParticule, update: renderParticule,
offset: 0 offset: 0,
}); });
} }
@@ -135,7 +135,7 @@ let render = anime({
duration: Infinity, duration: Infinity,
update: function () { update: function () {
ctx.clearRect(0, 0, canvasEl.width, canvasEl.height); ctx.clearRect(0, 0, canvasEl.width, canvasEl.height);
} },
}); });
document.addEventListener( document.addEventListener(

View File

@@ -1,96 +1,110 @@
class Circle { class Circle {
constructor({ origin, speed, color, angle, context }) { constructor({ origin, speed, color, angle, context }) {
this.origin = origin this.origin = origin;
this.position = { ...this.origin } this.position = { ...this.origin };
this.color = color this.color = color;
this.speed = speed this.speed = speed;
this.angle = angle this.angle = angle;
this.context = context this.context = context;
this.renderCount = 0 this.renderCount = 0;
} }
draw() { draw() {
this.context.fillStyle = this.color this.context.fillStyle = this.color;
this.context.beginPath() this.context.beginPath();
this.context.arc(this.position.x, this.position.y, 2, 0, Math.PI * 2) this.context.arc(this.position.x, this.position.y, 2, 0, Math.PI * 2);
this.context.fill() this.context.fill();
} }
move() { move() {
this.position.x = (Math.sin(this.angle) * this.speed) + this.position.x this.position.x = Math.sin(this.angle) * this.speed + this.position.x;
this.position.y = (Math.cos(this.angle) * this.speed) + this.position.y + (this.renderCount * 0.3) this.position.y =
this.renderCount++ Math.cos(this.angle) * this.speed +
} this.position.y +
this.renderCount * 0.3;
this.renderCount++;
} }
}
class Boom { class Boom {
constructor ({ origin, context, circleCount = 10, area }) { constructor({ origin, context, circleCount = 10, area }) {
this.origin = origin this.origin = origin;
this.context = context this.context = context;
this.circleCount = circleCount this.circleCount = circleCount;
this.area = area this.area = area;
this.stop = false this.stop = false;
this.circles = [] this.circles = [];
} }
randomArray(range) { randomArray(range) {
const length = range.length const length = range.length;
const randomIndex = Math.floor(length * Math.random()) const randomIndex = Math.floor(length * Math.random());
return range[randomIndex] return range[randomIndex];
} }
randomColor() { randomColor() {
const range = ['8', '9', 'A', 'B', 'C', 'D', 'E', 'F'] const range = ["8", "9", "A", "B", "C", "D", "E", "F"];
return '#' + this.randomArray(range) + this.randomArray(range) + this.randomArray(range) + this.randomArray(range) + this.randomArray(range) + this.randomArray(range) return (
"#" +
this.randomArray(range) +
this.randomArray(range) +
this.randomArray(range) +
this.randomArray(range) +
this.randomArray(range) +
this.randomArray(range)
);
} }
randomRange(start, end) { randomRange(start, end) {
return (end - start) * Math.random() + start return (end - start) * Math.random() + start;
} }
init() { init() {
for(let i = 0; i < this.circleCount; i++) { for (let i = 0; i < this.circleCount; i++) {
const circle = new Circle({ const circle = new Circle({
context: this.context, context: this.context,
origin: this.origin, origin: this.origin,
color: this.randomColor(), color: this.randomColor(),
angle: this.randomRange(Math.PI - 1, Math.PI + 1), angle: this.randomRange(Math.PI - 1, Math.PI + 1),
speed: this.randomRange(1, 6) speed: this.randomRange(1, 6),
}) });
this.circles.push(circle) this.circles.push(circle);
} }
} }
move() { move() {
this.circles.forEach((circle, index) => { this.circles.forEach((circle, index) => {
if (circle.position.x > this.area.width || circle.position.y > this.area.height) { if (
return this.circles.splice(index, 1) circle.position.x > this.area.width ||
circle.position.y > this.area.height
) {
return this.circles.splice(index, 1);
} }
circle.move() circle.move();
}) });
if (this.circles.length == 0) { if (this.circles.length == 0) {
this.stop = true this.stop = true;
} }
} }
draw() { draw() {
this.circles.forEach(circle => circle.draw()) this.circles.forEach((circle) => circle.draw());
}
} }
}
class CursorSpecialEffects { class CursorSpecialEffects {
constructor() { constructor() {
this.computerCanvas = document.createElement('canvas') this.computerCanvas = document.createElement("canvas");
this.renderCanvas = document.createElement('canvas') this.renderCanvas = document.createElement("canvas");
this.computerContext = this.computerCanvas.getContext('2d') this.computerContext = this.computerCanvas.getContext("2d");
this.renderContext = this.renderCanvas.getContext('2d') this.renderContext = this.renderCanvas.getContext("2d");
this.globalWidth = window.innerWidth this.globalWidth = window.innerWidth;
this.globalHeight = window.innerHeight this.globalHeight = window.innerHeight;
this.booms = [] this.booms = [];
this.running = false this.running = false;
} }
handleMouseDown(e) { handleMouseDown(e) {
@@ -99,56 +113,68 @@ class Circle {
context: this.computerContext, context: this.computerContext,
area: { area: {
width: this.globalWidth, width: this.globalWidth,
height: this.globalHeight height: this.globalHeight,
} },
}) });
boom.init() boom.init();
this.booms.push(boom) this.booms.push(boom);
this.running || this.run() this.running || this.run();
} }
handlePageHide() { handlePageHide() {
this.booms = [] this.booms = [];
this.running = false this.running = false;
} }
init() { init() {
const style = this.renderCanvas.style const style = this.renderCanvas.style;
style.position = 'fixed' style.position = "fixed";
style.top = style.left = 0 style.top = style.left = 0;
style.zIndex = '99999' style.zIndex = "99999";
style.pointerEvents = 'none' style.pointerEvents = "none";
style.width = this.renderCanvas.width = this.computerCanvas.width = this.globalWidth style.width =
style.height = this.renderCanvas.height = this.computerCanvas.height = this.globalHeight this.renderCanvas.width =
this.computerCanvas.width =
this.globalWidth;
style.height =
this.renderCanvas.height =
this.computerCanvas.height =
this.globalHeight;
document.body.append(this.renderCanvas) document.body.append(this.renderCanvas);
window.addEventListener('mousedown', this.handleMouseDown.bind(this)) window.addEventListener("mousedown", this.handleMouseDown.bind(this));
window.addEventListener('pagehide', this.handlePageHide.bind(this)) window.addEventListener("pagehide", this.handlePageHide.bind(this));
} }
run() { run() {
this.running = true this.running = true;
if (this.booms.length == 0) { if (this.booms.length == 0) {
return this.running = false return (this.running = false);
} }
requestAnimationFrame(this.run.bind(this)) requestAnimationFrame(this.run.bind(this));
this.computerContext.clearRect(0, 0, this.globalWidth, this.globalHeight) this.computerContext.clearRect(0, 0, this.globalWidth, this.globalHeight);
this.renderContext.clearRect(0, 0, this.globalWidth, this.globalHeight) this.renderContext.clearRect(0, 0, this.globalWidth, this.globalHeight);
this.booms.forEach((boom, index) => { this.booms.forEach((boom, index) => {
if (boom.stop) { if (boom.stop) {
return this.booms.splice(index, 1) return this.booms.splice(index, 1);
}
boom.move()
boom.draw()
})
this.renderContext.drawImage(this.computerCanvas, 0, 0, this.globalWidth, this.globalHeight)
} }
boom.move();
boom.draw();
});
this.renderContext.drawImage(
this.computerCanvas,
0,
0,
this.globalWidth,
this.globalHeight
);
} }
}
const cursorSpecialEffects = new CursorSpecialEffects() const cursorSpecialEffects = new CursorSpecialEffects();
cursorSpecialEffects.init() cursorSpecialEffects.init();

File diff suppressed because one or more lines are too long

2
source/js/jquery-3.6.0.min.js vendored Normal file

File diff suppressed because one or more lines are too long