mirror of
https://github.com/wahyd4/cdnjs.git
synced 2026-08-20 10:16:29 +10:00
Merge pull request #484 from DanielRapp/master
Update Noisy.js to 1.1.1
This commit is contained in:
+3
@@ -0,0 +1,3 @@
|
||||
(function(c){c.fn.noisy=function(b){var b=c.extend({},c.fn.noisy.defaults,b),d,h,a=!1;try{h=!0,a=localStorage.getItem(window.JSON.stringify(b))}catch(l){h=!1}if(a)d=a;else{a=document.createElement("canvas");if(a.getContext){a.width=a.height=b.size;for(var i=a.getContext("2d"),e=i.createImageData(a.width,a.height),j=Math.round(b.intensity*Math.pow(b.size,2)),k=255*b.opacity;j--;){var f=~~(Math.random()*a.width),g=~~(Math.random()*a.height),f=4*(f+g*e.width),g=j%255;e.data[f]=g;e.data[f+1]=b.monochrome?
|
||||
g:~~(255*Math.random());e.data[f+2]=b.monochrome?g:~~(255*Math.random());e.data[f+3]=~~(Math.random()*k)}i.putImageData(e,0,0);d=a.toDataURL("image/png");if(0!=d.indexOf("data:image/png")||c.browser.msie&&9>c.browser.version.substr(0,1)&&32768<d.length)d=b.fallback}else d=b.fallback;window.JSON&&h&&localStorage.setItem(window.JSON.stringify(b),d)}return this.each(function(){c(this).css("background-image","url('"+d+"'),"+c(this).css("background-image"))})};c.fn.noisy.defaults={intensity:0.9,size:200,
|
||||
opacity:0.08,fallback:"",monochrome:!1}})(jQuery);
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "noisy",
|
||||
"filename": "jquery.noisy.min.js",
|
||||
"version": "1.1",
|
||||
"version": "1.1.1",
|
||||
"description": "Adds random noise to the background of a given element.",
|
||||
"homepage": "http://rappdaniel.com/noisy/",
|
||||
"keywords": [
|
||||
|
||||
Reference in New Issue
Block a user