├── .all-contributorsrc ├── .eslintignore ├── .eslintrc ├── .github └── workflows │ └── pages.yml ├── .gitignore ├── LICENSE ├── README.md ├── _config.yml.example ├── languages ├── default.yml ├── en.yml ├── zh-CN.yml └── zh-TW.yml ├── layout ├── _macro │ ├── archive.ejs │ └── post.ejs ├── _partial │ ├── _footer │ │ └── social.ejs │ ├── _head │ │ └── meta.ejs │ ├── _post │ │ ├── copyright.ejs │ │ ├── reward.ejs │ │ └── toc.ejs │ ├── comments.ejs │ ├── footer.ejs │ ├── head.ejs │ ├── header.ejs │ ├── pagination.ejs │ ├── slideout.ejs │ └── title.ejs ├── _script │ ├── _analytics │ │ ├── baidu-analytics.ejs │ │ └── google-analytics.ejs │ ├── _comments │ │ ├── changyan.ejs │ │ ├── cusdis.ejs │ │ ├── disqus.ejs │ │ ├── gitalk.ejs │ │ ├── livere.ejs │ │ └── utterances.ejs │ ├── analytics.ejs │ ├── comments.ejs │ ├── counter.ejs │ ├── libs.ejs │ ├── push.ejs │ └── theme.ejs ├── archive.ejs ├── categories.ejs ├── index.ejs ├── layout.ejs ├── page.ejs ├── post.ejs └── tags.ejs ├── package-lock.json ├── package.json └── source ├── css ├── _base.scss ├── _common │ ├── _animation.scss │ ├── _normalize.scss │ └── _utils.scss ├── _custom │ └── _custom.scss ├── _partial │ ├── _archive.scss │ ├── _back-to-top.scss │ ├── _categories.scss │ ├── _footer.scss │ ├── _footer │ │ ├── _copyright.scss │ │ └── _social.scss │ ├── _header.scss │ ├── _header │ │ ├── _logo.scss │ │ └── _menu.scss │ ├── _iconfont.scss │ ├── _mathjax.scss │ ├── _mobile.scss │ ├── _pagination.scss │ ├── _post.scss │ ├── _post │ │ ├── _code.scss │ │ ├── _content.scss │ │ ├── _copyright.scss │ │ ├── _footer.scss │ │ ├── _header.scss │ │ ├── _reward.scss │ │ └── _toc.scss │ ├── _slideout.scss │ └── _tags.scss ├── _variables.scss └── style.scss ├── favicon.ico ├── fonts └── chancery │ ├── apple-chancery-webfont.eot │ ├── apple-chancery-webfont.svg │ ├── apple-chancery-webfont.ttf │ ├── apple-chancery-webfont.woff │ └── apple-chancery-webfont.woff2 ├── js └── src │ └── even.js ├── lib ├── fancybox │ ├── blank.gif │ ├── fancybox_loading.gif │ ├── fancybox_loading@2x.gif │ ├── fancybox_overlay.png │ ├── fancybox_sprite.png │ ├── fancybox_sprite@2x.png │ ├── helpers │ │ ├── fancybox_buttons.png │ │ ├── jquery.fancybox-buttons.css │ │ ├── jquery.fancybox-buttons.js │ │ ├── jquery.fancybox-media.js │ │ ├── jquery.fancybox-thumbs.css │ │ └── jquery.fancybox-thumbs.js │ ├── jquery.fancybox.css │ ├── jquery.fancybox.js │ └── jquery.fancybox.pack.js ├── jquery │ └── jquery.min.js └── slideout │ ├── slideout.js │ └── slideout.min.js └── robots.txt /.all-contributorsrc: -------------------------------------------------------------------------------- 1 | { 2 | "projectName": "hexo-theme-even", 3 | "projectOwner": "ahonn", 4 | "repoType": "github", 5 | "repoHost": "https://github.com", 6 | "files": [ 7 | "README.md" 8 | ], 9 | "imageSize": 60, 10 | "commit": true, 11 | "commitConvention": "angular", 12 | "contributors": [ 13 | { 14 | "login": "ahonn", 15 | "name": "Yuexun Jiang", 16 | "avatar_url": "https://avatars3.githubusercontent.com/u/9718515?v=4", 17 | "profile": "https://www.ahonn.me", 18 | "contributions": [ 19 | "code", 20 | "doc", 21 | "design", 22 | "ideas" 23 | ] 24 | } 25 | ], 26 | "contributorsPerLine": 7 27 | } 28 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | source/lib 2 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": true 4 | }, 5 | "parserOptions": { 6 | "ecmaVersion": 5, 7 | "ecmaFeatures": { 8 | "impliedStrict": true 9 | } 10 | }, 11 | "globals": { 12 | "$": true, 13 | "AV": true, 14 | "NProgress": true, 15 | "Even": true, 16 | "themeConfig": true, 17 | "Slideout": true 18 | }, 19 | "extends": "eslint:recommended" 20 | } 21 | -------------------------------------------------------------------------------- /.github/workflows/pages.yml: -------------------------------------------------------------------------------- 1 | name: GitHub Pages 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | - demo-source 8 | 9 | jobs: 10 | build: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Checkout branch 14 | uses: actions/checkout@master 15 | with: 16 | ref: demo-source 17 | - name: Use Node.js 18 | uses: actions/setup-node@master 19 | with: 20 | node-version: '18.x' 21 | - name: Cache NPM dependencies 22 | uses: actions/cache@v2 23 | with: 24 | path: node_modules 25 | key: ${{ runner.OS }}-npm-cache 26 | restore-keys: | 27 | ${{ runner.OS }}-npm-cache 28 | - name: Prepare source 29 | run: | 30 | npm install hexo-renderer-ejs hexo-renderer-dartsass --save 31 | git clone -b master https://github.com/ahonn/hexo-theme-even.git themes/even 32 | cp themes/even/_config.yml.example themes/even/_config.yml 33 | - name: Install Dependencies 34 | run: npm install 35 | - name: Build 36 | run: | 37 | npm i -g hexo-cli 38 | hexo generate 39 | - name: Upload Pages artifact 40 | uses: actions/upload-pages-artifact@v2 41 | with: 42 | path: ./public 43 | deploy: 44 | needs: build 45 | permissions: 46 | pages: write 47 | id-token: write 48 | environment: 49 | name: github-pages 50 | url: ${{ steps.deployment.outputs.page_url }} 51 | runs-on: ubuntu-latest 52 | steps: 53 | - name: Deploy to GitHub Pages 54 | id: deployment 55 | uses: actions/deploy-pages@v2 56 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | /node_modules 3 | *.log 4 | /.vscode 5 | _config.yml 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015-current 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # hexo-theme-even 2 | A super simple theme for Hexo 3 | 4 | 5 | 6 | [![GitHub stars](https://img.shields.io/github/stars/ahonn/hexo-theme-even.svg?style=flat-square)](https://github.com/ahonn/hexo-theme-even/stargazers) 7 | [![GitHub forks](https://img.shields.io/github/forks/ahonn/hexo-theme-even.svg?style=flat-square)](https://github.com/ahonn/hexo-theme-even/network) 8 | [![GitHub issues](https://img.shields.io/github/issues/ahonn/hexo-theme-even.svg?style=flat-square)](https://github.com/ahonn/hexo-theme-even/issues) 9 | [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://raw.githubusercontent.com/ahonn/hexo-theme-even/master/LICENSE) 10 | 11 | ## Screenshots 12 | ![even-screenshots](https://ahonn-me.oss-cn-beijing.aliyuncs.com/images/55iw9.png) 13 | 14 | [🔯 Live Preview](https://ahonn.github.io/hexo-theme-even/) 15 | 16 | ## Installation 17 | ```bash 18 | $ npm install hexo-renderer-ejs hexo-renderer-dartsass --save 19 | $ git clone https://github.com/ahonn/hexo-theme-even themes/even 20 | $ cp themes/even/_config.yml.example themes/even/_config.yml 21 | ``` 22 | 23 | Modify `yoursite/_config.yml`: 24 | 25 | ```yaml 26 | # Extensions 27 | ## Plugins: http://hexo.io/plugins/ 28 | ## Themes: http://hexo.io/themes/ 29 | theme: even 30 | ``` 31 | 32 | For more options, check out the [document](https://github.com/ahonn/hexo-theme-even/wiki) 33 | 34 | ## Update 35 | You can update to latest master branch by the following command: 36 | 37 | ```base 38 | $ cd themes/even 39 | $ git pull 40 | ``` 41 | 42 | ## Contributing 43 | Contribution is welcome, feel free to open an issue or pull request. 44 | 45 | ## Contributors 46 | 47 | This project exists thanks to all the people who contribute. 48 | 49 | -------------------------------------------------------------------------------- /_config.yml.example: -------------------------------------------------------------------------------- 1 | # =========================================== 2 | # Site Information Settings 3 | # =========================================== 4 | 5 | # Site creation time 6 | since: 2015 7 | 8 | # Custom your favicon.ico in `site/source` 9 | favicon: /favicon.ico 10 | 11 | # Set feed link (false | default | your feed link) 12 | # false: disable 13 | # default: use `atom.xml`, generator for `hexo-generator-feed` 14 | rss: default 15 | 16 | # =========================================== 17 | # Menu Settings 18 | # =========================================== 19 | menu: 20 | Home: / 21 | # Archives: /archives/ 22 | # Tags: /tags/ 23 | # Categories: /categories/ 24 | # About: /about/ 25 | 26 | # =========================================== 27 | # Theme Settings 28 | # =========================================== 29 | # color: default | mint green | cobalt blue | hot pink | dark violet 30 | color: default 31 | 32 | # default page mode: default | archives 33 | mode: default 34 | 35 | toc: true 36 | 37 | # jQuery fancybox 38 | fancybox: true 39 | 40 | # LaTeX support (via MathJax) 41 | latex: false 42 | 43 | copyright: 44 | enable: true 45 | # https://creativecommons.org/ 46 | license: '知识共享署名-非商业性使用 4.0 国际许可协议' 47 | 48 | reward: 49 | enable: false 50 | qrCode: 51 | wechat: 52 | alipay: 53 | 54 | # =========================================== 55 | # Social links Settings 56 | # =========================================== 57 | social: 58 | email: your@email.com 59 | stack-overflow: 60 | twitter: 61 | facebook: 62 | linkedin: 63 | google: 64 | github: https://github.com/ahonn 65 | weibo: 66 | zhihu: 67 | douban: 68 | pocket: 69 | tumblr: 70 | instagram: 71 | 72 | # =========================================== 73 | # Third Party Services Settings 74 | # =========================================== 75 | 76 | # LeanCloud 77 | leancloud: 78 | app_id: 79 | app_key: 80 | server_url: 81 | cdn: 82 | 83 | # Baidu Analytics 84 | baidu_analytics: 85 | # Baidu Verification 86 | baidu_verification: 87 | 88 | # Baidu push 89 | baidu_push: 90 | 91 | # Google Analytics 92 | google_analytics: 93 | # Google Verification 94 | google_verification: 95 | 96 | # Disqus 97 | disqus_shortname: 98 | 99 | #Changyan 100 | changyan: 101 | appid: 102 | appkey: 103 | 104 | #LiveRe 105 | livere_datauid: 106 | 107 | # Gitalk 108 | # Demo: https://gitalk.github.io 109 | # https://github.com/gitalk/gitalk 110 | gitalk: 111 | enable: false 112 | github_id: GitHub repo owner 113 | repo: GitHub repo 114 | client_id: GitHub Application Client ID 115 | client_secret: GitHub Application Client Secret 116 | admin_user: GitHub repo owner and collaborators, only these guys can initialize github issues 117 | distraction_free_mode: true # Facebook-like distraction free mode 118 | # Gitalk's display language depends on user's browser or system environment 119 | # If you want everyone visiting your site to see a uniform language, you can set a force language value 120 | # Available values: en, es-ES, fr, ru, zh-CN, zh-TW 121 | language: 122 | 123 | # utterances 124 | # Docs: https://utteranc.es/ 125 | # Tips: Make sure you have installed [utterances app](https://github.com/apps/utterances) in your repo 126 | utterances: 127 | enable: false 128 | repo: owner/repo # Repository 129 | issueTerm: title # Blog post ↔️ issue mapping: pathname | url | title | og:title 130 | theme: github-light # Theme: github-light | github-dark | github-dark-orange | icy-dark | dark-blue | photon-dark 131 | label: utterances # Issue label 132 | 133 | # =========================================== 134 | # Version 135 | # =========================================== 136 | version: 3.0.0 137 | -------------------------------------------------------------------------------- /languages/default.yml: -------------------------------------------------------------------------------- 1 | menu: 2 | home: Home 3 | archives: Archives 4 | tags: Tags 5 | categories: Categories 6 | about: About 7 | 8 | footer: 9 | powered: "Powered by %s" 10 | theme: Theme 11 | 12 | posts: 13 | prev: Prev 14 | next: Next 15 | prev_post: Prev 16 | next_post: Next 17 | toc: Contents 18 | readmore: Read more.. 19 | visits: Visits 20 | reward: 'Reward' 21 | 22 | copyright: 23 | author: 'Author' 24 | link: 'Link' 25 | license: 'License' 26 | 27 | counter: 28 | archives: 29 | zero: No Posts 30 | one: 1 Post 31 | other: "%d Posts In Total" 32 | 33 | tagcloud: 34 | zero: No tags 35 | one: 1 Tag In Total 36 | other: "%d Tags In Total" 37 | 38 | categories: 39 | zero: No Categories 40 | one: 1 Category In Total 41 | other: "%d Categories In Total" 42 | -------------------------------------------------------------------------------- /languages/en.yml: -------------------------------------------------------------------------------- 1 | menu: 2 | home: Home 3 | archives: Archives 4 | tags: Tags 5 | categories: Categories 6 | about: About 7 | 8 | footer: 9 | powered: "Powered by %s" 10 | theme: Theme 11 | 12 | posts: 13 | prev: Prev 14 | next: Next 15 | prev_post: Prev 16 | next_post: Next 17 | toc: Contents 18 | readmore: Read more.. 19 | visits: Visits 20 | reward: 'Reward' 21 | 22 | copyright: 23 | author: 'Author' 24 | link: 'Link' 25 | license: 'License' 26 | 27 | counter: 28 | archives: 29 | zero: No Posts 30 | one: 1 Post 31 | other: "%d Posts In Total" 32 | 33 | tagcloud: 34 | zero: No tags 35 | one: 1 Tag In Total 36 | other: "%d Tags In Total" 37 | 38 | categories: 39 | zero: No Categories 40 | one: 1 Category In Total 41 | other: "%d Categories In Total" 42 | -------------------------------------------------------------------------------- /languages/zh-CN.yml: -------------------------------------------------------------------------------- 1 | menu: 2 | home: 首页 3 | archives: 归档 4 | tags: 标签 5 | categories: 分类 6 | about: 关于 7 | 8 | footer: 9 | powered: "由 %s 强力驱动" 10 | theme: 主题 11 | 12 | posts: 13 | prev: 上一页 14 | next: 下一页 15 | prev_post: 上一篇 16 | next_post: 下一篇 17 | toc: 文章目录 18 | readmore: 阅读更多 19 | visits: '阅读次数' 20 | reward: '赞赏支持' 21 | 22 | copyright: 23 | author: '原文作者' 24 | link: '原文链接' 25 | license: '许可协议' 26 | 27 | counter: 28 | archives: 29 | zero: 暂无日志 30 | one: 目前共计 1 篇日志 31 | other: "目前共计 %d 篇日志" 32 | 33 | tagcloud: 34 | zero: 暂无标签 35 | one: 目前共计 1 个标签 36 | other: "目前共计 %d 个标签" 37 | 38 | categories: 39 | zero: 暂无分类 40 | one: 目前共计 1 个分类 41 | other: "目前共计 %d 个分类" 42 | -------------------------------------------------------------------------------- /languages/zh-TW.yml: -------------------------------------------------------------------------------- 1 | menu: 2 | home: 首頁 3 | archives: 歸檔 4 | tags: 標籤 5 | categories: 分類 6 | about: 關於 7 | 8 | footer: 9 | powered: "由 %s 技術提供" 10 | theme: 主題 11 | 12 | posts: 13 | prev: 上一頁 14 | next: 下一頁 15 | prev_post: 上一篇 16 | next_post: 下一篇 17 | toc: 文章目錄 18 | readmore: 閱讀更多 19 | visits: '閱讀次數' 20 | reward: '讚賞支持' 21 | 22 | copyright: 23 | author: '原文作者' 24 | link: '原文鏈結' 25 | license: '授權' 26 | 27 | counter: 28 | archives: 29 | zero: 暫無文章 30 | one: 目前總計 1 篇文章 31 | other: "目前總計 %d 篇文章" 32 | 33 | tagcloud: 34 | zero: 暫無文章 35 | one: 目前總計 1 個標籤 36 | other: "目前總計 %d 個標籤" 37 | 38 | categories: 39 | zero: 暫無分類 40 | one: 目前總計 1 個分類 41 | other: "目前總計 %d 個分類" 42 | -------------------------------------------------------------------------------- /layout/_macro/archive.ejs: -------------------------------------------------------------------------------- 1 | <% 2 | var isArchivesPage = !!page.archive; 3 | var isArchivesMode = theme.mode.toLowerCase() === 'archives'; 4 | %> 5 | 6 |
7 | <% if (!page.prev) { %> 8 | <% if (page.tag) { %> 9 |
10 |

<%= page.tag %>

11 |
12 | <% } else if (page.category) { %> 13 |
14 |

<%= page.category %>

15 |
16 | <% } else if (isArchivesPage) { %> 17 |
18 | 19 | <%= _p("counter.archives", site.posts.length) %> 20 | 21 |
22 | <% } %> 23 | <% } %> 24 | 25 | <% var year; %> 26 | <% page.posts.forEach(function(post) { %> 27 | <% if (isArchivesPage || isArchivesMode) { %> 28 | <% post.year = date(post.date, 'YYYY'); %> 29 | <% if (post.year !== year) { %> 30 | <% year = post.year; %> 31 |
32 |

33 | <%= year %> 34 |

35 |
36 | <% } %> 37 | <% } %> 38 | 39 |
40 | 41 | <% if (isArchivesPage || isArchivesMode) { %> 42 | <%= date(post.date, 'MM-DD') %> 43 | <% } else { %> 44 | <%= date(post.date, 'YYYY-MM-DD') %> 45 | <% } %> 46 | 47 | 48 | 49 | <%= post.title %> 50 | 51 | 52 |
53 | <% }); %> 54 |
55 | 56 | <%- partial('../_partial/pagination.ejs') %> -------------------------------------------------------------------------------- /layout/_macro/post.ejs: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | <% if (is_home()) { %> 5 | <%= post.title %> 6 | <% } else { %> 7 | <%= post.title %> 8 | <% } %> 9 |

10 | 11 | 33 |
34 | 35 | <%- partial("../_partial/_post/toc.ejs") %> 36 | 37 |
38 | <% if (is_home()) { %> 39 | <% var excerpt = ""; %> 40 | <% if (post.description) { %> 41 | <% excerpt = '

' + post.description + '

'; %> 42 | <% } else if (post.excerpt) { %> 43 | <% excerpt = post.excerpt; %> 44 | <% } %> 45 | 46 | <% if (excerpt) { %> 47 | <%- excerpt %> 48 | 51 | <% } else { %> 52 | <%- post.content %> 53 | <% } %> 54 | <% } else { %> 55 | <%- post.content %> 56 | <% } %> 57 |
58 | 59 | <% if (!is_home()) { %> 60 | <%- partial("../_partial/_post/copyright.ejs") %> 61 | <%- partial("../_partial/_post/reward.ejs") %> 62 | <% } %> 63 | 64 | <% if (!is_home()) { %> 65 | 75 | <% } %> 76 | 77 |
-------------------------------------------------------------------------------- /layout/_partial/_footer/social.ejs: -------------------------------------------------------------------------------- 1 | <% if (theme.social) { %> 2 | 23 | <% } %> 24 | -------------------------------------------------------------------------------- /layout/_partial/_head/meta.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | <% if (page.description) { %> 16 | 17 | <% } else if (page.title) { %> 18 | 19 | <% } else if (config.description) { %> 20 | 21 | <% } %> 22 | 23 | 24 | <% if (page.keywords) { %> 25 | 26 | <% } else if (config.keywords) { %> 27 | 28 | <% } else if (page.tags && page.tags.length) { %> 29 | 30 | <% } %> 31 | <% if (theme.baidu_verification) { %> 32 | 33 | <% } %> 34 | <% if (theme.google_verification) { %> 35 | 36 | <% } %> -------------------------------------------------------------------------------- /layout/_partial/_post/copyright.ejs: -------------------------------------------------------------------------------- 1 | 2 | <% if (theme.copyright.enable && page.copyright !== false) { %> 3 |
4 | 8 | 12 | 17 |
18 | <% } %> -------------------------------------------------------------------------------- /layout/_partial/_post/reward.ejs: -------------------------------------------------------------------------------- 1 | <% if ((theme.reward.enable && page.reward !== false) || page.reward === true) { %> 2 |
3 | 4 | 5 |
6 | <% var qrCode = theme.reward.qrCode; %> 7 | <% if (qrCode.wechat) { %> 8 | 11 | <% } %> 12 | <% if (qrCode.alipay) { %> 13 | 16 | <% } %> 17 |
18 |
19 | <% } %> 20 | -------------------------------------------------------------------------------- /layout/_partial/_post/toc.ejs: -------------------------------------------------------------------------------- 1 | <% if (!is_home() && toc(page.content) && !!theme.toc) { %> 2 |
3 |

<%- __('posts.toc') %>

4 |
5 | <%- toc(page.content, theme.toc) %> 6 |
7 |
8 | <% } %> -------------------------------------------------------------------------------- /layout/_partial/comments.ejs: -------------------------------------------------------------------------------- 1 | <% if (page.comments && !is_home()) { %> 2 |
3 | <% if (theme.disqus_shortname) { %> 4 |
5 | 9 |
10 | <% } else if (theme.livere_datauid) { %> 11 |
12 | 13 |
14 | <% } else if (theme.gitalk && theme.gitalk.enable) { %> 15 |
16 | <% } else if (theme.utterances && theme.utterances.enable) { %> 17 |
18 | <% } else if (theme.cusdis && theme.cusdis.app_id) { %> 19 |
26 | <% } %> 27 |
28 | <% } %> 29 | -------------------------------------------------------------------------------- /layout/_partial/footer.ejs: -------------------------------------------------------------------------------- 1 | 2 | <%- partial ("./_footer/social.ejs") %> 3 | 4 | -------------------------------------------------------------------------------- /layout/_partial/head.ejs: -------------------------------------------------------------------------------- 1 | 2 | <%- partial ("./_head/meta.ejs") %> 3 | 4 | 5 | <% if (theme.rss === 'default' && config.feed && config.feed.path) { %> 6 | <%- feed_tag(config.feed.path) %> 7 | <% } else if (theme.rss) { %> 8 | <%- feed_tag(theme.rss) %> 9 | <% } else { %> 10 | <%- feed_tag('atom.xml') %> 11 | <% } %> 12 | 13 | 14 | <% if (theme.favicon) { %> 15 | 16 | <% } %> 17 | 18 | 19 | 20 | 21 | 22 | <% if (theme.fancybox) { %> 23 | 24 | <% } %> 25 | 26 | 27 | <% if (theme.latex) { %> 28 | 31 | 32 | <% } %> 33 | 34 | 35 | 36 | 37 | 38 | <% if (!env.debug) { %> 39 | <%- partial ("../_script/analytics.ejs") %> 40 | <%- partial ("../_script/push.ejs") %> 41 | <% } %> 42 | 43 | 44 | <%- partial ("../_script/counter.ejs") %> 45 | <% var themeConfig = { leancloud: theme.leancloud, toc: theme.toc, fancybox: theme.fancybox, pjax: theme.pjax, latex: theme.latex }; %> 46 | -------------------------------------------------------------------------------- /layout/_partial/header.ejs: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 | 23 | -------------------------------------------------------------------------------- /layout/_partial/pagination.ejs: -------------------------------------------------------------------------------- 1 | <% if (!is_post()) { %> 2 | 16 | <% } else { %> 17 | 33 | <% } %> 34 | -------------------------------------------------------------------------------- /layout/_partial/slideout.ejs: -------------------------------------------------------------------------------- 1 |
2 | 5 |
6 | 7 | 8 | 9 |
10 |
11 | 12 | -------------------------------------------------------------------------------- /layout/_partial/title.ejs: -------------------------------------------------------------------------------- 1 | <%= title %> -------------------------------------------------------------------------------- /layout/_script/_analytics/baidu-analytics.ejs: -------------------------------------------------------------------------------- 1 | <% if (theme.baidu_analytics) { %> 2 | 11 | <% } %> -------------------------------------------------------------------------------- /layout/_script/_analytics/google-analytics.ejs: -------------------------------------------------------------------------------- 1 | <% if (theme.google_analytics) { %> 2 | 3 | 4 | 14 | <% } %> -------------------------------------------------------------------------------- /layout/_script/_comments/changyan.ejs: -------------------------------------------------------------------------------- 1 | <% if (theme.changyan.appid && theme.changyan.appkey) { %> 2 | 3 |
4 | 42 | <% } %> -------------------------------------------------------------------------------- /layout/_script/_comments/cusdis.ejs: -------------------------------------------------------------------------------- 1 | <% if (theme.cusdis && theme.cusdis.enable) { %> 2 | 3 | <% } %> -------------------------------------------------------------------------------- /layout/_script/_comments/disqus.ejs: -------------------------------------------------------------------------------- 1 | <% if (theme.disqus_shortname) { %> 2 | 18 | <% } %> -------------------------------------------------------------------------------- /layout/_script/_comments/gitalk.ejs: -------------------------------------------------------------------------------- 1 | <% if (theme.gitalk.enable) { %> 2 | <% var gitalk_js_url = '//cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js'; %> 3 | 4 | 5 | <% var gitalk_css_url = '//cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.css'; %> 6 | 7 | 8 | <% var md5_url = '//cdn.jsdelivr.net/npm/js-md5@0.7.3/src/md5.min.js'; %> 9 | 10 | 11 | 28 | 29 | <% } %> -------------------------------------------------------------------------------- /layout/_script/_comments/livere.ejs: -------------------------------------------------------------------------------- 1 | <% if (theme.livere_datauid) { %> 2 | 15 | <% } %> -------------------------------------------------------------------------------- /layout/_script/_comments/utterances.ejs: -------------------------------------------------------------------------------- 1 | <% if (theme.utterances && theme.utterances.enable) { %> 2 | 15 | <% } %> -------------------------------------------------------------------------------- /layout/_script/analytics.ejs: -------------------------------------------------------------------------------- 1 | <%- partial("_analytics/baidu-analytics.ejs") %> 2 | <%- partial("_analytics/google-analytics.ejs") %> -------------------------------------------------------------------------------- /layout/_script/comments.ejs: -------------------------------------------------------------------------------- 1 | <% if (!is_home() && !is_archive()) { %> 2 | <%- partial("_comments/disqus.ejs") %> 3 | <%- partial("_comments/changyan.ejs") %> 4 | <%- partial("_comments/livere.ejs") %> 5 | <%- partial("_comments/gitalk.ejs") %> 6 | <%- partial("_comments/utterances.ejs") %> 7 | <%- partial("_comments/cusdis.ejs") %> 8 | <% } %> 9 | -------------------------------------------------------------------------------- /layout/_script/counter.ejs: -------------------------------------------------------------------------------- 1 | <% if (theme.leancloud && theme.leancloud.app_id && theme.leancloud.app_key) { %> 2 | 3 | 9 | <% } %> -------------------------------------------------------------------------------- /layout/_script/libs.ejs: -------------------------------------------------------------------------------- 1 | <% if (theme.fancybox) { %> 2 | <% var fancybox_js = 'fancybox/jquery.fancybox.pack.js' %> 3 | <% } %> 4 | 5 | <% 6 | var js_libs = { 7 | jquery: 'jquery/jquery.min.js', 8 | slideout: 'slideout/slideout.js', 9 | fancybox: fancybox_js, 10 | } 11 | %> 12 | 13 | <% for (var lib in js_libs) { %> 14 | <% if (lib) { %> 15 | 16 | <% } %> 17 | <% } %> 18 | -------------------------------------------------------------------------------- /layout/_script/push.ejs: -------------------------------------------------------------------------------- 1 | <% if (theme.baidu_push) { %> 2 | 16 | <% } %> 17 | -------------------------------------------------------------------------------- /layout/_script/theme.ejs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /layout/archive.ejs: -------------------------------------------------------------------------------- 1 | <%- partial('_macro/archive.ejs', {page: page}) %> -------------------------------------------------------------------------------- /layout/categories.ejs: -------------------------------------------------------------------------------- 1 |
2 |
3 | <%- _p('counter.categories', site.categories.length) %> 4 |
5 |
6 | <%- list_categories({style: null, separator: ' ', depth: '-1'}) %> 7 |
8 |
-------------------------------------------------------------------------------- /layout/index.ejs: -------------------------------------------------------------------------------- 1 |
2 | <% var mode = theme.mode.toLowerCase(); %> 3 | <% if (mode == 'default') { %> 4 | <% page.posts.each(function(post) { %> 5 | <%- partial('_macro/post.ejs', {post: post}) %> 6 | <% }); %> 7 | <%- partial("_partial/pagination.ejs") %> 8 | <% } else { %> 9 | <%- partial('_macro/archive.ejs') %> 10 | <% } %> 11 |
-------------------------------------------------------------------------------- /layout/layout.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | <%- partial('_partial/head.ejs') %> 6 | <% 7 | var title; 8 | if (is_home()){ 9 | title = config.title; 10 | } else if (page.archive){ 11 | if (is_month()){ 12 | title = __('menu.archives') + ' - ' + page.year + '/' + page.month + ' · ' + config.title; 13 | } else if (is_year()){ 14 | title = __('menu.archives') + ' - ' + page.year + ' · ' + config.title; 15 | } else { 16 | title = __('menu.archives') + ' · ' + config.title; 17 | } 18 | } else if (is_category()){ 19 | title = page.category + ' · ' + config.title; 20 | } else if (is_tag()){ 21 | title = page.tag + ' · ' + config.title; 22 | } else if (is_page() && page.title){ 23 | title = __('menu.' + page.title.toLowerCase()) + ' · ' + config.title; 24 | } else { 25 | title = page.title + ' - ' + config.title; 26 | } 27 | %> 28 | <%- partial("_partial/title.ejs", {title: title}) %> 29 | 30 | 31 | 32 | 33 |
34 | <%- partial('_partial/slideout.ejs') %> 35 |
36 | 39 |
40 |
41 |
42 | <%- body %> 43 |
44 | <%- partial('_partial/comments.ejs') %> 45 |
46 |
47 | 50 |
51 |
52 | <%- partial('_script/comments.ejs') %> 53 | <%- partial('_script/libs.ejs') %> 54 | <%- partial('_script/theme.ejs') %> 55 | 56 | 57 | -------------------------------------------------------------------------------- /layout/page.ejs: -------------------------------------------------------------------------------- 1 |
2 |
3 | <%- page.content %> 4 |
5 |
-------------------------------------------------------------------------------- /layout/post.ejs: -------------------------------------------------------------------------------- 1 | <%- partial('_macro/post.ejs', {post: page}) %> -------------------------------------------------------------------------------- /layout/tags.ejs: -------------------------------------------------------------------------------- 1 |
2 |
3 | <%- _p('counter.tagcloud', site.tags.length) %> 4 |
5 |
6 | <%- tagcloud({min_font: 16, max_font: 28, amount: 100, orderby: 'count'}) %> 7 |
8 |
-------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hexo-theme-even", 3 | "version": "3.0.0", 4 | "description": "A super simple theme for Hexo", 5 | "main": "index.js", 6 | "keywords": [ 7 | "responsive", 8 | "simple", 9 | "light" 10 | ], 11 | "author": "ahonn", 12 | "license": "MIT", 13 | "repository": { 14 | "type": "git", 15 | "url": "git+https://github.com/ahonn/hexo-theme-even.git" 16 | }, 17 | "bugs": { 18 | "url": "https://github.com/ahonn/hexo-theme-even/issues" 19 | }, 20 | "homepage": "https://github.com/ahonn/hexo-theme-even#readme", 21 | "devDependencies": { 22 | "all-contributors-cli": "^6.9.1", 23 | "eslint": "^6.5.1" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /source/css/_base.scss: -------------------------------------------------------------------------------- 1 | @import '_common/normalize'; 2 | 3 | html { 4 | font-size: $global-font-size; 5 | box-sizing: border-box; 6 | } 7 | 8 | body { 9 | padding: 0; 10 | margin: 0; 11 | font-family: $global-font-family; 12 | font-weight: normal; 13 | -webkit-font-smoothing: antialiased; 14 | -moz-osx-font-smoothing: grayscale; 15 | line-height: $global-lineheight; 16 | color: $global-font-color; 17 | background: $global-background; 18 | scroll-behavior: smooth; 19 | border-top: 3px solid $theme-color; 20 | 21 | &.hide-top { 22 | border-top: 3px solid transparent; 23 | } 24 | } 25 | 26 | @include max-screen() { 27 | body { 28 | border-top: 0; 29 | } 30 | } 31 | 32 | ::selection { 33 | background: $theme-color; 34 | color: #fff; 35 | } 36 | 37 | // ::-webkit-scrollbar { 38 | // width: 8px; 39 | // height: 6px; 40 | // } 41 | 42 | // ::-webkit-scrollbar-thumb { 43 | // background: lighten($theme-color, 10%); 44 | // border-radius: 5px; 45 | // } 46 | 47 | // ::-webkit-scrollbar-track { 48 | // background: rgba(211, 211, 211, 0.4); 49 | // border-radius: 5px; 50 | // } 51 | 52 | img { 53 | max-width: 100%; 54 | height: auto; 55 | display: inline-block; 56 | vertical-align: middle; 57 | } 58 | 59 | a { 60 | color: $global-font-color; 61 | text-decoration: none; 62 | } 63 | 64 | @each $header, $size in $global-headings { 65 | #{$header} { 66 | font-size: $size; 67 | font-family: $global-serif-font-family; 68 | } 69 | } 70 | 71 | .container { 72 | margin: 0 auto; 73 | width: $global-body-width; 74 | } 75 | 76 | @include max-screen() { 77 | .container { 78 | width: 100%; 79 | box-shadow: -1px -5px 5px $gray; 80 | } 81 | } 82 | 83 | .content-wrapper { 84 | padding: $global-container-padding; 85 | } 86 | 87 | // make video fluid: 88 | // https://css-tricks.com/NetMag/FluidWidthVideo/Article-FluidWidthVideo.php 89 | // class video-container is the wrapper used by hexo youtube tag plugin 90 | .video-container { 91 | position: relative; 92 | padding-bottom: 56.25%; /* 16:9 */ 93 | padding-top: 25px; 94 | height: 0; 95 | } 96 | .video-container iframe { 97 | position: absolute; 98 | top: 0; 99 | left: 0; 100 | width: 100%; 101 | height: 100%; 102 | } 103 | -------------------------------------------------------------------------------- /source/css/_common/_animation.scss: -------------------------------------------------------------------------------- 1 | @mixin underline-from-center() { 2 | display: inline-block; 3 | vertical-align: middle; 4 | transform: translateZ(0); 5 | backface-visibility: hidden; 6 | box-shadow: 0 0 1px transparent; 7 | position: relative; 8 | overflow: hidden; 9 | 10 | &:before { 11 | content: ''; 12 | position: absolute; 13 | z-index: -1; 14 | height: 2px; 15 | bottom: 0; 16 | left: 51%; 17 | right: 51%; 18 | background: $theme-color; 19 | transition-duration: 0.2s; 20 | transition-property: right, left; 21 | transition-timing-function: ease-out; 22 | } 23 | 24 | &.active, 25 | &:active, 26 | &:focus, 27 | &:hover { 28 | &:before { 29 | right: 0; 30 | left: 0; 31 | } 32 | } 33 | } 34 | 35 | @mixin mobile-menu-icon() { 36 | @keyframes clickfirst { 37 | 0% { 38 | transform: translateY(6px) rotate(0deg); 39 | 40 | } 41 | 42 | 100% { 43 | transform: translateY(0) rotate(45deg); 44 | } 45 | } 46 | 47 | @keyframes clickmid { 48 | 0% { 49 | opacity: 1; 50 | } 51 | 52 | 100% { 53 | opacity: 0; 54 | } 55 | } 56 | 57 | @keyframes clicklast { 58 | 0% { 59 | transform: translateY(-6px) rotate(0deg); 60 | } 61 | 62 | 100% { 63 | transform: translateY(0) rotate(-45deg); 64 | } 65 | } 66 | 67 | @keyframes outfirst { 68 | 0% { 69 | transform: translateY(0) rotate(-45deg); 70 | } 71 | 72 | 100% { 73 | transform: translateY(-6px) rotate(0deg); 74 | } 75 | } 76 | 77 | @keyframes outmid { 78 | 0% { 79 | opacity: 0; 80 | } 81 | 82 | 100% { 83 | opacity: 1; 84 | } 85 | } 86 | 87 | @keyframes outlast { 88 | 0% { 89 | transform: translateY(0) rotate(45deg); 90 | } 91 | 92 | 100% { 93 | transform: translateY(6px) rotate(0deg); 94 | } 95 | } 96 | 97 | span { 98 | position: absolute; 99 | left: calc((100% - 20px) / 2); 100 | top: calc((100% - 1px) / 2); 101 | width: 20px; 102 | height: 1px; 103 | background-color: $theme-color; 104 | 105 | &:nth-child(1) { 106 | transform: translateY(6px) rotate(0deg); 107 | } 108 | 109 | &:nth-child(3) { 110 | transform: translateY(-6px) rotate(0deg); 111 | } 112 | } 113 | 114 | &.icon-click { 115 | span:nth-child(1) { 116 | animation-duration: 0.5s; 117 | animation-fill-mode: both; 118 | animation-name: clickfirst; 119 | } 120 | 121 | span:nth-child(2) { 122 | animation-duration: 0.2s; 123 | animation-fill-mode: both; 124 | animation-name: clickmid; 125 | } 126 | 127 | span:nth-child(3) { 128 | animation-duration: 0.5s; 129 | animation-fill-mode: both; 130 | animation-name: clicklast; 131 | } 132 | } 133 | 134 | &.icon-out { 135 | span:nth-child(1) { 136 | animation-duration: 0.5s; 137 | animation-fill-mode: both; 138 | animation-name: outfirst; 139 | } 140 | 141 | span:nth-child(2) { 142 | animation-duration: 0.2s; 143 | animation-fill-mode: both; 144 | animation-name: outmid; 145 | } 146 | 147 | span:nth-child(3) { 148 | animation-duration: 0.5s; 149 | animation-fill-mode: both; 150 | animation-name: outlast; 151 | } 152 | } 153 | } -------------------------------------------------------------------------------- /source/css/_common/_normalize.scss: -------------------------------------------------------------------------------- 1 | /*! normalize.css v3.0.2 | MIT License | git.io/normalize */ 2 | 3 | /** 4 | * 1. Set default font family to sans-serif. 5 | * 2. Prevent iOS text size adjust after orientation change, without disabling 6 | * user zoom. 7 | */ 8 | 9 | html { 10 | font-family: sans-serif; /* 1 */ 11 | -ms-text-size-adjust: 100%; /* 2 */ 12 | -webkit-text-size-adjust: 100%; /* 2 */ 13 | } 14 | 15 | /** 16 | * Remove default margin. 17 | */ 18 | 19 | body { 20 | margin: 0; 21 | } 22 | 23 | /* HTML5 display definitions 24 | ========================================================================== */ 25 | 26 | /** 27 | * Correct `block` display not defined for any HTML5 element in IE 8/9. 28 | * Correct `block` display not defined for `details` or `summary` in IE 10/11 29 | * and Firefox. 30 | * Correct `block` display not defined for `main` in IE 11. 31 | */ 32 | 33 | article, 34 | aside, 35 | details, 36 | figcaption, 37 | figure, 38 | footer, 39 | header, 40 | hgroup, 41 | main, 42 | menu, 43 | nav, 44 | section, 45 | summary { 46 | display: block; 47 | } 48 | 49 | /** 50 | * 1. Correct `inline-block` display not defined in IE 8/9. 51 | * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. 52 | */ 53 | 54 | audio, 55 | canvas, 56 | progress, 57 | video { 58 | display: inline-block; /* 1 */ 59 | vertical-align: baseline; /* 2 */ 60 | } 61 | 62 | /** 63 | * Prevent modern browsers from displaying `audio` without controls. 64 | * Remove excess height in iOS 5 devices. 65 | */ 66 | 67 | audio:not([controls]) { 68 | display: none; 69 | height: 0; 70 | } 71 | 72 | /** 73 | * Address `[hidden]` styling not present in IE 8/9/10. 74 | * Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22. 75 | */ 76 | 77 | [hidden], 78 | template { 79 | display: none; 80 | } 81 | 82 | /* Links 83 | ========================================================================== */ 84 | 85 | /** 86 | * Remove the gray background color from active links in IE 10. 87 | */ 88 | 89 | a { 90 | background-color: transparent; 91 | } 92 | 93 | /** 94 | * Improve readability when focused and also mouse hovered in all browsers. 95 | */ 96 | 97 | a:active, 98 | a:hover { 99 | outline: 0; 100 | } 101 | 102 | /* Text-level semantics 103 | ========================================================================== */ 104 | 105 | /** 106 | * Address styling not present in IE 8/9/10/11, Safari, and Chrome. 107 | */ 108 | 109 | abbr[title] { 110 | border-bottom: 1px dotted; 111 | } 112 | 113 | /** 114 | * Address style set to `bolder` in Firefox 4+, Safari, and Chrome. 115 | */ 116 | 117 | b, 118 | strong { 119 | font-weight: bold; 120 | } 121 | 122 | /** 123 | * Address styling not present in Safari and Chrome. 124 | */ 125 | 126 | dfn { 127 | font-style: italic; 128 | } 129 | 130 | /** 131 | * Address variable `h1` font-size and margin within `section` and `article` 132 | * contexts in Firefox 4+, Safari, and Chrome. 133 | */ 134 | 135 | h1 { 136 | font-size: 2em; 137 | margin: 0.67em 0; 138 | } 139 | 140 | /** 141 | * Address styling not present in IE 8/9. 142 | */ 143 | 144 | mark { 145 | background: #ff0; 146 | color: #000; 147 | } 148 | 149 | /** 150 | * Address inconsistent and variable font size in all browsers. 151 | */ 152 | 153 | small { 154 | font-size: 80%; 155 | } 156 | 157 | /** 158 | * Prevent `sub` and `sup` affecting `line-height` in all browsers. 159 | */ 160 | 161 | sub, 162 | sup { 163 | font-size: 75%; 164 | line-height: 0; 165 | position: relative; 166 | vertical-align: baseline; 167 | } 168 | 169 | sup { 170 | top: -0.5em; 171 | } 172 | 173 | sub { 174 | bottom: -0.25em; 175 | } 176 | 177 | /* Embedded content 178 | ========================================================================== */ 179 | 180 | /** 181 | * Remove border when inside `a` element in IE 8/9/10. 182 | */ 183 | 184 | img { 185 | border: 0; 186 | } 187 | 188 | /** 189 | * Correct overflow not hidden in IE 9/10/11. 190 | */ 191 | 192 | svg:not(:root) { 193 | overflow: hidden; 194 | } 195 | 196 | /* Grouping content 197 | ========================================================================== */ 198 | 199 | /** 200 | * Address margin not present in IE 8/9 and Safari. 201 | */ 202 | 203 | figure { 204 | margin: 1em 40px; 205 | } 206 | 207 | /** 208 | * Address differences between Firefox and other browsers. 209 | */ 210 | 211 | hr { 212 | -moz-box-sizing: content-box; 213 | box-sizing: content-box; 214 | height: 0; 215 | } 216 | 217 | /** 218 | * Contain overflow in all browsers. 219 | */ 220 | 221 | pre { 222 | overflow: auto; 223 | } 224 | 225 | /** 226 | * Address odd `em`-unit font size rendering in all browsers. 227 | */ 228 | 229 | code, 230 | kbd, 231 | pre, 232 | samp { 233 | font-family: monospace, monospace; 234 | font-size: 1em; 235 | } 236 | 237 | /* Forms 238 | ========================================================================== */ 239 | 240 | /** 241 | * Known limitation: by default, Chrome and Safari on OS X allow very limited 242 | * styling of `select`, unless a `border` property is set. 243 | */ 244 | 245 | /** 246 | * 1. Correct color not being inherited. 247 | * Known issue: affects color of disabled elements. 248 | * 2. Correct font properties not being inherited. 249 | * 3. Address margins set differently in Firefox 4+, Safari, and Chrome. 250 | */ 251 | 252 | button, 253 | input, 254 | optgroup, 255 | select, 256 | textarea { 257 | color: inherit; /* 1 */ 258 | font: inherit; /* 2 */ 259 | margin: 0; /* 3 */ 260 | } 261 | 262 | /** 263 | * Address `overflow` set to `hidden` in IE 8/9/10/11. 264 | */ 265 | 266 | button { 267 | overflow: visible; 268 | } 269 | 270 | /** 271 | * Address inconsistent `text-transform` inheritance for `button` and `select`. 272 | * All other form control elements do not inherit `text-transform` values. 273 | * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera. 274 | * Correct `select` style inheritance in Firefox. 275 | */ 276 | 277 | button, 278 | select { 279 | text-transform: none; 280 | } 281 | 282 | /** 283 | * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` 284 | * and `video` controls. 285 | * 2. Correct inability to style clickable `input` types in iOS. 286 | * 3. Improve usability and consistency of cursor style between image-type 287 | * `input` and others. 288 | */ 289 | 290 | button, 291 | html input[type="button"], /* 1 */ 292 | input[type="reset"], 293 | input[type="submit"] { 294 | -webkit-appearance: button; /* 2 */ 295 | cursor: pointer; /* 3 */ 296 | } 297 | 298 | /** 299 | * Re-set default cursor for disabled elements. 300 | */ 301 | 302 | button[disabled], 303 | html input[disabled] { 304 | cursor: default; 305 | } 306 | 307 | /** 308 | * Remove inner padding and border in Firefox 4+. 309 | */ 310 | 311 | button::-moz-focus-inner, 312 | input::-moz-focus-inner { 313 | border: 0; 314 | padding: 0; 315 | } 316 | 317 | /** 318 | * Address Firefox 4+ setting `line-height` on `input` using `!important` in 319 | * the UA stylesheet. 320 | */ 321 | 322 | input { 323 | line-height: normal; 324 | } 325 | 326 | /** 327 | * It's recommended that you don't attempt to style these elements. 328 | * Firefox's implementation doesn't respect box-sizing, padding, or width. 329 | * 330 | * 1. Address box sizing set to `content-box` in IE 8/9/10. 331 | * 2. Remove excess padding in IE 8/9/10. 332 | */ 333 | 334 | input[type="checkbox"], 335 | input[type="radio"] { 336 | box-sizing: border-box; /* 1 */ 337 | padding: 0; /* 2 */ 338 | } 339 | 340 | /** 341 | * Fix the cursor style for Chrome's increment/decrement buttons. For certain 342 | * `font-size` values of the `input`, it causes the cursor style of the 343 | * decrement button to change from `default` to `text`. 344 | */ 345 | 346 | input[type="number"]::-webkit-inner-spin-button, 347 | input[type="number"]::-webkit-outer-spin-button { 348 | height: auto; 349 | } 350 | 351 | /** 352 | * 1. Address `appearance` set to `searchfield` in Safari and Chrome. 353 | * 2. Address `box-sizing` set to `border-box` in Safari and Chrome 354 | * (include `-moz` to future-proof). 355 | */ 356 | 357 | input[type="search"] { 358 | -webkit-appearance: textfield; /* 1 */ 359 | -moz-box-sizing: content-box; 360 | -webkit-box-sizing: content-box; /* 2 */ 361 | box-sizing: content-box; 362 | } 363 | 364 | /** 365 | * Remove inner padding and search cancel button in Safari and Chrome on OS X. 366 | * Safari (but not Chrome) clips the cancel button when the search input has 367 | * padding (and `textfield` appearance). 368 | */ 369 | 370 | input[type="search"]::-webkit-search-cancel-button, 371 | input[type="search"]::-webkit-search-decoration { 372 | -webkit-appearance: none; 373 | } 374 | 375 | /** 376 | * Define consistent border, margin, and padding. 377 | */ 378 | 379 | fieldset { 380 | border: 1px solid #c0c0c0; 381 | margin: 0 2px; 382 | padding: 0.35em 0.625em 0.75em; 383 | } 384 | 385 | /** 386 | * 1. Correct `color` not being inherited in IE 8/9/10/11. 387 | * 2. Remove padding so people aren't caught out if they zero out fieldsets. 388 | */ 389 | 390 | legend { 391 | border: 0; /* 1 */ 392 | padding: 0; /* 2 */ 393 | } 394 | 395 | /** 396 | * Remove default vertical scrollbar in IE 8/9/10/11. 397 | */ 398 | 399 | textarea { 400 | overflow: auto; 401 | } 402 | 403 | /** 404 | * Don't inherit the `font-weight` (applied by a rule above). 405 | * NOTE: the default cannot safely be changed in Chrome and Safari on OS X. 406 | */ 407 | 408 | optgroup { 409 | font-weight: bold; 410 | } 411 | 412 | /* Tables 413 | ========================================================================== */ 414 | 415 | /** 416 | * Remove most spacing between table cells. 417 | */ 418 | 419 | table { 420 | border-collapse: collapse; 421 | border-spacing: 0; 422 | } 423 | 424 | td, 425 | th { 426 | padding: 0; 427 | } -------------------------------------------------------------------------------- /source/css/_common/_utils.scss: -------------------------------------------------------------------------------- 1 | @mixin clearfix() { 2 | &:before, 3 | &:after { 4 | content: " "; 5 | display: table; 6 | } 7 | 8 | &:after { 9 | clear: both; 10 | } 11 | } 12 | 13 | @mixin min-screen($min-width: $global-body-width) { 14 | @media screen and (min-width: $min-width) { 15 | @content; 16 | } 17 | } 18 | 19 | @mixin max-screen($max-width: $global-body-width) { 20 | @media screen and (max-width: $max-width) { 21 | @content; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /source/css/_custom/_custom.scss: -------------------------------------------------------------------------------- 1 | // ============================== 2 | // Custom style 3 | // ============================== 4 | // You can override the variables in _variables.scss to customize the style 5 | -------------------------------------------------------------------------------- /source/css/_partial/_archive.scss: -------------------------------------------------------------------------------- 1 | // ============================== 2 | // Archive 3 | // ============================= 4 | 5 | .archive { 6 | margin: $archive-margin; 7 | max-width: $archive-max-width; 8 | 9 | .archive-title { 10 | font-family: $global-serif-font-family; 11 | 12 | &.tag, 13 | &.category { 14 | margin: 15px 0; 15 | } 16 | 17 | .archive-name { 18 | margin: 0; 19 | display: inline-block; 20 | font-weight: 400; 21 | font-size: $archive-name-font-size; 22 | line-height: $archive-name-font-size + 2px; 23 | } 24 | 25 | .archive-post-counter { 26 | display: none; 27 | color: $dark-gray; 28 | } 29 | } 30 | 31 | .collection-title { 32 | font-family: $global-serif-font-family; 33 | 34 | .archive-year { 35 | margin: 15px 0; 36 | font-weight: 400; 37 | font-size: $collection-title-font-size; 38 | line-height: $collection-title-font-size + 2px; 39 | } 40 | } 41 | 42 | .archive-post { 43 | padding: $archive-post-padding; 44 | border-left: $archive-post-border-left; 45 | 46 | .archive-post-time { 47 | margin-right: 10px; 48 | color: $dark-gray; 49 | } 50 | 51 | .archive-post-title { 52 | .archive-post-link { 53 | color: $theme-color; 54 | } 55 | } 56 | 57 | &::first-child { 58 | margin-top: 10px; 59 | } 60 | 61 | &:hover { 62 | border-left: $archive-post-hover-border-left; 63 | transition: $archive-post-hover-transition; 64 | transform: $archive-post-hover-transform; 65 | 66 | .archive-post-time { 67 | color: darken($dark-gray, 10%); 68 | } 69 | 70 | .archive-post-title .archive-post-link { 71 | color: darken($theme-color, 10%); 72 | } 73 | } 74 | } 75 | } 76 | 77 | @include max-screen() { 78 | .archive { 79 | margin-left: auto; 80 | margin-right: auto; 81 | 82 | .archive-title .archive-name { 83 | font-size: $archive-name-font-size - 4px; 84 | } 85 | 86 | .collection-title .archive-year { 87 | margin: 10px 0; 88 | font-size: $collection-title-font-size - 4px; 89 | } 90 | 91 | .archive-post { 92 | padding: $archive-post-mobile-padding; 93 | 94 | .archive-post-time { 95 | font-size: $archive-post-mobile-time-font-size; 96 | display: block; 97 | } 98 | } 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /source/css/_partial/_back-to-top.scss: -------------------------------------------------------------------------------- 1 | // ============================== 2 | // Back to top 3 | // ============================= 4 | 5 | .back-to-top { 6 | display: none; 7 | position: fixed; 8 | right: 20px; 9 | bottom: 20px; 10 | transition-property: transform; 11 | transition-timing-function: ease-out; 12 | transition-duration: 0.3s; 13 | z-index: 10; 14 | 15 | &:hover { 16 | transform: translateY(-5px); 17 | } 18 | } 19 | 20 | @include max-screen() { 21 | .back-to-top { 22 | display: none !important; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /source/css/_partial/_categories.scss: -------------------------------------------------------------------------------- 1 | 2 | .categories { 3 | margin: 2em 0 3em; 4 | text-align: center; 5 | font-family: $global-serif-font-family; 6 | 7 | .categories-title { 8 | display: inline-block; 9 | font-size: $categories-title-size; 10 | color: $theme-color; 11 | border-bottom: $categories-title-border-bottom; 12 | } 13 | 14 | .categories-tags { 15 | margin: 10px 0; 16 | 17 | .category-link { 18 | display: inline-block; 19 | position: relative; 20 | margin: $categories-tags-link-margin; 21 | word-wrap: break-word; 22 | transition-duration: 0.2s; 23 | transition-property: transform; 24 | transition-timing-function: ease-out; 25 | 26 | .category-count { 27 | display: inline-block; 28 | position: relative; 29 | top: -8px; 30 | right: -2px; 31 | color: $theme-color; 32 | font-size: $category-count-font-size; 33 | } 34 | 35 | &:active, 36 | &:focus, 37 | &:hover { 38 | color: $theme-color; 39 | transform: scale(1.1); 40 | } 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /source/css/_partial/_footer.scss: -------------------------------------------------------------------------------- 1 | // ============================== 2 | // Post footer 3 | // ============================= 4 | 5 | .footer { 6 | margin-top: $footer-margin-top; 7 | 8 | @import "_footer/social"; 9 | @import "_footer/copyright"; 10 | } -------------------------------------------------------------------------------- /source/css/_partial/_footer/_copyright.scss: -------------------------------------------------------------------------------- 1 | // ============================== 2 | // Copyright 3 | // ============================= 4 | 5 | .copyright { 6 | margin: $copyright-margin; 7 | color: $dark-gray; 8 | text-align: center; 9 | font-family: $global-serif-font-family; 10 | 11 | .hexo-link, 12 | .theme-link { 13 | color: $theme-color; 14 | } 15 | 16 | .copyright-year { 17 | display: block; 18 | 19 | .heart { 20 | font-size: 14px; 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /source/css/_partial/_footer/_social.scss: -------------------------------------------------------------------------------- 1 | // ============================== 2 | // Social 3 | // ============================= 4 | 5 | .social-links { 6 | text-align: center; 7 | 8 | .iconfont { 9 | font-size: $social-icon-font-size; 10 | 11 | & + .iconfont { 12 | margin-left: $social-link-margin-left; 13 | } 14 | 15 | &:hover { 16 | color: $theme-color; 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /source/css/_partial/_header.scss: -------------------------------------------------------------------------------- 1 | // ============================== 2 | // Header 3 | // ============================== 4 | 5 | .header { 6 | @include clearfix; 7 | padding: $header-padding; 8 | 9 | @import '_header/logo'; 10 | @import '_header/menu'; 11 | } 12 | 13 | 14 | @include max-screen() { 15 | .header { 16 | padding: 50px 0 0; 17 | text-align: center; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /source/css/_partial/_header/_logo.scss: -------------------------------------------------------------------------------- 1 | // ============================== 2 | // Logo 3 | // ============================= 4 | 5 | .logo-wrapper { 6 | float: left; 7 | 8 | .logo { 9 | font-size: $logo-font-size; 10 | font-family: $logo-font-family; 11 | } 12 | } 13 | 14 | @include max-screen() { 15 | .logo-wrapper { 16 | display: none; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /source/css/_partial/_header/_menu.scss: -------------------------------------------------------------------------------- 1 | // ============================== 2 | // Menu 3 | // ============================= 4 | 5 | .site-navbar { 6 | float: right; 7 | 8 | .menu { 9 | display: inline-block; 10 | position: relative; 11 | padding-left: 0; 12 | padding-right: 25px; 13 | font-family: $global-serif-font-family; 14 | 15 | .menu-item { 16 | display: inline-block; 17 | 18 | & + .menu-item { 19 | margin-left: $menu-item-margin-left;; 20 | } 21 | 22 | @include underline-from-center; 23 | } 24 | 25 | .menu-item-link { 26 | font-size: $menu-link-font-size; 27 | } 28 | } 29 | } 30 | 31 | @include max-screen() { 32 | .site-navbar { 33 | display: none; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /source/css/_partial/_iconfont.scss: -------------------------------------------------------------------------------- 1 | // ============================== 2 | // Iconfont 3 | // ============================== 4 | 5 | @font-face { 6 | font-family: 'iconfont'; /* project id 96542 */ 7 | src: url('//at.alicdn.com/t/font_96542_ixz9jngnf1sb57b9.eot'); 8 | src: url('//at.alicdn.com/t/font_96542_ixz9jngnf1sb57b9.eot?#iefix') format('embedded-opentype'), 9 | url('//at.alicdn.com/t/font_96542_ixz9jngnf1sb57b9.woff') format('woff'), 10 | url('//at.alicdn.com/t/font_96542_ixz9jngnf1sb57b9.ttf') format('truetype'), 11 | url('//at.alicdn.com/t/font_96542_ixz9jngnf1sb57b9.svg#iconfont') format('svg'); 12 | } 13 | 14 | .iconfont { 15 | font-family: "iconfont" !important; 16 | font-style: normal; 17 | -webkit-font-smoothing: antialiased; 18 | -webkit-text-stroke-width: 0.2px; 19 | -moz-osx-font-smoothing: grayscale; 20 | cursor: pointer; 21 | } 22 | 23 | .icon-instagram:before { 24 | font-size: .95em; 25 | content: "\e611"; 26 | position: relative; 27 | top: -1px; 28 | } 29 | .icon-douban:before { 30 | content: "\e610"; 31 | } 32 | .icon-tumblr:before { 33 | content: "\e69f"; 34 | font-size: .85em; 35 | position: relative; 36 | top: -4px; 37 | } 38 | .icon-linkedin:before { 39 | content: "\e60d"; 40 | position: relative; 41 | top: -4px; 42 | } 43 | .icon-twitter:before { 44 | content: "\e600"; 45 | } 46 | .icon-weibo:before { 47 | content: "\e602"; 48 | } 49 | .icon-stack-overflow:before { 50 | content: "\e603"; 51 | font-size: .85em; 52 | position: relative; 53 | top: -4px; 54 | } 55 | .icon-email:before { 56 | content: "\e605"; 57 | position: relative; 58 | top: -2px; 59 | } 60 | .icon-facebook:before { 61 | content: "\e601"; 62 | font-size: .95em; 63 | position: relative; 64 | top: -2px; 65 | } 66 | .icon-github:before { 67 | content: "\e606"; 68 | position: relative; 69 | top: -3px; 70 | } 71 | .icon-rss:before { 72 | content: "\e604"; 73 | } 74 | .icon-google:before { 75 | content: "\e609"; 76 | } 77 | .icon-zhihu:before { 78 | content: "\e607"; 79 | font-size: .9em; 80 | position: relative; 81 | top: -2px; 82 | } 83 | .icon-pocket:before { 84 | content: "\e856"; 85 | } 86 | 87 | /* Generic Icon */ 88 | .icon-heart:before { 89 | content: "\e608"; 90 | } 91 | .icon-right:before { 92 | content: "\e60a"; 93 | } 94 | .icon-left:before { 95 | content: "\e60b"; 96 | } 97 | .icon-up:before { 98 | content: "\e60c"; 99 | } 100 | .icon-close:before { 101 | content: "\e60f"; 102 | } 103 | -------------------------------------------------------------------------------- /source/css/_partial/_mathjax.scss: -------------------------------------------------------------------------------- 1 | .mjx-chtml:focus { 2 | padding: 1px 0; 3 | outline: none; 4 | } 5 | -------------------------------------------------------------------------------- /source/css/_partial/_mobile.scss: -------------------------------------------------------------------------------- 1 | // ============================== 2 | // Mobile Navbar 3 | // ============================== 4 | 5 | .mobile-navbar { 6 | display: none; 7 | position: fixed; 8 | top: 0; 9 | left: 0; 10 | width: 100%; 11 | height: $mobile-navbar-height; 12 | background: $white; 13 | box-shadow: 0px 2px 2px $gray; 14 | text-align: center; 15 | transition: transform 300ms ease; 16 | z-index: 99; 17 | 18 | &.fixed-open { 19 | transform: translate3d(180px, 0px, 0px); 20 | } 21 | 22 | .mobile-header-logo { 23 | display: inline-block; 24 | margin-right: 50px; 25 | 26 | .logo { 27 | font-size: 22px; 28 | line-height: $mobile-navbar-height; 29 | font-family: $logo-font-family; 30 | } 31 | } 32 | 33 | .mobile-navbar-icon { 34 | color: $theme-color; 35 | height: $mobile-navbar-height; 36 | width: $mobile-navbar-height; 37 | font-size: 24px; 38 | text-align: center; 39 | float: left; 40 | position: relative; 41 | transition: background 0.5s; 42 | 43 | @include mobile-menu-icon(); 44 | } 45 | } 46 | 47 | .mobile-menu { 48 | background-color: rgba($deputy-color, 0.5); 49 | 50 | .mobile-menu-list { 51 | position: relative; 52 | list-style: none; 53 | margin-top: 50px; 54 | padding: 0; 55 | border-top: 1px solid $deputy-color; 56 | 57 | .mobile-menu-item { 58 | padding: 10px 30px; 59 | border-bottom: 1px solid $deputy-color; 60 | } 61 | 62 | a { 63 | font-size: 18px; 64 | font-family: $global-serif-font-family; 65 | 66 | &:hover { 67 | color: $theme-color; 68 | } 69 | } 70 | } 71 | } 72 | 73 | @include max-screen() { 74 | .mobile-navbar { 75 | display: block; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /source/css/_partial/_pagination.scss: -------------------------------------------------------------------------------- 1 | // ============================== 2 | // Pagination 3 | // ============================== 4 | 5 | .pagination { 6 | margin: $pagination-margin; 7 | @include clearfix; 8 | 9 | .prev, 10 | .next { 11 | font-weight: 600; 12 | font-size: $pagination-font-size; 13 | font-family: $global-serif-font-family; 14 | transition-property: transform; 15 | transition-timing-function: ease-out; 16 | transition-duration: 0.3s; 17 | } 18 | 19 | .prev { 20 | float: left; 21 | 22 | &:hover { 23 | color: $theme-color; 24 | transform: translateX(-4px); 25 | } 26 | } 27 | 28 | .next { 29 | float: right; 30 | 31 | &:hover { 32 | color: $theme-color; 33 | transform: translateX(4px); 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /source/css/_partial/_post.scss: -------------------------------------------------------------------------------- 1 | // ============================== 2 | // Post 3 | // ============================== 4 | 5 | .posts { 6 | margin-bottom: $post-list-margin-bottom; 7 | } 8 | 9 | .post { 10 | padding: $post-padding; 11 | 12 | & + .post { 13 | border-top: $post-border; 14 | } 15 | 16 | @import '_post/header'; 17 | @import '_post/toc'; 18 | @import '_post/content'; 19 | @import '_post/copyright'; 20 | @import '_post/reward'; 21 | @import '_post/footer'; 22 | } 23 | -------------------------------------------------------------------------------- /source/css/_partial/_post/_code.scss: -------------------------------------------------------------------------------- 1 | code, pre { 2 | padding: 7px; 3 | font-size: $code-font-size; 4 | font-family: $code-font-family; 5 | background: $code-background; 6 | } 7 | 8 | code { 9 | padding: 3px 5px; 10 | border-radius: 4px; 11 | color: $code-color; 12 | word-break: normal; 13 | white-space: pre-warp; 14 | word-wrap: break-word; 15 | } 16 | 17 | .highlight { 18 | margin: 1em 0; 19 | border-radius: 5px; 20 | overflow-x: auto; 21 | box-shadow: 1px 1px 2px rgba(0,0,0,0.125); 22 | position: relative; 23 | 24 | table { 25 | position: relative; 26 | max-width: none; 27 | 28 | &::after { 29 | position: absolute; 30 | top: 0; 31 | right: 0; 32 | left: 0; 33 | padding: 2px 7px; 34 | font-size: $code-font-size; 35 | font-weight: bold; 36 | color: darken($gray, 10%); 37 | background: darken($code-background, 3%); 38 | content: 'Code'; 39 | } 40 | } 41 | 42 | @each $sign, $text in $code-type-list { 43 | &.#{$sign} > table::after { 44 | content: $text; 45 | } 46 | 47 | &.#{$sign} > figcaption > span::after { 48 | content: ' · ' + $text; 49 | } 50 | 51 | &.#{$sign} figcaption + table { 52 | &::after { 53 | display: none; 54 | } 55 | } 56 | } 57 | 58 | figcaption { 59 | position: absolute; 60 | top: 0; 61 | width: 100%; 62 | padding: 2px 7px; 63 | font-size: $code-font-size; 64 | font-weight: bold; 65 | color: darken($gray, 10%); 66 | background: darken($code-background, 3%); 67 | z-index: 20; 68 | overflow-x: hidden; 69 | box-sizing: border-box; 70 | 71 | & > a { 72 | position: absolute; 73 | right: 0; 74 | display: inline-box; 75 | margin-right: 7px; 76 | font-weight: 400; 77 | 78 | &:hover { 79 | text-decoration: none; 80 | border: 0; 81 | } 82 | } 83 | } 84 | 85 | .code { 86 | pre { 87 | margin: 0; 88 | padding: 30px 10px 10px; 89 | } 90 | } 91 | 92 | .gutter { 93 | width: 10px; 94 | color: $gray; 95 | 96 | pre { 97 | margin: 0; 98 | padding: 30px 7px 10px; 99 | } 100 | } 101 | 102 | .line { 103 | // Fix code block null line height and 104 | // Synchronous gutter and code line highly. 105 | height: round($code-font-size * 1.5); 106 | } 107 | 108 | table, tr, td { 109 | margin: 0; 110 | padding: 0; 111 | width: 100%; 112 | border-collapse: collapse; 113 | } 114 | 115 | .code { 116 | .comment, 117 | .quote { 118 | color: map-get($code-highlight-color, comment); 119 | } 120 | 121 | .keyword, 122 | .selector-tag, 123 | .addition { 124 | color: map-get($code-highlight-color, keyword); 125 | } 126 | 127 | .number, 128 | .string, 129 | .meta .meta-string, 130 | .literal, 131 | .doctag, 132 | .regexp { 133 | color: map-get($code-highlight-color, number); 134 | } 135 | 136 | .title, 137 | .section, 138 | .name, 139 | .selector-id, 140 | .selector-class { 141 | color: map-get($code-highlight-color, title); 142 | } 143 | 144 | .attribute, 145 | .attr, 146 | .variable, 147 | .template-variable, 148 | .class .title, 149 | .type { 150 | color: map-get($code-highlight-color, attribute); 151 | } 152 | 153 | .symbol, 154 | .bullet, 155 | .subst, 156 | .meta, 157 | .meta .keyword, 158 | .selector-attr, 159 | .selector-pseudo, 160 | .link { 161 | color: map-get($code-highlight-color, symbol); 162 | } 163 | 164 | .built_in, 165 | .deletion { 166 | color: map-get($code-highlight-color, built_in); 167 | } 168 | } 169 | } 170 | -------------------------------------------------------------------------------- /source/css/_partial/_post/_content.scss: -------------------------------------------------------------------------------- 1 | // ============================== 2 | // Post content 3 | // ============================== 4 | 5 | .post-content { 6 | @for $i from 1 through 6 { 7 | h#{$i} { 8 | font-weight: 400; 9 | font-family: $global-serif-font-family; 10 | } 11 | } 12 | 13 | .headerlink { 14 | &:hover { 15 | border-bottom: 0; 16 | } 17 | 18 | @if $content-headings-anchor != "" { 19 | &::before { 20 | content: $content-headings-anchor; 21 | margin-right: 5px; 22 | font-size: 1.1em; 23 | color: $theme-color; 24 | } 25 | } 26 | } 27 | 28 | a { 29 | color: $theme-color; 30 | word-break: break-all; 31 | 32 | &:hover { 33 | border-bottom: $content-link-border; 34 | } 35 | 36 | &.fancybox { 37 | border: 0; 38 | } 39 | } 40 | 41 | ul { 42 | padding-left: 0; 43 | list-style: inside; 44 | 45 | li { 46 | input[type="checkbox"] { 47 | margin-right: 5px; 48 | } 49 | } 50 | } 51 | 52 | blockquote { 53 | margin: 2em 0; 54 | padding: 10px 20px; 55 | position: relative; 56 | color: rgba(#34495e, 0.8); 57 | background-color: $content-blockquote-backgroud; 58 | border-left: $content-blockquote-border-left; 59 | box-shadow: 1px 1px 2px rgba(0,0,0,0.125); 60 | 61 | p { 62 | margin: 0; 63 | } 64 | } 65 | 66 | img { 67 | display: inline-block; 68 | max-width: 100%; 69 | } 70 | 71 | .table-responsive { 72 | width: 100%; 73 | margin-bottom: 20px; 74 | overflow: auto; 75 | border: 3px double $content-table-border-color; 76 | } 77 | 78 | table { 79 | width: 100%; 80 | max-width: 100%; 81 | border-spacing: 0; 82 | box-shadow: 2px 2px 3px rgba(0,0,0,.125); 83 | 84 | thead { 85 | background: $deputy-color; 86 | } 87 | 88 | th, td { 89 | padding: 5px 15px; 90 | border: 1px double $content-table-border-color; 91 | } 92 | } 93 | 94 | @import 'code'; 95 | 96 | .read-more { 97 | .read-more-link { 98 | color: $theme-color; 99 | font-size: 1.1em; 100 | font-family: $global-serif-font-family; 101 | 102 | &:hover { 103 | border-bottom: $post-readMore-border-bottom; 104 | } 105 | } 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /source/css/_partial/_post/_copyright.scss: -------------------------------------------------------------------------------- 1 | .post-copyright { 2 | margin-top: 20px; 3 | padding-top: 10px; 4 | border-top: 1px dashed $light-gray; 5 | 6 | .copyright-item { 7 | margin: 5px 0; 8 | word-break: normal; 9 | white-space: pre-warp; 10 | word-wrap: break-word; 11 | 12 | a { 13 | color: $theme-color; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /source/css/_partial/_post/_footer.scss: -------------------------------------------------------------------------------- 1 | // ============================== 2 | // Post footer 3 | // ============================== 4 | 5 | .post-footer { 6 | margin-top: $post-footer-margin-top; 7 | border-top: $post-footer-border-top; 8 | font-family: $global-serif-font-family; 9 | 10 | .post-tags { 11 | padding: $post-tags-padding; 12 | 13 | a { 14 | margin-right: 5px; 15 | color: $theme-color; 16 | word-break: break-all; 17 | 18 | &::before { 19 | content: '#'; 20 | } 21 | } 22 | } 23 | 24 | .post-nav { 25 | margin: 1em 0; 26 | @include clearfix; 27 | 28 | .prev, 29 | .next { 30 | font-weight: 600; 31 | font-size: $post-nav-font-size; 32 | font-family: $global-serif-font-family; 33 | transition-property: transform; 34 | transition-timing-function: ease-out; 35 | transition-duration: 0.3s; 36 | } 37 | 38 | .prev { 39 | float: left; 40 | 41 | &:hover { 42 | color: $theme-color; 43 | transform: translateX(-4px); 44 | } 45 | } 46 | 47 | .next { 48 | float: right; 49 | 50 | &:hover { 51 | color: $theme-color; 52 | transform: translateX(4px); 53 | } 54 | } 55 | 56 | .nav-mobile { 57 | display: none; 58 | } 59 | } 60 | } 61 | 62 | @include max-screen() { 63 | .post-footer { 64 | .post-nav { 65 | .nav-default { 66 | display: none; 67 | } 68 | 69 | .nav-mobile { 70 | display: inline; 71 | } 72 | } 73 | } 74 | } -------------------------------------------------------------------------------- /source/css/_partial/_post/_header.scss: -------------------------------------------------------------------------------- 1 | .post-header { 2 | margin-bottom: 20px; 3 | 4 | .post-title { 5 | margin: 0; 6 | font-size: $post-title-font-size; 7 | font-weight: $post-title-font-weight; 8 | font-family: $global-serif-font-family; 9 | } 10 | 11 | .post-link { 12 | @include underline-from-center; 13 | } 14 | 15 | .post-meta { 16 | .post-time { 17 | font-size: 15px; 18 | color: $post-meta-font-color; 19 | } 20 | 21 | .post-category { 22 | display: inline; 23 | font-size: 14px; 24 | color: $post-meta-font-color; 25 | 26 | &::before { 27 | content: '·'; 28 | } 29 | 30 | a { 31 | color: inherit; 32 | 33 | & + a { 34 | &::before { 35 | content: '/'; 36 | margin-right: 3px; 37 | color: $post-meta-font-color !important; 38 | } 39 | } 40 | 41 | &:hover { 42 | color: $theme-color; 43 | } 44 | } 45 | } 46 | 47 | .post-visits { 48 | display: inline-block; 49 | font-size: 14px; 50 | color: $post-meta-font-color; 51 | 52 | &::before { 53 | content: '·'; 54 | } 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /source/css/_partial/_post/_reward.scss: -------------------------------------------------------------------------------- 1 | .post-reward { 2 | margin-top: 20px; 3 | padding-top: 10px; 4 | text-align: center; 5 | border-top: 1px dashed $light-gray; 6 | 7 | .reward-button { 8 | margin: 15px 0; 9 | padding: 3px 7px; 10 | display: inline-block; 11 | color: $theme-color; 12 | border: 1px solid $theme-color; 13 | border-radius: 5px; 14 | cursor: pointer; 15 | 16 | &:hover { 17 | color: $white; 18 | background-color: $theme-color; 19 | transition: 0.5s; 20 | } 21 | } 22 | 23 | #reward:checked { 24 | & ~ .qr-code { 25 | display: block; 26 | } 27 | 28 | & ~ .reward-button { 29 | display: none; 30 | } 31 | } 32 | 33 | .qr-code { 34 | display: none; 35 | margin-top: 15px; 36 | 37 | .qr-code-image { 38 | display: inline-block; 39 | min-width: 200px; 40 | width: 40%; 41 | } 42 | 43 | .image { 44 | width: 200px; 45 | height: 200px; 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /source/css/_partial/_post/_toc.scss: -------------------------------------------------------------------------------- 1 | .post-toc { 2 | position: absolute; 3 | width: $post-toc-width; 4 | margin-left: $post-toc-margin-left; 5 | padding: 10px; 6 | font-family: $global-serif-font-family; 7 | border-radius: 5px; 8 | background: $post-toc-backgroud; 9 | box-shadow: 1px 1px 2px rgba(0,0,0,0.125); 10 | word-wrap: break-word; 11 | box-sizing: border-box; 12 | 13 | .post-toc-title { 14 | margin: 0 10px; 15 | font-size: $post-toc-title-size; 16 | font-weight: 400; 17 | text-transform: uppercase; 18 | } 19 | 20 | .post-toc-content { 21 | font-size: $post-toc-content; 22 | 23 | .toc, 24 | .toc-child { 25 | list-style: $post-toc-list-style; 26 | } 27 | 28 | .toc { 29 | margin: 10px 0; 30 | padding-left: 20px; 31 | 32 | .toc-child { 33 | padding-left: 15px; 34 | } 35 | } 36 | 37 | .toc-link.active { 38 | color: $theme-color; 39 | } 40 | } 41 | } 42 | 43 | @include max-screen($toc-max-sreen-width) { 44 | .post-toc { 45 | display: none; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /source/css/_partial/_slideout.scss: -------------------------------------------------------------------------------- 1 | // ============================== 2 | // slideout (https://github.com/mango/slideout) 3 | // ============================== 4 | 5 | .slideout-menu { 6 | position: fixed; 7 | top: 0; 8 | left: 0px; 9 | bottom: 0; 10 | width: 180px; 11 | min-height: 100vh; 12 | overflow-y: hidden; 13 | -webkit-overflow-scrolling: touch; 14 | z-index: 0; 15 | display: none; 16 | } 17 | 18 | .slideout-panel { 19 | position: relative; 20 | z-index: 1; 21 | background-color: $white; 22 | min-height: 100vh; 23 | } 24 | 25 | .slideout-open, 26 | .slideout-open body, 27 | .slideout-open .slideout-panel { 28 | overflow: hidden; 29 | } 30 | 31 | .slideout-open .slideout-menu { 32 | display: block; 33 | } 34 | -------------------------------------------------------------------------------- /source/css/_partial/_tags.scss: -------------------------------------------------------------------------------- 1 | // ============================== 2 | // Tags 3 | // ============================= 4 | 5 | .tag-cloud { 6 | margin: 2em 0 3em; 7 | text-align: center; 8 | font-family: $global-serif-font-family; 9 | 10 | .tag-cloud-title { 11 | display: inline-block; 12 | font-size: $tag-cloud-title-size; 13 | color: $theme-color; 14 | border-bottom: $tag-cloud-title-border-bottom; 15 | } 16 | 17 | .tag-cloud-tags { 18 | margin: 10px 0; 19 | 20 | a { 21 | display: inline-block; 22 | position: relative; 23 | margin: $tag-cloud-tags-link-margin; 24 | word-wrap: break-word; 25 | transition-duration: 0.2s; 26 | transition-property: transform; 27 | transition-timing-function: ease-out; 28 | 29 | &:active, 30 | &:focus, 31 | &:hover { 32 | color: $theme-color; 33 | transform: scale(1.1); 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /source/css/_variables.scss: -------------------------------------------------------------------------------- 1 | // ============================== 2 | // Variables 3 | // ============================== 4 | 5 | // ========== Theme Color ========== // 6 | // Theme color config from `even/_config.yml` 7 | $theme-color-config: to-lower-case(hexo-theme-config('color')); 8 | 9 | // Default theme color map 10 | $theme-color-map: ( 11 | 'default': #c05b4d #f8f5ec, 12 | 'mint green': #16982B #f5f5f5, 13 | 'cobalt blue': #0047AB #f0f2f5, 14 | 'hot pink': #FF69B4 #f8f5f5, 15 | 'dark violet': #9932CC #f5f4fa 16 | ); 17 | 18 | // Check theme color config. 19 | // if it does not exist, use default theme color. 20 | @if not(map-has-key($theme-color-map, $theme-color-config)) { 21 | $theme-color-config: 'default'; 22 | } 23 | $theme-color-list: map-get($theme-color-map, $theme-color-config); 24 | 25 | // Default theme color of the site. 26 | $theme-color: nth($theme-color-list, 1) !default; 27 | 28 | // Deputy theme color of the site. 29 | $deputy-color: nth($theme-color-list, 2) !default; 30 | 31 | // ========== Color ========== // 32 | $black: #0a0a0a !default; 33 | $white: #fefefe !default; 34 | $light-gray: #e6e6e6 !default; 35 | $gray: #cacaca !default; 36 | $dark-gray: #8a8a8a !default; 37 | 38 | 39 | // ========== Global ========== // 40 | // Text color of the body. 41 | $global-font-color: #34495e !default; 42 | 43 | // Font size attribute applied to '' and ''. 44 | $global-font-size: 16px !default; 45 | 46 | // Global width of ''. 47 | $global-body-width: 800px !default; 48 | 49 | // Padding of container main 50 | $global-container-padding: 0 20px !default; 51 | 52 | // Default line height for all type. `$global-lineheight` is 24px while `$global-font-size` is 16px. 53 | $global-lineheight: 1.5 !default; 54 | 55 | // Font family of the site. 56 | $global-font-family: 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif !default; 57 | 58 | // Serif font family of the site. 59 | $global-serif-font-family: Athelas, STHeiti, Microsoft Yahei, serif !default; 60 | 61 | // Background color of the site. 62 | $global-background: $white !default; 63 | 64 | // Headings font size of the site. 65 | $global-headings: ( 66 | h1: 26px, 67 | h2: 24px, 68 | h3: 20px, 69 | h4: 16px, 70 | h5: 14px, 71 | h6: 14px 72 | ) !default; 73 | 74 | 75 | // ========== Header ========== // 76 | // Padding of the site header. 77 | $header-padding: 20px 20px !default; 78 | 79 | // Font family: Chancery 80 | @font-face { 81 | font-family: 'Chancery'; 82 | src: url('../fonts/chancery/apple-chancery-webfont.eot'); 83 | src: local('Apple Chancery'), url('../fonts/chancery/apple-chancery-webfont.eot?#iefix') format('embedded-opentype'), 84 | url('../fonts/chancery/apple-chancery-webfont.woff2') format('woff2'), 85 | url('../fonts/chancery/apple-chancery-webfont.woff') format('woff'), 86 | url('../fonts/chancery/apple-chancery-webfont.ttf') format('truetype'), 87 | url('../fonts/chancery/apple-chancery-webfont.svg#apple-chancery') format('svg'); 88 | font-weight: lighter; 89 | font-style: normal; 90 | } 91 | 92 | // Font size of the logo. 93 | $logo-font-size: 48px !default; 94 | 95 | // Font family of the logo. 96 | $logo-font-family: 'Chancery', cursive, LiSu, sans-serif !default; 97 | 98 | // Margin of menu item. 99 | $menu-item-margin-left: 10px !default; 100 | 101 | // Margin of menu item in mobile. 102 | $menu-item-mobile-margin: 5px !default; 103 | 104 | // Font size of menu item link. 105 | $menu-link-font-size: 18px !default; 106 | 107 | // Height of the mobile header. 108 | $mobile-navbar-height: 50px !default; 109 | 110 | // ========== Post ========== // 111 | // Margin bottom of post list. 112 | $post-list-margin-bottom: 20px !default; 113 | 114 | // Padding of the post. 115 | $post-padding: 1.5em 0 !default; 116 | 117 | // Border top of the post + post. 118 | $post-border: 1px solid $light-gray !default; 119 | 120 | // Font size of post title. 121 | $post-title-font-size: 27px !default; 122 | 123 | // Font weight of post title. 124 | $post-title-font-weight: 400 !default; 125 | 126 | // Margin top of the post meta (post time). 127 | $post-meta-margin-top: 5px !default; 128 | 129 | // Font color of the post meta. 130 | $post-meta-font-color: $dark-gray !default; 131 | 132 | // Border bottom of the read more link when hover it. 133 | $post-readMore-border-bottom: 1px solid $theme-color !default; 134 | 135 | // Margin top of the post footer. 136 | $post-footer-margin-top: 20px !default; 137 | 138 | // Border top of post footer. 139 | $post-footer-border-top: 1px solid $light-gray !default; 140 | 141 | // Padding of the post tags. 142 | $post-tags-padding: 15px 0 !default; 143 | 144 | // Font size of post pagination. 145 | $post-nav-font-size: 18px !default; 146 | 147 | 148 | // ========== TOC ========== // 149 | // Width of the post toc. 150 | $post-toc-width: 200px !default; 151 | 152 | // Backgroud color of the post toc. 153 | $post-toc-backgroud: rgba($deputy-color, 0.6) !default; 154 | 155 | // Margin left of the post toc. 156 | $post-toc-margin-left: $global-body-width - 15px !default; 157 | 158 | // Font size of the post toc title. 159 | $post-toc-title-size: 20px !default; 160 | 161 | // Font size of the post toc content. 162 | $post-toc-content: 15px !default; 163 | 164 | // List style of the post toc list. 165 | $post-toc-list-style: square !default; 166 | 167 | // Max screen media of the post toc. 168 | $toc-max-sreen-width: 2 * $post-toc-width + $post-toc-margin-left !default; 169 | 170 | // ========== Content ========== // 171 | // Headings anchor. 172 | $content-headings-anchor: "" !default; 173 | 174 | // Border bottom of the link when hover it. 175 | $content-link-border: 1px solid $theme-color !default; 176 | 177 | // Background color of the blockquote. 178 | $content-blockquote-backgroud: rgba($theme-color, 0.05) !default; 179 | 180 | // Border left of the blockquote. 181 | $content-blockquote-border-left: 3px solid rgba($theme-color, 0.3) !default; 182 | 183 | // Border color of the table. 184 | $content-table-border-color: darken($deputy-color, 3%) !default; 185 | 186 | // ========== Code ========== // 187 | // Color of the code. 188 | $code-color: #c7254e !default; 189 | 190 | // Font size of code. 191 | $code-font-size: 13px !default; 192 | 193 | // Font family of the code. 194 | $code-font-family: Consolas, Monaco, Menlo, Consolas, monospace !default; 195 | 196 | // Color of code highlight, solarized. 197 | $code-highlight-color: ( 198 | comment: #93a1a1, 199 | keyword: #859900, 200 | number: #2aa198, 201 | title: #268bd2, 202 | attribute: #b58900, 203 | symbol: #cb4b16, 204 | built_in: #dc322f 205 | ) !default; 206 | 207 | // Code type list. 208 | $code-type-list: ( 209 | html: "HTML", 210 | js: "JavaScript", 211 | bash: "Bash", 212 | css: "CSS", 213 | scss: "Scss", 214 | java: "Java", 215 | xml: "XML", 216 | python: "Python", 217 | json: "JSON", 218 | swift: "Swift", 219 | ruby: "Ruby", 220 | php: "PHP", 221 | c: "C", 222 | cpp: "C++", 223 | scheme: "Scheme", 224 | objectivec: "Objective-C", 225 | yml: "YAML", 226 | stylus: "Stylus", 227 | sql: "SQL", 228 | http: "HTTP", 229 | go: "Go", 230 | kotlin: "Kotlin" 231 | ) !default; 232 | 233 | // Color of the code background. 234 | $code-background: $deputy-color !default; 235 | 236 | 237 | // ========== Pagination ========== // 238 | // Margin of the pagination. 239 | $pagination-margin: 2em 0 !default; 240 | 241 | // Font size of the pagination (Without post, post pagination see line 140). 242 | $pagination-font-size: 20px !default; 243 | 244 | 245 | // ========== Footer ========== // 246 | // Margin top of the footer. 247 | $footer-margin-top: 2em !default; 248 | 249 | // Margin left of the social link. 250 | $social-link-margin-left: 10px !default; 251 | 252 | // Font size of the social icon. 253 | $social-icon-font-size: 30px !default; 254 | 255 | // Margin of the copyright. 256 | $copyright-margin: 10px 0 !default; 257 | 258 | 259 | // ========== Archive ========== // 260 | // Margin of the archive. 261 | $archive-margin: 2em 0px !default; 262 | 263 | // Max width of the archive. 264 | $archive-max-width: 550px !default; 265 | 266 | // Font size of the archive name. 267 | $archive-name-font-size: 30px !default; 268 | 269 | // Font size of the collection title. 270 | $collection-title-font-size: 28px !default; 271 | 272 | // Padding of the archive post. 273 | $archive-post-padding: 3px 20px !default; 274 | 275 | // Padding of the archive post in mobile. 276 | $archive-post-mobile-padding: 5px 10px !default; 277 | 278 | // Font size of the archive post time in mobile. 279 | $archive-post-mobile-time-font-size: 13px !default; 280 | 281 | // Border left of the archive post, use $archive-post-hover-border-left when hover it. 282 | $archive-post-border-left: 1px solid $gray !default; 283 | $archive-post-hover-border-left: 3px solid $theme-color !default; 284 | 285 | // Transition of the archive post when hover it. 286 | $archive-post-hover-transition: 0.2s ease-out !default; 287 | 288 | // Transform of the archive post when hover it. 289 | $archive-post-hover-transform: translateX(4px) !default; 290 | 291 | 292 | // ========== Tags ========== // 293 | // Font soze of the tag cloud title. 294 | $tag-cloud-title-size: 18px !default; 295 | 296 | // Border bottom of the tag cloud title. 297 | $tag-cloud-title-border-bottom: 2px solid $theme-color !default; 298 | 299 | // Margin of the tag cloud tags link. 300 | $tag-cloud-tags-link-margin: 5px 10px !default; 301 | 302 | 303 | // ========== Categories ========== // 304 | // Font soze of the categories title. 305 | $categories-title-size: 18px !default; 306 | 307 | // Border bottom of the categories title. 308 | $categories-title-border-bottom: 2px solid $theme-color !default; 309 | 310 | // Margin of the categories tags link. 311 | $categories-tags-link-margin: 5px 10px !default; 312 | 313 | // Font size of the category count 314 | $category-count-font-size: 12px !default; 315 | -------------------------------------------------------------------------------- /source/css/style.scss: -------------------------------------------------------------------------------- 1 | @import "_variables"; 2 | @import "_custom/custom"; 3 | 4 | @import "_common/utils"; 5 | @import "_common/animation"; 6 | 7 | @import "_base"; 8 | @import "_partial/header"; 9 | @import "_partial/post"; 10 | @import "_partial/pagination"; 11 | @import "_partial/footer"; 12 | @import "_partial/archive"; 13 | @import "_partial/tags"; 14 | @import "_partial/categories"; 15 | @import "_partial/iconfont"; 16 | @import "_partial/slideout"; 17 | @import "_partial/mobile"; 18 | @import "_partial/back-to-top"; 19 | @import "_partial/mathjax"; 20 | -------------------------------------------------------------------------------- /source/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahonn/hexo-theme-even/0943a339232c04c7686b656a408972701e84e5f8/source/favicon.ico -------------------------------------------------------------------------------- /source/fonts/chancery/apple-chancery-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahonn/hexo-theme-even/0943a339232c04c7686b656a408972701e84e5f8/source/fonts/chancery/apple-chancery-webfont.eot -------------------------------------------------------------------------------- /source/fonts/chancery/apple-chancery-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahonn/hexo-theme-even/0943a339232c04c7686b656a408972701e84e5f8/source/fonts/chancery/apple-chancery-webfont.ttf -------------------------------------------------------------------------------- /source/fonts/chancery/apple-chancery-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahonn/hexo-theme-even/0943a339232c04c7686b656a408972701e84e5f8/source/fonts/chancery/apple-chancery-webfont.woff -------------------------------------------------------------------------------- /source/fonts/chancery/apple-chancery-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahonn/hexo-theme-even/0943a339232c04c7686b656a408972701e84e5f8/source/fonts/chancery/apple-chancery-webfont.woff2 -------------------------------------------------------------------------------- /source/js/src/even.js: -------------------------------------------------------------------------------- 1 | (function (window) { 2 | 'use strict'; 3 | 4 | function Even(config) { 5 | this.config = config; 6 | } 7 | 8 | Even.prototype.setup = function() { 9 | var leancloud = this.config.leancloud; 10 | 11 | this.navbar(); 12 | this.responsiveTable(); 13 | 14 | if (this.config.toc) { 15 | this.scrollToc(); 16 | this.tocFollow(); 17 | } 18 | if (this.config.fancybox) { 19 | this.fancybox(); 20 | } 21 | if (leancloud.app_id && leancloud.app_key) { 22 | this.recordReadings(); 23 | } 24 | if(this.config.latex) { 25 | this.renderLaTeX(); 26 | } 27 | this.backToTop(); 28 | }; 29 | 30 | Even.prototype.navbar = function () { 31 | var $nav = $('#mobile-navbar'); 32 | var $navIcon = $('.mobile-navbar-icon'); 33 | 34 | var slideout = new Slideout({ 35 | 'panel': document.getElementById('mobile-panel'), 36 | 'menu': document.getElementById('mobile-menu'), 37 | 'padding': 180, 38 | 'tolerance': 70 39 | }); 40 | slideout.disableTouch(); 41 | 42 | $navIcon.click(function () { 43 | slideout.toggle(); 44 | }); 45 | 46 | slideout.on('beforeopen', function () { 47 | $nav.addClass('fixed-open'); 48 | $navIcon.addClass('icon-click').removeClass('icon-out'); 49 | }); 50 | 51 | slideout.on('beforeclose', function () { 52 | $nav.removeClass('fixed-open'); 53 | $navIcon.addClass('icon-out').removeClass('icon-click'); 54 | }); 55 | 56 | $('#mobile-panel').on('touchend', function () { 57 | slideout.isOpen() && $navIcon.click(); 58 | }); 59 | }; 60 | 61 | Even.prototype.responsiveTable = function () { 62 | var tables = $('.post-content > table') 63 | tables.wrap('
') 64 | }; 65 | 66 | Even.prototype.scrollToc = function () { 67 | var SPACING = 20; 68 | var $toc = $('.post-toc'); 69 | var $footer = $('.post-footer'); 70 | 71 | if ($toc.length) { 72 | var minScrollTop = $toc.offset().top - SPACING; 73 | $(window).scroll(function () { 74 | var tocState = { 75 | start: { 76 | 'position': 'absolute', 77 | 'top': minScrollTop 78 | }, 79 | process: { 80 | 'position': 'fixed', 81 | 'top': SPACING 82 | } 83 | } 84 | var scrollTop = $(window).scrollTop(); 85 | if (scrollTop < minScrollTop) { 86 | $toc.css(tocState.start); 87 | } else { 88 | $toc.css(tocState.process); 89 | 90 | if($(".post-toc").css("display") != "none"){ 91 | var maxTocTop = $footer.offset().top - $toc.height() - SPACING; 92 | var tocCenterThreshold = document.documentElement.scrollTop + window.innerHeight / 2; 93 | if ($(".toc-link.active").offset() != undefined && $(".toc-link.active").offset().top > tocCenterThreshold) { 94 | var distanceBetween = $(".post-toc").offset().top - $(".toc-link.active").offset().top; 95 | $(".post-toc").offset({ 96 | top: Math.min(maxTocTop, tocCenterThreshold + distanceBetween), 97 | }); 98 | } 99 | if (maxTocTop < $(".post-toc").offset().top) { 100 | $(".post-toc").offset({ top: maxTocTop }); 101 | } 102 | } 103 | } 104 | }) 105 | } 106 | }; 107 | 108 | Even.prototype.tocFollow = function () { 109 | var HEADERFIX = 30; 110 | var $toclink = $('.toc-link'), 111 | $headerlink = $('.headerlink'); 112 | 113 | $(window).scroll(function () { 114 | var headerlinkTop = $.map($headerlink, function (link) { 115 | return $(link).offset().top; 116 | }); 117 | var scrollTop = $(window).scrollTop(); 118 | 119 | for (var i = 0; i < $toclink.length; i++) { 120 | var isLastOne = i + 1 === $toclink.length, 121 | currentTop = headerlinkTop[i] - HEADERFIX, 122 | nextTop = isLastOne ? Infinity : headerlinkTop[i + 1] - HEADERFIX; 123 | 124 | if (currentTop < scrollTop && scrollTop <= nextTop) { 125 | $($toclink[i]).addClass('active'); 126 | } else { 127 | $($toclink[i]).removeClass('active'); 128 | } 129 | } 130 | }); 131 | }; 132 | 133 | Even.prototype.fancybox = function () { 134 | if ($.fancybox) { 135 | $('.post').each(function () { 136 | $(this).find('img').each(function () { 137 | var href = 'href="' + this.src + '"'; 138 | var title = 'title="' + this.alt + '"'; 139 | $(this).wrap(''); 140 | }); 141 | }); 142 | 143 | $('.fancybox').fancybox({ 144 | openEffect: 'elastic', 145 | closeEffect: 'elastic' 146 | }); 147 | } 148 | }; 149 | 150 | Even.prototype.recordReadings = function () { 151 | if (typeof AV !== 'object') return; 152 | 153 | var $visits = $('.post-visits'); 154 | var Counter = AV.Object.extend('Counter'); 155 | if ($visits.length === 1) { 156 | addCounter(Counter); 157 | } else { 158 | showTime(Counter); 159 | } 160 | 161 | function updateVisits(dom, time) { 162 | var readText = dom.text().replace(/(\d+)/i, time) 163 | dom.text(readText); 164 | } 165 | 166 | function addCounter(Counter) { 167 | var query = new AV.Query(Counter); 168 | 169 | var url = $visits.data('url').trim(); 170 | var title = $visits.data('title').trim(); 171 | 172 | query.equalTo('url', url); 173 | query.find().then(function (results) { 174 | if (results.length > 0) { 175 | var counter = results[0]; 176 | counter.save(null, { 177 | fetchWhenSave: true 178 | }).then(function (counter) { 179 | counter.increment('time', 1); 180 | return counter.save(); 181 | }).then(function (counter) { 182 | updateVisits($visits, counter.get('time')); 183 | }); 184 | } else { 185 | var newcounter = new Counter(); 186 | newcounter.set('title', title); 187 | newcounter.set('url', url); 188 | newcounter.set('time', 1); 189 | 190 | var acl = new AV.ACL(); 191 | acl.setWriteAccess('*', true) 192 | acl.setReadAccess('*', true) 193 | newcounter.setACL(acl) 194 | 195 | newcounter.save().then(function () { 196 | updateVisits($visits, newcounter.get('time')); 197 | }); 198 | } 199 | }, function (error) { 200 | // eslint-disable-next-line 201 | console.log('Error:' + error.code + ' ' + error.message); 202 | }); 203 | } 204 | 205 | function showTime(Counter) { 206 | let index = 0; 207 | $visits.each(function () { 208 | var $this = $(this); 209 | setTimeout( 210 | function() { 211 | var query = new AV.Query(Counter); 212 | var url = $this.data('url').trim(); 213 | 214 | query.equalTo('url', url); 215 | query.find().then(function (results) { 216 | if (results.length === 0) { 217 | updateVisits($this, 0); 218 | } else { 219 | var counter = results[0]; 220 | updateVisits($this, counter.get('time')); 221 | } 222 | }, function (error) { 223 | // eslint-disable-next-line 224 | console.log('Error:' + error.code + ' ' + error.message); 225 | }); 226 | }, 100*(index++)); 227 | }) 228 | } 229 | }; 230 | 231 | Even.prototype.backToTop = function () { 232 | var $backToTop = $('#back-to-top'); 233 | 234 | $(window).scroll(function () { 235 | if ($(window).scrollTop() > 100) { 236 | $backToTop.fadeIn(1000); 237 | } else { 238 | $backToTop.fadeOut(1000); 239 | } 240 | }); 241 | 242 | $backToTop.click(function () { 243 | $('body,html').animate({ scrollTop: 0 }); 244 | }); 245 | }; 246 | 247 | Even.prototype.renderLaTeX = function () { 248 | var loopID = setInterval(function () { 249 | if(window.MathJax) { 250 | var jax = window.MathJax; 251 | jax.Hub.Config({ tex2jax: { inlineMath: [['$', '$'], ['\\(', '\\)']] }}); 252 | jax.Hub.Queue(['Typeset', jax.Hub, $(document.body)[0]]); 253 | clearInterval(loopID); 254 | } 255 | }, 500); 256 | } 257 | 258 | var config = window.config; 259 | var even = new Even(config); 260 | even.setup(); 261 | }(window)) 262 | -------------------------------------------------------------------------------- /source/lib/fancybox/blank.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahonn/hexo-theme-even/0943a339232c04c7686b656a408972701e84e5f8/source/lib/fancybox/blank.gif -------------------------------------------------------------------------------- /source/lib/fancybox/fancybox_loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahonn/hexo-theme-even/0943a339232c04c7686b656a408972701e84e5f8/source/lib/fancybox/fancybox_loading.gif -------------------------------------------------------------------------------- /source/lib/fancybox/fancybox_loading@2x.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahonn/hexo-theme-even/0943a339232c04c7686b656a408972701e84e5f8/source/lib/fancybox/fancybox_loading@2x.gif -------------------------------------------------------------------------------- /source/lib/fancybox/fancybox_overlay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahonn/hexo-theme-even/0943a339232c04c7686b656a408972701e84e5f8/source/lib/fancybox/fancybox_overlay.png -------------------------------------------------------------------------------- /source/lib/fancybox/fancybox_sprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahonn/hexo-theme-even/0943a339232c04c7686b656a408972701e84e5f8/source/lib/fancybox/fancybox_sprite.png -------------------------------------------------------------------------------- /source/lib/fancybox/fancybox_sprite@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahonn/hexo-theme-even/0943a339232c04c7686b656a408972701e84e5f8/source/lib/fancybox/fancybox_sprite@2x.png -------------------------------------------------------------------------------- /source/lib/fancybox/helpers/fancybox_buttons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahonn/hexo-theme-even/0943a339232c04c7686b656a408972701e84e5f8/source/lib/fancybox/helpers/fancybox_buttons.png -------------------------------------------------------------------------------- /source/lib/fancybox/helpers/jquery.fancybox-buttons.css: -------------------------------------------------------------------------------- 1 | #fancybox-buttons { 2 | position: fixed; 3 | left: 0; 4 | width: 100%; 5 | z-index: 8050; 6 | } 7 | 8 | #fancybox-buttons.top { 9 | top: 10px; 10 | } 11 | 12 | #fancybox-buttons.bottom { 13 | bottom: 10px; 14 | } 15 | 16 | #fancybox-buttons ul { 17 | display: block; 18 | width: 166px; 19 | height: 30px; 20 | margin: 0 auto; 21 | padding: 0; 22 | list-style: none; 23 | border: 1px solid #111; 24 | border-radius: 3px; 25 | -webkit-box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); 26 | -moz-box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); 27 | box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); 28 | background: rgb(50,50,50); 29 | background: -moz-linear-gradient(top, rgb(68,68,68) 0%, rgb(52,52,52) 50%, rgb(41,41,41) 50%, rgb(51,51,51) 100%); 30 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgb(68,68,68)), color-stop(50%,rgb(52,52,52)), color-stop(50%,rgb(41,41,41)), color-stop(100%,rgb(51,51,51))); 31 | background: -webkit-linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%); 32 | background: -o-linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%); 33 | background: -ms-linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%); 34 | background: linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%); 35 | filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#444444', endColorstr='#222222',GradientType=0 ); 36 | } 37 | 38 | #fancybox-buttons ul li { 39 | float: left; 40 | margin: 0; 41 | padding: 0; 42 | } 43 | 44 | #fancybox-buttons a { 45 | display: block; 46 | width: 30px; 47 | height: 30px; 48 | text-indent: -9999px; 49 | background-color: transparent; 50 | background-image: url('fancybox_buttons.png'); 51 | background-repeat: no-repeat; 52 | outline: none; 53 | opacity: 0.8; 54 | } 55 | 56 | #fancybox-buttons a:hover { 57 | opacity: 1; 58 | } 59 | 60 | #fancybox-buttons a.btnPrev { 61 | background-position: 5px 0; 62 | } 63 | 64 | #fancybox-buttons a.btnNext { 65 | background-position: -33px 0; 66 | border-right: 1px solid #3e3e3e; 67 | } 68 | 69 | #fancybox-buttons a.btnPlay { 70 | background-position: 0 -30px; 71 | } 72 | 73 | #fancybox-buttons a.btnPlayOn { 74 | background-position: -30px -30px; 75 | } 76 | 77 | #fancybox-buttons a.btnToggle { 78 | background-position: 3px -60px; 79 | border-left: 1px solid #111; 80 | border-right: 1px solid #3e3e3e; 81 | width: 35px 82 | } 83 | 84 | #fancybox-buttons a.btnToggleOn { 85 | background-position: -27px -60px; 86 | } 87 | 88 | #fancybox-buttons a.btnClose { 89 | border-left: 1px solid #111; 90 | width: 35px; 91 | background-position: -56px 0px; 92 | } 93 | 94 | #fancybox-buttons a.btnDisabled { 95 | opacity : 0.4; 96 | cursor: default; 97 | } -------------------------------------------------------------------------------- /source/lib/fancybox/helpers/jquery.fancybox-buttons.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Buttons helper for fancyBox 3 | * version: 1.0.5 (Mon, 15 Oct 2012) 4 | * @requires fancyBox v2.0 or later 5 | * 6 | * Usage: 7 | * $(".fancybox").fancybox({ 8 | * helpers : { 9 | * buttons: { 10 | * position : 'top' 11 | * } 12 | * } 13 | * }); 14 | * 15 | */ 16 | (function ($) { 17 | //Shortcut for fancyBox object 18 | var F = $.fancybox; 19 | 20 | //Add helper object 21 | F.helpers.buttons = { 22 | defaults : { 23 | skipSingle : false, // disables if gallery contains single image 24 | position : 'top', // 'top' or 'bottom' 25 | tpl : '
' 26 | }, 27 | 28 | list : null, 29 | buttons: null, 30 | 31 | beforeLoad: function (opts, obj) { 32 | //Remove self if gallery do not have at least two items 33 | 34 | if (opts.skipSingle && obj.group.length < 2) { 35 | obj.helpers.buttons = false; 36 | obj.closeBtn = true; 37 | 38 | return; 39 | } 40 | 41 | //Increase top margin to give space for buttons 42 | obj.margin[ opts.position === 'bottom' ? 2 : 0 ] += 30; 43 | }, 44 | 45 | onPlayStart: function () { 46 | if (this.buttons) { 47 | this.buttons.play.attr('title', 'Pause slideshow').addClass('btnPlayOn'); 48 | } 49 | }, 50 | 51 | onPlayEnd: function () { 52 | if (this.buttons) { 53 | this.buttons.play.attr('title', 'Start slideshow').removeClass('btnPlayOn'); 54 | } 55 | }, 56 | 57 | afterShow: function (opts, obj) { 58 | var buttons = this.buttons; 59 | 60 | if (!buttons) { 61 | this.list = $(opts.tpl).addClass(opts.position).appendTo('body'); 62 | 63 | buttons = { 64 | prev : this.list.find('.btnPrev').click( F.prev ), 65 | next : this.list.find('.btnNext').click( F.next ), 66 | play : this.list.find('.btnPlay').click( F.play ), 67 | toggle : this.list.find('.btnToggle').click( F.toggle ), 68 | close : this.list.find('.btnClose').click( F.close ) 69 | } 70 | } 71 | 72 | //Prev 73 | if (obj.index > 0 || obj.loop) { 74 | buttons.prev.removeClass('btnDisabled'); 75 | } else { 76 | buttons.prev.addClass('btnDisabled'); 77 | } 78 | 79 | //Next / Play 80 | if (obj.loop || obj.index < obj.group.length - 1) { 81 | buttons.next.removeClass('btnDisabled'); 82 | buttons.play.removeClass('btnDisabled'); 83 | 84 | } else { 85 | buttons.next.addClass('btnDisabled'); 86 | buttons.play.addClass('btnDisabled'); 87 | } 88 | 89 | this.buttons = buttons; 90 | 91 | this.onUpdate(opts, obj); 92 | }, 93 | 94 | onUpdate: function (opts, obj) { 95 | var toggle; 96 | 97 | if (!this.buttons) { 98 | return; 99 | } 100 | 101 | toggle = this.buttons.toggle.removeClass('btnDisabled btnToggleOn'); 102 | 103 | //Size toggle button 104 | if (obj.canShrink) { 105 | toggle.addClass('btnToggleOn'); 106 | 107 | } else if (!obj.canExpand) { 108 | toggle.addClass('btnDisabled'); 109 | } 110 | }, 111 | 112 | beforeClose: function () { 113 | if (this.list) { 114 | this.list.remove(); 115 | } 116 | 117 | this.list = null; 118 | this.buttons = null; 119 | } 120 | }; 121 | 122 | }(jQuery)); 123 | -------------------------------------------------------------------------------- /source/lib/fancybox/helpers/jquery.fancybox-media.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Media helper for fancyBox 3 | * version: 1.0.6 (Fri, 14 Jun 2013) 4 | * @requires fancyBox v2.0 or later 5 | * 6 | * Usage: 7 | * $(".fancybox").fancybox({ 8 | * helpers : { 9 | * media: true 10 | * } 11 | * }); 12 | * 13 | * Set custom URL parameters: 14 | * $(".fancybox").fancybox({ 15 | * helpers : { 16 | * media: { 17 | * youtube : { 18 | * params : { 19 | * autoplay : 0 20 | * } 21 | * } 22 | * } 23 | * } 24 | * }); 25 | * 26 | * Or: 27 | * $(".fancybox").fancybox({, 28 | * helpers : { 29 | * media: true 30 | * }, 31 | * youtube : { 32 | * autoplay: 0 33 | * } 34 | * }); 35 | * 36 | * Supports: 37 | * 38 | * Youtube 39 | * http://www.youtube.com/watch?v=opj24KnzrWo 40 | * http://www.youtube.com/embed/opj24KnzrWo 41 | * http://youtu.be/opj24KnzrWo 42 | * http://www.youtube-nocookie.com/embed/opj24KnzrWo 43 | * Vimeo 44 | * http://vimeo.com/40648169 45 | * http://vimeo.com/channels/staffpicks/38843628 46 | * http://vimeo.com/groups/surrealism/videos/36516384 47 | * http://player.vimeo.com/video/45074303 48 | * Metacafe 49 | * http://www.metacafe.com/watch/7635964/dr_seuss_the_lorax_movie_trailer/ 50 | * http://www.metacafe.com/watch/7635964/ 51 | * Dailymotion 52 | * http://www.dailymotion.com/video/xoytqh_dr-seuss-the-lorax-premiere_people 53 | * Twitvid 54 | * http://twitvid.com/QY7MD 55 | * Twitpic 56 | * http://twitpic.com/7p93st 57 | * Instagram 58 | * http://instagr.am/p/IejkuUGxQn/ 59 | * http://instagram.com/p/IejkuUGxQn/ 60 | * Google maps 61 | * http://maps.google.com/maps?q=Eiffel+Tower,+Avenue+Gustave+Eiffel,+Paris,+France&t=h&z=17 62 | * http://maps.google.com/?ll=48.857995,2.294297&spn=0.007666,0.021136&t=m&z=16 63 | * http://maps.google.com/?ll=48.859463,2.292626&spn=0.000965,0.002642&t=m&z=19&layer=c&cbll=48.859524,2.292532&panoid=YJ0lq28OOy3VT2IqIuVY0g&cbp=12,151.58,,0,-15.56 64 | */ 65 | (function ($) { 66 | "use strict"; 67 | 68 | //Shortcut for fancyBox object 69 | var F = $.fancybox, 70 | format = function( url, rez, params ) { 71 | params = params || ''; 72 | 73 | if ( $.type( params ) === "object" ) { 74 | params = $.param(params, true); 75 | } 76 | 77 | $.each(rez, function(key, value) { 78 | url = url.replace( '$' + key, value || '' ); 79 | }); 80 | 81 | if (params.length) { 82 | url += ( url.indexOf('?') > 0 ? '&' : '?' ) + params; 83 | } 84 | 85 | return url; 86 | }; 87 | 88 | //Add helper object 89 | F.helpers.media = { 90 | defaults : { 91 | youtube : { 92 | matcher : /(youtube\.com|youtu\.be|youtube-nocookie\.com)\/(watch\?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*)).*/i, 93 | params : { 94 | autoplay : 1, 95 | autohide : 1, 96 | fs : 1, 97 | rel : 0, 98 | hd : 1, 99 | wmode : 'opaque', 100 | enablejsapi : 1 101 | }, 102 | type : 'iframe', 103 | url : '//www.youtube.com/embed/$3' 104 | }, 105 | vimeo : { 106 | matcher : /(?:vimeo(?:pro)?.com)\/(?:[^\d]+)?(\d+)(?:.*)/, 107 | params : { 108 | autoplay : 1, 109 | hd : 1, 110 | show_title : 1, 111 | show_byline : 1, 112 | show_portrait : 0, 113 | fullscreen : 1 114 | }, 115 | type : 'iframe', 116 | url : '//player.vimeo.com/video/$1' 117 | }, 118 | metacafe : { 119 | matcher : /metacafe.com\/(?:watch|fplayer)\/([\w\-]{1,10})/, 120 | params : { 121 | autoPlay : 'yes' 122 | }, 123 | type : 'swf', 124 | url : function( rez, params, obj ) { 125 | obj.swf.flashVars = 'playerVars=' + $.param( params, true ); 126 | 127 | return '//www.metacafe.com/fplayer/' + rez[1] + '/.swf'; 128 | } 129 | }, 130 | dailymotion : { 131 | matcher : /dailymotion.com\/video\/(.*)\/?(.*)/, 132 | params : { 133 | additionalInfos : 0, 134 | autoStart : 1 135 | }, 136 | type : 'swf', 137 | url : '//www.dailymotion.com/swf/video/$1' 138 | }, 139 | twitvid : { 140 | matcher : /twitvid\.com\/([a-zA-Z0-9_\-\?\=]+)/i, 141 | params : { 142 | autoplay : 0 143 | }, 144 | type : 'iframe', 145 | url : '//www.twitvid.com/embed.php?guid=$1' 146 | }, 147 | twitpic : { 148 | matcher : /twitpic\.com\/(?!(?:place|photos|events)\/)([a-zA-Z0-9\?\=\-]+)/i, 149 | type : 'image', 150 | url : '//twitpic.com/show/full/$1/' 151 | }, 152 | instagram : { 153 | matcher : /(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i, 154 | type : 'image', 155 | url : '//$1/p/$2/media/?size=l' 156 | }, 157 | google_maps : { 158 | matcher : /maps\.google\.([a-z]{2,3}(\.[a-z]{2})?)\/(\?ll=|maps\?)(.*)/i, 159 | type : 'iframe', 160 | url : function( rez ) { 161 | return '//maps.google.' + rez[1] + '/' + rez[3] + '' + rez[4] + '&output=' + (rez[4].indexOf('layer=c') > 0 ? 'svembed' : 'embed'); 162 | } 163 | } 164 | }, 165 | 166 | beforeLoad : function(opts, obj) { 167 | var url = obj.href || '', 168 | type = false, 169 | what, 170 | item, 171 | rez, 172 | params; 173 | 174 | for (what in opts) { 175 | if (opts.hasOwnProperty(what)) { 176 | item = opts[ what ]; 177 | rez = url.match( item.matcher ); 178 | 179 | if (rez) { 180 | type = item.type; 181 | params = $.extend(true, {}, item.params, obj[ what ] || ($.isPlainObject(opts[ what ]) ? opts[ what ].params : null)); 182 | 183 | url = $.type( item.url ) === "function" ? item.url.call( this, rez, params, obj ) : format( item.url, rez, params ); 184 | 185 | break; 186 | } 187 | } 188 | } 189 | 190 | if (type) { 191 | obj.href = url; 192 | obj.type = type; 193 | 194 | obj.autoHeight = false; 195 | } 196 | } 197 | }; 198 | 199 | }(jQuery)); -------------------------------------------------------------------------------- /source/lib/fancybox/helpers/jquery.fancybox-thumbs.css: -------------------------------------------------------------------------------- 1 | #fancybox-thumbs { 2 | position: fixed; 3 | left: 0; 4 | width: 100%; 5 | overflow: hidden; 6 | z-index: 8050; 7 | } 8 | 9 | #fancybox-thumbs.bottom { 10 | bottom: 2px; 11 | } 12 | 13 | #fancybox-thumbs.top { 14 | top: 2px; 15 | } 16 | 17 | #fancybox-thumbs ul { 18 | position: relative; 19 | list-style: none; 20 | margin: 0; 21 | padding: 0; 22 | } 23 | 24 | #fancybox-thumbs ul li { 25 | float: left; 26 | padding: 1px; 27 | opacity: 0.5; 28 | } 29 | 30 | #fancybox-thumbs ul li.active { 31 | opacity: 0.75; 32 | padding: 0; 33 | border: 1px solid #fff; 34 | } 35 | 36 | #fancybox-thumbs ul li:hover { 37 | opacity: 1; 38 | } 39 | 40 | #fancybox-thumbs ul li a { 41 | display: block; 42 | position: relative; 43 | overflow: hidden; 44 | border: 1px solid #222; 45 | background: #111; 46 | outline: none; 47 | } 48 | 49 | #fancybox-thumbs ul li img { 50 | display: block; 51 | position: relative; 52 | border: 0; 53 | padding: 0; 54 | max-width: none; 55 | } -------------------------------------------------------------------------------- /source/lib/fancybox/helpers/jquery.fancybox-thumbs.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Thumbnail helper for fancyBox 3 | * version: 1.0.7 (Mon, 01 Oct 2012) 4 | * @requires fancyBox v2.0 or later 5 | * 6 | * Usage: 7 | * $(".fancybox").fancybox({ 8 | * helpers : { 9 | * thumbs: { 10 | * width : 50, 11 | * height : 50 12 | * } 13 | * } 14 | * }); 15 | * 16 | */ 17 | (function ($) { 18 | //Shortcut for fancyBox object 19 | var F = $.fancybox; 20 | 21 | //Add helper object 22 | F.helpers.thumbs = { 23 | defaults : { 24 | width : 50, // thumbnail width 25 | height : 50, // thumbnail height 26 | position : 'bottom', // 'top' or 'bottom' 27 | source : function ( item ) { // function to obtain the URL of the thumbnail image 28 | var href; 29 | 30 | if (item.element) { 31 | href = $(item.element).find('img').attr('src'); 32 | } 33 | 34 | if (!href && item.type === 'image' && item.href) { 35 | href = item.href; 36 | } 37 | 38 | return href; 39 | } 40 | }, 41 | 42 | wrap : null, 43 | list : null, 44 | width : 0, 45 | 46 | init: function (opts, obj) { 47 | var that = this, 48 | list, 49 | thumbWidth = opts.width, 50 | thumbHeight = opts.height, 51 | thumbSource = opts.source; 52 | 53 | //Build list structure 54 | list = ''; 55 | 56 | for (var n = 0; n < obj.group.length; n++) { 57 | list += '
  • '; 58 | } 59 | 60 | this.wrap = $('
    ').addClass(opts.position).appendTo('body'); 61 | this.list = $('').appendTo(this.wrap); 62 | 63 | //Load each thumbnail 64 | $.each(obj.group, function (i) { 65 | var href = thumbSource( obj.group[ i ] ); 66 | 67 | if (!href) { 68 | return; 69 | } 70 | 71 | $("").load(function () { 72 | var width = this.width, 73 | height = this.height, 74 | widthRatio, heightRatio, parent; 75 | 76 | if (!that.list || !width || !height) { 77 | return; 78 | } 79 | 80 | //Calculate thumbnail width/height and center it 81 | widthRatio = width / thumbWidth; 82 | heightRatio = height / thumbHeight; 83 | 84 | parent = that.list.children().eq(i).find('a'); 85 | 86 | if (widthRatio >= 1 && heightRatio >= 1) { 87 | if (widthRatio > heightRatio) { 88 | width = Math.floor(width / heightRatio); 89 | height = thumbHeight; 90 | 91 | } else { 92 | width = thumbWidth; 93 | height = Math.floor(height / widthRatio); 94 | } 95 | } 96 | 97 | $(this).css({ 98 | width : width, 99 | height : height, 100 | top : Math.floor(thumbHeight / 2 - height / 2), 101 | left : Math.floor(thumbWidth / 2 - width / 2) 102 | }); 103 | 104 | parent.width(thumbWidth).height(thumbHeight); 105 | 106 | $(this).hide().appendTo(parent).fadeIn(300); 107 | 108 | }).attr('src', href); 109 | }); 110 | 111 | //Set initial width 112 | this.width = this.list.children().eq(0).outerWidth(true); 113 | 114 | this.list.width(this.width * (obj.group.length + 1)).css('left', Math.floor($(window).width() * 0.5 - (obj.index * this.width + this.width * 0.5))); 115 | }, 116 | 117 | beforeLoad: function (opts, obj) { 118 | //Remove self if gallery do not have at least two items 119 | if (obj.group.length < 2) { 120 | obj.helpers.thumbs = false; 121 | 122 | return; 123 | } 124 | 125 | //Increase bottom margin to give space for thumbs 126 | obj.margin[ opts.position === 'top' ? 0 : 2 ] += ((opts.height) + 15); 127 | }, 128 | 129 | afterShow: function (opts, obj) { 130 | //Check if exists and create or update list 131 | if (this.list) { 132 | this.onUpdate(opts, obj); 133 | 134 | } else { 135 | this.init(opts, obj); 136 | } 137 | 138 | //Set active element 139 | this.list.children().removeClass('active').eq(obj.index).addClass('active'); 140 | }, 141 | 142 | //Center list 143 | onUpdate: function (opts, obj) { 144 | if (this.list) { 145 | this.list.stop(true).animate({ 146 | 'left': Math.floor($(window).width() * 0.5 - (obj.index * this.width + this.width * 0.5)) 147 | }, 150); 148 | } 149 | }, 150 | 151 | beforeClose: function () { 152 | if (this.wrap) { 153 | this.wrap.remove(); 154 | } 155 | 156 | this.wrap = null; 157 | this.list = null; 158 | this.width = 0; 159 | } 160 | } 161 | 162 | }(jQuery)); -------------------------------------------------------------------------------- /source/lib/fancybox/jquery.fancybox.css: -------------------------------------------------------------------------------- 1 | /*! fancyBox v2.1.5 fancyapps.com | fancyapps.com/fancybox/#license */ 2 | .fancybox-wrap, 3 | .fancybox-skin, 4 | .fancybox-outer, 5 | .fancybox-inner, 6 | .fancybox-image, 7 | .fancybox-wrap iframe, 8 | .fancybox-wrap object, 9 | .fancybox-nav, 10 | .fancybox-nav span, 11 | .fancybox-tmp 12 | { 13 | padding: 0; 14 | margin: 0; 15 | border: 0; 16 | outline: none; 17 | vertical-align: top; 18 | } 19 | 20 | .fancybox-wrap { 21 | position: absolute; 22 | top: 0; 23 | left: 0; 24 | z-index: 8020; 25 | } 26 | 27 | .fancybox-skin { 28 | position: relative; 29 | background: #f9f9f9; 30 | color: #444; 31 | text-shadow: none; 32 | -webkit-border-radius: 4px; 33 | -moz-border-radius: 4px; 34 | border-radius: 4px; 35 | } 36 | 37 | .fancybox-opened { 38 | z-index: 8030; 39 | } 40 | 41 | .fancybox-opened .fancybox-skin { 42 | -webkit-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); 43 | -moz-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); 44 | box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); 45 | } 46 | 47 | .fancybox-outer, .fancybox-inner { 48 | position: relative; 49 | } 50 | 51 | .fancybox-inner { 52 | overflow: hidden; 53 | } 54 | 55 | .fancybox-type-iframe .fancybox-inner { 56 | -webkit-overflow-scrolling: touch; 57 | } 58 | 59 | .fancybox-error { 60 | color: #444; 61 | font: 14px/20px "Helvetica Neue",Helvetica,Arial,sans-serif; 62 | margin: 0; 63 | padding: 15px; 64 | white-space: nowrap; 65 | } 66 | 67 | .fancybox-image, .fancybox-iframe { 68 | display: block; 69 | width: 100%; 70 | height: 100%; 71 | } 72 | 73 | .fancybox-image { 74 | max-width: 100%; 75 | max-height: 100%; 76 | } 77 | 78 | #fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span { 79 | background-image: url('fancybox_sprite.png'); 80 | } 81 | 82 | #fancybox-loading { 83 | position: fixed; 84 | top: 50%; 85 | left: 50%; 86 | margin-top: -22px; 87 | margin-left: -22px; 88 | background-position: 0 -108px; 89 | opacity: 0.8; 90 | cursor: pointer; 91 | z-index: 8060; 92 | } 93 | 94 | #fancybox-loading div { 95 | width: 44px; 96 | height: 44px; 97 | background: url('fancybox_loading.gif') center center no-repeat; 98 | } 99 | 100 | .fancybox-close { 101 | position: absolute; 102 | top: -18px; 103 | right: -18px; 104 | width: 36px; 105 | height: 36px; 106 | cursor: pointer; 107 | z-index: 8040; 108 | } 109 | 110 | .fancybox-nav { 111 | position: absolute; 112 | top: 0; 113 | width: 40%; 114 | height: 100%; 115 | cursor: pointer; 116 | text-decoration: none; 117 | background: transparent url('blank.gif'); /* helps IE */ 118 | -webkit-tap-highlight-color: rgba(0,0,0,0); 119 | z-index: 8040; 120 | } 121 | 122 | .fancybox-prev { 123 | left: 0; 124 | } 125 | 126 | .fancybox-next { 127 | right: 0; 128 | } 129 | 130 | .fancybox-nav span { 131 | position: absolute; 132 | top: 50%; 133 | width: 36px; 134 | height: 34px; 135 | margin-top: -18px; 136 | cursor: pointer; 137 | z-index: 8040; 138 | visibility: hidden; 139 | } 140 | 141 | .fancybox-prev span { 142 | left: 10px; 143 | background-position: 0 -36px; 144 | } 145 | 146 | .fancybox-next span { 147 | right: 10px; 148 | background-position: 0 -72px; 149 | } 150 | 151 | .fancybox-nav:hover span { 152 | visibility: visible; 153 | } 154 | 155 | .fancybox-tmp { 156 | position: absolute; 157 | top: -99999px; 158 | left: -99999px; 159 | visibility: hidden; 160 | max-width: 99999px; 161 | max-height: 99999px; 162 | overflow: visible !important; 163 | } 164 | 165 | /* Overlay helper */ 166 | 167 | .fancybox-lock { 168 | overflow: hidden !important; 169 | width: auto; 170 | } 171 | 172 | .fancybox-lock body { 173 | overflow: hidden !important; 174 | } 175 | 176 | .fancybox-lock-test { 177 | overflow-y: hidden !important; 178 | } 179 | 180 | .fancybox-overlay { 181 | position: absolute; 182 | top: 0; 183 | left: 0; 184 | overflow: hidden; 185 | display: none; 186 | z-index: 8010; 187 | background: url('fancybox_overlay.png'); 188 | } 189 | 190 | .fancybox-overlay-fixed { 191 | position: fixed; 192 | bottom: 0; 193 | right: 0; 194 | } 195 | 196 | .fancybox-lock .fancybox-overlay { 197 | overflow: auto; 198 | overflow-y: scroll; 199 | } 200 | 201 | /* Title helper */ 202 | 203 | .fancybox-title { 204 | visibility: hidden; 205 | font: normal 13px/20px "Helvetica Neue",Helvetica,Arial,sans-serif; 206 | position: relative; 207 | text-shadow: none; 208 | z-index: 8050; 209 | } 210 | 211 | .fancybox-opened .fancybox-title { 212 | visibility: visible; 213 | } 214 | 215 | .fancybox-title-float-wrap { 216 | position: absolute; 217 | bottom: 0; 218 | right: 50%; 219 | margin-bottom: -35px; 220 | z-index: 8050; 221 | text-align: center; 222 | } 223 | 224 | .fancybox-title-float-wrap .child { 225 | display: inline-block; 226 | margin-right: -100%; 227 | padding: 2px 20px; 228 | background: transparent; /* Fallback for web browsers that doesn't support RGBa */ 229 | background: rgba(0, 0, 0, 0.8); 230 | -webkit-border-radius: 15px; 231 | -moz-border-radius: 15px; 232 | border-radius: 15px; 233 | text-shadow: 0 1px 2px #222; 234 | color: #FFF; 235 | font-weight: bold; 236 | line-height: 24px; 237 | white-space: nowrap; 238 | } 239 | 240 | .fancybox-title-outside-wrap { 241 | position: relative; 242 | margin-top: 10px; 243 | color: #fff; 244 | } 245 | 246 | .fancybox-title-inside-wrap { 247 | padding-top: 10px; 248 | } 249 | 250 | .fancybox-title-over-wrap { 251 | position: absolute; 252 | bottom: 0; 253 | left: 0; 254 | color: #fff; 255 | padding: 10px; 256 | background: #000; 257 | background: rgba(0, 0, 0, .8); 258 | } 259 | 260 | /*Retina graphics!*/ 261 | @media only screen and (-webkit-min-device-pixel-ratio: 1.5), 262 | only screen and (min--moz-device-pixel-ratio: 1.5), 263 | only screen and (min-device-pixel-ratio: 1.5){ 264 | 265 | #fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span { 266 | background-image: url('fancybox_sprite@2x.png'); 267 | background-size: 44px 152px; /*The size of the normal image, half the size of the hi-res image*/ 268 | } 269 | 270 | #fancybox-loading div { 271 | background-image: url('fancybox_loading@2x.gif'); 272 | background-size: 24px 24px; /*The size of the normal image, half the size of the hi-res image*/ 273 | } 274 | } -------------------------------------------------------------------------------- /source/lib/fancybox/jquery.fancybox.pack.js: -------------------------------------------------------------------------------- 1 | /*! fancyBox v2.1.5 fancyapps.com | fancyapps.com/fancybox/#license */ 2 | (function(r,G,f,v){var J=f("html"),n=f(r),p=f(G),b=f.fancybox=function(){b.open.apply(this,arguments)},I=navigator.userAgent.match(/msie/i),B=null,s=G.createTouch!==v,t=function(a){return a&&a.hasOwnProperty&&a instanceof f},q=function(a){return a&&"string"===f.type(a)},E=function(a){return q(a)&&0
    ',image:'',iframe:'",error:'

    The requested content cannot be loaded.
    Please try again later.

    ',closeBtn:'',next:'',prev:''},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0, 6 | openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:f.noop,beforeLoad:f.noop,afterLoad:f.noop,beforeShow:f.noop,afterShow:f.noop,beforeChange:f.noop,beforeClose:f.noop,afterClose:f.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:!1, 7 | isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(a,d){if(a&&(f.isPlainObject(d)||(d={}),!1!==b.close(!0)))return f.isArray(a)||(a=t(a)?f(a).get():[a]),f.each(a,function(e,c){var k={},g,h,j,m,l;"object"===f.type(c)&&(c.nodeType&&(c=f(c)),t(c)?(k={href:c.data("fancybox-href")||c.attr("href"),title:c.data("fancybox-title")||c.attr("title"),isDom:!0,element:c},f.metadata&&f.extend(!0,k, 8 | c.metadata())):k=c);g=d.href||k.href||(q(c)?c:null);h=d.title!==v?d.title:k.title||"";m=(j=d.content||k.content)?"html":d.type||k.type;!m&&k.isDom&&(m=c.data("fancybox-type"),m||(m=(m=c.prop("class").match(/fancybox\.(\w+)/))?m[1]:null));q(g)&&(m||(b.isImage(g)?m="image":b.isSWF(g)?m="swf":"#"===g.charAt(0)?m="inline":q(c)&&(m="html",j=c)),"ajax"===m&&(l=g.split(/\s+/,2),g=l.shift(),l=l.shift()));j||("inline"===m?g?j=f(q(g)?g.replace(/.*(?=#[^\s]+$)/,""):g):k.isDom&&(j=c):"html"===m?j=g:!m&&(!g&& 9 | k.isDom)&&(m="inline",j=c));f.extend(k,{href:g,type:m,content:j,title:h,selector:l});a[e]=k}),b.opts=f.extend(!0,{},b.defaults,d),d.keys!==v&&(b.opts.keys=d.keys?f.extend({},b.defaults.keys,d.keys):!1),b.group=a,b._start(b.opts.index)},cancel:function(){var a=b.coming;a&&!1!==b.trigger("onCancel")&&(b.hideLoading(),b.ajaxLoad&&b.ajaxLoad.abort(),b.ajaxLoad=null,b.imgPreload&&(b.imgPreload.onload=b.imgPreload.onerror=null),a.wrap&&a.wrap.stop(!0,!0).trigger("onReset").remove(),b.coming=null,b.current|| 10 | b._afterZoomOut(a))},close:function(a){b.cancel();!1!==b.trigger("beforeClose")&&(b.unbindEvents(),b.isActive&&(!b.isOpen||!0===a?(f(".fancybox-wrap").stop(!0).trigger("onReset").remove(),b._afterZoomOut()):(b.isOpen=b.isOpened=!1,b.isClosing=!0,f(".fancybox-item, .fancybox-nav").remove(),b.wrap.stop(!0,!0).removeClass("fancybox-opened"),b.transitions[b.current.closeMethod]())))},play:function(a){var d=function(){clearTimeout(b.player.timer)},e=function(){d();b.current&&b.player.isActive&&(b.player.timer= 11 | setTimeout(b.next,b.current.playSpeed))},c=function(){d();p.unbind(".player");b.player.isActive=!1;b.trigger("onPlayEnd")};if(!0===a||!b.player.isActive&&!1!==a){if(b.current&&(b.current.loop||b.current.index=c.index?"next":"prev"],b.router=e||"jumpto",c.loop&&(0>a&&(a=c.group.length+a%c.group.length),a%=c.group.length),c.group[a]!==v&&(b.cancel(),b._start(a)))},reposition:function(a,d){var e=b.current,c=e?e.wrap:null,k;c&&(k=b._getPosition(d),a&&"scroll"===a.type?(delete k.position,c.stop(!0,!0).animate(k,200)):(c.css(k),e.pos=f.extend({},e.dim,k)))},update:function(a){var d= 13 | a&&a.type,e=!d||"orientationchange"===d;e&&(clearTimeout(B),B=null);b.isOpen&&!B&&(B=setTimeout(function(){var c=b.current;c&&!b.isClosing&&(b.wrap.removeClass("fancybox-tmp"),(e||"load"===d||"resize"===d&&c.autoResize)&&b._setDimension(),"scroll"===d&&c.canShrink||b.reposition(a),b.trigger("onUpdate"),B=null)},e&&!s?0:300))},toggle:function(a){b.isOpen&&(b.current.fitToView="boolean"===f.type(a)?a:!b.current.fitToView,s&&(b.wrap.removeAttr("style").addClass("fancybox-tmp"),b.trigger("onUpdate")), 14 | b.update())},hideLoading:function(){p.unbind(".loading");f("#fancybox-loading").remove()},showLoading:function(){var a,d;b.hideLoading();a=f('
    ').click(b.cancel).appendTo("body");p.bind("keydown.loading",function(a){if(27===(a.which||a.keyCode))a.preventDefault(),b.cancel()});b.defaults.fixed||(d=b.getViewport(),a.css({position:"absolute",top:0.5*d.h+d.y,left:0.5*d.w+d.x}))},getViewport:function(){var a=b.current&&b.current.locked||!1,d={x:n.scrollLeft(), 15 | y:n.scrollTop()};a?(d.w=a[0].clientWidth,d.h=a[0].clientHeight):(d.w=s&&r.innerWidth?r.innerWidth:n.width(),d.h=s&&r.innerHeight?r.innerHeight:n.height());return d},unbindEvents:function(){b.wrap&&t(b.wrap)&&b.wrap.unbind(".fb");p.unbind(".fb");n.unbind(".fb")},bindEvents:function(){var a=b.current,d;a&&(n.bind("orientationchange.fb"+(s?"":" resize.fb")+(a.autoCenter&&!a.locked?" scroll.fb":""),b.update),(d=a.keys)&&p.bind("keydown.fb",function(e){var c=e.which||e.keyCode,k=e.target||e.srcElement; 16 | if(27===c&&b.coming)return!1;!e.ctrlKey&&(!e.altKey&&!e.shiftKey&&!e.metaKey&&(!k||!k.type&&!f(k).is("[contenteditable]")))&&f.each(d,function(d,k){if(1h[0].clientWidth||h[0].clientHeight&&h[0].scrollHeight>h[0].clientHeight),h=f(h).parent();if(0!==c&&!j&&1g||0>k)b.next(0>g?"up":"right");d.preventDefault()}}))},trigger:function(a,d){var e,c=d||b.coming||b.current;if(c){f.isFunction(c[a])&&(e=c[a].apply(c,Array.prototype.slice.call(arguments,1)));if(!1===e)return!1;c.helpers&&f.each(c.helpers,function(d,e){if(e&&b.helpers[d]&&f.isFunction(b.helpers[d][a]))b.helpers[d][a](f.extend(!0, 18 | {},b.helpers[d].defaults,e),c)});p.trigger(a)}},isImage:function(a){return q(a)&&a.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)},isSWF:function(a){return q(a)&&a.match(/\.(swf)((\?|#).*)?$/i)},_start:function(a){var d={},e,c;a=l(a);e=b.group[a]||null;if(!e)return!1;d=f.extend(!0,{},b.opts,e);e=d.margin;c=d.padding;"number"===f.type(e)&&(d.margin=[e,e,e,e]);"number"===f.type(c)&&(d.padding=[c,c,c,c]);d.modal&&f.extend(!0,d,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1, 19 | mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}});d.autoSize&&(d.autoWidth=d.autoHeight=!0);"auto"===d.width&&(d.autoWidth=!0);"auto"===d.height&&(d.autoHeight=!0);d.group=b.group;d.index=a;b.coming=d;if(!1===b.trigger("beforeLoad"))b.coming=null;else{c=d.type;e=d.href;if(!c)return b.coming=null,b.current&&b.router&&"jumpto"!==b.router?(b.current.index=a,b[b.router](b.direction)):!1;b.isActive=!0;if("image"===c||"swf"===c)d.autoHeight=d.autoWidth=!1,d.scrolling="visible";"image"===c&&(d.aspectRatio= 20 | !0);"iframe"===c&&s&&(d.scrolling="scroll");d.wrap=f(d.tpl.wrap).addClass("fancybox-"+(s?"mobile":"desktop")+" fancybox-type-"+c+" fancybox-tmp "+d.wrapCSS).appendTo(d.parent||"body");f.extend(d,{skin:f(".fancybox-skin",d.wrap),outer:f(".fancybox-outer",d.wrap),inner:f(".fancybox-inner",d.wrap)});f.each(["Top","Right","Bottom","Left"],function(a,b){d.skin.css("padding"+b,w(d.padding[a]))});b.trigger("onReady");if("inline"===c||"html"===c){if(!d.content||!d.content.length)return b._error("content")}else if(!e)return b._error("href"); 21 | "image"===c?b._loadImage():"ajax"===c?b._loadAjax():"iframe"===c?b._loadIframe():b._afterLoad()}},_error:function(a){f.extend(b.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:a,content:b.coming.tpl.error});b._afterLoad()},_loadImage:function(){var a=b.imgPreload=new Image;a.onload=function(){this.onload=this.onerror=null;b.coming.width=this.width/b.opts.pixelRatio;b.coming.height=this.height/b.opts.pixelRatio;b._afterLoad()};a.onerror=function(){this.onload= 22 | this.onerror=null;b._error("image")};a.src=b.coming.href;!0!==a.complete&&b.showLoading()},_loadAjax:function(){var a=b.coming;b.showLoading();b.ajaxLoad=f.ajax(f.extend({},a.ajax,{url:a.href,error:function(a,e){b.coming&&"abort"!==e?b._error("ajax",a):b.hideLoading()},success:function(d,e){"success"===e&&(a.content=d,b._afterLoad())}}))},_loadIframe:function(){var a=b.coming,d=f(a.tpl.iframe.replace(/\{rnd\}/g,(new Date).getTime())).attr("scrolling",s?"auto":a.iframe.scrolling).attr("src",a.href); 23 | f(a.wrap).bind("onReset",function(){try{f(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(a){}});a.iframe.preload&&(b.showLoading(),d.one("load",function(){f(this).data("ready",1);s||f(this).bind("load.fb",b.update);f(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show();b._afterLoad()}));a.content=d.appendTo(a.inner);a.iframe.preload||b._afterLoad()},_preloadImages:function(){var a=b.group,d=b.current,e=a.length,c=d.preload?Math.min(d.preload, 24 | e-1):0,f,g;for(g=1;g<=c;g+=1)f=a[(d.index+g)%e],"image"===f.type&&f.href&&((new Image).src=f.href)},_afterLoad:function(){var a=b.coming,d=b.current,e,c,k,g,h;b.hideLoading();if(a&&!1!==b.isActive)if(!1===b.trigger("afterLoad",a,d))a.wrap.stop(!0).trigger("onReset").remove(),b.coming=null;else{d&&(b.trigger("beforeChange",d),d.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove());b.unbindEvents();e=a.content;c=a.type;k=a.scrolling;f.extend(b,{wrap:a.wrap,skin:a.skin, 25 | outer:a.outer,inner:a.inner,current:a,previous:d});g=a.href;switch(c){case "inline":case "ajax":case "html":a.selector?e=f("
    ").html(e).find(a.selector):t(e)&&(e.data("fancybox-placeholder")||e.data("fancybox-placeholder",f('
    ').insertAfter(e).hide()),e=e.show().detach(),a.wrap.bind("onReset",function(){f(this).find(e).length&&e.hide().replaceAll(e.data("fancybox-placeholder")).data("fancybox-placeholder",!1)}));break;case "image":e=a.tpl.image.replace("{href}", 26 | g);break;case "swf":e='',h="",f.each(a.swf,function(a,b){e+='';h+=" "+a+'="'+b+'"'}),e+='"}(!t(e)||!e.parent().is(a.inner))&&a.inner.append(e);b.trigger("beforeShow");a.inner.css("overflow","yes"===k?"scroll": 27 | "no"===k?"hidden":k);b._setDimension();b.reposition();b.isOpen=!1;b.coming=null;b.bindEvents();if(b.isOpened){if(d.prevMethod)b.transitions[d.prevMethod]()}else f(".fancybox-wrap").not(a.wrap).stop(!0).trigger("onReset").remove();b.transitions[b.isOpened?a.nextMethod:a.openMethod]();b._preloadImages()}},_setDimension:function(){var a=b.getViewport(),d=0,e=!1,c=!1,e=b.wrap,k=b.skin,g=b.inner,h=b.current,c=h.width,j=h.height,m=h.minWidth,u=h.minHeight,n=h.maxWidth,p=h.maxHeight,s=h.scrolling,q=h.scrollOutside? 28 | h.scrollbarWidth:0,x=h.margin,y=l(x[1]+x[3]),r=l(x[0]+x[2]),v,z,t,C,A,F,B,D,H;e.add(k).add(g).width("auto").height("auto").removeClass("fancybox-tmp");x=l(k.outerWidth(!0)-k.width());v=l(k.outerHeight(!0)-k.height());z=y+x;t=r+v;C=E(c)?(a.w-z)*l(c)/100:c;A=E(j)?(a.h-t)*l(j)/100:j;if("iframe"===h.type){if(H=h.content,h.autoHeight&&1===H.data("ready"))try{H[0].contentWindow.document.location&&(g.width(C).height(9999),F=H.contents().find("body"),q&&F.css("overflow-x","hidden"),A=F.outerHeight(!0))}catch(G){}}else if(h.autoWidth|| 29 | h.autoHeight)g.addClass("fancybox-tmp"),h.autoWidth||g.width(C),h.autoHeight||g.height(A),h.autoWidth&&(C=g.width()),h.autoHeight&&(A=g.height()),g.removeClass("fancybox-tmp");c=l(C);j=l(A);D=C/A;m=l(E(m)?l(m,"w")-z:m);n=l(E(n)?l(n,"w")-z:n);u=l(E(u)?l(u,"h")-t:u);p=l(E(p)?l(p,"h")-t:p);F=n;B=p;h.fitToView&&(n=Math.min(a.w-z,n),p=Math.min(a.h-t,p));z=a.w-y;r=a.h-r;h.aspectRatio?(c>n&&(c=n,j=l(c/D)),j>p&&(j=p,c=l(j*D)),cz||y>r)&&(c>m&&j>u)&&!(19n&&(c=n,j=l(c/D)),g.width(c).height(j),e.width(c+x),a=e.width(),y=e.height();else c=Math.max(m,Math.min(c,c-(a-z))),j=Math.max(u,Math.min(j,j-(y-r)));q&&("auto"===s&&jz||y>r)&&c>m&&j>u;c=h.aspectRatio?cu&&j
    ').appendTo(b.coming?b.coming.parent:a.parent);this.fixed=!1;a.fixed&&b.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(a){var d=this;a=f.extend({},this.defaults,a);this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(a);this.fixed||(n.bind("resize.overlay",f.proxy(this.update,this)),this.update());a.closeClick&&this.overlay.bind("click.overlay",function(a){if(f(a.target).hasClass("fancybox-overlay"))return b.isActive? 40 | b.close():d.close(),!1});this.overlay.css(a.css).show()},close:function(){var a,b;n.unbind("resize.overlay");this.el.hasClass("fancybox-lock")&&(f(".fancybox-margin").removeClass("fancybox-margin"),a=n.scrollTop(),b=n.scrollLeft(),this.el.removeClass("fancybox-lock"),n.scrollTop(a).scrollLeft(b));f(".fancybox-overlay").remove().hide();f.extend(this,{overlay:null,fixed:!1})},update:function(){var a="100%",b;this.overlay.width(a).height("100%");I?(b=Math.max(G.documentElement.offsetWidth,G.body.offsetWidth), 41 | p.width()>b&&(a=p.width())):p.width()>n.width()&&(a=p.width());this.overlay.width(a).height(p.height())},onReady:function(a,b){var e=this.overlay;f(".fancybox-overlay").stop(!0,!0);e||this.create(a);a.locked&&(this.fixed&&b.fixed)&&(e||(this.margin=p.height()>n.height()?f("html").css("margin-right").replace("px",""):!1),b.locked=this.overlay.append(b.wrap),b.fixed=!1);!0===a.showEarly&&this.beforeShow.apply(this,arguments)},beforeShow:function(a,b){var e,c;b.locked&&(!1!==this.margin&&(f("*").filter(function(){return"fixed"=== 42 | f(this).css("position")&&!f(this).hasClass("fancybox-overlay")&&!f(this).hasClass("fancybox-wrap")}).addClass("fancybox-margin"),this.el.addClass("fancybox-margin")),e=n.scrollTop(),c=n.scrollLeft(),this.el.addClass("fancybox-lock"),n.scrollTop(e).scrollLeft(c));this.open(a)},onUpdate:function(){this.fixed||this.update()},afterClose:function(a){this.overlay&&!b.coming&&this.overlay.fadeOut(a.speedOut,f.proxy(this.close,this))}};b.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(a){var d= 43 | b.current,e=d.title,c=a.type;f.isFunction(e)&&(e=e.call(d.element,d));if(q(e)&&""!==f.trim(e)){d=f('
    '+e+"
    ");switch(c){case "inside":c=b.skin;break;case "outside":c=b.wrap;break;case "over":c=b.inner;break;default:c=b.skin,d.appendTo("body"),I&&d.width(d.width()),d.wrapInner(''),b.current.margin[2]+=Math.abs(l(d.css("margin-bottom")))}d["top"===a.position?"prependTo":"appendTo"](c)}}};f.fn.fancybox=function(a){var d, 44 | e=f(this),c=this.selector||"",k=function(g){var h=f(this).blur(),j=d,k,l;!g.ctrlKey&&(!g.altKey&&!g.shiftKey&&!g.metaKey)&&!h.is(".fancybox-wrap")&&(k=a.groupAttr||"data-fancybox-group",l=h.attr(k),l||(k="rel",l=h.get(0)[k]),l&&(""!==l&&"nofollow"!==l)&&(h=c.length?f(c):e,h=h.filter("["+k+'="'+l+'"]'),j=h.index(this)),a.index=j,!1!==b.open(h,a)&&g.preventDefault())};a=a||{};d=a.index||0;!c||!1===a.live?e.unbind("click.fb-start").bind("click.fb-start",k):p.undelegate(c,"click.fb-start").delegate(c+ 45 | ":not('.fancybox-item, .fancybox-nav')","click.fb-start",k);this.filter("[data-fancybox-start=1]").trigger("click");return this};p.ready(function(){var a,d;f.scrollbarWidth===v&&(f.scrollbarWidth=function(){var a=f('
    ').appendTo("body"),b=a.children(),b=b.innerWidth()-b.height(99).innerWidth();a.remove();return b});if(f.support.fixedPosition===v){a=f.support;d=f('
    ').appendTo("body");var e=20=== 46 | d[0].offsetTop||15===d[0].offsetTop;d.remove();a.fixedPosition=e}f.extend(b.defaults,{scrollbarWidth:f.scrollbarWidth(),fixed:f.support.fixedPosition,parent:f("body")});a=f(r).width();J.addClass("fancybox-lock-test");d=f(r).width();J.removeClass("fancybox-lock-test");f("").appendTo("head")})})(window,document,jQuery); -------------------------------------------------------------------------------- /source/lib/slideout/slideout.js: -------------------------------------------------------------------------------- 1 | !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.Slideout=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o self._tolerance) ? self.open() : self.close(); 245 | } 246 | self._moved = false; 247 | }; 248 | 249 | this.panel.addEventListener(touch.end, this._onTouchEndFn); 250 | 251 | /** 252 | * Translates panel on touchmove 253 | */ 254 | this._onTouchMoveFn = function(eve) { 255 | if ( 256 | scrolling || 257 | self._preventOpen || 258 | typeof eve.touches === 'undefined' || 259 | hasIgnoredElements(eve.target) 260 | ) { 261 | return; 262 | } 263 | 264 | var dif_x = eve.touches[0].clientX - self._startOffsetX; 265 | var translateX = self._currentOffsetX = dif_x; 266 | 267 | if (Math.abs(translateX) > self._padding) { 268 | return; 269 | } 270 | 271 | if (Math.abs(dif_x) > 20) { 272 | 273 | self._opening = true; 274 | 275 | var oriented_dif_x = dif_x * self._orientation; 276 | 277 | if (self._opened && oriented_dif_x > 0 || !self._opened && oriented_dif_x < 0) { 278 | return; 279 | } 280 | 281 | if (!self._moved) { 282 | self.emit('translatestart'); 283 | } 284 | 285 | if (oriented_dif_x <= 0) { 286 | translateX = dif_x + self._padding * self._orientation; 287 | self._opening = false; 288 | } 289 | 290 | if (!(self._moved && html.classList.contains('slideout-open'))) { 291 | html.classList.add('slideout-open'); 292 | } 293 | 294 | self.panel.style[prefix + 'transform'] = self.panel.style.transform = 'translateX(' + translateX + 'px)'; 295 | self.emit('translate', translateX); 296 | self._moved = true; 297 | } 298 | 299 | }; 300 | 301 | this.panel.addEventListener(touch.move, this._onTouchMoveFn); 302 | 303 | return this; 304 | }; 305 | 306 | /** 307 | * Enable opening the slideout via touch events. 308 | */ 309 | Slideout.prototype.enableTouch = function() { 310 | this._touch = true; 311 | return this; 312 | }; 313 | 314 | /** 315 | * Disable opening the slideout via touch events. 316 | */ 317 | Slideout.prototype.disableTouch = function() { 318 | this._touch = false; 319 | return this; 320 | }; 321 | 322 | /** 323 | * Destroy an instance of slideout. 324 | */ 325 | Slideout.prototype.destroy = function() { 326 | // Close before clean 327 | this.close(); 328 | 329 | // Remove event listeners 330 | doc.removeEventListener(touch.move, this._preventMove); 331 | this.panel.removeEventListener(touch.start, this._resetTouchFn); 332 | this.panel.removeEventListener('touchcancel', this._onTouchCancelFn); 333 | this.panel.removeEventListener(touch.end, this._onTouchEndFn); 334 | this.panel.removeEventListener(touch.move, this._onTouchMoveFn); 335 | doc.removeEventListener('scroll', this._onScrollFn); 336 | 337 | // Remove methods 338 | this.open = this.close = function() {}; 339 | 340 | // Return the instance so it can be easily dereferenced 341 | return this; 342 | }; 343 | 344 | /** 345 | * Expose Slideout 346 | */ 347 | module.exports = Slideout; 348 | 349 | },{"decouple":2,"emitter":3}],2:[function(require,module,exports){ 350 | 'use strict'; 351 | 352 | var requestAnimFrame = (function() { 353 | return window.requestAnimationFrame || 354 | window.webkitRequestAnimationFrame || 355 | function (callback) { 356 | window.setTimeout(callback, 1000 / 60); 357 | }; 358 | }()); 359 | 360 | function decouple(node, event, fn) { 361 | var eve, 362 | tracking = false; 363 | 364 | function captureEvent(e) { 365 | eve = e; 366 | track(); 367 | } 368 | 369 | function track() { 370 | if (!tracking) { 371 | requestAnimFrame(update); 372 | tracking = true; 373 | } 374 | } 375 | 376 | function update() { 377 | fn.call(node, eve); 378 | tracking = false; 379 | } 380 | 381 | node.addEventListener(event, captureEvent, false); 382 | 383 | return captureEvent; 384 | } 385 | 386 | /** 387 | * Expose decouple 388 | */ 389 | module.exports = decouple; 390 | 391 | },{}],3:[function(require,module,exports){ 392 | "use strict"; 393 | 394 | var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; 395 | 396 | exports.__esModule = true; 397 | /** 398 | * Creates a new instance of Emitter. 399 | * @class 400 | * @returns {Object} Returns a new instance of Emitter. 401 | * @example 402 | * // Creates a new instance of Emitter. 403 | * var Emitter = require('emitter'); 404 | * 405 | * var emitter = new Emitter(); 406 | */ 407 | 408 | var Emitter = (function () { 409 | function Emitter() { 410 | _classCallCheck(this, Emitter); 411 | } 412 | 413 | /** 414 | * Adds a listener to the collection for the specified event. 415 | * @memberof! Emitter.prototype 416 | * @function 417 | * @param {String} event - The event name. 418 | * @param {Function} listener - A listener function to add. 419 | * @returns {Object} Returns an instance of Emitter. 420 | * @example 421 | * // Add an event listener to "foo" event. 422 | * emitter.on('foo', listener); 423 | */ 424 | 425 | Emitter.prototype.on = function on(event, listener) { 426 | // Use the current collection or create it. 427 | this._eventCollection = this._eventCollection || {}; 428 | 429 | // Use the current collection of an event or create it. 430 | this._eventCollection[event] = this._eventCollection[event] || []; 431 | 432 | // Appends the listener into the collection of the given event 433 | this._eventCollection[event].push(listener); 434 | 435 | return this; 436 | }; 437 | 438 | /** 439 | * Adds a listener to the collection for the specified event that will be called only once. 440 | * @memberof! Emitter.prototype 441 | * @function 442 | * @param {String} event - The event name. 443 | * @param {Function} listener - A listener function to add. 444 | * @returns {Object} Returns an instance of Emitter. 445 | * @example 446 | * // Will add an event handler to "foo" event once. 447 | * emitter.once('foo', listener); 448 | */ 449 | 450 | Emitter.prototype.once = function once(event, listener) { 451 | var self = this; 452 | 453 | function fn() { 454 | self.off(event, fn); 455 | listener.apply(this, arguments); 456 | } 457 | 458 | fn.listener = listener; 459 | 460 | this.on(event, fn); 461 | 462 | return this; 463 | }; 464 | 465 | /** 466 | * Removes a listener from the collection for the specified event. 467 | * @memberof! Emitter.prototype 468 | * @function 469 | * @param {String} event - The event name. 470 | * @param {Function} listener - A listener function to remove. 471 | * @returns {Object} Returns an instance of Emitter. 472 | * @example 473 | * // Remove a given listener. 474 | * emitter.off('foo', listener); 475 | */ 476 | 477 | Emitter.prototype.off = function off(event, listener) { 478 | 479 | var listeners = undefined; 480 | 481 | // Defines listeners value. 482 | if (!this._eventCollection || !(listeners = this._eventCollection[event])) { 483 | return this; 484 | } 485 | 486 | listeners.forEach(function (fn, i) { 487 | if (fn === listener || fn.listener === listener) { 488 | // Removes the given listener. 489 | listeners.splice(i, 1); 490 | } 491 | }); 492 | 493 | // Removes an empty event collection. 494 | if (listeners.length === 0) { 495 | delete this._eventCollection[event]; 496 | } 497 | 498 | return this; 499 | }; 500 | 501 | /** 502 | * Execute each item in the listener collection in order with the specified data. 503 | * @memberof! Emitter.prototype 504 | * @function 505 | * @param {String} event - The name of the event you want to emit. 506 | * @param {...Object} data - Data to pass to the listeners. 507 | * @returns {Object} Returns an instance of Emitter. 508 | * @example 509 | * // Emits the "foo" event with 'param1' and 'param2' as arguments. 510 | * emitter.emit('foo', 'param1', 'param2'); 511 | */ 512 | 513 | Emitter.prototype.emit = function emit(event) { 514 | var _this = this; 515 | 516 | for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { 517 | args[_key - 1] = arguments[_key]; 518 | } 519 | 520 | var listeners = undefined; 521 | 522 | // Defines listeners value. 523 | if (!this._eventCollection || !(listeners = this._eventCollection[event])) { 524 | return this; 525 | } 526 | 527 | // Clone listeners 528 | listeners = listeners.slice(0); 529 | 530 | listeners.forEach(function (fn) { 531 | return fn.apply(_this, args); 532 | }); 533 | 534 | return this; 535 | }; 536 | 537 | return Emitter; 538 | })(); 539 | 540 | /** 541 | * Exports Emitter 542 | */ 543 | exports["default"] = Emitter; 544 | module.exports = exports["default"]; 545 | },{}]},{},[1])(1) 546 | }); 547 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJpbmRleC5qcyIsIm5vZGVfbW9kdWxlcy9kZWNvdXBsZS9pbmRleC5qcyIsIm5vZGVfb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O1xuICAgKi9cblxuICBFbWl0dGVyLnByb3RvdHlwZS5lbWl0ID0gZnVuY3Rpb24gZW1pdChldmVudCkge1xuICAgIHZhciBfdGhpcyA9IHRoaXM7XG5cbiAgICBmb3IgKHZhciBfbGVuID0gYXJndW1lbnRzLmxlbmd0aCwgYXJncyA9IEFycmF5KF9sZW4gPiAxID8gX2xlbiAtIDEgOiAwKSwgX2tleSA9IDE7IF9rZXkgPCBfbGVuOyBfa2V5KyspIHtcbiAgICAgIGFyZ3NbX2tleSAtIDFdID0gYXJndW1lbnRzW19rZXldO1xuICAgIH1cblxuICAgIHZhciBsaXN0ZW5lcnMgPSB1bmRlZmluZWQ7XG5cbiAgICAvLyBEZWZpbmVzIGxpc3RlbmVycyB2YWx1ZS5cbiAgICBpZiAoIXRoaXMuX2V2ZW50Q29sbGVjdGlvbiB8fCAhKGxpc3RlbmVycyA9IHRoaXMuX2V2ZW50Q29sbGVjdGlvbltldmVudF0pKSB7XG4gICAgICByZXR1cm4gdGhpcztcbiAgICB9XG5cbiAgICAvLyBDbG9uZSBsaXN0ZW5lcnNcbiAgICBsaXN0ZW5lcnMgPSBsaXN0ZW5lcnMuc2xpY2UoMCk7XG5cbiAgICBsaXN0ZW5lcnMuZm9yRWFjaChmdW5jdGlvbiAoZm4pIHtcbiAgICAgIHJldHVybiBmbi5hcHBseShfdGhpcywgYXJncyk7XG4gICAgfSk7XG5cbiAgICByZXR1cm4gdGhpcztcbiAgfTtcblxuICByZXR1cm4gRW1pdHRlcjtcbn0pKCk7XG5cbi8qKlxuICogRXhwb3J0cyBFbWl0dGVyXG4gKi9cbmV4cG9ydHNbXCJkZWZhdWx0XCJdID0gRW1pdHRlcjtcbm1vZHVsZS5leHBvcnRzID0gZXhwb3J0c1tcImRlZmF1bHRcIl07Il19 548 | -------------------------------------------------------------------------------- /source/lib/slideout/slideout.min.js: -------------------------------------------------------------------------------- 1 | !function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.Slideout=t()}}(function(){var t,e,n;return function i(t,e,n){function o(r,a){if(!e[r]){if(!t[r]){var u=typeof require=="function"&&require;if(!a&&u)return u(r,!0);if(s)return s(r,!0);var l=new Error("Cannot find module '"+r+"'");throw l.code="MODULE_NOT_FOUND",l}var f=e[r]={exports:{}};t[r][0].call(f.exports,function(e){var n=t[r][1][e];return o(n?n:e)},f,f.exports,i,t,e,n)}return e[r].exports}var s=typeof require=="function"&&require;for(var r=0;rt._tolerance?t.open():t.close()}t._moved=false};this.panel.addEventListener(f.end,this._onTouchEndFn);this._onTouchMoveFn=function(e){if(r||t._preventOpen||typeof e.touches==="undefined"||d(e.target)){return}var n=e.touches[0].clientX-t._startOffsetX;var i=t._currentOffsetX=n;if(Math.abs(i)>t._padding){return}if(Math.abs(n)>20){t._opening=true;var o=n*t._orientation;if(t._opened&&o>0||!t._opened&&o<0){return}if(!t._moved){t.emit("translatestart")}if(o<=0){i=n+t._padding*t._orientation;t._opening=false}if(!(t._moved&&u.classList.contains("slideout-open"))){u.classList.add("slideout-open")}t.panel.style[h+"transform"]=t.panel.style.transform="translateX("+i+"px)";t.emit("translate",i);t._moved=true}};this.panel.addEventListener(f.move,this._onTouchMoveFn);return this};_.prototype.enableTouch=function(){this._touch=true;return this};_.prototype.disableTouch=function(){this._touch=false;return this};_.prototype.destroy=function(){this.close();a.removeEventListener(f.move,this._preventMove);this.panel.removeEventListener(f.start,this._resetTouchFn);this.panel.removeEventListener("touchcancel",this._onTouchCancelFn);this.panel.removeEventListener(f.end,this._onTouchEndFn);this.panel.removeEventListener(f.move,this._onTouchMoveFn);a.removeEventListener("scroll",this._onScrollFn);this.open=this.close=function(){};return this};e.exports=_},{decouple:2,emitter:3}],2:[function(t,e,n){"use strict";var i=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)}}();function o(t,e,n){var o,s=false;function r(t){o=t;a()}function a(){if(!s){i(u);s=true}}function u(){n.call(t,o);s=false}t.addEventListener(e,r,false);return r}e.exports=o},{}],3:[function(t,e,n){"use strict";var i=function(t,e){if(!(t instanceof e)){throw new TypeError("Cannot call a class as a function")}};n.__esModule=true;var o=function(){function t(){i(this,t)}t.prototype.on=function e(t,n){this._eventCollection=this._eventCollection||{};this._eventCollection[t]=this._eventCollection[t]||[];this._eventCollection[t].push(n);return this};t.prototype.once=function n(t,e){var n=this;function i(){n.off(t,i);e.apply(this,arguments)}i.listener=e;this.on(t,i);return this};t.prototype.off=function o(t,e){var n=undefined;if(!this._eventCollection||!(n=this._eventCollection[t])){return this}n.forEach(function(t,i){if(t===e||t.listener===e){n.splice(i,1)}});if(n.length===0){delete this._eventCollection[t]}return this};t.prototype.emit=function s(t){var e=this;for(var n=arguments.length,i=Array(n>1?n-1:0),o=1;o