├── .github
└── stale.yml
├── LICENSE
├── README.md
├── canvas-nest-nomobile.min.js
└── canvas-nest.min.js
/.github/stale.yml:
--------------------------------------------------------------------------------
1 | # Configuration for probot-stale - https://github.com/probot/stale
2 |
3 | # Number of days of inactivity before an Issue or Pull Request becomes stale
4 | daysUntilStale: 60
5 | # Number of days of inactivity before a stale Issue or Pull Request is closed
6 | daysUntilClose: 7
7 | # Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
8 | exemptLabels:
9 | - bug
10 | - discussion
11 | - need-verify
12 | - pending-reply
13 | - feature-request
14 | - enhancement
15 | - question
16 | - documentation
17 | - backlog
18 | # Label to use when marking as stale
19 | staleLabel: stale
20 | # Comment to post when marking as stale. Set to `false` to disable
21 | markComment: >
22 | This issue has been automatically marked as stale because lack of
23 | recent activity. It will be closed if no further activity occurs. Thank you
24 | for your contributions.
25 | # Comment to post when removing the stale label. Set to `false` to disable
26 | unmarkComment: false
27 | # Comment to post when closing a stale Issue or Pull Request. Set to `false` to disable
28 | closeComment: false
29 | # Limit to only `issues` or `pulls`
30 | only: issues
31 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 «NexT»
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.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Theme NexT Canvas Nest
2 |
3 | 
4 |
5 | [canvas-nest.js](https://github.com/hustcc/canvas-nest.js) for [NexT](https://github.com/theme-next).
6 |
7 | ## Install
8 |
9 | ### Step 1 → Go to Hexo dir
10 |
11 | Change dir to **Hexo** directory. There must be `scaffolds`, `source`, `themes` and other directories:
12 |
13 | ```sh
14 | $ cd hexo
15 | $ ls
16 | scaffolds source themes _config.yml package.json
17 | ```
18 |
19 | ### Step 2 → Create `footer.swig`
20 |
21 | Create a file named `footer.swig` in `hexo/source/_data` directory (create `_data` directory if it does not exist).
22 |
23 | Edit this file and add the following content:
24 |
25 | ```xml
26 |
27 | ```
28 |
29 | You can customize these options.
30 |
31 | ### Step 3 → Set it up
32 |
33 | In the NexT `_config.yml`, uncomment `footer` under the `custom_file_path` section.
34 |
35 | ```yml
36 | # Define custom file paths.
37 | # Create your custom files in site directory `source/_data` and uncomment needed files below.
38 | custom_file_path:
39 | #head: source/_data/head.swig
40 | #header: source/_data/header.swig
41 | #sidebar: source/_data/sidebar.swig
42 | #postMeta: source/_data/post-meta.swig
43 | #postBodyEnd: source/_data/post-body-end.swig
44 | footer: source/_data/footer.swig
45 | #bodyEnd: source/_data/body-end.swig
46 | #variable: source/_data/variables.styl
47 | #mixin: source/_data/mixins.styl
48 | #style: source/_data/styles.styl
49 | ```
50 |
--------------------------------------------------------------------------------
/canvas-nest-nomobile.min.js:
--------------------------------------------------------------------------------
1 | !function(){
2 | var userAgentInfo = navigator.userAgent;
3 | var Agents = ["iPad", "iPhone", "Android",
4 | "SymbianOS", "Windows Phone",
5 | "iPod", "webOS", "BlackBerry", "IEMobile"];
6 | for (var v = 0; v < Agents.length; v++) {
7 | if (userAgentInfo.indexOf(Agents[v]) > 0) {
8 | return;
9 | }
10 | }
11 | function o(w,v,i){return w.getAttribute(v)||i}function j(i){return document.getElementsByTagName(i)}function l(){var i=j("script"),w=i.length,v=i[w-1];return{l:w,z:o(v,"zIndex",-1),o:o(v,"opacity",0.5),c:o(v,"color","0,0,0"),n:o(v,"count",99)}}function k(){r=u.width=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,n=u.height=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight}function b(){e.clearRect(0,0,r,n);var w=[f].concat(t);var x,v,A,B,z,y;t.forEach(function(i){i.x+=i.xa,i.y+=i.ya,i.xa*=i.x>r||i.x<0?-1:1,i.ya*=i.y>n||i.y<0?-1:1,e.fillRect(i.x-0.5,i.y-0.5,1,1);for(v=0;v=x.max/2&&(i.x-=0.03*B,i.y-=0.03*z),A=(x.max-y)/x.max,e.beginPath(),e.lineWidth=A/2,e.strokeStyle="rgba("+s.c+","+(A+0.2)+")",e.moveTo(i.x,i.y),e.lineTo(x.x,x.y),e.stroke())}}w.splice(w.indexOf(i),1)}),m(b)}var u=document.createElement("canvas"),s=l(),c="c_n"+s.l,e=u.getContext("2d"),r,n,m=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(i){window.setTimeout(i,1000/45)},a=Math.random,f={x:null,y:null,max:20000};u.id=c;u.style.cssText="position:fixed;top:0;left:0;z-index:"+s.z+";opacity:"+s.o;j("body")[0].appendChild(u);k(),window.onresize=k;window.onmousemove=function(i){i=i||window.event,f.x=i.clientX,f.y=i.clientY},window.onmouseout=function(){f.x=null,f.y=null};for(var t=[],p=0;s.n>p;p++){var h=a()*r,g=a()*n,q=2*a()-1,d=2*a()-1;t.push({x:h,y:g,xa:q,ya:d,max:6000})}setTimeout(function(){b()},100)}();
--------------------------------------------------------------------------------
/canvas-nest.min.js:
--------------------------------------------------------------------------------
1 | !function(){function o(w,v,i){return w.getAttribute(v)||i}function j(i){return document.getElementsByTagName(i)}function l(){var i=j("script"),w=i.length,v=i[w-1];return{l:w,z:o(v,"zIndex",-1),o:o(v,"opacity",0.5),c:o(v,"color","0,0,0"),n:o(v,"count",99)}}function k(){r=u.width=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,n=u.height=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight}function b(){e.clearRect(0,0,r,n);var w=[f].concat(t);var x,v,A,B,z,y;t.forEach(function(i){i.x+=i.xa,i.y+=i.ya,i.xa*=i.x>r||i.x<0?-1:1,i.ya*=i.y>n||i.y<0?-1:1,e.fillRect(i.x-0.5,i.y-0.5,1,1);for(v=0;v=x.max/2&&(i.x-=0.03*B,i.y-=0.03*z),A=(x.max-y)/x.max,e.beginPath(),e.lineWidth=A/2,e.strokeStyle="rgba("+s.c+","+(A+0.2)+")",e.moveTo(i.x,i.y),e.lineTo(x.x,x.y),e.stroke())}}w.splice(w.indexOf(i),1)}),m(b)}var u=document.createElement("canvas"),s=l(),c="c_n"+s.l,e=u.getContext("2d"),r,n,m=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(i){window.setTimeout(i,1000/45)},a=Math.random,f={x:null,y:null,max:20000};u.id=c;u.style.cssText="position:fixed;top:0;left:0;z-index:"+s.z+";opacity:"+s.o;j("body")[0].appendChild(u);k(),window.onresize=k;window.onmousemove=function(i){i=i||window.event,f.x=i.clientX,f.y=i.clientY},window.onmouseout=function(){f.x=null,f.y=null};for(var t=[],p=0;s.n>p;p++){var h=a()*r,g=a()*n,q=2*a()-1,d=2*a()-1;t.push({x:h,y:g,xa:q,ya:d,max:6000})}setTimeout(function(){b()},100)}();
--------------------------------------------------------------------------------