diff --git a/README.md b/README.md index e451836..a45b670 100644 --- a/README.md +++ b/README.md @@ -1,117 +1,193 @@ -
-中文 -
- -
- - - -# hexo-theme-butterfly - -![master version](https://img.shields.io/github/package-json/v/jerryc127/hexo-theme-butterfly/master?color=%231ab1ad&label=master) -![master version](https://img.shields.io/github/package-json/v/jerryc127/hexo-theme-butterfly/dev?label=dev) -![https://img.shields.io/npm/v/hexo-theme-butterfly?color=%09%23bf00ff](https://img.shields.io/npm/v/hexo-theme-butterfly?color=%09%23bf00ff) -![hexo version](https://img.shields.io/badge/hexo-5.3.0+-0e83c) -![license](https://img.shields.io/github/license/jerryc127/hexo-theme-butterfly?color=FF5531) - -📢 Demo: [Butterfly](https://butterfly.js.org/) / [CrazyWong](https://blog.crazywong.com/) - -📖 Docs: [English](https://butterfly.js.org/en/posts/butterfly-docs-en-get-started/) / [Chinese](https://butterfly.js.org/posts/21cfbf15/) - -![](https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/theme-butterfly-readme.png) - -
- ---- - -## 💻 Installation - -### GIT - -> If you are in Mainland China, you can download in [Gitee](https://gitee.com/immyw/hexo-theme-butterfly.git) - -Stable branch [recommend]: - -``` -git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly -``` - -Dev branch: - -``` -git clone -b dev https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly -``` - -### NPM - -> It supports Hexo 5.0.0 or later - -In Hexo site root directory - -```powershell -npm i hexo-theme-butterfly -``` - -## ⚙ Configuration - - Set theme in the hexo work folder's root config file `_config.yml`: - -> theme: butterfly - - If you don't have pug & stylus renderer, try this: - -> npm install hexo-renderer-pug hexo-renderer-stylus - -## 🎉 Features - -- [x] Card UI Design -- [x] Rounded Design/Squared Design -- [X] Support sub-menu -- [x] Two-column layout -- [x] Responsive Web Design -- [x] Dark Mode -- [x] Pjax -- [x] Read Mode -- [x] Conversion between Traditional and Simplified Chinese -- [X] TOC catalog is available for both computers and mobile phones -- [X] Built-in Syntax Highlighting Themes (darker/pale night/light/ocean), also support customization -- [X] Code Blocks (Display code language/close or expand Code Blocks/Copy Button/word wrap) -- [X] Disable copy/Add a Copyright Notice to the Copied Text -- [X] Search (Algolia Search/Local Search) -- [x] Mathjax and Katex -- [x] Built-in 404 page -- [x] WordCount -- [x] Related articles -- [x] Displays outdated notice for a post -- [x] Share (Sharejs/Addtoany) -- [X] Comment (Disqus/Disqusjs/Livere/Gitalk/Valine/Waline/Utterances/Facebook Comments/Twikoo/Giscus/Remark42/artalk) -- [x] Multiple Comment System Support -- [x] Online Chats (Chatra/Tidio/Crisp) -- [x] Web analytics -- [x] Google AdSense -- [x] Webmaster Verification -- [x] Change website colour scheme -- [x] Typewriter Effect: activate_power_mode -- [x] Background effects (Canvas ribbon/canvas_ribbon_piao/canvas_nest) -- [x] Mouse click effects (Fireworks/Heart/Text) -- [x] Preloader/Loading Animation/pace.js -- [x] Busuanzi visitor counter -- [x] Medium Zoom/Fancybox -- [x] Mermaid -- [x] Chart.js -- [x] Justified Gallery -- [x] Lazyload images -- [x] Instantpage/Snackbar notification toast/PWA...... - -## ✨ Contributors - - - - - -## 📷 Screenshots - -![](https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-1.jpg) -![](https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-2.jpg) -![](https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-3.jpg) -![](https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-4.jpg) +
+ 中文 +
+ +
+ +Butterfly Logo + +# hexo-theme-butterfly + +A modern, elegant and feature-rich theme for Hexo + +![master version](https://img.shields.io/github/package-json/v/jerryc127/hexo-theme-butterfly/master?color=%231ab1ad&label=master) +![dev version](https://img.shields.io/github/package-json/v/jerryc127/hexo-theme-butterfly/dev?label=dev) +![npm version](https://img.shields.io/npm/v/hexo-theme-butterfly?color=%09%23bf00ff) +![hexo version](https://img.shields.io/badge/hexo-5.3.0+-0e83cd) +![license](https://img.shields.io/github/license/jerryc127/hexo-theme-butterfly?color=FF5531) +![GitHub stars](https://img.shields.io/github/stars/jerryc127/hexo-theme-butterfly?style=social) + +📢 **Demo**: [Butterfly Official](https://butterfly.js.org/) | [CrazyWong's Blog](https://blog.crazywong.com/) + +📖 **Documentation**: [English Docs](https://butterfly.js.org/en/posts/butterfly-docs-en-get-started/) | [中文文档](https://butterfly.js.org/posts/21cfbf15/) + +![Butterfly Theme Preview](https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/theme-butterfly-readme.png) + +
+ +--- + +## 🚀 Quick Start + +### 💾 Installation + +#### Method 1: Git Installation (Recommended) + +> 💡 **Tip**: If GitHub access is slow in mainland China, you can use the [Gitee Mirror](https://gitee.com/immyw/hexo-theme-butterfly.git) + +Execute in your Hexo blog root directory: + +```bash +# Install stable version (recommended) +git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly +``` + +```bash +# Install development version (early access to new features) +git clone -b dev https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly +``` + +#### Method 2: NPM Installation + +> ⚠️ **Note**: NPM installation only supports Hexo 5.0.0 and above + +```bash +npm install hexo-theme-butterfly +``` + +### ⚙️ Theme Configuration + +1. **Enable Theme**: Modify your Hexo configuration file `_config.yml`: + +```yaml +theme: butterfly +``` + +2. **Install Dependencies**: If you haven't installed pug and stylus renderers, please run: + +```bash +npm install hexo-renderer-pug hexo-renderer-stylus --save +``` + +## ✨ Theme Features + +### 🎨 Design Style +- [x] **Card-based Design** - Modern card-style layout +- [x] **Rounded/Square Design** - Customizable border styles +- [x] **Responsive Design** - Perfect adaptation to all screen sizes +- [x] **Two-column Layout** - Optimized reading experience +- [x] **Dark Mode** - Eye-friendly night mode + +### 📝 Content Features +- [x] **Multi-level Menu** - Support for secondary navigation menus +- [x] **Reading Mode** - Focused article reading experience +- [x] **TOC Navigation** - Desktop and mobile TOC support +- [x] **Word Count** - Display article word count and reading time +- [x] **Related Articles** - Smart recommendation of related content +- [x] **Outdated Reminder** - Automatic article update status alerts +- [x] **Traditional/Simplified Chinese** - Support for Traditional and Simplified Chinese switching +- [x] **Tag Plugins** - Rich tag plugin support + +### 🔍 Search & Navigation +- [x] **Multiple Search Options** - Algolia Search / Local Search / Docsearch +- [x] **Built-in 404** - Beautiful 404 error page +- [x] **Pjax Support** - Smooth page transition experience + +### 🎨 Code Display +- [x] **Syntax Highlighting** - Built-in multiple themes (darker/pale night/light/ocean) +- [x] **Code Features** - Language display/fold expand/copy button/auto-wrap +- [x] **Math Formulas** - Support for Mathjax and Katex + +### 💬 Social Interaction +- [x] **Multiple Comment Systems** - Disqus/Gitalk/Valine/Waline/Twikoo/Giscus/Artalk etc. +- [x] **Dual Comments Support** - Enable two comment systems simultaneously +- [x] **Share Features** - Sharejs/Addtoany sharing components +- [x] **Live Chat** - Chatra/Tidio/Crisp instant messaging + +### 📊 Analytics & Statistics +- [x] **Visit Statistics** - Busuanzi counter +- [x] **Site Analytics** - Google Analytics/Baidu Analytics/Cloudflare Analytics/Microsoft Clarity/Umami +- [x] **Webmaster Verification** - Major search engine verification +- [x] **Ad Support** - Google AdSense/custom ad slots + +### 🎪 Visual Effects +- [x] **Typing Effects** - activate_power_mode animations +- [x] **Background Effects** - Static ribbons/dynamic ribbons/floating ribbons/Canvas Nest +- [x] **Mouse Effects** - Fireworks/hearts/text click effects +- [x] **Loading Animations** - Preloader and pace.js progress bars +- [x] **Image Effects** - Medium Zoom/Fancybox image lightbox +- [x] **Lazy Loading** - Image lazy loading optimization + +### 🛠️ Advanced Features +- [x] **PWA Support** - Progressive Web App +- [x] **Copy Protection** - Disable text copying/copyright info append +- [x] **Theme Customization** - Custom site color schemes +- [x] **Chart Support** - Mermaid flowcharts/Chart.js data charts +- [x] **Music Notation** - ABCJS music notation support +- [x] **Music Player** - APlayer/Meting music playback +- [x] **Article Series** - Series article organization +- [x] **Instantpage** - Page preloading acceleration +- [x] **Snackbar** - Elegant notification messages + +## 🤝 Contributors + +Thanks to all the developers who have contributed to the Butterfly theme! + +[![Contributors](https://contrib.rocks/image?repo=jerryc127/hexo-theme-butterfly)](https://github.com/jerryc127/hexo-theme-butterfly/graphs/contributors) + +## 📸 Screenshots + +
+ +![Theme Demo](https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-1.jpg) + +![Theme Demo](https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-2.jpg) + +![Theme Demo](https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-3.jpg) + +![Theme Demo](https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-4.jpg) + +
+ + +## ⭐ Star History + +[![Star History Chart](https://api.star-history.com/svg?repos=jerryc127/hexo-theme-butterfly&type=Date)](https://star-history.com/#jerryc127/hexo-theme-butterfly&Date) + +## 🤝 Building a Better Theme Together + +We believe **the power of open source comes from everyone's participation**! Whether you're a developer, designer, or user, you can contribute to the development of the Butterfly theme. + +### 💬 Get Help & Support + +- 🐛 **Found a bug?** → [GitHub Issues](https://github.com/jerryc127/hexo-theme-butterfly/issues) - Let's solve it together! +- 💡 **Have ideas?** → [GitHub Discussions](https://github.com/jerryc127/hexo-theme-butterfly/discussions) - Share your creative ideas! +- 📚 **Learning to use?** → [Official Documentation](https://butterfly.js.org/) - Detailed usage guide +- 💬 **Real-time discussion?** → [Telegram Group](https://t.me/bu2fly) - Chat with community members + +### 🎯 Contributing + +Want to make Butterfly better? We welcome any form of contribution: + +- **🔧 Code Contributions** - Fix bugs, add new features, optimize performance +- **📝 Documentation** - Improve docs, translate content, write tutorials +- **🎨 Design Suggestions** - UI/UX improvements, theme colors, icon design +- **🧪 Testing & Feedback** - Test new features, report issues, provide user experience +- **💰 Financial Support** - [Sponsor the Project](https://buy.stripe.com/3cs6rP6YA91sbbG5kk) - Support long-term development + +## 📄 License + +This project is licensed under the [Apache 2.0](LICENSE) License. + +## 🙏 Acknowledgments + +This theme is developed based on [hexo-theme-melody](https://github.com/Molunerfinn/hexo-theme-melody). Thanks to the original author for their excellent work that provided inspiration and foundation! + +Thanks to all friends who have contributed to the development of the Butterfly theme. Your support has made this theme continuously improve and progress. + +--- + +
+ +**✨ If this theme helps you, please give us a ⭐ Star! ✨** +
diff --git a/README_CN.md b/README_CN.md index 5a42e0e..f1bb1b5 100644 --- a/README_CN.md +++ b/README_CN.md @@ -4,114 +4,190 @@
- +Butterfly Logo # hexo-theme-butterfly +一個適用於 Hexo 的現代化、美觀且功能豐富的主題 + ![master version](https://img.shields.io/github/package-json/v/jerryc127/hexo-theme-butterfly/master?color=%231ab1ad&label=master) -![master version](https://img.shields.io/github/package-json/v/jerryc127/hexo-theme-butterfly/dev?label=dev) -![https://img.shields.io/npm/v/hexo-theme-butterfly?color=%09%23bf00ff](https://img.shields.io/npm/v/hexo-theme-butterfly?color=%09%23bf00ff) -![hexo version](https://img.shields.io/badge/hexo-5.3.0+-0e83c) +![dev version](https://img.shields.io/github/package-json/v/jerryc127/hexo-theme-butterfly/dev?label=dev) +![npm version](https://img.shields.io/npm/v/hexo-theme-butterfly?color=%09%23bf00ff) +![hexo version](https://img.shields.io/badge/hexo-5.3.0+-0e83cd) ![license](https://img.shields.io/github/license/jerryc127/hexo-theme-butterfly?color=FF5531) +![GitHub stars](https://img.shields.io/github/stars/jerryc127/hexo-theme-butterfly?style=social) -📢 預覽: [Butterfly](https://butterfly.js.org/) / [CrazyWong](https://blog.crazywong.com/) +📢 **在線預覽**: [Butterfly 官方](https://butterfly.js.org/) | [CrazyWong 博客](https://blog.crazywong.com/) -📖 文檔: [中文](https://butterfly.js.org/posts/21cfbf15/) / [English](https://butterfly.js.org/en/posts/butterfly-docs-en-get-started/) +📖 **完整文檔**: [中文文檔](https://butterfly.js.org/posts/21cfbf15/) | [English Docs](https://butterfly.js.org/en/posts/butterfly-docs-en-get-started/) -![](https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/theme-butterfly-readme.png) +![Butterfly 主題預覽](https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/theme-butterfly-readme.png)
--- -## 💻 安裝 +## 🚀 快速開始 -### Git 安裝 +### 💾 安裝方式 -> 本倉庫同時上傳到 [Gitee](https://gitee.com/immyw/hexo-theme-butterfly.git),如果你訪問 Github 緩慢,可從 Gitee 中下載。 +#### 方式一:Git 安裝(推薦) -在博客根目錄裡安裝穩定版【推薦】 +> 💡 **提示**: 如果您在中國大陸訪問 GitHub 速度較慢,可以使用 [Gitee 鏡像](https://gitee.com/immyw/hexo-theme-butterfly.git) -```powershell +在您的 Hexo 博客根目錄下執行: + +```bash +# 安裝穩定版本(推薦) git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly ``` -如果想要安裝比較新的dev分支,可以 - -```powershell +```bash +# 安裝開發版本(搶先體驗新功能) git clone -b dev https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly ``` -### npm 安裝 +#### 方式二:NPM 安裝 -> 此方法只支持Hexo 5.0.0以上版本 +> ⚠️ **注意**: NPM 安裝方式僅支援 Hexo 5.0.0 及以上版本 -在博客根目錄裡 - -```powershell -npm i hexo-theme-butterfly +```bash +npm install hexo-theme-butterfly ``` -## ⚙ 應用主題 +### ⚙️ 主題配置 -修改hexo配置文件`_config.yml`,把主題改為`Butterfly` +1. **啟用主題**: 修改您的 Hexo 配置檔案 `_config.yml`: -``` +```yaml theme: butterfly ``` ->如果你沒有pug以及stylus的渲染器,請下載安裝: npm install hexo-renderer-pug hexo-renderer-stylus --save +2. **安裝依賴**: 如果您尚未安裝 pug 和 stylus 渲染器,請執行: -## 🎉 特色 +```bash +npm install hexo-renderer-pug hexo-renderer-stylus --save +``` -- [x] 卡片化設計 -- [x] 圓角化設計/直角化設計 -- [X] 支持二級目錄 -- [x] 雙欄設計 -- [x] 響應式主題 -- [x] 夜間模式 -- [x] Pjax -- [x] 文章閲讀模式 -- [x] 簡體和繁體轉換 -- [X] 電腦和手機都可查看TOC目錄 -- [X] 內置多種代碼配色(darker/pale night/light/ocean),可自定義代碼配色 -- [X] 代碼塊顯示代碼語言/關閉或展開代碼塊/代碼複製/代碼自動換行 -- [X] 可關閉文字複製/可開啟內容複製增加版權信息) -- [X] 兩種搜索( Algolia 搜索和本地搜索) -- [x] Mathjax 和 Katex -- [x] 內置404頁面 -- [x] 顯示字數統計 -- [x] 顯示相關文章 -- [x] 過期文章提醒 -- [x] 多種分享系統(Sharejs/Addtoany) -- [X] 多種評論系統(Disqus/Disqusjs/Livere/Gitalk/Valine/Waline/Utterances/Facebook Comments/Twikoo/Giscus/Remark42/artalk) -- [x] 支持雙評論部署 -- [x] 多種在線聊天(Chatra/Tidio/Crisp) -- [x] 多種分析系統 -- [x] 谷歌廣告/手動廣告位置 -- [x] 各種站長驗證 -- [x] 修改網站配色 -- [x] 打字特效 activate_power_mode -- [x] 多種背景特效(靜止彩帶/動態彩帶/Canvas Nest) -- [x] 多種鼠標點擊特效(煙花/文字/愛心) -- [x] 內置一種 Preloader 加載動畫和 pace.js 加載動畫條 -- [x] 不蒜子訪問統計 -- [x] 兩種大圖模式(Medium Zoom/Fancybox) -- [x] Mermaid 圖表顯示 -- [x] Chart.js 圖表顯示 -- [x] 照片牆 -- [x] 圖片懶加載 -- [x] Instantpage/Snackbar彈窗/PWA...... +## ✨ 主題特色 -## ✨ 貢獻者 +### 🎨 設計風格 +- [x] **卡片化設計** - 現代化的卡片式佈局 +- [x] **圓角/直角設計** - 支援自訂邊框樣式 +- [x] **響應式設計** - 完美適配各種螢幕尺寸 +- [x] **雙欄佈局** - 優化的閱讀體驗 +- [x] **深色模式** - 護眼的夜間模式 - - - +### 📝 內容功能 +- [x] **多級選單** - 支援二級導航選單 +- [x] **閱讀模式** - 專注的文章閱讀體驗 +- [x] **目錄導航** - 電腦和手機雙端支援 TOC +- [x] **字數統計** - 顯示文章字數和閱讀時間 +- [x] **相關文章** - 智能推薦相關內容 +- [x] **過期提醒** - 自動提示文章更新狀態 +- [x] **簡繁轉換** - 支援繁體中文和簡體中文切換 +- [x] **標籤外掛** - 豐富的標籤外掛支持 -## 📷 截圖 +### 🔍 搜尋與導航 +- [x] **多種搜尋** - Algolia 搜尋 / 本地搜尋 / Docsearch +- [x] **內建 404** - 美觀的 404 錯誤頁面 +- [x] **Pjax 支援** - 流暢的頁面切換體驗 -![](https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-1.jpg) -![](https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-2.jpg) -![](https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-3.jpg) -![](https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-4.jpg) +### 🎨 程式碼展示 +- [x] **語法高亮** - 內建多種主題(darker/pale night/light/ocean) +- [x] **程式碼功能** - 語言顯示/摺疊展開/複製按鈕/自動換行 +- [x] **數學公式** - 支援 Mathjax 和 Katex + +### 💬 社交互動 +- [x] **多元評論系統** - Disqus/Gitalk/Valine/Waline/Twikoo/Giscus/Artalk 等 +- [x] **雙評論支援** - 可同時啟用兩套評論系統 +- [x] **分享功能** - Sharejs/Addtoany 分享套件 +- [x] **線上客服** - Chatra/Tidio/Crisp 即時聊天 + +### 📊 數據分析 +- [x] **訪問統計** - 不蒜子計數器 +- [x] **網站分析** - Google Analytics/百度統計/Cloudflare Analytics/Microsoft Clarity/Umami +- [x] **站長驗證** - 各大搜尋引擎驗證 +- [x] **廣告支援** - Google AdSense/自訂廣告位 + +### 🎪 視覺效果 +- [x] **打字特效** - activate_power_mode 動畫 +- [x] **背景特效** - 靜態彩帶/動態彩帶/飄帶效果/Canvas Nest +- [x] **滑鼠特效** - 煙花/愛心/文字點擊效果 +- [x] **載入動畫** - Preloader 和 pace.js 進度條 +- [x] **圖片效果** - Medium Zoom/Fancybox 圖片燈箱 +- [x] **懶載入** - 圖片延遲載入優化 + +### 🛠️ 進階功能 +- [x] **PWA 支援** - 漸進式網頁應用 +- [x] **複製保護** - 可關閉文字複製/版權資訊追加 +- [x] **主題定製** - 自訂網站配色方案 +- [x] **圖表支援** - Mermaid 流程圖/Chart.js 數據圖表 +- [x] **音樂符號** - ABCJS 音樂記譜法支援 +- [x] **音樂播放器** - APlayer/Meting 音樂播放功能 +- [x] **系列文章** - 系列文章組織功能 +- [x] **Instantpage** - 頁面預載入加速 +- [x] **Snackbar** - 優雅的提示訊息 + +## 🤝 貢獻者 + +感謝所有為 Butterfly 主題做出貢獻的開發者們! + +[![Contributors](https://contrib.rocks/image?repo=jerryc127/hexo-theme-butterfly)](https://github.com/jerryc127/hexo-theme-butterfly/graphs/contributors) + +## 📸 主題截圖 + +
+ +![主題展示](https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-1.jpg) + +![主題展示](https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-2.jpg) + +![主題展示](https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-3.jpg) + +![主題展示](https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-4.jpg) + +
+ + +## ⭐ Star 趨勢 + +[![Star History Chart](https://api.star-history.com/svg?repos=jerryc127/hexo-theme-butterfly&type=Date)](https://star-history.com/#jerryc127/hexo-theme-butterfly&Date) + +## 🤝 一起構建更美好的主題 + +我們相信,**開源的力量來自於每一個人的參與**!無論您是開發者、設計師還是用戶,都可以為 Butterfly 主題的發展貢獻力量。 + +### 💬 獲取幫助與支援 + +- 🐛 **發現問題?** → [GitHub Issues](https://github.com/jerryc127/hexo-theme-butterfly/issues) - 讓我們一起解決! +- 💡 **有好想法?** → [GitHub Discussions](https://github.com/jerryc127/hexo-theme-butterfly/discussions) - 分享您的創意想法! +- 📚 **學習使用?** → [官方文檔](https://butterfly.js.org/) - 詳細的使用指南 +- 💬 **即時討論?** → [Telegram 群組](https://t.me/bu2fly) - 與社群成員實時交流 + +### 🎯 參與貢獻 + +想要讓 Butterfly 變得更好嗎?我們歡迎您的任何形式的貢獻: + +- **🔧 代碼貢獻** - 修復 Bug、添加新功能、優化性能 +- **📝 文檔完善** - 改進文檔、翻譯內容、撰寫教程 +- **🎨 設計建議** - UI/UX 改進、主題配色、圖示設計 +- **🧪 測試反饋** - 測試新功能、回報問題、提供使用體驗 +- **💰 資金支援** - [贊助項目](https://buy.stripe.com/3cs6rP6YA91sbbG5kk) - 支持長期發展 + +## 📄 授權條款 + +本專案採用 [Apache 2.0](LICENSE) 授權條款。 + +## 🙏 致敬與感謝 + +本主題基於 [hexo-theme-melody](https://github.com/Molunerfinn/hexo-theme-melody) 進行開發,感謝原作者的精彩創作為我們提供了靈感與基礎! + +感謝所有為 Butterfly 主題發展做出貢獻的朋友們,是你們的支持讓這個主題能夠不斷完善與進步。 + +--- + +
+ +**✨ 如果這個主題對您有幫助,請給我們一個 ⭐ Star!✨** +
diff --git a/_config.yml b/_config.yml index 9dae457..329ac97 100644 --- a/_config.yml +++ b/_config.yml @@ -1033,7 +1033,7 @@ Open_Graph_meta: # Structured Data # https://developers.google.com/search/docs/guides/intro-structured-data -structured_data: true +structured_data: false # Add the vendor prefixes to ensure compatibility css_prefix: true diff --git a/layout/includes/widget/card_tags.pug b/layout/includes/widget/card_tags.pug index b0aaa97..0bc51b5 100644 --- a/layout/includes/widget/card_tags.pug +++ b/layout/includes/widget/card_tags.pug @@ -9,6 +9,6 @@ if theme.aside.card_tags.enable - limit = limit === 0 ? 0 : limit || 40 if theme.aside.card_tags.color - .card-tag-cloud!= cloudTags({source: site.tags, orderby: orderby, order: order, minfontsize: 1.15, maxfontsize: 1.45, limit: limit, unit: 'em'}) + .card-tag-cloud!= cloudTags({source: site.tags, orderby: orderby, order: order, minfontsize: 1.15, maxfontsize: 1.45, limit: limit, unit: 'em', page: 'index'}) else .card-tag-cloud!= tagcloud({orderby: orderby, order: order, min_font: 1.1, max_font: 1.5, amount: limit , color: true, start_color: '#999', end_color: '#99a9bf', unit: 'em'}) diff --git a/package.json b/package.json index 294a2f9..d94368c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hexo-theme-butterfly", - "version": "5.4.3", + "version": "5.5.0-b1", "description": "A Simple and Card UI Design theme for Hexo", "main": "package.json", "scripts": { @@ -26,7 +26,7 @@ "hexo-renderer-pug": "^3.0.0", "hexo-renderer-stylus": "^3.0.1", "hexo-util": "^3.3.0", - "moment-timezone": "^0.5.48" + "moment-timezone": "^0.6.0" }, "homepage": "https://butterfly.js.org/", "author": "Jerry ", diff --git a/scripts/common/default_config.js b/scripts/common/default_config.js new file mode 100644 index 0000000..db08c3f --- /dev/null +++ b/scripts/common/default_config.js @@ -0,0 +1,590 @@ +// Butterfly 主題默認配置 +// Default configuration for Butterfly theme + +module.exports = { + nav: { + logo: null, + display_title: true, + display_post_title: true, + fixed: false + }, + menu: null, + code_blocks: { + theme: 'light', + macStyle: false, + height_limit: false, + word_wrap: false, + copy: true, + language: true, + shrink: false, + fullpage: false + }, + social: null, + favicon: '/img/favicon.png', + avatar: { + img: '/img/butterfly-icon.png', + effect: false + }, + disable_top_img: false, + default_top_img: null, + index_img: null, + archive_img: null, + tag_img: null, + tag_per_img: null, + category_img: null, + category_per_img: null, + footer_img: false, + background: null, + cover: { + index_enable: true, + aside_enable: true, + archives_enable: true, + default_cover: null + }, + error_img: { + flink: '/img/friend_404.gif', + post_page: '/img/404.jpg' + }, + error_404: { + enable: false, + subtitle: 'Page Not Found', + background: '/img/error-page.png' + }, + post_meta: { + page: { + date_type: 'created', + date_format: 'date', + categories: true, + tags: false, + label: true + }, + post: { + position: 'left', + date_type: 'both', + date_format: 'date', + categories: true, + tags: true, + label: true + } + }, + index_site_info_top: null, + index_top_img_height: null, + subtitle: { + enable: false, + effect: true, + typed_option: null, + source: false, + sub: null + }, + index_layout: 3, + index_post_content: { + method: 3, + length: 500 + }, + toc: { + post: true, + page: false, + number: true, + expand: false, + style_simple: false, + scroll_percent: true + }, + post_copyright: { + enable: true, + decode: false, + author_href: null, + license: 'CC BY-NC-SA 4.0', + license_url: 'https://creativecommons.org/licenses/by-nc-sa/4.0/' + }, + reward: { + enable: false, + text: null, + QR_code: null + }, + post_edit: { + enable: false, + url: null + }, + related_post: { + enable: true, + limit: 6, + date_type: 'created' + }, + post_pagination: 1, + noticeOutdate: { + enable: false, + style: 'flat', + limit_day: 365, + position: 'top', + message_prev: 'It has been', + message_next: 'days since the last update, the content of the article may be outdated.' + }, + footer: { + nav: null, + owner: { + enable: true, + since: 2025 + }, + copyright: { + enable: true, + version: true + }, + custom_text: null + }, + aside: { + enable: true, + hide: false, + button: true, + mobile: true, + position: 'right', + display: { + archive: true, + tag: true, + category: true + }, + card_author: { + enable: true, + description: null, + button: { + enable: true, + icon: 'fab fa-github', + text: 'Follow Me', + link: 'https://github.com/xxxxxx' + } + }, + card_announcement: { + enable: true, + content: 'This is my Blog' + }, + card_recent_post: { + enable: true, + limit: 5, + sort: 'date', + sort_order: null + }, + card_newest_comments: { + enable: false, + sort_order: null, + limit: 6, + storage: 10, + avatar: true + }, + card_categories: { + enable: true, + limit: 8, + expand: 'none', + sort_order: null + }, + card_tags: { + enable: true, + limit: 40, + color: false, + orderby: 'random', + order: 1, + sort_order: null + }, + card_archives: { + enable: true, + type: 'monthly', + format: 'MMMM YYYY', + order: -1, + limit: 8, + sort_order: null + }, + card_post_series: { + enable: true, + series_title: false, + orderBy: 'date', + order: -1 + }, + card_webinfo: { + enable: true, + post_count: true, + last_push_date: true, + sort_order: null, + runtime_date: null + } + }, + rightside_bottom: null, + translate: { + enable: false, + default: '繁', + defaultEncoding: 2, + translateDelay: 0, + msgToTraditionalChinese: '繁', + msgToSimplifiedChinese: '簡' + }, + readmode: true, + darkmode: { + enable: true, + button: true, + autoChangeMode: false, + start: null, + end: null + }, + rightside_scroll_percent: false, + rightside_item_order: { + enable: false, + hide: null, + show: null + }, + rightside_config_animation: true, + anchor: { + auto_update: false, + click_to_scroll: false + }, + photofigcaption: false, + copy: { + enable: true, + copyright: { + enable: false, + limit_count: 150 + } + }, + wordcount: { + enable: false, + post_wordcount: true, + min2read: true, + total_wordcount: true + }, + busuanzi: { + site_uv: true, + site_pv: true, + page_pv: true + }, + math: { + use: null, + per_page: true, + hide_scrollbar: false, + mathjax: { + enableMenu: true, + tags: 'none' + }, + katex: { + copy_tex: false + } + }, + search: { + use: null, + placeholder: null, + algolia_search: { + hitsPerPage: 6 + }, + local_search: { + preload: false, + top_n_per_article: 1, + unescape: false, + CDN: null + }, + docsearch: { + appId: null, + apiKey: null, + indexName: null, + option: null + } + }, + share: { + use: 'sharejs', + sharejs: { + sites: 'facebook,twitter,wechat,weibo,qq' + }, + addtoany: { + item: 'facebook,twitter,wechat,sina_weibo,facebook_messenger,email,copy_link' + } + }, + comments: { + use: null, + text: true, + lazyload: false, + count: false, + card_post_count: false + }, + disqus: { + shortname: null, + apikey: null + }, + disqusjs: { + shortname: null, + apikey: null, + option: null + }, + livere: { + uid: null + }, + gitalk: { + client_id: null, + client_secret: null, + repo: null, + owner: null, + admin: null, + option: null + }, + valine: { + appId: null, + appKey: null, + avatar: 'monsterid', + serverURLs: null, + bg: null, + visitor: false, + option: null + }, + waline: { + serverURL: null, + bg: null, + pageview: false, + option: null + }, + utterances: { + repo: null, + issue_term: 'pathname', + light_theme: 'github-light', + dark_theme: 'photon-dark', + js: null, + option: null + }, + facebook_comments: { + app_id: null, + user_id: null, + pageSize: 10, + order_by: 'social', + lang: 'en_US' + }, + twikoo: { + envId: null, + region: null, + visitor: false, + option: null + }, + giscus: { + repo: null, + repo_id: null, + category_id: null, + light_theme: 'light', + dark_theme: 'dark', + js: null, + option: null + }, + remark42: { + host: null, + siteId: null, + option: null + }, + artalk: { + server: null, + site: null, + visitor: false, + option: null + }, + chat: { + use: null, + rightside_button: false, + button_hide_show: false + }, + chatra: { + id: null + }, + tidio: { + public_key: null + }, + crisp: { + website_id: null + }, + google_tag_manager: { + tag_id: null, + domain: 'https://www.googletagmanager.com' + }, + baidu_analytics: null, + google_analytics: null, + cloudflare_analytics: null, + microsoft_clarity: null, + umami_analytics: { + enable: false, + serverURL: null, + website_id: null, + option: null, + UV_PV: { + site_uv: false, + site_pv: false, + page_pv: false, + token: null + } + }, + google_adsense: { + enable: false, + auto_ads: true, + js: 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js', + client: null, + enable_page_level_ads: true + }, + ad: { + index: null, + aside: null, + post: null + }, + site_verification: null, + category_ui: null, + tag_ui: null, + rounded_corners_ui: true, + text_align_justify: false, + mask: { + header: true, + footer: true + }, + preloader: { + enable: false, + source: 1, + pace_css_url: null + }, + enter_transitions: true, + display_mode: 'light', + beautify: { + enable: false, + field: 'post', + title_prefix_icon: null, + title_prefix_icon_color: null + }, + font: { + global_font_size: null, + code_font_size: null, + font_family: null, + code_font_family: null + }, + blog_title_font: { + font_link: null, + font_family: null + }, + hr_icon: { + enable: true, + icon: null, + icon_top: null + }, + activate_power_mode: { + enable: false, + colorful: true, + shake: true, + mobile: false + }, + canvas_ribbon: { + enable: false, + size: 150, + alpha: 0.6, + zIndex: -1, + click_to_change: false, + mobile: false + }, + canvas_fluttering_ribbon: { + enable: false, + mobile: false + }, + canvas_nest: { + enable: false, + color: '0,0,255', + opacity: 0.7, + zIndex: -1, + count: 99, + mobile: false + }, + fireworks: { + enable: false, + zIndex: 9999, + mobile: false + }, + click_heart: { + enable: false, + mobile: false + }, + clickShowText: { + enable: false, + text: null, + fontSize: '15px', + random: false, + mobile: false + }, + lightbox: null, + series: { + enable: false, + orderBy: 'title', + order: 1, + number: true + }, + abcjs: { + enable: false, + per_page: true + }, + mermaid: { + enable: false, + code_write: false, + theme: { + light: 'default', + dark: 'dark' + } + }, + chartjs: { + enable: false, + fontColor: { + light: 'rgba(0, 0, 0, 0.8)', + dark: 'rgba(255, 255, 255, 0.8)' + }, + borderColor: { + light: 'rgba(0, 0, 0, 0.1)', + dark: 'rgba(255, 255, 255, 0.2)' + }, + scale_ticks_backdropColor: { + light: 'transparent', + dark: 'transparent' + } + }, + note: { + style: 'flat', + icons: true, + border_radius: 3, + light_bg_offset: 0 + }, + pjax: { + enable: false, + exclude: null + }, + aplayerInject: { + enable: false, + per_page: true + }, + snackbar: { + enable: false, + position: 'bottom-left', + bg_light: '#49b1f5', + bg_dark: '#1f1f1f' + }, + instantpage: false, + lazyload: { + enable: false, + native: false, + field: 'site', + placeholder: null, + blur: false + }, + pwa: { + enable: false, + manifest: null, + apple_touch_icon: null, + favicon_32_32: null, + favicon_16_16: null, + mask_icon: null + }, + Open_Graph_meta: { + enable: true, + option: null + }, + structured_data: false, + css_prefix: true, + inject: { + head: null, + bottom: null + }, + CDN: { + internal_provider: 'local', + third_party_provider: 'jsdelivr', + version: false, + custom_format: null, + option: null + } +} diff --git a/scripts/events/comment.js b/scripts/events/comment.js deleted file mode 100644 index 83a67e9..0000000 --- a/scripts/events/comment.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Capitalize the first letter of comment name - */ - -hexo.extend.filter.register('before_generate', () => { - const themeConfig = hexo.theme.config - let { use } = themeConfig.comments - if (!use) return - - // Make sure use is an array - use = Array.isArray(use) ? use : use.split(',') - - // Capitalize the first letter of each comment name - use = use.map(item => - item.trim().toLowerCase().replace(/\b[a-z]/g, s => s.toUpperCase()) - ) - - // Disqus and Disqusjs conflict, only keep the first one - if (use.includes('Disqus') && use.includes('Disqusjs')) { - use = [use[0]] - } - - themeConfig.comments.use = use -}) diff --git a/scripts/events/init.js b/scripts/events/init.js index dab4696..b7d6e63 100644 --- a/scripts/events/init.js +++ b/scripts/events/init.js @@ -1,20 +1,87 @@ -hexo.extend.filter.register('before_generate', () => { - // Get first two digits of the Hexo version number - const { version, log, locals } = hexo - const hexoVer = version.replace(/(^.*\..*)\..*/, '$1') - - if (hexoVer < 5.3) { - log.error('Please update Hexo to V5.3.0 or higher!') - log.error('請把 Hexo 升級到 V5.3.0 或更高的版本!') - process.exit(-1) - } - - if (locals.get) { - const data = locals.get('data') - if (data && data.butterfly) { - log.error("'butterfly.yml' is deprecated. Please use '_config.butterfly.yml'") - log.error("'butterfly.yml' 已經棄用,請使用 '_config.butterfly.yml'") - process.exit(-1) - } - } -}) +const { deepMerge } = require('hexo-util') +const path = require('path') +const fs = require('fs') + +// Cache default config to avoid repeated file reads +let cachedDefaultConfig = null + +/** + * Check Hexo version and configuration + */ +function checkHexoEnvironment (hexo) { + const { version, log, locals } = hexo + + const [major, minor] = version.split('.').map(Number) + const requiredMajor = 5 + const requiredMinor = 3 + + if (major < requiredMajor || (major === requiredMajor && minor < requiredMinor)) { + log.error('Please update Hexo to V5.3.0 or higher!') + log.error('請把 Hexo 升級到 V5.3.0 或更高的版本!') + process.exit(-1) + } + + // Check for deprecated configuration file + if (locals.get) { + const data = locals.get('data') + if (data && data.butterfly) { + log.error("'butterfly.yml' is deprecated. Please use '_config.butterfly.yml'") + log.error("'butterfly.yml' 已經棄用,請使用 '_config.butterfly.yml'") + process.exit(-1) + } + } +} + +/** + * Load default configuration + */ +function loadDefaultConfig () { + if (cachedDefaultConfig) { + return cachedDefaultConfig + } + + const configPath = path.join(__dirname, '../common/default_config.js') + cachedDefaultConfig = require(configPath) + return cachedDefaultConfig +} + +/** + * Process comment system configuration + */ +function processCommentConfig (themeConfig) { + const { comments } = themeConfig + if (!comments || !comments.use) { + return + } + + let { use } = comments + + if (!Array.isArray(use)) { + use = typeof use === 'string' ? use.split(',') : [use] + } + + use = use + .map(item => { + if (typeof item !== 'string') return item + return item.trim().toLowerCase().replace(/\b[a-z]/g, s => s.toUpperCase()) + }) + .filter(Boolean) + + // Handle Disqus and Disqusjs conflict + if (use.includes('Disqus') && use.includes('Disqusjs')) { + hexo.log.warn('Disqus and Disqusjs conflict detected, keeping only the first one') + hexo.log.warn('檢測到 Disqus 和 Disqusjs 衝突,只保留第一個') + use = [use[0]] + } + + themeConfig.comments.use = use +} + +hexo.extend.filter.register('before_generate', () => { + checkHexoEnvironment(hexo) + + const defaultConfig = loadDefaultConfig() + hexo.theme.config = deepMerge(defaultConfig, hexo.theme.config) + + processCommentConfig(hexo.theme.config) +}, 1) diff --git a/scripts/events/merge_config.js b/scripts/events/merge_config.js deleted file mode 100644 index d449282..0000000 --- a/scripts/events/merge_config.js +++ /dev/null @@ -1,593 +0,0 @@ -const { deepMerge } = require('hexo-util') - -hexo.extend.filter.register('before_generate', () => { - const defaultConfig = { - nav: { - logo: null, - display_title: true, - display_post_title: true, - fixed: false - }, - menu: null, - code_blocks: { - theme: 'light', - macStyle: false, - height_limit: false, - word_wrap: false, - copy: true, - language: true, - shrink: false, - fullpage: false - }, - social: null, - favicon: '/img/favicon.png', - avatar: { - img: '/img/butterfly-icon.png', - effect: false - }, - disable_top_img: false, - default_top_img: null, - index_img: null, - archive_img: null, - tag_img: null, - tag_per_img: null, - category_img: null, - category_per_img: null, - footer_img: false, - background: null, - cover: { - index_enable: true, - aside_enable: true, - archives_enable: true, - default_cover: null - }, - error_img: { - flink: '/img/friend_404.gif', - post_page: '/img/404.jpg' - }, - error_404: { - enable: false, - subtitle: 'Page Not Found', - background: '/img/error-page.png' - }, - post_meta: { - page: { - date_type: 'created', - date_format: 'date', - categories: true, - tags: false, - label: true - }, - post: { - position: 'left', - date_type: 'both', - date_format: 'date', - categories: true, - tags: true, - label: true - } - }, - index_site_info_top: null, - index_top_img_height: null, - subtitle: { - enable: false, - effect: true, - typed_option: null, - source: false, - sub: null - }, - index_layout: 3, - index_post_content: { - method: 3, - length: 500 - }, - toc: { - post: true, - page: false, - number: true, - expand: false, - style_simple: false, - scroll_percent: true - }, - post_copyright: { - enable: true, - decode: false, - author_href: null, - license: 'CC BY-NC-SA 4.0', - license_url: 'https://creativecommons.org/licenses/by-nc-sa/4.0/' - }, - reward: { - enable: false, - text: null, - QR_code: null - }, - post_edit: { - enable: false, - url: null - }, - related_post: { - enable: true, - limit: 6, - date_type: 'created' - }, - post_pagination: 1, - noticeOutdate: { - enable: false, - style: 'flat', - limit_day: 365, - position: 'top', - message_prev: 'It has been', - message_next: 'days since the last update, the content of the article may be outdated.' - }, - footer: { - nav: null, - owner: { - enable: true, - since: 2024 - }, - copyright: { - enable: true, - version: true - }, - custom_text: null - }, - aside: { - enable: true, - hide: false, - button: true, - mobile: true, - position: 'right', - display: { - archive: true, - tag: true, - category: true - }, - card_author: { - enable: true, - description: null, - button: { - enable: true, - icon: 'fab fa-github', - text: 'Follow Me', - link: 'https://github.com/xxxxxx' - } - }, - card_announcement: { - enable: true, - content: 'This is my Blog' - }, - card_recent_post: { - enable: true, - limit: 5, - sort: 'date', - sort_order: null - }, - card_newest_comments: { - enable: false, - sort_order: null, - limit: 6, - storage: 10, - avatar: true - }, - card_categories: { - enable: true, - limit: 8, - expand: 'none', - sort_order: null - }, - card_tags: { - enable: true, - limit: 40, - color: false, - orderby: 'random', - order: 1, - sort_order: null - }, - card_archives: { - enable: true, - type: 'monthly', - format: 'MMMM YYYY', - order: -1, - limit: 8, - sort_order: null - }, - card_post_series: { - enable: true, - series_title: false, - orderBy: 'date', - order: -1 - }, - card_webinfo: { - enable: true, - post_count: true, - last_push_date: true, - sort_order: null, - runtime_date: null - } - }, - rightside_bottom: null, - translate: { - enable: false, - default: '繁', - defaultEncoding: 2, - translateDelay: 0, - msgToTraditionalChinese: '繁', - msgToSimplifiedChinese: '簡' - }, - readmode: true, - darkmode: { - enable: true, - button: true, - autoChangeMode: false, - start: null, - end: null - }, - rightside_scroll_percent: false, - rightside_item_order: { - enable: false, - hide: null, - show: null - }, - rightside_config_animation: true, - anchor: { - auto_update: false, - click_to_scroll: false - }, - photofigcaption: false, - copy: { - enable: true, - copyright: { - enable: false, - limit_count: 150 - } - }, - wordcount: { - enable: false, - post_wordcount: true, - min2read: true, - total_wordcount: true - }, - busuanzi: { - site_uv: true, - site_pv: true, - page_pv: true - }, - math: { - use: null, - per_page: true, - hide_scrollbar: false, - mathjax: { - enableMenu: true, - tags: 'none' - }, - katex: { - copy_tex: false - } - }, - search: { - use: null, - placeholder: null, - algolia_search: { - hitsPerPage: 6 - }, - local_search: { - preload: false, - top_n_per_article: 1, - unescape: false, - CDN: null - }, - docsearch: { - appId: null, - apiKey: null, - indexName: null, - option: null - } - }, - share: { - use: 'sharejs', - sharejs: { - sites: 'facebook,twitter,wechat,weibo,qq' - }, - addtoany: { - item: 'facebook,twitter,wechat,sina_weibo,facebook_messenger,email,copy_link' - } - }, - comments: { - use: null, - text: true, - lazyload: false, - count: false, - card_post_count: false - }, - disqus: { - shortname: null, - apikey: null - }, - disqusjs: { - shortname: null, - apikey: null, - option: null - }, - livere: { - uid: null - }, - gitalk: { - client_id: null, - client_secret: null, - repo: null, - owner: null, - admin: null, - option: null - }, - valine: { - appId: null, - appKey: null, - avatar: 'monsterid', - serverURLs: null, - bg: null, - visitor: false, - option: null - }, - waline: { - serverURL: null, - bg: null, - pageview: false, - option: null - }, - utterances: { - repo: null, - issue_term: 'pathname', - light_theme: 'github-light', - dark_theme: 'photon-dark', - js: null, - option: null - }, - facebook_comments: { - app_id: null, - user_id: null, - pageSize: 10, - order_by: 'social', - lang: 'en_US' - }, - twikoo: { - envId: null, - region: null, - visitor: false, - option: null - }, - giscus: { - repo: null, - repo_id: null, - category_id: null, - light_theme: 'light', - dark_theme: 'dark', - js: null, - option: null - }, - remark42: { - host: null, - siteId: null, - option: null - }, - artalk: { - server: null, - site: null, - visitor: false, - option: null - }, - chat: { - use: null, - rightside_button: false, - button_hide_show: false - }, - chatra: { - id: null - }, - tidio: { - public_key: null - }, - crisp: { - website_id: null - }, - google_tag_manager: { - tag_id: null, - domain: 'https://www.googletagmanager.com' - }, - baidu_analytics: null, - google_analytics: null, - cloudflare_analytics: null, - microsoft_clarity: null, - umami_analytics: { - enable: false, - serverURL: null, - website_id: null, - option: null, - UV_PV: { - site_uv: false, - site_pv: false, - page_pv: false, - token: null - } - }, - google_adsense: { - enable: false, - auto_ads: true, - js: 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js', - client: null, - enable_page_level_ads: true - }, - ad: { - index: null, - aside: null, - post: null - }, - site_verification: null, - category_ui: null, - tag_ui: null, - rounded_corners_ui: true, - text_align_justify: false, - mask: { - header: true, - footer: true - }, - preloader: { - enable: false, - source: 1, - pace_css_url: null - }, - enter_transitions: true, - display_mode: 'light', - beautify: { - enable: false, - field: 'post', - title_prefix_icon: null, - title_prefix_icon_color: null - }, - font: { - global_font_size: null, - code_font_size: null, - font_family: null, - code_font_family: null - }, - blog_title_font: { - font_link: null, - font_family: null - }, - hr_icon: { - enable: true, - icon: null, - icon_top: null - }, - activate_power_mode: { - enable: false, - colorful: true, - shake: true, - mobile: false - }, - canvas_ribbon: { - enable: false, - size: 150, - alpha: 0.6, - zIndex: -1, - click_to_change: false, - mobile: false - }, - canvas_fluttering_ribbon: { - enable: false, - mobile: false - }, - canvas_nest: { - enable: false, - color: '0,0,255', - opacity: 0.7, - zIndex: -1, - count: 99, - mobile: false - }, - fireworks: { - enable: false, - zIndex: 9999, - mobile: false - }, - click_heart: { - enable: false, - mobile: false - }, - clickShowText: { - enable: false, - text: null, - fontSize: '15px', - random: false, - mobile: false - }, - lightbox: null, - series: { - enable: false, - orderBy: 'title', - order: 1, - number: true - }, - abcjs: { - enable: false, - per_page: true - }, - mermaid: { - enable: false, - code_write: false, - theme: { - light: 'default', - dark: 'dark' - } - }, - chartjs: { - enable: false, - fontColor: { - light: 'rgba(0, 0, 0, 0.8)', - dark: 'rgba(255, 255, 255, 0.8)' - }, - borderColor: { - light: 'rgba(0, 0, 0, 0.1)', - dark: 'rgba(255, 255, 255, 0.2)' - }, - scale_ticks_backdropColor: { - light: 'transparent', - dark: 'transparent' - } - }, - note: { - style: 'flat', - icons: true, - border_radius: 3, - light_bg_offset: 0 - }, - pjax: { - enable: false, - exclude: null - }, - aplayerInject: { - enable: false, - per_page: true - }, - snackbar: { - enable: false, - position: 'bottom-left', - bg_light: '#49b1f5', - bg_dark: '#1f1f1f' - }, - instantpage: false, - lazyload: { - enable: false, - native: false, - field: 'site', - placeholder: null, - blur: false - }, - pwa: { - enable: false, - manifest: null, - apple_touch_icon: null, - favicon_32_32: null, - favicon_16_16: null, - mask_icon: null - }, - Open_Graph_meta: { - enable: true, - option: null - }, - structured_data: true, - css_prefix: true, - inject: { - head: null, - bottom: null - }, - CDN: { - internal_provider: 'local', - third_party_provider: 'jsdelivr', - version: false, - custom_format: null, - option: null - } - } - - hexo.theme.config = deepMerge(defaultConfig, hexo.theme.config) -}, 1) diff --git a/scripts/helpers/page.js b/scripts/helpers/page.js index 9cdee3f..0b1bbc6 100644 --- a/scripts/helpers/page.js +++ b/scripts/helpers/page.js @@ -13,7 +13,7 @@ hexo.extend.helper.register('postDesc', data => { hexo.extend.helper.register('cloudTags', function (options = {}) { const env = this - let { source, minfontsize, maxfontsize, limit, unit = 'px', orderby, order } = options + let { source, minfontsize, maxfontsize, limit, unit = 'px', orderby, order, page = 'tags' } = options if (limit > 0) { source = source.limit(limit) @@ -29,14 +29,19 @@ hexo.extend.helper.register('cloudTags', function (options = {}) { return `rgb(${Math.max(r, 50)}, ${Math.max(g, 50)}, ${Math.max(b, 50)})` } - const generateStyle = (size, unit) => - `font-size: ${parseFloat(size.toFixed(2)) + unit}; color: ${getRandomColor()};` + const generateStyle = (size, unit, page) => { + if (page === 'tags') { + return `font-size: ${parseFloat(size.toFixed(2)) + unit}; background-color: ${getRandomColor()};` + } else { + return `font-size: ${parseFloat(size.toFixed(2)) + unit}; color: ${getRandomColor()};` + } + } const length = sizes.length - 1 const result = source.sort(orderby, order).map(tag => { const ratio = length ? sizes.indexOf(tag.length) / length : 0 const size = minfontsize + ((maxfontsize - minfontsize) * ratio) - const style = generateStyle(size, unit) + const style = generateStyle(size, unit, page) return `${tag.name}` }).join('') diff --git a/scripts/tag/hide.js b/scripts/tag/hide.js index f2556fe..c244ddb 100644 --- a/scripts/tag/hide.js +++ b/scripts/tag/hide.js @@ -49,4 +49,4 @@ const hideToggle = (args, content) => { hexo.extend.tag.register('hideInline', hideInline) hexo.extend.tag.register('hideBlock', hideBlock, { ends: true }) -hexo.extend.tag.register('hideToggle', hideToggle, { ends: true }) \ No newline at end of file +hexo.extend.tag.register('hideToggle', hideToggle, { ends: true }) diff --git a/scripts/tag/score.js b/scripts/tag/score.js index df345e5..a356325 100644 --- a/scripts/tag/score.js +++ b/scripts/tag/score.js @@ -37,7 +37,7 @@ const score = (args, content) => { try { paramsObj = JSON.parse(paramPart) } catch (e) { - console.error("Failed to parse JSON in score tag:", e) + console.error('Failed to parse JSON in score tag:', e) } // Use double quotes for data-params attribute value, @@ -47,4 +47,4 @@ const score = (args, content) => { ` } -hexo.extend.tag.register("score", score, { ends: true }) \ No newline at end of file +hexo.extend.tag.register('score', score, { ends: true }) diff --git a/source/css/_global/function.styl b/source/css/_global/function.styl index c2aa551..2b6da53 100644 --- a/source/css/_global/function.styl +++ b/source/css/_global/function.styl @@ -181,6 +181,60 @@ if hexo-config('avatar.effect') == true .reward-main animation: donate_effcet .3s .1s ease both +.btn-effects + position: relative + overflow: hidden + transition: all .3s cubic-bezier(.4, 0, .2, 1) + transform: translateZ(0) + + &:hover + box-shadow: 0 4px 12px rgba(0, 0, 0, .15) + text-decoration: none + transform: translateY(-1px) scale(1.02) + + &:active + transition-duration: .1s + transform: translateY(0) scale(.98) + + i + display: inline-block + vertical-align: middle + transition: all .3s cubic-bezier(.4, 0, .2, 1) + + &:hover i + animation: buttonIconBounce .6s ease-in-out + + i + span + margin-left: 6px + vertical-align: middle + transition: margin-left .3s cubic-bezier(.4, 0, .2, 1) + + &:hover i + span + margin-left: 8px + + &::before + position: absolute + top: 0 + left: -100% + z-index: 1 + width: 100% + height: 100% + background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .2), transparent) + content: '' + transition: left .5s cubic-bezier(.4, 0, .2, 1) + + &:hover::before + left: 100% + + & > * + position: relative + z-index: 2 + +.btn-effects-large + &:hover + box-shadow: 0 6px 16px rgba(0, 0, 0, .2) + transform: translateY(-2px) scale(1.03) + @keyframes scroll-down-effect 0% opacity: .4 @@ -278,3 +332,17 @@ if hexo-config('avatar.effect') == true 100% transform: translateX(0) + +@keyframes buttonIconBounce + 0%, + 100% + transform: translateY(0) scale(1) + + 25% + transform: translateY(-3px) scale(1.1) rotateZ(-5deg) + + 50% + transform: translateY(0) scale(1.05) rotateZ(0) + + 75% + transform: translateY(-1px) scale(1.02) rotateZ(2deg) \ No newline at end of file diff --git a/source/css/_global/index.styl b/source/css/_global/index.styl index ca17ad3..996265e 100644 --- a/source/css/_global/index.styl +++ b/source/css/_global/index.styl @@ -39,6 +39,65 @@ --zoom-bg: #fff --mark-bg: alpha($dark-black, .3) +// tags plugin +:root + --btn-color: $btn-color + --btn-default-color: $btn-default-color + --tags-blue-color: $tagsP-blue-color + --tags-blue-color-lighten: lighten($tagsP-blue-color, 85%) + --tags-pink-color: $tagsP-pink-color + --tags-pink-color-lighten: lighten($tagsP-pink-color, 85%) + --tags-red-color: $tagsP-red-color + --tags-red-color-lighten: lighten($tagsP-red-color, 85%) + --tags-orange-color: $tagsP-orange-color + --tags-orange-color-lighten: lighten($tagsP-orange-color, 85%) + --tags-purple-color: $tagsP-purple-color + --tags-purple-color-lighten: lighten($tagsP-purple-color, 85%) + --tags-green-color: $tagsP-green-color + --tags-green-color-lighten: lighten($tagsP-green-color, 85%) + --note-default-border: $note-default-border + --note-default-bg: $note-default-bg + --note-default-text: $note-default-text + --note-modern-default-border: $note-modern-default-border + --note-modern-default-bg: $note-modern-default-bg + --note-modern-default-text: $note-modern-default-text + --note-modern-default-hover: $note-modern-default-hover + --note-primary-border: $note-primary-border + --note-primary-bg: $note-primary-bg + --note-primary-text: $note-primary-text + --note-modern-primary-border: $note-modern-primary-border + --note-modern-primary-bg: $note-modern-primary-bg + --note-modern-primary-text: $note-modern-primary-text + --note-modern-primary-hover: $note-modern-primary-hover + --note-info-border: $note-info-border + --note-info-bg: $note-info-bg + --note-info-text: $note-info-text + --note-modern-info-border: $note-modern-info-border + --note-modern-info-bg: $note-modern-info-bg + --note-modern-info-text: $note-modern-info-text + --note-modern-info-hover: $note-modern-info-hover + --note-success-border: $note-success-border + --note-success-bg: $note-success-bg + --note-success-text: $note-success-text + --note-modern-success-border: $note-modern-success-border + --note-modern-success-bg: $note-modern-success-bg + --note-modern-success-text: $note-modern-success-text + --note-modern-success-hover: $note-modern-success-hover + --note-warning-border: $note-warning-border + --note-warning-bg: $note-warning-bg + --note-warning-text: $note-warning-text + --note-modern-warning-border: $note-modern-warning-border + --note-modern-warning-bg: $note-modern-warning-bg + --note-modern-warning-text: $note-modern-warning-text + --note-modern-warning-hover: $note-modern-warning-hover + --note-danger-border: $note-danger-border + --note-danger-bg: $note-danger-bg + --note-danger-text: $note-danger-text + --note-modern-danger-border: $note-modern-danger-border + --note-modern-danger-bg: $note-modern-danger-bg + --note-modern-danger-text: $note-modern-danger-text + --note-modern-danger-hover: $note-modern-danger-hover + body position: relative overflow-y: scroll diff --git a/source/css/_layout/aside.styl b/source/css/_layout/aside.styl index 1bf056a..abb779d 100644 --- a/source/css/_layout/aside.styl +++ b/source/css/_layout/aside.styl @@ -60,6 +60,7 @@ text-align: center line-height: 2.4 addBorderRadius(7) + @extend .btn-effects &:hover background-color: var(--btn-hover-color) diff --git a/source/css/_layout/reward.styl b/source/css/_layout/reward.styl index b50387a..b6cce62 100644 --- a/source/css/_layout/reward.styl +++ b/source/css/_layout/reward.styl @@ -15,9 +15,12 @@ color: var(--btn-color) cursor: pointer addBorderRadius() + @extend .btn-effects + @extend .btn-effects-large i margin-right: 5px + vertical-align: baseline &:hover .reward-button @@ -28,7 +31,7 @@ .reward-main position: absolute - bottom: 40px + bottom: 50px left: 0 z-index: 100 display: none diff --git a/source/css/_layout/rightside.styl b/source/css/_layout/rightside.styl index a071630..9ebb741 100644 --- a/source/css/_layout/rightside.styl +++ b/source/css/_layout/rightside.styl @@ -54,19 +54,52 @@ if hexo-config('rightside_scroll_percent') #go-up + position: relative + .scroll-percent + position: absolute + top: 0 + left: 0 display: none + width: 100% + height: 100% + opacity: 0 + transition: all .4s cubic-bezier(.4, 0, .2, 1) + transform: scale(.8) + + i + position: relative + z-index: 1 + width: 100% + opacity: 1 + transition: all .4s cubic-bezier(.4, 0, .2, 1) + transform: scale(1) &.show-percent .scroll-percent display: block + opacity: 1 + transform: scale(1) + animation: fadeInScale .4s ease-out - & + i - display: none + i + opacity: 0 + transform: scale(.8) - &:hover + &:hover.show-percent .scroll-percent - display: none + opacity: 0 + transform: scale(.8) - & + i - display: block + i + opacity: 1 !important + transform: scale(1) !important + +@keyframes fadeInScale + from + opacity: 0 + transform: scale(.8) + + to + opacity: 1 + transform: scale(1) \ No newline at end of file diff --git a/source/css/_mode/darkmode.styl b/source/css/_mode/darkmode.styl index bcd5334..28d0893 100644 --- a/source/css/_mode/darkmode.styl +++ b/source/css/_mode/darkmode.styl @@ -33,6 +33,56 @@ if hexo-config('darkmode.enable') || hexo-config('display_mode') == 'dark' --timeline-bg: lighten(#121212, 5) --zoom-bg: #121212 --mark-bg: alpha($dark-black, .6) + --btn-color: darken($btn-color, 20%) + --btn-default-color: lighten($btn-default-color, 20%) + --tags-blue-color: desaturate(darken($tagsP-blue-color, 20%), 25%) + --tags-blue-color-lighten: rgba(66, 139, 202, .15) + --tags-pink-color: desaturate(darken($tagsP-pink-color, 22%), 30%) + --tags-pink-color-lighten: rgba(255, 105, 180, .15) + --tags-red-color: desaturate(darken($tagsP-red-color, 25%), 28%) + --tags-red-color-lighten: rgba(255, 0, 0, .15) + --tags-orange-color: desaturate(darken($tagsP-orange-color, 22%), 32%) + --tags-orange-color-lighten: rgba(255, 140, 0, .15) + --tags-purple-color: desaturate(darken($tagsP-purple-color, 18%), 30%) + --tags-purple-color-lighten: rgba(111, 66, 193, .15) + --tags-green-color: desaturate(darken($tagsP-green-color, 20%), 28%) + --tags-green-color-lighten: rgba(92, 184, 92, .15) + --note-default-border: $note-dark-default-border + --note-default-bg: $note-dark-default-bg + --note-default-text: $note-dark-default-text + --note-modern-default-border: $note-dark-modern-default-border + --note-modern-default-bg: $note-dark-modern-default-bg + --note-modern-default-text: $note-dark-modern-default-text + --note-primary-border: $note-dark-primary-border + --note-primary-bg: $note-dark-primary-bg + --note-primary-text: $note-dark-primary-text + --note-modern-primary-border: $note-dark-modern-primary-border + --note-modern-primary-bg: $note-dark-modern-primary-bg + --note-modern-primary-text: $note-dark-modern-primary-text + --note-info-border: $note-dark-info-border + --note-info-bg: $note-dark-info-bg + --note-info-text: $note-dark-info-text + --note-modern-info-border: $note-dark-modern-info-border + --note-modern-info-bg: $note-dark-modern-info-bg + --note-modern-info-text: $note-dark-modern-info-text + --note-success-border: $note-dark-success-border + --note-success-bg: $note-dark-success-bg + --note-success-text: $note-dark-success-text + --note-modern-success-border: $note-dark-modern-success-border + --note-modern-success-bg: $note-dark-modern-success-bg + --note-modern-success-text: $note-dark-modern-success-text + --note-warning-border: $note-dark-warning-border + --note-warning-bg: $note-dark-warning-bg + --note-warning-text: $note-dark-warning-text + --note-modern-warning-border: $note-dark-modern-warning-border + --note-modern-warning-bg: $note-dark-modern-warning-bg + --note-modern-warning-text: $note-dark-modern-warning-text + --note-danger-border: $note-dark-danger-border + --note-danger-bg: $note-dark-danger-bg + --note-danger-text: $note-dark-danger-text + --note-modern-danger-border: $note-dark-modern-danger-border + --note-modern-danger-bg: $note-dark-modern-danger-bg + --note-modern-danger-text: $note-dark-modern-danger-text #web_bg:before position: absolute @@ -78,23 +128,17 @@ if hexo-config('darkmode.enable') || hexo-config('display_mode') == 'dark' #switch-btn filter: brightness(.8) - // note - if hexo-config('note.style') == 'modern' || hexo-config('note.style') == 'flat' - .note - filter: brightness(.8) - // hide-tags .hide-button, - .btn-beautify, - .hl-label, #post-outdate-notice, .error-img, .container iframe, .gist, - .ads-wrap + .ads-wrap, + .tag-cloud-list > a filter: brightness(.8) - img + img:not(.cover) if hexo-config('lazyload.enable') && hexo-config('lazyload.blur') && !hexo-config('lazyload.placeholder') filter: blur(0) brightness(.8) else @@ -148,7 +192,7 @@ if hexo-config('darkmode.enable') || hexo-config('display_mode') == 'dark' --at-color-font: alpha(#FFFFFF, .7) --at-color-meta: alpha(#FFFFFF, .7) --at-color-grey: alpha(#FFFFFF, .7) - + .atk-send-btn, .atk-badge color: alpha(#FFFFFF, .7) !important diff --git a/source/css/_page/tags.styl b/source/css/_page/tags.styl index fb868d2..1b272d6 100644 --- a/source/css/_page/tags.styl +++ b/source/css/_page/tags.styl @@ -1,27 +1,91 @@ .tag-cloud &-list + animation: tagsFadeIn .6s cubic-bezier(.4, 0, .2, 1) + + &:hover a:not(:hover) + opacity: .7 + transform: scale(.98) + a + position: relative display: inline-block - margin: 2px - padding: 2px 7px + margin: 5px + padding: 3px 12px line-height: 1.7 - transition: all .3s - addBorderRadius(5) + transition: all .3s cubic-bezier(.4, 0, .2, 1) + addBorderRadius(7) + overflow: hidden + color: white + transform: translateY(0) scale(1) + will-change: transform, background-color, box-shadow + + &::before + position: absolute + top: 0 + left: -100% + z-index: -1 + width: 100% + height: 100% + background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .1), transparent) + content: '' + transition: left .6s cubic-bezier(.4, 0, .2, 1) &:hover - background: var(--btn-bg) !important - box-shadow: 2px 2px 6px rgba(0, 0, 0, .2) + background: var(--btn-hover-color) !important + box-shadow: + 0 6px 20px rgba(0, 0, 0, .12), + 0 4px 8px rgba(0, 0, 0, .08), + 0 0 0 1px rgba(255, 255, 255, .05) color: var(--btn-color) !important + transform: translateY(-2px) scale(1.02) + + &::before + left: 100% + + &:active + box-shadow: + 0 3px 8px rgba(0, 0, 0, .15), + 0 1px 3px rgba(0, 0, 0, .1) + transition: all .15s cubic-bezier(.4, 0, .2, 1) + transform: translateY(-1px) scale(.98) +maxWidth768() zoom: .85 + &:hover + transform: translateY(-1px) scale(1.01) + + &:active + transform: translateY(0) scale(.99) + + &::before + display: none + &-title font-size: 2.57em + animation: titleSlideIn .8s cubic-bezier(.4, 0, .2, 1) +maxWidth768() font-size: 2em +@keyframes tagsFadeIn + from + opacity: 0 + transform: translateY(20px) + + to + opacity: 1 + transform: translateY(0) + +@keyframes titleSlideIn + from + opacity: 0 + transform: translateX(-30px) + + to + opacity: 1 + transform: translateX(0) + .page-title & + .tag-cloud-list text-align: left diff --git a/source/css/_tags/button.styl b/source/css/_tags/button.styl index afb1b66..2af9dc9 100644 --- a/source/css/_tags/button.styl +++ b/source/css/_tags/button.styl @@ -7,21 +7,20 @@ display: inline-block margin: 0 4px 6px padding: 0 15px - background-color: var(--btn-beautify-color, $btn-default-color) - color: $btn-color + background-color: var(--btn-beautify-color, var(--btn-default-color)) + color: var(--btn-color, $btn-color) + vertical-align: top line-height: 2 addBorderRadius() + @extend .btn-effects for $type in $color-types &.{$type} - --btn-beautify-color: lookup('$tagsP-' + $type + '-color') + --btn-beautify-color: unquote('var(--tags-' + $type + '-color)') &:hover background-color: var(--btn-hover-color) - i + span - margin-left: 6px - &:not(.block) + .btn-beautify:not(.block) margin: 0 4px 20px @@ -39,18 +38,26 @@ &.larger padding: 6px 15px - - &:hover - text-decoration: none + @extend .btn-effects-large &.outline border: 1px solid transparent - border-color: var(--btn-beautify-color, $btn-default-color) + border-color: var(--btn-beautify-color, var(--btn-default-color)) background-color: transparent - color: var(--btn-beautify-color, $btn-default-color) + color: var(--btn-beautify-color, var(--btn-default-color)) + + i, + span + transition: color .3s cubic-bezier(.4, 0, .2, 1) + + &::before + background: linear-gradient(90deg, transparent, rgba(0, 0, 0, .1), transparent) &:hover - background-color: var(--btn-beautify-color, $btn-default-color) + border-color: var(--btn-beautify-color, var(--btn-default-color)) + background-color: var(--btn-beautify-color, var(--btn-default-color)) + color: var(--btn-color) !important - &:hover - color: white !important + i, + span + color: var(--btn-color) diff --git a/source/css/_tags/hide.styl b/source/css/_tags/hide.styl index dbc9bd3..69cc57a 100644 --- a/source/css/_tags/hide.styl +++ b/source/css/_tags/hide.styl @@ -7,6 +7,7 @@ background: $tag-hide-bg color: var(--white) addBorderRadius() + @extend .btn-effects &:hover background-color: var(--btn-hover-color) diff --git a/source/css/_tags/label.styl b/source/css/_tags/label.styl index e7ca01c..0626330 100644 --- a/source/css/_tags/label.styl +++ b/source/css/_tags/label.styl @@ -1,11 +1,11 @@ .hl-label padding: 2px 4px - color: $btn-color + color: var(--btn-color, $btn-color) addBorderRadius(3) &.default - background-color: $btn-default-color + background-color: var(--btn-default-color) for $type in $color-types &.{$type} - background-color: lookup('$tagsP-' + $type + '-color') + background-color: unquote('var(--tags-' + $type + '-color)') diff --git a/source/css/_tags/note.styl b/source/css/_tags/note.styl index 4cc6f2b..14adbb3 100644 --- a/source/css/_tags/note.styl +++ b/source/css/_tags/note.styl @@ -19,32 +19,32 @@ for $type in $color-types &.{$type} &:not(.disabled) - border-left-color: lookup('$tagsP-' + $type + '-color') !important + border-left-color: unquote('var(--tags-' + $type + '-color)') !important &.modern border-left-color: transparent !important - color: lookup('$tagsP-' + $type + '-color') + color: unquote('var(--tags-' + $type + '-color)') &:not(.simple) - background: lighten(lookup('$tagsP-' + $type + '-color'), 85%) !important + background: unquote('var(--tags-' + $type + '-color-lighten)') & > .note-icon - color: lookup('$tagsP-' + $type + '-color') + color: unquote('var(--tags-' + $type + '-color)') &.simple - border: 1px solid #EEEEEE + border: 1px solid var(--note-default-border) border-left-width: 5px &.modern border: 1px solid transparent !important - background-color: #f5f5f5 - color: $font-black + background-color: var(--note-modern-default-bg) + color: var(--note-modern-default-text) &.flat border: initial - border-left: 5px solid #EEEEEE - background-color: lighten(#EEEEEE, 65%) - color: $font-black + border-left: 5px solid var(--note-default-border) + background-color: var(--note-default-bg) + color: var(--note-default-text) h2, h3, @@ -90,29 +90,30 @@ for $type in $note-types &.{$type} &.flat - background: lookup('$note-' + $type + '-bg') + background: unquote('var(--note-' + $type + '-bg)') + color: var(--font-color) &.modern - border-color: lookup('$note-modern-' + $type + '-border') - background: lookup('$note-modern-' + $type + '-bg') - color: lookup('$note-modern-' + $type + '-text') + border-color: unquote('var(--note-modern-' + $type + '-border)') !important + background: unquote('var(--note-modern-' + $type + '-bg)') + color: unquote('var(--note-modern-' + $type + '-text)') a &:not(.btn) - color: lookup('$note-modern-' + $type + '-text') + color: unquote('var(--note-modern-' + $type + '-text)') &:hover - color: lookup('$note-modern-' + $type + '-hover') + color: unquote('var(--note-modern-' + $type + '-hover)') &:not(.modern) - border-left-color: lookup('$note-' + $type + '-border') + border-left-color: unquote('var(--note-' + $type + '-border)') h2, h3, h4, h5, h6 - color: lookup('$note-' + $type + '-text') + color: unquote('var(--note-' + $type + '-text)') if $note-icons &:not(.no-icon) @@ -121,4 +122,4 @@ &:not(.modern) &::before - color: lookup('$note-' + $type + '-text') + color: unquote('var(--note-' + $type + '-text)') diff --git a/source/css/var.styl b/source/css/var.styl index fd6ead8..bd1fb81 100644 --- a/source/css/var.styl +++ b/source/css/var.styl @@ -13,11 +13,9 @@ $code-foreground = $themeColorEnable && hexo-config('theme_color.code_foreground $code-background = $themeColorEnable && hexo-config('theme_color.code_background') ? convert(hexo-config('theme_color.code_background')) : rgba(27, 31, 35, .05) $theme-toc-color = $themeColorEnable && hexo-config('theme_color.toc_color') ? convert(hexo-config('theme_color.toc_color')) : $strong-cyan // font - $chineseFont = $language == 'zh-CN' ? 'Microsoft YaHei' : 'Microsoft JhengHei' $default-font-family = -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Lato, Roboto, 'PingFang SC', $chineseFont, sans-serif $default-code-font = consolas, Menlo, monospace, 'PingFang SC', $chineseFont, sans-serif - $font-family = hexo-config('font.font_family') ? unquote(hexo-config('font.font_family')) : $default-font-family $code-font-family = hexo-config('font.code_font_family') ? unquote(hexo-config('font.code_font_family')) : $default-code-font $site-name-font = hexo-config('blog_title_font.font_family') && unquote(hexo-config('blog_title_font.font_family')) @@ -184,3 +182,52 @@ $tab-to-top-color = #99a9bf $tab-to-top-hover-color = $theme-color // Tag Plugins - timeline $timeline-default-color = $theme-color +// note - darkmode +// Default +$note-dark-default-border = #5a5a5a +$note-dark-default-bg = #2b2b2b +$note-dark-default-text = #b3b3b3 +$note-dark-modern-default-border = #9a9a9a +$note-dark-modern-default-bg = #353535 +$note-dark-modern-default-text = #c4c4c4 +$note-dark-modern-default-hover = #d0d0d0 +// Primary +$note-dark-primary-border = #5935a1 +$note-dark-primary-bg = #2e1c3e +$note-dark-primary-text = #a47dd4 +$note-dark-modern-primary-border = #9985cc +$note-dark-modern-primary-bg = #3c2d4c +$note-dark-modern-primary-text = #b693e6 +$note-dark-modern-primary-hover = #c9a8f0 +// Info +$note-dark-info-border = #346fa2 +$note-dark-info-bg = #1f2e3b +$note-dark-info-text = #7bb3db +$note-dark-modern-info-border = #7ca8b5 +$note-dark-modern-info-bg = #2b3c44 +$note-dark-modern-info-text = #8fc6e0 +$note-dark-modern-info-hover = #a3d4ea +// Success +$note-dark-success-border = #4a944a +$note-dark-success-bg = #202e20 +$note-dark-success-text = #82c682 +$note-dark-modern-success-border = #8bb087 +$note-dark-modern-success-bg = #2c3d2c +$note-dark-modern-success-text = #96d196 +$note-dark-modern-success-hover = #a8dca8 +// Warning +$note-dark-warning-border = #c08a3e +$note-dark-warning-bg = #3e301f +$note-dark-warning-text = #e6ba6b +$note-dark-modern-warning-border = #b8a285 +$note-dark-modern-warning-bg = #4b3c2b +$note-dark-modern-warning-text = #d4b373 +$note-dark-modern-warning-hover = #e0c080 +// Danger +$note-dark-danger-border = #b34440 +$note-dark-danger-bg = #3b201f +$note-dark-danger-text = #e67572 +$note-dark-modern-danger-border = #c7898c +$note-dark-modern-danger-bg = #4d2b2e +$note-dark-modern-danger-text = #d98b8e +$note-dark-modern-danger-hover = #e59fa2 \ No newline at end of file diff --git a/source/js/utils.js b/source/js/utils.js index 93dcfe4..0ba1c38 100644 --- a/source/js/utils.js +++ b/source/js/utils.js @@ -249,7 +249,7 @@ 'rotateCW', 'flipX', 'flipY', - "reset" + 'reset' ], right: ['autoplay', 'thumbs', 'close'] }