Compare commits
33 Commits
dea546ddfa
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| a699cd8439 | |||
| 0bb27b4b85 | |||
| 49572eb3a0 | |||
| 8b240e8654 | |||
| 7cfd111895 | |||
| 14a299f13f | |||
| bcf66aee48 | |||
| 92fa085399 | |||
| 30ad5027db | |||
| 6b5d9f232e | |||
| 875fb417a7 | |||
| efff4fc131 | |||
| dc75bd64f1 | |||
| 5ea5e3cba1 | |||
| ee2c51ff65 | |||
| f68c9071aa | |||
| 74ae58bd12 | |||
| 4bd598b0df | |||
| 456cd4e755 | |||
| aaeed68ca9 | |||
| b05bf011a4 | |||
| 8e22c02d6f | |||
| 26b63d45ab | |||
| 2c2ca13fdc | |||
| 0e03622db0 | |||
| 9b648efef4 | |||
| af3944558c | |||
| 25a2270e2e | |||
| f3993756fc | |||
| 8ddeba0de6 | |||
| 3dd2927bd2 | |||
| a03118ad68 | |||
| 167f6afe6a |
90
.idea/workspace.xml
generated
@@ -5,48 +5,7 @@
|
|||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="de9fa6e3-30cd-4bd9-9de2-e5d7f0390fc8" name="更改" comment="">
|
<list default="true" id="de9fa6e3-30cd-4bd9-9de2-e5d7f0390fc8" name="更改" comment="">
|
||||||
<change afterPath="$PROJECT_DIR$/README.md" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
<change afterPath="$PROJECT_DIR$/_config.butterfly1.yml" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/public/favicon.ico" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/public/img/512.png" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/public/img/algolia.svg" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/public/img/comment_bg.png" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/public/img/default_cover.jpg" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/public/img/favicon.ico" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/public/img/loading.gif" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/public/img/siteicon/16.png" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/public/img/siteicon/32.png" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/public/img/siteicon/apple-icon-180.png" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/public/img/siteicon/manifest-icon-192.maskable.png" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/public/img/siteicon/manifest-icon-512.maskable.png" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/public/js/anzhiyu/ai_abstract.js" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/public/js/anzhiyu/comment_barrage.js" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/public/js/anzhiyu/people.js" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/public/js/anzhiyu/random_friends_post.js" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/public/js/anzhiyu/right_click_menu.js" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/source/categories/index.md" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/source/tags/index.md" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/_config.anzhiyu.yml" beforeDir="false" afterPath="$PROJECT_DIR$/_config.anzhiyu.yml" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/_config.butterfly.yml" beforeDir="false" afterPath="$PROJECT_DIR$/_config.butterfly.yml" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/_config.yml" beforeDir="false" afterPath="$PROJECT_DIR$/_config.yml" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/db.json" beforeDir="false" afterPath="$PROJECT_DIR$/db.json" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/public/2024/07/30/about/me/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/public/2024/07/30/about/me/index.html" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/public/2024/07/30/hello-world/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/public/2024/07/30/hello-world/index.html" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/public/404.html" beforeDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/public/archives/2024/07/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/public/archives/2024/07/index.html" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/public/archives/2024/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/public/archives/2024/index.html" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/public/archives/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/public/archives/index.html" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/public/css/index.css" beforeDir="false" afterPath="$PROJECT_DIR$/public/css/index.css" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/public/img/404.jpg" beforeDir="false" afterPath="$PROJECT_DIR$/public/img/404.jpg" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/public/img/avatar.jpg" beforeDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/public/img/favicon.png" beforeDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/public/img/friend_404.gif" beforeDir="false" afterPath="$PROJECT_DIR$/public/img/friend_404.gif" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/public/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/public/index.html" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/public/js/main.js" beforeDir="false" afterPath="$PROJECT_DIR$/public/js/main.js" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/public/js/search/algolia.js" beforeDir="false" afterPath="$PROJECT_DIR$/public/js/search/algolia.js" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/public/js/search/local-search.js" beforeDir="false" afterPath="$PROJECT_DIR$/public/js/search/local-search.js" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/public/js/tw_cn.js" beforeDir="false" afterPath="$PROJECT_DIR$/public/js/tw_cn.js" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/public/js/utils.js" beforeDir="false" afterPath="$PROJECT_DIR$/public/js/utils.js" afterDir="false" />
|
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
@@ -57,6 +16,7 @@
|
|||||||
<option name="RECENT_TEMPLATES">
|
<option name="RECENT_TEMPLATES">
|
||||||
<list>
|
<list>
|
||||||
<option value="HTML File" />
|
<option value="HTML File" />
|
||||||
|
<option value="CSS File" />
|
||||||
</list>
|
</list>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
@@ -94,7 +54,8 @@
|
|||||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||||
"git-widget-placeholder": "master",
|
"git-widget-placeholder": "master",
|
||||||
"kotlin-language-version-configured": "true",
|
"kotlin-language-version-configured": "true",
|
||||||
"last_opened_file_path": "D:/JetBrainsToolProject/InteliJIDEA/test-qr/qr",
|
"last_opened_file_path": "D:/JetBrainsToolProject/IntelJ IDEA/qr-hexo/source/img",
|
||||||
|
"list.type.of.created.stylesheet": "CSS",
|
||||||
"node.js.detected.package.eslint": "true",
|
"node.js.detected.package.eslint": "true",
|
||||||
"node.js.detected.package.tslint": "true",
|
"node.js.detected.package.tslint": "true",
|
||||||
"node.js.selected.package.eslint": "(autodetect)",
|
"node.js.selected.package.eslint": "(autodetect)",
|
||||||
@@ -107,11 +68,15 @@
|
|||||||
}</component>
|
}</component>
|
||||||
<component name="RecentsManager">
|
<component name="RecentsManager">
|
||||||
<key name="CopyFile.RECENT_KEYS">
|
<key name="CopyFile.RECENT_KEYS">
|
||||||
<recent name="D:\JetBrainsToolProject\InteliJIDEA\qr-hexo" />
|
<recent name="D:\JetBrainsToolProject\IntelJ IDEA\qr-hexo\source\img" />
|
||||||
|
<recent name="D:\JetBrainsToolProject\InteliJIDEA\qr-hexo\source\img" />
|
||||||
|
<recent name="D:\JetBrainsToolProject\InteliJIDEA\qr-hexo\themes" />
|
||||||
<recent name="D:\JetBrainsToolProject\InteliJIDEA\qr-hexo\themes\butterfly\source\img" />
|
<recent name="D:\JetBrainsToolProject\InteliJIDEA\qr-hexo\themes\butterfly\source\img" />
|
||||||
<recent name="D:\JetBrainsToolProject\InteliJIDEA\qr-hexo\static" />
|
<recent name="D:\JetBrainsToolProject\InteliJIDEA\qr-hexo" />
|
||||||
</key>
|
</key>
|
||||||
<key name="MoveFile.RECENT_KEYS">
|
<key name="MoveFile.RECENT_KEYS">
|
||||||
|
<recent name="D:\JetBrainsToolProject\InteliJIDEA\qr-hexo\source\_posts\net\jichang" />
|
||||||
|
<recent name="D:\JetBrainsToolProject\InteliJIDEA\qr-hexo\source\css" />
|
||||||
<recent name="D:\JetBrainsToolProject\InteliJIDEA\qr-hexo\themes" />
|
<recent name="D:\JetBrainsToolProject\InteliJIDEA\qr-hexo\themes" />
|
||||||
</key>
|
</key>
|
||||||
</component>
|
</component>
|
||||||
@@ -146,8 +111,8 @@
|
|||||||
<component name="SharedIndexes">
|
<component name="SharedIndexes">
|
||||||
<attachedChunks>
|
<attachedChunks>
|
||||||
<set>
|
<set>
|
||||||
<option value="bundled-jdk-9f38398b9061-39b83d9b5494-intellij.indexing.shared.core-IU-241.18034.62" />
|
<option value="bundled-jdk-9823dce3aa75-b114ca120d71-intellij.indexing.shared.core-IU-242.21829.142" />
|
||||||
<option value="bundled-js-predefined-1d06a55b98c1-0b3e54e931b4-JavaScript-IU-241.18034.62" />
|
<option value="bundled-js-predefined-d6986cc7102b-7c0b70fcd90d-JavaScript-IU-242.21829.142" />
|
||||||
</set>
|
</set>
|
||||||
</attachedChunks>
|
</attachedChunks>
|
||||||
</component>
|
</component>
|
||||||
@@ -164,12 +129,43 @@
|
|||||||
<workItem from="1722346590186" duration="1768000" />
|
<workItem from="1722346590186" duration="1768000" />
|
||||||
<workItem from="1722385471856" duration="1455000" />
|
<workItem from="1722385471856" duration="1455000" />
|
||||||
<workItem from="1722405691335" duration="3656000" />
|
<workItem from="1722405691335" duration="3656000" />
|
||||||
|
<workItem from="1722472583002" duration="3928000" />
|
||||||
|
<workItem from="1722495344547" duration="188000" />
|
||||||
|
<workItem from="1722496451693" duration="5606000" />
|
||||||
|
<workItem from="1722523547664" duration="231000" />
|
||||||
|
<workItem from="1722525090581" duration="136000" />
|
||||||
|
<workItem from="1722837934755" duration="1258000" />
|
||||||
|
<workItem from="1722996243982" duration="2835000" />
|
||||||
|
<workItem from="1723000171547" duration="657000" />
|
||||||
|
<workItem from="1723000935915" duration="2478000" />
|
||||||
|
<workItem from="1723076731245" duration="609000" />
|
||||||
|
<workItem from="1723078072510" duration="1448000" />
|
||||||
|
<workItem from="1723204368886" duration="2226000" />
|
||||||
|
<workItem from="1723256861409" duration="2023000" />
|
||||||
|
<workItem from="1723376828153" duration="28000" />
|
||||||
|
<workItem from="1723864071920" duration="482000" />
|
||||||
|
<workItem from="1723940011559" duration="166000" />
|
||||||
|
<workItem from="1723996998009" duration="264000" />
|
||||||
|
<workItem from="1726012925092" duration="988000" />
|
||||||
|
<workItem from="1726065560220" duration="886000" />
|
||||||
|
<workItem from="1726147233388" duration="6000" />
|
||||||
</task>
|
</task>
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
<component name="TypeScriptGeneratedFilesManager">
|
<component name="TypeScriptGeneratedFilesManager">
|
||||||
<option name="version" value="3" />
|
<option name="version" value="3" />
|
||||||
</component>
|
</component>
|
||||||
|
<component name="Vcs.Log.Tabs.Properties">
|
||||||
|
<option name="TAB_STATES">
|
||||||
|
<map>
|
||||||
|
<entry key="MAIN">
|
||||||
|
<value>
|
||||||
|
<State />
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
</map>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
<component name="VcsManagerConfiguration">
|
<component name="VcsManagerConfiguration">
|
||||||
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
|
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
|
||||||
</component>
|
</component>
|
||||||
|
|||||||
14
README.md
@@ -1,5 +1,15 @@
|
|||||||
### anzhiyu主题
|
## 1. anzhiyu主题
|
||||||
**启动**
|
**dev server 启动**
|
||||||
```shell
|
```shell
|
||||||
hexo cl && hexo g && hexo s
|
hexo cl && hexo g && hexo s
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## 2. butterfly 主题
|
||||||
|
**dev server 启动**
|
||||||
|
```shell
|
||||||
|
hexo server
|
||||||
|
```
|
||||||
|
**重新构建**
|
||||||
|
```shell
|
||||||
|
npm run build
|
||||||
|
```
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ menu:
|
|||||||
highlight_theme: mac # darker / pale night / light / ocean / mac / mac light / false
|
highlight_theme: mac # darker / pale night / light / ocean / mac / mac light / false
|
||||||
highlight_copy: true # copy button
|
highlight_copy: true # copy button
|
||||||
highlight_lang: true # show the code language
|
highlight_lang: true # show the code language
|
||||||
highlight_shrink: true # true: shrink the code blocks / false: expand the code blocks | none: expand code blocks and hide the button
|
highlight_shrink: none # true: shrink the code blocks / false: expand the code blocks | none: expand code blocks and hide the button
|
||||||
highlight_height_limit: false # unit: px
|
highlight_height_limit: false # unit: px
|
||||||
code_word_wrap: false
|
code_word_wrap: false
|
||||||
|
|
||||||
@@ -51,31 +51,31 @@ avatar:
|
|||||||
disable_top_img: false
|
disable_top_img: false
|
||||||
|
|
||||||
# The banner image of home page
|
# The banner image of home page
|
||||||
index_img:
|
index_img: /img/site01.jpg
|
||||||
|
|
||||||
# If the banner of page not setting, it will show the top_img
|
# If the banner of page not setting, it will show the top_img
|
||||||
default_top_img:
|
default_top_img: /img/site01.jpg
|
||||||
|
|
||||||
# The banner image of archive page
|
# The banner image of archive page
|
||||||
archive_img:
|
archive_img: /img/site01.jpg
|
||||||
|
|
||||||
# If the banner of tag page not setting, it will show the top_img
|
# If the banner of tag page not setting, it will show the top_img
|
||||||
# note: tag page, not tags page (子標籤頁面的 top_img)
|
# note: tag page, not tags page (子標籤頁面的 top_img)
|
||||||
tag_img:
|
tag_img: /img/site01.jpg
|
||||||
|
|
||||||
# The banner image of tag page
|
# The banner image of tag page
|
||||||
# format:
|
# format:
|
||||||
# - tag name: xxxxx
|
# - tag name: xxxxx
|
||||||
tag_per_img:
|
tag_per_img: /img/site01.jpg
|
||||||
|
|
||||||
# If the banner of category page not setting, it will show the top_img
|
# If the banner of category page not setting, it will show the top_img
|
||||||
# note: category page, not categories page (子分類頁面的 top_img)
|
# note: category page, not categories page (子分類頁面的 top_img)
|
||||||
category_img:
|
category_img: /img/site01.jpg
|
||||||
|
|
||||||
# The banner image of category page
|
# The banner image of category page
|
||||||
# format:
|
# format:
|
||||||
# - category name: xxxxx
|
# - category name: xxxxx
|
||||||
category_per_img:
|
category_per_img: /img/site01.jpg
|
||||||
|
|
||||||
cover:
|
cover:
|
||||||
# display the cover or not (是否顯示文章封面)
|
# display the cover or not (是否顯示文章封面)
|
||||||
@@ -86,8 +86,8 @@ cover:
|
|||||||
# left/right/both
|
# left/right/both
|
||||||
position: both
|
position: both
|
||||||
# When cover is not set, the default cover is displayed (當沒有設置cover時,默認的封面顯示)
|
# When cover is not set, the default cover is displayed (當沒有設置cover時,默認的封面顯示)
|
||||||
default_cover:
|
# default_cover:
|
||||||
- https://i.loli.net/2020/05/01/gkihqEjXxJ5UZ1C.jpg
|
# - https://i.loli.net/2020/05/01/gkihqEjXxJ5UZ1C.jpg
|
||||||
|
|
||||||
# Replace Broken Images (替換無法顯示的圖片)
|
# Replace Broken Images (替換無法顯示的圖片)
|
||||||
error_img:
|
error_img:
|
||||||
@@ -96,7 +96,7 @@ error_img:
|
|||||||
|
|
||||||
# A simple 404 page
|
# A simple 404 page
|
||||||
error_404:
|
error_404:
|
||||||
enable: true
|
enable: false
|
||||||
subtitle: 'Page Not Found'
|
subtitle: 'Page Not Found'
|
||||||
background: https://i.loli.net/2020/05/19/aKOcLiyPl2JQdFD.png
|
background: https://i.loli.net/2020/05/19/aKOcLiyPl2JQdFD.png
|
||||||
|
|
||||||
@@ -208,7 +208,7 @@ footer:
|
|||||||
owner:
|
owner:
|
||||||
enable: true
|
enable: true
|
||||||
since: 2024
|
since: 2024
|
||||||
custom_text: <span>备案号:豫ICP备2023019300号</span>
|
custom_text: <a href="https://beian.miit.gov.cn/#/Integrated/recordQuery"><img class="icp-icon" src="https://beian.mps.gov.cn/img/logo01.dd7ff50e.png"><span>备案号:豫ICP备2023019300号</span></a>
|
||||||
|
|
||||||
# aside (側邊欄)
|
# aside (側邊欄)
|
||||||
# --------------------------------------
|
# --------------------------------------
|
||||||
@@ -344,7 +344,7 @@ rightside_item_order:
|
|||||||
|
|
||||||
# MathJax
|
# MathJax
|
||||||
mathjax:
|
mathjax:
|
||||||
enable: false
|
enable: true
|
||||||
per_page: false
|
per_page: false
|
||||||
|
|
||||||
# KaTeX
|
# KaTeX
|
||||||
@@ -365,13 +365,13 @@ algolia_search:
|
|||||||
|
|
||||||
# Local search
|
# Local search
|
||||||
local_search:
|
local_search:
|
||||||
enable: false
|
enable: true
|
||||||
# Preload the search data when the page loads.
|
# Preload the search data when the page loads.
|
||||||
preload: false
|
preload: false
|
||||||
# Show top n results per article, show all results by setting to -1
|
# Show top n results per article, show all results by setting to -1
|
||||||
top_n_per_article: 1
|
top_n_per_article: 1
|
||||||
# Unescape html strings to the readable one.
|
# Unescape html strings to the readable one.
|
||||||
unescape: false
|
unescape: true
|
||||||
CDN:
|
CDN:
|
||||||
|
|
||||||
# Docsearch
|
# Docsearch
|
||||||
@@ -641,10 +641,10 @@ text_align_justify: false
|
|||||||
# Website Background (設置網站背景)
|
# Website Background (設置網站背景)
|
||||||
# can set it to color or image (可設置圖片 或者 顔色)
|
# can set it to color or image (可設置圖片 或者 顔色)
|
||||||
# The formal of image: url(http://xxxxxx.com/xxx.jpg)
|
# The formal of image: url(http://xxxxxx.com/xxx.jpg)
|
||||||
background:
|
#background: /img/site01.jpg
|
||||||
|
background: url(https://file.shenjianl.cn/assets/site.jpg)
|
||||||
# Footer Background
|
# Footer Background
|
||||||
footer_bg: false
|
footer_bg: transparent
|
||||||
|
|
||||||
# Add mask to header or footer (为 header 或 footer 添加黑色半透遮罩)
|
# Add mask to header or footer (为 header 或 footer 添加黑色半透遮罩)
|
||||||
mask:
|
mask:
|
||||||
@@ -660,7 +660,7 @@ enter_transitions: true
|
|||||||
# Typewriter Effect (打字效果)
|
# Typewriter Effect (打字效果)
|
||||||
# https://github.com/disjukr/activate-power-mode
|
# https://github.com/disjukr/activate-power-mode
|
||||||
activate_power_mode:
|
activate_power_mode:
|
||||||
enable: false
|
enable: true
|
||||||
colorful: true # open particle animation (冒光特效)
|
colorful: true # open particle animation (冒光特效)
|
||||||
shake: true # open shake (抖動特效)
|
shake: true # open shake (抖動特效)
|
||||||
mobile: false
|
mobile: false
|
||||||
@@ -721,10 +721,10 @@ display_mode: light
|
|||||||
|
|
||||||
# Beautify (美化頁面顯示)
|
# Beautify (美化頁面顯示)
|
||||||
beautify:
|
beautify:
|
||||||
enable: false
|
enable: true
|
||||||
field: post # site/post
|
field: post # site/post
|
||||||
title-prefix-icon: # '\f0c1'
|
title-prefix-icon: '\f0c1'
|
||||||
title-prefix-icon-color: # '#F47466'
|
title-prefix-icon-color: '#F47466'
|
||||||
|
|
||||||
# Global font settings
|
# Global font settings
|
||||||
# Don't modify the following settings unless you know how they work (非必要不要修改)
|
# Don't modify the following settings unless you know how they work (非必要不要修改)
|
||||||
@@ -748,7 +748,7 @@ hr_icon:
|
|||||||
|
|
||||||
# the subtitle on homepage (主頁subtitle)
|
# the subtitle on homepage (主頁subtitle)
|
||||||
subtitle:
|
subtitle:
|
||||||
enable: false
|
enable: true
|
||||||
# Typewriter Effect (打字效果)
|
# Typewriter Effect (打字效果)
|
||||||
effect: true
|
effect: true
|
||||||
# Customize typed.js (配置typed.js)
|
# Customize typed.js (配置typed.js)
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
# Site
|
# Site
|
||||||
title: QuickReference
|
title: QuickReference
|
||||||
subtitle: '实用知识文档'
|
subtitle: '一份快捷简便的知识文档,查阅编程的细节'
|
||||||
description: '一份快捷简便的文档,便于查阅编程的细节'
|
description: '一份快捷简便的文档,便于查阅编程的细节'
|
||||||
keywords: doucment
|
keywords: doucment
|
||||||
author: shenjianZ
|
author: shenjianZ
|
||||||
@@ -13,8 +13,8 @@ timezone: 'Asia/Shanghai'
|
|||||||
|
|
||||||
# URL
|
# URL
|
||||||
## Set your site url here. For example, if you use GitHub Page, set url as 'https://username.github.io/project'
|
## Set your site url here. For example, if you use GitHub Page, set url as 'https://username.github.io/project'
|
||||||
url: http://rq.shenjianl.cn
|
url: https://rq.shenjianl.cn
|
||||||
permalink: :year/:month/:day/:title/
|
permalink: posts/:abbrlink.html
|
||||||
permalink_defaults:
|
permalink_defaults:
|
||||||
pretty_urls:
|
pretty_urls:
|
||||||
trailing_index: true # Set to false to remove trailing 'index.md' from permalinks
|
trailing_index: true # Set to false to remove trailing 'index.md' from permalinks
|
||||||
|
|||||||
301
package-lock.json
generated
@@ -8,10 +8,13 @@
|
|||||||
"name": "hexo-site",
|
"name": "hexo-site",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"activate-power-mode": "^1.0.0",
|
||||||
"hexo": "^7.0.0",
|
"hexo": "^7.0.0",
|
||||||
|
"hexo-abbrlink": "^2.2.1",
|
||||||
"hexo-generator-archive": "^2.0.0",
|
"hexo-generator-archive": "^2.0.0",
|
||||||
"hexo-generator-category": "^2.0.0",
|
"hexo-generator-category": "^2.0.0",
|
||||||
"hexo-generator-index": "^3.0.0",
|
"hexo-generator-index": "^3.0.0",
|
||||||
|
"hexo-generator-searchdb": "^1.4.1",
|
||||||
"hexo-generator-tag": "^2.0.0",
|
"hexo-generator-tag": "^2.0.0",
|
||||||
"hexo-renderer-ejs": "^2.0.0",
|
"hexo-renderer-ejs": "^2.0.0",
|
||||||
"hexo-renderer-marked": "^6.0.0",
|
"hexo-renderer-marked": "^6.0.0",
|
||||||
@@ -137,6 +140,11 @@
|
|||||||
"node": ">=0.4.0"
|
"node": ">=0.4.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/activate-power-mode": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmmirror.com/activate-power-mode/-/activate-power-mode-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-6AP7cCp5Ff7VaUKY805re11AlFg6ePInGlqq88v24Y5PvFl+6sD+WNiIZX8Uu35b8ZS9VyyTXP3znxuZ6EixGQ=="
|
||||||
|
},
|
||||||
"node_modules/agent-base": {
|
"node_modules/agent-base": {
|
||||||
"version": "6.0.2",
|
"version": "6.0.2",
|
||||||
"resolved": "https://registry.npmmirror.com/agent-base/-/agent-base-6.0.2.tgz",
|
"resolved": "https://registry.npmmirror.com/agent-base/-/agent-base-6.0.2.tgz",
|
||||||
@@ -1066,6 +1074,160 @@
|
|||||||
"url": "https://opencollective.com/hexo"
|
"url": "https://opencollective.com/hexo"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/hexo-abbrlink": {
|
||||||
|
"version": "2.2.1",
|
||||||
|
"resolved": "https://registry.npmmirror.com/hexo-abbrlink/-/hexo-abbrlink-2.2.1.tgz",
|
||||||
|
"integrity": "sha512-yvazN7bbrIb7p8QU3nJ/8fbDmir1mFroYvUYcJz5xpc6DtszKggschmqZg6WNUdjhDBFyDwksrIUfwQnw0OOuA==",
|
||||||
|
"dependencies": {
|
||||||
|
"hexo-front-matter": "^1.0.0",
|
||||||
|
"hexo-fs": "^3.1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/hexo-abbrlink/node_modules/argparse": {
|
||||||
|
"version": "1.0.10",
|
||||||
|
"resolved": "https://registry.npmmirror.com/argparse/-/argparse-1.0.10.tgz",
|
||||||
|
"integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
|
||||||
|
"dependencies": {
|
||||||
|
"sprintf-js": "~1.0.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/hexo-abbrlink/node_modules/dom-serializer": {
|
||||||
|
"version": "1.4.1",
|
||||||
|
"resolved": "https://registry.npmmirror.com/dom-serializer/-/dom-serializer-1.4.1.tgz",
|
||||||
|
"integrity": "sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==",
|
||||||
|
"dependencies": {
|
||||||
|
"domelementtype": "^2.0.1",
|
||||||
|
"domhandler": "^4.2.0",
|
||||||
|
"entities": "^2.0.0"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/cheeriojs/dom-serializer?sponsor=1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/hexo-abbrlink/node_modules/dom-serializer/node_modules/entities": {
|
||||||
|
"version": "2.2.0",
|
||||||
|
"resolved": "https://registry.npmmirror.com/entities/-/entities-2.2.0.tgz",
|
||||||
|
"integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==",
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/fb55/entities?sponsor=1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/hexo-abbrlink/node_modules/domhandler": {
|
||||||
|
"version": "4.3.1",
|
||||||
|
"resolved": "https://registry.npmmirror.com/domhandler/-/domhandler-4.3.1.tgz",
|
||||||
|
"integrity": "sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"domelementtype": "^2.2.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 4"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/fb55/domhandler?sponsor=1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/hexo-abbrlink/node_modules/domutils": {
|
||||||
|
"version": "2.8.0",
|
||||||
|
"resolved": "https://registry.npmmirror.com/domutils/-/domutils-2.8.0.tgz",
|
||||||
|
"integrity": "sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==",
|
||||||
|
"dependencies": {
|
||||||
|
"dom-serializer": "^1.0.1",
|
||||||
|
"domelementtype": "^2.2.0",
|
||||||
|
"domhandler": "^4.2.0"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/fb55/domutils?sponsor=1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/hexo-abbrlink/node_modules/entities": {
|
||||||
|
"version": "3.0.1",
|
||||||
|
"resolved": "https://registry.npmmirror.com/entities/-/entities-3.0.1.tgz",
|
||||||
|
"integrity": "sha512-WiyBqoomrwMdFG1e0kqvASYfnlb0lp8M5o5Fw2OFq1hNZxxcNk8Ik0Xm7LxzBhuidnZB/UtBqVCgUz3kBOP51Q==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.12"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/fb55/entities?sponsor=1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/hexo-abbrlink/node_modules/hexo-front-matter": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmmirror.com/hexo-front-matter/-/hexo-front-matter-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-Hn8IIzgWWnxYTekrjnA0rxwWMoQHifyrxKMqVibmFaRKf4AQ2V6Xo13Jiso6CDwYfS+OdA41QS5DG1Y+QXA5gw==",
|
||||||
|
"dependencies": {
|
||||||
|
"js-yaml": "^3.13.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8.6.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/hexo-abbrlink/node_modules/hexo-fs": {
|
||||||
|
"version": "3.1.0",
|
||||||
|
"resolved": "https://registry.npmmirror.com/hexo-fs/-/hexo-fs-3.1.0.tgz",
|
||||||
|
"integrity": "sha512-SfoDH7zlU9Iop+bAfEONXezbNIkpVX1QqjNCBYpapilZR+xVOCfTEdlNixanrKBbLGPb2fXqrdDBFgrKuiVGQQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"bluebird": "^3.5.1",
|
||||||
|
"chokidar": "^3.0.0",
|
||||||
|
"graceful-fs": "^4.1.11",
|
||||||
|
"hexo-util": "^2.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10.13.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/hexo-abbrlink/node_modules/hexo-util": {
|
||||||
|
"version": "2.7.0",
|
||||||
|
"resolved": "https://registry.npmmirror.com/hexo-util/-/hexo-util-2.7.0.tgz",
|
||||||
|
"integrity": "sha512-hQM3h34nhDg0bSe/Tg1lnpODvNkz7h2u0+lZGzlKL0Oufp+5KCAEUX9wal7/xC7ax3/cwEn8IuoU75kNpZLpJQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"bluebird": "^3.5.2",
|
||||||
|
"camel-case": "^4.0.0",
|
||||||
|
"cross-spawn": "^7.0.0",
|
||||||
|
"deepmerge": "^4.2.2",
|
||||||
|
"highlight.js": "^11.0.1",
|
||||||
|
"htmlparser2": "^7.0.0",
|
||||||
|
"prismjs": "^1.17.1",
|
||||||
|
"strip-indent": "^3.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12.4.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/hexo-abbrlink/node_modules/htmlparser2": {
|
||||||
|
"version": "7.2.0",
|
||||||
|
"resolved": "https://registry.npmmirror.com/htmlparser2/-/htmlparser2-7.2.0.tgz",
|
||||||
|
"integrity": "sha512-H7MImA4MS6cw7nbyURtLPO1Tms7C5H602LRETv95z1MxO/7CP7rDVROehUYeYBUYEON94NXXDEPmZuq+hX4sog==",
|
||||||
|
"funding": [
|
||||||
|
"https://github.com/fb55/htmlparser2?sponsor=1",
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/fb55"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"dependencies": {
|
||||||
|
"domelementtype": "^2.0.1",
|
||||||
|
"domhandler": "^4.2.2",
|
||||||
|
"domutils": "^2.8.0",
|
||||||
|
"entities": "^3.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/hexo-abbrlink/node_modules/js-yaml": {
|
||||||
|
"version": "3.14.1",
|
||||||
|
"resolved": "https://registry.npmmirror.com/js-yaml/-/js-yaml-3.14.1.tgz",
|
||||||
|
"integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==",
|
||||||
|
"dependencies": {
|
||||||
|
"argparse": "^1.0.7",
|
||||||
|
"esprima": "^4.0.0"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"js-yaml": "bin/js-yaml.js"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/hexo-abbrlink/node_modules/sprintf-js": {
|
||||||
|
"version": "1.0.3",
|
||||||
|
"resolved": "https://registry.npmmirror.com/sprintf-js/-/sprintf-js-1.0.3.tgz",
|
||||||
|
"integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g=="
|
||||||
|
},
|
||||||
"node_modules/hexo-cli": {
|
"node_modules/hexo-cli": {
|
||||||
"version": "4.3.2",
|
"version": "4.3.2",
|
||||||
"resolved": "https://registry.npmmirror.com/hexo-cli/-/hexo-cli-4.3.2.tgz",
|
"resolved": "https://registry.npmmirror.com/hexo-cli/-/hexo-cli-4.3.2.tgz",
|
||||||
@@ -1147,6 +1309,14 @@
|
|||||||
"node": ">=14"
|
"node": ">=14"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/hexo-generator-searchdb": {
|
||||||
|
"version": "1.4.1",
|
||||||
|
"resolved": "https://registry.npmmirror.com/hexo-generator-searchdb/-/hexo-generator-searchdb-1.4.1.tgz",
|
||||||
|
"integrity": "sha512-7m8IBpZbI6iKb2jRYxs4pghD6Ln8ylQSRGl6MIC4G9wws21vYSXSD8rvC3MoCO+pWBHs6E/mTA/rjG+p2AZfVg==",
|
||||||
|
"dependencies": {
|
||||||
|
"nunjucks": "^3.2.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/hexo-generator-tag": {
|
"node_modules/hexo-generator-tag": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmmirror.com/hexo-generator-tag/-/hexo-generator-tag-2.0.0.tgz",
|
"resolved": "https://registry.npmmirror.com/hexo-generator-tag/-/hexo-generator-tag-2.0.0.tgz",
|
||||||
@@ -2869,6 +3039,11 @@
|
|||||||
"acorn": "^8.11.0"
|
"acorn": "^8.11.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"activate-power-mode": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmmirror.com/activate-power-mode/-/activate-power-mode-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-6AP7cCp5Ff7VaUKY805re11AlFg6ePInGlqq88v24Y5PvFl+6sD+WNiIZX8Uu35b8ZS9VyyTXP3znxuZ6EixGQ=="
|
||||||
|
},
|
||||||
"agent-base": {
|
"agent-base": {
|
||||||
"version": "6.0.2",
|
"version": "6.0.2",
|
||||||
"resolved": "https://registry.npmmirror.com/agent-base/-/agent-base-6.0.2.tgz",
|
"resolved": "https://registry.npmmirror.com/agent-base/-/agent-base-6.0.2.tgz",
|
||||||
@@ -3544,6 +3719,124 @@
|
|||||||
"warehouse": "^5.0.1"
|
"warehouse": "^5.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"hexo-abbrlink": {
|
||||||
|
"version": "2.2.1",
|
||||||
|
"resolved": "https://registry.npmmirror.com/hexo-abbrlink/-/hexo-abbrlink-2.2.1.tgz",
|
||||||
|
"integrity": "sha512-yvazN7bbrIb7p8QU3nJ/8fbDmir1mFroYvUYcJz5xpc6DtszKggschmqZg6WNUdjhDBFyDwksrIUfwQnw0OOuA==",
|
||||||
|
"requires": {
|
||||||
|
"hexo-front-matter": "^1.0.0",
|
||||||
|
"hexo-fs": "^3.1.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"argparse": {
|
||||||
|
"version": "1.0.10",
|
||||||
|
"resolved": "https://registry.npmmirror.com/argparse/-/argparse-1.0.10.tgz",
|
||||||
|
"integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
|
||||||
|
"requires": {
|
||||||
|
"sprintf-js": "~1.0.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"dom-serializer": {
|
||||||
|
"version": "1.4.1",
|
||||||
|
"resolved": "https://registry.npmmirror.com/dom-serializer/-/dom-serializer-1.4.1.tgz",
|
||||||
|
"integrity": "sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==",
|
||||||
|
"requires": {
|
||||||
|
"domelementtype": "^2.0.1",
|
||||||
|
"domhandler": "^4.2.0",
|
||||||
|
"entities": "^2.0.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"entities": {
|
||||||
|
"version": "2.2.0",
|
||||||
|
"resolved": "https://registry.npmmirror.com/entities/-/entities-2.2.0.tgz",
|
||||||
|
"integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A=="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"domhandler": {
|
||||||
|
"version": "4.3.1",
|
||||||
|
"resolved": "https://registry.npmmirror.com/domhandler/-/domhandler-4.3.1.tgz",
|
||||||
|
"integrity": "sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==",
|
||||||
|
"requires": {
|
||||||
|
"domelementtype": "^2.2.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"domutils": {
|
||||||
|
"version": "2.8.0",
|
||||||
|
"resolved": "https://registry.npmmirror.com/domutils/-/domutils-2.8.0.tgz",
|
||||||
|
"integrity": "sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==",
|
||||||
|
"requires": {
|
||||||
|
"dom-serializer": "^1.0.1",
|
||||||
|
"domelementtype": "^2.2.0",
|
||||||
|
"domhandler": "^4.2.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"entities": {
|
||||||
|
"version": "3.0.1",
|
||||||
|
"resolved": "https://registry.npmmirror.com/entities/-/entities-3.0.1.tgz",
|
||||||
|
"integrity": "sha512-WiyBqoomrwMdFG1e0kqvASYfnlb0lp8M5o5Fw2OFq1hNZxxcNk8Ik0Xm7LxzBhuidnZB/UtBqVCgUz3kBOP51Q=="
|
||||||
|
},
|
||||||
|
"hexo-front-matter": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmmirror.com/hexo-front-matter/-/hexo-front-matter-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-Hn8IIzgWWnxYTekrjnA0rxwWMoQHifyrxKMqVibmFaRKf4AQ2V6Xo13Jiso6CDwYfS+OdA41QS5DG1Y+QXA5gw==",
|
||||||
|
"requires": {
|
||||||
|
"js-yaml": "^3.13.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"hexo-fs": {
|
||||||
|
"version": "3.1.0",
|
||||||
|
"resolved": "https://registry.npmmirror.com/hexo-fs/-/hexo-fs-3.1.0.tgz",
|
||||||
|
"integrity": "sha512-SfoDH7zlU9Iop+bAfEONXezbNIkpVX1QqjNCBYpapilZR+xVOCfTEdlNixanrKBbLGPb2fXqrdDBFgrKuiVGQQ==",
|
||||||
|
"requires": {
|
||||||
|
"bluebird": "^3.5.1",
|
||||||
|
"chokidar": "^3.0.0",
|
||||||
|
"graceful-fs": "^4.1.11",
|
||||||
|
"hexo-util": "^2.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"hexo-util": {
|
||||||
|
"version": "2.7.0",
|
||||||
|
"resolved": "https://registry.npmmirror.com/hexo-util/-/hexo-util-2.7.0.tgz",
|
||||||
|
"integrity": "sha512-hQM3h34nhDg0bSe/Tg1lnpODvNkz7h2u0+lZGzlKL0Oufp+5KCAEUX9wal7/xC7ax3/cwEn8IuoU75kNpZLpJQ==",
|
||||||
|
"requires": {
|
||||||
|
"bluebird": "^3.5.2",
|
||||||
|
"camel-case": "^4.0.0",
|
||||||
|
"cross-spawn": "^7.0.0",
|
||||||
|
"deepmerge": "^4.2.2",
|
||||||
|
"highlight.js": "^11.0.1",
|
||||||
|
"htmlparser2": "^7.0.0",
|
||||||
|
"prismjs": "^1.17.1",
|
||||||
|
"strip-indent": "^3.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"htmlparser2": {
|
||||||
|
"version": "7.2.0",
|
||||||
|
"resolved": "https://registry.npmmirror.com/htmlparser2/-/htmlparser2-7.2.0.tgz",
|
||||||
|
"integrity": "sha512-H7MImA4MS6cw7nbyURtLPO1Tms7C5H602LRETv95z1MxO/7CP7rDVROehUYeYBUYEON94NXXDEPmZuq+hX4sog==",
|
||||||
|
"requires": {
|
||||||
|
"domelementtype": "^2.0.1",
|
||||||
|
"domhandler": "^4.2.2",
|
||||||
|
"domutils": "^2.8.0",
|
||||||
|
"entities": "^3.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"js-yaml": {
|
||||||
|
"version": "3.14.1",
|
||||||
|
"resolved": "https://registry.npmmirror.com/js-yaml/-/js-yaml-3.14.1.tgz",
|
||||||
|
"integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==",
|
||||||
|
"requires": {
|
||||||
|
"argparse": "^1.0.7",
|
||||||
|
"esprima": "^4.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sprintf-js": {
|
||||||
|
"version": "1.0.3",
|
||||||
|
"resolved": "https://registry.npmmirror.com/sprintf-js/-/sprintf-js-1.0.3.tgz",
|
||||||
|
"integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g=="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"hexo-cli": {
|
"hexo-cli": {
|
||||||
"version": "4.3.2",
|
"version": "4.3.2",
|
||||||
"resolved": "https://registry.npmmirror.com/hexo-cli/-/hexo-cli-4.3.2.tgz",
|
"resolved": "https://registry.npmmirror.com/hexo-cli/-/hexo-cli-4.3.2.tgz",
|
||||||
@@ -3604,6 +3897,14 @@
|
|||||||
"hexo-pagination": "3.0.0"
|
"hexo-pagination": "3.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"hexo-generator-searchdb": {
|
||||||
|
"version": "1.4.1",
|
||||||
|
"resolved": "https://registry.npmmirror.com/hexo-generator-searchdb/-/hexo-generator-searchdb-1.4.1.tgz",
|
||||||
|
"integrity": "sha512-7m8IBpZbI6iKb2jRYxs4pghD6Ln8ylQSRGl6MIC4G9wws21vYSXSD8rvC3MoCO+pWBHs6E/mTA/rjG+p2AZfVg==",
|
||||||
|
"requires": {
|
||||||
|
"nunjucks": "^3.2.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
"hexo-generator-tag": {
|
"hexo-generator-tag": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmmirror.com/hexo-generator-tag/-/hexo-generator-tag-2.0.0.tgz",
|
"resolved": "https://registry.npmmirror.com/hexo-generator-tag/-/hexo-generator-tag-2.0.0.tgz",
|
||||||
|
|||||||
@@ -3,19 +3,22 @@
|
|||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "hexo generate",
|
"build": "hexo clean && hexo generate",
|
||||||
"clean": "hexo clean",
|
"clean": "hexo clean",
|
||||||
"deploy": "hexo deploy",
|
"deploy": "hexo deploy",
|
||||||
"server": "hexo server"
|
"dev": "hexo server"
|
||||||
},
|
},
|
||||||
"hexo": {
|
"hexo": {
|
||||||
"version": "7.3.0"
|
"version": "7.3.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"activate-power-mode": "^1.0.0",
|
||||||
"hexo": "^7.0.0",
|
"hexo": "^7.0.0",
|
||||||
|
"hexo-abbrlink": "^2.2.1",
|
||||||
"hexo-generator-archive": "^2.0.0",
|
"hexo-generator-archive": "^2.0.0",
|
||||||
"hexo-generator-category": "^2.0.0",
|
"hexo-generator-category": "^2.0.0",
|
||||||
"hexo-generator-index": "^3.0.0",
|
"hexo-generator-index": "^3.0.0",
|
||||||
|
"hexo-generator-searchdb": "^1.4.1",
|
||||||
"hexo-generator-tag": "^2.0.0",
|
"hexo-generator-tag": "^2.0.0",
|
||||||
"hexo-renderer-ejs": "^2.0.0",
|
"hexo-renderer-ejs": "^2.0.0",
|
||||||
"hexo-renderer-marked": "^6.0.0",
|
"hexo-renderer-marked": "^6.0.0",
|
||||||
|
|||||||
154
public/404.html
@@ -1,154 +0,0 @@
|
|||||||
<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0,viewport-fit=cover"><title>页面没有找到 | QuickReference</title><meta name="author" content="shenjianZ"><meta name="copyright" content="shenjianZ"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="一份快捷简便的文档,便于查阅编程的细节">
|
|
||||||
<meta property="og:type" content="website">
|
|
||||||
<meta property="og:title" content="QuickReference">
|
|
||||||
<meta property="og:url" content="http://rq.shenjianl.cn/404.html">
|
|
||||||
<meta property="og:site_name" content="QuickReference">
|
|
||||||
<meta property="og:description" content="一份快捷简便的文档,便于查阅编程的细节">
|
|
||||||
<meta property="og:locale" content="zh_CN">
|
|
||||||
<meta property="og:image" content="http://rq.shenjianl.cn/img/avatar.jpg">
|
|
||||||
<meta property="article:author" content="shenjianZ">
|
|
||||||
<meta property="article:tag" content="doucment">
|
|
||||||
<meta name="twitter:card" content="summary">
|
|
||||||
<meta name="twitter:image" content="http://rq.shenjianl.cn/img/avatar.jpg"><link rel="shortcut icon" href="/img/favicon.png"><link rel="canonical" href="http://rq.shenjianl.cn/404.html"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css?v=4.13.0"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.5.1/css/all.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui@5.0.33/dist/fancybox/fancybox.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = {
|
|
||||||
root: '/',
|
|
||||||
algolia: undefined,
|
|
||||||
localSearch: undefined,
|
|
||||||
translate: undefined,
|
|
||||||
noticeOutdate: undefined,
|
|
||||||
highlight: {"plugin":"highlight.js","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
|
|
||||||
copy: {
|
|
||||||
success: '复制成功',
|
|
||||||
error: '复制错误',
|
|
||||||
noSupport: '浏览器不支持'
|
|
||||||
},
|
|
||||||
relativeDate: {
|
|
||||||
homepage: false,
|
|
||||||
post: false
|
|
||||||
},
|
|
||||||
runtime: '天',
|
|
||||||
dateSuffix: {
|
|
||||||
just: '刚刚',
|
|
||||||
min: '分钟前',
|
|
||||||
hour: '小时前',
|
|
||||||
day: '天前',
|
|
||||||
month: '个月前'
|
|
||||||
},
|
|
||||||
copyright: undefined,
|
|
||||||
lightbox: 'fancybox',
|
|
||||||
Snackbar: undefined,
|
|
||||||
infinitegrid: {
|
|
||||||
js: 'https://cdn.jsdelivr.net/npm/@egjs/infinitegrid@4.11.1/dist/infinitegrid.min.js',
|
|
||||||
buttonText: '加载更多'
|
|
||||||
},
|
|
||||||
isPhotoFigcaption: false,
|
|
||||||
islazyload: false,
|
|
||||||
isAnchor: false,
|
|
||||||
percent: {
|
|
||||||
toc: true,
|
|
||||||
rightside: false,
|
|
||||||
},
|
|
||||||
autoDarkmode: false
|
|
||||||
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
|
|
||||||
title: '页面没有找到',
|
|
||||||
isPost: false,
|
|
||||||
isHome: false,
|
|
||||||
isHighlightShrink: true,
|
|
||||||
isToc: false,
|
|
||||||
postUpdate: '2024-08-01 08:43:54'
|
|
||||||
}</script><script>(win=>{
|
|
||||||
win.saveToLocal = {
|
|
||||||
set: (key, value, ttl) => {
|
|
||||||
if (ttl === 0) return
|
|
||||||
const now = Date.now()
|
|
||||||
const expiry = now + ttl * 86400000
|
|
||||||
const item = {
|
|
||||||
value,
|
|
||||||
expiry
|
|
||||||
}
|
|
||||||
localStorage.setItem(key, JSON.stringify(item))
|
|
||||||
},
|
|
||||||
|
|
||||||
get: key => {
|
|
||||||
const itemStr = localStorage.getItem(key)
|
|
||||||
|
|
||||||
if (!itemStr) {
|
|
||||||
return undefined
|
|
||||||
}
|
|
||||||
const item = JSON.parse(itemStr)
|
|
||||||
const now = Date.now()
|
|
||||||
|
|
||||||
if (now > item.expiry) {
|
|
||||||
localStorage.removeItem(key)
|
|
||||||
return undefined
|
|
||||||
}
|
|
||||||
return item.value
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
win.getScript = (url, attr = {}) => new Promise((resolve, reject) => {
|
|
||||||
const script = document.createElement('script')
|
|
||||||
script.src = url
|
|
||||||
script.async = true
|
|
||||||
script.onerror = reject
|
|
||||||
script.onload = script.onreadystatechange = function() {
|
|
||||||
const loadState = this.readyState
|
|
||||||
if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
|
|
||||||
script.onload = script.onreadystatechange = null
|
|
||||||
resolve()
|
|
||||||
}
|
|
||||||
|
|
||||||
Object.keys(attr).forEach(key => {
|
|
||||||
script.setAttribute(key, attr[key])
|
|
||||||
})
|
|
||||||
|
|
||||||
document.head.appendChild(script)
|
|
||||||
})
|
|
||||||
|
|
||||||
win.getCSS = (url, id = false) => new Promise((resolve, reject) => {
|
|
||||||
const link = document.createElement('link')
|
|
||||||
link.rel = 'stylesheet'
|
|
||||||
link.href = url
|
|
||||||
if (id) link.id = id
|
|
||||||
link.onerror = reject
|
|
||||||
link.onload = link.onreadystatechange = function() {
|
|
||||||
const loadState = this.readyState
|
|
||||||
if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
|
|
||||||
link.onload = link.onreadystatechange = null
|
|
||||||
resolve()
|
|
||||||
}
|
|
||||||
document.head.appendChild(link)
|
|
||||||
})
|
|
||||||
|
|
||||||
win.activateDarkMode = () => {
|
|
||||||
document.documentElement.setAttribute('data-theme', 'dark')
|
|
||||||
if (document.querySelector('meta[name="theme-color"]') !== null) {
|
|
||||||
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
win.activateLightMode = () => {
|
|
||||||
document.documentElement.setAttribute('data-theme', 'light')
|
|
||||||
if (document.querySelector('meta[name="theme-color"]') !== null) {
|
|
||||||
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const t = saveToLocal.get('theme')
|
|
||||||
|
|
||||||
if (t === 'dark') activateDarkMode()
|
|
||||||
else if (t === 'light') activateLightMode()
|
|
||||||
|
|
||||||
const asideStatus = saveToLocal.get('aside-status')
|
|
||||||
if (asideStatus !== undefined) {
|
|
||||||
if (asideStatus === 'hide') {
|
|
||||||
document.documentElement.classList.add('hide-aside')
|
|
||||||
} else {
|
|
||||||
document.documentElement.classList.remove('hide-aside')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const detectApple = () => {
|
|
||||||
if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
|
|
||||||
document.documentElement.classList.add('apple')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
detectApple()
|
|
||||||
})(window)</script><meta name="generator" content="Hexo 7.3.0"></head><body><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="/img/avatar.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">2</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">0</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">0</div></a></div><hr class="custom-hr"/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> Home</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> Archives</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> Tags</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> Categories</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> List</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> Music</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> Movie</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> Link</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> About</span></a></div></div></div></div><div class="error404" id="body-wrap"><header class="not-top-img fixed" id="page-header"><nav id="nav"><span id="blog-info"><a href="/" title="QuickReference"><span class="site-name">QuickReference</span></a></span><div id="menus"><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> Home</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> Archives</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> Tags</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> Categories</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> List</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> Music</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> Movie</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> Link</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> About</span></a></div></div><div id="toggle-menu"><a class="site-page" href="javascript:void(0);"><i class="fas fa-bars fa-fw"></i></a></div></div></nav></header><div id="error-wrap"><div class="error-content"><div class="error-img"><img src="https://i.loli.net/2020/05/19/aKOcLiyPl2JQdFD.png" alt="Page not found"></div><div class="error-info"><h1 class="error_title">404</h1><div class="error_subtitle">Page Not Found</div></div></div></div></div><div id="rightside"><div id="rightside-config-hide"><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside-config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button id="go-up" type="button" title="回到顶部"><span class="scroll-percent"></span><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/js/utils.js?v=4.13.0"></script><script src="/js/main.js?v=4.13.0"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui@5.0.33/dist/fancybox/fancybox.umd.min.js"></script><div class="js-pjax"></div><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>
|
|
||||||
168
public/about/index.html
Normal file
@@ -0,0 +1,168 @@
|
|||||||
|
<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0,viewport-fit=cover"><title>About me | QuickReference</title><meta name="author" content="shenjianZ"><meta name="copyright" content="shenjianZ"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="落花飞舞,翩若惊鸿。">
|
||||||
|
<meta property="og:type" content="website">
|
||||||
|
<meta property="og:title" content="About me">
|
||||||
|
<meta property="og:url" content="https://rq.shenjianl.cn/about/index.html">
|
||||||
|
<meta property="og:site_name" content="QuickReference">
|
||||||
|
<meta property="og:description" content="落花飞舞,翩若惊鸿。">
|
||||||
|
<meta property="og:locale" content="zh_CN">
|
||||||
|
<meta property="og:image" content="https://rq.shenjianl.cn/img/avatar.jpg">
|
||||||
|
<meta property="article:published_time" content="2024-08-10T02:35:41.000Z">
|
||||||
|
<meta property="article:modified_time" content="2024-08-10T02:38:14.626Z">
|
||||||
|
<meta property="article:author" content="shenjianZ">
|
||||||
|
<meta property="article:tag" content="doucment">
|
||||||
|
<meta name="twitter:card" content="summary">
|
||||||
|
<meta name="twitter:image" content="https://rq.shenjianl.cn/img/avatar.jpg"><link rel="shortcut icon" href="/img/favicon.png"><link rel="canonical" href="https://rq.shenjianl.cn/about/index.html"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css?v=4.13.0"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.5.1/css/all.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui@5.0.33/dist/fancybox/fancybox.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = {
|
||||||
|
root: '/',
|
||||||
|
algolia: undefined,
|
||||||
|
localSearch: {"path":"/search.xml","preload":false,"top_n_per_article":1,"unescape":true,"languages":{"hits_empty":"找不到您查询的内容:${query}","hits_stats":"共找到 ${hits} 篇文章"}},
|
||||||
|
translate: undefined,
|
||||||
|
noticeOutdate: undefined,
|
||||||
|
highlight: {"plugin":"highlight.js","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
|
||||||
|
copy: {
|
||||||
|
success: '复制成功',
|
||||||
|
error: '复制错误',
|
||||||
|
noSupport: '浏览器不支持'
|
||||||
|
},
|
||||||
|
relativeDate: {
|
||||||
|
homepage: false,
|
||||||
|
post: false
|
||||||
|
},
|
||||||
|
runtime: '天',
|
||||||
|
dateSuffix: {
|
||||||
|
just: '刚刚',
|
||||||
|
min: '分钟前',
|
||||||
|
hour: '小时前',
|
||||||
|
day: '天前',
|
||||||
|
month: '个月前'
|
||||||
|
},
|
||||||
|
copyright: undefined,
|
||||||
|
lightbox: 'fancybox',
|
||||||
|
Snackbar: undefined,
|
||||||
|
infinitegrid: {
|
||||||
|
js: 'https://cdn.jsdelivr.net/npm/@egjs/infinitegrid@4.11.1/dist/infinitegrid.min.js',
|
||||||
|
buttonText: '加载更多'
|
||||||
|
},
|
||||||
|
isPhotoFigcaption: false,
|
||||||
|
islazyload: false,
|
||||||
|
isAnchor: false,
|
||||||
|
percent: {
|
||||||
|
toc: true,
|
||||||
|
rightside: false,
|
||||||
|
},
|
||||||
|
autoDarkmode: false
|
||||||
|
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
|
||||||
|
title: 'About me',
|
||||||
|
isPost: false,
|
||||||
|
isHome: false,
|
||||||
|
isHighlightShrink: undefined,
|
||||||
|
isToc: false,
|
||||||
|
postUpdate: '2024-08-10 10:38:14'
|
||||||
|
}</script><script>(win=>{
|
||||||
|
win.saveToLocal = {
|
||||||
|
set: (key, value, ttl) => {
|
||||||
|
if (ttl === 0) return
|
||||||
|
const now = Date.now()
|
||||||
|
const expiry = now + ttl * 86400000
|
||||||
|
const item = {
|
||||||
|
value,
|
||||||
|
expiry
|
||||||
|
}
|
||||||
|
localStorage.setItem(key, JSON.stringify(item))
|
||||||
|
},
|
||||||
|
|
||||||
|
get: key => {
|
||||||
|
const itemStr = localStorage.getItem(key)
|
||||||
|
|
||||||
|
if (!itemStr) {
|
||||||
|
return undefined
|
||||||
|
}
|
||||||
|
const item = JSON.parse(itemStr)
|
||||||
|
const now = Date.now()
|
||||||
|
|
||||||
|
if (now > item.expiry) {
|
||||||
|
localStorage.removeItem(key)
|
||||||
|
return undefined
|
||||||
|
}
|
||||||
|
return item.value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
win.getScript = (url, attr = {}) => new Promise((resolve, reject) => {
|
||||||
|
const script = document.createElement('script')
|
||||||
|
script.src = url
|
||||||
|
script.async = true
|
||||||
|
script.onerror = reject
|
||||||
|
script.onload = script.onreadystatechange = function() {
|
||||||
|
const loadState = this.readyState
|
||||||
|
if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
|
||||||
|
script.onload = script.onreadystatechange = null
|
||||||
|
resolve()
|
||||||
|
}
|
||||||
|
|
||||||
|
Object.keys(attr).forEach(key => {
|
||||||
|
script.setAttribute(key, attr[key])
|
||||||
|
})
|
||||||
|
|
||||||
|
document.head.appendChild(script)
|
||||||
|
})
|
||||||
|
|
||||||
|
win.getCSS = (url, id = false) => new Promise((resolve, reject) => {
|
||||||
|
const link = document.createElement('link')
|
||||||
|
link.rel = 'stylesheet'
|
||||||
|
link.href = url
|
||||||
|
if (id) link.id = id
|
||||||
|
link.onerror = reject
|
||||||
|
link.onload = link.onreadystatechange = function() {
|
||||||
|
const loadState = this.readyState
|
||||||
|
if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
|
||||||
|
link.onload = link.onreadystatechange = null
|
||||||
|
resolve()
|
||||||
|
}
|
||||||
|
document.head.appendChild(link)
|
||||||
|
})
|
||||||
|
|
||||||
|
win.activateDarkMode = () => {
|
||||||
|
document.documentElement.setAttribute('data-theme', 'dark')
|
||||||
|
if (document.querySelector('meta[name="theme-color"]') !== null) {
|
||||||
|
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
win.activateLightMode = () => {
|
||||||
|
document.documentElement.setAttribute('data-theme', 'light')
|
||||||
|
if (document.querySelector('meta[name="theme-color"]') !== null) {
|
||||||
|
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const t = saveToLocal.get('theme')
|
||||||
|
|
||||||
|
if (t === 'dark') activateDarkMode()
|
||||||
|
else if (t === 'light') activateLightMode()
|
||||||
|
|
||||||
|
const asideStatus = saveToLocal.get('aside-status')
|
||||||
|
if (asideStatus !== undefined) {
|
||||||
|
if (asideStatus === 'hide') {
|
||||||
|
document.documentElement.classList.add('hide-aside')
|
||||||
|
} else {
|
||||||
|
document.documentElement.classList.remove('hide-aside')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const detectApple = () => {
|
||||||
|
if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
|
||||||
|
document.documentElement.classList.add('apple')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
detectApple()
|
||||||
|
})(window)</script><meta name="generator" content="Hexo 7.3.0"></head><body><div id="web_bg"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="/img/avatar.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">18</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">9</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">2</div></a></div><hr class="custom-hr"/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> Home</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> Archives</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> Tags</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> Categories</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> List</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> Music</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> Movie</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> Link</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> About</span></a></div></div></div></div><div class="page" id="body-wrap"><header class="not-home-page fixed" id="page-header" style="background-image: url('/img/site01.jpg')"><nav id="nav"><span id="blog-info"><a href="/" title="QuickReference"><span class="site-name">QuickReference</span></a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search" href="javascript:void(0);"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> Home</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> Archives</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> Tags</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> Categories</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> List</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> Music</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> Movie</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> Link</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> About</span></a></div></div><div id="toggle-menu"><a class="site-page" href="javascript:void(0);"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="page-site-info"><h1 id="site-title">About me</h1></div></header><main class="layout" id="content-inner"><div id="page"><div id="article-container"><p>落花飞舞,翩若惊鸿。</p>
|
||||||
|
</div></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="/img/avatar.jpg" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">shenjianZ</div><div class="author-info__description">一份快捷简便的文档,便于查阅编程的细节</div></div><div class="card-info-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">18</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">9</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">2</div></a></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/shenjianz"><i class="fab fa-github"></i><span>Follow Me</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/shenjianZ" target="_blank" title="Github"><i class="fab fa-github" style="color: #24292e;"></i></a><a class="social-icon" href="mailto:15202078626@163.com" target="_blank" title="Email"><i class="fas fa-envelope" style="color: #4a7dbe;"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content">一个简单快捷的文档知识点查阅网站</div></div><div class="sticky_layout"><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/posts/8816.html" title="集成学习"><img src="/img/machinelearning/ensemble-learning.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="集成学习"/></a><div class="content"><a class="title" href="/posts/8816.html" title="集成学习">集成学习</a><time datetime="2025-01-25T07:12:08.000Z" title="发表于 2025-01-25 15:12:08">2025-01-25</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/95.html" title="决策树算法"><img src="/img/machinelearning/decision-tree.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="决策树算法"/></a><div class="content"><a class="title" href="/posts/95.html" title="决策树算法">决策树算法</a><time datetime="2025-01-24T04:39:59.000Z" title="发表于 2025-01-24 12:39:59">2025-01-24</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/posts/60504.html" title="逻辑回归">逻辑回归</a><time datetime="2025-01-20T07:30:08.000Z" title="发表于 2025-01-20 15:30:08">2025-01-20</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/posts/52662.html" title="线性回归">线性回归</a><time datetime="2025-01-19T08:46:51.000Z" title="发表于 2025-01-19 16:46:51">2025-01-19</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/posts/12462.html" title="C lang">C lang</a><time datetime="2025-01-15T12:41:26.000Z" title="发表于 2025-01-15 20:41:26">2025-01-15</time></div></div></div></div><div class="card-widget card-categories"><div class="item-headline">
|
||||||
|
<i class="fas fa-folder-open"></i>
|
||||||
|
<span>分类</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<ul class="card-category-list" id="aside-cat-list">
|
||||||
|
<li class="card-category-list-item "><a class="card-category-list-link" href="/categories/machinelearning/"><span class="card-category-list-name">machinelearning</span><span class="card-category-list-count">5</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E5%8F%A4%E6%96%87%E8%A7%82%E6%AD%A2/"><span class="card-category-list-name">古文观止</span><span class="card-category-list-count">1</span></a></li>
|
||||||
|
</ul></div><div class="card-widget card-tags"><div class="item-headline"><i class="fas fa-tags"></i><span>标签</span></div><div class="card-tag-cloud"><a href="/tags/linear-regression/" style="font-size: 1.1em; color: #999">linear-regression</a> <a href="/tags/KNN/" style="font-size: 1.1em; color: #999">KNN</a> <a href="/tags/logistic-regression/" style="font-size: 1.1em; color: #999">logistic-regression</a> <a href="/tags/%E5%8F%A4%E6%96%87%E8%A7%82%E6%AD%A2/" style="font-size: 1.1em; color: #999">古文观止</a> <a href="/tags/decisiontree/" style="font-size: 1.1em; color: #999">decisiontree</a> <a href="/tags/uniapp/" style="font-size: 1.5em; color: #99a9bf">uniapp</a> <a href="/tags/%E7%BD%91%E7%BB%9C%E4%BB%A3%E7%90%86/" style="font-size: 1.1em; color: #999">网络代理</a> <a href="/tags/C-C/" style="font-size: 1.1em; color: #999">C C++</a> <a href="/tags/ensemble-learning/" style="font-size: 1.1em; color: #999">ensemble-learning</a></div></div><div class="card-widget card-archives"><div class="item-headline"><i class="fas fa-archive"></i><span>归档</span></div><ul class="card-archive-list"><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2025/01/"><span class="card-archive-list-date">一月 2025</span><span class="card-archive-list-count">6</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2024/09/"><span class="card-archive-list-date">九月 2024</span><span class="card-archive-list-count">4</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2024/08/"><span class="card-archive-list-date">八月 2024</span><span class="card-archive-list-count">8</span></a></li></ul></div><div class="card-widget card-webinfo"><div class="item-headline"><i class="fas fa-chart-line"></i><span>网站资讯</span></div><div class="webinfo"><div class="webinfo-item"><div class="item-name">文章数目 :</div><div class="item-count">18</div></div><div class="webinfo-item"><div class="item-name">已运行时间 :</div><div class="item-count" id="runtimeshow" data-publishDate="2024-07-30T16:00:00.000Z"><i class="fa-solid fa-spinner fa-spin"></i></div></div><div class="webinfo-item"><div class="item-name">本站访客数 :</div><div class="item-count" id="busuanzi_value_site_uv"><i class="fa-solid fa-spinner fa-spin"></i></div></div><div class="webinfo-item"><div class="item-name">本站总访问量 :</div><div class="item-count" id="busuanzi_value_site_pv"><i class="fa-solid fa-spinner fa-spin"></i></div></div><div class="webinfo-item"><div class="item-name">最后更新时间 :</div><div class="item-count" id="last-push-date" data-lastPushDate="2025-10-16T03:29:44.082Z"><i class="fa-solid fa-spinner fa-spin"></i></div></div></div></div></div></div></main><footer id="footer" style="background: transparent"><div id="footer-wrap"><div class="copyright">©2024 - 2025 By shenjianZ</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><div class="footer_custom_text"><a target="_blank" rel="noopener" href="https://beian.miit.gov.cn/#/Integrated/recordQuery"><img class="icp-icon" src="https://beian.mps.gov.cn/img/logo01.dd7ff50e.png"><span>备案号:豫ICP备2023019300号</span></a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside-config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button id="go-up" type="button" title="回到顶部"><span class="scroll-percent"></span><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/js/utils.js?v=4.13.0"></script><script src="/js/main.js?v=4.13.0"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui@5.0.33/dist/fancybox/fancybox.umd.min.js"></script><div class="js-pjax"></div><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1.1.3/dist/activate-power-mode.min.js"></script><script>POWERMODE.colorful = true;
|
||||||
|
POWERMODE.shake = true;
|
||||||
|
POWERMODE.mobile = false;
|
||||||
|
document.body.addEventListener('input', POWERMODE);
|
||||||
|
</script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script><div id="local-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">搜索</span><span id="loading-status"></span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="is-center" id="loading-database"><i class="fas fa-spinner fa-pulse"></i><span> 数据库加载中</span></div><div class="search-wrap"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div><hr/><div id="local-search-results"></div><div id="local-search-stats-wrap"></div></div></div><div id="search-mask"></div><script src="/js/search/local-search.js?v=4.13.0"></script></div></div></body></html>
|
||||||
158
public/archives/2024/08/index.html
Normal file
158
public/archives/2024/09/index.html
Normal file
158
public/archives/2024/page/2/index.html
Normal file
158
public/archives/2025/01/index.html
Normal file
158
public/archives/2025/index.html
Normal file
158
public/archives/page/2/index.html
Normal file
158
public/categories/machinelearning/index.html
Normal file
158
public/categories/古文观止/index.html
Normal file
24736
public/css/index.css
|
Before Width: | Height: | Size: 4.2 KiB |
BIN
public/img/000001.png
Normal file
|
After Width: | Height: | Size: 152 KiB |
|
Before Width: | Height: | Size: 138 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 4.1 KiB |
@@ -1,9 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1366 362">
|
|
||||||
<linearGradient id="a" x1="428.258" x2="434.145" y1="404.15" y2="409.85" gradientUnits="userSpaceOnUse" gradientTransform="matrix(94.045 0 0 -94.072 -40381.527 38479.52)">
|
|
||||||
<stop offset="0" stop-color="#00aeff"/>
|
|
||||||
<stop offset="1" stop-color="#3369e7"/>
|
|
||||||
</linearGradient>
|
|
||||||
<path fill="url(#a)" d="M61.8 15.4h242.8c23.9 0 43.4 19.4 43.4 43.4v242.9c0 23.9-19.4 43.4-43.4 43.4H61.8c-23.9 0-43.4-19.4-43.4-43.4v-243c0-23.9 19.4-43.3 43.4-43.3z"/>
|
|
||||||
<path fill="#FFF" d="M187 98.7c-51.4 0-93.1 41.7-93.1 93.2S135.6 285 187 285s93.1-41.7 93.1-93.2-41.6-93.1-93.1-93.1zm0 158.8c-36.2 0-65.6-29.4-65.6-65.6s29.4-65.6 65.6-65.6 65.6 29.4 65.6 65.6-29.3 65.6-65.6 65.6zm0-117.8v48.9c0 1.4 1.5 2.4 2.8 1.7l43.4-22.5c1-.5 1.3-1.7.8-2.7-9-15.8-25.7-26.6-45-27.3-1 0-2 .8-2 1.9zm-60.8-35.9l-5.7-5.7c-5.6-5.6-14.6-5.6-20.2 0l-6.8 6.8c-5.6 5.6-5.6 14.6 0 20.2l5.6 5.6c.9.9 2.2.7 3-.2 3.3-4.5 6.9-8.8 10.9-12.8 4.1-4.1 8.3-7.7 12.9-11 1-.6 1.1-2 .3-2.9zM217.5 89V77.7c0-7.9-6.4-14.3-14.3-14.3h-33.3c-7.9 0-14.3 6.4-14.3 14.3v11.6c0 1.3 1.2 2.2 2.5 1.9 9.3-2.7 19.1-4.1 29-4.1 9.5 0 18.9 1.3 28 3.8 1.2.3 2.4-.6 2.4-1.9z"/>
|
|
||||||
<path fill="#182359" d="M842.5 267.6c0 26.7-6.8 46.2-20.5 58.6-13.7 12.4-34.6 18.6-62.8 18.6-10.3 0-31.7-2-48.8-5.8l6.3-31c14.3 3 33.2 3.8 43.1 3.8 15.7 0 26.9-3.2 33.6-9.6s10-15.9 10-28.5v-6.4c-3.9 1.9-9 3.8-15.3 5.8-6.3 1.9-13.6 2.9-21.8 2.9-10.8 0-20.6-1.7-29.5-5.1-8.9-3.4-16.6-8.4-22.9-15-6.3-6.6-11.3-14.9-14.8-24.8s-5.3-27.6-5.3-40.6c0-12.2 1.9-27.5 5.6-37.7 3.8-10.2 9.2-19 16.5-26.3 7.2-7.3 16-12.9 26.3-17s22.4-6.7 35.5-6.7c12.7 0 24.4 1.6 35.8 3.5 11.4 1.9 21.1 3.9 29 6.1v155.2zm-108.7-77.2c0 16.4 3.6 34.6 10.8 42.2 7.2 7.6 16.5 11.4 27.9 11.4 6.2 0 12.1-.9 17.6-2.6 5.5-1.7 9.9-3.7 13.4-6.1v-97.1c-2.8-.6-14.5-3-25.8-3.3-14.2-.4-25 5.4-32.6 14.7-7.5 9.3-11.3 25.6-11.3 40.8zm294.3 0c0 13.2-1.9 23.2-5.8 34.1s-9.4 20.2-16.5 27.9c-7.1 7.7-15.6 13.7-25.6 17.9s-25.4 6.6-33.1 6.6c-7.7-.1-23-2.3-32.9-6.6-9.9-4.3-18.4-10.2-25.5-17.9-7.1-7.7-12.6-17-16.6-27.9s-6-20.9-6-34.1c0-13.2 1.8-25.9 5.8-36.7 4-10.8 9.6-20 16.8-27.7s15.8-13.6 25.6-17.8c9.9-4.2 20.8-6.2 32.6-6.2s22.7 2.1 32.7 6.2c10 4.2 18.6 10.1 25.6 17.8 7.1 7.7 12.6 16.9 16.6 27.7 4.2 10.8 6.3 23.5 6.3 36.7zm-40 .1c0-16.9-3.7-31-10.9-40.8-7.2-9.9-17.3-14.8-30.2-14.8-12.9 0-23 4.9-30.2 14.8-7.2 9.9-10.7 23.9-10.7 40.8 0 17.1 3.6 28.6 10.8 38.5 7.2 10 17.3 14.9 30.2 14.9 12.9 0 23-5 30.2-14.9 7.2-10 10.8-21.4 10.8-38.5zm127.1 86.4c-64.1.3-64.1-51.8-64.1-60.1L1051 32l39.1-6.2v183.6c0 4.7 0 34.5 25.1 34.6v32.9zm68.9 0h-39.3V108.1l39.3-6.2v175zm-19.7-193.5c13.1 0 23.8-10.6 23.8-23.7S1177.6 36 1164.4 36s-23.8 10.6-23.8 23.7 10.7 23.7 23.8 23.7zm117.4 18.6c12.9 0 23.8 1.6 32.6 4.8 8.8 3.2 15.9 7.7 21.1 13.4s8.9 13.5 11.1 21.7c2.3 8.2 3.4 17.2 3.4 27.1v100.6c-6 1.3-15.1 2.8-27.3 4.6s-25.9 2.7-41.1 2.7c-10.1 0-19.4-1-27.7-2.9-8.4-1.9-15.5-5-21.5-9.3-5.9-4.3-10.5-9.8-13.9-16.6-3.3-6.8-5-16.4-5-26.4 0-9.6 1.9-15.7 5.6-22.3 3.8-6.6 8.9-12 15.3-16.2 6.5-4.2 13.9-7.2 22.4-9s17.4-2.7 26.6-2.7c4.3 0 8.8.3 13.6.8s9.8 1.4 15.2 2.7v-6.4c0-4.5-.5-8.8-1.6-12.8-1.1-4.1-3-7.6-5.6-10.7-2.7-3.1-6.2-5.5-10.6-7.2s-10-3-16.7-3c-9 0-17.2 1.1-24.7 2.4-7.5 1.3-13.7 2.8-18.4 4.5l-4.7-32.1c4.9-1.7 12.2-3.4 21.6-5.1s19.5-2.6 30.3-2.6zm3.3 141.9c12 0 20.9-.7 27.1-1.9v-39.8c-2.2-.6-5.3-1.3-9.4-1.9-4.1-.6-8.6-1-13.6-1-4.3 0-8.7.3-13.1 1-4.4.6-8.4 1.8-11.9 3.5s-6.4 4.1-8.5 7.2c-2.2 3.1-3.2 4.9-3.2 9.6 0 9.2 3.2 14.5 9 18 5.9 3.6 13.7 5.3 23.6 5.3zM512.9 103c12.9 0 23.8 1.6 32.6 4.8 8.8 3.2 15.9 7.7 21.1 13.4 5.3 5.8 8.9 13.5 11.1 21.7 2.3 8.2 3.4 17.2 3.4 27.1v100.6c-6 1.3-15.1 2.8-27.3 4.6-12.2 1.8-25.9 2.7-41.1 2.7-10.1 0-19.4-1-27.7-2.9-8.4-1.9-15.5-5-21.5-9.3-5.9-4.3-10.5-9.8-13.9-16.6-3.3-6.8-5-16.4-5-26.4 0-9.6 1.9-15.7 5.6-22.3 3.8-6.6 8.9-12 15.3-16.2 6.5-4.2 13.9-7.2 22.4-9s17.4-2.7 26.6-2.7c4.3 0 8.8.3 13.6.8 4.7.5 9.8 1.4 15.2 2.7v-6.4c0-4.5-.5-8.8-1.6-12.8-1.1-4.1-3-7.6-5.6-10.7-2.7-3.1-6.2-5.5-10.6-7.2-4.4-1.7-10-3-16.7-3-9 0-17.2 1.1-24.7 2.4-7.5 1.3-13.7 2.8-18.4 4.5l-4.7-32.1c4.9-1.7 12.2-3.4 21.6-5.1 9.4-1.8 19.5-2.6 30.3-2.6zm3.4 142c12 0 20.9-.7 27.1-1.9v-39.8c-2.2-.6-5.3-1.3-9.4-1.9-4.1-.6-8.6-1-13.6-1-4.3 0-8.7.3-13.1 1-4.4.6-8.4 1.8-11.9 3.5s-6.4 4.1-8.5 7.2c-2.2 3.1-3.2 4.9-3.2 9.6 0 9.2 3.2 14.5 9 18s13.7 5.3 23.6 5.3zm158.5 31.9c-64.1.3-64.1-51.8-64.1-60.1L610.6 32l39.1-6.2v183.6c0 4.7 0 34.5 25.1 34.6v32.9z"/>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 14 KiB |
BIN
public/img/dingyue.png
Normal file
|
After Width: | Height: | Size: 609 KiB |
|
Before Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 590 KiB After Width: | Height: | Size: 64 KiB |
BIN
public/img/language/c-env-conf.png
Normal file
|
After Width: | Height: | Size: 126 KiB |
|
Before Width: | Height: | Size: 721 KiB |
BIN
public/img/machinelearning/cros-valid.png
Normal file
|
After Width: | Height: | Size: 183 KiB |
BIN
public/img/machinelearning/decision-tree.png
Normal file
|
After Width: | Height: | Size: 537 KiB |
BIN
public/img/machinelearning/ensemble-learning.png
Normal file
|
After Width: | Height: | Size: 613 KiB |
BIN
public/img/machinelearning/fitting.png
Normal file
|
After Width: | Height: | Size: 100 KiB |
BIN
public/img/machinelearning/kfold-skfold.png
Normal file
|
After Width: | Height: | Size: 27 KiB |
BIN
public/img/machinelearning/knn-01.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
public/img/machinelearning/linear.png
Normal file
|
After Width: | Height: | Size: 123 KiB |
BIN
public/img/machinelearning/ott.png
Normal file
|
After Width: | Height: | Size: 53 KiB |
BIN
public/img/machinelearning/over_random_sampling.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
public/img/machinelearning/over_smote_sampling.png
Normal file
|
After Width: | Height: | Size: 39 KiB |
BIN
public/img/machinelearning/random-forest.png
Normal file
|
After Width: | Height: | Size: 116 KiB |
BIN
public/img/machinelearning/under_sampling.png
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
public/img/peiqian.png
Normal file
|
After Width: | Height: | Size: 770 KiB |
BIN
public/img/site01.jpg
Normal file
|
After Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 283 B |
|
Before Width: | Height: | Size: 431 B |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 6.6 KiB |
BIN
public/img/yiyuan.png
Normal file
|
After Width: | Height: | Size: 203 KiB |
@@ -1,438 +0,0 @@
|
|||||||
(function () {
|
|
||||||
const {
|
|
||||||
randomNum,
|
|
||||||
basicWordCount,
|
|
||||||
btnLink,
|
|
||||||
key: AIKey,
|
|
||||||
Referer: AIReferer,
|
|
||||||
gptName,
|
|
||||||
switchBtn,
|
|
||||||
mode: initialMode,
|
|
||||||
} = GLOBAL_CONFIG.postHeadAiDescription;
|
|
||||||
|
|
||||||
const { title, postAI, pageFillDescription } = GLOBAL_CONFIG_SITE;
|
|
||||||
|
|
||||||
let lastAiRandomIndex = -1;
|
|
||||||
let animationRunning = true;
|
|
||||||
let mode = initialMode;
|
|
||||||
let refreshNum = 0;
|
|
||||||
let prevParam;
|
|
||||||
let audio = null;
|
|
||||||
let isPaused = false;
|
|
||||||
let summaryID = null;
|
|
||||||
|
|
||||||
const post_ai = document.querySelector(".post-ai-description");
|
|
||||||
const aiTitleRefreshIcon = post_ai.querySelector(".ai-title .anzhiyufont.anzhiyu-icon-arrow-rotate-right");
|
|
||||||
let aiReadAloudIcon = post_ai.querySelector(".anzhiyu-icon-circle-dot");
|
|
||||||
const explanation = post_ai.querySelector(".ai-explanation");
|
|
||||||
|
|
||||||
let aiStr = "";
|
|
||||||
let aiStrLength = "";
|
|
||||||
let delayInit = 600;
|
|
||||||
let indexI = 0;
|
|
||||||
let indexJ = 0;
|
|
||||||
let timeouts = [];
|
|
||||||
let elapsed = 0;
|
|
||||||
|
|
||||||
const observer = createIntersectionObserver();
|
|
||||||
const aiFunctions = [introduce, aiTitleRefreshIconClick, aiRecommend, aiGoHome];
|
|
||||||
|
|
||||||
const aiBtnList = post_ai.querySelectorAll(".ai-btn-item");
|
|
||||||
const filteredHeadings = Array.from(aiBtnList).filter(heading => heading.id !== "go-tianli-blog");
|
|
||||||
filteredHeadings.forEach((item, index) => {
|
|
||||||
item.addEventListener("click", () => {
|
|
||||||
aiFunctions[index]();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
document.getElementById("ai-tag").addEventListener("click", onAiTagClick);
|
|
||||||
aiTitleRefreshIcon.addEventListener("click", onAiTitleRefreshIconClick);
|
|
||||||
document.getElementById("go-tianli-blog").addEventListener("click", () => {
|
|
||||||
window.open(btnLink, "_blank");
|
|
||||||
});
|
|
||||||
aiReadAloudIcon.addEventListener("click", readAloud);
|
|
||||||
|
|
||||||
async function readAloud() {
|
|
||||||
if (!summaryID) {
|
|
||||||
anzhiyu.snackbarShow("摘要还没加载完呢,请稍后。。。");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
aiReadAloudIcon = post_ai.querySelector(".anzhiyu-icon-circle-dot");
|
|
||||||
aiReadAloudIcon.style.opacity = "0.2";
|
|
||||||
if (audio && !isPaused) {
|
|
||||||
audio.pause();
|
|
||||||
isPaused = true;
|
|
||||||
aiReadAloudIcon.style.opacity = "1";
|
|
||||||
aiReadAloudIcon.style.animation = "";
|
|
||||||
aiReadAloudIcon.style.cssText = "animation: ''; opacity: 1;cursor: pointer;";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (audio && isPaused) {
|
|
||||||
audio.play();
|
|
||||||
isPaused = false;
|
|
||||||
aiReadAloudIcon.style.cssText = "animation: breathe .5s linear infinite; opacity: 0.2;cursor: pointer";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const options = {
|
|
||||||
key: AIKey,
|
|
||||||
Referer: AIReferer,
|
|
||||||
};
|
|
||||||
const requestParams = new URLSearchParams({
|
|
||||||
key: options.key,
|
|
||||||
id: summaryID,
|
|
||||||
});
|
|
||||||
|
|
||||||
const requestOptions = {
|
|
||||||
method: "GET",
|
|
||||||
headers: {
|
|
||||||
"Content-Type": "application/json",
|
|
||||||
Referer: options.Referer,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
try {
|
|
||||||
const response = await fetch(`https://summary.tianli0.top/audio?${requestParams}`, requestOptions);
|
|
||||||
if (response.status === 403) {
|
|
||||||
console.error("403 refer与key不匹配。");
|
|
||||||
} else if (response.status === 500) {
|
|
||||||
console.error("500 系统内部错误");
|
|
||||||
} else {
|
|
||||||
const audioBlob = await response.blob();
|
|
||||||
const audioURL = URL.createObjectURL(audioBlob);
|
|
||||||
audio = new Audio(audioURL);
|
|
||||||
audio.play();
|
|
||||||
aiReadAloudIcon.style.cssText = "animation: breathe .5s linear infinite; opacity: 0.2;cursor: pointer";
|
|
||||||
audio.addEventListener("ended", () => {
|
|
||||||
audio = null;
|
|
||||||
aiReadAloudIcon.style.opacity = "1";
|
|
||||||
aiReadAloudIcon.style.animation = "";
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error("请求发生错误❎");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (switchBtn) {
|
|
||||||
document.getElementById("ai-Toggle").addEventListener("click", changeShowMode);
|
|
||||||
}
|
|
||||||
|
|
||||||
aiAbstract();
|
|
||||||
showAiBtn();
|
|
||||||
|
|
||||||
function createIntersectionObserver() {
|
|
||||||
return new IntersectionObserver(
|
|
||||||
entries => {
|
|
||||||
let isVisible = entries[0].isIntersecting;
|
|
||||||
animationRunning = isVisible;
|
|
||||||
if (animationRunning) {
|
|
||||||
delayInit = indexI === 0 ? 200 : 20;
|
|
||||||
timeouts[1] = setTimeout(() => {
|
|
||||||
if (indexJ) {
|
|
||||||
indexI = 0;
|
|
||||||
indexJ = 0;
|
|
||||||
}
|
|
||||||
if (indexI === 0) {
|
|
||||||
explanation.innerHTML = aiStr.charAt(0);
|
|
||||||
}
|
|
||||||
requestAnimationFrame(animate);
|
|
||||||
}, delayInit);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{ threshold: 0 }
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function animate(timestamp) {
|
|
||||||
if (!animationRunning) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!animate.start) animate.start = timestamp;
|
|
||||||
elapsed = timestamp - animate.start;
|
|
||||||
if (elapsed >= 20) {
|
|
||||||
animate.start = timestamp;
|
|
||||||
if (indexI < aiStrLength - 1) {
|
|
||||||
let char = aiStr.charAt(indexI + 1);
|
|
||||||
let delay = /[,.,。!?!?]/.test(char) ? 150 : 20;
|
|
||||||
if (explanation.firstElementChild) {
|
|
||||||
explanation.removeChild(explanation.firstElementChild);
|
|
||||||
}
|
|
||||||
explanation.innerHTML += char;
|
|
||||||
let div = document.createElement("div");
|
|
||||||
div.className = "ai-cursor";
|
|
||||||
explanation.appendChild(div);
|
|
||||||
indexI++;
|
|
||||||
if (delay === 150) {
|
|
||||||
post_ai.querySelector(".ai-explanation .ai-cursor").style.opacity = "0.2";
|
|
||||||
}
|
|
||||||
if (indexI === aiStrLength - 1) {
|
|
||||||
observer.disconnect();
|
|
||||||
explanation.removeChild(explanation.firstElementChild);
|
|
||||||
}
|
|
||||||
timeouts[0] = setTimeout(() => {
|
|
||||||
requestAnimationFrame(animate);
|
|
||||||
}, delay);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
requestAnimationFrame(animate);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function clearTimeouts() {
|
|
||||||
if (timeouts.length) {
|
|
||||||
timeouts.forEach(item => {
|
|
||||||
if (item) {
|
|
||||||
clearTimeout(item);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function startAI(str, df = true) {
|
|
||||||
indexI = 0;
|
|
||||||
indexJ = 1;
|
|
||||||
clearTimeouts();
|
|
||||||
animationRunning = false;
|
|
||||||
elapsed = 0;
|
|
||||||
observer.disconnect();
|
|
||||||
explanation.innerHTML = df ? "生成中. . ." : "请等待. . .";
|
|
||||||
aiStr = str;
|
|
||||||
aiStrLength = aiStr.length;
|
|
||||||
observer.observe(post_ai);
|
|
||||||
}
|
|
||||||
|
|
||||||
async function aiAbstract(num = basicWordCount) {
|
|
||||||
if (mode === "tianli") {
|
|
||||||
await aiAbstractTianli(num);
|
|
||||||
} else {
|
|
||||||
aiAbstractLocal();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function aiAbstractTianli(num) {
|
|
||||||
indexI = 0;
|
|
||||||
indexJ = 1;
|
|
||||||
clearTimeouts();
|
|
||||||
animationRunning = false;
|
|
||||||
elapsed = 0;
|
|
||||||
observer.disconnect();
|
|
||||||
|
|
||||||
num = Math.max(10, Math.min(2000, num));
|
|
||||||
const options = {
|
|
||||||
key: AIKey,
|
|
||||||
Referer: AIReferer,
|
|
||||||
};
|
|
||||||
const truncateDescription = (title + pageFillDescription).trim().substring(0, num);
|
|
||||||
|
|
||||||
const requestBody = {
|
|
||||||
key: options.key,
|
|
||||||
content: truncateDescription,
|
|
||||||
url: location.href,
|
|
||||||
};
|
|
||||||
|
|
||||||
const requestOptions = {
|
|
||||||
method: "POST",
|
|
||||||
headers: {
|
|
||||||
"Content-Type": "application/json",
|
|
||||||
Referer: options.Referer,
|
|
||||||
},
|
|
||||||
body: JSON.stringify(requestBody),
|
|
||||||
};
|
|
||||||
console.info(truncateDescription.length);
|
|
||||||
try {
|
|
||||||
let animationInterval = null;
|
|
||||||
let summary;
|
|
||||||
if (animationInterval) clearInterval(animationInterval);
|
|
||||||
animationInterval = setInterval(() => {
|
|
||||||
const animationText = "生成中" + ".".repeat(indexJ);
|
|
||||||
explanation.innerHTML = animationText;
|
|
||||||
indexJ = (indexJ % 3) + 1;
|
|
||||||
}, 500);
|
|
||||||
const response = await fetch(`https://summary.tianli0.top/`, requestOptions);
|
|
||||||
let result;
|
|
||||||
if (response.status === 403) {
|
|
||||||
result = {
|
|
||||||
summary: "403 refer与key不匹配。",
|
|
||||||
};
|
|
||||||
} else if (response.status === 500) {
|
|
||||||
result = {
|
|
||||||
summary: "500 系统内部错误",
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
result = await response.json();
|
|
||||||
}
|
|
||||||
|
|
||||||
summary = result.summary.trim();
|
|
||||||
summaryID = result.id;
|
|
||||||
|
|
||||||
setTimeout(() => {
|
|
||||||
aiTitleRefreshIcon.style.opacity = "1";
|
|
||||||
}, 300);
|
|
||||||
if (summary) {
|
|
||||||
startAI(summary);
|
|
||||||
} else {
|
|
||||||
startAI("摘要获取失败!!!请检查Tianli服务是否正常!!!");
|
|
||||||
}
|
|
||||||
clearInterval(animationInterval);
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
explanation.innerHTML = "发生异常" + error;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function aiAbstractLocal() {
|
|
||||||
const strArr = postAI.split(",").map(item => item.trim());
|
|
||||||
if (strArr.length !== 1) {
|
|
||||||
let randomIndex = Math.floor(Math.random() * strArr.length);
|
|
||||||
while (randomIndex === lastAiRandomIndex) {
|
|
||||||
randomIndex = Math.floor(Math.random() * strArr.length);
|
|
||||||
}
|
|
||||||
lastAiRandomIndex = randomIndex;
|
|
||||||
startAI(strArr[randomIndex]);
|
|
||||||
} else {
|
|
||||||
startAI(strArr[0]);
|
|
||||||
}
|
|
||||||
setTimeout(() => {
|
|
||||||
aiTitleRefreshIcon.style.opacity = "1";
|
|
||||||
}, 600);
|
|
||||||
}
|
|
||||||
|
|
||||||
function aiRecommend() {
|
|
||||||
indexI = 0;
|
|
||||||
indexJ = 1;
|
|
||||||
clearTimeouts();
|
|
||||||
animationRunning = false;
|
|
||||||
elapsed = 0;
|
|
||||||
explanation.innerHTML = "生成中. . .";
|
|
||||||
aiStr = "";
|
|
||||||
aiStrLength = "";
|
|
||||||
observer.disconnect();
|
|
||||||
timeouts[2] = setTimeout(() => {
|
|
||||||
explanation.innerHTML = recommendList();
|
|
||||||
}, 600);
|
|
||||||
}
|
|
||||||
|
|
||||||
function recommendList() {
|
|
||||||
let thumbnail = document.querySelectorAll(".relatedPosts-list a");
|
|
||||||
if (!thumbnail.length) {
|
|
||||||
const cardRecentPost = document.querySelector(".card-widget.card-recent-post");
|
|
||||||
if (!cardRecentPost) return "";
|
|
||||||
|
|
||||||
thumbnail = cardRecentPost.querySelectorAll(".aside-list-item a");
|
|
||||||
|
|
||||||
let list = "";
|
|
||||||
for (let i = 0; i < thumbnail.length; i++) {
|
|
||||||
const item = thumbnail[i];
|
|
||||||
list += `<div class="ai-recommend-item"><span class="index">${
|
|
||||||
i + 1
|
|
||||||
}:</span><a href="javascript:;" onclick="pjax.loadUrl('${item.href}')" title="${
|
|
||||||
item.title
|
|
||||||
}" data-pjax-state="">${item.title}</a></div>`;
|
|
||||||
}
|
|
||||||
|
|
||||||
return `很抱歉,无法找到类似的文章,你也可以看看本站最新发布的文章:<br /><div class="ai-recommend">${list}</div>`;
|
|
||||||
}
|
|
||||||
|
|
||||||
let list = "";
|
|
||||||
for (let i = 0; i < thumbnail.length; i++) {
|
|
||||||
const item = thumbnail[i];
|
|
||||||
list += `<div class="ai-recommend-item"><span>推荐${
|
|
||||||
i + 1
|
|
||||||
}:</span><a href="javascript:;" onclick="pjax.loadUrl('${item.href}')" title="${
|
|
||||||
item.title
|
|
||||||
}" data-pjax-state="">${item.title}</a></div>`;
|
|
||||||
}
|
|
||||||
|
|
||||||
return `推荐文章:<br /><div class="ai-recommend">${list}</div>`;
|
|
||||||
}
|
|
||||||
|
|
||||||
function aiGoHome() {
|
|
||||||
startAI("正在前往博客主页...", false);
|
|
||||||
timeouts[2] = setTimeout(() => {
|
|
||||||
if (window.pjax) {
|
|
||||||
pjax.loadUrl("/");
|
|
||||||
} else {
|
|
||||||
location.href = location.origin;
|
|
||||||
}
|
|
||||||
}, 1000);
|
|
||||||
}
|
|
||||||
|
|
||||||
function introduce() {
|
|
||||||
if (mode == "tianli") {
|
|
||||||
startAI("我是文章辅助AI: TianliGPT,点击下方的按钮,让我生成本文简介、推荐相关文章等。");
|
|
||||||
} else {
|
|
||||||
startAI(`我是文章辅助AI: ${gptName} GPT,点击下方的按钮,让我生成本文简介、推荐相关文章等。`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function aiTitleRefreshIconClick() {
|
|
||||||
aiTitleRefreshIcon.click();
|
|
||||||
}
|
|
||||||
|
|
||||||
function onAiTagClick() {
|
|
||||||
if (mode === "tianli") {
|
|
||||||
post_ai.querySelectorAll(".ai-btn-item").forEach(item => (item.style.display = "none"));
|
|
||||||
document.getElementById("go-tianli-blog").style.display = "block";
|
|
||||||
startAI(
|
|
||||||
"你好,我是Tianli开发的摘要生成助理TianliGPT,是一个基于GPT-4的生成式AI。我在这里只负责摘要的预生成和显示,你无法与我直接沟通,如果你也需要一个这样的AI摘要接口,可以在下方购买。"
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
post_ai.querySelectorAll(".ai-btn-item").forEach(item => (item.style.display = "block"));
|
|
||||||
document.getElementById("go-tianli-blog").style.display = "none";
|
|
||||||
startAI(
|
|
||||||
`你好,我是本站摘要生成助理${gptName} GPT,是一个基于GPT-4的生成式AI。我在这里只负责摘要的预生成和显示,你无法与我直接沟通。`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function onAiTitleRefreshIconClick() {
|
|
||||||
const truncateDescription = (title + pageFillDescription).trim().substring(0, basicWordCount);
|
|
||||||
|
|
||||||
aiTitleRefreshIcon.style.opacity = "0.2";
|
|
||||||
aiTitleRefreshIcon.style.transitionDuration = "0.3s";
|
|
||||||
aiTitleRefreshIcon.style.transform = "rotate(" + 360 * refreshNum + "deg)";
|
|
||||||
if (truncateDescription.length <= basicWordCount) {
|
|
||||||
let param = truncateDescription.length - Math.floor(Math.random() * randomNum);
|
|
||||||
while (param === prevParam || truncateDescription.length - param === prevParam) {
|
|
||||||
param = truncateDescription.length - Math.floor(Math.random() * randomNum);
|
|
||||||
}
|
|
||||||
prevParam = param;
|
|
||||||
aiAbstract(param);
|
|
||||||
} else {
|
|
||||||
let value = Math.floor(Math.random() * randomNum) + basicWordCount;
|
|
||||||
while (value === prevParam || truncateDescription.length - value === prevParam) {
|
|
||||||
value = Math.floor(Math.random() * randomNum) + basicWordCount;
|
|
||||||
}
|
|
||||||
aiAbstract(value);
|
|
||||||
}
|
|
||||||
refreshNum++;
|
|
||||||
}
|
|
||||||
|
|
||||||
function changeShowMode() {
|
|
||||||
mode = mode === "tianli" ? "local" : "tianli";
|
|
||||||
if (mode === "tianli") {
|
|
||||||
document.getElementById("ai-tag").innerHTML = "TianliGPT";
|
|
||||||
|
|
||||||
aiReadAloudIcon.style.opacity = "1";
|
|
||||||
aiReadAloudIcon.style.cursor = "pointer";
|
|
||||||
} else {
|
|
||||||
aiReadAloudIcon.style.opacity = "0";
|
|
||||||
aiReadAloudIcon.style.cursor = "auto";
|
|
||||||
if ((document.getElementById("go-tianli-blog").style.display = "block")) {
|
|
||||||
document.querySelectorAll(".ai-btn-item").forEach(item => (item.style.display = "block"));
|
|
||||||
document.getElementById("go-tianli-blog").style.display = "none";
|
|
||||||
}
|
|
||||||
document.getElementById("ai-tag").innerHTML = gptName + " GPT";
|
|
||||||
}
|
|
||||||
aiAbstract();
|
|
||||||
}
|
|
||||||
|
|
||||||
function showAiBtn() {
|
|
||||||
if (mode === "tianli") {
|
|
||||||
document.getElementById("ai-tag").innerHTML = "TianliGPT";
|
|
||||||
} else {
|
|
||||||
document.getElementById("ai-tag").innerHTML = gptName + " GPT";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
@@ -1,179 +0,0 @@
|
|||||||
if (document.querySelector(".comment-barrage")) {
|
|
||||||
var commentBarrageConfig = {
|
|
||||||
maxBarrage: GLOBAL_CONFIG.commentBarrageConfig.maxBarrage,
|
|
||||||
barrageTime: GLOBAL_CONFIG.commentBarrageConfig.barrageTime,
|
|
||||||
twikooUrl: GLOBAL_CONFIG.twikooEnvId,
|
|
||||||
accessToken: GLOBAL_CONFIG.commentBarrageConfig.accessToken,
|
|
||||||
mailMd5: GLOBAL_CONFIG.commentBarrageConfig.mailMd5,
|
|
||||||
pageUrl: window.location.pathname,
|
|
||||||
barrageTimer: [],
|
|
||||||
barrageList: [],
|
|
||||||
barrageIndex: 0,
|
|
||||||
dom: document.querySelector(".comment-barrage"),
|
|
||||||
};
|
|
||||||
var commentInterval = null;
|
|
||||||
var hoverOnCommentBarrage = false;
|
|
||||||
|
|
||||||
document.querySelector(".comment-barrage").addEventListener("mouseenter", function () {
|
|
||||||
hoverOnCommentBarrage = true;
|
|
||||||
});
|
|
||||||
document.querySelector(".comment-barrage").addEventListener("mouseleave", function () {
|
|
||||||
hoverOnCommentBarrage = false;
|
|
||||||
});
|
|
||||||
|
|
||||||
function initCommentBarrage() {
|
|
||||||
if (!commentBarrageConfig.dom) return;
|
|
||||||
|
|
||||||
var data = JSON.stringify({
|
|
||||||
event: "COMMENT_GET",
|
|
||||||
"commentBarrageConfig.accessToken": commentBarrageConfig.accessToken,
|
|
||||||
url: commentBarrageConfig.pageUrl,
|
|
||||||
});
|
|
||||||
var xhr = new XMLHttpRequest();
|
|
||||||
xhr.withCredentials = true;
|
|
||||||
xhr.addEventListener("readystatechange", function () {
|
|
||||||
if (this.readyState === 4 && this.responseText) {
|
|
||||||
commentBarrageConfig.barrageList = commentLinkFilter(JSON.parse(this.responseText).data);
|
|
||||||
commentBarrageConfig.dom.innerHTML = "";
|
|
||||||
}
|
|
||||||
});
|
|
||||||
xhr.open("POST", commentBarrageConfig.twikooUrl);
|
|
||||||
xhr.setRequestHeader("Content-Type", "application/json");
|
|
||||||
xhr.send(data);
|
|
||||||
|
|
||||||
clearInterval(commentInterval);
|
|
||||||
commentInterval = null;
|
|
||||||
|
|
||||||
commentInterval = setInterval(() => {
|
|
||||||
if (commentBarrageConfig.barrageList.length && !hoverOnCommentBarrage) {
|
|
||||||
popCommentBarrage(commentBarrageConfig.barrageList[commentBarrageConfig.barrageIndex]);
|
|
||||||
commentBarrageConfig.barrageIndex += 1;
|
|
||||||
commentBarrageConfig.barrageIndex %= commentBarrageConfig.barrageList.length;
|
|
||||||
}
|
|
||||||
if (
|
|
||||||
commentBarrageConfig.barrageTimer.length >
|
|
||||||
(commentBarrageConfig.barrageList.length > commentBarrageConfig.maxBarrage
|
|
||||||
? commentBarrageConfig.maxBarrage
|
|
||||||
: commentBarrageConfig.barrageList.length) &&
|
|
||||||
!hoverOnCommentBarrage
|
|
||||||
) {
|
|
||||||
removeCommentBarrage(commentBarrageConfig.barrageTimer.shift());
|
|
||||||
}
|
|
||||||
}, commentBarrageConfig.barrageTime);
|
|
||||||
}
|
|
||||||
|
|
||||||
function commentLinkFilter(data) {
|
|
||||||
data.sort((a, b) => {
|
|
||||||
return a.created - b.created;
|
|
||||||
});
|
|
||||||
let newData = [];
|
|
||||||
data.forEach(item => {
|
|
||||||
newData.push(...getCommentReplies(item));
|
|
||||||
});
|
|
||||||
return newData;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getCommentReplies(item) {
|
|
||||||
if (item.replies) {
|
|
||||||
let replies = [item];
|
|
||||||
item.replies.forEach(item => {
|
|
||||||
replies.push(...getCommentReplies(item));
|
|
||||||
});
|
|
||||||
return replies;
|
|
||||||
} else {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function popCommentBarrage(data) {
|
|
||||||
let barrage = document.createElement("div");
|
|
||||||
barrage.className = "comment-barrage-item";
|
|
||||||
barrage.innerHTML = `
|
|
||||||
<div class="barrageHead">
|
|
||||||
<a class="barrageTitle ${
|
|
||||||
data.mailMd5 === commentBarrageConfig.mailMd5 ? "barrageBloggerTitle" : ""
|
|
||||||
}" href="javascript:anzhiyu.scrollTo('#post-comment')"">
|
|
||||||
${data.mailMd5 === commentBarrageConfig.mailMd5 ? "博主" : "热评"}
|
|
||||||
</a>
|
|
||||||
<div class="barrageNick">${data.nick}</div>
|
|
||||||
<img class="nolazyload barrageAvatar" src="https://cravatar.cn/avatar/${data.mailMd5}"/>
|
|
||||||
<a class="comment-barrage-close" href="javascript:anzhiyu.switchCommentBarrage()"><i class="anzhiyufont anzhiyu-icon-xmark"></i></a>
|
|
||||||
</div>
|
|
||||||
<anzhiyu class="barrageContent" onClick="window.location.hash = '${data.id}'">
|
|
||||||
${data.comment}
|
|
||||||
</anzhiyu>
|
|
||||||
`;
|
|
||||||
|
|
||||||
// 获取anzhiyu标签内的所有pre元素
|
|
||||||
let anzhiyuPres = barrage.querySelectorAll("anzhiyu pre");
|
|
||||||
|
|
||||||
// 遍历每个pre元素,将其替换为"【代码】"
|
|
||||||
anzhiyuPres.forEach(pre => {
|
|
||||||
let codePlaceholder = document.createElement("span");
|
|
||||||
codePlaceholder.innerText = "【代码】";
|
|
||||||
pre.parentNode.replaceChild(codePlaceholder, pre);
|
|
||||||
});
|
|
||||||
|
|
||||||
// 获取anzhiyu标签内的所有图片元素
|
|
||||||
let anzhiyuImages = barrage.querySelectorAll("anzhiyu img");
|
|
||||||
|
|
||||||
// 遍历每个图片元素,将其替换为"【图片】",但排除带有class=tk-owo-emotion的图片
|
|
||||||
anzhiyuImages.forEach(image => {
|
|
||||||
if (!image.classList.contains("tk-owo-emotion")) {
|
|
||||||
image.style.display = "none"; // 隐藏图片
|
|
||||||
let placeholder = document.createElement("span");
|
|
||||||
placeholder.innerText = "【图片】";
|
|
||||||
image.parentNode.replaceChild(placeholder, image);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
commentBarrageConfig.barrageTimer.push(barrage);
|
|
||||||
commentBarrageConfig.dom.append(barrage);
|
|
||||||
}
|
|
||||||
|
|
||||||
function removeCommentBarrage(barrage) {
|
|
||||||
barrage.className = "comment-barrage-item out";
|
|
||||||
|
|
||||||
setTimeout(() => {
|
|
||||||
if (commentBarrageConfig.dom && commentBarrageConfig.dom.contains(barrage)) {
|
|
||||||
commentBarrageConfig.dom.removeChild(barrage);
|
|
||||||
}
|
|
||||||
}, 1000);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 自动隐藏
|
|
||||||
const commentEntryCallback = entries => {
|
|
||||||
const commentBarrage = document.querySelector(".comment-barrage");
|
|
||||||
const postComment = document.getElementById("post-comment");
|
|
||||||
|
|
||||||
entries.forEach(entry => {
|
|
||||||
if (postComment && commentBarrage && document.body.clientWidth > 768) {
|
|
||||||
commentBarrage.style.bottom = entry.isIntersecting ? `-${commentBarrageConfig.maxBarrage * 200}px` : "0";
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
// 创建IntersectionObserver实例
|
|
||||||
const observer = new IntersectionObserver(commentEntryCallback, {
|
|
||||||
root: null,
|
|
||||||
rootMargin: "0px",
|
|
||||||
threshold: 0,
|
|
||||||
});
|
|
||||||
// 监视目标元素
|
|
||||||
const postCommentTarget = document.getElementById("post-comment");
|
|
||||||
if (postCommentTarget) {
|
|
||||||
observer.observe(postCommentTarget);
|
|
||||||
}
|
|
||||||
|
|
||||||
initCommentBarrage();
|
|
||||||
|
|
||||||
if (localStorage.getItem("commentBarrageSwitch") !== "false") {
|
|
||||||
document.querySelector(".comment-barrage").style.display = "flex";
|
|
||||||
document.querySelector(".menu-commentBarrage-text").textContent = "关闭热评";
|
|
||||||
} else {
|
|
||||||
document.querySelector(".comment-barrage").style.display = "none";
|
|
||||||
document.querySelector(".menu-commentBarrage-text").textContent = "显示热评";
|
|
||||||
}
|
|
||||||
|
|
||||||
document.addEventListener("pjax:send", function () {
|
|
||||||
clearInterval(commentInterval);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
@@ -1,271 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
function _toConsumableArray(e) {
|
|
||||||
return _arrayWithoutHoles(e) || _iterableToArray(e) || _unsupportedIterableToArray(e) || _nonIterableSpread();
|
|
||||||
}
|
|
||||||
|
|
||||||
function _nonIterableSpread() {
|
|
||||||
throw new TypeError(
|
|
||||||
"Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function _unsupportedIterableToArray(e, r) {
|
|
||||||
if (e) {
|
|
||||||
if ("string" == typeof e) return _arrayLikeToArray(e, r);
|
|
||||||
var t = Object.prototype.toString.call(e).slice(8, -1);
|
|
||||||
return (
|
|
||||||
"Object" === t && e.constructor && (t = e.constructor.name),
|
|
||||||
"Map" === t || "Set" === t
|
|
||||||
? Array.from(e)
|
|
||||||
: "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)
|
|
||||||
? _arrayLikeToArray(e, r)
|
|
||||||
: void 0
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function _iterableToArray(e) {
|
|
||||||
if (("undefined" != typeof Symbol && null != e[Symbol.iterator]) || null != e["@@iterator"]) return Array.from(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
function _arrayWithoutHoles(e) {
|
|
||||||
if (Array.isArray(e)) return _arrayLikeToArray(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
function _arrayLikeToArray(e, r) {
|
|
||||||
(null == r || r > e.length) && (r = e.length);
|
|
||||||
for (var t = 0, a = new Array(r); t < r; t++) a[t] = e[t];
|
|
||||||
return a;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _classCallCheck(e, r) {
|
|
||||||
if (!(e instanceof r)) throw new TypeError("Cannot call a class as a function");
|
|
||||||
}
|
|
||||||
|
|
||||||
function _defineProperties(e, r) {
|
|
||||||
for (var t = 0; t < r.length; t++) {
|
|
||||||
var a = r[t];
|
|
||||||
(a.enumerable = a.enumerable || !1),
|
|
||||||
(a.configurable = !0),
|
|
||||||
"value" in a && (a.writable = !0),
|
|
||||||
Object.defineProperty(e, a.key, a);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function _createClass(e, r, t) {
|
|
||||||
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), e;
|
|
||||||
}
|
|
||||||
var peopleConfig = {
|
|
||||||
src: GLOBAL_CONFIG.peoplecanvas.img,
|
|
||||||
rows: 15,
|
|
||||||
cols: 7,
|
|
||||||
},
|
|
||||||
randomRange = function (e, r) {
|
|
||||||
return e + Math.random() * (r - e);
|
|
||||||
},
|
|
||||||
randomIndex = function (e) {
|
|
||||||
return 0 | randomRange(0, e.length);
|
|
||||||
},
|
|
||||||
removeFromArray = function (e, r) {
|
|
||||||
return e.splice(r, 1)[0];
|
|
||||||
},
|
|
||||||
removeItemFromArray = function (e, r) {
|
|
||||||
return removeFromArray(e, e.indexOf(r));
|
|
||||||
},
|
|
||||||
removeRandomFromArray = function (e) {
|
|
||||||
return removeFromArray(e, randomIndex(e));
|
|
||||||
},
|
|
||||||
getRandomFromArray = function (e) {
|
|
||||||
return e[0 | randomIndex(e)];
|
|
||||||
},
|
|
||||||
resetPeep = function (e) {
|
|
||||||
var r,
|
|
||||||
t,
|
|
||||||
a = e.stage,
|
|
||||||
n = e.peep,
|
|
||||||
o = 0.5 < Math.random() ? 1 : -1,
|
|
||||||
i = 100 - 250 * gsap.parseEase("power2.in")(Math.random()),
|
|
||||||
s = a.height - n.height + i;
|
|
||||||
return (
|
|
||||||
1 == o ? ((r = -n.width), (t = a.width), (n.scaleX = 1)) : ((r = a.width + n.width), (t = 0), (n.scaleX = -1)),
|
|
||||||
(n.x = r),
|
|
||||||
(n.y = s),
|
|
||||||
{
|
|
||||||
startX: r,
|
|
||||||
startY: (n.anchorY = s),
|
|
||||||
endX: t,
|
|
||||||
}
|
|
||||||
);
|
|
||||||
},
|
|
||||||
normalWalk = function (e) {
|
|
||||||
var r = e.peep,
|
|
||||||
t = e.props,
|
|
||||||
a = (t.startX, t.startY),
|
|
||||||
n = t.endX,
|
|
||||||
o = gsap.timeline();
|
|
||||||
return (
|
|
||||||
o.timeScale(randomRange(0.5, 1.5)),
|
|
||||||
o.to(
|
|
||||||
r,
|
|
||||||
{
|
|
||||||
duration: 10,
|
|
||||||
x: n,
|
|
||||||
ease: "none",
|
|
||||||
},
|
|
||||||
0
|
|
||||||
),
|
|
||||||
o.to(
|
|
||||||
r,
|
|
||||||
{
|
|
||||||
duration: 0.25,
|
|
||||||
repeat: 40,
|
|
||||||
yoyo: !0,
|
|
||||||
y: a - 10,
|
|
||||||
},
|
|
||||||
0
|
|
||||||
),
|
|
||||||
o
|
|
||||||
);
|
|
||||||
},
|
|
||||||
walks = [normalWalk],
|
|
||||||
Peep = (function () {
|
|
||||||
function a(e) {
|
|
||||||
var r = e.image,
|
|
||||||
t = e.rect;
|
|
||||||
_classCallCheck(this, a),
|
|
||||||
(this.image = r),
|
|
||||||
this.setRect(t),
|
|
||||||
(this.x = 0),
|
|
||||||
(this.y = 0),
|
|
||||||
(this.anchorY = 0),
|
|
||||||
(this.scaleX = 1),
|
|
||||||
(this.walk = null);
|
|
||||||
}
|
|
||||||
return (
|
|
||||||
_createClass(a, [
|
|
||||||
{
|
|
||||||
key: "setRect",
|
|
||||||
value: function (e) {
|
|
||||||
(this.rect = e),
|
|
||||||
(this.width = e[2]),
|
|
||||||
(this.height = e[3]),
|
|
||||||
(this.drawArgs = [this.image].concat(_toConsumableArray(e), [0, 0, this.width, this.height]));
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "render",
|
|
||||||
value: function (e) {
|
|
||||||
e.save(),
|
|
||||||
e.translate(this.x, this.y),
|
|
||||||
e.scale(this.scaleX, 1),
|
|
||||||
e.drawImage.apply(e, _toConsumableArray(this.drawArgs)),
|
|
||||||
e.restore();
|
|
||||||
},
|
|
||||||
},
|
|
||||||
]),
|
|
||||||
a
|
|
||||||
);
|
|
||||||
})(),
|
|
||||||
img = document.createElement("img");
|
|
||||||
(img.onload = init), (img.src = peopleConfig.src);
|
|
||||||
let peoplecanvasEl = document.getElementById("peoplecanvas");
|
|
||||||
|
|
||||||
let ctx = peoplecanvasEl ? peoplecanvasEl.getContext("2d") : undefined,
|
|
||||||
stage = {
|
|
||||||
width: 0,
|
|
||||||
height: 0,
|
|
||||||
},
|
|
||||||
allPeeps = [],
|
|
||||||
availablePeeps = [],
|
|
||||||
crowd = [];
|
|
||||||
|
|
||||||
function init() {
|
|
||||||
if (!peoplecanvasEl) return;
|
|
||||||
createPeeps(), resize(), gsap.ticker.add(render), window.addEventListener("resize", resize);
|
|
||||||
}
|
|
||||||
document.addEventListener("pjax:success", e => {
|
|
||||||
peoplecanvasEl = document.getElementById("peoplecanvas");
|
|
||||||
if (peoplecanvasEl) {
|
|
||||||
(ctx = peoplecanvasEl ? peoplecanvasEl.getContext("2d") : undefined), window.removeEventListener("resize", resize);
|
|
||||||
gsap.ticker.remove(render);
|
|
||||||
setTimeout(() => {
|
|
||||||
if (!peoplecanvasEl) return;
|
|
||||||
resize(), gsap.ticker.add(render), window.addEventListener("resize", resize);
|
|
||||||
}, 300);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
function createPeeps() {
|
|
||||||
for (
|
|
||||||
var e = peopleConfig.rows,
|
|
||||||
r = peopleConfig.cols,
|
|
||||||
t = e * r,
|
|
||||||
a = img.naturalWidth / e,
|
|
||||||
n = img.naturalHeight / r,
|
|
||||||
o = 0;
|
|
||||||
o < t;
|
|
||||||
o++
|
|
||||||
)
|
|
||||||
allPeeps.push(
|
|
||||||
new Peep({
|
|
||||||
image: img,
|
|
||||||
rect: [(o % e) * a, ((o / e) | 0) * n, a, n],
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function resize() {
|
|
||||||
if (peoplecanvasEl && peoplecanvasEl.clientWidth != 0) {
|
|
||||||
(stage.width = peoplecanvasEl.clientWidth),
|
|
||||||
(stage.height = peoplecanvasEl.clientHeight),
|
|
||||||
(peoplecanvasEl.width = stage.width * devicePixelRatio),
|
|
||||||
(peoplecanvasEl.height = stage.height * devicePixelRatio),
|
|
||||||
crowd.forEach(function (e) {
|
|
||||||
e.walk.kill();
|
|
||||||
}),
|
|
||||||
(crowd.length = 0),
|
|
||||||
(availablePeeps.length = 0),
|
|
||||||
availablePeeps.push.apply(availablePeeps, allPeeps),
|
|
||||||
initCrowd();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function initCrowd() {
|
|
||||||
for (; availablePeeps.length; ) addPeepToCrowd().walk.progress(Math.random());
|
|
||||||
}
|
|
||||||
|
|
||||||
function addPeepToCrowd() {
|
|
||||||
var e = removeRandomFromArray(availablePeeps),
|
|
||||||
r = getRandomFromArray(walks)({
|
|
||||||
peep: e,
|
|
||||||
props: resetPeep({
|
|
||||||
peep: e,
|
|
||||||
stage: stage,
|
|
||||||
}),
|
|
||||||
}).eventCallback("onComplete", function () {
|
|
||||||
removePeepFromCrowd(e), addPeepToCrowd();
|
|
||||||
});
|
|
||||||
return (
|
|
||||||
(e.walk = r),
|
|
||||||
crowd.push(e),
|
|
||||||
crowd.sort(function (e, r) {
|
|
||||||
return e.anchorY - r.anchorY;
|
|
||||||
}),
|
|
||||||
e
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function removePeepFromCrowd(e) {
|
|
||||||
removeItemFromArray(crowd, e), availablePeeps.push(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
function render() {
|
|
||||||
if (!peoplecanvasEl) return;
|
|
||||||
(peoplecanvasEl.width = peoplecanvasEl.width),
|
|
||||||
ctx.save(),
|
|
||||||
ctx.scale(devicePixelRatio, devicePixelRatio),
|
|
||||||
crowd.forEach(function (e) {
|
|
||||||
e.render(ctx);
|
|
||||||
}),
|
|
||||||
ctx.restore();
|
|
||||||
}
|
|
||||||
@@ -1,215 +0,0 @@
|
|||||||
var fdata = {
|
|
||||||
apiurl: GLOBAL_CONFIG.friends_vue_info.apiurl,
|
|
||||||
defaultFish: 100,
|
|
||||||
hungryFish: 100,
|
|
||||||
};
|
|
||||||
//可通过 var fdataUser 替换默认值
|
|
||||||
if (typeof fdataUser !== "undefined") {
|
|
||||||
for (var key in fdataUser) {
|
|
||||||
if (fdataUser[key]) {
|
|
||||||
fdata[key] = fdataUser[key];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var randomPostTimes = 0;
|
|
||||||
var randomPostWorking = false;
|
|
||||||
var randomPostTips = [
|
|
||||||
"钓到了绝世好文!",
|
|
||||||
"在河边打了个喷嚏,吓跑了",
|
|
||||||
"你和小伙伴抢夺着",
|
|
||||||
"你击败了巨龙,在巢穴中发现了",
|
|
||||||
"挖掘秦始皇坟时找到了",
|
|
||||||
"在路边闲逛的时候随手买了一个",
|
|
||||||
"从学校班主任那拿来了孩子上课偷偷看的",
|
|
||||||
"你的同桌无情的从你的语文书中撕下了那篇你最喜欢的",
|
|
||||||
"考古学家近日发现了",
|
|
||||||
"外星人降临地球学习地球文化,落地时被你塞了",
|
|
||||||
"从图书馆顶层的隐秘角落里发现了闪着金光的",
|
|
||||||
"徒弟修炼走火入魔,为师立刻掏出了",
|
|
||||||
"在大山中唱山歌,隔壁的阿妹跑来了,带着",
|
|
||||||
"隔壁家的孩子数学考了满分,都是因为看了",
|
|
||||||
"隔壁家的孩子英语考了满分,都是因为看了",
|
|
||||||
"小米研发了全新一代MIX手机,据说灵感",
|
|
||||||
"修炼渡劫成功,还好提前看了",
|
|
||||||
"库克坐上了苹果CEO的宝座,因为他面试的时候看了",
|
|
||||||
"阿里巴巴大喊芝麻开门,映入眼帘的就是",
|
|
||||||
"师傅说练武要先炼心,然后让我好生研读",
|
|
||||||
"科考队在南极大陆发现了被冰封的",
|
|
||||||
"飞机窗户似乎被一张纸糊上了,仔细一看是",
|
|
||||||
"历史上满写的仁义道德四个字,透过字缝里却全是",
|
|
||||||
"十几年前的录音机似乎还能够使用,插上电发现正在播的是",
|
|
||||||
"新版语文书拟增加一篇熟读并背诵的",
|
|
||||||
"经调查,99%的受访者都没有背诵过",
|
|
||||||
"今年的高考满分作文是",
|
|
||||||
"唐僧揭开了佛祖压在五指山上的",
|
|
||||||
"科学家发现能够解决衰老的秘密,就是每日研读",
|
|
||||||
"英特尔发布了全新的至强处理器,其芯片的制造原理都是",
|
|
||||||
"新的iPhone产能很足,新的进货渠道是",
|
|
||||||
"今年亩产突破了八千万斤,多亏了",
|
|
||||||
"陆隐一统天上宗,在无数祖境高手的目光下宣读了",
|
|
||||||
"黑钻风跟白钻风说道,吃了唐僧肉能长生不老,他知道是因为看了",
|
|
||||||
"上卫生间没带纸,直接提裤跑路也不愿意玷污手中",
|
|
||||||
"种下一篇文章就会产生很多很多文章,我种下了",
|
|
||||||
"三十年河东,三十年河西,莫欺我没有看过",
|
|
||||||
"踏破铁血无觅处,得来全靠",
|
|
||||||
"今日双色球中了两千万,预测全靠",
|
|
||||||
"因为卷子上没写名字,老师罚抄",
|
|
||||||
"为了抗议世间的不公,割破手指写下了",
|
|
||||||
"在艺术大街上被贴满了相同的纸,走近一看是",
|
|
||||||
"这区区迷阵岂能难得住我?其实能走出来多亏了",
|
|
||||||
"今日被一篇文章顶上了微博热搜,它是",
|
|
||||||
"你送给乞丐一个暴富秘籍,它是",
|
|
||||||
"UZI一个走A拿下五杀,在事后采访时说他当时回想起了",
|
|
||||||
"科学家解刨了第一个感染丧尸病毒的人,发现丧尸抗体存在于",
|
|
||||||
"如果你有梦想的话,就要努力去看",
|
|
||||||
"决定我们成为什么样人的,不是我们的能力,而是是否看过",
|
|
||||||
"有信心不一定会成功,没信心就去看",
|
|
||||||
"你真正是谁并不重要,重要的是你看没看过",
|
|
||||||
"玄天境重要的是锻体,为师赠你此书,好好修炼去吧,这是",
|
|
||||||
"上百祖境高手在天威湖大战三天三夜为了抢夺",
|
|
||||||
"这化仙池水乃上古真仙对后人的考校,要求熟读并背诵",
|
|
||||||
"庆氏三千年根基差点竟被你小子毁于一旦,能够被我拯救全是因为我看了",
|
|
||||||
"我就是神奇宝贝大师!我这只皮卡丘可是",
|
|
||||||
"我就是神奇宝贝大师!我这只小火龙可是",
|
|
||||||
"我就是神奇宝贝大师!我这只可达鸭可是",
|
|
||||||
"我就是神奇宝贝大师!我这只杰尼龟可是",
|
|
||||||
"上古遗迹中写道,只要习得此书,便得成功。你定睛一看,原来是",
|
|
||||||
"奶奶的,玩阴的是吧,我就是双料特工代号穿山甲,",
|
|
||||||
"你的背景太假了,我的就逼真多了,学到这个技术全是因为看了",
|
|
||||||
"我是云南的,云南怒江的,怒江芦水市,芦水市六库,六库傈僳族,傈僳族是",
|
|
||||||
"我真的栓Q了,我真的会谢如果你看",
|
|
||||||
"你已经习得退退退神功,接下来的心法已经被记录在",
|
|
||||||
"人生无常大肠包小肠,小肠包住了",
|
|
||||||
"你抽到了普通文章,它是",
|
|
||||||
"你收到了稀有文章,它是",
|
|
||||||
"你抽到了金色普通文章,它是",
|
|
||||||
"你抽到了金色稀有文章,它是",
|
|
||||||
"你抽到了传说文章!它是",
|
|
||||||
"哇!金色传说!你抽到了金色传说文章,它是",
|
|
||||||
"报告!侦察兵说在前往300米有一个男子在偷偷看一本书,上面赫然写着",
|
|
||||||
"芷莲姑娘大摆擂台,谁若是能读完此书,便可娶了她。然后从背后掏出了",
|
|
||||||
"请问你的梦想是什么?我的梦想是能读到",
|
|
||||||
"读什么才能增智慧?当然是读",
|
|
||||||
"纳兰嫣然掏出了退婚书,可是发现出门带错了,结果拿出了一本",
|
|
||||||
"你要尽全力保护你的梦想。那些嘲笑你的人,他们必定会失败,他们想把你变成和他们一样的人。如果你有梦想的话,就要努力去读",
|
|
||||||
"走人生的路就像爬山一样,看起来走了许多冤枉的路,崎岖的路,但终究需要读完",
|
|
||||||
"游戏的规则就是这么的简单,你听懂了吗?管你听没听懂,快去看",
|
|
||||||
];
|
|
||||||
var randomPostClick = 0;
|
|
||||||
function fetchRandomPost() {
|
|
||||||
if (!document.getElementById("random-post")) return;
|
|
||||||
if (randomPostWorking == false) {
|
|
||||||
randomPostWorking = true;
|
|
||||||
//获取旋转角度
|
|
||||||
let randomRotate = randomPostTimes * 360;
|
|
||||||
let randomPostTipsItem = randomPostTips[Math.floor(Math.random() * randomPostTips.length)];
|
|
||||||
let randomPostLevel = "";
|
|
||||||
if (randomPostTimes > 10000) {
|
|
||||||
randomPostLevel = "愿者上钩";
|
|
||||||
} else if (randomPostTimes > 1000) {
|
|
||||||
randomPostLevel = "俯览天下";
|
|
||||||
} else if (randomPostTimes > 1000) {
|
|
||||||
randomPostLevel = "超越神了";
|
|
||||||
} else if (randomPostTimes > 100) {
|
|
||||||
randomPostLevel = "绝世渔夫";
|
|
||||||
} else if (randomPostTimes > 75) {
|
|
||||||
randomPostLevel = "钓鱼王者";
|
|
||||||
} else if (randomPostTimes > 50) {
|
|
||||||
randomPostLevel = "钓鱼宗师";
|
|
||||||
} else if (randomPostTimes > 20) {
|
|
||||||
randomPostLevel = "钓鱼专家";
|
|
||||||
} else if (randomPostTimes > 5) {
|
|
||||||
randomPostLevel = "钓鱼高手";
|
|
||||||
} else {
|
|
||||||
randomPostLevel = "钓鱼新手";
|
|
||||||
}
|
|
||||||
if (randomPostTimes >= 5) {
|
|
||||||
document.getElementById("random-post").innerHTML =
|
|
||||||
`钓鱼中... (Lv.` + randomPostTimes + ` 当前称号:` + randomPostLevel + `)`;
|
|
||||||
} else {
|
|
||||||
document.getElementById("random-post").innerHTML = `钓鱼中...`;
|
|
||||||
}
|
|
||||||
|
|
||||||
let randomTime = randomNum(1000, 3000);
|
|
||||||
|
|
||||||
if (randomPostTimes == 0) {
|
|
||||||
randomTime = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
document.querySelector(".random-post-start").style.opacity = "0.2";
|
|
||||||
document.querySelector(".random-post-start").style.transitionDuration = "0.3s";
|
|
||||||
document.querySelector(".random-post-start").style.transform = "rotate(" + randomRotate + "deg)";
|
|
||||||
|
|
||||||
//判断是否饥饿
|
|
||||||
if (
|
|
||||||
document.getElementById("random-post") &&
|
|
||||||
randomPostClick * fdata.hungryFish + fdata.defaultFish < randomPostTimes &&
|
|
||||||
Math.round(Math.random()) == 0
|
|
||||||
) {
|
|
||||||
document.getElementById("random-post").innerHTML =
|
|
||||||
"因为只钓鱼不吃鱼,过分饥饿导致本次钓鱼失败...(点击任意一篇钓鱼获得的文章即可恢复)";
|
|
||||||
randomPostWorking = false;
|
|
||||||
} else {
|
|
||||||
var fetchUrl = fdata.apiurl + "randompost";
|
|
||||||
fetch(fetchUrl)
|
|
||||||
.then(res => res.json())
|
|
||||||
.then(json => {
|
|
||||||
var title = json.title;
|
|
||||||
var link = json.link;
|
|
||||||
var author = json.author;
|
|
||||||
if (document.getElementById("random-post")) {
|
|
||||||
window.setTimeout(function () {
|
|
||||||
document.getElementById("random-post").innerHTML =
|
|
||||||
randomPostTipsItem +
|
|
||||||
`来自友链 <b>` +
|
|
||||||
author +
|
|
||||||
`</b> 的文章:<a class="random-friends-post" onclick="randomClickLink()" target="_blank" href="` +
|
|
||||||
link +
|
|
||||||
`" rel="external nofollow">` +
|
|
||||||
title +
|
|
||||||
`</a>`;
|
|
||||||
randomPostTimes += 1;
|
|
||||||
localStorage.setItem("randomPostTimes", randomPostTimes);
|
|
||||||
document.querySelector(".random-post-start").style.opacity = "1";
|
|
||||||
}, randomTime);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
randomPostWorking = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//初始化检查
|
|
||||||
function initRandomPost() {
|
|
||||||
// 获取已经存储的数据
|
|
||||||
if (localStorage.randomPostTimes) {
|
|
||||||
randomPostTimes = parseInt(localStorage.randomPostTimes);
|
|
||||||
randomPostClick = parseInt(localStorage.randomPostClick);
|
|
||||||
document.querySelector(".random-post-start").style.transitionDuration = "0.3s";
|
|
||||||
document.querySelector(".random-post-start").style.transform = "rotate(" + 360 * randomPostTimes + "deg)";
|
|
||||||
}
|
|
||||||
fetchRandomPost();
|
|
||||||
}
|
|
||||||
|
|
||||||
initRandomPost();
|
|
||||||
|
|
||||||
//添加点击统计
|
|
||||||
function randomClickLink() {
|
|
||||||
randomPostClick += 1;
|
|
||||||
localStorage.setItem("randomPostClick", randomPostClick);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 生成随机数
|
|
||||||
function randomNum(minNum, maxNum) {
|
|
||||||
switch (arguments.length) {
|
|
||||||
case 1:
|
|
||||||
return parseInt(Math.random() * minNum + 1, 10);
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,479 +0,0 @@
|
|||||||
// 初始化函数
|
|
||||||
rm = {};
|
|
||||||
|
|
||||||
//禁止图片与超链接拖拽
|
|
||||||
let aElements = document.getElementsByTagName("a");
|
|
||||||
for (let i = 0; i < aElements.length; i++) {
|
|
||||||
aElements[i].setAttribute("draggable", "false");
|
|
||||||
let imgElements = aElements[i].getElementsByTagName("img");
|
|
||||||
for (let j = 0; j < imgElements.length; j++) {
|
|
||||||
imgElements[j].setAttribute("draggable", "false");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 显示菜单
|
|
||||||
rm.showRightMenu = function (isTrue, x = 0, y = 0) {
|
|
||||||
console.info(x, y);
|
|
||||||
let rightMenu = document.getElementById("rightMenu");
|
|
||||||
rightMenu.style.top = x + "px";
|
|
||||||
rightMenu.style.left = y + "px";
|
|
||||||
if (isTrue) {
|
|
||||||
rightMenu.style.display = "block";
|
|
||||||
stopMaskScroll();
|
|
||||||
} else {
|
|
||||||
rightMenu.style.display = "none";
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// 隐藏菜单
|
|
||||||
rm.hideRightMenu = function () {
|
|
||||||
rm.showRightMenu(false);
|
|
||||||
let rightMenuMask = document.querySelector("#rightmenu-mask");
|
|
||||||
rightMenuMask.style.display = "none";
|
|
||||||
};
|
|
||||||
|
|
||||||
// 尺寸
|
|
||||||
let rmWidth = document.getElementById("rightMenu").offsetWidth;
|
|
||||||
let rmHeight = document.getElementById("rightMenu").offsetHeight;
|
|
||||||
|
|
||||||
// 重新定义尺寸
|
|
||||||
rm.reloadrmSize = function () {
|
|
||||||
rightMenu.style.visibility = "hidden";
|
|
||||||
rightMenu.style.display = "block";
|
|
||||||
// 获取宽度和高度
|
|
||||||
rmWidth = document.getElementById("rightMenu").offsetWidth;
|
|
||||||
rmHeight = document.getElementById("rightMenu").offsetHeight;
|
|
||||||
rightMenu.style.visibility = "visible";
|
|
||||||
};
|
|
||||||
|
|
||||||
// 获取点击的href
|
|
||||||
let domhref = "";
|
|
||||||
let domImgSrc = "";
|
|
||||||
let globalEvent = null;
|
|
||||||
|
|
||||||
var oncontextmenuFunction = function (event) {
|
|
||||||
if (document.body.clientWidth > 768) {
|
|
||||||
let pageX = event.clientX + 10; //加10是为了防止显示时鼠标遮在菜单上
|
|
||||||
let pageY = event.clientY;
|
|
||||||
|
|
||||||
//其他额外菜单
|
|
||||||
const $rightMenuOther = document.querySelector(".rightMenuOther");
|
|
||||||
const $rightMenuPlugin = document.querySelector(".rightMenuPlugin");
|
|
||||||
const $rightMenuCopyText = document.querySelector("#menu-copytext");
|
|
||||||
const $rightMenuPasteText = document.querySelector("#menu-pastetext");
|
|
||||||
const $rightMenuCommentText = document.querySelector("#menu-commenttext");
|
|
||||||
const $rightMenuNewWindow = document.querySelector("#menu-newwindow");
|
|
||||||
const $rightMenuNewWindowImg = document.querySelector("#menu-newwindowimg");
|
|
||||||
const $rightMenuCopyLink = document.querySelector("#menu-copylink");
|
|
||||||
const $rightMenuCopyImg = document.querySelector("#menu-copyimg");
|
|
||||||
const $rightMenuDownloadImg = document.querySelector("#menu-downloadimg");
|
|
||||||
const $rightMenuSearch = document.querySelector("#menu-search");
|
|
||||||
const $rightMenuSearchBaidu = document.querySelector("#menu-searchBaidu");
|
|
||||||
const $rightMenuMusicToggle = document.querySelector("#menu-music-toggle");
|
|
||||||
const $rightMenuMusicBack = document.querySelector("#menu-music-back");
|
|
||||||
const $rightMenuMusicForward = document.querySelector("#menu-music-forward");
|
|
||||||
const $rightMenuMusicPlaylist = document.querySelector("#menu-music-playlist");
|
|
||||||
const $rightMenuMusicCopyMusicName = document.querySelector("#menu-music-copyMusicName");
|
|
||||||
|
|
||||||
let href = event.target.href;
|
|
||||||
let imgsrc = event.target.currentSrc;
|
|
||||||
|
|
||||||
// 判断模式 扩展模式为有事件
|
|
||||||
let pluginMode = false;
|
|
||||||
$rightMenuOther.style.display = "block";
|
|
||||||
globalEvent = event;
|
|
||||||
|
|
||||||
// 检查是否需要复制 是否有选中文本
|
|
||||||
if (selectTextNow && window.getSelection()) {
|
|
||||||
pluginMode = true;
|
|
||||||
$rightMenuCopyText.style.display = "block";
|
|
||||||
$rightMenuCommentText.style.display = "block";
|
|
||||||
$rightMenuSearch.style.display = "block";
|
|
||||||
$rightMenuSearchBaidu.style.display = "block";
|
|
||||||
} else {
|
|
||||||
$rightMenuCopyText.style.display = "none";
|
|
||||||
$rightMenuCommentText.style.display = "none";
|
|
||||||
$rightMenuSearchBaidu.style.display = "none";
|
|
||||||
$rightMenuSearch.style.display = "none";
|
|
||||||
}
|
|
||||||
|
|
||||||
//检查是否右键点击了链接a标签
|
|
||||||
if (href) {
|
|
||||||
pluginMode = true;
|
|
||||||
$rightMenuNewWindow.style.display = "block";
|
|
||||||
$rightMenuCopyLink.style.display = "block";
|
|
||||||
domhref = href;
|
|
||||||
} else {
|
|
||||||
$rightMenuNewWindow.style.display = "none";
|
|
||||||
$rightMenuCopyLink.style.display = "none";
|
|
||||||
}
|
|
||||||
|
|
||||||
//检查是否需要复制图片
|
|
||||||
if (imgsrc) {
|
|
||||||
pluginMode = true;
|
|
||||||
$rightMenuCopyImg.style.display = "block";
|
|
||||||
$rightMenuDownloadImg.style.display = "block";
|
|
||||||
$rightMenuNewWindowImg.style.display = "block";
|
|
||||||
document.getElementById("rightMenu").style.width = "12rem";
|
|
||||||
domImgSrc = imgsrc;
|
|
||||||
} else {
|
|
||||||
$rightMenuCopyImg.style.display = "none";
|
|
||||||
$rightMenuDownloadImg.style.display = "none";
|
|
||||||
$rightMenuNewWindowImg.style.display = "none";
|
|
||||||
}
|
|
||||||
|
|
||||||
// 判断是否为输入框
|
|
||||||
if (event.target.tagName.toLowerCase() === "input" || event.target.tagName.toLowerCase() === "textarea") {
|
|
||||||
pluginMode = true;
|
|
||||||
$rightMenuPasteText.style.display = "block";
|
|
||||||
} else {
|
|
||||||
$rightMenuPasteText.style.display = "none";
|
|
||||||
}
|
|
||||||
const navMusicEl = document.querySelector("#nav-music");
|
|
||||||
//判断是否是音乐
|
|
||||||
if (navMusicEl && navMusicEl.contains(event.target)) {
|
|
||||||
pluginMode = true;
|
|
||||||
$rightMenuMusicToggle.style.display = "block";
|
|
||||||
$rightMenuMusicBack.style.display = "block";
|
|
||||||
$rightMenuMusicForward.style.display = "block";
|
|
||||||
$rightMenuMusicPlaylist.style.display = "block";
|
|
||||||
$rightMenuMusicCopyMusicName.style.display = "block";
|
|
||||||
} else {
|
|
||||||
$rightMenuMusicToggle.style.display = "none";
|
|
||||||
$rightMenuMusicBack.style.display = "none";
|
|
||||||
$rightMenuMusicForward.style.display = "none";
|
|
||||||
$rightMenuMusicPlaylist.style.display = "none";
|
|
||||||
$rightMenuMusicCopyMusicName.style.display = "none";
|
|
||||||
}
|
|
||||||
|
|
||||||
// 如果不是扩展模式则隐藏扩展模块
|
|
||||||
if (pluginMode) {
|
|
||||||
$rightMenuOther.style.display = "none";
|
|
||||||
$rightMenuPlugin.style.display = "block";
|
|
||||||
} else {
|
|
||||||
$rightMenuPlugin.style.display = "none";
|
|
||||||
}
|
|
||||||
|
|
||||||
rm.reloadrmSize();
|
|
||||||
|
|
||||||
// 鼠标默认显示在鼠标右下方,当鼠标靠右或靠下时,将菜单显示在鼠标左方\上方
|
|
||||||
if (pageX + rmWidth > window.innerWidth) {
|
|
||||||
pageX -= rmWidth + 10;
|
|
||||||
}
|
|
||||||
if (pageY + rmHeight > window.innerHeight) {
|
|
||||||
pageY -= pageY + rmHeight - window.innerHeight;
|
|
||||||
}
|
|
||||||
|
|
||||||
rm.showRightMenu(true, pageY, pageX);
|
|
||||||
document.getElementById("rightmenu-mask").style.display = "flex";
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// 监听右键初始化
|
|
||||||
window.oncontextmenu = oncontextmenuFunction;
|
|
||||||
|
|
||||||
// 下载图片状态
|
|
||||||
rm.downloadimging = false;
|
|
||||||
|
|
||||||
// 复制图片到剪贴板
|
|
||||||
rm.writeClipImg = function (imgsrc) {
|
|
||||||
console.log("按下复制");
|
|
||||||
rm.hideRightMenu();
|
|
||||||
anzhiyu.snackbarShow("正在下载中,请稍后", false, 10000);
|
|
||||||
if (rm.downloadimging == false) {
|
|
||||||
rm.downloadimging = true;
|
|
||||||
setTimeout(function () {
|
|
||||||
copyImage(imgsrc);
|
|
||||||
anzhiyu.snackbarShow("复制成功!图片已添加盲水印,请遵守版权协议");
|
|
||||||
rm.downloadimging = false;
|
|
||||||
}, "10000");
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
function imageToBlob(imageURL) {
|
|
||||||
const img = new Image();
|
|
||||||
const c = document.createElement("canvas");
|
|
||||||
const ctx = c.getContext("2d");
|
|
||||||
img.crossOrigin = "";
|
|
||||||
img.src = imageURL;
|
|
||||||
return new Promise(resolve => {
|
|
||||||
img.onload = function () {
|
|
||||||
c.width = this.naturalWidth;
|
|
||||||
c.height = this.naturalHeight;
|
|
||||||
ctx.drawImage(this, 0, 0);
|
|
||||||
c.toBlob(
|
|
||||||
blob => {
|
|
||||||
// here the image is a blob
|
|
||||||
resolve(blob);
|
|
||||||
},
|
|
||||||
"image/png",
|
|
||||||
0.75
|
|
||||||
);
|
|
||||||
};
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
async function copyImage(imageURL) {
|
|
||||||
const blob = await imageToBlob(imageURL);
|
|
||||||
const item = new ClipboardItem({ "image/png": blob });
|
|
||||||
navigator.clipboard.write([item]);
|
|
||||||
}
|
|
||||||
|
|
||||||
rm.copyUrl = function (id) {
|
|
||||||
const input = document.createElement("input"); // Create a new <input> element
|
|
||||||
input.id = "copyVal"; // Set the id of the new element to "copyVal"
|
|
||||||
document.body.appendChild(input); // Append the new element to the end of the <body> element
|
|
||||||
|
|
||||||
const text = id;
|
|
||||||
input.value = text;
|
|
||||||
input.select();
|
|
||||||
input.setSelectionRange(0, input.value.length);
|
|
||||||
document.execCommand("copy");
|
|
||||||
|
|
||||||
input.remove(); // Remove the <input> element from the DOM
|
|
||||||
};
|
|
||||||
|
|
||||||
function stopMaskScroll() {
|
|
||||||
if (document.getElementById("rightmenu-mask")) {
|
|
||||||
let xscroll = document.getElementById("rightmenu-mask");
|
|
||||||
xscroll.addEventListener(
|
|
||||||
"mousewheel",
|
|
||||||
function (e) {
|
|
||||||
//阻止浏览器默认方法
|
|
||||||
rm.hideRightMenu();
|
|
||||||
// e.preventDefault();
|
|
||||||
},
|
|
||||||
{ passive: true }
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (document.getElementById("rightMenu")) {
|
|
||||||
let xscroll = document.getElementById("rightMenu");
|
|
||||||
xscroll.addEventListener(
|
|
||||||
"mousewheel",
|
|
||||||
function (e) {
|
|
||||||
//阻止浏览器默认方法
|
|
||||||
rm.hideRightMenu();
|
|
||||||
// e.preventDefault();
|
|
||||||
},
|
|
||||||
{ passive: true }
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
rm.rightmenuCopyText = function (txt) {
|
|
||||||
if (navigator.clipboard) {
|
|
||||||
navigator.clipboard.writeText(txt);
|
|
||||||
}
|
|
||||||
rm.hideRightMenu();
|
|
||||||
};
|
|
||||||
|
|
||||||
rm.copyPageUrl = function (url) {
|
|
||||||
if (!url) {
|
|
||||||
url = window.location.href;
|
|
||||||
}
|
|
||||||
rm.copyUrl(url);
|
|
||||||
anzhiyu.snackbarShow("复制链接地址成功", false, 2000);
|
|
||||||
rm.hideRightMenu();
|
|
||||||
};
|
|
||||||
|
|
||||||
// 复制当前选中文本
|
|
||||||
var selectTextNow = "";
|
|
||||||
document.onmouseup = document.ondblclick = selceText;
|
|
||||||
|
|
||||||
function selceText() {
|
|
||||||
var txt;
|
|
||||||
if (document.selection) {
|
|
||||||
txt = document.selection.createRange().text;
|
|
||||||
} else {
|
|
||||||
txt = window.getSelection().toString();
|
|
||||||
}
|
|
||||||
selectTextNow = txt !== "" ? txt : "";
|
|
||||||
}
|
|
||||||
|
|
||||||
// 读取剪切板
|
|
||||||
rm.readClipboard = function () {
|
|
||||||
if (navigator.clipboard) {
|
|
||||||
navigator.clipboard.readText().then(clipText => rm.insertAtCaret(globalEvent.target, clipText));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// 粘贴文本到焦点
|
|
||||||
rm.insertAtCaret = function (elemt, value) {
|
|
||||||
const startPos = elemt.selectionStart,
|
|
||||||
endPos = elemt.selectionEnd;
|
|
||||||
if (document.selection) {
|
|
||||||
elemt.focus();
|
|
||||||
var sel = document.selection.createRange();
|
|
||||||
sel.text = value;
|
|
||||||
elemt.focus();
|
|
||||||
} else {
|
|
||||||
if (startPos || startPos == "0") {
|
|
||||||
var scrollTop = elemt.scrollTop;
|
|
||||||
elemt.value = elemt.value.substring(0, startPos) + value + elemt.value.substring(endPos, elemt.value.length);
|
|
||||||
elemt.focus();
|
|
||||||
elemt.selectionStart = startPos + value.length;
|
|
||||||
elemt.selectionEnd = startPos + value.length;
|
|
||||||
elemt.scrollTop = scrollTop;
|
|
||||||
} else {
|
|
||||||
elemt.value += value;
|
|
||||||
elemt.focus();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
//粘贴文本
|
|
||||||
rm.pasteText = function () {
|
|
||||||
const result = rm.readClipboard() || "";
|
|
||||||
rm.hideRightMenu();
|
|
||||||
};
|
|
||||||
|
|
||||||
//引用到评论
|
|
||||||
rm.rightMenuCommentText = function (txt) {
|
|
||||||
rm.hideRightMenu();
|
|
||||||
const postCommentDom = document.getElementById("post-comment");
|
|
||||||
var domTop = postCommentDom.offsetTop;
|
|
||||||
window.scrollTo(0, domTop - 80);
|
|
||||||
if (txt == "undefined" || txt == "null") txt = "好棒!";
|
|
||||||
function setText() {
|
|
||||||
setTimeout(() => {
|
|
||||||
var input = document.getElementsByClassName("el-textarea__inner")[0];
|
|
||||||
if (!input) setText();
|
|
||||||
let evt = document.createEvent("HTMLEvents");
|
|
||||||
evt.initEvent("input", true, true);
|
|
||||||
let inputValue = replaceAll(txt, "\n", "\n> ");
|
|
||||||
input.value = "> " + inputValue + "\n\n";
|
|
||||||
input.dispatchEvent(evt);
|
|
||||||
input.focus();
|
|
||||||
input.setSelectionRange(-1, -1);
|
|
||||||
if (document.getElementById("comment-tips")) {
|
|
||||||
document.getElementById("comment-tips").classList.add("show");
|
|
||||||
}
|
|
||||||
}, 100);
|
|
||||||
}
|
|
||||||
setText();
|
|
||||||
};
|
|
||||||
|
|
||||||
//替换所有内容
|
|
||||||
function replaceAll(string, search, replace) {
|
|
||||||
return string.split(search).join(replace);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 百度搜索
|
|
||||||
rm.searchBaidu = function () {
|
|
||||||
anzhiyu.snackbarShow("即将跳转到百度搜索", false, 2000);
|
|
||||||
setTimeout(function () {
|
|
||||||
window.open("https://www.baidu.com/s?wd=" + selectTextNow);
|
|
||||||
}, "2000");
|
|
||||||
rm.hideRightMenu();
|
|
||||||
};
|
|
||||||
|
|
||||||
//分享链接
|
|
||||||
rm.copyLink = function () {
|
|
||||||
rm.rightmenuCopyText(domhref);
|
|
||||||
anzhiyu.snackbarShow("已复制链接地址");
|
|
||||||
};
|
|
||||||
|
|
||||||
function addRightMenuClickEvent() {
|
|
||||||
// 添加点击事件
|
|
||||||
document.getElementById("menu-backward").addEventListener("click", function () {
|
|
||||||
window.history.back();
|
|
||||||
rm.hideRightMenu();
|
|
||||||
});
|
|
||||||
|
|
||||||
document.getElementById("menu-forward").addEventListener("click", function () {
|
|
||||||
window.history.forward();
|
|
||||||
rm.hideRightMenu();
|
|
||||||
});
|
|
||||||
|
|
||||||
document.getElementById("menu-refresh").addEventListener("click", function () {
|
|
||||||
window.location.reload();
|
|
||||||
});
|
|
||||||
|
|
||||||
document.getElementById("menu-top").addEventListener("click", function () {
|
|
||||||
anzhiyu.scrollToDest(0, 500);
|
|
||||||
rm.hideRightMenu();
|
|
||||||
});
|
|
||||||
|
|
||||||
document.getElementById("menu-translate").addEventListener("click", function () {
|
|
||||||
window.translateFn.translatePage();
|
|
||||||
rm.hideRightMenu();
|
|
||||||
});
|
|
||||||
|
|
||||||
const menuLinks = document.querySelectorAll(".menu-link");
|
|
||||||
menuLinks.forEach(function (link) {
|
|
||||||
link.addEventListener("click", rm.hideRightMenu);
|
|
||||||
});
|
|
||||||
|
|
||||||
document.getElementById("menu-home") &&
|
|
||||||
document.getElementById("menu-home").addEventListener("click", function () {
|
|
||||||
window.location.href = window.location.origin;
|
|
||||||
});
|
|
||||||
|
|
||||||
document.getElementById("menu-randomPost").addEventListener("click", function () {
|
|
||||||
toRandomPost();
|
|
||||||
});
|
|
||||||
|
|
||||||
document.getElementById("menu-commentBarrage").addEventListener("click", anzhiyu.switchCommentBarrage);
|
|
||||||
|
|
||||||
document.getElementById("rightmenu-mask").addEventListener("click", rm.hideRightMenu);
|
|
||||||
|
|
||||||
document.getElementById("rightmenu-mask").addEventListener("contextmenu", function (event) {
|
|
||||||
rm.hideRightMenu();
|
|
||||||
event.preventDefault(); // Prevent the default context menu from appearing
|
|
||||||
});
|
|
||||||
|
|
||||||
document.getElementById("menu-copy").addEventListener("click", () => {
|
|
||||||
rm.copyPageUrl();
|
|
||||||
});
|
|
||||||
|
|
||||||
document.getElementById("menu-pastetext").addEventListener("click", rm.pasteText);
|
|
||||||
|
|
||||||
document.getElementById("menu-copytext").addEventListener("click", function () {
|
|
||||||
rm.rightmenuCopyText(selectTextNow);
|
|
||||||
const copyright = GLOBAL_CONFIG.copyright;
|
|
||||||
if (copyright.copy) {
|
|
||||||
anzhiyu.snackbarShow(copyright.languages.copySuccess);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
document.getElementById("menu-commenttext").addEventListener("click", function () {
|
|
||||||
rm.rightMenuCommentText(selectTextNow);
|
|
||||||
});
|
|
||||||
|
|
||||||
document.getElementById("menu-newwindow").addEventListener("click", function () {
|
|
||||||
window.open(domhref, "_blank");
|
|
||||||
rm.hideRightMenu();
|
|
||||||
});
|
|
||||||
|
|
||||||
document.getElementById("menu-copylink").addEventListener("click", rm.copyLink);
|
|
||||||
|
|
||||||
document.getElementById("menu-downloadimg").addEventListener("click", function () {
|
|
||||||
anzhiyu.downloadImage(domImgSrc, "anzhiyu");
|
|
||||||
});
|
|
||||||
|
|
||||||
document.getElementById("menu-newwindowimg").addEventListener("click", function () {
|
|
||||||
window.open(domImgSrc, "_blank");
|
|
||||||
rm.hideRightMenu();
|
|
||||||
});
|
|
||||||
|
|
||||||
document.getElementById("menu-copyimg").addEventListener("click", function () {
|
|
||||||
rm.writeClipImg(domImgSrc);
|
|
||||||
});
|
|
||||||
|
|
||||||
document.getElementById("menu-searchBaidu").addEventListener("click", rm.searchBaidu);
|
|
||||||
|
|
||||||
//音乐
|
|
||||||
document.getElementById("menu-music-toggle").addEventListener("click", anzhiyu.musicToggle);
|
|
||||||
|
|
||||||
document.getElementById("menu-music-back").addEventListener("click", anzhiyu.musicSkipBack);
|
|
||||||
|
|
||||||
document.getElementById("menu-music-forward").addEventListener("click", anzhiyu.musicSkipForward);
|
|
||||||
|
|
||||||
document.getElementById("menu-music-copyMusicName").addEventListener("click", function () {
|
|
||||||
rm.rightmenuCopyText(anzhiyu.musicGetName());
|
|
||||||
anzhiyu.snackbarShow("复制歌曲名称成功", false, 3000);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
addRightMenuClickEvent();
|
|
||||||
2093
public/js/main.js
@@ -1,74 +1,83 @@
|
|||||||
window.addEventListener("load", () => {
|
window.addEventListener('load', () => {
|
||||||
const $searchMask = document.getElementById("search-mask");
|
const $searchMask = document.getElementById('search-mask')
|
||||||
const $searchDialog = document.querySelector("#algolia-search .search-dialog");
|
const $searchDialog = document.querySelector('#algolia-search .search-dialog')
|
||||||
|
|
||||||
const openSearch = () => {
|
const openSearch = () => {
|
||||||
anzhiyu.animateIn($searchMask, "to_show 0.5s");
|
const bodyStyle = document.body.style
|
||||||
$searchDialog.style.display = "block";
|
bodyStyle.width = '100%'
|
||||||
setTimeout(() => {
|
bodyStyle.overflow = 'hidden'
|
||||||
document.querySelector("#algolia-search .ais-SearchBox-input").focus();
|
btf.animateIn($searchMask, 'to_show 0.5s')
|
||||||
}, 100);
|
btf.animateIn($searchDialog, 'titleScale 0.5s')
|
||||||
|
setTimeout(() => { document.querySelector('#algolia-search .ais-SearchBox-input').focus() }, 100)
|
||||||
|
|
||||||
// shortcut: ESC
|
// shortcut: ESC
|
||||||
document.addEventListener("keydown", function f(event) {
|
document.addEventListener('keydown', function f (event) {
|
||||||
if (event.code === "Escape") {
|
if (event.code === 'Escape') {
|
||||||
closeSearch();
|
closeSearch()
|
||||||
document.removeEventListener("keydown", f);
|
document.removeEventListener('keydown', f)
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
|
||||||
fixSafariHeight();
|
fixSafariHeight()
|
||||||
window.addEventListener("resize", fixSafariHeight);
|
window.addEventListener('resize', fixSafariHeight)
|
||||||
};
|
|
||||||
|
|
||||||
// shortcut: shift+S
|
|
||||||
if (anzhiyu_keyboard) {
|
|
||||||
window.addEventListener("keydown", function (event) {
|
|
||||||
if (event.keyCode == 83 && event.shiftKey) {
|
|
||||||
console.info(selectTextNow);
|
|
||||||
if (selectTextNow) {
|
|
||||||
openSearch();
|
|
||||||
const t = document.querySelector("#algolia-search-input > div > form > input");
|
|
||||||
t.value = selectTextNow;
|
|
||||||
t.dispatchEvent(new Event("input"));
|
|
||||||
setTimeout(() => {
|
|
||||||
document.querySelector("#algolia-search-input > div > form > button.ais-SearchBox-submit").click();
|
|
||||||
}, 64);
|
|
||||||
} else {
|
|
||||||
openSearch();
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const closeSearch = () => {
|
const closeSearch = () => {
|
||||||
anzhiyu.animateOut($searchDialog, "search_close .5s");
|
const bodyStyle = document.body.style
|
||||||
anzhiyu.animateOut($searchMask, "to_hide 0.5s");
|
bodyStyle.width = ''
|
||||||
window.removeEventListener("resize", fixSafariHeight);
|
bodyStyle.overflow = ''
|
||||||
};
|
btf.animateOut($searchDialog, 'search_close .5s')
|
||||||
|
btf.animateOut($searchMask, 'to_hide 0.5s')
|
||||||
|
window.removeEventListener('resize', fixSafariHeight)
|
||||||
|
}
|
||||||
|
|
||||||
// fix safari
|
// fix safari
|
||||||
const fixSafariHeight = () => {
|
const fixSafariHeight = () => {
|
||||||
if (window.innerWidth < 768) {
|
if (window.innerWidth < 768) {
|
||||||
$searchDialog.style.setProperty("--search-height", window.innerHeight + "px");
|
$searchDialog.style.setProperty('--search-height', window.innerHeight + 'px')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
const searchClickFn = () => {
|
const searchClickFn = () => {
|
||||||
anzhiyu.addEventListenerPjax(document.querySelector("#search-button > .search"), "click", openSearch);
|
btf.addEventListenerPjax(document.querySelector('#search-button > .search'), 'click', openSearch)
|
||||||
};
|
}
|
||||||
|
|
||||||
const searchFnOnce = () => {
|
const searchFnOnce = () => {
|
||||||
$searchMask.addEventListener("click", closeSearch);
|
$searchMask.addEventListener('click', closeSearch)
|
||||||
document.querySelector("#algolia-search .search-close-button").addEventListener("click", closeSearch);
|
document.querySelector('#algolia-search .search-close-button').addEventListener('click', closeSearch)
|
||||||
};
|
}
|
||||||
|
|
||||||
const algolia = GLOBAL_CONFIG.algolia;
|
const cutContent = content => {
|
||||||
const isAlgoliaValid = algolia.appId && algolia.apiKey && algolia.indexName;
|
if (content === '') return ''
|
||||||
|
|
||||||
|
const firstOccur = content.indexOf('<mark>')
|
||||||
|
|
||||||
|
let start = firstOccur - 30
|
||||||
|
let end = firstOccur + 120
|
||||||
|
let pre = ''
|
||||||
|
let post = ''
|
||||||
|
|
||||||
|
if (start <= 0) {
|
||||||
|
start = 0
|
||||||
|
end = 140
|
||||||
|
} else {
|
||||||
|
pre = '...'
|
||||||
|
}
|
||||||
|
|
||||||
|
if (end > content.length) {
|
||||||
|
end = content.length
|
||||||
|
} else {
|
||||||
|
post = '...'
|
||||||
|
}
|
||||||
|
|
||||||
|
const matchContent = pre + content.substring(start, end) + post
|
||||||
|
return matchContent
|
||||||
|
}
|
||||||
|
|
||||||
|
const algolia = GLOBAL_CONFIG.algolia
|
||||||
|
const isAlgoliaValid = algolia.appId && algolia.apiKey && algolia.indexName
|
||||||
if (!isAlgoliaValid) {
|
if (!isAlgoliaValid) {
|
||||||
return console.error("Algolia setting is invalid!");
|
return console.error('Algolia setting is invalid!')
|
||||||
}
|
}
|
||||||
|
|
||||||
const search = instantsearch({
|
const search = instantsearch({
|
||||||
@@ -76,117 +85,93 @@ window.addEventListener("load", () => {
|
|||||||
/* global algoliasearch */
|
/* global algoliasearch */
|
||||||
searchClient: algoliasearch(algolia.appId, algolia.apiKey),
|
searchClient: algoliasearch(algolia.appId, algolia.apiKey),
|
||||||
searchFunction (helper) {
|
searchFunction (helper) {
|
||||||
if (helper.state.query) {
|
helper.state.query && helper.search()
|
||||||
let innerLoading = '<i class="anzhiyufont anzhiyu-icon-spinner anzhiyu-spin"></i>';
|
|
||||||
document.getElementById("algolia-hits").innerHTML = innerLoading;
|
|
||||||
helper.search();
|
|
||||||
}
|
}
|
||||||
},
|
})
|
||||||
});
|
|
||||||
|
|
||||||
const configure = instantsearch.widgets.configure({
|
const configure = instantsearch.widgets.configure({
|
||||||
hitsPerPage: algolia.hits.per_page ?? 5,
|
hitsPerPage: 5
|
||||||
});
|
})
|
||||||
|
|
||||||
const searchBox = instantsearch.widgets.searchBox({
|
const searchBox = instantsearch.widgets.searchBox({
|
||||||
container: "#algolia-search-input",
|
container: '#algolia-search-input',
|
||||||
showReset: false,
|
showReset: false,
|
||||||
showSubmit: false,
|
showSubmit: false,
|
||||||
placeholder: algolia.languages.input_placeholder,
|
placeholder: GLOBAL_CONFIG.algolia.languages.input_placeholder,
|
||||||
showLoadingIndicator: true,
|
showLoadingIndicator: true
|
||||||
searchOnEnterKeyPressOnly: true,
|
})
|
||||||
searchAsYouType: false,
|
|
||||||
});
|
|
||||||
|
|
||||||
const hits = instantsearch.widgets.hits({
|
const hits = instantsearch.widgets.hits({
|
||||||
container: "#algolia-hits",
|
container: '#algolia-hits',
|
||||||
templates: {
|
templates: {
|
||||||
item (data) {
|
item (data) {
|
||||||
const link = data.permalink ? data.permalink : GLOBAL_CONFIG.root + data.path;
|
const link = data.permalink ? data.permalink : (GLOBAL_CONFIG.root + data.path)
|
||||||
const result = data._highlightResult;
|
const result = data._highlightResult
|
||||||
const loadingLogo = document.querySelector("#algolia-hits .anzhiyu-spin");
|
const content = result.contentStripTruncate
|
||||||
if (loadingLogo) {
|
? cutContent(result.contentStripTruncate.value)
|
||||||
loadingLogo.style.display = "none";
|
: result.contentStrip
|
||||||
}
|
? cutContent(result.contentStrip.value)
|
||||||
setTimeout(() => {
|
: result.content
|
||||||
document.querySelector("#algolia-search .ais-SearchBox-input").focus();
|
? cutContent(result.content.value)
|
||||||
}, 200);
|
: ''
|
||||||
return `
|
return `
|
||||||
<a href="${link}" class="algolia-hit-item-link">
|
<a href="${link}" class="algolia-hit-item-link">
|
||||||
<span class="algolia-hits-item-title">${result.title.value || "no-title"}</span>
|
<span class="algolia-hits-item-title">${result.title.value || 'no-title'}</span>
|
||||||
</a>`;
|
<p class="algolia-hit-item-content">${content}</p>
|
||||||
|
</a>`
|
||||||
},
|
},
|
||||||
empty: function (data) {
|
empty: function (data) {
|
||||||
const loadingLogo = document.querySelector("#algolia-hits .anzhiyu-spin");
|
|
||||||
console.info(loadingLogo);
|
|
||||||
if (loadingLogo) {
|
|
||||||
loadingLogo.style.display = "none";
|
|
||||||
}
|
|
||||||
setTimeout(() => {
|
|
||||||
document.querySelector("#algolia-search .ais-SearchBox-input").focus();
|
|
||||||
}, 200);
|
|
||||||
return (
|
return (
|
||||||
'<div id="algolia-hits-empty">' +
|
'<div id="algolia-hits-empty">' +
|
||||||
GLOBAL_CONFIG.algolia.languages.hits_empty.replace(/\$\{query}/, data.query) +
|
GLOBAL_CONFIG.algolia.languages.hits_empty.replace(/\$\{query}/, data.query) +
|
||||||
"</div>"
|
'</div>'
|
||||||
);
|
)
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
cssClasses: {
|
})
|
||||||
item: "algolia-hit-item",
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const stats = instantsearch.widgets.stats({
|
const stats = instantsearch.widgets.stats({
|
||||||
container: "#algolia-info > .algolia-stats",
|
container: '#algolia-info > .algolia-stats',
|
||||||
templates: {
|
templates: {
|
||||||
text: function (data) {
|
text: function (data) {
|
||||||
const stats = GLOBAL_CONFIG.algolia.languages.hits_stats
|
const stats = GLOBAL_CONFIG.algolia.languages.hits_stats
|
||||||
.replace(/\$\{hits}/, data.nbHits)
|
.replace(/\$\{hits}/, data.nbHits)
|
||||||
.replace(/\$\{time}/, data.processingTimeMS);
|
.replace(/\$\{time}/, data.processingTimeMS)
|
||||||
return `<hr>${stats}`;
|
return (
|
||||||
},
|
`<hr>${stats}`
|
||||||
},
|
)
|
||||||
});
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
const powerBy = instantsearch.widgets.poweredBy({
|
const powerBy = instantsearch.widgets.poweredBy({
|
||||||
container: "#algolia-info > .algolia-poweredBy",
|
container: '#algolia-info > .algolia-poweredBy'
|
||||||
});
|
})
|
||||||
|
|
||||||
const pagination = instantsearch.widgets.pagination({
|
const pagination = instantsearch.widgets.pagination({
|
||||||
container: "#algolia-pagination",
|
container: '#algolia-pagination',
|
||||||
totalPages: algolia.hits.per_page ?? 5,
|
totalPages: 5,
|
||||||
templates: {
|
templates: {
|
||||||
first: '<i class="anzhiyufont anzhiyu-icon-angle-double-left"></i>',
|
first: '<i class="fas fa-angle-double-left"></i>',
|
||||||
last: '<i class="anzhiyufont anzhiyu-icon-angle-double-right"></i>',
|
last: '<i class="fas fa-angle-double-right"></i>',
|
||||||
previous: '<i class="anzhiyufont anzhiyu-icon-angle-left"></i>',
|
previous: '<i class="fas fa-angle-left"></i>',
|
||||||
next: '<i class="anzhiyufont anzhiyu-icon-angle-right"></i>',
|
next: '<i class="fas fa-angle-right"></i>'
|
||||||
},
|
}
|
||||||
scrollTo: false,
|
})
|
||||||
showFirstLast: false,
|
|
||||||
cssClasses: {
|
|
||||||
root: "pagination",
|
|
||||||
item: "pagination-item",
|
|
||||||
link: "page-number",
|
|
||||||
active: "current",
|
|
||||||
disabled: "disabled-item",
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
search.addWidgets([configure, searchBox, hits, stats, powerBy, pagination]); // add the widgets to the instantsearch instance
|
search.addWidgets([configure, searchBox, hits, stats, powerBy, pagination]) // add the widgets to the instantsearch instance
|
||||||
|
|
||||||
search.start();
|
search.start()
|
||||||
|
|
||||||
searchClickFn();
|
searchClickFn()
|
||||||
searchFnOnce();
|
searchFnOnce()
|
||||||
|
|
||||||
window.addEventListener("pjax:complete", () => {
|
window.addEventListener('pjax:complete', () => {
|
||||||
!anzhiyu.isHidden($searchMask) && closeSearch();
|
!btf.isHidden($searchMask) && closeSearch()
|
||||||
searchClickFn();
|
searchClickFn()
|
||||||
});
|
})
|
||||||
|
|
||||||
window.pjax &&
|
window.pjax && search.on('render', () => {
|
||||||
search.on("render", () => {
|
window.pjax.refresh(document.getElementById('algolia-hits'))
|
||||||
window.pjax.refresh(document.getElementById("algolia-hits"));
|
})
|
||||||
});
|
})
|
||||||
});
|
|
||||||
|
|||||||
@@ -1,270 +1,364 @@
|
|||||||
window.addEventListener("load", () => {
|
/**
|
||||||
let loadFlag = false;
|
* Refer to hexo-generator-searchdb
|
||||||
let dataObj = [];
|
* https://github.com/next-theme/hexo-generator-searchdb/blob/main/dist/search.js
|
||||||
const $searchMask = document.getElementById("search-mask");
|
* Modified by hexo-theme-butterfly
|
||||||
|
*/
|
||||||
|
|
||||||
|
class LocalSearch {
|
||||||
|
constructor ({
|
||||||
|
path = '',
|
||||||
|
unescape = false,
|
||||||
|
top_n_per_article = 1
|
||||||
|
}) {
|
||||||
|
this.path = path
|
||||||
|
this.unescape = unescape
|
||||||
|
this.top_n_per_article = top_n_per_article
|
||||||
|
this.isfetched = false
|
||||||
|
this.datas = null
|
||||||
|
}
|
||||||
|
|
||||||
|
getIndexByWord (words, text, caseSensitive = false) {
|
||||||
|
const index = []
|
||||||
|
const included = new Set()
|
||||||
|
|
||||||
|
if (!caseSensitive) {
|
||||||
|
text = text.toLowerCase()
|
||||||
|
}
|
||||||
|
words.forEach(word => {
|
||||||
|
if (this.unescape) {
|
||||||
|
const div = document.createElement('div')
|
||||||
|
div.innerText = word
|
||||||
|
word = div.innerHTML
|
||||||
|
}
|
||||||
|
const wordLen = word.length
|
||||||
|
if (wordLen === 0) return
|
||||||
|
let startPosition = 0
|
||||||
|
let position = -1
|
||||||
|
if (!caseSensitive) {
|
||||||
|
word = word.toLowerCase()
|
||||||
|
}
|
||||||
|
while ((position = text.indexOf(word, startPosition)) > -1) {
|
||||||
|
index.push({ position, word })
|
||||||
|
included.add(word)
|
||||||
|
startPosition = position + wordLen
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// Sort index by position of keyword
|
||||||
|
index.sort((left, right) => {
|
||||||
|
if (left.position !== right.position) {
|
||||||
|
return left.position - right.position
|
||||||
|
}
|
||||||
|
return right.word.length - left.word.length
|
||||||
|
})
|
||||||
|
return [index, included]
|
||||||
|
}
|
||||||
|
|
||||||
|
// Merge hits into slices
|
||||||
|
mergeIntoSlice (start, end, index) {
|
||||||
|
let item = index[0]
|
||||||
|
let { position, word } = item
|
||||||
|
const hits = []
|
||||||
|
const count = new Set()
|
||||||
|
while (position + word.length <= end && index.length !== 0) {
|
||||||
|
count.add(word)
|
||||||
|
hits.push({
|
||||||
|
position,
|
||||||
|
length: word.length
|
||||||
|
})
|
||||||
|
const wordEnd = position + word.length
|
||||||
|
|
||||||
|
// Move to next position of hit
|
||||||
|
index.shift()
|
||||||
|
while (index.length !== 0) {
|
||||||
|
item = index[0]
|
||||||
|
position = item.position
|
||||||
|
word = item.word
|
||||||
|
if (wordEnd > position) {
|
||||||
|
index.shift()
|
||||||
|
} else {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
hits,
|
||||||
|
start,
|
||||||
|
end,
|
||||||
|
count: count.size
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Highlight title and content
|
||||||
|
highlightKeyword (val, slice) {
|
||||||
|
let result = ''
|
||||||
|
let index = slice.start
|
||||||
|
for (const { position, length } of slice.hits) {
|
||||||
|
result += val.substring(index, position)
|
||||||
|
index = position + length
|
||||||
|
result += `<mark class="search-keyword">${val.substr(position, length)}</mark>`
|
||||||
|
}
|
||||||
|
result += val.substring(index, slice.end)
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
|
getResultItems (keywords) {
|
||||||
|
const resultItems = []
|
||||||
|
this.datas.forEach(({ title, content, url }) => {
|
||||||
|
// The number of different keywords included in the article.
|
||||||
|
const [indexOfTitle, keysOfTitle] = this.getIndexByWord(keywords, title)
|
||||||
|
const [indexOfContent, keysOfContent] = this.getIndexByWord(keywords, content)
|
||||||
|
const includedCount = new Set([...keysOfTitle, ...keysOfContent]).size
|
||||||
|
|
||||||
|
// Show search results
|
||||||
|
const hitCount = indexOfTitle.length + indexOfContent.length
|
||||||
|
if (hitCount === 0) return
|
||||||
|
|
||||||
|
const slicesOfTitle = []
|
||||||
|
if (indexOfTitle.length !== 0) {
|
||||||
|
slicesOfTitle.push(this.mergeIntoSlice(0, title.length, indexOfTitle))
|
||||||
|
}
|
||||||
|
|
||||||
|
let slicesOfContent = []
|
||||||
|
while (indexOfContent.length !== 0) {
|
||||||
|
const item = indexOfContent[0]
|
||||||
|
const { position } = item
|
||||||
|
// Cut out 120 characters. The maxlength of .search-input is 80.
|
||||||
|
const start = Math.max(0, position - 20)
|
||||||
|
const end = Math.min(content.length, position + 100)
|
||||||
|
slicesOfContent.push(this.mergeIntoSlice(start, end, indexOfContent))
|
||||||
|
}
|
||||||
|
|
||||||
|
// Sort slices in content by included keywords' count and hits' count
|
||||||
|
slicesOfContent.sort((left, right) => {
|
||||||
|
if (left.count !== right.count) {
|
||||||
|
return right.count - left.count
|
||||||
|
} else if (left.hits.length !== right.hits.length) {
|
||||||
|
return right.hits.length - left.hits.length
|
||||||
|
}
|
||||||
|
return left.start - right.start
|
||||||
|
})
|
||||||
|
|
||||||
|
// Select top N slices in content
|
||||||
|
const upperBound = parseInt(this.top_n_per_article, 10)
|
||||||
|
if (upperBound >= 0) {
|
||||||
|
slicesOfContent = slicesOfContent.slice(0, upperBound)
|
||||||
|
}
|
||||||
|
|
||||||
|
let resultItem = ''
|
||||||
|
|
||||||
|
url = new URL(url, location.origin)
|
||||||
|
url.searchParams.append('highlight', keywords.join(' '))
|
||||||
|
|
||||||
|
if (slicesOfTitle.length !== 0) {
|
||||||
|
resultItem += `<div class="local-search-hit-item"><a href="${url.href}"><span class="search-result-title">${this.highlightKeyword(title, slicesOfTitle[0])}</span>`
|
||||||
|
} else {
|
||||||
|
resultItem += `<div class="local-search-hit-item"><a href="${url.href}"><span class="search-result-title">${title}</span>`
|
||||||
|
}
|
||||||
|
|
||||||
|
slicesOfContent.forEach(slice => {
|
||||||
|
resultItem += `<p class="search-result">${this.highlightKeyword(content, slice)}...</p></a>`
|
||||||
|
})
|
||||||
|
|
||||||
|
resultItem += '</div>'
|
||||||
|
resultItems.push({
|
||||||
|
item: resultItem,
|
||||||
|
id: resultItems.length,
|
||||||
|
hitCount,
|
||||||
|
includedCount
|
||||||
|
})
|
||||||
|
})
|
||||||
|
return resultItems
|
||||||
|
}
|
||||||
|
|
||||||
|
fetchData () {
|
||||||
|
const isXml = !this.path.endsWith('json')
|
||||||
|
fetch(this.path)
|
||||||
|
.then(response => response.text())
|
||||||
|
.then(res => {
|
||||||
|
// Get the contents from search data
|
||||||
|
this.isfetched = true
|
||||||
|
this.datas = isXml
|
||||||
|
? [...new DOMParser().parseFromString(res, 'text/xml').querySelectorAll('entry')].map(element => ({
|
||||||
|
title: element.querySelector('title').textContent,
|
||||||
|
content: element.querySelector('content').textContent,
|
||||||
|
url: element.querySelector('url').textContent
|
||||||
|
}))
|
||||||
|
: JSON.parse(res)
|
||||||
|
// Only match articles with non-empty titles
|
||||||
|
this.datas = this.datas.filter(data => data.title).map(data => {
|
||||||
|
data.title = data.title.trim()
|
||||||
|
data.content = data.content ? data.content.trim().replace(/<[^>]+>/g, '') : ''
|
||||||
|
data.url = decodeURIComponent(data.url).replace(/\/{2,}/g, '/')
|
||||||
|
return data
|
||||||
|
})
|
||||||
|
// Remove loading animation
|
||||||
|
window.dispatchEvent(new Event('search:loaded'))
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// Highlight by wrapping node in mark elements with the given class name
|
||||||
|
highlightText (node, slice, className) {
|
||||||
|
const val = node.nodeValue
|
||||||
|
let index = slice.start
|
||||||
|
const children = []
|
||||||
|
for (const { position, length } of slice.hits) {
|
||||||
|
const text = document.createTextNode(val.substring(index, position))
|
||||||
|
index = position + length
|
||||||
|
const mark = document.createElement('mark')
|
||||||
|
mark.className = className
|
||||||
|
mark.appendChild(document.createTextNode(val.substr(position, length)))
|
||||||
|
children.push(text, mark)
|
||||||
|
}
|
||||||
|
node.nodeValue = val.substring(index, slice.end)
|
||||||
|
children.forEach(element => {
|
||||||
|
node.parentNode.insertBefore(element, node)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// Highlight the search words provided in the url in the text
|
||||||
|
highlightSearchWords (body) {
|
||||||
|
const params = new URL(location.href).searchParams.get('highlight')
|
||||||
|
const keywords = params ? params.split(' ') : []
|
||||||
|
if (!keywords.length || !body) return
|
||||||
|
const walk = document.createTreeWalker(body, NodeFilter.SHOW_TEXT, null)
|
||||||
|
const allNodes = []
|
||||||
|
while (walk.nextNode()) {
|
||||||
|
if (!walk.currentNode.parentNode.matches('button, select, textarea, .mermaid')) allNodes.push(walk.currentNode)
|
||||||
|
}
|
||||||
|
allNodes.forEach(node => {
|
||||||
|
const [indexOfNode] = this.getIndexByWord(keywords, node.nodeValue)
|
||||||
|
if (!indexOfNode.length) return
|
||||||
|
const slice = this.mergeIntoSlice(0, node.nodeValue.length, indexOfNode)
|
||||||
|
this.highlightText(node, slice, 'search-keyword')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
window.addEventListener('load', () => {
|
||||||
|
// Search
|
||||||
|
const { path, top_n_per_article, unescape, languages } = GLOBAL_CONFIG.localSearch
|
||||||
|
const localSearch = new LocalSearch({
|
||||||
|
path,
|
||||||
|
top_n_per_article,
|
||||||
|
unescape
|
||||||
|
})
|
||||||
|
|
||||||
|
const input = document.querySelector('#local-search-input input')
|
||||||
|
const statsItem = document.getElementById('local-search-stats-wrap')
|
||||||
|
const $loadingStatus = document.getElementById('loading-status')
|
||||||
|
const isXml = !path.endsWith('json')
|
||||||
|
|
||||||
|
const inputEventFunction = () => {
|
||||||
|
if (!localSearch.isfetched) return
|
||||||
|
let searchText = input.value.trim().toLowerCase()
|
||||||
|
isXml && (searchText = searchText.replace(/</g, '<').replace(/>/g, '>'))
|
||||||
|
if (searchText !== '') $loadingStatus.innerHTML = '<i class="fas fa-spinner fa-pulse"></i>'
|
||||||
|
const keywords = searchText.split(/[-\s]+/)
|
||||||
|
const container = document.getElementById('local-search-results')
|
||||||
|
let resultItems = []
|
||||||
|
if (searchText.length > 0) {
|
||||||
|
// Perform local searching
|
||||||
|
resultItems = localSearch.getResultItems(keywords)
|
||||||
|
}
|
||||||
|
if (keywords.length === 1 && keywords[0] === '') {
|
||||||
|
container.textContent = ''
|
||||||
|
statsItem.textContent = ''
|
||||||
|
} else if (resultItems.length === 0) {
|
||||||
|
container.textContent = ''
|
||||||
|
const statsDiv = document.createElement('div')
|
||||||
|
statsDiv.className = 'search-result-stats'
|
||||||
|
statsDiv.textContent = languages.hits_empty.replace(/\$\{query}/, searchText)
|
||||||
|
statsItem.innerHTML = statsDiv.outerHTML
|
||||||
|
} else {
|
||||||
|
resultItems.sort((left, right) => {
|
||||||
|
if (left.includedCount !== right.includedCount) {
|
||||||
|
return right.includedCount - left.includedCount
|
||||||
|
} else if (left.hitCount !== right.hitCount) {
|
||||||
|
return right.hitCount - left.hitCount
|
||||||
|
}
|
||||||
|
return right.id - left.id
|
||||||
|
})
|
||||||
|
|
||||||
|
const stats = languages.hits_stats.replace(/\$\{hits}/, resultItems.length)
|
||||||
|
|
||||||
|
container.innerHTML = `<div class="search-result-list">${resultItems.map(result => result.item).join('')}</div>`
|
||||||
|
statsItem.innerHTML = `<hr><div class="search-result-stats">${stats}</div>`
|
||||||
|
window.pjax && window.pjax.refresh(container)
|
||||||
|
}
|
||||||
|
|
||||||
|
$loadingStatus.textContent = ''
|
||||||
|
}
|
||||||
|
|
||||||
|
let loadFlag = false
|
||||||
|
const $searchMask = document.getElementById('search-mask')
|
||||||
|
const $searchDialog = document.querySelector('#local-search .search-dialog')
|
||||||
|
|
||||||
|
// fix safari
|
||||||
|
const fixSafariHeight = () => {
|
||||||
|
if (window.innerWidth < 768) {
|
||||||
|
$searchDialog.style.setProperty('--search-height', window.innerHeight + 'px')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const openSearch = () => {
|
const openSearch = () => {
|
||||||
const bodyStyle = document.body.style;
|
const bodyStyle = document.body.style
|
||||||
bodyStyle.width = "100%";
|
bodyStyle.width = '100%'
|
||||||
bodyStyle.overflow = "hidden";
|
bodyStyle.overflow = 'hidden'
|
||||||
anzhiyu.animateIn($searchMask, "to_show 0.5s");
|
btf.animateIn($searchMask, 'to_show 0.5s')
|
||||||
anzhiyu.animateIn(document.querySelector("#local-search .search-dialog"), "titleScale 0.5s");
|
btf.animateIn($searchDialog, 'titleScale 0.5s')
|
||||||
setTimeout(() => {
|
setTimeout(() => { input.focus() }, 300)
|
||||||
document.querySelector("#local-search-input input").focus();
|
|
||||||
}, 100);
|
|
||||||
if (!loadFlag) {
|
if (!loadFlag) {
|
||||||
search();
|
!localSearch.isfetched && localSearch.fetchData()
|
||||||
loadFlag = true;
|
input.addEventListener('input', inputEventFunction)
|
||||||
|
loadFlag = true
|
||||||
}
|
}
|
||||||
// shortcut: ESC
|
// shortcut: ESC
|
||||||
document.addEventListener("keydown", function f(event) {
|
document.addEventListener('keydown', function f (event) {
|
||||||
if (event.code === "Escape") {
|
if (event.code === 'Escape') {
|
||||||
closeSearch();
|
closeSearch()
|
||||||
document.removeEventListener("keydown", f);
|
document.removeEventListener('keydown', f)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
fixSafariHeight()
|
||||||
|
window.addEventListener('resize', fixSafariHeight)
|
||||||
}
|
}
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const closeSearch = () => {
|
const closeSearch = () => {
|
||||||
const bodyStyle = document.body.style;
|
const bodyStyle = document.body.style
|
||||||
bodyStyle.width = "";
|
bodyStyle.width = ''
|
||||||
bodyStyle.overflow = "";
|
bodyStyle.overflow = ''
|
||||||
anzhiyu.animateOut(document.querySelector("#local-search .search-dialog"), "search_close .5s");
|
btf.animateOut($searchDialog, 'search_close .5s')
|
||||||
anzhiyu.animateOut($searchMask, "to_hide 0.5s");
|
btf.animateOut($searchMask, 'to_hide 0.5s')
|
||||||
};
|
window.removeEventListener('resize', fixSafariHeight)
|
||||||
|
}
|
||||||
|
|
||||||
const searchClickFn = () => {
|
const searchClickFn = () => {
|
||||||
document.querySelector("#search-button > .search").addEventListener("click", openSearch);
|
btf.addEventListenerPjax(document.querySelector('#search-button > .search'), 'click', openSearch)
|
||||||
document.querySelector("#menu-search").addEventListener("click", openSearch);
|
|
||||||
};
|
|
||||||
|
|
||||||
const searchClickFnOnce = () => {
|
|
||||||
document.querySelector("#local-search .search-close-button").addEventListener("click", closeSearch);
|
|
||||||
$searchMask.addEventListener("click", closeSearch);
|
|
||||||
if (GLOBAL_CONFIG.localSearch.preload) dataObj = fetchData(GLOBAL_CONFIG.localSearch.path);
|
|
||||||
};
|
|
||||||
|
|
||||||
// check url is json or not
|
|
||||||
const isJson = url => {
|
|
||||||
const reg = /\.json$/;
|
|
||||||
return reg.test(url);
|
|
||||||
};
|
|
||||||
|
|
||||||
const fetchData = async path => {
|
|
||||||
let data = [];
|
|
||||||
const response = await fetch(path);
|
|
||||||
if (isJson(path)) {
|
|
||||||
data = await response.json();
|
|
||||||
} else {
|
|
||||||
const res = await response.text();
|
|
||||||
const t = await new window.DOMParser().parseFromString(res, "text/xml");
|
|
||||||
const a = await t;
|
|
||||||
|
|
||||||
data = [...a.querySelectorAll("entry")].map(item => {
|
|
||||||
let tagsArr = [];
|
|
||||||
if (item.querySelector("tags") && item.querySelector("tags").getElementsByTagName("tag")) {
|
|
||||||
Array.prototype.forEach.call(item.querySelector("tags").getElementsByTagName("tag"), function (item, index) {
|
|
||||||
tagsArr.push(item.textContent);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
let content = item.querySelector("content") && item.querySelector("content").textContent;
|
|
||||||
let imgReg = /<img.*?(?:>|\/>)/gi; //匹配图片中的img标签
|
|
||||||
let srcReg = /src=[\'\"]?([^\'\"]*)[\'\"]?/i; // 匹配图片中的src
|
|
||||||
let arr = content.match(imgReg); //筛选出所有的img
|
|
||||||
|
|
||||||
let srcArr = [];
|
|
||||||
if (arr) {
|
|
||||||
for (let i = 0; i < arr.length; i++) {
|
|
||||||
let src = arr[i].match(srcReg);
|
|
||||||
// 获取图片地址
|
|
||||||
if (!src[1].indexOf("http")) srcArr.push(src[1]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
const searchFnOnce = () => {
|
||||||
title: item.querySelector("title").textContent,
|
document.querySelector('#local-search .search-close-button').addEventListener('click', closeSearch)
|
||||||
content: content,
|
$searchMask.addEventListener('click', closeSearch)
|
||||||
url: item.querySelector("url").textContent,
|
if (GLOBAL_CONFIG.localSearch.preload) {
|
||||||
tags: tagsArr,
|
localSearch.fetchData()
|
||||||
oneImage: srcArr && srcArr[0],
|
|
||||||
};
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
if (response.ok) {
|
localSearch.highlightSearchWords(document.getElementById('article-container'))
|
||||||
const $loadDataItem = document.getElementById("loading-database");
|
|
||||||
$loadDataItem.nextElementSibling.style.display = "block";
|
|
||||||
$loadDataItem.remove();
|
|
||||||
}
|
|
||||||
return data;
|
|
||||||
};
|
|
||||||
|
|
||||||
const search = () => {
|
|
||||||
if (!GLOBAL_CONFIG.localSearch.preload) {
|
|
||||||
dataObj = fetchData(GLOBAL_CONFIG.localSearch.path);
|
|
||||||
}
|
|
||||||
const $input = document.querySelector("#local-search-input input");
|
|
||||||
const $resultContent = document.getElementById("local-search-results");
|
|
||||||
const $loadingStatus = document.getElementById("loading-status");
|
|
||||||
|
|
||||||
$input.addEventListener("input", function () {
|
|
||||||
const keywords = this.value.trim().toLowerCase().split(/[\s]+/);
|
|
||||||
if (keywords[0] !== "")
|
|
||||||
$loadingStatus.innerHTML = '<i class="anzhiyufont anzhiyu-icon-spinner anzhiyu-pulse-icon"></i>';
|
|
||||||
|
|
||||||
$resultContent.innerHTML = "";
|
|
||||||
let str = '<div class="search-result-list">';
|
|
||||||
if (keywords.length <= 0) return;
|
|
||||||
let count = 0;
|
|
||||||
// perform local searching
|
|
||||||
dataObj.then(data => {
|
|
||||||
data.forEach(data => {
|
|
||||||
let isMatch = true;
|
|
||||||
let dataTitle = data.title ? data.title.trim().toLowerCase() : "";
|
|
||||||
let dataTags = data.tags;
|
|
||||||
let oneImage = data.oneImage ?? "";
|
|
||||||
const dataContent = data.content
|
|
||||||
? data.content
|
|
||||||
.trim()
|
|
||||||
.replace(/<[^>]+>/g, "")
|
|
||||||
.toLowerCase()
|
|
||||||
: "";
|
|
||||||
const dataUrl = data.url.startsWith("/") ? data.url : GLOBAL_CONFIG.root + data.url;
|
|
||||||
let indexTitle = -1;
|
|
||||||
let indexContent = -1;
|
|
||||||
let firstOccur = -1;
|
|
||||||
// only match articles with not empty titles and contents
|
|
||||||
if (dataTitle !== "" || dataContent !== "") {
|
|
||||||
keywords.forEach((keyword, i) => {
|
|
||||||
indexTitle = dataTitle.indexOf(keyword);
|
|
||||||
indexContent = dataContent.indexOf(keyword);
|
|
||||||
if (indexTitle < 0 && indexContent < 0) {
|
|
||||||
isMatch = false;
|
|
||||||
} else {
|
|
||||||
if (indexContent < 0) {
|
|
||||||
indexContent = 0;
|
|
||||||
}
|
|
||||||
if (i === 0) {
|
|
||||||
firstOccur = indexContent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
isMatch = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// show search results
|
window.addEventListener('search:loaded', () => {
|
||||||
if (isMatch) {
|
const $loadDataItem = document.getElementById('loading-database')
|
||||||
if (firstOccur >= 0) {
|
$loadDataItem.nextElementSibling.style.display = 'block'
|
||||||
// cut out 130 characters
|
$loadDataItem.remove()
|
||||||
// let start = firstOccur - 30 < 0 ? 0 : firstOccur - 30
|
})
|
||||||
// let end = firstOccur + 50 > dataContent.length ? dataContent.length : firstOccur + 50
|
|
||||||
let start = firstOccur - 30;
|
|
||||||
let end = firstOccur + 100;
|
|
||||||
let pre = "";
|
|
||||||
let post = "";
|
|
||||||
|
|
||||||
if (start < 0) {
|
searchClickFn()
|
||||||
start = 0;
|
searchFnOnce()
|
||||||
}
|
|
||||||
|
|
||||||
if (start === 0) {
|
|
||||||
end = 100;
|
|
||||||
} else {
|
|
||||||
pre = "...";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (end > dataContent.length) {
|
|
||||||
end = dataContent.length;
|
|
||||||
} else {
|
|
||||||
post = "...";
|
|
||||||
}
|
|
||||||
|
|
||||||
let matchContent = dataContent.substring(start, end);
|
|
||||||
|
|
||||||
// highlight all keywords
|
|
||||||
keywords.forEach(keyword => {
|
|
||||||
const regS = new RegExp(keyword, "gi");
|
|
||||||
matchContent = matchContent.replace(regS, '<span class="search-keyword">' + keyword + "</span>");
|
|
||||||
dataTitle = dataTitle.replace(regS, '<span class="search-keyword">' + keyword + "</span>");
|
|
||||||
});
|
|
||||||
|
|
||||||
str += '<div class="local-search__hit-item">';
|
|
||||||
if (oneImage) {
|
|
||||||
str += `<div class="search-left"><img src=${oneImage} alt=${dataTitle} data-fancybox='gallery'>`;
|
|
||||||
} else {
|
|
||||||
str += '<div class="search-left" style="width:0">';
|
|
||||||
}
|
|
||||||
|
|
||||||
str += "</div>";
|
|
||||||
|
|
||||||
if (oneImage) {
|
|
||||||
str +=
|
|
||||||
'<div class="search-right"><a href="' +
|
|
||||||
dataUrl +
|
|
||||||
'" class="search-result-title">' +
|
|
||||||
dataTitle +
|
|
||||||
"</a>";
|
|
||||||
} else {
|
|
||||||
str +=
|
|
||||||
'<div class="search-right" style="width: 100%"><a href="' +
|
|
||||||
dataUrl +
|
|
||||||
'" class="search-result-title">' +
|
|
||||||
dataTitle +
|
|
||||||
"</a>";
|
|
||||||
}
|
|
||||||
|
|
||||||
count += 1;
|
|
||||||
|
|
||||||
if (dataContent !== "") {
|
|
||||||
str +=
|
|
||||||
'<p class="search-result" onclick="pjax.loadUrl(`' +
|
|
||||||
dataUrl +
|
|
||||||
'`)">' +
|
|
||||||
pre +
|
|
||||||
matchContent +
|
|
||||||
post +
|
|
||||||
"</p>";
|
|
||||||
}
|
|
||||||
if (dataTags.length) {
|
|
||||||
str += '<div class="search-result-tags">';
|
|
||||||
|
|
||||||
for (let i = 0; i < dataTags.length; i++) {
|
|
||||||
const element = dataTags[i].trim();
|
|
||||||
|
|
||||||
str +=
|
|
||||||
'<a class="tag-list" href="/tags/' +
|
|
||||||
element +
|
|
||||||
'/" data-pjax-state="" one-link-mark="yes">#' +
|
|
||||||
element +
|
|
||||||
"</a>";
|
|
||||||
}
|
|
||||||
|
|
||||||
str += "</div>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
str += "</div></div>";
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (count === 0) {
|
|
||||||
str +=
|
|
||||||
'<div id="local-search__hits-empty">' +
|
|
||||||
GLOBAL_CONFIG.localSearch.languages.hits_empty.replace(/\$\{query}/, this.value.trim()) +
|
|
||||||
"</div>";
|
|
||||||
}
|
|
||||||
str += "</div>";
|
|
||||||
$resultContent.innerHTML = str;
|
|
||||||
if (keywords[0] !== "") $loadingStatus.innerHTML = "";
|
|
||||||
window.pjax && window.pjax.refresh($resultContent);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
searchClickFn();
|
|
||||||
searchClickFnOnce();
|
|
||||||
|
|
||||||
// pjax
|
// pjax
|
||||||
window.addEventListener("pjax:complete", () => {
|
window.addEventListener('pjax:complete', () => {
|
||||||
!anzhiyu.isHidden($searchMask) && closeSearch();
|
!btf.isHidden($searchMask) && closeSearch()
|
||||||
searchClickFn();
|
localSearch.highlightSearchWords(document.getElementById('article-container'))
|
||||||
});
|
searchClickFn()
|
||||||
});
|
})
|
||||||
|
})
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
saveToLocal.get(targetEncodingCookie) === undefined
|
saveToLocal.get(targetEncodingCookie) === undefined
|
||||||
? defaultEncoding
|
? defaultEncoding
|
||||||
: Number(saveToLocal.get('translate-chn-cht'))
|
: Number(saveToLocal.get('translate-chn-cht'))
|
||||||
let translateButtonObject, translateRightMenuButtonObject;
|
let translateButtonObject
|
||||||
const isSnackbar = snackbarData !== undefined
|
const isSnackbar = snackbarData !== undefined
|
||||||
|
|
||||||
function setLang () {
|
function setLang () {
|
||||||
@@ -56,12 +56,12 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
currentEncoding = 1
|
currentEncoding = 1
|
||||||
targetEncoding = 2
|
targetEncoding = 2
|
||||||
translateButtonObject.textContent = msgToTraditionalChinese
|
translateButtonObject.textContent = msgToTraditionalChinese
|
||||||
isSnackbar && anzhiyu.snackbarShow(snackbarData.cht_to_chs)
|
isSnackbar && btf.snackbarShow(snackbarData.cht_to_chs)
|
||||||
} else if (targetEncoding === 2) {
|
} else if (targetEncoding === 2) {
|
||||||
currentEncoding = 2
|
currentEncoding = 2
|
||||||
targetEncoding = 1
|
targetEncoding = 1
|
||||||
translateButtonObject.textContent = msgToSimplifiedChinese
|
translateButtonObject.textContent = msgToSimplifiedChinese
|
||||||
isSnackbar && anzhiyu.snackbarShow(snackbarData.chs_to_cht)
|
isSnackbar && btf.snackbarShow(snackbarData.chs_to_cht)
|
||||||
}
|
}
|
||||||
saveToLocal.set(targetEncodingCookie, targetEncoding, 2)
|
saveToLocal.set(targetEncodingCookie, targetEncoding, 2)
|
||||||
setLang()
|
setLang()
|
||||||
@@ -98,23 +98,15 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function translateInitialization () {
|
function translateInitialization () {
|
||||||
translateButtonObject = document.getElementById('translateLink');
|
translateButtonObject = document.getElementById('translateLink')
|
||||||
translateRightMenuButtonObject = document.getElementById('menu-translate').querySelector('span');
|
|
||||||
|
|
||||||
if (translateButtonObject || translateRightMenuButtonObject) {
|
|
||||||
if (currentEncoding !== targetEncoding) {
|
|
||||||
const textContent = targetEncoding === 1 ? msgToSimplifiedChinese : msgToTraditionalChinese;
|
|
||||||
|
|
||||||
if (translateButtonObject) {
|
if (translateButtonObject) {
|
||||||
translateButtonObject.textContent = textContent;
|
if (currentEncoding !== targetEncoding) {
|
||||||
}
|
translateButtonObject.textContent =
|
||||||
|
targetEncoding === 1
|
||||||
if (translateRightMenuButtonObject) {
|
? msgToSimplifiedChinese
|
||||||
translateRightMenuButtonObject.textContent = textContent;
|
: msgToTraditionalChinese
|
||||||
}
|
setLang()
|
||||||
|
setTimeout(translateBody, translateDelay)
|
||||||
setLang();
|
|
||||||
setTimeout(translateBody, translateDelay);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
1499
public/js/utils.js
203
public/link/index.html
Normal file
@@ -0,0 +1,203 @@
|
|||||||
|
<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0,viewport-fit=cover"><title>link | QuickReference</title><meta name="author" content="shenjianZ"><meta name="copyright" content="shenjianZ"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="一份快捷简便的文档,便于查阅编程的细节">
|
||||||
|
<meta property="og:type" content="website">
|
||||||
|
<meta property="og:title" content="link">
|
||||||
|
<meta property="og:url" content="https://rq.shenjianl.cn/link/index.html">
|
||||||
|
<meta property="og:site_name" content="QuickReference">
|
||||||
|
<meta property="og:description" content="一份快捷简便的文档,便于查阅编程的细节">
|
||||||
|
<meta property="og:locale" content="zh_CN">
|
||||||
|
<meta property="og:image" content="https://rq.shenjianl.cn/img/avatar.jpg">
|
||||||
|
<meta property="article:published_time" content="2024-08-10T02:42:35.000Z">
|
||||||
|
<meta property="article:modified_time" content="2024-08-10T02:42:48.927Z">
|
||||||
|
<meta property="article:author" content="shenjianZ">
|
||||||
|
<meta property="article:tag" content="doucment">
|
||||||
|
<meta name="twitter:card" content="summary">
|
||||||
|
<meta name="twitter:image" content="https://rq.shenjianl.cn/img/avatar.jpg"><link rel="shortcut icon" href="/img/favicon.png"><link rel="canonical" href="https://rq.shenjianl.cn/link/index.html"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css?v=4.13.0"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.5.1/css/all.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui@5.0.33/dist/fancybox/fancybox.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = {
|
||||||
|
root: '/',
|
||||||
|
algolia: undefined,
|
||||||
|
localSearch: {"path":"/search.xml","preload":false,"top_n_per_article":1,"unescape":true,"languages":{"hits_empty":"找不到您查询的内容:${query}","hits_stats":"共找到 ${hits} 篇文章"}},
|
||||||
|
translate: undefined,
|
||||||
|
noticeOutdate: undefined,
|
||||||
|
highlight: {"plugin":"highlight.js","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
|
||||||
|
copy: {
|
||||||
|
success: '复制成功',
|
||||||
|
error: '复制错误',
|
||||||
|
noSupport: '浏览器不支持'
|
||||||
|
},
|
||||||
|
relativeDate: {
|
||||||
|
homepage: false,
|
||||||
|
post: false
|
||||||
|
},
|
||||||
|
runtime: '天',
|
||||||
|
dateSuffix: {
|
||||||
|
just: '刚刚',
|
||||||
|
min: '分钟前',
|
||||||
|
hour: '小时前',
|
||||||
|
day: '天前',
|
||||||
|
month: '个月前'
|
||||||
|
},
|
||||||
|
copyright: undefined,
|
||||||
|
lightbox: 'fancybox',
|
||||||
|
Snackbar: undefined,
|
||||||
|
infinitegrid: {
|
||||||
|
js: 'https://cdn.jsdelivr.net/npm/@egjs/infinitegrid@4.11.1/dist/infinitegrid.min.js',
|
||||||
|
buttonText: '加载更多'
|
||||||
|
},
|
||||||
|
isPhotoFigcaption: false,
|
||||||
|
islazyload: false,
|
||||||
|
isAnchor: false,
|
||||||
|
percent: {
|
||||||
|
toc: true,
|
||||||
|
rightside: false,
|
||||||
|
},
|
||||||
|
autoDarkmode: false
|
||||||
|
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
|
||||||
|
title: 'link',
|
||||||
|
isPost: false,
|
||||||
|
isHome: false,
|
||||||
|
isHighlightShrink: undefined,
|
||||||
|
isToc: false,
|
||||||
|
postUpdate: '2024-08-10 10:42:48'
|
||||||
|
}</script><script>(win=>{
|
||||||
|
win.saveToLocal = {
|
||||||
|
set: (key, value, ttl) => {
|
||||||
|
if (ttl === 0) return
|
||||||
|
const now = Date.now()
|
||||||
|
const expiry = now + ttl * 86400000
|
||||||
|
const item = {
|
||||||
|
value,
|
||||||
|
expiry
|
||||||
|
}
|
||||||
|
localStorage.setItem(key, JSON.stringify(item))
|
||||||
|
},
|
||||||
|
|
||||||
|
get: key => {
|
||||||
|
const itemStr = localStorage.getItem(key)
|
||||||
|
|
||||||
|
if (!itemStr) {
|
||||||
|
return undefined
|
||||||
|
}
|
||||||
|
const item = JSON.parse(itemStr)
|
||||||
|
const now = Date.now()
|
||||||
|
|
||||||
|
if (now > item.expiry) {
|
||||||
|
localStorage.removeItem(key)
|
||||||
|
return undefined
|
||||||
|
}
|
||||||
|
return item.value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
win.getScript = (url, attr = {}) => new Promise((resolve, reject) => {
|
||||||
|
const script = document.createElement('script')
|
||||||
|
script.src = url
|
||||||
|
script.async = true
|
||||||
|
script.onerror = reject
|
||||||
|
script.onload = script.onreadystatechange = function() {
|
||||||
|
const loadState = this.readyState
|
||||||
|
if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
|
||||||
|
script.onload = script.onreadystatechange = null
|
||||||
|
resolve()
|
||||||
|
}
|
||||||
|
|
||||||
|
Object.keys(attr).forEach(key => {
|
||||||
|
script.setAttribute(key, attr[key])
|
||||||
|
})
|
||||||
|
|
||||||
|
document.head.appendChild(script)
|
||||||
|
})
|
||||||
|
|
||||||
|
win.getCSS = (url, id = false) => new Promise((resolve, reject) => {
|
||||||
|
const link = document.createElement('link')
|
||||||
|
link.rel = 'stylesheet'
|
||||||
|
link.href = url
|
||||||
|
if (id) link.id = id
|
||||||
|
link.onerror = reject
|
||||||
|
link.onload = link.onreadystatechange = function() {
|
||||||
|
const loadState = this.readyState
|
||||||
|
if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
|
||||||
|
link.onload = link.onreadystatechange = null
|
||||||
|
resolve()
|
||||||
|
}
|
||||||
|
document.head.appendChild(link)
|
||||||
|
})
|
||||||
|
|
||||||
|
win.activateDarkMode = () => {
|
||||||
|
document.documentElement.setAttribute('data-theme', 'dark')
|
||||||
|
if (document.querySelector('meta[name="theme-color"]') !== null) {
|
||||||
|
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
win.activateLightMode = () => {
|
||||||
|
document.documentElement.setAttribute('data-theme', 'light')
|
||||||
|
if (document.querySelector('meta[name="theme-color"]') !== null) {
|
||||||
|
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const t = saveToLocal.get('theme')
|
||||||
|
|
||||||
|
if (t === 'dark') activateDarkMode()
|
||||||
|
else if (t === 'light') activateLightMode()
|
||||||
|
|
||||||
|
const asideStatus = saveToLocal.get('aside-status')
|
||||||
|
if (asideStatus !== undefined) {
|
||||||
|
if (asideStatus === 'hide') {
|
||||||
|
document.documentElement.classList.add('hide-aside')
|
||||||
|
} else {
|
||||||
|
document.documentElement.classList.remove('hide-aside')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const detectApple = () => {
|
||||||
|
if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
|
||||||
|
document.documentElement.classList.add('apple')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
detectApple()
|
||||||
|
})(window)</script><meta name="generator" content="Hexo 7.3.0"></head><body><div id="web_bg"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="/img/avatar.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">18</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">9</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">2</div></a></div><hr class="custom-hr"/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> Home</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> Archives</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> Tags</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> Categories</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> List</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> Music</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> Movie</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> Link</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> About</span></a></div></div></div></div><div class="page" id="body-wrap"><header class="not-home-page fixed" id="page-header" style="background-image: url('/img/site01.jpg')"><nav id="nav"><span id="blog-info"><a href="/" title="QuickReference"><span class="site-name">QuickReference</span></a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search" href="javascript:void(0);"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> Home</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> Archives</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> Tags</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> Categories</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> List</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> Music</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> Movie</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> Link</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> About</span></a></div></div><div id="toggle-menu"><a class="site-page" href="javascript:void(0);"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="page-site-info"><h1 id="site-title">link</h1></div></header><main class="layout" id="content-inner"><div id="page"><div id="article-container"><div class="flink"><h2 id="友情链接"><a href="#友情链接" class="headerlink" title="友情链接"></a>友情链接</h2><div class="flink-desc">那些人,那些事</div> <div class="flink-list">
|
||||||
|
<div class="flink-list-item">
|
||||||
|
<a href="https://hexo.io/zh-cn/" title="Hexo" target="_blank">
|
||||||
|
<div class="flink-item-icon">
|
||||||
|
<img class="no-lightbox" src="https://d33wubrfki0l68.cloudfront.net/6657ba50e702d84afb32fe846bed54fba1a77add/827ae/logo.svg" onerror='this.onerror=null;this.src="/img/friend_404.gif"' alt="Hexo" />
|
||||||
|
</div>
|
||||||
|
<div class="flink-item-name">Hexo</div>
|
||||||
|
<div class="flink-item-desc" title="快速、简单且強大的文档框架">快速、简单且強大的文档框架</div>
|
||||||
|
</a>
|
||||||
|
</div></div><h2 id="网站"><a href="#网站" class="headerlink" title="网站"></a>网站</h2><div class="flink-desc">值得推荐的网站</div> <div class="flink-list">
|
||||||
|
<div class="flink-list-item">
|
||||||
|
<a href="https://www.youtube.com/" title="Youtube" target="_blank">
|
||||||
|
<div class="flink-item-icon">
|
||||||
|
<img class="no-lightbox" src="https://i.loli.net/2020/05/14/9ZkGg8v3azHJfM1.png" onerror='this.onerror=null;this.src="/img/friend_404.gif"' alt="Youtube" />
|
||||||
|
</div>
|
||||||
|
<div class="flink-item-name">Youtube</div>
|
||||||
|
<div class="flink-item-desc" title="视频网站">视频网站</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="flink-list-item">
|
||||||
|
<a href="https://www.weibo.com/" title="Weibo" target="_blank">
|
||||||
|
<div class="flink-item-icon">
|
||||||
|
<img class="no-lightbox" src="https://i.loli.net/2020/05/14/TLJBum386vcnI1P.png" onerror='this.onerror=null;this.src="/img/friend_404.gif"' alt="Weibo" />
|
||||||
|
</div>
|
||||||
|
<div class="flink-item-name">Weibo</div>
|
||||||
|
<div class="flink-item-desc" title="中国最大社交分享平台">中国最大社交分享平台</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="flink-list-item">
|
||||||
|
<a href="https://twitter.com/" title="Twitter" target="_blank">
|
||||||
|
<div class="flink-item-icon">
|
||||||
|
<img class="no-lightbox" src="https://i.loli.net/2020/05/14/5VyHPQqR6LWF39a.png" onerror='this.onerror=null;this.src="/img/friend_404.gif"' alt="Twitter" />
|
||||||
|
</div>
|
||||||
|
<div class="flink-item-name">Twitter</div>
|
||||||
|
<div class="flink-item-desc" title="社交分享平台">社交分享平台</div>
|
||||||
|
</a>
|
||||||
|
</div></div></div></div></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="/img/avatar.jpg" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">shenjianZ</div><div class="author-info__description">一份快捷简便的文档,便于查阅编程的细节</div></div><div class="card-info-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">18</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">9</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">2</div></a></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/shenjianz"><i class="fab fa-github"></i><span>Follow Me</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/shenjianZ" target="_blank" title="Github"><i class="fab fa-github" style="color: #24292e;"></i></a><a class="social-icon" href="mailto:15202078626@163.com" target="_blank" title="Email"><i class="fas fa-envelope" style="color: #4a7dbe;"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content">一个简单快捷的文档知识点查阅网站</div></div><div class="sticky_layout"><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/posts/8816.html" title="集成学习"><img src="/img/machinelearning/ensemble-learning.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="集成学习"/></a><div class="content"><a class="title" href="/posts/8816.html" title="集成学习">集成学习</a><time datetime="2025-01-25T07:12:08.000Z" title="发表于 2025-01-25 15:12:08">2025-01-25</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/95.html" title="决策树算法"><img src="/img/machinelearning/decision-tree.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="决策树算法"/></a><div class="content"><a class="title" href="/posts/95.html" title="决策树算法">决策树算法</a><time datetime="2025-01-24T04:39:59.000Z" title="发表于 2025-01-24 12:39:59">2025-01-24</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/posts/60504.html" title="逻辑回归">逻辑回归</a><time datetime="2025-01-20T07:30:08.000Z" title="发表于 2025-01-20 15:30:08">2025-01-20</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/posts/52662.html" title="线性回归">线性回归</a><time datetime="2025-01-19T08:46:51.000Z" title="发表于 2025-01-19 16:46:51">2025-01-19</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/posts/12462.html" title="C lang">C lang</a><time datetime="2025-01-15T12:41:26.000Z" title="发表于 2025-01-15 20:41:26">2025-01-15</time></div></div></div></div><div class="card-widget card-categories"><div class="item-headline">
|
||||||
|
<i class="fas fa-folder-open"></i>
|
||||||
|
<span>分类</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<ul class="card-category-list" id="aside-cat-list">
|
||||||
|
<li class="card-category-list-item "><a class="card-category-list-link" href="/categories/machinelearning/"><span class="card-category-list-name">machinelearning</span><span class="card-category-list-count">5</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E5%8F%A4%E6%96%87%E8%A7%82%E6%AD%A2/"><span class="card-category-list-name">古文观止</span><span class="card-category-list-count">1</span></a></li>
|
||||||
|
</ul></div><div class="card-widget card-tags"><div class="item-headline"><i class="fas fa-tags"></i><span>标签</span></div><div class="card-tag-cloud"><a href="/tags/linear-regression/" style="font-size: 1.1em; color: #999">linear-regression</a> <a href="/tags/KNN/" style="font-size: 1.1em; color: #999">KNN</a> <a href="/tags/logistic-regression/" style="font-size: 1.1em; color: #999">logistic-regression</a> <a href="/tags/%E5%8F%A4%E6%96%87%E8%A7%82%E6%AD%A2/" style="font-size: 1.1em; color: #999">古文观止</a> <a href="/tags/decisiontree/" style="font-size: 1.1em; color: #999">decisiontree</a> <a href="/tags/uniapp/" style="font-size: 1.5em; color: #99a9bf">uniapp</a> <a href="/tags/%E7%BD%91%E7%BB%9C%E4%BB%A3%E7%90%86/" style="font-size: 1.1em; color: #999">网络代理</a> <a href="/tags/C-C/" style="font-size: 1.1em; color: #999">C C++</a> <a href="/tags/ensemble-learning/" style="font-size: 1.1em; color: #999">ensemble-learning</a></div></div><div class="card-widget card-archives"><div class="item-headline"><i class="fas fa-archive"></i><span>归档</span></div><ul class="card-archive-list"><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2025/01/"><span class="card-archive-list-date">一月 2025</span><span class="card-archive-list-count">6</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2024/09/"><span class="card-archive-list-date">九月 2024</span><span class="card-archive-list-count">4</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2024/08/"><span class="card-archive-list-date">八月 2024</span><span class="card-archive-list-count">8</span></a></li></ul></div><div class="card-widget card-webinfo"><div class="item-headline"><i class="fas fa-chart-line"></i><span>网站资讯</span></div><div class="webinfo"><div class="webinfo-item"><div class="item-name">文章数目 :</div><div class="item-count">18</div></div><div class="webinfo-item"><div class="item-name">已运行时间 :</div><div class="item-count" id="runtimeshow" data-publishDate="2024-07-30T16:00:00.000Z"><i class="fa-solid fa-spinner fa-spin"></i></div></div><div class="webinfo-item"><div class="item-name">本站访客数 :</div><div class="item-count" id="busuanzi_value_site_uv"><i class="fa-solid fa-spinner fa-spin"></i></div></div><div class="webinfo-item"><div class="item-name">本站总访问量 :</div><div class="item-count" id="busuanzi_value_site_pv"><i class="fa-solid fa-spinner fa-spin"></i></div></div><div class="webinfo-item"><div class="item-name">最后更新时间 :</div><div class="item-count" id="last-push-date" data-lastPushDate="2025-10-16T03:29:44.082Z"><i class="fa-solid fa-spinner fa-spin"></i></div></div></div></div></div></div></main><footer id="footer" style="background: transparent"><div id="footer-wrap"><div class="copyright">©2024 - 2025 By shenjianZ</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><div class="footer_custom_text"><a target="_blank" rel="noopener" href="https://beian.miit.gov.cn/#/Integrated/recordQuery"><img class="icp-icon" src="https://beian.mps.gov.cn/img/logo01.dd7ff50e.png"><span>备案号:豫ICP备2023019300号</span></a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside-config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button id="go-up" type="button" title="回到顶部"><span class="scroll-percent"></span><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/js/utils.js?v=4.13.0"></script><script src="/js/main.js?v=4.13.0"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui@5.0.33/dist/fancybox/fancybox.umd.min.js"></script><div class="js-pjax"></div><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1.1.3/dist/activate-power-mode.min.js"></script><script>POWERMODE.colorful = true;
|
||||||
|
POWERMODE.shake = true;
|
||||||
|
POWERMODE.mobile = false;
|
||||||
|
document.body.addEventListener('input', POWERMODE);
|
||||||
|
</script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script><div id="local-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">搜索</span><span id="loading-status"></span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="is-center" id="loading-database"><i class="fas fa-spinner fa-pulse"></i><span> 数据库加载中</span></div><div class="search-wrap"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div><hr/><div id="local-search-results"></div><div id="local-search-stats-wrap"></div></div></div><div id="search-mask"></div><script src="/js/search/local-search.js?v=4.13.0"></script></div></div></body></html>
|
||||||