├── .eslintignore ├── .eslintrc ├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE.md └── workflows │ └── main.yml ├── .gitignore ├── .npmignore ├── .travis.demo.yml ├── .vscode ├── launch.json └── settings.json ├── CHANGELOG.md ├── FAQ.md ├── LICENSE ├── README.md ├── _config.yml ├── languages ├── default.yml ├── en.yml └── zh-Hans.yml ├── layout ├── 404.pug ├── archive.pug ├── category.pug ├── gallery.pug ├── includes │ ├── 404 │ │ ├── 404-nav.pug │ │ └── layout.pug │ ├── additional-js.pug │ ├── comments │ │ ├── disqus.pug │ │ ├── gitalk.pug │ │ ├── gitment.pug │ │ ├── index.pug │ │ ├── laibili.pug │ │ ├── valine.pug │ │ ├── vssue.pug │ │ └── waline.pug │ ├── config.pug │ ├── count │ │ └── busuanzi.pug │ ├── footer.pug │ ├── gallery │ │ ├── layout.pug │ │ └── script.pug │ ├── head.pug │ ├── header.pug │ ├── layout.pug │ ├── mixins │ │ ├── article-sort.pug │ │ └── slide.pug │ ├── nav.pug │ ├── pagination.pug │ ├── recent-posts.pug │ ├── search │ │ ├── algolia.pug │ │ ├── index.pug │ │ └── local-search.pug │ ├── share │ │ ├── add-this.pug │ │ ├── index.pug │ │ └── share-js.pug │ ├── sidebar.pug │ ├── slide │ │ ├── layout.pug │ │ └── script.pug │ └── third-party │ │ ├── canvas-ribbon.pug │ │ ├── katex.pug │ │ └── mathjax.pug ├── index.pug ├── page.pug ├── post.pug ├── slides.pug └── tag.pug ├── package.json ├── scripts ├── gallery-tag.js ├── hexo-plugins.txt └── replace-config.js ├── source ├── css │ ├── 404.styl │ ├── _global │ │ └── index.styl │ ├── _highlight │ │ ├── diff.styl │ │ ├── highlight.styl │ │ └── theme.styl │ ├── _layout │ │ ├── comments.styl │ │ ├── footer.styl │ │ ├── head.styl │ │ ├── page.styl │ │ ├── pagination.styl │ │ ├── post.styl │ │ └── sidebar.styl │ ├── _search │ │ ├── algolia.styl │ │ ├── index.styl │ │ └── local-search.styl │ ├── _third-party │ │ ├── jquery.fancybox.min.css │ │ └── normalize.min.css │ ├── index.styl │ └── var.styl ├── img │ ├── algolia.svg │ └── avatar.png ├── js │ ├── copy.js │ ├── fancybox.js │ ├── fireworks.js │ ├── head.js │ ├── hexo-theme-melody.js │ ├── katex.js │ ├── scroll.js │ ├── search │ │ ├── algolia.js │ │ └── local-search.js │ ├── sidebar.js │ ├── third-party │ │ ├── anime.min.js │ │ ├── canvas-ribbon.js │ │ ├── jquery.fancybox.min.js │ │ ├── jquery.min.js │ │ ├── reveal │ │ │ └── head.min.js │ │ ├── velocity.min.js │ │ └── velocity.ui.min.js │ ├── transition.js │ └── utils.js └── melody-favicon.ico └── stylus_format.json /.eslintignore: -------------------------------------------------------------------------------- 1 | source/js/third-party/* 2 | source/js/utils.js 3 | scripts/* -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "standard", 3 | "env": { 4 | "jquery": true 5 | }, 6 | "globals": { 7 | "anime": false, 8 | "debounce": false, 9 | "throttle": false, 10 | "isMobile": false, 11 | "instantsearch": false, 12 | "GLOBAL_CONFIG": false 13 | } 14 | } -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | custom: ["https://paypal.me/Molunerfinn"] -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 9 | 10 | ## I want to create a new issue 11 | 12 | 13 | 14 | - [] Yes, I have read [FAQ](https://github.com/Molunerfinn/hexo-theme-melody/blob/dev/FAQ.md). 15 | - [] Yes, I have read [Hexo Docs page](https://hexo.io/docs/), especially [Templates](https://hexo.io/docs/templates.html), [Variables](https://hexo.io/docs/variables.html), [Helpers](https://hexo.io/docs/helpers.html) and [Troubleshooting](https://hexo.io/docs/troubleshooting.html). 16 | - [] Yes, I have read [Hexo-theme-melody Documentation](https://molunerfinn.com/hexo-theme-melody-doc/). 17 | - [] And yes, I already searched for current [issues](https://github.com/Molunerfinn/hexo-theme-melody/issues?utf8=%E2%9C%93&q=is%3Aissue) and this did not help me. 18 | 19 | ## Melody Information 20 | 21 | 22 | **Melody Version:** 23 | 24 | 25 | **Platform:** 26 | 27 | 28 | **Browser:** 29 | 30 | ## Expected behavior 31 | 32 | ## Actual behavior 33 | 34 | 35 | 36 | 37 | ## Steps to reproduce the behavior 38 | 39 | ## Feature Request 40 | 41 | 42 | 43 | 44 | --- 45 | 46 | 50 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: publish 2 | on: 3 | push: 4 | branches: 5 | - master 6 | jobs: 7 | build: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - uses: actions/checkout@v1 11 | - uses: actions/setup-node@v1 12 | with: 13 | node-version: '12.x' 14 | registry-url: 'https://registry.npmjs.org' 15 | - run: npm publish 16 | env: 17 | NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | yarn.lock 3 | .DS_Store 4 | _config.demo.yml 5 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | yarn-error.log 3 | package-lock.json 4 | .vscode/ 5 | .travis.yml 6 | .github/ 7 | yarn.lock 8 | .eslintignore 9 | .eslintrc 10 | stylus_format.json -------------------------------------------------------------------------------- /.travis.demo.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: stable 3 | 4 | # Travis-CI Caching 5 | cache: 6 | directories: 7 | - node_modules 8 | 9 | # S: Build Lifecycle 10 | install: 11 | - npm install 12 | 13 | before_script: 14 | # - npm install -g gulp 15 | 16 | 17 | script: 18 | - hexo clean && hexo g 19 | 20 | 21 | after_script: 22 | - cd ./public 23 | - git init 24 | - git config user.name "Your GitHub User Name" 25 | - git config user.email "Your GitHub Email" 26 | - git add . 27 | - git commit -m "Update docs" 28 | - git push --force --quiet "https://${GH_TOKEN}@${GH_REF}" master:master 29 | # E: Build LifeCycle 30 | 31 | branches: 32 | only: 33 | - master 34 | # - hexo 35 | env: 36 | global: 37 | - GH_REF: github.com/USERNAME/USERNAME.github.io.git 38 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible Node.js debug attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "node", 9 | "request": "launch", 10 | "name": "Launch Program", 11 | "program": "${file}" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "eslint.enable": true, 3 | // "editor.formatOnSave": true, 4 | "[markdown]": { 5 | "editor.formatOnSave": false 6 | }, 7 | "stylusSupremacy.insertSemicolons": false, 8 | "stylusSupremacy.insertBraces": false, 9 | "stylusSupremacy.insertNewLineBetweenSelectors": true, 10 | "stylusSupremacy.insertParenthesisAroundIfCondition": false, 11 | "stylusSupremacy.alwaysUseNoneOverZero": true, 12 | "stylusSupremacy.alwaysUseZeroWithoutUnit": true, 13 | "stylusSupremacy.sortProperties": "grouped", 14 | "eslint.autoFixOnSave": true, 15 | "stylusSupremacy.quoteChar": "\"", 16 | "editor.codeActionsOnSave": { 17 | "source.fixAll.eslint": true 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## :tada: 1.9.1 (2022-07-11) 2 | 3 | 4 | ### :sparkles: Features 5 | 6 | * add waline support ([#331](https://github.com/Molunerfinn/hexo-theme-melody/issues/331)) ([d51ac1e](https://github.com/Molunerfinn/hexo-theme-melody/commit/d51ac1e)) 7 | 8 | 9 | ### :bug: Bug Fixes 10 | 11 | * **style:** fix recent post item content overflow ([b3e7f34](https://github.com/Molunerfinn/hexo-theme-melody/commit/b3e7f34)) 12 | * fireworks effect for animejs 3 ([#321](https://github.com/Molunerfinn/hexo-theme-melody/issues/321)) ([49cd43e](https://github.com/Molunerfinn/hexo-theme-melody/commit/49cd43e)) 13 | * post page search ([#328](https://github.com/Molunerfinn/hexo-theme-melody/issues/328)) ([9c30e08](https://github.com/Molunerfinn/hexo-theme-melody/commit/9c30e08)) 14 | * support toc auto heightlight for hexo v6 ([#339](https://github.com/Molunerfinn/hexo-theme-melody/issues/339)) ([98455c6](https://github.com/Molunerfinn/hexo-theme-melody/commit/98455c6)) 15 | * tab error ([b7eca92](https://github.com/Molunerfinn/hexo-theme-melody/commit/b7eca92)) 16 | * **slide:** Remove unused dependencies ([#306](https://github.com/Molunerfinn/hexo-theme-melody/issues/306)) ([a3b33f1](https://github.com/Molunerfinn/hexo-theme-melody/commit/a3b33f1)) 17 | 18 | 19 | 20 | # :tada: 1.9.0 (2020-10-21) 21 | 22 | 23 | ### :sparkles: Features 24 | 25 | * add some options in slides configuration ([9a3bd2e](https://github.com/Molunerfinn/hexo-theme-melody/commit/9a3bd2e)) 26 | * **comment:** add vssue comment system ([#302](https://github.com/Molunerfinn/hexo-theme-melody/issues/302)) ([e49a2b2](https://github.com/Molunerfinn/hexo-theme-melody/commit/e49a2b2)) 27 | 28 | 29 | ### :bug: Bug Fixes 30 | 31 | * decodeURL -> decodeURI ([6929e58](https://github.com/Molunerfinn/hexo-theme-melody/commit/6929e58)) 32 | * image witdh can't fit the content ([cbb36bf](https://github.com/Molunerfinn/hexo-theme-melody/commit/cbb36bf)), closes [#285](https://github.com/Molunerfinn/hexo-theme-melody/issues/285) 33 | * unexpected navbar menu ([b9627a7](https://github.com/Molunerfinn/hexo-theme-melody/commit/b9627a7)), closes [#291](https://github.com/Molunerfinn/hexo-theme-melody/issues/291) 34 | * URL display problem in some environments ([#284](https://github.com/Molunerfinn/hexo-theme-melody/issues/284)) ([355b021](https://github.com/Molunerfinn/hexo-theme-melody/commit/355b021)) 35 | 36 | 37 | 38 | ## :tada: 1.8.2 (2020-08-09) 39 | 40 | 41 | ### :bug: Bug Fixes 42 | 43 | * decodeURL -> decodeURI ([6929e58](https://github.com/Molunerfinn/hexo-theme-melody/commit/6929e58)) 44 | 45 | 46 | 47 | ## :tada: 1.8.1 (2020-08-09) 48 | 49 | 50 | ### :bug: Bug Fixes 51 | 52 | * toc-item's href will be encoded in hexo v5 ([bed1f19](https://github.com/Molunerfinn/hexo-theme-melody/commit/bed1f19)), closes [#286](https://github.com/Molunerfinn/hexo-theme-melody/issues/286) 53 | 54 | 55 | 56 | # :tada: 1.8.0 (2020-08-09) 57 | 58 | 59 | ### :sparkles: Features 60 | 61 | * add hexo 5.0 support ([68e605c](https://github.com/Molunerfinn/hexo-theme-melody/commit/68e605c)) 62 | 63 | 64 | ### :bug: Bug Fixes 65 | 66 | * [#277](https://github.com/Molunerfinn/hexo-theme-melody/issues/277) and add new feature ([#278](https://github.com/Molunerfinn/hexo-theme-melody/issues/278)) ([b801ea6](https://github.com/Molunerfinn/hexo-theme-melody/commit/b801ea6)) 67 | * img style can effect custom image on footer ([#264](https://github.com/Molunerfinn/hexo-theme-melody/issues/264)) ([e7b2a04](https://github.com/Molunerfinn/hexo-theme-melody/commit/e7b2a04)) 68 | 69 | 70 | ### :pencil: Documentation 71 | 72 | * replace demo site ([b355099](https://github.com/Molunerfinn/hexo-theme-melody/commit/b355099)) 73 | * update demo sites ([1296062](https://github.com/Molunerfinn/hexo-theme-melody/commit/1296062)) 74 | 75 | 76 | ### :package: Chore 77 | 78 | * add funding url ([165f338](https://github.com/Molunerfinn/hexo-theme-melody/commit/165f338)) 79 | 80 | 81 | 82 | # :tada: 1.7.0 (2020-01-29) 83 | 84 | 85 | ### :sparkles: Features 86 | 87 | * **keywords:** add page keywords meta option ([21c34fd](https://github.com/Molunerfinn/hexo-theme-melody/commit/21c34fd)), closes [#213](https://github.com/Molunerfinn/hexo-theme-melody/issues/213) 88 | * add 404 page ([db718fd](https://github.com/Molunerfinn/hexo-theme-melody/commit/db718fd)), closes [#110](https://github.com/Molunerfinn/hexo-theme-melody/issues/110) 89 | * add canvas ribbon ([#190](https://github.com/Molunerfinn/hexo-theme-melody/issues/190)) ([7f281df](https://github.com/Molunerfinn/hexo-theme-melody/commit/7f281df)) 90 | * add hitokoto ([#252](https://github.com/Molunerfinn/hexo-theme-melody/issues/252)) ([f508191](https://github.com/Molunerfinn/hexo-theme-melody/commit/f508191)) 91 | * add sidebar_display option for controlling the sidebar display ([18f22c7](https://github.com/Molunerfinn/hexo-theme-melody/commit/18f22c7)), closes [#203](https://github.com/Molunerfinn/hexo-theme-melody/issues/203) 92 | * add top_img for page's post_meta option in other pages ([92623bf](https://github.com/Molunerfinn/hexo-theme-melody/commit/92623bf)), closes [#215](https://github.com/Molunerfinn/hexo-theme-melody/issues/215) 93 | * add top_img_height for control the height of top_img ([e8fbd91](https://github.com/Molunerfinn/hexo-theme-melody/commit/e8fbd91)) 94 | * custom header & footer text color ([#192](https://github.com/Molunerfinn/hexo-theme-melody/issues/192)) ([ecd9bac](https://github.com/Molunerfinn/hexo-theme-melody/commit/ecd9bac)) 95 | * post_meta.date_type add `both` option ([01dad37](https://github.com/Molunerfinn/hexo-theme-melody/commit/01dad37)) 96 | 97 | 98 | ### :bug: Bug Fixes 99 | 100 | * add no-fancybox className to avoid the effect with fancybox.js ([e620a07](https://github.com/Molunerfinn/hexo-theme-melody/commit/e620a07)), closes [#211](https://github.com/Molunerfinn/hexo-theme-melody/issues/211) 101 | * border width ([ace4852](https://github.com/Molunerfinn/hexo-theme-melody/commit/ace4852)), closes [#226](https://github.com/Molunerfinn/hexo-theme-melody/issues/226) 102 | * codeblock language style ([f286fc8](https://github.com/Molunerfinn/hexo-theme-melody/commit/f286fc8)), closes [#229](https://github.com/Molunerfinn/hexo-theme-melody/issues/229) 103 | * nav in 404 page -> 404-nav ([c326a6b](https://github.com/Molunerfinn/hexo-theme-melody/commit/c326a6b)) 104 | * paginator bug ([197c530](https://github.com/Molunerfinn/hexo-theme-melody/commit/197c530)), closes [#234](https://github.com/Molunerfinn/hexo-theme-melody/issues/234) 105 | * read percentage may < 0 in Safari ([0525ef7](https://github.com/Molunerfinn/hexo-theme-melody/commit/0525ef7)), closes [#258](https://github.com/Molunerfinn/hexo-theme-melody/issues/258) 106 | * serveral bugs ([30bfb34](https://github.com/Molunerfinn/hexo-theme-melody/commit/30bfb34)), closes [#188](https://github.com/Molunerfinn/hexo-theme-melody/issues/188) 107 | * slides hljs highlighting bug ([9d8ab38](https://github.com/Molunerfinn/hexo-theme-melody/commit/9d8ab38)), closes [#218](https://github.com/Molunerfinn/hexo-theme-melody/issues/218) 108 | * word error in _config.yml ([5889c35](https://github.com/Molunerfinn/hexo-theme-melody/commit/5889c35)) 109 | 110 | 111 | ### :pencil: Documentation 112 | 113 | * update demo sites ([105531b](https://github.com/Molunerfinn/hexo-theme-melody/commit/105531b)) 114 | * update demo-sites ([242d4b2](https://github.com/Molunerfinn/hexo-theme-melody/commit/242d4b2)) 115 | 116 | 117 | ### :package: Chore 118 | 119 | * add picgo bump-version ([e437892](https://github.com/Molunerfinn/hexo-theme-melody/commit/e437892)) 120 | * remove invalid links ([#227](https://github.com/Molunerfinn/hexo-theme-melody/issues/227)) ([ca32cc2](https://github.com/Molunerfinn/hexo-theme-melody/commit/ca32cc2)) 121 | * update demo sites ([b960e7e](https://github.com/Molunerfinn/hexo-theme-melody/commit/b960e7e)) 122 | * update demo sites ([#230](https://github.com/Molunerfinn/hexo-theme-melody/issues/230)) ([c347072](https://github.com/Molunerfinn/hexo-theme-melody/commit/c347072)) 123 | 124 | 125 | 126 | -------------------------------------------------------------------------------- /FAQ.md: -------------------------------------------------------------------------------- 1 | 本文收录大家在使用`hexo-theme-melody`中遇到的常见问题。其中很大一部分是没有阅读[文档](https://molunerfinn.com/hexo-theme-melody-doc/#/zh-Hans/)导致的。请养成先看文档再提问的习惯! 2 | 3 | ## 常见问题 4 | 5 | ### 1. `wordcount`相关。能看到的报错如:`wordcount is not a function`。 6 | 7 | ![](https://user-images.githubusercontent.com/12621342/39472068-845afe58-4d79-11e8-922c-6e2aab177f1f.png) 8 | 9 | ### 2. `keywords`相关。能看到的报错如:`(config.keywords || []).join is not a function` 10 | 11 | 参考[issue](https://github.com/Molunerfinn/hexo-theme-melody/issues/58)。 12 | 13 | 找到你hexo站点的`_config.yml`(不是主题的`_config.yml`!)然后修改你的`keywords`项,改成空或者数组形式: 14 | 15 | ```yaml 16 | keywords: 17 | - item1 18 | - item2 19 | ``` 20 | 21 | ### 3. `renderer`相关。能看到的报错如:`ERROR Process failed: layout/includes/slide/script.pug` 22 | 23 | 参考[issue](https://github.com/Molunerfinn/hexo-theme-melody/issues/67)。 24 | 25 | ![](https://user-images.githubusercontent.com/12621342/38991683-18ccf3a6-4411-11e8-8d8c-dc0ea8e5060a.png) 26 | 27 | ### 4. `localSeach`相关。能看到的报错如:`Cannot read property 'path' of undefined` 28 | 29 | 参考[issue](https://github.com/Molunerfinn/hexo-theme-melody/issues/54)。 30 | 31 | ![](https://user-images.githubusercontent.com/12621342/38242062-63ce5438-3766-11e8-9375-256d87d0adfc.png) 32 | 33 | ### 5. `renderer`相关。能看到的报错如:`Syntax Error: Unexpected charactor` 34 | 35 | 参考[issue](https://github.com/Molunerfinn/hexo-theme-melody/issues/5)。 36 | 37 | 注意你站点里的`package.json`里有没有同时存在`hexo-renderer-pug`和`hexo-renderer-jade`。请删掉`hexo-renderer-pug`。然后重新`npm install`。之后执行`hexo clean` 和 `hexo g` 即可。 38 | 39 | ------ 40 | 41 | If you have meet some problems using `hexo-theme-melody`, it's recommended to read [documentation](https://molunerfinn.com/hexo-theme-melody-doc/#/), most of your problems will be solved. 42 | 43 | ## FAQ 44 | 45 | ### 1. Problem with `wordcount`. Such as `wordcount is not a function`. 46 | 47 | ![](https://raw.githubusercontent.com/Molunerfinn/test/master/picgo/word_count_problem.png) 48 | 49 | ### 2. Problem with `keywords`. Such as `(config.keywords || []).join is not a function` 50 | 51 | Check this [issue](https://github.com/Molunerfinn/hexo-theme-melody/issues/58). 52 | 53 | Find your hexo site `_config.yml` (not the `_config.yml` in theme folder!), then modified your `keywords` option to an array or empty. 54 | 55 | ```yaml 56 | keywords: 57 | - item1 58 | - item2 59 | ``` 60 | 61 | ### 3. Problem with `renderer`. Such as `ERROR Process failed: layout/includes/slide/script.pug` 62 | 63 | Check this [issue](https://github.com/Molunerfinn/hexo-theme-melody/issues/67). 64 | 65 | ![](https://user-images.githubusercontent.com/12621342/38991683-18ccf3a6-4411-11e8-8d8c-dc0ea8e5060a.png) 66 | 67 | ### 4. Problem with `localSeach`. Such as `Cannot read property 'path' of undefined` 68 | 69 | Check this [issue](https://github.com/Molunerfinn/hexo-theme-melody/issues/54). 70 | 71 | ![](https://raw.githubusercontent.com/Molunerfinn/test/master/picgo/local_search_problem.png) 72 | 73 | ### 5. Problem with `renderer`. Such as `Syntax Error: Unexpected charactor` 74 | 75 | Check this [issue](https://github.com/Molunerfinn/hexo-theme-melody/issues/5). 76 | 77 | Notice that if both `hexo-renderer-pug` & `hexo-renderer-jade` are existing in your hexo site's `package.json`. Please remove `hexo-renderer-pug` and then `npm install`, `hexo clean` and `hexo g`. 78 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The 996ICU License (996ICU) 2 | Version 0.1, March 2019 3 | 4 | PACKAGE is distributed under LICENSE with the following restriction: 5 | 6 | The above license is only granted to entities that act in concordance 7 | with local labor laws. In addition, the following requirements must be 8 | observed: 9 | 10 | * The licencee must not, explicitly or implicitly, request or schedule 11 | their employees to work more than 45 hours in any single week. 12 | * The licencee must not, explicitly or implicitly, request or schedule 13 | their employees to be at work consecutively for 10 hours. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # hexo-theme-melody 2 | 3 |

4 | 5 |

6 | 7 |

8 | JavaScript Style Guide 9 | license 10 | hexo-image 11 | 12 | 13 | 14 | 15 | 16 | 17 |

18 | 19 | A simple & beautiful & fast theme for Hexo. 20 | 21 | See demo: 22 | 23 | - [molunerfinn.com](https://molunerfinn.com) 24 | - [Elody's Blog](https://elody-07.github.io) 25 | - [zouyaoji's Blog](https://zouyaoji.top/) 26 | - [flytreeleft's Blog](https://flytreeleft.org/) 27 | - [霪霖笙箫的博客](https://fridolph.github.io/) 28 | - [upupming 的博客](https://upupming.site/) 29 | - [HibisciDai's blog](https://hibiscidai.com/) 30 | - [李牧羊](https://www.limuyang.cc/) 31 | - [DoubleFJ の Blog](http://putop.top) 32 | - [Inno’s Blog](https://innofang.github.io/) 33 | - [SpiffyEight77's Blog](https://spiffyeight77.github.io/) 34 | - [FoolのGarden](https://gofugui.github.io/) 35 | - [高可用可伸缩微服务架构](https://msainaction.github.io/) 36 | - [Oolong Box](https://www.oolongbox.com/) 37 | - [Kiyoshi's Blog](https://blog.k1yoshi.com/) 38 | - [Sheey的小窝](https://sheey.moe/) 39 | - [Ahuiyo の Blog](https://ahuiyo.cn/) 40 | - [XIAO Blog](https://blog.xiaojianzheng.cn) 41 | - [Moon's Blog](https://loumoon.github.io/) 42 | - [cuteerhas](https://lishoushoua.github.io/) 43 | - [李林林的小站](https://leilinen.github.io/) 44 | - [Sunshine](http://hudongyang.com/) 45 | - [过客别墅](https://zc-apiao.space/) 46 | - [jie wei](http://weijiew.com/) 47 | - [Mandarin的日常](https://liwenhau.github.io/) 48 | 49 | and more... 50 | 51 | If you are using `theme-melody` and want to be shown to others like above (It will be stopped when the demo sites' number up to 25), please write down your site in this [issue](https://github.com/Molunerfinn/hexo-theme-melody/issues/1)! 52 | 53 | # Documentation 54 | 55 | Documentation is [here](https://molunerfinn.com/hexo-theme-melody-doc/). Now it supports `en` and `zh-Hans`. 56 | 57 | If you meet problems using `hexo-theme-melody`, it's recommended to read [FAQ](https://github.com/Molunerfinn/hexo-theme-melody/blob/dev/FAQ.md) & [Documentation](https://molunerfinn.com/hexo-theme-melody-doc/), most of your problems will be solved! 58 | 59 | # Changelogs 60 | 61 | See [releases](https://github.com/Molunerfinn/hexo-theme-melody/releases). 62 | 63 | # Screenshots 64 | 65 | ![](https://raw.githubusercontent.com/Molunerfinn/hexo-theme-melody-doc/master/docs/imgs/index-page.png) 66 | ![](https://raw.githubusercontent.com/Molunerfinn/hexo-theme-melody-doc/master/docs/imgs/archives.png) 67 | ![](https://raw.githubusercontent.com/Molunerfinn/hexo-theme-melody-doc/master/docs/imgs/post.png) 68 | ![](https://raw.githubusercontent.com/Molunerfinn/hexo-theme-melody-doc/master/docs/imgs/post-2.png) 69 | ![](https://raw.githubusercontent.com/Molunerfinn/hexo-theme-melody-doc/master/docs/imgs/mobile.png) 70 | 71 | # Installation 72 | 73 | **Notice: The installation method before and after hexo 5.0 version is different.** 74 | 75 | ## Hexo version < 5.0 76 | 77 | Find your hexo work folder 78 | 79 | 80 | ```bash 81 | git clone -b master https://github.com/Molunerfinn/hexo-theme-melody themes/melody 82 | ``` 83 | 84 | If you don't have jade & stylus renderer, follow this: 85 | 86 | ```bash 87 | npm install hexo-renderer-pug hexo-renderer-stylus 88 | ``` 89 | 90 | In your hexo site's `_config.yml`, find the `theme` field, change it to `melody`: 91 | 92 | ```yaml 93 | theme: melody 94 | ``` 95 | 96 | ## Hexo version >= 5.0 97 | 98 | ``` 99 | npm install hexo-theme-melody 100 | ``` 101 | 102 | If you don't have jade & stylus renderer, follow this: 103 | 104 | ```bash 105 | npm install hexo-renderer-pug hexo-renderer-stylus 106 | ``` 107 | 108 | In your hexo site's `_config.yml`, find the `theme` field, change it to `melody`: 109 | 110 | 111 | # Configuration 112 | 113 | **Notice: The configuration file before and after hexo 5.0 version is different.** 114 | 115 | ## Hexo version < 5.0 116 | 117 | For smoothly updating theme-melody, I recommend to create a config file named `melody.yml` in your hexo work folder's (**Notice: not the theme-melody folder**) `source/_data` folder(If it doesn't exist, create one) 118 | 119 | Copy the contents of `_config.yml` to `melody.yml`. Now you can configure it by yourself and you can update theme-melody smoothly. 120 | 121 | ## Hexo version >= 5.0 122 | 123 | 1. create a `_config.melody.yml` in your hexo work folder. 124 | 2. copy the contents of `./node_modules/hexo-theme-melody/_config.yml` to `_config.melody.yml` 125 | 3. If you have used `hexo-theme-melody` for a long time, and has a `melody.yml` above, please copy the contents of `melody.yml` to `_config.melody.yml` & remove `melody.yml` since it will be deprecated. 126 | 127 | Now you can configure it by yourself and you can update theme-melody smoothly. 128 | 129 | # Update 130 | 131 | **Notice: The update method before and after hexo 5.0 version is different.** 132 | 133 | ## Hexo version < 5.0 134 | 135 | Jump into the melody folder, just `git pull` is OK. 136 | 137 | ## Hexo version >= 5.0 138 | 139 | In your hexo work folder, just `npm update hexo-theme-melody` is OK. 140 | 141 | > For more details, please check [documentation](https://molunerfinn.com/hexo-theme-melody-doc/) 142 | 143 | # Browser Support 144 | 145 | IE >= 10 146 | 147 | # TODOS 148 | 149 | - ~~Doc~~ 150 | - ~~Search~~ // Algolia support 151 | - ~~Analysis~~ // Baidu & Google analytics support 152 | - ~~MathJax~~ // MathJax support 153 | - ~~i18n~~ // zh-Hans & en support 154 | - ~~PWA~~ // v1.2 support 155 | - Performance optimization 156 | - ... 157 | 158 | # License 159 | 160 | [MIT](http://opensource.org/licenses/MIT) 161 | 162 | Copyright (c) 2017 Molunerfinn 163 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | # --------------- 2 | # Theme color for customize 3 | # Notice: color value must in double quotes like "#000" or may cause error! 4 | # --------------- 5 | # theme_color: 6 | # enable: true 7 | # main: "#49B1F5" 8 | # paginator: "#00C4B6" 9 | # button_hover: "#FF7242" 10 | # text_selection: "#00C4B6" 11 | # link_color: "#858585" 12 | # hr_color: "#A4D8FA" 13 | # tag_start_color: "#A4D8FA" 14 | # tag_end_color: "#1B9EF3" 15 | # header_text_color: "#EEEEEE" 16 | # footer_text_color: "#EEEEEE" 17 | 18 | # Main menu navigation 19 | menu: 20 | # Home: / 21 | # Archives: /archives 22 | # Tags: /tags 23 | # Categories: /categories 24 | #XXX: /xxx 25 | 26 | # Favicon 27 | # --------------- 28 | favicon: /melody-favicon.ico 29 | 30 | # PWA 31 | # See https://github.com/JLHwung/hexo-offline 32 | # --------------- 33 | pwa: 34 | enable: false 35 | manifest: /manifest.json 36 | # If you don't want to trouble, just ignore the following things 37 | # See https://realfavicongenerator.net/ 38 | # theme_color: "#49B1F5" 39 | # apple_touch_icon: /apple-touch-icon.png 40 | # favicon_32_32: /favicon-32x32.png 41 | # favicon_16_16: /favicon-16x16.png 42 | # mask_icon: /safari-pinned-tab.svg 43 | 44 | # Highlight theme 45 | # --------------- 46 | highlight_theme: default 47 | 48 | # code_word_wrap: true or false 49 | 50 | # Nav settings 51 | # see the icon_name in fontawesome website. 52 | # And you need to add the `fa` or `fab` prefix by your self. 53 | # --------------- 54 | #social: 55 | #icon_name fa: url 56 | #icon_name fab: url 57 | 58 | # Algolia search 59 | # --------------- 60 | algolia_search: 61 | enable: false 62 | hits: 63 | per_page: 10 64 | 65 | # Local search 66 | # Please see doc for more details: https://molunerfinn.com/hexo-theme-melody-doc/third-party-support.html#local-search 67 | # --------------- 68 | local_search: 69 | enable: false 70 | 71 | # MathJax 72 | # Please see doc for more details: https://molunerfinn.com/hexo-theme-melody-doc/third-party-support.html#mathjax 73 | # --------------- 74 | mathjax: 75 | enable: false 76 | cdn: https://cdn.jsdelivr.net/npm/mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML 77 | 78 | # KaTeX 79 | # Please see doc for more details: https://molunerfinn.com/hexo-theme-melody-doc/third-party-support.html#katex 80 | # --------------- 81 | katex: 82 | enable: false 83 | cdn: 84 | css: https://cdn.jsdelivr.net/npm/katex@latest/dist/katex.min.css 85 | hide_scrollbar: true 86 | 87 | # Toggle fireworks (IE >= 10) 88 | # --------------- 89 | fireworks: false 90 | 91 | # Analysis 92 | # --------------- 93 | baidu_analytics: 94 | # Format: UA-xxxxxxxxx-x 95 | # Example: UA-123456789-0 96 | google_analytics: 97 | # Format: G-xxxxxxxxx 98 | # Example: G-0A12345678 99 | google_analytics_MeasurementID: 100 | 101 | # Tencent_analytics ID 102 | tencent_analytics: 103 | 104 | # stylesheets loaded in the 105 | # --------------- 106 | stylesheets: 107 | - /css/index.css 108 | # scripts loaded in the end of the body 109 | # --------------- 110 | scripts: 111 | - /js/utils.js 112 | - /js/fancybox.js 113 | - /js/sidebar.js 114 | - /js/copy.js 115 | - /js/fireworks.js 116 | - /js/transition.js 117 | - /js/scroll.js 118 | - /js/head.js 119 | 120 | # cdn for third-party library 121 | # --------------- 122 | cdn: 123 | css: 124 | fontawesome: https://cdn.jsdelivr.net/npm/font-awesome@latest/css/font-awesome.min.css 125 | # fontawesomeV5: https://use.fontawesome.com/releases/v5.3.1/css/all.css 126 | js: 127 | anime: https://cdn.jsdelivr.net/npm/animejs@latest/lib/anime.min.js 128 | jquery: https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js 129 | fancybox: https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js 130 | velocity: https://cdn.jsdelivr.net/npm/velocity-animate@latest/velocity.min.js 131 | velocity-ui: https://cdn.jsdelivr.net/npm/velocity-ui-pack@latest/velocity.ui.min.js 132 | 133 | # Post info settings 134 | # --------------- 135 | avatar: 136 | 137 | top_img: true # false or url of img 138 | 139 | top_img_height: 60 # best range: 60 - 100 140 | 141 | post_meta: 142 | date_type: created # created or updated 143 | categories: true 144 | tags: true 145 | 146 | # Please see doc for more details: https://molunerfinn.com/hexo-theme-melody-doc/additional-package-support.html#word-counting 147 | wordcount: 148 | enable: false 149 | 150 | toc: 151 | enable: true 152 | # number: true 153 | 154 | post_copyright: 155 | enable: true 156 | license: CC BY-NC-SA 4.0 157 | license_url: https://creativecommons.org/licenses/by-nc-sa/4.0/ 158 | 159 | # Please see doc for more details: https://molunerfinn.com/hexo-theme-melody-doc/theme-config.html#auto-excerpt 160 | # auto_excerpt: 161 | # enable: false 162 | # length: 150 163 | 164 | # slide 165 | # For reveal.js config, see https://github.com/hakimel/reveal.js#configuration 166 | slide: 167 | separator: --- 168 | separator_vertical: -- 169 | charset: utf-8 170 | theme: black 171 | codeTheme: monokai 172 | # optional 173 | mouseWheel: false 174 | transition: slide 175 | transitionSpeed: default 176 | parallaxBackgroundImage: "" 177 | parallaxBackgroundSize: "" 178 | parallaxBackgroundHorizontal: null 179 | parallaxBackgroundVertical: null 180 | loop: false 181 | autoSlide: false 182 | controlsBackArrows: 'faded' 183 | controlsLayout: 'bottom-right' # Determines where controls appear, "edges" or "bottom-right" 184 | progress: true 185 | showNotes: false 186 | autoPlayMedia: false 187 | backgroundTransition: 'fade' 188 | 189 | # QR_code: 190 | # - itemlist: 191 | # img: 192 | # text: 193 | 194 | # adv: 195 | # enable: false 196 | # info: 197 | 198 | # Share System 199 | # --------------- 200 | addThis: 201 | enable: false 202 | #pubid: 203 | 204 | # sharejs: 205 | # enable: false 206 | # disabled_sites: 207 | 208 | # Comments System 209 | # --------------- 210 | disqus: 211 | enable: false 212 | #shortname: 213 | #count: 214 | 215 | # laibili: 216 | # enable: false 217 | # uid: 218 | 219 | # gitment 220 | # enable: false 221 | # owner: 222 | # repo: 223 | # client_id: 224 | # client_secret: 225 | 226 | # gitalk: 227 | # enable: false 228 | # client_id: 229 | # client_secret: 230 | # repo: 231 | # owner: 232 | # admin: 233 | 234 | # valine comment system. https://valine.js.org 235 | # valine: 236 | # enable: false # if you want use valine,please set this value is true 237 | # appId: # leancloud application app id 238 | # appKey: # leancloud application app key 239 | # notify: false # valine mail notify (true/false) https://github.com/xCss/Valine/wiki 240 | # verify: false # valine verify code (true/false) 241 | # recordip: false # whether record commentor's ip (true/false) 242 | # pageSize: 10 # comment list page size 243 | # avatar: mm # gravatar style https://valine.js.org/#/avatar 244 | # lang: zh-cn # i18n: zh-cn/en 245 | # placeholder: Just go go # valine comment input placeholder(like: Please leave your footprints ) 246 | # guest_info: nick,mail,link #valine comment header inf 247 | 248 | # vssue: 249 | # enable: false # Set to true to enable 250 | # platform: github-v4 251 | # owner: 252 | # repo: 253 | # clientId: 254 | # clientSecret: # only required for some of the platforms 255 | # autoCreateIssue: false # Auto create issue on platform (github/...) 256 | # baseURL: "" # For self-hosted gitlab/bitbucket only, see here: https://vssue.js.org/options/#baseurl 257 | # perPage: 10 # How much comment/page 258 | # labels: 'Vssue' 259 | 260 | # waline comment system. https://waline.js.org/ 261 | # waline: 262 | # enable: true 263 | # serverURL: '' 264 | # lang: zh-CN 265 | # avatar: '' 266 | 267 | # Footer Settings 268 | # --------------- 269 | since: 2013 270 | 271 | # footer_custom_text: put custom text directly or put hitokoto to fetch random texts 272 | 273 | ICP: 274 | enable: false 275 | #text: 276 | 277 | # busuanzi count for PV / UV in site 278 | busuanzi: 279 | # count values only if the other configs are false 280 | enable: true 281 | # custom uv span for the whole site 282 | site_uv: true 283 | site_uv_header: 284 | site_uv_footer: 285 | # custom pv span for the whole site 286 | site_pv: true 287 | site_pv_header: 288 | site_pv_footer: 289 | # custom pv span for one page only 290 | page_pv: true 291 | page_pv_header: 292 | page_pv_footer: 293 | 294 | # canvas_ribbon 295 | # See: https://github.com/hustcc/ribbon.js 296 | canvas_ribbon: 297 | enable: false 298 | size: 150 299 | alpha: 0.6 300 | zIndex: -1 301 | click_to_change: false 302 | 303 | # Sidebar Settings 304 | # --------------- 305 | # links_title: Links 306 | # links: 307 | # Name: url 308 | 309 | # Follow Me Button 310 | # follow: 311 | # enable: true 312 | # url: '' 313 | # text: '' 314 | 315 | # controls the sidebar showing or hidden in different pages 316 | sidebar_display: post # all/index/post/index-none/post-none/hidden 317 | 318 | # Ads 319 | # --------------- 320 | # Google Adsense 321 | google_adsense: 322 | enable: false 323 | js: //pagead2.googlesyndication.com/pagead/js/adsbygoogle.js 324 | client: ca-pub-........... 325 | enable_page_level_ads: true 326 | 327 | # Google Webmaster tools verification setting 328 | # See: https://www.google.com/webmasters/ 329 | google_site_verification: 330 | 331 | # Bing Webmaster tools verification setting 332 | # See: https://www.bing.com/webmaster/ 333 | bing_site_verification: 334 | 335 | # Yandex Webmaster tools verification setting 336 | # See: https://webmaster.yandex.ru/ 337 | #yandex_site_verification: 338 | 339 | # Baidu Webmaster tools verification setting 340 | # See: https://ziyuan.baidu.com/site/ 341 | baidu_site_verification: 342 | 343 | # 360 Webmaster tools verification setting 344 | # see http://zhanzhang.so.com/ 345 | qihu_site_verification: 346 | 347 | # avoid baidu transformation 348 | disable_baidu_transformation: true 349 | 350 | # 404 Page SubTitle 351 | 404Text: 352 | -------------------------------------------------------------------------------- /languages/default.yml: -------------------------------------------------------------------------------- 1 | sidebar: 2 | articles: Articles 3 | tags: Tags 4 | categories: Categories 5 | toggle_site: Toggle site 6 | toggle_article: Toggle article 7 | catalog: Catalog 8 | have_read: You've read 9 | 10 | footer: 11 | driven: Driven 12 | theme: Theme 13 | 14 | copy: 15 | success: Copy successfully 16 | error: Copy error 17 | noSupport: The browser does not support 18 | 19 | page: 20 | articles: Articles 21 | tag: Tag 22 | category: Category 23 | archives: Archives 24 | 25 | sticky: Sticky 26 | no_title: No title 27 | read_more: Read more 28 | 29 | post: 30 | created: created 31 | updated: updated 32 | wordcount: Word count 33 | min2read: 'Reading time: %s min' 34 | copyright: 35 | author: Author 36 | link: Link 37 | copyright_notice: Copyright Notice 38 | copyright_content: 'All articles in this blog are licensed under %s unless stating additionally.' 39 | 40 | 41 | search: Search 42 | algolia_search: 43 | input_placeholder: Search for Posts 44 | hits_empty: "We didn't find any results for the search: ${query}." 45 | hits_stats: "${hits} results found in ${time} ms" 46 | 47 | local_search: 48 | label: Local search 49 | input_placeholder: Search for Posts 50 | hits_empty: "We didn't find any results for the search: ${query}" 51 | powered_by: Powered by 52 | -------------------------------------------------------------------------------- /languages/en.yml: -------------------------------------------------------------------------------- 1 | sidebar: 2 | articles: Articles 3 | tags: Tags 4 | categories: Categories 5 | toggle_site: Toggle site 6 | toggle_article: Toggle article 7 | catalog: Catalog 8 | have_read: You've read 9 | 10 | footer: 11 | driven: Driven 12 | theme: Theme 13 | 14 | copy: 15 | success: Copy successfully 16 | error: Copy error 17 | noSupport: The browser does not support 18 | 19 | page: 20 | articles: Articles 21 | tag: Tag 22 | category: Category 23 | archives: Archives 24 | 25 | sticky: Sticky 26 | no_title: No title 27 | read_more: Read more 28 | 29 | post: 30 | created: created 31 | updated: updated 32 | wordcount: Word count 33 | min2read: 'Reading time: %s min' 34 | copyright: 35 | author: Author 36 | link: Link 37 | copyright_notice: Copyright Notice 38 | copyright_content: 'All articles in this blog are licensed under %s unless stating additionally.' 39 | 40 | 41 | search: Search 42 | algolia_search: 43 | input_placeholder: Search for Posts 44 | hits_empty: "We didn't find any results for the search: ${query}." 45 | hits_stats: "${hits} results found in ${time} ms" 46 | 47 | local_search: 48 | label: Local search 49 | input_placeholder: Search for Posts 50 | hits_empty: "We didn't find any results for the search: ${query}" 51 | powered_by: Powered by 52 | -------------------------------------------------------------------------------- /languages/zh-Hans.yml: -------------------------------------------------------------------------------- 1 | sidebar: 2 | articles: 文章 3 | tags: 标签 4 | categories: 分类 5 | toggle_site: 切换站点概览 6 | toggle_article: 切换文章详情 7 | catalog: 目录 8 | have_read: 你已经读了 9 | 10 | footer: 11 | driven: 驱动 12 | theme: 主题 13 | 14 | copy: 15 | success: 复制成功 16 | error: 复制错误 17 | noSupport: 浏览器不支持 18 | 19 | page: 20 | articles: 文章总览 21 | tag: 标签 22 | category: 分类 23 | archives: 归档 24 | 25 | sticky: 置顶 26 | no_title: 无题 27 | read_more: 阅读更多 28 | 29 | post: 30 | created: 发表于 31 | updated: 更新于 32 | wordcount: 字数总计 33 | min2read: '阅读时长: %s 分钟' 34 | copyright: 35 | author: 文章作者 36 | link: 文章链接 37 | copyright_notice: 版权声明 38 | copyright_content: '本博客所有文章除特别声明外,均采用 %s 许可协议。转载请注明来自 %s!' 39 | 40 | search: 搜索 41 | algolia_search: 42 | input_placeholder: 搜索文章 43 | hits_empty: "找不到您查询的内容:${query}" 44 | hits_stats: "找到 ${hits} 条结果,用时 ${time} 毫秒" 45 | 46 | local_search: 47 | label: 本地搜索 48 | input_placeholder: 搜索文章 49 | hits_empty: "找不到您查询的内容:${query}" 50 | powered: "提供支持" 51 | by: 由 52 | -------------------------------------------------------------------------------- /layout/404.pug: -------------------------------------------------------------------------------- 1 | extends includes/404/layout.pug -------------------------------------------------------------------------------- /layout/archive.pug: -------------------------------------------------------------------------------- 1 | 2 | extends includes/layout.pug 3 | 4 | block content 5 | include ./includes/mixins/article-sort.pug 6 | #archive 7 | .article-sort-title= _p('page.articles') + ' - ' + site.posts.length 8 | +articleSort(page.posts) 9 | include includes/pagination.pug 10 | -------------------------------------------------------------------------------- /layout/category.pug: -------------------------------------------------------------------------------- 1 | extends includes/layout.pug 2 | 3 | block content 4 | include ./includes/mixins/article-sort.pug 5 | #category 6 | .article-sort-title= _p('page.category') + ' - ' + page.category 7 | +articleSort(page.posts) 8 | include includes/pagination.pug 9 | -------------------------------------------------------------------------------- /layout/gallery.pug: -------------------------------------------------------------------------------- 1 | extends includes/layout.pug 2 | 3 | block content 4 | include includes/gallery/layout.pug -------------------------------------------------------------------------------- /layout/includes/404/404-nav.pug: -------------------------------------------------------------------------------- 1 | - var top_img = page.top_img || theme.post_meta.top_img || theme.top_img || config.top_img || true 2 | - var bg_img = top_img && top_img !== true ? `background-image: url(${top_img})` : '' 3 | - var flag = top_img === true ? 'no-bg' : '' 4 | nav#nav(style=bg_img class=flag) 5 | include ../header.pug 6 | #site-info 7 | #site-title= config.title 8 | #site-sub-title= theme['404Text'] || '404 Page Not Found' 9 | if(theme.social) 10 | #site-social-icons 11 | each url, icon in theme.social 12 | a.social-icon(href=url target="_blank" rel="noreferrer noopener nofollow") 13 | i(class="fa-" + icon) 14 | -------------------------------------------------------------------------------- /layout/includes/404/layout.pug: -------------------------------------------------------------------------------- 1 | - pageTitle = `Page not found | ${config.title}` 2 | 3 | - var pageDescription = page.description || page.title || config.description || '' 4 | - var pageKeywords = (config.keywords || []).join(',') 5 | - if (page.tags && page.tags.data) pageKeywords = page.tags.data.map(function(tag) {return tag.name;}).join(',') 6 | - if (page.keywords) pageKeywords = page.keywords.join(',') 7 | - var pageAuthor = config.email ? config.author + ',' + config.email : config.author 8 | - var pageCopyright = config.copyright || config.author 9 | 10 | doctype html 11 | html(lang=config.language) 12 | head 13 | meta(charset='UTF-8') 14 | meta(http-equiv="X-UA-Compatible" content="IE=edge") 15 | meta(name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1") 16 | meta(name="description" content=pageDescription) 17 | meta(name="keywords" content=pageKeywords) 18 | meta(name="author" content=pageAuthor) 19 | meta(name="copyright" content=pageCopyright) 20 | title= pageTitle 21 | !=favicon_tag(config.favicon || theme.favicon || '/melody-favicon.ico') 22 | if theme.stylesheets !== undefined && theme.stylesheets.length > 0 23 | each url in theme.stylesheets 24 | link(rel='stylesheet', href=url_for(url) + '?version=' + version()) 25 | each item in theme.cdn.css 26 | if item !== undefined 27 | link(rel='stylesheet', href=item + '?version=' + version()) 28 | link(rel='stylesheet', href=url_for('/css/404.css') + '?version=' + version()) 29 | include ../head.pug 30 | include ../config.pug 31 | body 32 | include ./404-nav.pug 33 | each item in theme.cdn.js 34 | if item !== undefined 35 | script(src=url_for(item)) 36 | if theme.scripts !== undefined && theme.scripts.length > 0 37 | //- scripts list from config.yml 38 | each url in theme.scripts 39 | script(src=url_for(url) + '?version=' + version()) 40 | include ../additional-js.pug 41 | include ../search/index.pug 42 | -------------------------------------------------------------------------------- /layout/includes/additional-js.pug: -------------------------------------------------------------------------------- 1 | if (theme.algolia_search.enable) 2 | script(src=url_for('/js/search/algolia.js')) 3 | if (theme.mathjax && theme.mathjax.enable) 4 | if(!is_tag() && !is_category() && !is_archive()) 5 | include ./third-party/mathjax.pug 6 | if (theme.katex && theme.katex.enable) 7 | if(!is_tag() && !is_category() && !is_archive()) 8 | include ./third-party/katex.pug 9 | if (theme.local_search && theme.local_search.enable) 10 | script(src=url_for('/js/search/local-search.js')) 11 | if (theme.canvas_ribbon && theme.canvas_ribbon.enable) 12 | include ./third-party/canvas-ribbon.pug 13 | script. 14 | if(/Android|webOS|iPhone|iPod|iPad|BlackBerry/i.test(navigator.userAgent)) { 15 | $('#nav').addClass('is-mobile') 16 | $('footer').addClass('is-mobile') 17 | $('#top-container').addClass('is-mobile') 18 | } 19 | -------------------------------------------------------------------------------- /layout/includes/comments/disqus.pug: -------------------------------------------------------------------------------- 1 | if theme.disqus.enable 2 | #disqus_thread 3 | script. 4 | var unused = null; 5 | var disqus_config = function () { 6 | this.page.url = '!{ page.permalink }'; 7 | this.page.identifier = '!{ page.path }'; 8 | this.page.title = '!{ page.title }'; 9 | } 10 | var d = document, s = d.createElement('script'); 11 | s.src = "https://" + '!{theme.disqus.shortname}' +".disqus.com/embed.js"; 12 | s.setAttribute('data-timestamp', '' + +new Date()); 13 | (d.head || d.body).appendChild(s); 14 | if theme.disqus.count 15 | script#dsq-count-scr(src="https://" + theme.disqus.shortname + ".disqus.com/count.js" async) 16 | -------------------------------------------------------------------------------- /layout/includes/comments/gitalk.pug: -------------------------------------------------------------------------------- 1 | if theme.gitalk && theme.gitalk.enable 2 | - let lang = config.language === 'zh-Hans' ? 'zh-CN' : config.language 3 | #gitalk-container 4 | script. 5 | var gitalk = new Gitalk({ 6 | clientID: '!{theme.gitalk.client_id}', 7 | clientSecret: '!{theme.gitalk.client_secret}', 8 | repo: '!{theme.gitalk.repo}', 9 | owner: '!{theme.gitalk.owner}', 10 | admin: '!{theme.gitalk.admin}', 11 | id: md5(decodeURI(location.pathname)), 12 | language: '!{lang}' 13 | }) 14 | gitalk.render('gitalk-container') 15 | -------------------------------------------------------------------------------- /layout/includes/comments/gitment.pug: -------------------------------------------------------------------------------- 1 | if theme.gitment && theme.gitment.enable 2 | #gitment-container 3 | script. 4 | var gitment = new Gitment({ 5 | id: md5(decodeURI(location.pathname)), 6 | owner: '!{theme.gitment.owner}', 7 | repo: '!{theme.gitment.repo}', 8 | oauth: { 9 | client_id: '!{theme.gitment.client_id}', 10 | client_secret: '!{theme.gitment.client_secret}' 11 | } 12 | }) 13 | gitment.render('gitment-container') -------------------------------------------------------------------------------- /layout/includes/comments/index.pug: -------------------------------------------------------------------------------- 1 | if theme.disqus.enable 2 | include ./disqus.pug 3 | else if theme.laibili && theme.laibili.enable 4 | include ./laibili.pug 5 | else if theme.gitment && theme.gitment.enable 6 | include ./gitment.pug 7 | else if theme.gitalk && theme.gitalk.enable 8 | include ./gitalk.pug 9 | else if theme.valine && theme.valine.enable 10 | include ./valine.pug 11 | else if theme.vssue && theme.vssue.enable 12 | include ./vssue.pug 13 | else if theme.waline && theme.waline.enable 14 | include ./waline.pug 15 | -------------------------------------------------------------------------------- /layout/includes/comments/laibili.pug: -------------------------------------------------------------------------------- 1 | if theme.laibili && theme.laibili.enable 2 | #lv-container(data-id="city" data-uid=theme.laibili.uid) 3 | script. 4 | (function(d, s) { 5 | var j, e = d.getElementsByTagName(s)[0]; 6 | if (typeof LivereTower === 'function') { return; } 7 | j = d.createElement(s); 8 | j.src = 'https://cdn-city.livere.com/js/embed.dist.js'; 9 | j.async = true; 10 | e.parentNode.insertBefore(j, e); 11 | })(document, 'script'); 12 | -------------------------------------------------------------------------------- /layout/includes/comments/valine.pug: -------------------------------------------------------------------------------- 1 | if theme.valine && theme.valine.enable 2 | #vcomment 3 | script(src='https://cdn1.lncld.net/static/js/3.0.4/av-min.js') 4 | script(src='https://cdn.jsdelivr.net/npm/valine/dist/Valine.min.js') 5 | script. 6 | var notify = '#{ theme.valine.notify }' == 'true'; 7 | var verify = '#{ theme.valine.verify }' == 'true'; 8 | var record_ip = '#{ theme.valine.recordip }' == 'true'; 9 | var GUEST_INFO = ['nick','mail','link']; 10 | var guest_info = '#{ theme.valine.guest_info }'.split(',').filter(function(item){ 11 | return GUEST_INFO.indexOf(item) > -1 12 | }); 13 | guest_info = guest_info.length == 0 ? GUEST_INFO :guest_info; 14 | window.valine = new Valine({ 15 | el:'#vcomment', 16 | notify:notify, 17 | verify:verify, 18 | recordIP:record_ip, 19 | appId:'#{theme.valine.appId}', 20 | appKey:'#{theme.valine.appKey}', 21 | placeholder:'#{theme.valine.placeholder}', 22 | avatar:'#{theme.valine.avatar}', 23 | guest_info:guest_info, 24 | pageSize:'#{theme.valine.pageSize}', 25 | lang: '#{theme.valine.lang}' 26 | }) 27 | -------------------------------------------------------------------------------- /layout/includes/comments/vssue.pug: -------------------------------------------------------------------------------- 1 | if theme.vssue && theme.vssue.enable 2 | #vssue-container 3 | link(rel="stylesheet" href="https://cdn.jsdelivr.net/npm/vssue@1.4.6/dist/vssue.css") 4 | script(src="https://cdn.jsdelivr.net/npm/vue@2.6.12/dist/vue.min.js") 5 | - var platform = theme.vssue.platform || 'github' 6 | script(src="https://cdn.jsdelivr.net/npm/vssue@1.4.6/dist/vssue." + platform + ".min.js") 7 | //- Used for scripts 8 | - var perPage = theme.vssue.perPage || 10 9 | - var autoCreateIssue = theme.vssue.autoCreateIssue || false 10 | if theme.vssue.baseURL !== "" 11 | - var baseURL = theme.vssue.baseURL 12 | else if ['github-v4', 'github'].includes(theme.vssue.platform) 13 | - var baseURL = 'https://github.com' 14 | else if theme.vssue.platform === 'gitlab' 15 | - var baseURL = "https://gitlab.com" 16 | else if theme.vssue.platform === 'gitee' 17 | - var baseURL = "https://gitee.com" 18 | else if theme.vssue.platform === 'gitea' 19 | - var baseURL = "https://gitea.com" 20 | else if theme.vssue.platform === 'bitbucket' 21 | - var baseURL = "https://bitbucket.org" 22 | 23 | script. 24 | var vssue = new Vue({ 25 | el: '#vssue', 26 | 27 | data: { 28 | options: { 29 | owner: '!{theme.vssue.owner}', 30 | repo: '!{theme.vssue.repo}', 31 | clientId:'!{theme.vssue.clientId}', 32 | clientSecret: '!{theme.vssue.clientSecret}', 33 | autoCreateIssue: !{autoCreateIssue}, 34 | baseURL: '!{baseURL}', 35 | perPage: !{perPage}, 36 | labels: ['!{theme.vssue.labels}'], 37 | }, 38 | }, 39 | }) 40 | vssue.render('vssue-container') -------------------------------------------------------------------------------- /layout/includes/comments/waline.pug: -------------------------------------------------------------------------------- 1 | if theme.waline && theme.waline.enable 2 | #waline 3 | script(src='https://cdn.jsdelivr.net/npm/@waline/client') 4 | script. 5 | Waline({ 6 | el:'#waline', 7 | serverURL: '#{theme.waline.serverURL}', 8 | lang: '#{theme.waline.lang}' 9 | avatar: '#{theme.waline.avatar}' 10 | }) 11 | -------------------------------------------------------------------------------- /layout/includes/config.pug: -------------------------------------------------------------------------------- 1 | - 2 | var algolia = 'undefined'; 3 | var env = process.env; 4 | if (theme.algolia_search.enable) { 5 | algolia = JSON.stringify({ 6 | appId: env.ALGOLIA_APP_ID || config.algolia.appId || config.algolia.applicationID, 7 | apiKey: env.ALGOLIA_API_KEY || config.algolia.apiKey, 8 | indexName: env.ALGOLIA_INDEX_NAME || config.algolia.indexName, 9 | hits: theme.algolia_search.hits, 10 | // search languages 11 | languages: { 12 | input_placeholder: _p("algolia_search.input_placeholder"), 13 | hits_empty: _p("algolia_search.hits_empty"), 14 | hits_stats: _p("algolia_search.hits_stats") 15 | } 16 | }) 17 | } 18 | 19 | var localSearch = 'undefined'; 20 | if (theme.local_search && theme.local_search.enable) { 21 | localSearch = JSON.stringify({ 22 | path: config.search.path, 23 | languages: { 24 | // search languages 25 | hits_empty: _p("local_search.hits_empty") 26 | } 27 | }) 28 | } 29 | script. 30 | var GLOBAL_CONFIG = { 31 | root: '!{config.root}', 32 | algolia: !{algolia}, 33 | localSearch: !{localSearch}, 34 | copy: { 35 | success: '!{_p("copy.success")}', 36 | error: '!{_p("copy.error")}', 37 | noSupport: '!{_p("copy.noSupport")}' 38 | }, 39 | hexoVersion: '!{hexoVersion()}' 40 | } -------------------------------------------------------------------------------- /layout/includes/count/busuanzi.pug: -------------------------------------------------------------------------------- 1 | .busuanzi 2 | script(async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js") 3 | if(!is_post()) 4 | if(theme.busuanzi.site_uv) 5 | span#busuanzi_container_site_uv!= theme.busuanzi.site_uv_header 6 | span#busuanzi_value_site_uv 7 | span!=theme.busuanzi.site_uv_footer 8 | if(theme.busuanzi.site_pv) 9 | if(theme.busuanzi.site_pv) 10 | if(theme.busuanzi.site_uv) 11 | span.footer-separator | 12 | span#busuanzi_container_site_pv!= theme.busuanzi.site_pv_header 13 | span#busuanzi_value_site_pv 14 | span!=theme.busuanzi.site_pv_footer 15 | else 16 | if(theme.busuanzi.page_pv) 17 | span#busuanzi_container_page_pv!= theme.busuanzi.page_pv_header 18 | span#busuanzi_value_page_pv 19 | span!=theme.busuanzi.page_pv_footer 20 | else 21 | if(theme.busuanzi.site_uv) 22 | span#busuanzi_container_site_uv!= theme.busuanzi.site_uv_header 23 | span#busuanzi_value_site_uv 24 | span!=theme.busuanzi.site_uv_footer 25 | if(theme.busuanzi.site_pv) 26 | if(theme.busuanzi.site_pv) 27 | if(theme.busuanzi.site_uv) 28 | span.footer-separator | 29 | span#busuanzi_container_site_pv!= theme.busuanzi.site_pv_header 30 | span#busuanzi_value_site_pv 31 | span!=theme.busuanzi.site_pv_footer 32 | -------------------------------------------------------------------------------- /layout/includes/footer.pug: -------------------------------------------------------------------------------- 1 | #footer.layout 2 | - var now = new Date() 3 | - var nowYear = now.getFullYear() 4 | if theme.since && theme.since != nowYear 5 | .copyright!= `©${theme.since} - ${nowYear} By ${config.author}` 6 | else 7 | .copyright!= `©${nowYear} By ${config.author}` 8 | .framework-info 9 | span= _p('footer.driven') + ' - ' 10 | a(href='http://hexo.io') 11 | span Hexo 12 | span.footer-separator | 13 | span= _p('footer.theme') + ' - ' 14 | a(href='https://github.com/Molunerfinn/hexo-theme-melody') 15 | span Melody 16 | if theme.footer_custom_text 17 | .footer_custom_text!=`${theme.footer_custom_text}` 18 | if theme.ICP.enable 19 | .icp 20 | a(href=theme.ICP.url) 21 | span=theme.ICP.text 22 | if theme.busuanzi.enable 23 | include ./count/busuanzi.pug 24 | -------------------------------------------------------------------------------- /layout/includes/gallery/layout.pug: -------------------------------------------------------------------------------- 1 | #gallery!= page.content -------------------------------------------------------------------------------- /layout/includes/gallery/script.pug: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Molunerfinn/hexo-theme-melody/11685c65d503304ad908138c55af5c1cd5dae9e2/layout/includes/gallery/script.pug -------------------------------------------------------------------------------- /layout/includes/head.pug: -------------------------------------------------------------------------------- 1 | meta(name="format-detection" content="telephone=no") 2 | meta(http-equiv="x-dns-prefetch-control" content="on") 3 | link(rel="dns-prefetch" href="https://cdn.jsdelivr.net") 4 | 5 | if theme.algolia_search.enable 6 | link(rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/instantsearch.js@2.1.1/dist/instantsearch.min.css") 7 | script(src="https://cdn.jsdelivr.net/npm/instantsearch.js@2.1.1/dist/instantsearch.min.js" defer) 8 | 9 | if (theme.gitment && theme.gitment.enable) 10 | link(rel="dns-prefetch" href="https://unpkg.com") 11 | link(rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/gitment/style/default.min.css") 12 | script(src="https://cdn.jsdelivr.net/npm/gitment/dist/gitment.browser.min.js") 13 | script(src="https://cdn.jsdelivr.net/npm/blueimp-md5@2.10.0/js/md5.min.js") 14 | 15 | if (theme.gitalk && theme.gitalk.enable) 16 | link(rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/gitalk/dist/gitalk.min.css") 17 | if(theme.gitalk.js) 18 | script(src=theme.gitalk.js) 19 | else 20 | script(src="https://cdn.jsdelivr.net/npm/gitalk@latest/dist/gitalk.min.js") 21 | script(src="https://cdn.jsdelivr.net/npm/blueimp-md5@2.10.0/js/md5.min.js") 22 | 23 | if (theme.pwa && theme.pwa.enable) 24 | link(rel="manifest" href=theme.pwa.manifest) 25 | 26 | if (theme.pwa && theme.pwa.enable) 27 | link(rel="manifest" href=theme.pwa.manifest) 28 | if(theme.pwa.theme_color) 29 | meta(name="theme-color" content=theme.pwa.theme_color) 30 | if(theme.pwa.theme_color) 31 | meta(name="msapplication-TileColor" content=theme.pwa.theme_color) 32 | if(theme.pwa.apple_touch_icon) 33 | link(rel="apple-touch-icon" sizes="180x180" href=theme.pwa.apple_touch_icon) 34 | if(theme.pwa.favicon_32_32) 35 | link(rel="icon" type="image/png" sizes="32x32" href=theme.pwa.favicon_32_32) 36 | if(theme.pwa.favicon_16_16) 37 | link(rel="icon" type="image/png" sizes="16x16" href=theme.pwa.favicon_16_16) 38 | if(theme.pwa.theme_color) 39 | link(rel="mask-icon" href=theme.pwa.mask_icon color=theme.pwa.theme_color) 40 | 41 | if (theme.google_adsense && theme.google_adsense.enable) 42 | script(async src=theme.google_adsense.js) 43 | script. 44 | (adsbygoogle = window.adsbygoogle || []).push({ 45 | google_ad_client: '!{theme.google_adsense.client}', 46 | enable_page_level_ads: '!{theme.google_adsense.enable_page_level_ads}' 47 | }); 48 | 49 | if theme.baidu_analytics 50 | link(rel="dns-prefetch" href="https://hm.baidu.com") 51 | script. 52 | var _hmt = _hmt || []; 53 | (function() { 54 | var hm = document.createElement("script"); 55 | hm.src = "https://hm.baidu.com/hm.js?!{theme.baidu_analytics}"; 56 | var s = document.getElementsByTagName("script")[0]; 57 | s.parentNode.insertBefore(hm, s); 58 | })(); 59 | if theme.google_analytics 60 | link(rel="dns-prefetch" href="https://www.google-analytics.com") 61 | script. 62 | (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ 63 | (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), 64 | m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) 65 | })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); 66 | 67 | ga('create', '!{theme.google_analytics}', 'auto'); 68 | ga('send', 'pageview'); 69 | if theme.google_analytics_MeasurementID 70 | script(async, src=`https://www.googletagmanager.com/gtag/js?id=${theme.google_analytics_MeasurementID}`) 71 | script. 72 | window.dataLayer = window.dataLayer || []; 73 | function gtag(){dataLayer.push(arguments);} 74 | gtag('js', new Date()); 75 | gtag('config', '!{theme.google_analytics_MeasurementID}'); 76 | if theme.tencent_analytics 77 | link(rel="dns-prefetch" href="http://ta.qq.com") 78 | script. 79 | (function() { 80 | var hm = document.createElement("script"); 81 | hm.src = "https://tajs.qq.com/stats?sId=#{theme.tencent_analytics}"; 82 | var s = document.getElementsByTagName("script")[0]; 83 | s.parentNode.insertBefore(hm, s); 84 | })(); 85 | if theme.google_site_verification 86 | meta(name="google-site-verification" content=theme.google_site_verification) 87 | 88 | if theme.bing_site_verification 89 | meta(name="msvalidate.01" content=theme.bing_site_verification) 90 | 91 | if theme.baidu_site_verification 92 | meta(name="baidu-site-verification" content=theme.baidu_site_verification) 93 | 94 | if theme.qihu_site_verification 95 | meta(name="360-site-verification" content=theme.qihu_site_verification) 96 | 97 | if theme.disable_baidu_transformation 98 | meta(http-equiv="Cache-Control" content="no-transform") 99 | meta(http-equiv="Cache-Control" content="no-siteapp") 100 | 101 | if theme.footer_custom_text==='hitokoto' 102 | script(src="https://v1.hitokoto.cn/?encode=js&charset=utf-8&select=.footer_custom_text" defer) 103 | -------------------------------------------------------------------------------- /layout/includes/header.pug: -------------------------------------------------------------------------------- 1 | #page-header 2 | span.pull-left 3 | a#site-name(href=url_for('/')) #[=config.title] 4 | i.fa.fa-bars.toggle-menu.pull-right(aria-hidden="true") 5 | 6 | if (theme.menu) 7 | span.pull-right.menus 8 | each url, label in theme.menu 9 | a.site-page(href=url)= label 10 | 11 | span.pull-right 12 | if (theme.algolia_search.enable || theme.local_search && theme.local_search.enable) 13 | a.site-page.social-icon.search 14 | i.fa.fa-search 15 | span=' '+_p('search') 16 | -------------------------------------------------------------------------------- /layout/includes/layout.pug: -------------------------------------------------------------------------------- 1 | 2 | - var pageTitle = page.title || config.subtitle || '' 3 | - if (is_archive()) pageTitle = _p('page.archives') 4 | - if (is_tag()) pageTitle = _p('page.tag') + ': ' + page.tag 5 | - if (is_category()) pageTitle = _p('page.category') + ': ' + page.category 6 | - if (is_month()) pageTitle += ': ' + page.month + '/' + page.year 7 | - if (is_year()) pageTitle += ': ' + page.year 8 | - pageTitle ? pageTitle += ' | ' + config.title : pageTitle = config.title 9 | 10 | - var pageDescription = page.description || page.title || config.description || '' 11 | - var pageKeywords = (config.keywords || []).join(',') 12 | - if (page.tags && page.tags.data) pageKeywords = page.tags.data.map(function(tag) {return tag.name;}).join(',') 13 | - if (page.keywords) pageKeywords = page.keywords.join(',') 14 | - var pageAuthor = config.email ? config.author + ',' + config.email : config.author 15 | - var pageCopyright = config.copyright || config.author 16 | 17 | doctype html 18 | html(lang=config.language) 19 | head 20 | meta(charset='UTF-8') 21 | meta(http-equiv="X-UA-Compatible" content="IE=edge") 22 | meta(name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1") 23 | meta(name="description" content=pageDescription) 24 | meta(name="keywords" content=pageKeywords) 25 | meta(name="author" content=pageAuthor) 26 | meta(name="copyright" content=pageCopyright) 27 | title= pageTitle 28 | !=favicon_tag(config.favicon || theme.favicon || '/melody-favicon.ico') 29 | if theme.stylesheets !== undefined && theme.stylesheets.length > 0 30 | each url in theme.stylesheets 31 | link(rel='stylesheet', href=url_for(url) + '?version=' + version()) 32 | each item in theme.cdn.css 33 | if item !== undefined 34 | link(rel='stylesheet', href=item + '?version=' + version()) 35 | include ./head.pug 36 | include ./config.pug 37 | body 38 | if theme.fireworks 39 | canvas.fireworks 40 | i.fa.fa-arrow-right#toggle-sidebar(aria-hidden="true") 41 | include ./sidebar.pug 42 | if (!is_post()) 43 | include ./nav.pug 44 | #content-outer 45 | block top_img 46 | #content-inner.layout 47 | if body 48 | div!= body 49 | else 50 | block content 51 | - var top_img = page.top_img || theme.post_meta.top_img || theme.top_img || config.top_img || true 52 | - var bg_img = top_img !== true ? `background-image: url(${top_img})` : '' 53 | - var footer_bg_class= bg_img ? 'footer-bg' : '' 54 | footer(style=bg_img class=footer_bg_class) 55 | include ./footer.pug 56 | i.fa.fa-arrow-up#go-up(aria-hidden="true") 57 | each item in theme.cdn.js 58 | if item !== undefined 59 | script(src=url_for(item)) 60 | if theme.scripts !== undefined && theme.scripts.length > 0 61 | //- scripts list from config.yml 62 | each url in theme.scripts 63 | script(src=url_for(url) + '?version=' + version()) 64 | include ./additional-js.pug 65 | include ./search/index.pug 66 | -------------------------------------------------------------------------------- /layout/includes/mixins/article-sort.pug: -------------------------------------------------------------------------------- 1 | mixin articleSort(posts) 2 | .article-sort 3 | - var year 4 | - posts.each(function (article) { 5 | - var tempYear = date(article.date, 'YYYY') 6 | if tempYear !== year 7 | - year = tempYear 8 | .article-sort-item.year= year 9 | .article-sort-item 10 | time.article-sort-item__time= date(article.date) 11 | a.article-sort-item__title(href=url_for(article.path))= article.title || 'No Title' 12 | - }) -------------------------------------------------------------------------------- /layout/includes/mixins/slide.pug: -------------------------------------------------------------------------------- 1 | include ./article-sort.pug 2 | mixin slideArticle() 3 | - var posts = site.posts.filter(item => item.layout === 'slides') 4 | #archive 5 | .article-sort-title= 'Slides - ' + posts.length 6 | +articleSort(posts) 7 | 8 | mixin slide(item) 9 | - var slide = page.slide || theme.slide 10 | - var defaultSlide = theme.slide 11 | section( 12 | data-markdown 13 | data-separator=slide.separator || defaultSlide.separator 14 | data-separator-vertical=slide.separator_vertical || defaultSlide.separator_vertical 15 | data-charset=slide.charset || defaultSlide.charset) 16 | script(type="text/template")!= item._content 17 | 18 | mixin slideIframe(url) 19 | .content 20 | iframe(src=url_for(url) frameborder="0") 21 | 22 | mixin postSlideIframe(url) 23 | .post-iframe 24 | iframe(src=url frameborder="0") 25 | -------------------------------------------------------------------------------- /layout/includes/nav.pug: -------------------------------------------------------------------------------- 1 | - var top_img = page.top_img || theme.post_meta.top_img || theme.top_img || config.top_img || true 2 | - var bg_img = top_img && top_img !== true ? `background-image: url(${top_img})` : '' 3 | - var flag = top_img === true ? 'no-bg' : '' 4 | nav#nav(style=bg_img class=flag) 5 | include ./header.pug 6 | #site-info 7 | #site-title= config.title 8 | #site-sub-title= config.subtitle 9 | if(theme.social) 10 | #site-social-icons 11 | each url, icon in theme.social 12 | a.social-icon(href=url target="_blank" rel="noreferrer noopener nofollow") 13 | i(class="fa-" + icon) 14 | -------------------------------------------------------------------------------- /layout/includes/pagination.pug: -------------------------------------------------------------------------------- 1 | - 2 | var options = { 3 | prev_text: '', 4 | next_text: '', 5 | mid_size: 1, 6 | escape: false 7 | } 8 | nav#pagination 9 | if(!is_post()) 10 | div.pagination 11 | !=paginator(options) 12 | else 13 | if(page.prev) 14 | .prev-post.pull-left 15 | a(href=url_for(page.prev.path)) 16 | i.fa.fa-chevron-left 17 | span=page.prev.title 18 | if(page.next) 19 | .next-post.pull-right 20 | a(href=url_for(page.next.path)) 21 | span=page.next.title 22 | i.fa.fa-chevron-right 23 | 24 | -------------------------------------------------------------------------------- /layout/includes/recent-posts.pug: -------------------------------------------------------------------------------- 1 | each article in page.posts.data 2 | .recent-post-item.article-container 3 | - var link = article.link || article.path 4 | a.article-title(href=url_for(link))= article.title || _p('no_title') 5 | if (article.top) 6 | span.article-meta 7 | i.fa.fa-thumb-tack.article-meta__icon.sticky 8 | span.sticky= _p('sticky') 9 | span.article-meta__separator(style="margin-right: 0.3rem") | 10 | if (theme.post_meta.date_type) 11 | - var date_type = theme.post_meta.date_type == 'updated' ? 'updated' : 'date' 12 | time.post-meta__date #[i.fa.fa-calendar(aria-hidden="true")] #[=date(article[date_type], config.date_format)] 13 | if (article.layout === 'slides') 14 | a.article-type(href='/slides') Slides 15 | if (theme.post_meta.categories && article.categories.data.length > 0) 16 | span.article-meta 17 | span.article-meta__separator | 18 | each item, index in article.categories.data 19 | i.fa.fa-inbox.article-meta__icon(aria-hidden="true") 20 | a(href=url_for(item.path)).article-meta__categories #[=item.name] 21 | if (index < article.categories.data.length - 1) 22 | i.fa.fa-angle-right(aria-hidden="true") 23 | if (theme.post_meta.tags && article.tags.data.length > 0) 24 | span.article-meta.tags 25 | span.article-meta__separator | 26 | each item, index in article.tags.data 27 | i.fa.fa-tag.article-meta__icon(aria-hidden="true") 28 | a(href=url_for(item.path)).article-meta__tags #[=item.name] 29 | if (index < article.tags.data.length - 1) 30 | span.article-meta__link - 31 | if (article.layout === 'slides') 32 | include ./mixins/slide.pug 33 | - var iframeLink = article.iframe || link 34 | +slideIframe(iframeLink) 35 | else if article.excerpt 36 | .content!= article.excerpt 37 | a.more(href=url_for(link) + '#more')= _p('read_more') 38 | else if theme.auto_excerpt && theme.auto_excerpt.enable 39 | - const content = strip_html(article.content) 40 | - let expert = content.substring(0, theme.auto_excerpt.length) 41 | - content.length > theme.auto_excerpt.length ? expert += ' ...' : '' 42 | .content!= expert 43 | a.more(href=url_for(link) + '#more' style="margin-top: 14px")= _p('read_more') 44 | else 45 | .content!= article.content 46 | hr 47 | -------------------------------------------------------------------------------- /layout/includes/search/algolia.pug: -------------------------------------------------------------------------------- 1 | #algolia-search.search-dialog 2 | #algolia-search-title.search-dialog__title Algolia 3 | #algolia-input-panel 4 | #algolia-search-input 5 | hr 6 | #algolia-search-results 7 | #algolia-hits 8 | #algolia-pagination 9 | #algolia-stats 10 | span.search-close-button 11 | i.fa.fa-times 12 | .search-mask 13 | -------------------------------------------------------------------------------- /layout/includes/search/index.pug: -------------------------------------------------------------------------------- 1 | if (theme.algolia_search.enable) 2 | include ./algolia.pug 3 | if (theme.local_search) 4 | if (!theme.algolia_search.enable && theme.local_search.enable) 5 | include ./local-search.pug -------------------------------------------------------------------------------- /layout/includes/search/local-search.pug: -------------------------------------------------------------------------------- 1 | #local-search.search-dialog 2 | #local-search-title.search-dialog__title=_p("local_search.label") 3 | #local-input-panel 4 | #local-search-input 5 | .local-search-box 6 | input(placeholder=_p("local_search.input_placeholder")).local-search-box--input 7 | hr 8 | #local-search-results 9 | #local-hits 10 | #local-stats 11 | #hr.local-search-stats__hr 12 | case config.language 13 | when "zh-Hans" 14 | span=_p("local_search.by") 15 | | #[a(href="https://github.com/wzpan/hexo-generator-search" style={'color': '#49B1F5'}) hexo-generator-search] 16 | | #[span=_p("local_search.powered")] 17 | when "en" 18 | default 19 | span=_p("local_search.powered_by") 20 | | #[a(href="https://github.com/wzpan/hexo-generator-search" style={'color': '#49B1F5'}) hexo-generator-search] 21 | span.search-close-button 22 | i.fa.fa-times 23 | .search-mask -------------------------------------------------------------------------------- /layout/includes/share/add-this.pug: -------------------------------------------------------------------------------- 1 | .addthis_inline_share_toolbox.pull-right 2 | script(src=`//s7.addthis.com/js/300/addthis_widget.js#pubid=${theme.addThis.pubid}` async) -------------------------------------------------------------------------------- /layout/includes/share/index.pug: -------------------------------------------------------------------------------- 1 | if theme.addThis && theme.addThis.enable 2 | include ./add-this.pug 3 | else if theme.sharejs && theme.sharejs.enable 4 | include ./share-js.pug 5 | -------------------------------------------------------------------------------- /layout/includes/share/share-js.pug: -------------------------------------------------------------------------------- 1 | if (theme.sharejs && theme.sharejs.enable) 2 | .social-share(data-disabled=theme.sharejs.disabled_sites).pull-right 3 | link(rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js@1.0.16/dist/css/share.min.css") 4 | script(src="https://cdn.jsdelivr.net/npm/social-share.js@1.0.16/dist/js/social-share.min.js") -------------------------------------------------------------------------------- /layout/includes/sidebar.pug: -------------------------------------------------------------------------------- 1 | - const showToc = is_post() && theme.toc.enable 2 | - 3 | let tocNumber 4 | if (page.toc_number !== undefined) tocNumber = page.toc_number 5 | else if (theme.toc.number !== undefined) tocNumber = theme.toc.number 6 | else tocNumber = true 7 | let currentPageType = is_post() 8 | ? 'post' 9 | : is_home() 10 | ? 'index' 11 | : 'other' 12 | let display = 'false' 13 | const sidebar_display = theme.sidebar_display || 'post' 14 | if ( 15 | currentPageType === sidebar_display || 16 | (sidebar_display === 'all') || 17 | (currentPageType !== 'index' && (sidebar_display === 'index-none')) || 18 | (currentPageType !== 'post' && (sidebar_display === 'post-none')) 19 | ) { 20 | display = 'true' 21 | } 22 | if (theme.sidebar_display === 'hidden') { 23 | display = 'false' 24 | } 25 | - 26 | #sidebar(data-display=display) 27 | if(showToc) 28 | .toggle-sidebar-info.text-center 29 | span(data-toggle= _p('sidebar.toggle_article'))= _p('sidebar.toggle_site') 30 | hr 31 | .sidebar-toc 32 | div.sidebar-toc__title= _p('sidebar.catalog') 33 | div.sidebar-toc__progress 34 | span.progress-notice= _p('sidebar.have_read') 35 | span.progress-num 0 36 | span.progress-percentage % 37 | div.sidebar-toc__progress-bar 38 | div.sidebar-toc__content!=toc(page.content, {list_number: tocNumber}) 39 | .author-info(class= showToc ? 'hide' : undefined) 40 | .author-info__avatar.text-center 41 | img(src=theme.avatar || url_for('/img/avatar.png')) 42 | .author-info__name.text-center= config.author 43 | .author-info__description.text-center= config.description 44 | if theme.follow && theme.follow.enable 45 | .follow-button 46 | a(href=theme.follow.url)= theme.follow.text || 'Follow Me' 47 | hr 48 | .author-info-articles 49 | if site.posts.length 50 | a(href=url_for(config.archive_dir)).author-info-articles__archives.article-meta 51 | span.pull-left= _p('sidebar.articles') 52 | span.pull-right= site.posts.length 53 | if site.tags.length 54 | a(href=url_for(config.tag_dir)).author-info-articles__tags.article-meta 55 | span.pull-left= _p('sidebar.tags') 56 | span.pull-right= site.tags.length 57 | if site.categories.length 58 | a(href=url_for(config.category_dir)).author-info-articles__categories.article-meta 59 | span.pull-left= _p('sidebar.categories') 60 | span.pull-right= site.categories.length 61 | if theme.links_title 62 | hr 63 | .author-info-links 64 | .author-info-links__title.text-center= theme.links_title 65 | each url, name in theme.links 66 | a.author-info-links__name.text-center(href=url)= name 67 | -------------------------------------------------------------------------------- /layout/includes/slide/layout.pug: -------------------------------------------------------------------------------- 1 | 2 | - var pageTitle = page.title || config.subtitle || '' 3 | - if (is_month()) pageTitle += ': ' + page.month + '/' + page.year 4 | - if (is_year()) pageTitle += ': ' + page.year 5 | - pageTitle += ' | ' + config.title 6 | 7 | - var pageDescription = page.description || page.title || config.description || '' 8 | - var pageKeywords = (config.keywords || []).join(',') 9 | - if (page.tags && page.tags.data) pageKeywords = page.tags.data.map(function(tag) {return tag.name;}).join(',') 10 | - if (page.keywords) pageKeywords = page.keywords.join(',') 11 | - var pageAuthor = config.author + ',' + config.email 12 | - var pageCopyright = config.copyright || config.author 13 | 14 | doctype html 15 | html(lang=config.language) 16 | head 17 | meta(charset='UTF-8') 18 | meta(http-equiv="X-UA-Compatible" content="IE=edge") 19 | meta(name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1") 20 | meta(name="description" content=pageDescription) 21 | meta(name="keywords" content=pageKeywords) 22 | meta(name="author" content=pageAuthor) 23 | meta(name="copyright" content=pageCopyright) 24 | title= pageTitle 25 | !=favicon_tag(config.favicon || theme.favicon || '/melody-favicon.ico') 26 | if !page.iframe 27 | link(rel="stylesheet" href="https://cdn.jsdelivr.net/npm/reveal.js@latest/dist/reveal.css") 28 | link(rel="stylesheet" href="https://cdn.jsdelivr.net/npm/reveal.js@latest/dist/reset.css") 29 | - var slide = page.slide || theme.slide 30 | - var defaultSlide = theme.slide 31 | - var slideTheme = slide.theme || defaultSlide.theme 32 | - var slideCodeTheme = slide.codeTheme || defaultSlide.codeTheme || 'monokai' 33 | link(rel="stylesheet" href="https://cdn.jsdelivr.net/npm/reveal.js@latest/dist/theme/" + slideTheme + ".css") 34 | link(rel="stylesheet" href="https://cdn.jsdelivr.net/npm/reveal.js@latest/plugin/highlight/"+ slideCodeTheme + ".css") 35 | //- Available: zenburn.css and monokai.css) 36 | else 37 | style. 38 | body { 39 | margin: 0; 40 | padding: 0; 41 | height: 100vh; 42 | overflow: hidden; 43 | } 44 | .post-iframe iframe{ 45 | width: 100%; 46 | height: 100vh; 47 | } 48 | body 49 | include ../mixins/slide.pug 50 | if page.iframe 51 | +postSlideIframe(page.iframe) 52 | else 53 | .reveal 54 | .slides 55 | +slide(page) 56 | include ./script.pug 57 | -------------------------------------------------------------------------------- /layout/includes/slide/script.pug: -------------------------------------------------------------------------------- 1 | script(src=url_for("https://cdn.jsdelivr.net/npm/reveal.js@latest/dist/reveal.js")) 2 | script(src=url_for("https://cdn.jsdelivr.net/npm/reveal.js@latest/plugin/zoom/zoom.js")) 3 | script(src=url_for("https://cdn.jsdelivr.net/npm/reveal.js@latest/plugin/search/search.js")) 4 | script(src=url_for("https://cdn.jsdelivr.net/npm/reveal.js@latest/plugin/notes/notes.js")) 5 | script(src=url_for("https://cdn.jsdelivr.net/npm/reveal.js@latest/plugin/math/math.js")) 6 | script(src=url_for("https://cdn.jsdelivr.net/npm/reveal.js@latest/plugin/markdown/markdown.js")) 7 | script(src=url_for("https://cdn.jsdelivr.net/npm/reveal.js@latest/plugin/highlight/highlight.js")) 8 | - var slide = page.slide || theme.slide 9 | - var defaultSlide = theme.slide 10 | - var mouseWheel = slide.mouseWheel || defaultSlide.mouseWheel 11 | - var transition = slide.transition || defaultSlide.transition 12 | - var transitionSpeed = slide.transitionSpeed || defaultSlide.transitionSpeed 13 | - var parallaxBackgroundImage = slide.parallaxBackgroundImage || defaultSlide.parallaxBackgroundImage 14 | - var parallaxBackgroundSize = slide.parallaxBackgroundSize || defaultSlide.parallaxBackgroundSize 15 | - var parallaxBackgroundHorizontal = slide.parallaxBackgroundHorizontal || defaultSlide.parallaxBackgroundHorizontal 16 | - var parallaxBackgroundVertical = slide.parallaxBackgroundVertical || defaultSlide.parallaxBackgroundVertical 17 | - var autoSlide = slide.autoSlide || defaultSlide.autoSlide || false 18 | - var loop = slide.loop || defaultSlide.loop || false 19 | - var controlsLayout = slide.controlsLayout || defaultSlide.controlsLayout || "bottom-right" 20 | - var controlsBackArrows = slide.controlsBackArrows || defaultSlide.controlsBackArrows || "faded" 21 | - var progress = slide.progress || defaultSlide.progress || true 22 | - var showNotes = slide.showNotes || defaultSlide.showNotes || false 23 | - var autoPlayMedia = slide.autoPlayMedia || defaultSlide.autoPlayMedia || false 24 | - var backgroundTransition = slide.backgroundTransition|| defaultSlide.backgroundTransition || 'fade' 25 | 26 | script. 27 | Reveal.initialize({ 28 | mouseWheel: !{mouseWheel}, 29 | transition: '!{transition}', 30 | transitionSpeed: '!{transitionSpeed}', 31 | parallaxBackgroundImage: '!{parallaxBackgroundImage}', 32 | parallaxBackgroundSize: '!{parallaxBackgroundSize}', 33 | parallaxBackgroundHorizontal: '!{parallaxBackgroundHorizontal}', 34 | parallaxBackgroundVertical: '!{parallaxBackgroundVertical}', 35 | autoSlide: !{autoSlide}, 36 | loop: !{loop}, 37 | controlsLayout: '!{controlsLayout}', // Determines where controls appear, "edges" or "bottom-right" 38 | controlsBackArrows: '!{controlsBackArrows}', 39 | progress: !{progress}, 40 | showNotes: !{showNotes}, 41 | autoPlayMedia: !{autoPlayMedia}, 42 | backgroundTransition: '!{backgroundTransition}', 43 | markdown: { 44 | smartypants: true 45 | }, 46 | plugins: [ 47 | RevealMarkdown, 48 | // Markdown 49 | RevealHighlight, 50 | // Search 51 | RevealSearch, 52 | // Speaker notes 53 | RevealNotes, 54 | // Zoom in and out with Alt+click 55 | RevealZoom, 56 | // MathJax 57 | RevealMath 58 | ] 59 | }); 60 | -------------------------------------------------------------------------------- /layout/includes/third-party/canvas-ribbon.pug: -------------------------------------------------------------------------------- 1 | script(id="ribbon" src=url_for('/js/third-party/canvas-ribbon.js') size=theme.canvas_ribbon.size 2 | alpha=theme.canvas_ribbon.alpha zIndex=theme.canvas_ribbon.zIndex data-click=`${theme.canvas_ribbon.click_to_change}`) 3 | -------------------------------------------------------------------------------- /layout/includes/third-party/katex.pug: -------------------------------------------------------------------------------- 1 | link(rel="stylesheet" type="text/css" href=theme.katex.cdn.css) 2 | script(src='https://cdn.jsdelivr.net/npm/katex-copytex@latest/dist/katex-copytex.min.js') 3 | link(rel="stylesheet" type="text/css" href='https://cdn.jsdelivr.net/npm/katex-copytex@latest/dist/katex-copytex.min.css') 4 | script(src=url_for('/js/katex.js')) -------------------------------------------------------------------------------- /layout/includes/third-party/mathjax.pug: -------------------------------------------------------------------------------- 1 | script(type="text/x-mathjax-config"). 2 | MathJax.Hub.Config({ 3 | tex2jax: { 4 | inlineMath: [ ['$','$'], ["\\(","\\)"] ], 5 | processEscapes: true, 6 | skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code'] 7 | }, 8 | CommonHTML: { 9 | linebreaks: { automatic: true, width: "90% container" } 10 | }, 11 | "HTML-CSS": { 12 | linebreaks: { automatic: true, width: "90% container" } 13 | }, 14 | "SVG": { 15 | linebreaks: { automatic: true, width: "90% container" } 16 | } 17 | }); 18 | 19 | script(type="text/x-mathjax-config"). 20 | MathJax.Hub.Queue(function() { 21 | var all = MathJax.Hub.getAllJax(), i; 22 | for (i=0; i < all.length; i += 1) { 23 | all[i].SourceElement().parentNode.className += ' has-jax'; 24 | } 25 | }); 26 | 27 | script(src=theme.mathjax.cdn) -------------------------------------------------------------------------------- /layout/index.pug: -------------------------------------------------------------------------------- 1 | extends includes/layout.pug 2 | 3 | block content 4 | include includes/recent-posts.pug 5 | include includes/pagination.pug 6 | -------------------------------------------------------------------------------- /layout/page.pug: -------------------------------------------------------------------------------- 1 | extends includes/layout.pug 2 | 3 | block content 4 | if page.type === 'tags' 5 | .tag-cloud 6 | .tag-cloud__title= _p('page.tag') 7 | | - 8 | span.tag-cloud__amount= site.tags.length 9 | - var start_color = theme.theme_color ? (theme.theme_color.tag_start_color || '#A4D8FA'): '#A4D8FA' 10 | - var end_color = theme.theme_color ? (theme.theme_color.tag_end_color || '#1B9EF3') : '#1B9EF3' 11 | .tag-cloud-tags!= tagcloud({min_font: 12, max_font: 30, amount: 200, color: true, start_color, end_color}) 12 | else if page.type === 'categories' 13 | #post-content 14 | .category-lists 15 | .category__title= _p('page.category') 16 | | - 17 | span.category__amount= site.categories.length 18 | div!= list_categories() 19 | else if page.type === 'slides' 20 | include ./includes/mixins/slide.pug 21 | +slideArticle() 22 | else 23 | article#page 24 | h1= page.title 25 | .article-container!= page.content 26 | include includes/pagination.pug 27 | 28 | if page.comments !== false 29 | include includes/comments/index.pug 30 | -------------------------------------------------------------------------------- /layout/post.pug: -------------------------------------------------------------------------------- 1 | extends includes/layout.pug 2 | 3 | block top_img 4 | - var top_img = page.top_img || theme.post_meta.top_img || theme.top_img || config.top_img 5 | if (top_img && page.top_img !== false) 6 | - var bg_img = top_img !== true ? `background-image: url(${top_img})` : '' 7 | - var flag = top_img === true ? 'no-bg' : '' 8 | div#top-container(style=bg_img class=flag) 9 | include ./includes/header.pug 10 | #post-info 11 | #post-title= page.title || _p('no_title') 12 | #post-meta 13 | if (theme.post_meta.date_type) 14 | if (theme.post_meta.date_type === 'both') 15 | time.post-meta__date 16 | i.fa.fa-calendar(aria-hidden="true") 17 | =' '+_p('post.created')+' '+date(page.date, config.date_format) 18 | span.post-meta__separator | 19 | i.fa.fa-calendar-check-o(aria-hidden="true") 20 | =' '+_p('post.updated')+' '+date(page.updated, config.date_format) 21 | else 22 | - var date_type = theme.post_meta.date_type === 'updated' ? 'updated' : 'date' 23 | time.post-meta__date #[i.fa.fa-calendar(aria-hidden="true")] #[=date(page[date_type], config.date_format)] 24 | if (theme.post_meta.categories && page.categories.data.length > 0) 25 | if (theme.post_meta.date_type) 26 | span.post-meta__separator | 27 | each item, index in page.categories.data 28 | i.fa.fa-inbox.post-meta__icon(aria-hidden="true") 29 | a(href=url_for(item.path)).post-meta__categories #[=item.name] 30 | if (index < page.categories.data.length - 1) 31 | i.fa.fa-angle-right(aria-hidden="true") 32 | if (theme.disqus.enable && theme.disqus.count) 33 | if (theme.post_meta.date_type || theme.post_meta.categories && page.categories.data.length > 0) 34 | span.post-meta__separator | 35 | i.fa.fa-comment-o.post-meta__icon(aria-hidden="true") 36 | a(href=url_for(page.path) + '#disqus_thread') 37 | span.disqus-comment-count(data-disqus-identifier=page.path) 38 | if (theme.wordcount && theme.wordcount.enable) 39 | .post-meta-wordcount 40 | span= _p('post.wordcount') + ': ' 41 | span.word-count= wordcount(page.content) 42 | span.post-meta__separator | 43 | span= _p('post.min2read', min2read(page.content, {cn: 350, en: 160})) 44 | else 45 | div#top-container.plain 46 | include ./includes/header.pug 47 | 48 | block content 49 | article#post(class="") 50 | if (!top_img) 51 | #post-title.plain= page.title || _p('no_title') 52 | #post-meta 53 | if (theme.post_meta.date_type) 54 | - var date_type = theme.post_meta.date_type === 'updated' ? '' : 'date' 55 | time.post-meta__date #[i.fa.fa-calendar(aria-hidden="true")] #[=date(page[date_type], config.date_format)] 56 | if (theme.post_meta.categories && page.categories.data.length > 0) 57 | if (theme.post_meta.date_type) 58 | span.post-meta__separator | 59 | each item, index in page.categories.data 60 | i.fa.fa-inbox(aria-hidden="true") 61 | a(href=url_for(item.path)).post-meta__categories #[=item.name] 62 | if (index < page.categories.data.length - 1) 63 | i.fa.fa-angle-right.post-meta__separator(aria-hidden="true") 64 | if (theme.disqus.enable && theme.disqus.count) 65 | if (theme.post_meta.date_type || theme.post_meta.categories && page.categories.data.length > 0) 66 | span.post-meta__separator | 67 | i.fa.fa-comment-o(aria-hidden="true") 68 | a(href=url_for(page.path) + '#disqus_thread') 69 | span.disqus-comment-count(data-disqus-identifier=page.path) 70 | if (theme.wordcount && theme.wordcount.enable) 71 | span.post-meta__separator | 72 | span.post-meta-wordcount 73 | span= _p('post.wordcount') + ': ' 74 | span.word-count= wordcount(page.content) 75 | span.post-meta__separator | 76 | span= _p('post.min2read', min2read(page.content, {cn: 350, en: 160})) 77 | #post-content.article-container!= page.content 78 | if (theme.post_copyright && theme.post_copyright.enable) 79 | .post-copyright 80 | .post-copyright__author 81 | span.post-copyright-meta= _p('post.copyright.author') + ": " 82 | span.post-copyright-info 83 | a(href=`mailto:${config.email}`) #[=config.author] 84 | .post-copyright__type 85 | span.post-copyright-meta= _p('post.copyright.link') + ": " 86 | span.post-copyright-info 87 | a(href=url_for(decodeURI(page.permalink))) #[=decodeURI(page.permalink)] 88 | .post-copyright__notice 89 | span.post-copyright-meta= _p('post.copyright.copyright_notice') + ": " 90 | span.post-copyright-info!= _p('post.copyright.copyright_content', theme.post_copyright.license_url, theme.post_copyright.license, config.url, config.title) 91 | if (theme.post_meta.tags) 92 | .post-meta__tag-list 93 | each item, index in page.tags.data 94 | a(href=url_for(item.path)).post-meta__tags #[=item.name] 95 | if (theme.QR_code) 96 | if (theme.QR_code.length > 0) 97 | .post-qr-code 98 | each item in theme.QR_code 99 | .post-qr-code-item 100 | img.post-qr-code__img(src=(item.itemlist||item).img) 101 | .post-qr-code__desc=(item.itemlist||item).text 102 | include includes/share/index.pug 103 | include includes/pagination.pug 104 | if (theme.adv && theme.adv.enable) 105 | .post-adv!= theme.adv.info 106 | if page.comments !== false 107 | include includes/comments/index.pug 108 | -------------------------------------------------------------------------------- /layout/slides.pug: -------------------------------------------------------------------------------- 1 | extends includes/slide/layout.pug -------------------------------------------------------------------------------- /layout/tag.pug: -------------------------------------------------------------------------------- 1 | extends includes/layout.pug 2 | 3 | block content 4 | include ./includes/mixins/article-sort.pug 5 | #tag 6 | .article-sort-title= _p('page.tag') + ' - ' + page.tag 7 | +articleSort(page.posts) 8 | include includes/pagination.pug 9 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hexo-theme-melody", 3 | "version": "1.9.1", 4 | "description": "hexo-theme-melody hexo theme", 5 | "scripts": { 6 | "cz": "git-cz", 7 | "release": "bump-version" 8 | }, 9 | "devDependencies": { 10 | "cross-env": "^5.1.3", 11 | "eslint": "^4.4.1", 12 | "eslint-config-standard": "^10.2.1", 13 | "eslint-plugin-import": "^2.7.0", 14 | "eslint-plugin-node": "^5.1.1", 15 | "eslint-plugin-promise": "^3.5.0", 16 | "eslint-plugin-standard": "^3.0.1", 17 | "nib": "^1.1.2", 18 | "stylus-supremacy": "^1.6.3", 19 | "@commitlint/cli": "^7.5.2", 20 | "@picgo/bump-version": "^1.0.3", 21 | "commitizen": "^3.0.7", 22 | "conventional-changelog": "^3.1.3", 23 | "cz-customizable": "^5.10.0", 24 | "husky": "^1.3.1" 25 | }, 26 | "husky": { 27 | "hooks": { 28 | "commit-msg": "commitlint -E HUSKY_GIT_PARAMS" 29 | } 30 | }, 31 | "config": { 32 | "commitizen": { 33 | "path": "./node_modules/cz-customizable" 34 | }, 35 | "cz-customizable": { 36 | "config": "./node_modules/@picgo/bump-version/.cz-config.js" 37 | } 38 | }, 39 | "commitlint": { 40 | "extends": [ 41 | "./node_modules/@picgo/bump-version/commitlint-picgo" 42 | ] 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /scripts/gallery-tag.js: -------------------------------------------------------------------------------- 1 | hexo.extend.tag.register('gallery', args => { 2 | const url = args[0] 3 | const title = args[1] || 'No title' 4 | return ` 5 | 15 | ` 16 | }) 17 | -------------------------------------------------------------------------------- /scripts/hexo-plugins.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Molunerfinn/hexo-theme-melody/11685c65d503304ad908138c55af5c1cd5dae9e2/scripts/hexo-plugins.txt -------------------------------------------------------------------------------- /scripts/replace-config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Note: configs in _data/melody.yml will replace configs in hexo.theme.config. 3 | */ 4 | 5 | const version = require('../package.json').version 6 | 7 | hexo.extend.helper.register('version', function () { 8 | return version 9 | }) 10 | 11 | hexo.extend.helper.register('hexoVersion', function () { 12 | return hexo.version 13 | }) 14 | 15 | hexo.on('generateBefore', function () { 16 | const rootConfig = hexo.config 17 | if (hexo.locals.get) { 18 | const data = hexo.locals.get('data') 19 | data && data.melody && (hexo.theme.config = data.melody) 20 | } 21 | hexo.theme.config.rootConfig = rootConfig 22 | }) -------------------------------------------------------------------------------- /source/css/404.styl: -------------------------------------------------------------------------------- 1 | #site-info 2 | height: 100vh 3 | 4 | #nav 5 | margin-bottom: 0 -------------------------------------------------------------------------------- /source/css/_global/index.styl: -------------------------------------------------------------------------------- 1 | html 2 | height: 100% 3 | font-size: $rem 4 | 5 | body 6 | position: relative 7 | display: flex 8 | flex-direction: column 9 | min-height: 100% 10 | background: #fff 11 | color: $font-black 12 | font-size: $font-size 13 | font-family: $font-family 14 | line-height: $text-line-height 15 | 16 | *::-webkit-scrollbar 17 | width: 8px 18 | height: 8px 19 | 20 | *::-webkit-scrollbar-thumb 21 | background: $light-blue 22 | 23 | *::-webkit-scrollbar-track 24 | background-color: transparent 25 | 26 | h1, 27 | h2, 28 | h3, 29 | h4, 30 | h5, 31 | h6 32 | position: relative 33 | margin: 0.2rem 0 34 | color: lighten($font-color, 15%) 35 | font-weight: bold 36 | 37 | #content-outer 38 | flex: 1 auto 39 | 40 | * 41 | box-sizing: border-box 42 | 43 | #content-inner 44 | .img-alt 45 | text-decoration: none 46 | 47 | #toggle-sidebar 48 | position: fixed 49 | bottom: $sidebar-icon-top 50 | left: $sidebar-icon-left 51 | z-index: 100 52 | font-size: $sidebar-icon-size 53 | cursor: pointer 54 | 55 | #go-up 56 | position: fixed 57 | right: $go-up-right 58 | bottom: $go-up-bottom 59 | z-index: 100 60 | font-size: $sidebar-icon-size 61 | opacity: 0 62 | cursor: pointer 63 | 64 | .fancybox-caption 65 | text-align: center 66 | 67 | .fireworks 68 | position: fixed 69 | z-index: -1 70 | pointer-events: none 71 | 72 | hr 73 | position: relative 74 | margin: 2rem auto 75 | width: calc(100% - 4px) 76 | border: 2px dashed $pale-blue 77 | background: $white 78 | 79 | &:hover 80 | &:before 81 | left: calc(95% - 20px) 82 | 83 | &:before 84 | position: absolute 85 | top: -10px 86 | left: 5% 87 | z-index: 1 88 | color: $light-blue 89 | content: "\f0c4" 90 | font: normal normal normal 14px / 1 FontAwesome 91 | font-size: 20px 92 | transition: all 1s ease-in-out 93 | 94 | // collapse/expand beautify 95 | details 96 | padding: 0.3rem 97 | border: 2px solid darken($light-grey, 10%) 98 | 99 | summary 100 | color: $theme-color 101 | 102 | // set of
to center-align 103 | // use class="not-code" to avoid conflicts because code also use
tag 104 | .not-code 105 | margin: 0.5em 106 | padding: 0.5em 107 | border: thin silver solid 108 | text-align: center 109 | 110 | table 111 | overflow: auto 112 | width: 100% 113 | border-spacing: 0 114 | border-collapse: collapse 115 | 116 | thead 117 | background: alpha($a-link-color, 10%) 118 | 119 | th, 120 | td 121 | padding: 0.3rem 0.6rem 122 | border: 1px solid darken($light-grey, 10%) 123 | vertical-align: top 124 | 125 | *::selection 126 | background: $selection 127 | color: $pale-grey 128 | 129 | .text-center 130 | text-align: center 131 | 132 | .pull-left 133 | float: left 134 | 135 | .pull-right 136 | float: right 137 | 138 | @media screen and (max-width: $bg) 139 | i#toggle-sidebar, 140 | #sidebar 141 | display: none 142 | 143 | body 144 | padding-left: 0 !important 145 | -------------------------------------------------------------------------------- /source/css/_highlight/diff.styl: -------------------------------------------------------------------------------- 1 | $highlight_theme = hexo-config("highlight_theme") 2 | 3 | if $highlight_theme == "light" 4 | $highlight-deletion = #fdd 5 | $highlight-addition = #dfd 6 | else 7 | $highlight-addition = #008000 8 | $highlight-deletion = #800000 9 | -------------------------------------------------------------------------------- /source/css/_highlight/highlight.styl: -------------------------------------------------------------------------------- 1 | // https://github.com/equinusocio/vsc-material-theme 2 | @require "theme" 3 | @require "diff" 4 | 5 | // languages = "js" "javascript" "python" "ruby" "xml" "html" "css" "perl" "sql" "coffeescript" "java" "scala" "kotlin" "c" "c\+\+" "go" "less" "sass" "scss" "stylus" "styl" "typescript" "ts" "bash" "yml" "gradle" 6 | wordWrap = !hexo-config("rootConfig.highlight.line_number") && hexo-config("code_word_wrap") 7 | 8 | // loopForLanguages() 9 | // for lang in languages 10 | // .article-container 11 | // figure.highlight 12 | // &{"." + lang} 13 | // table 14 | // &:before 15 | // content: lang 16 | 17 | // loopForLanguages() 18 | 19 | // Placeholder: $code-block 20 | $code-block 21 | overflow: auto 22 | margin: 1rem 0 23 | padding: 0 24 | padding-top: 1.4rem 25 | background: $highlight-background 26 | color: $highlight-foreground 27 | font-size: $code-font-size 28 | line-height: $line-height-code-block 29 | 30 | if wordWrap 31 | counter-reset: line 32 | white-space: pre-wrap 33 | 34 | figure.highlight 35 | position: relative 36 | 37 | blockquote 38 | margin: 0 39 | padding: 0 0.6rem 40 | border-left: 0.2rem solid $blockquote-padding-color 41 | color: $blockquote-color 42 | 43 | .article-container 44 | pre, 45 | code 46 | font-family: $code-font !important 47 | 48 | code 49 | padding: 0.1rem 0.2rem 50 | background: $code-background 51 | color: $code-foreground 52 | word-wrap: break-word 53 | font-size: $code-font-size 54 | 55 | pre 56 | @extend $code-block 57 | 58 | code 59 | padding: 0 60 | background: none 61 | color: $highlight-foreground 62 | text-shadow: none 63 | 64 | .highlight 65 | @extend $code-block 66 | position: relative 67 | border-radius: 1px 68 | 69 | &:after 70 | position: absolute 71 | top: 0 72 | z-index: 0 73 | min-width: 100% 74 | height: 1.4rem 75 | background: darken($highlight-background, 5) 76 | content: "" 77 | 78 | pre 79 | margin: 0 80 | padding: 8px 0 81 | border: none 82 | 83 | .line 84 | &::selection 85 | background: $highlight-selection 86 | color: $highlight-foreground 87 | 88 | if wordWrap 89 | &:before 90 | display: inline-block 91 | padding: 0 0.3rem 0 0 92 | min-width: 1.6rem 93 | color: $highlight-gutter.color 94 | content: counter(line) 95 | counter-increment: line 96 | text-align: left 97 | 98 | table 99 | position: relative 100 | margin: 0 101 | width: auto 102 | border: none 103 | 104 | &:after 105 | position: absolute 106 | top: -1.4rem 107 | z-index: 0 108 | width: 100% 109 | height: 1.4rem 110 | background: darken($highlight-background, 5) 111 | content: "" 112 | 113 | td 114 | padding: 0 115 | border: none 116 | 117 | figcaption 118 | clearfix() 119 | position: absolute 120 | z-index: 1 121 | margin-bottom: 1em 122 | padding: 0.2em 0 0.2em 0.7rem 123 | width: 100% 124 | height: 1.4em 125 | color: $highlight-foreground 126 | font-size: 1em 127 | line-height: 1em 128 | 129 | span 130 | float: left 131 | overflow: hidden 132 | max-width: 100% 133 | text-overflow: ellipsis 134 | white-space: nowrap 135 | 136 | a 137 | float: right 138 | padding-right: 10px 139 | color: $highlight-foreground 140 | 141 | &:hover 142 | border-bottom-color: $highlight-foreground 143 | 144 | &+table 145 | margin-top: 1em 146 | 147 | &:before 148 | margin-top: -2.1rem 149 | 150 | &:after 151 | top: -2.1rem 152 | 153 | .gutter pre 154 | padding-right: 0.5rem 155 | padding-left: 0.5rem 156 | background-color: $highlight-gutter.bg-color 157 | color: $highlight-gutter.color 158 | text-align: right 159 | 160 | .code pre 161 | padding-right: 0.5rem 162 | padding-left: 0.5rem 163 | width: 100% 164 | background-color: $highlight-background 165 | 166 | .line 167 | height: 1rem 168 | 169 | .gutter 170 | user-select: none 171 | -webkit-user-select: none 172 | -moz-user-select: none 173 | -ms-user-select: none 174 | 175 | .gist table 176 | width: auto 177 | 178 | td 179 | border: none 180 | 181 | // For diff highlight 182 | pre .deletion 183 | background: $highlight-deletion 184 | 185 | pre .addition 186 | background: $highlight-addition 187 | 188 | pre .meta 189 | color: $highlight-purple 190 | 191 | pre 192 | .comment 193 | color: $highlight-comment 194 | 195 | &::selection 196 | background: $highlight-selection 197 | color: $highlight-foreground 198 | 199 | .variable, 200 | .attribute, 201 | .regexp, 202 | .ruby .constant, 203 | .xml .tag .title, 204 | .xml .pi, 205 | .xml .doctype, 206 | .html .doctype, 207 | .css .id, 208 | .tag .name, 209 | .css .class, 210 | .css .pseudo 211 | color: $highlight-red 212 | 213 | &::selection 214 | background: $highlight-selection 215 | color: $highlight-foreground 216 | 217 | .tag 218 | color: $highlight-aqua 219 | 220 | &::selection 221 | background: $highlight-selection 222 | color: $highlight-foreground 223 | 224 | .number, 225 | .preprocessor, 226 | .literal, 227 | .params, 228 | .constant, 229 | .command 230 | color: $highlight-orange 231 | 232 | &::selection 233 | background: $highlight-selection 234 | color: $highlight-foreground 235 | 236 | .built_in 237 | color: $highlight-yellow 238 | 239 | &::selection 240 | background: $highlight-selection 241 | color: $highlight-foreground 242 | 243 | .ruby .class .title, 244 | .css .rules .attribute, 245 | .string, 246 | .value, 247 | .inheritance, 248 | .header, 249 | .ruby .symbol, 250 | .xml .cdata, 251 | .special, 252 | .number, 253 | .formula 254 | color: $highlight-green 255 | 256 | &::selection 257 | background: $highlight-selection 258 | color: $highlight-foreground 259 | 260 | .keyword, 261 | .title, 262 | .css .hexcolor 263 | color: $highlight-aqua 264 | 265 | &::selection 266 | background: $highlight-selection 267 | color: $highlight-foreground 268 | 269 | .function, 270 | .python .decorator, 271 | .python .title, 272 | .ruby .function .title, 273 | .ruby .title .keyword, 274 | .perl .sub, 275 | .javascript .title, 276 | .coffeescript .title 277 | color: $highlight-blue 278 | 279 | &::selection 280 | background: $highlight-selection 281 | color: $highlight-foreground 282 | 283 | .tag .attr, 284 | .javascript .function 285 | color: $highlight-purple 286 | 287 | &::selection 288 | background: $highlight-selection 289 | color: $highlight-foreground 290 | -------------------------------------------------------------------------------- /source/css/_highlight/theme.styl: -------------------------------------------------------------------------------- 1 | $highlight_theme = hexo-config("highlight_theme") 2 | 3 | if $highlight_theme == "default" 4 | $highlight-background = #263238 5 | $highlight-current-line = #efefef 6 | $highlight-selection = #80CBC420 7 | $highlight-foreground = #EEFFFF 8 | $highlight-comment = #546E7A 9 | $highlight-red = #FF5370 10 | $highlight-orange = #F78C6C 11 | $highlight-yellow = #FFCB6B 12 | $highlight-green = #C3E88D 13 | $highlight-aqua = #89DDFF 14 | $highlight-blue = #82AAFF 15 | $highlight-purple = #C792EA 16 | $highlight-gutter = { 17 | color: #37474F, 18 | bg-color: $highlight-background 19 | } 20 | 21 | if $highlight_theme == "darker" 22 | $highlight-background = #212121 23 | $highlight-current-line = #282a2e 24 | $highlight-selection = #61616150 25 | $highlight-foreground = #EEFFFF 26 | $highlight-comment = #4A4A4A 27 | $highlight-red = #FF5370 28 | $highlight-orange = #F78C6C 29 | $highlight-yellow = #FFCB6B 30 | $highlight-green = #C3E88D 31 | $highlight-aqua = #89DDFF 32 | $highlight-blue = #82AAFF 33 | $highlight-purple = #C792EA 34 | $highlight-gutter = { 35 | color: #424242, 36 | bg-color: $highlight-background 37 | } 38 | 39 | if $highlight_theme == "pale night" 40 | $highlight-background = #292D3E 41 | $highlight-current-line = #393939 42 | $highlight-selection = #717CB450 43 | $highlight-foreground = #A6ACCD 44 | $highlight-comment = #676E95 45 | $highlight-red = #FF5370 46 | $highlight-orange = #F78C6C 47 | $highlight-yellow = #FFCB6B 48 | $highlight-green = #C3E88D 49 | $highlight-aqua = #89DDFF 50 | $highlight-blue = #82AAFF 51 | $highlight-purple = #C792EA 52 | $highlight-gutter = { 53 | color: #3A3F58, 54 | bg-color: $highlight-background 55 | } 56 | 57 | if $highlight_theme == "ocean" 58 | $highlight-background = #0F111A 59 | $highlight-current-line = #000000 60 | $highlight-selection = #717CB450 61 | $highlight-foreground = #8F93A2 62 | $highlight-comment = #464B5D 63 | $highlight-red = #FF5370 64 | $highlight-orange = #F78C6C 65 | $highlight-yellow = #FFCB6B 66 | $highlight-green = #C3E88D 67 | $highlight-aqua = #89DDFF 68 | $highlight-blue = #82AAFF 69 | $highlight-purple = #C792EA 70 | $highlight-gutter = { 71 | color: #3B3F5180, 72 | bg-color: $highlight-background 73 | } 74 | 75 | if $highlight_theme == "light" 76 | $highlight-background = #F6F8FA 77 | $highlight-current-line = #00346e 78 | $highlight-selection = #80CBC440 79 | $highlight-foreground = #90A4AE 80 | $highlight-comment = #90A4AE90 81 | $highlight-red = #E53935 82 | $highlight-orange = #F76D47 83 | $highlight-yellow = #FFB62C 84 | $highlight-green = #91B859 85 | $highlight-aqua = #39ADB5 86 | $highlight-blue = #6182B8 87 | $highlight-purple = #7C4DFF 88 | $highlight-gutter = { 89 | color: #CFD8DC, 90 | bg-color: $highlight-background 91 | } 92 | -------------------------------------------------------------------------------- /source/css/_layout/comments.styl: -------------------------------------------------------------------------------- 1 | #disqus_thread 2 | margin-top: 1rem -------------------------------------------------------------------------------- /source/css/_layout/footer.styl: -------------------------------------------------------------------------------- 1 | footer 2 | $bg-svg += "" 3 | margin-top: 1rem 4 | background: $light-blue 5 | background-image: url($bg-svg) 6 | background-attachment: fixed 7 | 8 | &.footer-bg 9 | background-position: bottom 10 | background-size: cover 11 | 12 | &.is-mobile 13 | background-attachment: local 14 | 15 | #footer 16 | padding: 2rem 1rem 17 | color: $theme-footer-text-color 18 | text-align: center 19 | 20 | a 21 | color: $theme-footer-text-color 22 | text-decoration: none 23 | cursor: pointer 24 | 25 | &:hover 26 | color: $white 27 | 28 | .footer-separator 29 | margin: 0 0.2rem 30 | 31 | #busuanzi 32 | &_value 33 | &_site_uv, 34 | &_site_pv, 35 | &_page_pv 36 | margin-left: 0.2rem -------------------------------------------------------------------------------- /source/css/_layout/head.styl: -------------------------------------------------------------------------------- 1 | #nav 2 | position: relative 3 | margin-bottom: 1rem 4 | background-color: $light-blue 5 | background-attachment: fixed 6 | background-position: center 7 | background-size: cover 8 | 9 | &.no-bg 10 | $bg-svg += "" 11 | background-image: url($bg-svg) !important 12 | background-size: initial 13 | 14 | &.is-mobile 15 | background-attachment: local 16 | 17 | #site-info 18 | display: flex 19 | flex-direction: column 20 | justify-content: center 21 | align-items: center 22 | padding: 0 1rem 23 | height: unit($top_img_height, "vh") 24 | 25 | #site-title, 26 | #site-sub-title 27 | color: $theme-header-text-color 28 | text-align: center 29 | text-shadow: $light-shadow 30 | line-height: 1.5 31 | 32 | #site-title 33 | font-weight: bold 34 | font-size: 1.3rem 35 | 36 | #site-sub-title 37 | font-size: 0.8rem 38 | 39 | #site-social-icons 40 | margin: 0 auto 41 | width: 15rem 42 | text-align: center 43 | 44 | .social-icon 45 | margin: 0 0.5rem 46 | color: $theme-header-text-color 47 | text-shadow: $light-shadow 48 | font-size: 1.4rem 49 | cursor: pointer 50 | 51 | &:hover 52 | color: $white 53 | 54 | #page-header 55 | position: absolute 56 | top: 0 57 | z-index: 99 58 | padding: 10px 36px 59 | width: 100% 60 | border: none 61 | font-size: 18px 62 | transition: all 0.2s ease-in-out 63 | 64 | .toggle-menu 65 | display: none 66 | padding-top: 0.5rem 67 | color: $theme-header-text-color 68 | cursor: pointer 69 | transition: all 0.2s ease-in-out 70 | 71 | &:hover 72 | color: $white 73 | 74 | a 75 | color: $theme-header-text-color 76 | text-decoration: none 77 | 78 | &:hover 79 | color: $white 80 | 81 | .site-page 82 | position: relative 83 | margin-left: 0.6rem 84 | padding-bottom: 0.3rem 85 | text-shadow: $dark-shadow 86 | font-size: 0.7rem 87 | cursor: pointer 88 | 89 | &::after 90 | position: absolute 91 | bottom: 0 92 | left: 0 93 | z-index: -1 94 | width: 0 95 | height: 3px 96 | background-color: lighten($theme-color, 30%) 97 | content: "" 98 | transition: all 0.3s ease-in-out 99 | 100 | &:hover 101 | &::after 102 | width: 100% 103 | 104 | &.fixed 105 | position: fixed 106 | top: -56px 107 | z-index: 101 108 | background: alpha($white, 0.8) 109 | box-shadow: 0 5px 6px -5px alpha($grey, 0.6) 110 | transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out 111 | 112 | &.open-sidebar 113 | .site-page 114 | display: none 115 | opacity: 0 116 | 117 | a, 118 | .toggle-menu, 119 | #site-name 120 | color: $light-black 121 | text-shadow: none 122 | 123 | &:hover 124 | color: $light-blue 125 | 126 | &.visible 127 | transform: translate3d(0, 100%, 0) 128 | 129 | #site-name 130 | text-shadow: $light-shadow 131 | font-weight: bold 132 | cursor: pointer 133 | 134 | @media screen and (min-width: $sm) 135 | #site-title 136 | font-size: 2rem 137 | 138 | #site-sub-title 139 | font-size: 1.2rem 140 | 141 | @media screen and (max-width: $sm) 142 | #nav, 143 | #top-contianer 144 | background-attachment: local 145 | 146 | #page-header 147 | padding: 10px 0.8rem 148 | 149 | .toggle-menu 150 | display: block 151 | 152 | .menus 153 | position: absolute 154 | top: 3rem 155 | right: 0.8rem 156 | display: none 157 | width: 8rem 158 | background: alpha($white, 0.9) 159 | box-shadow: 0 0 4px rgba(0, 0, 0, 0.27) 160 | 161 | a 162 | display: block 163 | margin-left: 0 164 | padding-top: 0.3rem 165 | padding-bottom: 0.3rem 166 | padding-left: 0.6rem 167 | color: $font-black 168 | text-shadow: none 169 | font-size: 0.8rem 170 | 171 | &:hover 172 | color: $light-blue 173 | 174 | .search 175 | right: 0.5rem 176 | 177 | span 178 | display: none 179 | -------------------------------------------------------------------------------- /source/css/_layout/page.styl: -------------------------------------------------------------------------------- 1 | galleryItemStyle(w, h) 2 | .gallery 3 | &-item 4 | width: w 5 | height: unit(h, "rem") 6 | 7 | &__title 8 | transform: translate3d(0, unit(h, "rem"), 0) 9 | 10 | &:hover 11 | .gallery-item__title 12 | transform: translate3d(0, unit(h - 1.5, "rem"), 0) 13 | 14 | .recent-post-item 15 | margin: 1.6rem 0 2rem 16 | 17 | .content 18 | margin-top: 0.5rem 19 | word-break: break-word 20 | 21 | p 22 | word-break: break-word 23 | 24 | iframe 25 | width: $content-width 26 | height: $iframe-height 27 | 28 | .article-type 29 | margin-left: 0.3rem 30 | color: $grey 31 | 32 | .article-meta 33 | color: $grey 34 | 35 | .sticky 36 | color: $theme-button-hover-color 37 | 38 | i 39 | margin: 0 0.2rem 0 0.3rem 40 | 41 | &__separator 42 | margin-left: 0.3rem 43 | 44 | .fa-angle-right, 45 | &__link 46 | margin: 0 0 0 0.3rem 47 | 48 | time 49 | color: $grey 50 | 51 | .more 52 | display: inline-block 53 | padding: 0 0.6rem 54 | height: h = 1.6rem 55 | background: $light-blue 56 | color: $white 57 | text-align: center 58 | text-decoration: none 59 | line-height: h 60 | cursor: pointer 61 | transition: all 0.2s ease-in-out 62 | 63 | &:hover 64 | background: $ruby 65 | 66 | .article-title 67 | display: block 68 | margin-bottom: 0.3rem 69 | border-bottom: 1px solid $light-grey 70 | color: $black 71 | text-decoration: none 72 | font-size: 1.4rem 73 | cursor: pointer 74 | cursor: pointer 75 | transition: all 0.2s ease-in-out 76 | 77 | &:hover 78 | border-bottom: 1px solid $light-blue 79 | color: $light-blue 80 | 81 | .tag-cloud 82 | padding: 4.5rem 0 7rem 83 | text-align: center 84 | 85 | a 86 | display: inline-block 87 | margin: 0 0.4rem 88 | text-decoration: none 89 | cursor: pointer 90 | 91 | &:hover 92 | color: $ruby !important 93 | 94 | &__title 95 | font-size: 1.8rem 96 | 97 | #tag, 98 | #category, 99 | #archive 100 | padding: 3rem 0 3rem 101 | 102 | .article-sort 103 | padding-left: 1rem 104 | border-left: 0.1rem solid $pale-blue 105 | 106 | &-title 107 | position: relative 108 | padding-bottom: 1.2rem 109 | padding-left: 1rem 110 | font-size: 1.2rem 111 | line-height: 1 112 | 113 | &:hover 114 | &:before 115 | border-color: $ruby 116 | 117 | &:before 118 | position: absolute 119 | top: 0.25rem 120 | left: calc(-0.5rem + 1px) 121 | z-index: 1 122 | width: w = 0.5rem 123 | height: h = w 124 | border: 0.5 * w solid $light-blue 125 | border-radius: w 126 | background: $white 127 | content: "" 128 | line-height: h 129 | transition: all 0.2s ease-in-out 130 | 131 | &:after 132 | position: absolute 133 | bottom: 0 134 | left: 0 135 | z-index: 0 136 | width: 0.1rem 137 | height: 1.3rem 138 | background: $pale-blue 139 | content: "" 140 | 141 | &-item 142 | position: relative 143 | margin-bottom: 1rem 144 | transition: all 0.2s ease-in-out 145 | 146 | &:hover 147 | &:before 148 | border-color: $ruby 149 | 150 | &:before 151 | $w = 0.3rem 152 | position: absolute 153 | top: 0.48rem 154 | left: calc(-1rem - 7px) 155 | width: w = $w 156 | height: h = w 157 | border: 0.5 * w solid $light-blue 158 | border-radius: w 159 | background: $white 160 | content: "" 161 | line-height: h 162 | transition: all 0.2s ease-in-out 163 | 164 | &.year 165 | font-size: 1rem 166 | 167 | &:hover 168 | &:before 169 | border-color: $light-blue 170 | 171 | &:before 172 | top: 0.7rem 173 | border-color: $ruby 174 | 175 | &__time 176 | position: absolute 177 | top: 0.1rem 178 | color: $a-link-color 179 | 180 | &__title 181 | display: block 182 | margin-left: 5rem 183 | color: $font-black 184 | text-decoration: none 185 | font-size: 0.8rem 186 | cursor: pointer 187 | 188 | .category-lists 189 | padding: 3rem 0 3rem 190 | 191 | .category__title 192 | text-align: center 193 | font-size: 1.8rem 194 | 195 | .category-list 196 | a 197 | color: $font-black 198 | text-decoration: none 199 | cursor: pointer 200 | 201 | .category-list-count 202 | margin-left: 0.4rem 203 | color: $a-link-color 204 | 205 | &:before 206 | content: "(" 207 | 208 | &:after 209 | content: ")" 210 | 211 | .gallery 212 | &-item 213 | position: relative 214 | display: inline-block 215 | overflow: hidden 216 | margin: 0.4rem 217 | width: 6rem 218 | height: 6rem 219 | background-position: 50% 50% 220 | background-size: cover 221 | background-repeat: no-repeat 222 | cursor: pointer 223 | transition: all 0.2s ease-in-out 224 | 225 | &__title 226 | position: absolute 227 | overflow: hidden 228 | padding: 0 0.4rem 229 | width: 100% 230 | height: 1.5rem 231 | background: rgba(0, 0, 0, 0.5) 232 | color: $pale-blue 233 | text-align: center 234 | text-overflow: ellipsis 235 | white-space: nowrap 236 | line-height: 1.5rem 237 | transition: 0.2s ease-in-out 238 | transform: translate3d(0, 6rem, 0) 239 | 240 | &:hover 241 | .gallery-item__title 242 | transform: translate3d(0, 4.5rem, 0) 243 | 244 | @media screen and (max-width: $sm) 245 | .recent-post-item 246 | .article-title 247 | font-size: 1rem 248 | 249 | .article-meta.tags 250 | display: none 251 | 252 | galleryItemStyle(calc(50% - 22px), 6) 253 | 254 | @media screen and (min-width: $md) 255 | galleryItemStyle(8rem, 8) -------------------------------------------------------------------------------- /source/css/_layout/pagination.styl: -------------------------------------------------------------------------------- 1 | #pagination 2 | overflow: hidden 3 | margin-top: 1rem 4 | width: 100% 5 | 6 | .pagination 7 | text-align: center 8 | 9 | i.fa.fa-chevron-left 10 | margin-right: 0.3rem 11 | cursor: pointer 12 | 13 | i.fa.fa-chevron-right 14 | margin-left: 0.3rem 15 | cursor: pointer 16 | 17 | .space 18 | color: $a-link-color 19 | 20 | .page-number 21 | display: inline-block 22 | margin: 0 0.2rem 23 | min-width: w = 1.2rem 24 | height: w 25 | text-align: center 26 | line-height: w 27 | cursor: pointer 28 | 29 | &.current 30 | background: $cyan 31 | color: $white 32 | cursor: default -------------------------------------------------------------------------------- /source/css/_layout/post.styl: -------------------------------------------------------------------------------- 1 | headStyle(fontsize) 2 | padding-left: unit(fontsize + 0.1, "rem") 3 | 4 | code 5 | font-size: unit(fontsize, "rem") 6 | 7 | &:before 8 | top: calc(50% - unit(fontsize / 2 - 0.05, "rem")) 9 | font-size: unit(fontsize, "rem") 10 | 11 | &:hover 12 | padding-left: unit(fontsize + 0.2, "rem") 13 | 14 | #post-title 15 | font-size: 1.4rem 16 | 17 | &.plain 18 | margin-bottom: 0.3rem 19 | border-bottom: 1px solid $light-grey 20 | cursor: pointer 21 | transition: all 0.2s ease-in-out 22 | 23 | &:hover 24 | border-bottom: 1px solid $light-blue 25 | color: $light-blue 26 | 27 | #post 28 | overflow: hidden 29 | 30 | &-meta 31 | text-shadow: $light-shadow 32 | 33 | #post-meta 34 | color: $grey 35 | 36 | a 37 | text-decoration: none 38 | 39 | i.fa.fa-comment-o 40 | margin-right: 0.2rem 41 | 42 | #top-container 43 | position: relative 44 | margin-bottom: 1rem 45 | background-color: $light-blue 46 | background-attachment: fixed 47 | background-position: center 48 | background-size: cover 49 | opacity: 0 50 | 51 | &.no-bg 52 | $bg-svg += "" 53 | background-color: $light-blue 54 | background-image: url($bg-svg) !important 55 | background-size: auto 56 | 57 | &.plain 58 | margin-bottom: 1rem 59 | height: 56px 60 | 61 | a 62 | color: $theme-header-text-color 63 | text-decoration: none 64 | transition: all 0.3s ease-out 65 | 66 | &:hover 67 | color: $white 68 | 69 | #top-img 70 | padding: 0 71 | border: none 72 | 73 | #site-name 74 | font-weight: bold 75 | cursor: pointer 76 | 77 | #post-info 78 | display: flex 79 | flex-direction: column 80 | justify-content: center 81 | align-items: center 82 | padding: 0 1rem 83 | width: 100% 84 | height: unit($top_img_height, "vh") 85 | color: $theme-header-text-color 86 | text-align: center 87 | 88 | #post-title 89 | text-shadow: $light-shadow 90 | font-size: 1.3rem 91 | 92 | i.fa.fa-angle-right 93 | margin: 0 0.3rem 0 0.2rem 94 | 95 | .post-meta 96 | &__separator 97 | margin: 0 0.3rem 98 | 99 | &__icon 100 | margin-right: 0.2rem 101 | 102 | &__tag-list 103 | margin-bottom: 0.5rem 104 | 105 | &__tags 106 | display: inline-block 107 | margin: 0 0.4rem 0.2rem 0 108 | padding: 0 0.6rem 109 | width: fit-content 110 | border: 1px solid $light-blue 111 | border-radius: 0.6rem 112 | background: $white 113 | color: $light-blue 114 | text-decoration: none 115 | font-size: 12px 116 | cursor: pointer 117 | transition: all 0.2s ease-in-out 118 | 119 | &:hover 120 | background: $light-blue 121 | color: $white 122 | 123 | .layout 124 | margin: 0 auto 125 | width: $content-width 126 | opacity: 0 127 | 128 | #content-inner 129 | h1, 130 | h2, 131 | h3, 132 | h4, 133 | h5, 134 | h6 135 | cursor: pointer 136 | transition: all 0.2s ease-out 137 | 138 | &:before 139 | position: absolute 140 | top: calc(50% - 0.35rem) 141 | left: 0 142 | color: $light-red 143 | content: "\f0c1" 144 | font: normal normal normal 14px / 1 FontAwesome 145 | font-size: 0.8rem 146 | transition: all 0.2s ease-out 147 | 148 | &:hover 149 | padding-left: 1.1rem 150 | 151 | &:before 152 | color: $light-blue 153 | 154 | h1 155 | headStyle(1) 156 | 157 | h2 158 | headStyle(0.9) 159 | 160 | h3 161 | headStyle(0.8) 162 | 163 | h4 164 | headStyle(0.7) 165 | 166 | h5 167 | headStyle(0.6) 168 | 169 | h6 170 | headStyle(0.6) 171 | 172 | ol, 173 | ul 174 | margin-top: 0.4rem 175 | padding: 0 0 0 0.8rem 176 | list-style: none 177 | counter-reset: li 178 | 179 | p 180 | margin: 0 181 | 182 | ol, 183 | ul 184 | padding-left: 0.5rem 185 | 186 | li 187 | position: relative 188 | margin: 0.2rem 0 189 | padding: 0.1rem 0.5rem 0.1rem 1.5rem 190 | 191 | &:hover 192 | &:before 193 | transform: rotate(360deg) 194 | 195 | &:before 196 | position: absolute 197 | top: 0 198 | left: 0 199 | background: $light-blue 200 | color: $white 201 | cursor: pointer 202 | transition: all 0.3s ease-out 203 | 204 | ol 205 | > li 206 | &:before 207 | margin-top: 0.2rem 208 | width: w = 1.2rem 209 | height: h = w 210 | border-radius: 0.5 * w 211 | content: counter(li) 212 | counter-increment: li 213 | text-align: center 214 | font-size: 0.6rem 215 | line-height: h 216 | 217 | ul 218 | > li 219 | &:hover 220 | &:before 221 | border-color: $ruby 222 | 223 | &:before 224 | $w = 0.3rem 225 | top: 10px 226 | margin-left: 0.45rem 227 | width: w = $w 228 | height: h = w 229 | border: 0.5 * w solid $light-blue 230 | border-radius: w 231 | background: $white 232 | content: "" 233 | line-height: h 234 | 235 | #post-content 236 | margin-bottom: 1rem 237 | 238 | a 239 | color: $a-link-color 240 | transition: all 0.2s 241 | 242 | &:hover 243 | color: $light-blue 244 | text-decoration: none 245 | 246 | &#site-name 247 | color: $theme-header-text-color 248 | text-decoration: none 249 | 250 | a.fancybox 251 | outline: none 252 | 253 | &:focus 254 | outline: none 255 | 256 | display: inline-block 257 | width: 100% 258 | text-align: center 259 | text-decoration: none 260 | 261 | .content, #post, #sidebar 262 | img 263 | padding: $img-border-padding 264 | max-width: 100% 265 | border: 1px solid $img-border-color 266 | transition: all 0.2s 267 | 268 | &:hover 269 | box-shadow: 0 0 8px 0 rgba(232, 237, 250, 0.6), 0 2px 4px 0 rgba(232, 237, 250, 0.5) 270 | 271 | .code-area-wrap 272 | position: relative 273 | 274 | .codeblock-language 275 | position: absolute 276 | z-index: 1 277 | display: inline-block 278 | padding: 0 0.7rem 279 | color: $highlight-foreground 280 | font-weight: bold 281 | font-size: 0.8rem 282 | line-height: 1.4rem 283 | 284 | .fa-clipboard 285 | position: absolute 286 | top: 0.4rem 287 | right: 10px 288 | z-index: 1 289 | color: $highlight-aqua 290 | cursor: pointer 291 | transition: color 0.2s 292 | 293 | &:hover 294 | color: darken($highlight-aqua, 20%) 295 | 296 | .copy-notice 297 | position: absolute 298 | top: 0 299 | right: 0 300 | z-index: 1 301 | background: darken($highlight-background, 5) 302 | color: $highlight-aqua 303 | opacity: 0 304 | 305 | .post-copyright 306 | position: relative 307 | margin-bottom: 1rem 308 | padding: 0.5rem 0.8rem 309 | border: 1px solid $light-grey 310 | transition: box-shadow 0.3s ease-in-out 311 | 312 | &:before 313 | position: absolute 314 | top: t = 0.5rem 315 | right: t 316 | width: w = 0.8rem 317 | height: w 318 | border-radius: w 319 | background: $light-blue 320 | content: "" 321 | 322 | &:after 323 | position: absolute 324 | top: t = 0.7rem 325 | right: t 326 | width: w = 0.4rem 327 | height: w 328 | border-radius: w 329 | background: $white 330 | content: "" 331 | 332 | &:hover 333 | box-shadow: 0 0 8px 0 rgba(232, 237, 250, 0.6), 0 2px 4px 0 rgba(232, 237, 250, 0.5) 334 | 335 | &-meta 336 | color: $light-blue 337 | font-weight: bold 338 | 339 | &-info 340 | a 341 | word-break: break-word 342 | 343 | .post-qr-code 344 | text-align: center 345 | 346 | &-item 347 | display: inline-block 348 | margin-bottom: 0.8rem 349 | 350 | img 351 | margin: 0 1rem 0.1rem 1rem 352 | width: w = 10rem 353 | height: w 354 | 355 | &__desc 356 | color: $grey 357 | 358 | .post-adv 359 | margin: 1rem 0 360 | 361 | @media screen and (max-width: $sm) 362 | .layout 363 | margin: 0 30px 364 | width: auto 365 | 366 | .recent-post-item 367 | .content 368 | iframe 369 | width: 100% 370 | height: 177px 371 | 372 | .post-qr-code 373 | img 374 | width: w = 6rem 375 | height: w 376 | 377 | #top-container 378 | background-attachment: local 379 | 380 | #post-title 381 | color: $theme-header-text-color 382 | font-size: 1.1rem 383 | 384 | #post-title 385 | color: $theme-header-text-color 386 | font-size: 1.1rem 387 | 388 | @media screen and (min-width: $sm) 389 | #top-container 390 | #post-title 391 | font-size: 2rem 392 | 393 | @media screen and (min-width: $md) 394 | .layout 395 | width: $content-large-width 396 | 397 | .recent-post-item 398 | .content 399 | iframe 400 | width: $content-large-width 401 | height: $iframe-large-height 402 | 403 | .katex-wrap 404 | overflow: auto 405 | 406 | if hexo-config("katex") && hexo-config("katex.hide_scrollbar") 407 | &::-webkit-scrollbar 408 | display: none 409 | -------------------------------------------------------------------------------- /source/css/_layout/sidebar.styl: -------------------------------------------------------------------------------- 1 | #sidebar 2 | position: fixed 3 | top: 0 4 | left: -300px 5 | z-index: 10 6 | overflow-y: auto 7 | padding: 1rem 0 2rem 0.5rem 8 | width: $sidebar-width 9 | height: 100% 10 | background: $sidebar-background 11 | box-shadow: -0.25rem 0 0.25rem rgba(232, 237, 250, 0.6) inset 12 | 13 | hr 14 | margin: 1rem 0 15 | width: calc(100% - 0.25rem) 16 | 17 | .toggle-sidebar-info 18 | padding-right: 0.5rem 19 | 20 | span 21 | display: inline-block 22 | padding: 0 0.6rem 23 | height: h = 1.6rem 24 | background: $light-blue 25 | color: $white 26 | line-height: h 27 | cursor: pointer 28 | transition: all 0.2s ease-in-out 29 | 30 | &:hover 31 | background: $cyan 32 | 33 | .author-info 34 | margin-left: -0.25rem 35 | padding: 0.5rem 36 | width: 100% 37 | 38 | .follow-button 39 | text-align: center 40 | 41 | a 42 | display: inline-block 43 | margin-top: 0.2rem 44 | padding: 0 1rem 45 | height: 1.6rem 46 | background: $theme-color 47 | color: #fff 48 | text-decoration: none 49 | line-height: 1.6rem 50 | 51 | &:hover 52 | background: $theme-button-hover-color 53 | 54 | &.hide 55 | display: none 56 | 57 | &__avatar 58 | margin: 0 auto 59 | width: w = 5rem 60 | height: w 61 | 62 | &__name 63 | font-size: 0.8rem 64 | 65 | &__description 66 | color: $a-link-color 67 | 68 | &-articles 69 | padding: 0.2rem 0 70 | 71 | .article-meta 72 | display: block 73 | overflow: hidden 74 | margin-bottom: 0.4rem 75 | padding: 0.2rem 0.4rem 76 | height: 1.8rem 77 | background: $light-blue 78 | color: $white 79 | transition: all 0.2s ease-in-out 80 | 81 | .pull-right 82 | position: relative 83 | margin: -0.2rem -0.4rem 84 | width: 2.5rem 85 | height: 1.8rem 86 | background: $white 87 | color: $light-blue 88 | text-align: center 89 | line-height: 1.8rem 90 | transition: all 0.2s ease-in-out 91 | 92 | &:before 93 | position: absolute 94 | top: 0 95 | left: -0.8rem 96 | width: 0 97 | height: 0 98 | border-top: 0.9rem solid transparent 99 | border-right: 0.8rem solid $white 100 | border-bottom: 0.9rem solid transparent 101 | content: "" 102 | 103 | &:hover 104 | background: lighten($cyan, 8%) 105 | 106 | .pull-right 107 | color: $cyan 108 | 109 | &-links 110 | &__title 111 | margin-bottom: 0.4rem 112 | font-size: 0.8rem 113 | 114 | &__name 115 | position: relative 116 | float: left 117 | margin-right: 0.3rem 118 | margin-bottom: 0.3rem 119 | padding: 0 0.4rem 0 0.8rem 120 | height: 1.3rem 121 | background: $light-blue 122 | color: $white 123 | text-decoration: none 124 | line-height: 1.3rem 125 | transition: all 0.2s ease-in-out 126 | 127 | &:hover 128 | background: $ruby 129 | 130 | &:before 131 | position: absolute 132 | top: 50% 133 | left: 0.25rem 134 | margin-top: -0.15rem 135 | width: w = 0.3rem 136 | height: w 137 | border-radius: w 138 | background: $white 139 | content: "" 140 | 141 | .sidebar-toc 142 | ol, 143 | li 144 | list-style: none 145 | 146 | ol 147 | margin-top: 0.2rem 148 | padding-left: 0.4rem 149 | 150 | &__title 151 | padding-right: 0.5rem 152 | text-align: center 153 | font-size: unit(0.9 * $rem, "px") 154 | 155 | .toc-link 156 | display: block 157 | padding-left: 0.2rem 158 | border-right: 3px solid transparent 159 | text-decoration: none 160 | transition: all 0.2s ease-in-out 161 | 162 | &.active 163 | border-right-color: darken($cyan, 20%) 164 | background: $cyan 165 | color: $white 166 | 167 | &__progress 168 | position: relative 169 | margin-top: -0.3rem 170 | padding-left: 0.6rem 171 | color: $cyan 172 | 173 | .progress-notice 174 | margin-right: 0.4rem 175 | 176 | .progress-num 177 | display: inline-block 178 | min-width: 0.9rem 179 | 180 | &-bar 181 | width: 0 182 | height: 1px 183 | background: $cyan 184 | -------------------------------------------------------------------------------- /source/css/_search/algolia.styl: -------------------------------------------------------------------------------- 1 | #algolia-search 2 | .ais-search-box 3 | margin: 0 auto 4 | max-width: 100% 5 | width: 100% 6 | 7 | input 8 | padding: 0.25rem 0.7rem 9 | outline: none 10 | border: 2px solid $light-blue 11 | border-radius: 2rem 12 | font-size: 14px 13 | 14 | .ais-hits--item.algolia-hit-item 15 | position: relative 16 | padding-left: 1.5rem 17 | 18 | &:hover 19 | &:before 20 | border-color: $ruby 21 | 22 | &:before 23 | $w = 0.3rem 24 | position: absolute 25 | top: 0.4rem 26 | left: 0 27 | width: w = $w 28 | height: h = w 29 | border: 0.5 * w solid $light-blue 30 | border-radius: w 31 | background: $white 32 | content: "" 33 | line-height: h 34 | transition: all 0.2s ease-in-out 35 | 36 | a 37 | display: block 38 | color: $font-black 39 | text-decoration: none 40 | font-size: 14px 41 | cursor: pointer 42 | 43 | &:hover 44 | color: $light-blue 45 | 46 | .ais-pagination.pagination 47 | margin: 0.8rem 0 0 0 48 | padding: 0 49 | text-align: center 50 | 51 | .ais-pagination--item 52 | margin: 0 0.2rem 53 | padding: 0 54 | 55 | a 56 | display: inline-block 57 | min-width: 1.2rem 58 | height: 1.2rem 59 | text-align: center 60 | line-height: 1.2rem 61 | 62 | .ais-pagination--item.current 63 | a 64 | background: $cyan 65 | color: $white 66 | text-decoration: none 67 | cursor: default 68 | 69 | .algolia-logo 70 | padding-top: 2px 71 | width: 4rem 72 | height: 1.5rem -------------------------------------------------------------------------------- /source/css/_search/index.styl: -------------------------------------------------------------------------------- 1 | .search-dialog 2 | position: fixed 3 | top: 5rem 4 | left: 50% 5 | z-index: 1001 6 | display: none 7 | margin-left: -15rem 8 | padding: 1rem 9 | width: 30rem 10 | background: $white 11 | 12 | hr 13 | margin: 1rem auto 14 | 15 | span.search-close-button 16 | position: absolute 17 | top: 0.5rem 18 | right: 0.5rem 19 | color: $grey 20 | line-height: 1 21 | cursor: pointer 22 | transition: color 0.2s ease-in-out 23 | 24 | &:hover 25 | color: $light-blue 26 | 27 | &__title 28 | padding: 0 0 0.7rem 29 | color: $light-blue 30 | font-size: 1rem 31 | line-height: 1 32 | 33 | .search-mask 34 | position: fixed 35 | top: 0 36 | right: 0 37 | bottom: 0 38 | left: 0 39 | z-index: 1000 40 | display: none 41 | background: rgba(0, 0, 0, 0.6) 42 | 43 | @media screen and (max-width: $sm) 44 | .search-dialog 45 | margin-left: -45% 46 | width: 90% 47 | -------------------------------------------------------------------------------- /source/css/_search/local-search.styl: -------------------------------------------------------------------------------- 1 | #local-search 2 | .local-search-box 3 | margin: 0 auto 4 | max-width: 100% 5 | width: 100% 6 | 7 | input 8 | padding: 0.25rem 0.7rem 9 | width: 100% 10 | outline: none 11 | border: 2px solid $light-blue 12 | border-radius: 2rem 13 | font-size: 14px 14 | 15 | .local-search__hit-item 16 | position: relative 17 | padding-left: 1.5rem 18 | 19 | &:hover 20 | &:before 21 | border-color: $ruby 22 | 23 | &:before 24 | $w = 0.3rem 25 | position: absolute 26 | top: 0.4rem 27 | left: 0 28 | width: w = $w 29 | height: h = w 30 | border: 0.5 * w solid $light-blue 31 | border-radius: w 32 | background: $white 33 | content: "" 34 | line-height: h 35 | transition: all 0.2s ease-in-out 36 | 37 | a 38 | display: block 39 | color: $font-black 40 | text-decoration: none 41 | font-size: 14px 42 | cursor: pointer 43 | 44 | &:hover 45 | color: $light-blue 46 | 47 | .local-search-stats__hr 48 | display: none 49 | 50 | .search-result-list 51 | overflow-y: auto 52 | max-height: 10.5rem -------------------------------------------------------------------------------- /source/css/_third-party/jquery.fancybox.min.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8";.fancybox-enabled{overflow:hidden}.fancybox-enabled body{overflow:visible;height:100%}.fancybox-is-hidden{position:absolute;top:-9999px;left:-9999px;visibility:hidden}.fancybox-container{position:fixed;top:0;left:0;width:100%;height:100%;z-index:99993;-webkit-tap-highlight-color:transparent;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-transform:translateZ(0);transform:translateZ(0)}.fancybox-container~.fancybox-container{z-index:99992}.fancybox-bg,.fancybox-inner,.fancybox-outer,.fancybox-stage{position:absolute;top:0;right:0;bottom:0;left:0}.fancybox-outer{overflow-y:auto;-webkit-overflow-scrolling:touch}.fancybox-bg{background:#1e1e1e;opacity:0;transition-duration:inherit;transition-property:opacity;transition-timing-function:cubic-bezier(.47,0,.74,.71)}.fancybox-is-open .fancybox-bg{opacity:.87;transition-timing-function:cubic-bezier(.22,.61,.36,1)}.fancybox-caption-wrap,.fancybox-infobar,.fancybox-toolbar{position:absolute;direction:ltr;z-index:99997;opacity:0;visibility:hidden;transition:opacity .25s,visibility 0s linear .25s;box-sizing:border-box}.fancybox-show-caption .fancybox-caption-wrap,.fancybox-show-infobar .fancybox-infobar,.fancybox-show-toolbar .fancybox-toolbar{opacity:1;visibility:visible;transition:opacity .25s,visibility 0s}.fancybox-infobar{top:0;left:50%;margin-left:-79px}.fancybox-infobar__body{display:inline-block;width:70px;line-height:44px;font-size:13px;font-family:Helvetica Neue,Helvetica,Arial,sans-serif;text-align:center;color:#ddd;background-color:rgba(30,30,30,.7);pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;-webkit-font-smoothing:subpixel-antialiased}.fancybox-toolbar{top:0;right:0}.fancybox-stage{overflow:hidden;direction:ltr;z-index:99994;-webkit-transform:translateZ(0)}.fancybox-slide{position:absolute;top:0;left:0;width:100%;height:100%;margin:0;padding:0;overflow:auto;outline:none;white-space:normal;box-sizing:border-box;text-align:center;z-index:99994;-webkit-overflow-scrolling:touch;display:none;-webkit-backface-visibility:hidden;backface-visibility:hidden;transition-property:opacity,-webkit-transform;transition-property:transform,opacity;transition-property:transform,opacity,-webkit-transform;-webkit-transform-style:preserve-3d;transform-style:preserve-3d}.fancybox-slide:before{content:"";display:inline-block;vertical-align:middle;height:100%;width:0}.fancybox-is-sliding .fancybox-slide,.fancybox-slide--current,.fancybox-slide--next,.fancybox-slide--previous{display:block}.fancybox-slide--image{overflow:visible}.fancybox-slide--image:before{display:none}.fancybox-slide--video .fancybox-content,.fancybox-slide--video iframe{background:#000}.fancybox-slide--map .fancybox-content,.fancybox-slide--map iframe{background:#e5e3df}.fancybox-slide--next{z-index:99995}.fancybox-slide>*{display:inline-block;position:relative;padding:24px;margin:44px 0;border-width:0;vertical-align:middle;text-align:left;background-color:#fff;overflow:auto;box-sizing:border-box}.fancybox-slide .fancybox-image-wrap{position:absolute;top:0;left:0;margin:0;padding:0;border:0;z-index:99995;background:transparent;cursor:default;overflow:visible;-webkit-transform-origin:top left;transform-origin:top left;background-size:100% 100%;background-repeat:no-repeat;-webkit-backface-visibility:hidden;backface-visibility:hidden}.fancybox-can-zoomOut .fancybox-image-wrap{cursor:zoom-out}.fancybox-can-zoomIn .fancybox-image-wrap{cursor:zoom-in}.fancybox-can-drag .fancybox-image-wrap{cursor:-webkit-grab;cursor:grab}.fancybox-is-dragging .fancybox-image-wrap{cursor:-webkit-grabbing;cursor:grabbing}.fancybox-image,.fancybox-spaceball{position:absolute;top:0;left:0;width:100%;height:100%;margin:0;padding:0;border:0;max-width:none;max-height:none}.fancybox-spaceball{z-index:1}.fancybox-slide--iframe .fancybox-content{padding:0;width:80%;height:80%;max-width:calc(100% - 100px);max-height:calc(100% - 88px);overflow:visible;background:#fff}.fancybox-iframe{display:block;padding:0;border:0;height:100%}.fancybox-error,.fancybox-iframe{margin:0;width:100%;background:#fff}.fancybox-error{padding:40px;max-width:380px;cursor:default}.fancybox-error p{margin:0;padding:0;color:#444;font:16px/20px Helvetica Neue,Helvetica,Arial,sans-serif}.fancybox-close-small{position:absolute;top:0;right:0;width:44px;height:44px;padding:0;margin:0;border:0;border-radius:0;outline:none;background:transparent;z-index:10;cursor:pointer}.fancybox-close-small:after{content:"×";position:absolute;top:5px;right:5px;width:30px;height:30px;font:20px/30px Arial,Helvetica Neue,Helvetica,sans-serif;color:#888;font-weight:300;text-align:center;border-radius:50%;border-width:0;background:#fff;transition:background .25s;box-sizing:border-box;z-index:2}.fancybox-close-small:focus:after{outline:1px dotted #888}.fancybox-close-small:hover:after{color:#555;background:#eee}.fancybox-slide--iframe .fancybox-close-small{top:0;right:-44px}.fancybox-slide--iframe .fancybox-close-small:after{background:transparent;font-size:35px;color:#aaa}.fancybox-slide--iframe .fancybox-close-small:hover:after{color:#fff}.fancybox-caption-wrap{bottom:0;left:0;right:0;padding:60px 30px 0;background:linear-gradient(180deg,transparent 0,rgba(0,0,0,.1) 20%,rgba(0,0,0,.2) 40%,rgba(0,0,0,.6) 80%,rgba(0,0,0,.8));pointer-events:none}.fancybox-caption{padding:30px 0;border-top:1px solid hsla(0,0%,100%,.4);font-size:14px;font-family:Helvetica Neue,Helvetica,Arial,sans-serif;color:#fff;line-height:20px;-webkit-text-size-adjust:none}.fancybox-caption a,.fancybox-caption button,.fancybox-caption select{pointer-events:all}.fancybox-caption a{color:#fff;text-decoration:underline}.fancybox-button{display:inline-block;position:relative;margin:0;padding:0;border:0;width:44px;height:44px;line-height:44px;text-align:center;background:transparent;color:#ddd;border-radius:0;cursor:pointer;vertical-align:top;outline:none}.fancybox-button[disabled]{cursor:default;pointer-events:none}.fancybox-button,.fancybox-infobar__body{background:rgba(30,30,30,.6)}.fancybox-button:hover:not([disabled]){color:#fff;background:rgba(0,0,0,.8)}.fancybox-button:after,.fancybox-button:before{content:"";pointer-events:none;position:absolute;background-color:currentColor;color:currentColor;opacity:.9;box-sizing:border-box;display:inline-block}.fancybox-button[disabled]:after,.fancybox-button[disabled]:before{opacity:.3}.fancybox-button--left:after,.fancybox-button--right:after{top:18px;width:6px;height:6px;background:transparent;border-top:2px solid currentColor;border-right:2px solid currentColor}.fancybox-button--left:after{left:20px;-webkit-transform:rotate(-135deg);transform:rotate(-135deg)}.fancybox-button--right:after{right:20px;-webkit-transform:rotate(45deg);transform:rotate(45deg)}.fancybox-button--left{border-bottom-left-radius:5px}.fancybox-button--right{border-bottom-right-radius:5px}.fancybox-button--close:after,.fancybox-button--close:before{content:"";display:inline-block;position:absolute;height:2px;width:16px;top:calc(50% - 1px);left:calc(50% - 8px)}.fancybox-button--close:before{-webkit-transform:rotate(45deg);transform:rotate(45deg)}.fancybox-button--close:after{-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}.fancybox-arrow{position:absolute;top:50%;margin:-50px 0 0;height:100px;width:54px;padding:0;border:0;outline:none;background:none;cursor:pointer;z-index:99995;opacity:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;transition:opacity .25s}.fancybox-arrow:after{content:"";position:absolute;top:28px;width:44px;height:44px;background-color:rgba(30,30,30,.8);background-image:url(data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjRkZGRkZGIiBoZWlnaHQ9IjQ4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSI0OCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4gICAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIvPiAgICA8cGF0aCBkPSJNMTIgNGwtMS40MSAxLjQxTDE2LjE3IDExSDR2MmgxMi4xN2wtNS41OCA1LjU5TDEyIDIwbDgtOHoiLz48L3N2Zz4=);background-repeat:no-repeat;background-position:50%;background-size:24px 24px}.fancybox-arrow--right{right:0}.fancybox-arrow--left{left:0;-webkit-transform:scaleX(-1);transform:scaleX(-1)}.fancybox-arrow--left:after,.fancybox-arrow--right:after{left:0}.fancybox-show-nav .fancybox-arrow{opacity:.6}.fancybox-show-nav .fancybox-arrow[disabled]{opacity:.3}.fancybox-loading{border:6px solid hsla(0,0%,39%,.4);border-top:6px solid hsla(0,0%,100%,.6);border-radius:100%;height:50px;width:50px;-webkit-animation:a .8s infinite linear;animation:a .8s infinite linear;background:transparent;position:absolute;top:50%;left:50%;margin-top:-25px;margin-left:-25px;z-index:99999}@-webkit-keyframes a{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes a{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fancybox-animated{transition-timing-function:cubic-bezier(0,0,.25,1)}.fancybox-fx-slide.fancybox-slide--previous{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0);opacity:0}.fancybox-fx-slide.fancybox-slide--next{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0);opacity:0}.fancybox-fx-slide.fancybox-slide--current{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}.fancybox-fx-fade.fancybox-slide--next,.fancybox-fx-fade.fancybox-slide--previous{opacity:0;transition-timing-function:cubic-bezier(.19,1,.22,1)}.fancybox-fx-fade.fancybox-slide--current{opacity:1}.fancybox-fx-zoom-in-out.fancybox-slide--previous{-webkit-transform:scale3d(1.5,1.5,1.5);transform:scale3d(1.5,1.5,1.5);opacity:0}.fancybox-fx-zoom-in-out.fancybox-slide--next{-webkit-transform:scale3d(.5,.5,.5);transform:scale3d(.5,.5,.5);opacity:0}.fancybox-fx-zoom-in-out.fancybox-slide--current{-webkit-transform:scaleX(1);transform:scaleX(1);opacity:1}.fancybox-fx-rotate.fancybox-slide--previous{-webkit-transform:rotate(-1turn);transform:rotate(-1turn);opacity:0}.fancybox-fx-rotate.fancybox-slide--next{-webkit-transform:rotate(1turn);transform:rotate(1turn);opacity:0}.fancybox-fx-rotate.fancybox-slide--current{-webkit-transform:rotate(0deg);transform:rotate(0deg);opacity:1}.fancybox-fx-circular.fancybox-slide--previous{-webkit-transform:scale3d(0,0,0) translate3d(-100%,0,0);transform:scale3d(0,0,0) translate3d(-100%,0,0);opacity:0}.fancybox-fx-circular.fancybox-slide--next{-webkit-transform:scale3d(0,0,0) translate3d(100%,0,0);transform:scale3d(0,0,0) translate3d(100%,0,0);opacity:0}.fancybox-fx-circular.fancybox-slide--current{-webkit-transform:scaleX(1) translateZ(0);transform:scaleX(1) translateZ(0);opacity:1}.fancybox-fx-tube.fancybox-slide--previous{-webkit-transform:translate3d(-100%,0,0) scale(.1) skew(-10deg);transform:translate3d(-100%,0,0) scale(.1) skew(-10deg)}.fancybox-fx-tube.fancybox-slide--next{-webkit-transform:translate3d(100%,0,0) scale(.1) skew(10deg);transform:translate3d(100%,0,0) scale(.1) skew(10deg)}.fancybox-fx-tube.fancybox-slide--current{-webkit-transform:translateZ(0) scale(1);transform:translateZ(0) scale(1)}@media (max-width:800px){.fancybox-infobar{left:0;margin-left:0}.fancybox-button--left,.fancybox-button--right{display:none!important}.fancybox-caption{padding:20px 0;margin:0}}.fancybox-button--fullscreen:before{width:15px;height:11px;left:calc(50% - 7px);top:calc(50% - 6px);border:2px solid;background:none}.fancybox-button--pause:before,.fancybox-button--play:before{top:calc(50% - 6px);left:calc(50% - 4px);background:transparent}.fancybox-button--play:before{width:0;height:0;border-top:6px inset transparent;border-bottom:6px inset transparent;border-left:10px solid;border-radius:1px}.fancybox-button--pause:before{width:7px;height:11px;border-style:solid;border-width:0 2px}.fancybox-button--thumbs,.fancybox-thumbs{display:none}@media (min-width:800px){.fancybox-button--thumbs{display:inline-block}.fancybox-button--thumbs span{font-size:23px}.fancybox-button--thumbs:before{width:3px;height:3px;top:calc(50% - 2px);left:calc(50% - 2px);box-shadow:0 -4px 0,-4px -4px 0,4px -4px 0,inset 0 0 0 32px,-4px 0 0,4px 0 0,0 4px 0,-4px 4px 0,4px 4px 0}.fancybox-thumbs{position:absolute;top:0;right:0;bottom:0;left:auto;width:220px;margin:0;padding:5px 5px 0 0;background:#fff;word-break:normal;-webkit-tap-highlight-color:transparent;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar;box-sizing:border-box;z-index:99995}.fancybox-show-thumbs .fancybox-thumbs{display:block}.fancybox-show-thumbs .fancybox-inner{right:220px}.fancybox-thumbs>ul{list-style:none;position:absolute;position:relative;width:100%;height:100%;margin:0;padding:0;overflow-x:hidden;overflow-y:auto;font-size:0}.fancybox-thumbs>ul>li{float:left;overflow:hidden;max-width:50%;padding:0;margin:0;width:105px;height:75px;position:relative;cursor:pointer;outline:none;border:5px solid transparent;border-top-width:0;border-right-width:0;-webkit-tap-highlight-color:transparent;-webkit-backface-visibility:hidden;backface-visibility:hidden;box-sizing:border-box}li.fancybox-thumbs-loading{background:rgba(0,0,0,.1)}.fancybox-thumbs>ul>li>img{position:absolute;top:0;left:0;min-width:100%;min-height:100%;max-width:none;max-height:none;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.fancybox-thumbs>ul>li:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:2px;border:4px solid #4ea7f9;z-index:99991;opacity:0;transition:all .2s cubic-bezier(.25,.46,.45,.94)}.fancybox-thumbs>ul>li.fancybox-thumbs-active:before{opacity:1}} -------------------------------------------------------------------------------- /source/css/_third-party/normalize.min.css: -------------------------------------------------------------------------------- 1 | /*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,footer,header,nav,section{display:block}h1{font-size:2em;margin:.67em 0}figcaption,figure,main{display:block}figure{margin:1em 40px}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent;-webkit-text-decoration-skip:objects}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:inherit}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}dfn{font-style:italic}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}audio,video{display:inline-block}audio:not([controls]){display:none;height:0}img{border-style:none}svg:not(:root){overflow:hidden}button,input,optgroup,select,textarea{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{display:inline-block;vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details,menu{display:block}summary{display:list-item}canvas{display:inline-block}template{display:none}[hidden]{display:none}/*# sourceMappingURL=normalize.min.css.map */ -------------------------------------------------------------------------------- /source/css/index.styl: -------------------------------------------------------------------------------- 1 | @import "nib" 2 | // third-party 3 | if hexo-config("cdn.js.fancybox") == "https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js" 4 | @import url("https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css") 5 | else 6 | @import "_third-party/jquery.fancybox.min.css" 7 | @import "_third-party/normalize.min.css" 8 | // project 9 | @import "var" 10 | @import "_global" 11 | @import "_highlight/highlight" 12 | @import "_layout/*" 13 | 14 | // search 15 | if hexo-config("algolia_search.enable") 16 | @import "_search/index" 17 | @import "_search/algolia" 18 | 19 | if hexo-config("local_search") && hexo-config("local_search.enable") 20 | @import "_search/index" 21 | @import "_search/local-search" 22 | -------------------------------------------------------------------------------- /source/css/var.styl: -------------------------------------------------------------------------------- 1 | // Theme Global Color 2 | $theme-color = #49B1F5 3 | $theme-paginator-color = #00c4b6 4 | $theme-button-hover-color = #FF7242 5 | $theme-text-selection-color = #00c4b6 6 | $theme-meta-color = #858585 7 | $theme-link-color = #99a9bf 8 | $theme-hr-color = #A4D8FA 9 | $theme-header-text-color = #EEEEEE 10 | $theme-footer-text-color = #EEEEEE 11 | 12 | if hexo-config("theme_color") && hexo-config("theme_color.enable") 13 | $theme-color = convert(hexo-config("theme_color.main")) || #49B1F5 14 | $theme-paginator-color = convert(hexo-config("theme_color.paginator")) || #00c4b6 15 | $theme-button-hover-color = convert(hexo-config("theme_color.button_hover")) || #FF7242 16 | $theme-text-selection-color = convert(hexo-config("theme_color.text_selection")) || #00c4b6 17 | $theme-link-color = convert(hexo-config("theme_color.link_color")) || #99a9bf 18 | $theme-meta-color = convert(hexo-config("theme_color.meta_color")) || #858585 19 | $theme-hr-color = convert(hexo-config("theme_color.hr_color")) || #A4D8FA 20 | $theme-header-text-color = convert(hexo-config("theme_color.header_text_color")) || #EEEEEE 21 | $theme-footer-text-color = convert(hexo-config("theme_color.footer_text_color")) || #EEEEEE 22 | 23 | // Global Variables 24 | $font-size = 14px 25 | $font-color = #1F2D3D 26 | $rem = 20px 27 | $font-family = Lato, Helvetica Neue For Number, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Helvetica Neue, Helvetica, Arial, sans-serif 28 | $code-font = consolas, Menlo, "PingFang SC", "Microsoft YaHei", monospace, Helvetica Neue For Number 29 | $text-line-height = 2 30 | $sm = 768px 31 | $bg = 1024px 32 | $md = 1300px 33 | $lg = 1450px 34 | $sidebar-icon-top = 20px 35 | $sidebar-icon-left = $sidebar-icon-top - 4px 36 | $sidebar-icon-size = 16px 37 | $go-up-bottom = $sidebar-icon-top 38 | $go-up-right = (-($sidebar-icon-left)) 39 | // Global color & SVG 40 | $pale-blue = $theme-hr-color 41 | $light-blue = $theme-color 42 | $blue = #1B9EF3 43 | $dark-blue = #0790E8 44 | $orange = #F1BE48 45 | $pale-green = #B4E1C1 46 | $light-green = #69C282 47 | $green = #44B363 48 | $dark-green = #379F54 49 | $pale-cyan = #D1F4F2 50 | $light-cyan = #8CE4DE 51 | $cyan = $theme-paginator-color 52 | $pale-red = #F9b9b3 53 | $light-red = #F47466 54 | $red = #F15140 55 | $dark-red = #E63E2C 56 | $ruby = $theme-button-hover-color 57 | $light-black = #3B3A3A 58 | $black = #2E2E2E 59 | $dark-black = #000000 60 | $pale-grey = #F7F7F7 61 | $light-grey = #EEEEEE 62 | $grey = $theme-meta-color 63 | $white = #FFFFFF 64 | $dark-white = #F9F9F9 65 | $font-black = #4C4948 66 | $selection = $theme-text-selection-color 67 | $bg-svg = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 304 304' width='304' height='304'%3E%3Cpath fill='%23a4d8fa' fill-opacity='0.4' d='M44.1 224a5 5 0 1 1 0 2H0v-2h44.1zm160 48a5 5 0 1 1 0 2H82v-2h122.1zm57.8-46a5 5 0 1 1 0-2H304v2h-42.1zm0 16a5 5 0 1 1 0-2H304v2h-42.1zm6.2-114a5 5 0 1 1 0 2h-86.2a5 5 0 1 1 0-2h86.2zm-256-48a5 5 0 1 1 0 2H0v-2h12.1zm185.8 34a5 5 0 1 1 0-2h86.2a5 5 0 1 1 0 2h-86.2zM258 12.1a5 5 0 1 1-2 0V0h2v12.1zm-64 208a5 5 0 1 1-2 0v-54.2a5 5 0 1 1 2 0v54.2zm48-198.2V80h62v2h-64V21.9a5 5 0 1 1 2 0zm16 16V64h46v2h-48V37.9a5 5 0 1 1 2 0zm-128 96V208h16v12.1a5 5 0 1 1-2 0V210h-16v-76.1a5 5 0 1 1 2 0zm-5.9-21.9a5 5 0 1 1 0 2H114v48H85.9a5 5 0 1 1 0-2H112v-48h12.1zm-6.2 130a5 5 0 1 1 0-2H176v-74.1a5 5 0 1 1 2 0V242h-60.1zm-16-64a5 5 0 1 1 0-2H114v48h10.1a5 5 0 1 1 0 2H112v-48h-10.1zM66 284.1a5 5 0 1 1-2 0V274H50v30h-2v-32h18v12.1zM236.1 176a5 5 0 1 1 0 2H226v94h48v32h-2v-30h-48v-98h12.1zm25.8-30a5 5 0 1 1 0-2H274v44.1a5 5 0 1 1-2 0V146h-10.1zm-64 96a5 5 0 1 1 0-2H208v-80h16v-14h-42.1a5 5 0 1 1 0-2H226v18h-16v80h-12.1zm86.2-210a5 5 0 1 1 0 2H272V0h2v32h10.1zM98 101.9V146H53.9a5 5 0 1 1 0-2H96v-42.1a5 5 0 1 1 2 0zM53.9 34a5 5 0 1 1 0-2H80V0h2v34H53.9zm60.1 3.9V66H82v64H69.9a5 5 0 1 1 0-2H80V64h32V37.9a5 5 0 1 1 2 0zM101.9 82a5 5 0 1 1 0-2H128V37.9a5 5 0 1 1 2 0V82h-28.1zm16-64a5 5 0 1 1 0-2H146v44.1a5 5 0 1 1-2 0V18h-26.1zm102.2 270a5 5 0 1 1 0 2H98v14h-2v-16h124.1zM242 149.9V160h16v34h-16v62h48v48h-2v-46h-48v-66h16v-30h-16v-12.1a5 5 0 1 1 2 0zM53.9 18a5 5 0 1 1 0-2H64V2H48V0h18v18H53.9zm112 32a5 5 0 1 1 0-2H192V0h50v2h-48v48h-28.1zm-48-48a5 5 0 0 1-9.8-2h2.07a3 3 0 1 0 5.66 0H178v34h-18V21.9a5 5 0 1 1 2 0V32h14V2h-58.1zm0 96a5 5 0 1 1 0-2H137l32-32h39V21.9a5 5 0 1 1 2 0V66h-40.17l-32 32H117.9zm28.1 90.1a5 5 0 1 1-2 0v-76.51L175.59 80H224V21.9a5 5 0 1 1 2 0V82h-49.59L146 112.41v75.69zm16 32a5 5 0 1 1-2 0v-99.51L184.59 96H300.1a5 5 0 0 1 3.9-3.9v2.07a3 3 0 0 0 0 5.66v2.07a5 5 0 0 1-3.9-3.9H185.41L162 121.41v98.69zm-144-64a5 5 0 1 1-2 0v-3.51l48-48V48h32V0h2v50H66v55.41l-48 48v2.69zM50 53.9v43.51l-48 48V208h26.1a5 5 0 1 1 0 2H0v-65.41l48-48V53.9a5 5 0 1 1 2 0zm-16 16V89.41l-34 34v-2.82l32-32V69.9a5 5 0 1 1 2 0zM12.1 32a5 5 0 1 1 0 2H9.41L0 43.41V40.6L8.59 32h3.51zm265.8 18a5 5 0 1 1 0-2h18.69l7.41-7.41v2.82L297.41 50H277.9zm-16 160a5 5 0 1 1 0-2H288v-71.41l16-16v2.82l-14 14V210h-28.1zm-208 32a5 5 0 1 1 0-2H64v-22.59L40.59 194H21.9a5 5 0 1 1 0-2H41.41L66 216.59V242H53.9zm150.2 14a5 5 0 1 1 0 2H96v-56.6L56.6 162H37.9a5 5 0 1 1 0-2h19.5L98 200.6V256h106.1zm-150.2 2a5 5 0 1 1 0-2H80v-46.59L48.59 178H21.9a5 5 0 1 1 0-2H49.41L82 208.59V258H53.9zM34 39.8v1.61L9.41 66H0v-2h8.59L32 40.59V0h2v39.8zM2 300.1a5 5 0 0 1 3.9 3.9H3.83A3 3 0 0 0 0 302.17V256h18v48h-2v-46H2v42.1zM34 241v63h-2v-62H0v-2h34v1zM17 18H0v-2h16V0h2v18h-1zm273-2h14v2h-16V0h2v16zm-32 273v15h-2v-14h-14v14h-2v-16h18v1zM0 92.1A5.02 5.02 0 0 1 6 97a5 5 0 0 1-6 4.9v-2.07a3 3 0 1 0 0-5.66V92.1zM80 272h2v32h-2v-32zm37.9 32h-2.07a3 3 0 0 0-5.66 0h-2.07a5 5 0 0 1 9.8 0zM5.9 0A5.02 5.02 0 0 1 0 5.9V3.83A3 3 0 0 0 3.83 0H5.9zm294.2 0h2.07A3 3 0 0 0 304 3.83V5.9a5 5 0 0 1-3.9-5.9zm3.9 300.1v2.07a3 3 0 0 0-1.83 1.83h-2.07a5 5 0 0 1 3.9-3.9zM97 100a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0-16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-48 32a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm32 48a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-16 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm32-16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0-32a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16 32a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm32 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0-16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-16-64a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16 96a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16-144a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0 32a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16-32a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16-16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-96 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16-32a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm96 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-16-64a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16-16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-32 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0-16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-16 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-16 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-16 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM49 36a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-32 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm32 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM33 68a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16-48a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0 240a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16 32a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-16-64a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-16-32a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm80-176a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-16-16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm32 48a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16-16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0-32a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm112 176a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-16 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM17 180a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0-32a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM17 84a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm32 64a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16-16a3 3 0 1 0 0-6 3 3 0 0 0 0 6z'%3E%3C/path%3E%3C/svg%3E" 68 | $light-shadow = 0.1rem 0.1rem 0.2rem rgba(0, 0, 0, 0.15) 69 | $dark-shadow = 0.05rem 0.05rem 0.1rem rgba(0, 0, 0, 0.3) 70 | // code 71 | $code-font-size = $font-size 72 | $code-font-family = $font-family 73 | $code-foreground = $font-color 74 | $code-background = rgba(27, 31, 35, 0.05) 75 | $line-height-code-block = 20px 76 | $blockquote-color = #6a737d 77 | $blockquote-padding-color = #dfe2e5 78 | // page 79 | $content-width = 700px 80 | $iframe-height = (700 / 16 * 9)px 81 | $content-large-width = 900px 82 | $iframe-large-height = (900 / 16 * 9)px 83 | $a-link-color = $theme-link-color 84 | $a-hover-color = #82AAFF 85 | $img-border-color = #eaeefb 86 | $img-border-padding = 4px 87 | // sidebar 88 | $sidebar-width = 300px 89 | $sidebar-background = #f6f8fa 90 | // top_img_height 91 | $top_img_height = hexo-config("top_img_height") || 60 92 | -------------------------------------------------------------------------------- /source/img/algolia.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /source/img/avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Molunerfinn/hexo-theme-melody/11685c65d503304ad908138c55af5c1cd5dae9e2/source/img/avatar.png -------------------------------------------------------------------------------- /source/js/copy.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | // Add copy icon 3 | $('figure.highlight').wrap('
') 4 | var $copyIcon = $('') 5 | var $notice = $('
') 6 | var $codeLanguage = $('') 7 | $('.code-area-wrap').prepend($copyIcon) 8 | $('.code-area-wrap').prepend($notice) 9 | $('.code-area-wrap').prepend($codeLanguage) 10 | $('.code-area-wrap').each(function (index, element) { 11 | var codeLanguage = $(element) 12 | .find('figure.highlight') 13 | .attr('class') 14 | .replace('highlight', '') 15 | .trim() 16 | $(element) 17 | .find('.codeblock-language') 18 | .text(codeLanguage) 19 | }) 20 | // copy function 21 | function copy (text, ctx) { 22 | if ( 23 | document.queryCommandSupported && 24 | document.queryCommandSupported('copy') 25 | ) { 26 | try { 27 | document.execCommand('copy') // Security exception may be thrown by some browsers. 28 | $(ctx) 29 | .prev('.copy-notice') 30 | .text(GLOBAL_CONFIG.copy.success) 31 | .velocity( 32 | { 33 | translateX: -30, 34 | opacity: 1 35 | }, 36 | { 37 | loop: 1, 38 | duration: 750, 39 | easing: 'easeOutQuint' 40 | } 41 | ) 42 | } catch (ex) { 43 | $(ctx) 44 | .prev('.copy-notice') 45 | .text(GLOBAL_CONFIG.copy.error) 46 | .velocity( 47 | { 48 | translateX: -30, 49 | opacity: 1 50 | }, 51 | { 52 | loop: 1, 53 | duration: 750, 54 | easing: 'easeOutQuint' 55 | } 56 | ) 57 | return false 58 | } 59 | } else { 60 | $(ctx) 61 | .prev('.copy-notice') 62 | .text(GLOBAL_CONFIG.copy.noSupport) 63 | } 64 | } 65 | // click events 66 | $('.code-area-wrap .fa-clipboard').on('click', function () { 67 | var selection = window.getSelection() 68 | var range = document.createRange() 69 | range.selectNodeContents( 70 | $(this) 71 | .siblings('figure') 72 | .find('.code pre')[0] 73 | ) 74 | selection.removeAllRanges() 75 | selection.addRange(range) 76 | var text = selection.toString() 77 | copy(text, this) 78 | selection.removeAllRanges() 79 | }) 80 | }) 81 | -------------------------------------------------------------------------------- /source/js/fancybox.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | var imgList = $('.recent-post-item img').not('.no-fancybox') 3 | if (imgList.length === 0) { 4 | imgList = $('#post-content img').not('.no-fancybox') 5 | } 6 | for (var i = 0; i < imgList.length; i++) { 7 | var $a = $( 8 | '' 13 | ) 14 | var alt = imgList[i].alt 15 | var $wrap = $(imgList[i]).wrap($a) 16 | if (alt) { 17 | $wrap.after('
' + alt + '
') 18 | } 19 | } 20 | 21 | $().fancybox({ 22 | selector: '[data-fancybox]', 23 | loop: true, 24 | transitionEffect: 'slide', 25 | buttons: ['share', 'slideShow', 'fullScreen', 'download', 'thumbs', 'close'] 26 | }) 27 | 28 | var galleryItem = $('.gallery-item') 29 | var galleryList = [] 30 | galleryItem.each(function (idx, elem) { 31 | galleryList.push({ 32 | src: $(elem).data('url'), 33 | opts: { 34 | caption: $(elem).data('title') 35 | } 36 | }) 37 | }) 38 | galleryItem.on('click', function () { 39 | $.fancybox.open( 40 | galleryList, 41 | { 42 | loop: true, 43 | transitionEffect: 'slide' 44 | }, 45 | galleryItem.index(this) 46 | ) 47 | return false 48 | }) 49 | }) 50 | -------------------------------------------------------------------------------- /source/js/fireworks.js: -------------------------------------------------------------------------------- 1 | var canvasEl = document.querySelector('.fireworks') 2 | if (canvasEl) { 3 | var ctx = canvasEl.getContext('2d') 4 | var numberOfParticules = 30 5 | var pointerX = 0 6 | var pointerY = 0 7 | // var tap = ('ontouchstart' in window || navigator.msMaxTouchPoints) ? 'touchstart' : 'mousedown' 8 | // Fixed the mobile scroll 9 | var tap = 'mousedown' 10 | var colors = ['#FF1461', '#18FF92', '#5A87FF', '#FBF38C'] 11 | 12 | var setCanvasSize = debounce(function () { 13 | canvasEl.width = window.innerWidth 14 | canvasEl.height = window.innerHeight 15 | canvasEl.style.width = window.innerWidth + 'px' 16 | canvasEl.style.height = window.innerHeight + 'px' 17 | canvasEl.getContext('2d').scale(1, 1) 18 | }, 500) 19 | 20 | var render = anime({ 21 | duration: Infinity, 22 | update: function () { 23 | ctx.clearRect(0, 0, canvasEl.width, canvasEl.height) 24 | } 25 | }) 26 | 27 | document.addEventListener(tap, function (e) { 28 | if (e.target.id !== 'sidebar' && e.target.id !== 'toggle-sidebar' && e.target.nodeName !== 'A' && e.target.nodeName !== 'IMG') { 29 | render.play() 30 | updateCoords(e) 31 | animateParticules(pointerX, pointerY) 32 | } 33 | }, false) 34 | 35 | setCanvasSize() 36 | window.addEventListener('resize', setCanvasSize, false) 37 | } 38 | 39 | function updateCoords (e) { 40 | pointerX = (e.clientX || e.touches[0].clientX) - canvasEl.getBoundingClientRect().left 41 | pointerY = e.clientY || e.touches[0].clientY - canvasEl.getBoundingClientRect().top 42 | } 43 | 44 | function setParticuleDirection (p) { 45 | var angle = anime.random(0, 360) * Math.PI / 180 46 | var value = anime.random(50, 180) 47 | var radius = [-1, 1][anime.random(0, 1)] * value 48 | return { 49 | x: p.x + radius * Math.cos(angle), 50 | y: p.y + radius * Math.sin(angle) 51 | } 52 | } 53 | 54 | function createParticule (x, y) { 55 | var p = {} 56 | p.x = x 57 | p.y = y 58 | p.color = colors[anime.random(0, colors.length - 1)] 59 | p.radius = anime.random(16, 32) 60 | p.endPos = setParticuleDirection(p) 61 | p.draw = function () { 62 | ctx.beginPath() 63 | ctx.arc(p.x, p.y, p.radius, 0, 2 * Math.PI, true) 64 | ctx.fillStyle = p.color 65 | ctx.fill() 66 | } 67 | return p 68 | } 69 | 70 | function createCircle (x, y) { 71 | var p = {} 72 | p.x = x 73 | p.y = y 74 | p.color = '#F00' 75 | p.radius = 0.1 76 | p.alpha = 0.5 77 | p.lineWidth = 6 78 | p.draw = function () { 79 | ctx.globalAlpha = p.alpha 80 | ctx.beginPath() 81 | ctx.arc(p.x, p.y, p.radius, 0, 2 * Math.PI, true) 82 | ctx.lineWidth = p.lineWidth 83 | ctx.strokeStyle = p.color 84 | ctx.stroke() 85 | ctx.globalAlpha = 1 86 | } 87 | return p 88 | } 89 | 90 | function renderParticule (anim) { 91 | for (var i = 0; i < anim.animatables.length; i++) { 92 | anim.animatables[i].target.draw() 93 | } 94 | } 95 | 96 | function animateParticules (x, y) { 97 | var circle = createCircle(x, y) 98 | var particules = [] 99 | for (var i = 0; i < numberOfParticules; i++) { 100 | particules.push(createParticule(x, y)) 101 | } 102 | anime.timeline().add({ 103 | targets: particules, 104 | x: function (p) { 105 | return p.endPos.x 106 | }, 107 | y: function (p) { 108 | return p.endPos.y 109 | }, 110 | radius: 0.1, 111 | duration: anime.random(1200, 1800), 112 | easing: 'easeOutExpo', 113 | update: renderParticule 114 | }) 115 | .add({ 116 | targets: circle, 117 | radius: anime.random(80, 160), 118 | lineWidth: 0, 119 | alpha: { 120 | value: 0, 121 | easing: 'linear', 122 | duration: anime.random(600, 800) 123 | }, 124 | duration: anime.random(1200, 1800), 125 | easing: 'easeOutExpo', 126 | update: renderParticule, 127 | }, 0) 128 | } 129 | -------------------------------------------------------------------------------- /source/js/head.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | $('.toggle-menu').on('click', function () { 3 | if (!$('.menus').is(':visible')) { 4 | $('.menus').velocity('stop') 5 | .velocity('transition.slideDownIn', { duration: 300 }) 6 | } else { 7 | $('.menus').velocity('stop') 8 | .velocity('transition.slideUpOut', { duration: 300 }) 9 | } 10 | }) 11 | $(document).on('click touchstart', function (e) { 12 | var flag = $('.menus')[0].contains(e.target) || $('.toggle-menu')[0].contains(e.target) 13 | if (!flag && $('.toggle-menu').is(':visible')) { 14 | $('.menus').velocity('stop') 15 | .velocity('transition.slideUpOut', { duration: 300 }) 16 | } 17 | }) 18 | $(window).on('resize', function (e) { 19 | if (!$('.toggle-menu').is(':visible')) { 20 | if (!$('.menus').is(':visible')) { 21 | $('.menus').velocity('stop') 22 | .velocity('transition.slideDownIn', { duration: 300 }) 23 | } 24 | } 25 | }) 26 | }) 27 | -------------------------------------------------------------------------------- /source/js/hexo-theme-melody.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Molunerfinn/hexo-theme-melody/11685c65d503304ad908138c55af5c1cd5dae9e2/source/js/hexo-theme-melody.js -------------------------------------------------------------------------------- /source/js/katex.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | $('span.katex-display').wrap('
') 3 | }) 4 | -------------------------------------------------------------------------------- /source/js/scroll.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | var initTop = 0 3 | $('.toc-child').hide() 4 | 5 | // main of scroll 6 | $(window).scroll(throttle(function (event) { 7 | var currentTop = $(this).scrollTop() 8 | if (!isMobile()) { 9 | // percentage inspired by hexo-theme-next 10 | scrollPercent(currentTop) 11 | // head position 12 | findHeadPosition(currentTop) 13 | } 14 | var isUp = scrollDirection(currentTop) 15 | if (currentTop > 56) { 16 | if (isUp) { 17 | $('#page-header').hasClass('visible') ? $('#page-header').removeClass('visible') : console.log() 18 | } else { 19 | $('#page-header').hasClass('visible') ? console.log() : $('#page-header').addClass('visible') 20 | } 21 | $('#page-header').addClass('fixed') 22 | if ($('#go-up').css('opacity') === '0') { 23 | $('#go-up').velocity('stop').velocity({ 24 | translateX: -30, 25 | rotateZ: 360, 26 | opacity: 1 27 | }, { 28 | easing: 'easeOutQuart', 29 | duration: 200 30 | }) 31 | } 32 | } else { 33 | if (currentTop === 0) { 34 | $('#page-header').removeClass('fixed').removeClass('visible') 35 | } 36 | $('#go-up').velocity('stop').velocity({ 37 | translateX: 0, 38 | rotateZ: 180, 39 | opacity: 0 40 | }, { 41 | easing: 'linear', 42 | duration: 200 43 | }) 44 | } 45 | }, 50, 100)) 46 | 47 | // go up smooth scroll 48 | $('#go-up').on('click', function () { 49 | $('body').velocity('stop').velocity('scroll', { 50 | duration: 500, 51 | easing: 'easeOutQuart' 52 | }) 53 | }) 54 | 55 | // head scroll 56 | $('#post-content').find('h1,h2,h3,h4,h5,h6').on('click', function (e) { 57 | scrollToHead('#' + $(this).attr('id')) 58 | }) 59 | 60 | // head scroll 61 | $('.toc-link').on('click', function (e) { 62 | e.preventDefault() 63 | scrollToHead($(this).attr('href')) 64 | }) 65 | 66 | // find the scroll direction 67 | function scrollDirection (currentTop) { 68 | var result = currentTop > initTop // true is down & false is up 69 | initTop = currentTop 70 | return result 71 | } 72 | 73 | // scroll to a head(anchor) 74 | function scrollToHead (anchor) { 75 | var item 76 | try { 77 | item = $(anchor) 78 | } catch (e) { 79 | // fix #286 support hexo v5 80 | item = $(decodeURI(anchor)) 81 | } 82 | item.velocity('stop').velocity('scroll', { 83 | duration: 500, 84 | easing: 'easeInOutQuart' 85 | }) 86 | } 87 | 88 | // expand toc-item 89 | function expandToc ($item) { 90 | if ($item.is(':visible')) { 91 | return 92 | } 93 | $item.velocity('stop').velocity('transition.fadeIn', { 94 | duration: 500, 95 | easing: 'easeInQuart' 96 | }) 97 | } 98 | 99 | function scrollPercent (currentTop) { 100 | var docHeight = $('#content-outer').height() 101 | var winHeight = $(window).height() 102 | var contentMath = (docHeight > winHeight) ? (docHeight - winHeight) : ($(document).height() - winHeight) 103 | var scrollPercent = (currentTop) / (contentMath) 104 | var scrollPercentRounded = Math.round(scrollPercent * 100) 105 | var percentage = (scrollPercentRounded > 100) ? 100 106 | : (scrollPercentRounded <= 0) ? 0 107 | : scrollPercentRounded 108 | $('.progress-num').text(percentage) 109 | $('.sidebar-toc__progress-bar').velocity('stop') 110 | .velocity({ 111 | width: percentage + '%' 112 | }, { 113 | duration: 100, 114 | easing: 'easeInOutQuart' 115 | }) 116 | } 117 | 118 | function updateAnchor (anchor) { 119 | if (window.history.replaceState && anchor !== window.location.hash) { 120 | window.history.replaceState(undefined, undefined, anchor) 121 | } 122 | } 123 | 124 | // find head position & add active class 125 | // DOM Hierarchy: 126 | // ol.toc > (li.toc-item, ...) 127 | // li.toc-item > (a.toc-link, ol.toc-child > (li.toc-item, ...)) 128 | function findHeadPosition (top) { 129 | // assume that we are not in the post page if no TOC link be found, 130 | // thus no need to update the status 131 | if ($('.toc-link').length === 0) { 132 | return false 133 | } 134 | 135 | var list = $('#post-content').find('h1,h2,h3,h4,h5,h6') 136 | var currentId = '' 137 | list.each(function () { 138 | var head = $(this) 139 | if (top > head.offset().top - 25) { 140 | currentId = '#' + $(this).attr('id') 141 | } 142 | }) 143 | 144 | if (currentId === '') { 145 | $('.toc-link').removeClass('active') 146 | $('.toc-child').hide() 147 | } 148 | 149 | // fix #286 since hexo v5.0.0 will 150 | // encodeURI the toc-item href 151 | var hexoVersion = GLOBAL_CONFIG.hexoVersion[0] 152 | 153 | if (parseInt(hexoVersion) >= 5) { 154 | currentId = encodeURI(currentId) 155 | } 156 | 157 | var currentActive = $('.toc-link.active') 158 | if (currentId && currentActive.attr('href') !== currentId) { 159 | updateAnchor(currentId) 160 | 161 | $('.toc-link').removeClass('active') 162 | var _this = $('.toc-link[href="' + currentId + '"]') 163 | _this.addClass('active') 164 | 165 | var parents = _this.parents('.toc-child') 166 | // Returned list is in reverse order of the DOM elements 167 | // Thus `parents.last()` is the outermost .toc-child container 168 | // i.e. list of subsections 169 | var topLink = (parents.length > 0) ? parents.last() : _this 170 | expandToc(topLink.closest('.toc-item').find('.toc-child')) 171 | topLink 172 | // Find all top-level .toc-item containers, i.e. sections 173 | // excluding the currently active one 174 | .closest('.toc-item').siblings('.toc-item') 175 | // Hide their respective list of subsections 176 | .find('.toc-child').hide() 177 | } 178 | } 179 | }) 180 | -------------------------------------------------------------------------------- /source/js/search/algolia.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | $('a.social-icon.search').on('click', function () { 3 | $('body').css('width', '100%') 4 | $('body').css('overflow', 'hidden') 5 | $('.search-dialog').velocity('stop') 6 | .velocity('transition.expandIn', { 7 | duration: 300, 8 | complete: function () { 9 | $('.ais-search-box--input').focus() 10 | } 11 | }) 12 | $('.search-mask').velocity('stop') 13 | .velocity('transition.fadeIn', { 14 | duration: 300 15 | }) 16 | 17 | // shortcut: ESC 18 | document.addEventListener('keydown', function f(event) { 19 | if (event.code == "Escape") { 20 | closeSearch(); 21 | document.removeEventListener('keydown', f); 22 | } 23 | }) 24 | }) 25 | 26 | var closeSearch = function () { 27 | $('body').css('overflow', 'auto') 28 | $('.search-dialog').velocity('stop') 29 | .velocity('transition.expandOut', { 30 | duration: 300 31 | }) 32 | $('.search-mask').velocity('stop') 33 | .velocity('transition.fadeOut', { 34 | duration: 300 35 | }) 36 | } 37 | $('.search-mask, .search-close-button').on('click', closeSearch) 38 | 39 | 40 | 41 | var algolia = GLOBAL_CONFIG.algolia 42 | var isAlgoliaValid = algolia.appId && algolia.apiKey && algolia.indexName 43 | if (!isAlgoliaValid) { 44 | return console.error('Algolia setting is invalid!') 45 | } 46 | 47 | var search = instantsearch({ 48 | appId: algolia.appId, 49 | apiKey: algolia.apiKey, 50 | indexName: algolia.indexName, 51 | searchParameters: { 52 | hitsPerPage: algolia.hits.per_page || 10 53 | }, 54 | searchFunction: function (helper) { 55 | var searchInput = $('#algolia-search-input').find('input') 56 | 57 | if (searchInput.val()) { 58 | helper.search() 59 | } 60 | } 61 | }) 62 | 63 | search.addWidget( 64 | instantsearch.widgets.searchBox({ 65 | container: '#algolia-search-input', 66 | reset: false, 67 | magnifier: false, 68 | placeholder: GLOBAL_CONFIG.algolia.languages.input_placeholder 69 | }) 70 | ) 71 | search.addWidget( 72 | instantsearch.widgets.hits({ 73 | container: '#algolia-hits', 74 | templates: { 75 | item: function (data) { 76 | var link = data.permalink ? data.permalink : (GLOBAL_CONFIG.root + data.path) 77 | return ( 78 | '' + 79 | data._highlightResult.title.value + 80 | '' 81 | ) 82 | }, 83 | empty: function (data) { 84 | return ( 85 | '
' + 86 | GLOBAL_CONFIG.algolia.languages.hits_empty.replace(/\$\{query}/, data.query) + 87 | '
' 88 | ) 89 | } 90 | }, 91 | cssClasses: { 92 | item: 'algolia-hit-item' 93 | } 94 | }) 95 | ) 96 | 97 | search.addWidget( 98 | instantsearch.widgets.stats({ 99 | container: '#algolia-stats', 100 | templates: { 101 | body: function (data) { 102 | var stats = GLOBAL_CONFIG.algolia.languages.hits_stats 103 | .replace(/\$\{hits}/, data.nbHits) 104 | .replace(/\$\{time}/, data.processingTimeMS) 105 | return ( 106 | '
' + 107 | stats + 108 | '' 111 | ) 112 | } 113 | } 114 | }) 115 | ) 116 | 117 | search.addWidget( 118 | instantsearch.widgets.pagination({ 119 | container: '#algolia-pagination', 120 | scrollTo: false, 121 | showFirstLast: false, 122 | labels: { 123 | first: '', 124 | last: '', 125 | previous: '', 126 | next: '' 127 | }, 128 | cssClasses: { 129 | root: 'pagination', 130 | item: 'pagination-item', 131 | link: 'page-number', 132 | active: 'current', 133 | disabled: 'disabled-item' 134 | } 135 | }) 136 | ) 137 | 138 | search.start() 139 | }) 140 | -------------------------------------------------------------------------------- /source/js/search/local-search.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | var loadFlag = false 3 | $('a.social-icon.search').on('click', function () { 4 | $('body').css('width', '100%') 5 | $('body').css('overflow', 'hidden') 6 | $('.search-dialog').velocity('stop') 7 | .velocity('transition.expandIn', { 8 | duration: 300, 9 | complete: function () { 10 | $('#local-search-input input').focus() 11 | } 12 | }) 13 | $('.search-mask').velocity('stop') 14 | .velocity('transition.fadeIn', { 15 | duration: 300 16 | }) 17 | if (!loadFlag) { 18 | search(GLOBAL_CONFIG.localSearch.path) 19 | loadFlag = true 20 | } 21 | 22 | // shortcut: ESC 23 | document.addEventListener('keydown', function f(event) { 24 | if (event.code === 'Escape') { 25 | closeSearch() 26 | document.removeEventListener('keydown', f) 27 | } 28 | }) 29 | }) 30 | 31 | var closeSearch = function () { 32 | $('body').css('overflow', 'auto') 33 | $('.search-dialog').velocity('stop') 34 | .velocity('transition.expandOut', { 35 | duration: 300 36 | }) 37 | $('.search-mask').velocity('stop') 38 | .velocity('transition.fadeOut', { 39 | duration: 300 40 | }) 41 | } 42 | $('.search-mask, .search-close-button').on('click', closeSearch) 43 | 44 | function search(path) { 45 | $.ajax({ 46 | url: GLOBAL_CONFIG.root + path, 47 | dataType: 'xml', 48 | success: function (xmlResponse) { 49 | // get the contents from search data 50 | var datas = $('entry', xmlResponse).map(function () { 51 | return { 52 | title: $('title', this).text(), 53 | content: $('content', this).text(), 54 | url: $('url', this).text() 55 | } 56 | }).get() 57 | var $input = $('#local-search-input input')[0] 58 | var $resultContent = $('#local-hits')[0] 59 | $input.addEventListener('input', function () { 60 | var str = '
' 61 | var keywords = this.value.trim().toLowerCase().split(/[\s]+/) 62 | $resultContent.innerHTML = '' 63 | if (this.value.trim().length <= 0) { 64 | $('.local-search-stats__hr').hide() 65 | return 66 | } 67 | var count = 0 68 | // perform local searching 69 | datas.forEach(function (data) { 70 | var isMatch = true 71 | var dataTitle = data.title.trim().toLowerCase() 72 | var dataContent = data.content.trim().replace(/<[^>]+>/g, '').toLowerCase() 73 | var dataUrl = data.url 74 | var indexTitle = -1 75 | var indexContent = -1 76 | // only match artiles with not empty titles and contents 77 | if (dataTitle !== '' && dataContent !== '') { 78 | keywords.forEach(function (keyword, i) { 79 | indexTitle = dataTitle.indexOf(keyword) 80 | indexContent = dataContent.indexOf(keyword) 81 | if (indexTitle < 0 && indexContent < 0) { 82 | isMatch = false 83 | } else { 84 | if (indexContent < 0) { 85 | indexContent = 0 86 | } 87 | } 88 | }) 89 | } 90 | // show search results 91 | if (isMatch) { 92 | if (! dataUrl.startsWith('/')) { 93 | dataUrl = '/' + dataUrl 94 | } 95 | 96 | str += '' 97 | count += 1 98 | $('.local-search-stats__hr').show() 99 | } 100 | }) 101 | if (count === 0) { 102 | str += '
' + GLOBAL_CONFIG.localSearch.languages.hits_empty.replace(/\$\{query}/, this.value.trim()) + 103 | '
' 104 | } 105 | $resultContent.innerHTML = str 106 | }) 107 | } 108 | }) 109 | } 110 | }) 111 | -------------------------------------------------------------------------------- /source/js/sidebar.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | $('.toggle-sidebar-info > span').on('click', function () { 3 | var toggleText = $(this).attr('data-toggle') 4 | $(this).attr('data-toggle', $(this).text()) 5 | $(this).text(toggleText) 6 | changeSideBarInfo() 7 | }) 8 | $('#toggle-sidebar').on('click', function () { 9 | if (!isMobile() && $('#sidebar').is(':visible')) { 10 | var isOpen = $(this).hasClass('on') 11 | isOpen ? $(this).removeClass('on') : $(this).addClass('on') 12 | if (isOpen) { 13 | $('#page-header').removeClass('open-sidebar') 14 | $('body').velocity('stop').velocity({ 15 | paddingLeft: '0px' 16 | }, { 17 | duration: 200 18 | }) 19 | $('#sidebar').velocity('stop').velocity({ 20 | translateX: '0px' 21 | }, { 22 | duration: 200 23 | }) 24 | $('#toggle-sidebar').velocity('stop').velocity({ 25 | rotateZ: '0deg', 26 | color: '#1F2D3D' 27 | }, { 28 | duration: 200 29 | }) 30 | } else { 31 | $('#page-header').addClass('open-sidebar') 32 | $('body').velocity('stop').velocity({ 33 | paddingLeft: '300px' 34 | }, { 35 | duration: 200 36 | }) 37 | $('#sidebar').velocity('stop').velocity({ 38 | translateX: '300px' 39 | }, { 40 | duration: 200 41 | }) 42 | $('#toggle-sidebar').velocity('stop').velocity({ 43 | rotateZ: '180deg', 44 | color: '#99a9bf' 45 | }, { 46 | duration: 200 47 | }) 48 | } 49 | } 50 | }) 51 | function changeSideBarInfo () { 52 | if ($('.author-info').is(':visible')) { 53 | $('.author-info').velocity('stop') 54 | .velocity('transition.slideLeftOut', { 55 | duration: 300, 56 | complete: function () { 57 | $('.sidebar-toc').velocity('stop') 58 | .velocity('transition.slideRightIn', { duration: 500 }) 59 | } 60 | }) 61 | } else { 62 | $('.sidebar-toc').velocity('stop') 63 | .velocity('transition.slideRightOut', { 64 | duration: 300, 65 | complete: function () { 66 | $('.author-info').velocity('stop') 67 | .velocity('transition.slideLeftIn', { duration: 500 }) 68 | } 69 | }) 70 | } 71 | } 72 | }) 73 | -------------------------------------------------------------------------------- /source/js/third-party/canvas-ribbon.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016 hustcc 3 | * License: MIT 4 | * Version: v1.0.1 5 | * GitHub: https://github.com/hustcc/ribbon.js 6 | **/ 7 | // changed by Molunerfinn 8 | !(function () { 9 | function attr (node, attr, default_value) { 10 | if (default_value === true) { 11 | return node.getAttribute(attr) || default_value 12 | } 13 | return Number(node.getAttribute(attr)) || default_value 14 | } 15 | 16 | // get user config 17 | var script = document.getElementById('ribbon'), 18 | config = { 19 | z: attr(script, 'zIndex', -1), // z-index 20 | a: attr(script, 'alpha', 0.6), // alpha 21 | s: attr(script, 'size', 90), // size 22 | c: attr(script, 'data-click', true) // click-to-change 23 | } 24 | 25 | var canvas = document.createElement('canvas'), 26 | g2d = canvas.getContext('2d'), 27 | pr = window.devicePixelRatio || 1, 28 | width = window.innerWidth, 29 | height = window.innerHeight, 30 | f = config.s, 31 | q, 32 | t, 33 | m = Math, 34 | r = 0, 35 | pi = m.PI * 2, 36 | cos = m.cos, 37 | random = m.random 38 | canvas.width = width * pr 39 | canvas.height = height * pr 40 | g2d.scale(pr, pr) 41 | g2d.globalAlpha = config.a 42 | canvas.style.cssText = 43 | 'opacity: ' + 44 | config.a + 45 | ';position:fixed;top:0;left:0;z-index: ' + 46 | config.z + 47 | ';width:100%;height:100%;pointer-events:none;' 48 | // create canvas 49 | document.getElementsByTagName('body')[0].appendChild(canvas) 50 | 51 | function redraw () { 52 | g2d.clearRect(0, 0, width, height) 53 | q = [{ x: 0, y: height * 0.7 + f }, { x: 0, y: height * 0.7 - f }] 54 | while (q[1].x < width + f) draw(q[0], q[1]) 55 | } 56 | function draw (i, j) { 57 | g2d.beginPath() 58 | g2d.moveTo(i.x, i.y) 59 | g2d.lineTo(j.x, j.y) 60 | var k = j.x + (random() * 2 - 0.25) * f, 61 | n = line(j.y) 62 | g2d.lineTo(k, n) 63 | g2d.closePath() 64 | r -= pi / -50 65 | g2d.fillStyle = 66 | '#' + 67 | ( 68 | ((cos(r) * 127 + 128) << 16) | 69 | ((cos(r + pi / 3) * 127 + 128) << 8) | 70 | (cos(r + (pi / 3) * 2) * 127 + 128) 71 | ).toString(16) 72 | g2d.fill() 73 | q[0] = q[1] 74 | q[1] = { x: k, y: n } 75 | } 76 | function line (p) { 77 | t = p + (random() * 2 - 1.1) * f 78 | return t > height || t < 0 ? line(p) : t 79 | } 80 | if (config.c !== 'false') { 81 | document.onclick = redraw 82 | document.ontouchstart = redraw 83 | } 84 | redraw() 85 | })() 86 | -------------------------------------------------------------------------------- /source/js/third-party/reveal/head.min.js: -------------------------------------------------------------------------------- 1 | /*! head.core - v1.0.2 */ 2 | (function(n,t){"use strict";function r(n){a[a.length]=n}function k(n){var t=new RegExp(" ?\\b"+n+"\\b");c.className=c.className.replace(t,"")}function p(n,t){for(var i=0,r=n.length;in?(i.screensCss.gt&&r("gt-"+n),i.screensCss.gte&&r("gte-"+n)):tt);u.feature("landscape",fe?(i.browserCss.gt&&r("gt-"+f+e),i.browserCss.gte&&r("gte-"+f+e)):h2&&this[u+1]!==t)u&&r(this.slice(u,u+1).join("-").toLowerCase()+i.section);else{var f=n||"index",e=f.indexOf(".");e>0&&(f=f.substring(0,e));c.id=f.toLowerCase()+i.page;u||r("root"+i.section)}});u.screen={height:n.screen.height,width:n.screen.width};tt();b=0;n.addEventListener?n.addEventListener("resize",it,!1):n.attachEvent("onresize",it)})(window); 3 | /*! head.css3 - v1.0.0 */ 4 | (function(n,t){"use strict";function a(n){for(var r in n)if(i[n[r]]!==t)return!0;return!1}function r(n){var t=n.charAt(0).toUpperCase()+n.substr(1),i=(n+" "+c.join(t+" ")+t).split(" ");return!!a(i)}var h=n.document,o=h.createElement("i"),i=o.style,s=" -o- -moz- -ms- -webkit- -khtml- ".split(" "),c="Webkit Moz O ms Khtml".split(" "),l=n.head_conf&&n.head_conf.head||"head",u=n[l],f={gradient:function(){var n="background-image:";return i.cssText=(n+s.join("gradient(linear,left top,right bottom,from(#9f9),to(#fff));"+n)+s.join("linear-gradient(left top,#eee,#fff);"+n)).slice(0,-n.length),!!i.backgroundImage},rgba:function(){return i.cssText="background-color:rgba(0,0,0,0.5)",!!i.backgroundColor},opacity:function(){return o.style.opacity===""},textshadow:function(){return i.textShadow===""},multiplebgs:function(){i.cssText="background:url(https://),url(https://),red url(https://)";var n=(i.background||"").match(/url/g);return Object.prototype.toString.call(n)==="[object Array]"&&n.length===3},boxshadow:function(){return r("boxShadow")},borderimage:function(){return r("borderImage")},borderradius:function(){return r("borderRadius")},cssreflections:function(){return r("boxReflect")},csstransforms:function(){return r("transform")},csstransitions:function(){return r("transition")},touch:function(){return"ontouchstart"in n},retina:function(){return n.devicePixelRatio>1},fontface:function(){var t=u.browser.name,n=u.browser.version;switch(t){case"ie":return n>=9;case"chrome":return n>=13;case"ff":return n>=6;case"ios":return n>=5;case"android":return!1;case"webkit":return n>=5.1;case"opera":return n>=10;default:return!1}}};for(var e in f)f[e]&&u.feature(e,f[e].call(),!0);u.feature()})(window); 5 | /*! head.load - v1.0.3 */ 6 | (function(n,t){"use strict";function w(){}function u(n,t){if(n){typeof n=="object"&&(n=[].slice.call(n));for(var i=0,r=n.length;iparseFloat(c[1]))}(h,g)){var i="Velocity UI Pack: You need to update Velocity (velocity.js) to a newer version. Visit http://github.com/julianshapiro/velocity.";throw alert(i),new Error(i)}e.RegisterEffect=e.RegisterUI=function(a,b){function c(a,b,c,d){var g,h=0;f.each(a.nodeType?[a]:a,function(a,b){d&&(c+=a*d),g=b.parentNode;var i=["height","paddingTop","paddingBottom","marginTop","marginBottom"];"border-box"===e.CSS.getPropertyValue(b,"boxSizing").toString().toLowerCase()&&(i=["height"]),f.each(i,function(a,c){h+=parseFloat(e.CSS.getPropertyValue(b,c))})}),e.animate(g,{height:("In"===b?"+":"-")+"="+h},{queue:!1,easing:"ease-in-out",duration:c*("In"===b?.6:1)})}return e.Redirects[a]=function(d,g,h,i,j,k,l){var m=h===i-1,n=0;l=l||b.loop,"function"==typeof b.defaultDuration?b.defaultDuration=b.defaultDuration.call(j,j):b.defaultDuration=parseFloat(b.defaultDuration);for(var o=0;o=1?0:b.calls.length?(1-n)/b.calls.length:1;for(o=0;o1&&(f.each(b.reverse(),function(a,c){var d=b[a+1];if(d){var g=c.o||c.options,h=d.o||d.options,i=g&&g.sequenceQueue===!1?"begin":"complete",j=h&&h[i],k={};k[i]=function(){var a=d.e||d.elements,b=a.nodeType?[a]:a;j&&j.call(b,b),e(c)},d.o?d.o=f.extend({},h,k):d.options=f.extend({},h,k)}}),b.reverse()),e(b[0])}}(window.jQuery||window.Zepto||window,window,window?window.document:undefined)}); -------------------------------------------------------------------------------- /source/js/transition.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | // page 3 | $('.layout') 4 | .velocity('stop') 5 | .velocity('transition.slideUpIn', { 6 | delay: 500, 7 | duration: 1000, 8 | easing: 'easeInOutQuart', 9 | complete: function () { 10 | if ($('#sidebar').data('display')) { 11 | setTimeout(function () { 12 | $('#toggle-sidebar').click() 13 | }, 200) 14 | } 15 | } 16 | }) 17 | $('#top-container') 18 | .velocity('stop') 19 | .velocity('transition.fadeIn', { 20 | delay: 500, 21 | duration: 1000, 22 | easing: 'easeInOutQuart' 23 | }) 24 | }) 25 | -------------------------------------------------------------------------------- /source/js/utils.js: -------------------------------------------------------------------------------- 1 | function debounce(func, wait, immediate) { 2 | var timeout 3 | return function () { 4 | var context = this 5 | var args = arguments 6 | var later = function () { 7 | timeout = null 8 | if (!immediate) func.apply(context, args) 9 | } 10 | var callNow = immediate && !timeout 11 | clearTimeout(timeout) 12 | timeout = setTimeout(later, wait) 13 | if (callNow) func.apply(context, args) 14 | } 15 | }; 16 | 17 | function throttle(func, wait, mustRun) { 18 | var timeout 19 | var startTime = new Date() 20 | 21 | return function () { 22 | var context = this 23 | var args = arguments 24 | var curTime = new Date() 25 | 26 | clearTimeout(timeout) 27 | if (curTime - startTime >= mustRun) { 28 | func.apply(context, args) 29 | startTime = curTime 30 | } else { 31 | timeout = setTimeout(func, wait) 32 | } 33 | } 34 | }; 35 | 36 | function isMobile() { 37 | var check = false; 38 | (function (a) { if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4))) check = true })(navigator.userAgent || navigator.vendor || window.opera) 39 | return check 40 | }; 41 | 42 | window.debounce = debounce 43 | 44 | window.throttle = throttle 45 | 46 | window.isMobile = isMobile 47 | -------------------------------------------------------------------------------- /source/melody-favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Molunerfinn/hexo-theme-melody/11685c65d503304ad908138c55af5c1cd5dae9e2/source/melody-favicon.ico -------------------------------------------------------------------------------- /stylus_format.json: -------------------------------------------------------------------------------- 1 | { 2 | "insertColons": true, 3 | "insertSemicolons": false, 4 | "insertBraces": false, 5 | "insertNewLineAroundImports": true, 6 | "insertNewLineAroundBlocks": true, 7 | "insertNewLineAroundProperties": false, 8 | "insertNewLineAroundOthers": false, 9 | "insertNewLineBetweenSelectors": true, 10 | "insertSpaceBeforeComment": true, 11 | "insertSpaceAfterComment": true, 12 | "insertSpaceAfterComma": true, 13 | "insertSpaceInsideParenthesis": false, 14 | "insertParenthesisAroundIfCondition": false, 15 | "insertNewLineBeforeElse": false, 16 | "insertParenthesisAroundNegatedVariable": false, 17 | "insertLeadingZeroBeforeFraction": false, 18 | "quoteChar": "'", 19 | "sortProperties": "grouped", 20 | "alwaysUseImport": false, 21 | "alwaysUseNot": false, 22 | "alwaysUseAtBlock": false, 23 | "alwaysUseExtends": false, 24 | "alwaysUseNoneOverZero": false, 25 | "alwaysUseZeroWithoutUnit": true, 26 | "reduceMarginAndPaddingValues": true 27 | } --------------------------------------------------------------------------------