background.js 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/background.min.js +1 -0
  3. metadata +44 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6d0871754b4a0d1e2626228476624bfdf3aca12d
4
+ data.tar.gz: 82a121740e93e2563a63620ae284e065679006e2
5
+ SHA512:
6
+ metadata.gz: 547322ea22c0ac88606b43dffc8826b750146fdbedb496ca2f82c21a13d3d08e024e79948ab919ceae8d9e52de21392652d8c611d1bf1d50af0a44aa70b0fd88
7
+ data.tar.gz: a621e5daf3d6b571a72462cd2509ef5e6f794b9aa8e5dff00b048a776e6932e5a05cc184ba9783c76f6d32ff4ceb9b87945286230607bbc46b26d6b60cef715b
data/background.min.js ADDED
@@ -0,0 +1 @@
1
+ window.background={internal:{$d:$(document),$w:$(window),$b:$("body")},slide:function(d){var b,c,g,h,f,a,e;f=this.internal;c={horizontal:"center",duration:"1s",easeType:"ease-out"};if(typeof d==="string"){d={horizontal:arguments[0],duration:arguments[1],easeType:arguments[2]}}h=$.extend(c,d);b="background-position "+h.duration+" "+h.easeType;f.$b.css({transition:b,"moz-transition":b,"-webkit-transition":b,"-o-transition":b,"-ms-transition":b});e=[f.$d.height(),f.$w.height()],g=e[0],a=e[1];f.$w.on("resize",function(i){return a=$(this).height()});return f.$w.on("scroll",function(k){var i,j;g=g===f.$d.height()?g:f.$d.height();j=f.$d.scrollTop();i=j/(g-a)*100.toFixed(7);return f.$b.css("background-position",h.horizontal+(" "+i+"%"))})},tick:function(b){var g,a,f,d,e;d=this.internal;a={json:"",backgroundImage:"",backgroundColor:""};if(typeof b==="string"){b={json:arguments[0],backgroundImage:arguments[1],backgroundColor:arguments[2]}}f=$.extend(a,b);e=/^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+)(?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/;g=function(p){var m,j,q,h,c,o,k,n,l,i;if(typeof p==="string"){p=$.parseJSON(p)}m=p.backgrounds;h=new Date();for(k=0,n=m.length;k<n;k++){q=m[k];c=q.started.split(":");j=q.ended.split(":");if(c[0]===j[0]){if(h.getHours()===parseInt(c[0])&&(c[1]<=(l=h.getMinutes())&&l<=j[1])){true}else{continue}}else{if((parseInt(c[0])<(i=h.getHours())&&i<parseInt(j[0]))){true}else{if(h.getHours()===parseInt(c[0])&&h.getMinutes()>=parseInt(c[1])){true}else{if(h.getHours()===parseInt(j[0])&&h.getMinutes()<=parseInt(j[1])){true}else{continue}}}}o=q}if(o){if(o.image){d.$b.css("background-image","url("+o.image+")")}else{if(f.backgroundImage){d.$b.css("background-image","url("+f.backgroundImage+")")}}if(o.color){return d.$b.css("background-color",o.color)}else{if(f.backgroundColor){return d.$b.css("background-color",f.backgroundColor)}}}else{if(f.backgroundImage){d.$b.css("background-image","url("+f.backgroundImage+")")}if(f.backgroundColor){return d.$b.css("background-color",f.backgroundColor)}}};if(typeof f.json==="string"){if(e.test(f.json)){return $.ajax({url:f.json,data:{},success:function(c){return g(c)},error:function(){if(f.backgroundImage){d.$b.css("background-image","url("+f.backgroundImage+")")}if(f.backgroundColor){return d.$b.css("background-color",f.backgroundColor)}}})}else{return g(f.json)}}else{return g(f.json)}}};
metadata ADDED
@@ -0,0 +1,44 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: background.js
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3
5
+ platform: ruby
6
+ authors:
7
+ - he liu
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-03-10 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: a background dynamic effect libraries
14
+ email: gilbert.fr0m@gmail.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - "./background.min.js"
20
+ homepage: https://github.com/fr0m/background.js
21
+ licenses:
22
+ - MIT
23
+ metadata: {}
24
+ post_install_message:
25
+ rdoc_options: []
26
+ require_paths:
27
+ - lib
28
+ required_ruby_version: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ required_rubygems_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ requirements: []
39
+ rubyforge_project:
40
+ rubygems_version: 2.2.2
41
+ signing_key:
42
+ specification_version: 4
43
+ summary: background dynamic effect
44
+ test_files: []