Google电吉他扩展版

2011年09月18日17:40:59 5 5,833

代码:

  1. <!doctype html>   
  2. <meta charset='utf-8' />   
  3. <title>google电吉他扩展版——可播放曲谱</title>   
  4. <style>   
  5. #lga{width:500px;margin:0 auto;}   
  6. #hplogo:active,#hplogo:focus{outline:none}#hplogo-g{background:url(http://cssass.com/blog/resource/guitar/guitar11-hp-sprite.png) no-repeat 0 0;height:175px;position:relative;width:474px}#hplogo-click{background:url(http://cssass.com/blog/resource/guitar/guitar11-hp-sprite.png) no-repeat -2000px -2000px;cursor:pointer;height:130px;left:0;position:absolute;top:0;width:474px}#hplogo-lcd{height:30px;left:70px;position:absolute;top:129px;width:200px}#hplogo-lcd-icon{background:url(http://cssass.com/blog/resource/guitar/guitar11-hp-sprite.png) no-repeat -580px -162px;cursor:pointer;height:0;position:absolute;width:0}#hplogo-lcd-text{background:transparent;border:0 none;color:#666;cursor:text;font-family:"VT323",arial,sans-serif;font-size:14px;left:77px;position:absolute;top:134px;text-decoration:none;width:182px}#hplogo-lcd-screen{background:url(http://cssass.com/blog/resource/guitar/guitar11-hp-sprite.png) no-repeat -2000px -2000px;height:20px;left:52px;position:absolute;top:134px;width:214px}#hplogo-on{background:url(http://cssass.com/blog/resource/guitar/guitar11-hp-sprite.png) no-repeat -2000px -2000px;height:37px;left:272px;position:absolute;top:123px;width:62px}#hplogo-led{background:url(http://cssass.com/blog/resource/guitar/guitar11-hp-sprite.png) no-repeat -2000px -2000px;height:21px;left:292px;position:absolute;top:133px;width:21px}.hplogo-str{background:url(http://cssass.com/blog/resource/guitar/guitar11-hp-sprite.png) no-repeat -530px -60px;height:20px;position:absolute;width:255px}#hplogot{-webkit-box-shadow:5px 5px 10px #ddd;-moz-box-shadow:5px 5px 10px #ddd;box-shadow:5px 5px 10px #ddd;-webkit-transition:opacity 0.5s ease-out;-moz-transition:opacity 0.5s ease-out;-o-transition:opacity 0.5s ease-out;transition:opacity 0.5s ease-out;-webkit-user-select:none;-moz-user-select:none;user-select:none;background-color:#ffffca;border:1px solid #b5b5b5;cursor:pointer;display:none;font:normal 9pt arial,sans-serif;left:128px;opacity:0;padding:2px 3px;position:absolute;top:16px;white-space:nowrap}   
  7. .opern{width:480px;height:40px;}   
  8. </style>   
  9. <body onload="document.f.q.focus();" >   
  10. <div id=xjsc></div>   
  11. <div id=lga>   
  12. <div id=hplogo border=0>   
  13.     <div id=hplogo-g>   
  14.         <div id=hplogo-click ></div>   
  15.         <div id=hplogo-lcd-screen></div>   
  16.         <div id=hplogo-lcd-icon></div>   
  17.         <input id=hplogo-lcd-text value="" autocomplete=off onclick="this.focus();this.select()" readonly=readonly>   
  18.         <div id=hplogo-on></div>   
  19.         <div id=hplogo-led></div>   
  20.         <div id=hplogot>Les Paul&#39;s 96th Birthday</div>   
  21.     </div>   
  22. </div>   
  23. <form name=f><textarea class='opern' name=q >3688368 77653 2226235 37753 3688368 00989 00989987 53566</textarea></form>   
  24. <button id='play'>Play</button>   
  25. 节奏:   
  26. <select id='speed'>   
  27.     <option value='5'>Fast</option>   
  28.     <option value='7' selected>Medium</option>   
  29.     <option value='9'>Slow</option>   
  30. </select>   
  31. <script>   
  32. (function(){   
  33. var g=null,h;   
  34. if(!window.google)window.google={};   
  35. if(!google.doodle)google.doodle={};   
  36. google.rt=7;   
  37. var j,m,o,p,r,s,aa,t,u,ba,v,ca,da,ea=navigator.userAgent.indexOf("MSIE")>=0,fa=[[3,"#776a62","#2063ff",2,[[28,23],[103,23]]],[5,"#776a62","#f61b33",2,[[28,38],[103,38]]],[0,"#776a62","#ffdd24",2,[[65,67],[318,67]]],[2,"#776a62","#07d238",2,[[28,81],[281,81]]],[7,"#776a62","#2063ff",1,[[28,96.5],[281,96.5]]],[9,"#776a62","#f61b33",1,[[29,111.5],[104,111.5]]],[1,"#776a62","#07d238",2,[[358,66],[433,66]]],[4,"#776a62","#2063ff",2,[[358,81],[433,81]]],[6,"#776a62","#f61b33",2,[[330,96],[405,96]]],[8,"#776a62","#ffdd24",1,[[358,111.5],[434,111.5]]]],ga=0,ha=0,w=0,x=0,y=!0,z=[],A=g,B=g,   
  38. C=function(a){a&&a.parentNode&&a.parentNode.removeChild(a)},   
  39. D=function(a,b,c){if(a){if(!google.doodle.ka)google.doodle.ka=[];google.doodle.ka.push(arguments);   
  40. var d=a,e=b,f=c;   
  41. d.addEventListener?d.addEventListener(e,f,!1):d.attachEvent("on"+e,f)}},   
  42. ia=function(a,b,c){a&&(a.removeEventListener?a.removeEventListener(b,c,!1):a.detachEvent("on"+b,c))},   
  43. ja=function(){if(google.doodle.ka)for(var a;a=google.doodle.ka.pop();)ia.apply(g,a)},   
  44. E=function(a){a?a.stopPropagation&&a.stopPropagation():window.event.cancelBubble=!0;return!1},   
  45. F=function(a){if(j!==a){var b=j;j=a;for(a=0;a<z.length;++a)z[a](b)}},   
  46. G=0;z.push(function(){var a=document.getElementById("hplogo-on");if(a)j==1?(a.style.backgroundPosition="-476px -139px",G=0):j==2?G=1:(a.style.backgroundPosition="-2000px -2000px",G=0)});   
  47. var ka=function(a){j==0||j==5||j==4?F(1):F(4);return E(a)},   
  48. H=g,   
  49. ma=function(a){   
  50.     C(document.getElementById("goo-gl-script"));   
  51.     H&&window.clearTimeout(H);   
  52.     var b="http://google-lespaul.appspot.com?callback=google.doodle.url&url="+encodeURIComponent(a),c=document.createElement("script");   
  53.     c.src=b;   
  54.     c.id="goo-gl-script";   
  55.     H=window.setTimeout(function(){la(a)},2E3);   
  56.     (document.getElementById("xjsc")||document.body).appendChild(c)   
  57. },   
  58. na=function(a){a&&a.status=="OK"&&!a.error&&a.id&&la(a.id)},   
  59. la=function(a){   
  60.     if(j==0||j==4){window.clearTimeout(H);var b=document.getElementById("hplogo-lcd-text");if(b)b.value=a,b.select()}   
  61. },   
  62. I=[[0,0,0,0,0,0],[-540,-162,9,9,59,139],[-551,-162,9,6,62,139],[-559,-162,11,17,55,138]],   
  63. J=function(a){   
  64.     var b=document.getElementById("hplogo-lcd-screen");   
  65.     if(b)b.style.backgroundPosition="-678px -139px";   
  66.     if(b=document.getElementById("hplogo-lcd-icon"))   
  67.     b.style.backgroundPosition=I[a][0]+"px "+I[a][1]+"px",b.style.height=I[a][2]+"px",b.style.width=I[a][3]+"px",b.style.left=I[a][4]+"px",b.style.top=I[a][5]+"px"  
  68. };   
  69. z.push(function(a){   
  70.     var b=document.getElementById("hplogo-lcd-text");   
  71.     if(j==5){if(J(1),b.value=="")b.value="Playing..."}   
  72.     else if(A&&(j==0||j==4)){if(J(2),K(),b.value=="Playing...")b.value=""}   
  73.     else if(j==1)J(3),b.value="Recording";   
  74.     if(j!=2&&(a==1||a==2)&&A)A.stop(),K(),J(A.u.length==0?0:2),b.value="",B=g,(a=A.eb())&&ma(a)   
  75. });   
  76. var oa=function(a){A&&(j==0||j==4)?(F(5),A.play()):j==5&&F(4);return E(a)};   
  77. z.push(function(){j==1&&(A=new L,B=A.ib())});   
  78. var pa=!1,qa={el:1,iw:1,ja:1,kk:1,ky:1,ko:1,lt:1,lv:1,mk:1,mr:1,ru:1,th:1,ur:1,"zh-CN":1,"zh-TW":1},   
  79. ra=function(){   
  80. //  if(!pa&&!qa[google.kHL]){   
  81. //      pa=!0;window.WebFontConfig={google:{families:["VT323"]}};   
  82. //      var a=document.createElement("script");   
  83. //      a.src=("https:"==document.location.protocol?"https":"http")+"://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js";   
  84. //      a.type="text/javascript";a.async="true";(document.getElementById("xjsc")||document.body).appendChild(a)   
  85. //  }   
  86. },   
  87. sa=!1,N=g,   
  88. ua=function(){O();N=window.setTimeout(function(){ta(!0)},1E3)},   
  89. O=function(){N&&window.clearTimeout(N);N=g;ta(!1)},   
  90. ta=function(a){var b=document.getElementById("hplogot");if(b)sa?(b.style.display="block",b.style.opacity=a?1:0):b.style.display=a?"block":"none"},   
  91. za=function(){   
  92.     D(document,"keydown",va);   
  93.     D(document,"mousemove",P);   
  94.     D(document,"touchmove",P);   
  95.     D(document,"touchstart",wa);   
  96.     D(window,"resize",xa);   
  97.     D(document.getElementById("play"),"click",playA);   
  98.     var a=document.forms.f||document.forms.gs||document.forms.lb;   
  99.     a&&(D(a.q,"blur",function(){m=!1}),D(a.q,"focus",function(){m=!0;j!=5&&F(0)}));   
  100.     D(document.body,"mouseout",ya);   
  101.     if(a=document.getElementById("hplogo-on"))a.onclick=ka,a.style.cursor="pointer";   
  102.     if(a=document.getElementById("hplogo-led"))a.onclick=ka,a.style.cursor="pointer";   
  103.     if(a=document.getElementById("hplogo-lcd-icon"))a.onclick=oa;   
  104.     if((a=document.getElementById("hplogo-click"))&&!ea)a.onmousemove=ua,a.onmouseout=O;   
  105.     if(a=document.getElementById("speed"))a.onchange=function(){google.rt=this.value};   
  106. },   
  107. wa=function(a){var b=Aa(a);b[0]>=w&&b[0]<=w+474&&b[1]>=x&&b[1]<=x+175&&a.preventDefault()},   
  108. Aa=function(a){   
  109.     a=a||window.event;   
  110.     return[(a.clientX||a.targetTouches&&a.targetTouches[0].clientX||0)+(document.body.scrollLeft||document.documentElement.scrollLeft),   
  111.     (a.clientY||a.targetTouches&&a.targetTouches[0].clientY||0)+(document.body.scrollTop||document.documentElement.scrollTop)]   
  112. },   
  113. P=function(a){a=a||window.event;a=Aa(a);ga=a[0];ha=a[1]},   
  114. //Ba={49:2,50:6,51:3,52:0,53:7,54:1,55:8,56:4,57:9,48:5,81:2,87:6,69:3,82:0,84:7,89:1,85:8,73:4,79:9,80:5,65:2,83:6,68:3,70:0,71:7,72:1,74:8,75:4,76:9,186:5,90:2,88:6,67:3,86:0,66:7,78:1,77:8,188:4,190:9,191:5},   
  115. Ba={49:2,50:6,51:3,52:0,53:7,54:1,55:8,56:4,57:9,48:5,   
  116.     81:2,87:6,69:3,82:0,84:7,89:1,85:8,73:4,79:9,80:5,   
  117.     65:2,83:6,68:3,70:0,71:7,72:1,74:8,75:4,76:9,186:5,   
  118.     90:2,88:6,67:3,86:0,66:7,78:1,77:8,188:4,190:9,191:5,   
  119.     '1':2,'2':6,'3':3,'4':0,'5':7,'6':1,'7':8,'8':4,'9':9,'0':5,   
  120.     'q':2,'w':6,'e':3,'r':0,'t':7,'y':1,'u':8,'i':4,'o':9,'p':5,   
  121.     'a':2,'s':6,'d':3,'f':0,'g':7,'h':1,'j':8,'k':4,'l':9,';':5,   
  122.     'z':2,'x':6,'c':3,'v':0,'b':7,'n':1,'m':8,',':4,'.':9,'/':5,   
  123.     '#':'#'},   
  124. va=function(a){var b=a||window.event;return o&&!m&&!b.altKey&&!b.ctrlKey&&!b.metaKey&&(b=Ba[b.keyCode],typeof b=="number")?(j==0&&F(4),o.V(b),E(a)):!0},   
  125. playA=function(){   
  126.     var b=document.f.q.value.toLowerCase();   
  127.     var c=b.replace(/[^0-9a-zA-Z,.;/]/g,'#');   
  128.     var d=new L;   
  129.     for(var i=0,c=c.split(""); i<c.length; i++){   
  130.         b=Ba[c[i]].toString();   
  131.         d.Za(new Y(b,google.rt));   
  132.     }   
  133.     d.stop();   
  134.     google.d=5,d.play();   
  135. },   
  136. xa=function(){   
  137.     y&&p!=g&&(y=!1,window.setTimeout(function(){y=!0;var a=p,b=0;do b+=a.offsetLeft;while(a=a.offsetParent);w=b;a=p;b=0;do b+=a.offsetTop;while(a=a.offsetParent);x=b},30))   
  138. },   
  139. ya=function(a){   
  140.     (a=a||window.event)&&!a.toElement&&P(a)   
  141. },   
  142. Ca=function(a,b){   
  143.     this.i=a;this.Y=b;this.width=474;this.height=175;this.J=[];this.Ja=this.U=!1;this.ha=0;this.ta=this.T();this.ua=this.ia();this.qa=new Q(0,0);this.ra=new Q(0,0);this.Ia=!0;this.La=(new Date).getTime();this.Xa();this.Ka()   
  144. };   
  145. h=Ca.prototype;   
  146. h.Xa=function(){for(var a=0,b;b=fa[a++];)this.J.push(new Da(b[4][0][0],b[4][0][1],b[4][1][0],b[4][1][1],b[3],b[1],b[2],a,b[0],this.i,this.Y,this))};   
  147. h.T=function(){return ga-w};   
  148. h.ia=function(){return ha-x};   
  149. h.Ha=function(a){return R(a,this.width)/this.width};   
  150. h.kb=function(){this.bb();this.Ja&&this.ab();this.U&&(this.i&&this.i.clearRect(0,0,this.width,this.height),this.Ka())};   
  151. h.Ka=function(){for(var a=0,b;b=this.J[a++];)b.hb(),b.gb()};   
  152. h.ya=function(){if(this.J)for(var a=0,b;b=this.J[a++];)b.ya()};   
  153. h.Va=function(){for(var a=0,b;b=this.J[a++];)if(b.L||b.O){this.U=!0;return}this.U=!1};   
  154. h.bb=function(){   
  155.     var a=(new Date).getTime(),b=(a-this.La)/1E3;   
  156.     this.La=a;   
  157.     var a=this.T(),c=this.ia();   
  158.     this.qa.x=this.ta;this.qa.y=this.ua;this.ra.x=a;this.ra.y=c;var d=a-this.ta,e=c-this.ua,d=Math.sqrt(d*d+e*e);this.Ja=d>0;this.ha=(this.ha*4+R(((b>0?d/b:0)-70)/1430,1))/5;this.ta=a;this.ua=c   
  159. };   
  160. h.ab=function(){   
  161.     if(this.Ia)this.Ia=!1;   
  162.     else for(var a=0,b;b=this.J[a++];)   
  163.     {   
  164.         var c;c=this.qa;   
  165.         var d=this.ra,e=b.Ra,f=b.Qa,i=d.y-c.y,n=f.y-e.y,k=c.x-d.x,l=e.x-f.x,q=d.x*c.y-c.x*d.y,M=f.x*e.y-e.x*f.y,X=i*l-n*k;   
  166.         X==0?c=g:(k=(k*M-l*q)/X,i=(n*q-i*M)/X,c=Math.pow(k-d.x,2)+Math.pow(i-d.y,2)>Math.pow(c.x-d.x,2)+Math.pow(c.y-d.y,2)||Math.pow(k-c.x,2)+Math.pow(i-c.y,2)>Math.pow(c.x-d.x,2)+Math.pow(c.y-d.y,2)||Math.pow(k-f.x,2)+Math.pow(i-f.y,2)>Math.pow(e.x-f.x,2)+Math.pow(e.y-f.y,2)||Math.pow(k-e.x,2)+Math.pow(i-e.y,2)>Math.pow(e.x-f.x,2)+Math.pow(e.y-f.y,2)?g:new Q(k,i));   
  167.         c&&!b.L&&(this.ha<0.4?b.Ya(c.x,c.y):b.Ma(c.x,c.y,!1))   
  168.     }   
  169. };   
  170. h.V=function(a){a>=0&&a<12&&this.J[a].V()};   
  171. var R=function(a,b){return a<0?0:a>b?b:a},   
  172. Ea=function(a){for(var b=[],a=a.match(/[0-9a-f]{2}/gi),c=0,d;d=a[c++];)b.push(parseInt(d,16));return b},   
  173. Q=function(a,b){this.x=a;this.y=b},   
  174. Da=function(a,b,c,d,e,f,i,n,k,l,q,M){   
  175.     this.z=a;this.A=b;this.ea=c;this.fa=d;this.Ra=new Q(this.z,this.A);this.Qa=new Q(this.ea,this.fa);this.R=this.ea-this.z;this.S=this.fa-this.A;   
  176.     this.length=Math.sqrt(this.R*this.R+this.S*this.S);   
  177.     this.P=this.z+this.R*0.5;this.Q=this.A+this.S*0.5;this.W=this.P;this.X=this.Q;this.Aa=this.za=this.I=this.H=0;this.ga=k;this.Da=this.ga/11;this.Ca=this.M=this.F=this.la=0;this.ca=Math.atan2(this.S,this.R);this.ba=Math.sin(this.ca);this.ma=Math.cos(this.ca);a=Math.PI/2-this.ca;this.Pa=Math.sin(a);this.Oa=Math.cos(a);this.index=n;this.lineWidth=e;this.na=f;this.Ba=i;this.aa=this.na;this.color=this.w;this.w=Ea(this.na);this.da=Ea(this.Ba);this.B=this.k=0;this.Z=this.O=this.L=!1;this.oa=1;this.i=l;this.Y=q;this.v=M;this.o=(e=this.length>100)?7.5:5;this.Sa=0.88+(0.85-0.88)*this.Da;this.Ta=1.4+1.5*this.Da;this.$=0;   
  178.     if(!this.i)this.G=document.createElement("div"),this.G.className="hplogo-str",this.G.style.left=this.z+1+"px",this.G.style.top=this.A-10+"px",this.G.style.width=this.length,this.Ua=e?-475:-730,this.Y.appendChild(this.G)   
  179. };   
  180. h=Da.prototype;h.ya=function(){if(this.G)this.Y.removeChild(this.G),this.G=g};   
  181. h.gb=function(){   
  182.     var a,b;(this.L||this.Z)&&this.H&&this.I?(a=this.H,b=this.I):(a=this.W,b=this.X);   
  183.     var c=a-this.z,d=b-this.A,e=this.ea-a,f=this.fa-b;   
  184.     this.i?(this.i.beginPath(),this.i.lineCap="round",this.i.strokeStyle=this.aa,this.i.lineWidth=this.lineWidth,this.i.shadowOffsetX=2,this.i.shadowOffsetY=3,this.i.shadowBlur=2,this.i.shadowColor="rgba(0, 0, 0, 0.35)",c=Math.sqrt(c*c+d*d),f=Math.sqrt(e*e+f*f),e=0.45*c*this.ma,c=0.45*c*this.ba,d=0.45*f*this.ma,f=0.45*f*this.ba,this.i.moveTo(this.z,this.A),this.i.bezierCurveTo(a-e,b-c,a+d,b+f,this.ea,this.fa),this.i.stroke(),this.i.closePath()):this.G.style.backgroundPosition=this.Ua+"px "+-(3+Math.round(d/2))*20+"px"  
  185. };   
  186. h.hb=function(){this.L?this.Na():this.O&&this.db()};   
  187. h.db=function(){   
  188.     if(this.Z){   
  189.         this.aa=this.Ba;   
  190.         var a=this.za-this.H,b=this.Aa-this.I;   
  191.         this.H+=a*0.8;this.I+=b*0.8;   
  192.         if(Math.abs(a)<2&&Math.abs(b)<2)this.$=0,this.oa=1,this.Z=!1,(a>=0?1:-1)!=(this.ba>=0?1:-1)&&(this.oa*=-1)   
  193.     }else if(this.color=[this.w[0]+(this.da[0]-this.w[0])*(this.k>this.o*0.25?1:this.k/(this.o*0.25)),this.w[1]+(this.da[1]-this.w[1])*(this.k>this.o*0.25?1:this.k/(this.o*0.25)),this.w[2]+(this.da[2]-this.w[2])*(this.k>this.o*0.25?1:this.k/(this.o*0.25)),this.w[3]+(this.da[3]-this.w[3])*(this.k>this.o*0.25?1:this.k/(this.o*0.25))],this.aa="rgb("+Math.round(this.color[0])+","+Math.round(this.color[1])+","+Math.round(this.color[2])+")",this.$+=this.Ta*this.oa,a=Math.sin(this.$),this.k*=this.Sa,this.W=this.P+a*this.ba*this.k,this.X=this.Q-a*this.ma*this.k,this.k<=0.15)   
  194.     this.k=0,this.O=!1,this.color=this.w,this.aa=this.na,this.v.Va()   
  195. };   
  196. h.Na=function(){   
  197.     var a=this.v.T(),b=this.v.ia(),c=a-this.z,d=b-this.A,e=this.ca-Math.atan2(d,c),c=Math.sqrt(c*c+d*d);   
  198.     this.F=c*Math.sin(e);this.Ea(R(c*Math.cos(e)/this.length,1));this.B=R(Math.abs(this.F)/this.o,1);Math.abs(this.F)>this.la?this.Wa():(this.H=a,this.I=b)   
  199. };   
  200. h.Ea=function(a){this.M=a;this.Ca=this.M<=0.5?this.M/0.5:1-(this.M-0.5)/0.5;this.la=this.o*this.Ca};   
  201. h.Ma=function(a,b,c){   
  202.     this.H=a;this.I=b;   
  203.     var b=this.v.T()-this.z,d=this.v.ia()-this.A;this.Ea(R(Math.sqrt(b*b+d*d)/this.length,1));   
  204.     this.F=(1-(c?1:this.v.ha))*this.la;this.B=c?1:R(Math.abs(this.F)/this.o,1);if(this.F<3)this.F=3;   
  205.     this.H+=this.F*this.Oa;   
  206.     this.I+=this.F*this.Pa;   
  207.     this.W=this.P;this.X=this.Q;   
  208.     this.O?(this.B=R(this.B/2+this.k/this.o,1),this.k=this.B*this.o):(this.k=this.B*this.o,this.Ga());   
  209.     this.Fa(this.B,this.v.Ha(a))   
  210. };   
  211. h.V=function(){this.Ma(this.P,this.Q,!0)};   
  212. h.Ya=function(a,b){this.L=!0;this.v.U=!0;this.H=a;this.I=b;this.Na()};   
  213. h.Wa=function(){this.L=!1;this.W=this.P;this.X=this.Q;this.k=this.B*this.o;this.Fa(this.B,this.v.Ha(this.v.T()));this.Ga()};   
  214. h.Ga=function(){this.v.U=!0;this.za=this.z+this.M*this.R;this.Aa=this.A+this.M*this.S;this.$=0;this.Z=this.O=!0};   
  215. h.Fa=function(a,b){   
  216.     if(r)try{s.playTrack("guitar-"+(this.ga<10?"0":"")+this.ga,this.ga,0.4+(0.6-0.4)*a,-0.8+1.6*b)}catch(c){r=!1}B&&B([this.index-1])   
  217. };   
  218. var Fa=function(){if(r)for(var a=0;a<12;a++)if(r)try{s.stopChannel(a)}catch(b){r=!1}},   
  219. Ha=function(){u&&(Ga("guitar11-sound-player")||Ga("guitar11-sound-player-2"))},   
  220. Ga=function(a){return(a=u.getElementById(a))&&a.playTrack?(s=a,r=!0,Ia(),!0):!1},   
  221. S=function(a,b){if(a<b)return-1;else if(a>b)return 1;return 0},   
  222. T=function(a){a=a.match(/[\d]+/g);a.length=3;return a.join(".")},   
  223. Ja=function(){   
  224.     var a=!1,b="";   
  225.     if(navigator.plugins&&navigator.plugins.length){var c=navigator.plugins["Shockwave Flash"];c&&(a=!0,c.description&&(b=T(c.description)));navigator.plugins["Shockwave Flash 2.0"]&&(a=!0,b="2.0.0.11")} else if(navigator.mimeTypes&&navigator.mimeTypes.length)(a=(c=navigator.mimeTypes["application/x-shockwave-flash"])&&c.enabledPlugin)&&(b=T(c.enabledPlugin.description));else try{c=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"),a=!0,b=T(c.GetVariable("$version"))}catch(d){try{c=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"),a=!0,b="6.0.21"}catch(e){try{c=new ActiveXObject("ShockwaveFlash.ShockwaveFlash"),a=!0,b=T(c.GetVariable("$version"))}catch(f){}}}aa=a;ba=b   
  226. },   
  227. Ka=function(){   
  228.     for(var a=0,b=String(ba).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),c=String("9.0.0.0").replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),d=Math.max(b.length,c.length),e=0;a==0&&e<d;e++)   
  229.     {   
  230.         var f=b[e]||"",i=c[e]||"",n=RegExp("(\\d*)(\\D*)","g"),k=RegExp("(\\d*)(\\D*)","g");   
  231.         do{   
  232.             var l=n.exec(f)||["","",""],q=k.exec(i)||["","",""];   
  233.             if(l[0].length==0&&q[0].length==0)break;   
  234.             a=S(l[1].length==0?0:parseInt(l[1],10),q[1].length==0?0:parseInt(q[1],10))||S(l[2].length==0,q[2].length==0)||S(l[2],q[2])   
  235.         }   
  236.         while(a==0)}return a>=0},   
  237. U,La={c:2,d:6,e:3,f:0,g:7,a:1,b:8,C:4,D:9,E:5,1:2,2:6,3:3,4:0,5:7,6:1,7:8,8:4,9:9,0:5},   
  238. Ma=function(a,b){   
  239.     if(!(typeof a!="number"||typeof b!="string")){   
  240.         U!==void 0&&window.clearInterval(U);var c=Math.floor(6E4/a);if(!(c<30)&&!(6E4*(b.replace("[","").replace("]","").length/a)>28E3)){   
  241.             var d=0;F(5);   
  242.             U=window.setInterval(function(){d>=b.length&&j==5&&F(4);if(j!=5)window.clearInterval(U);else{var a=b.charAt(d++);   
  243.             if(a!="-"){   
  244.                 var c=[];if(a=="["){for(;d<b.length&&b.charAt(d)!="]";)c.push(b.charAt(d++));d++}else c.push(a);for(var a=0,i;i=c[a++];)La.hasOwnProperty(i)&&o.V(La[i])}   
  245.             }},c)   
  246.         }   
  247.     }   
  248. },   
  249. V=g,W=g,   
  250. Na=function(){   
  251.     if(!V){V={};W={};   
  252.     for(var a=0;a<65;a++)V[a]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_*".charAt(a),W[V[a]]=a;}   
  253. },   
  254. Y=function(a,b){this.N=a;this.duration=Math.max(b,0);var c=0;c+=this.N.length==1?5:11;c+=this.duration<Math.pow(2,5)?6:21;this.size=c};   
  255. //Y.prototype.play=function(){for(var a=0;a<this.N.length;++a)o.V(this.N[a])};   
  256. Y.prototype.play=function(){o.V(this.N)};   
  257. var Z=function(a,b){for(var c=[],d=0;d<b;++d)c.push(!!(a&1)),a>>=1;return c},   
  258. Oa=function(a,b,c){if(b+c>a.length)return-1;for(var d=0,e=0;e<c;++e)d*=2,d|=a[b+c-e-1]?1:0;return d},   
  259. Pa=function(a){for(var b=[],c=0;c<10;++c)b.push(!1);for(c=0;c<a.length;++c)b[a[c]]=!0;return b};   
  260. Y.prototype.xa=function(){   
  261.     var a=[];   
  262.     this.N.length==1?(a.push(!1),a=a.concat(Z(this.N[0],4))):(a.push(!0),a=a.concat(Pa(this.N)));   
  263.     this.duration<Math.pow(2,5)?(a.push(!1),a=a.concat(Z(this.duration,5))):(a.push(!0),a=a.concat(Z(this.duration,20)));   
  264.     return a   
  265. };   
  266. var Qa=function(a,b){   
  267.     var c,d,e=b;if(b<0||b>=a.length)return g;   
  268.     if(a[b]){c=b+1;if(c+10>a.length)d=g;else{d=[];for(var f=0;f<10;++f)a[c+f]&&d.push(f)}if(!d)return g;b+=11}   
  269.     else{c=Oa(a,b+1,4);if(c==-1)return g;d=[c];b+=5}   
  270.     if(b>=a.length)return g;a[b]?(c=Oa(a,b+1,20),b+=21):(c=Oa(a,b+1,5),b+=6);   
  271.     return c<0?g:{s:new Y(d,c),n:b-e}   
  272. },   
  273. L=function(a){this.u=a||[];this.va=g;for(var b=this.duration=a=0;b<this.u.length;++b)a+=this.u[b].size,b!=0&&(this.duration+=this.u[b].duration*50);this.size=a};   
  274. L.prototype.Za=function(a){this.u.push(a);this.size+=a.size;this.u.size>1&&(this.duration+=a.duration*50)};   
  275. L.prototype.$a=function(){return(this.size+4)*1.37/8};   
  276. var Ra=g,   
  277. Sa=function(){j==1&&F(2)},Ta=g,   
  278. Ua=function(){(j==1||j==2)&&F(4)};   
  279. L.prototype.ib=function(){this.wa=0;this.K=[];this.cb=!0;var a=this;this.va=window.setTimeout(function(){a.tick(!0)},50);return function(b){a.K.push(b)}};   
  280. L.prototype.tick=function(a){   
  281.     this.wa++;   
  282.     if(this.K&&this.K.length>0){   
  283.         var b=this.wa;this.wa=0;var c;   
  284.         if(this.K.length==1)c=this.K[0];else{for(var d=[],e=0;c=this.K[e++];)   
  285.         for(var f=0;f<c.length;++f)d[c[f]]=1;c=[];   
  286.         for(e=0;e<d.length;++e)d[e]&&c.push(e)}this.K=[];   
  287.         this.Za(new Y(c,b));   
  288.         this.u.length==1&&(window.clearTimeout(Ta),Ta=window.setTimeout(Ua,28E3),window.clearTimeout(Ra),Ra=window.setTimeout(Sa,23E3));   
  289.         b=this.$a();   
  290.         if(b>=1900||this.duration>=28E3){F(4);return}else b>=1800&&F(2)   
  291.     }   
  292.     if(a){var i=this;this.va=window.setTimeout(function(){i.tick(!0)},50)}   
  293. };   
  294. L.prototype.stop=function(){   
  295.     window.clearTimeout(this.va);this.tick(!1);   
  296.     if(this.u.length>0)this.u[0].duration=0;this.cb=!1;   
  297.     clearTimeout(google.clearp);   
  298. };   
  299. L.prototype.play=function(a){   
  300.     if(google.d || j==5)if(this.duration>28E3)j==5&&F(4);   
  301.     else{   
  302.         var b=a||0;b>0&&this.u[b-1].play();   
  303.         if(b>=this.u.length)j==5&&F(4);   
  304.         else{var c=this;google.clearp=window.setTimeout(function(){c.play(b+1)},this.u[b].duration*50)}   
  305.     }   
  306. };   
  307. eval("google.doodle.mod = (function(a,n){return a"+"%%".charAt(0)+"n;})");   
  308. L.prototype.xa=function(){   
  309.     for(var a=[],b=0;b<this.u.length;++b)a=a.concat(this.u[b].xa());   
  310.     for(window.bits=a;google.doodle.mod(a.length,8)!=0;)a.push(!1);   
  311.     return a   
  312. };   
  313. L.prototype.eb=function(){   
  314.     if(this.u.length==0)return g;   
  315.     var a="http://www.google.com/webhp?",b=Va(window.location.toString()).hl;b&&(a+="hl="+b+"&");   
  316.     a+="tune=";   
  317.     for(var c=this.xa(),b=[],d=0;d<c.length;d+=8){   
  318.         for(var e=0,f=0;f<8;++f)e*=2,e|=c[d+f]?1:0;b.push(e)   
  319.     }   
  320.     Na();c=V;d=[];   
  321.     for(e=0;e<b.length;e+=3){   
  322.         var i=b[e],n=(f=e+1<b.length)?b[e+1]:0,k=e+2<b.length,l=k?b[e+2]:0,q=i>>2,i=(i&3)*16|n>>4,n=(n&15)*4|l>>6;l&=63;k||(l=64,f||(n=64));d.push(c[q],c[i],c[n],c[l])   
  323.     }return a+d.join("")   
  324. };   
  325. var Va=function(a){   
  326.     if(!a)return{};   
  327.     for(var a=a.match(/\?[^#]*/),a=(a&&a.length>0?a[0].substr(1):"").split("&"),b={},c=0;c<a.length;++c){var d=a[c];d&&(d=d.split("="),b[d[0]]=d[1]||"")}   
  328.     return b   
  329. },   
  330. Ia=function(){   
  331.     var a=Va(window.location.href),b=parseInt(a.bpm,10),a=a.tune;b&&a&&Ma(b,unescape(a));   
  332.     if(a){   
  333.         Na();for(var c=W,b=[],d=0;d<a.length;){var e=c[a.charAt(d++)],f=d<a.length?c[a.charAt(d)]:0;++d;var i=d<a.length?c[a.charAt(d)]:0;++d;var n=d<a.length?c[a.charAt(d)]:0;++d;if(e==g||f==g||i==g||n==g)throw Error();b.push(e*4|f>>4);i!=64&&(b.push(f*16&240|i>>2),n!=64&&b.push(i*64&192|n))}a=[];   
  334.         for(c=0;c<b.length;++c){d=b[c];for(e=0;e<8;++e)a.push(!!(d&128)),d*=2}   
  335.         if(a){var k;a:{b=[];c=0;try{for(;a.length-c>=8;){var l=Qa(a,c);if(l)b.push(l.s),c+=l.n;else{k=g;break a}}}catch(q){k=g;break a}k=new L(b)}k&&(A=k,F(5),k.play())}   
  336.     }   
  337. },   
  338. Wa=!0,   
  339. Xa=function(){   
  340.     if(google.rein&&google.dstr&&!google.doodle.jb)google.doodle.jb=!0,google.rein.push(Xa),google.dstr.push($);   
  341.     if(document.getElementById("hplogo")){   
  342.         $();google.psy&&google.psy.q&&google.msg&&google.msg.listen(22,function(){$();return!0});google.doodle.url=na;p=document.getElementById("hplogo-g");   
  343.         v=document.createElement("canvas");   
  344.         v.getContext?(v.width=474,v.height=175,v.hideFocus=!0,ca=v.getContext("2d"),p.appendChild(v)):v=g;xa();o=new Ca(ca,p);   
  345.         var a;r=!1;Ja();   
  346.         if(!aa||!Ka())a=!1;else{   
  347.             google.doodle.flashLoaded=Ha;t=document.createElement("iframe");t.name="doodle-sound";t.style.position="absolute";t.style.top="-150px";t.style.border=0;t.style.width="100px";t.style.height="100px";document.getElementById("hplogo").appendChild(t);u=t.contentDocument;if(u==void 0||u==g)u=t.contentWindow.document;u.open();u.write("<html><head></head><body><object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0\" width=\"0\" height=\"0\" id=\"guitar11-sound-player\" type=\"application/x-shockwave-flash\"><param name=\"movie\" value=\"http://cssass.com/blog/resource/guitar/guitar11.swf\"><param name=\"allowScriptAccess\" value=\"always\"><object id=\"guitar11-sound-player-2\" type=\"application/x-shockwave-flash\" data=\"http://cssass.com/blog/resource/guitar/guitar11.swf\" width=\"0\" height=\"0\"><param name=\"allowScriptAccess\" value=\"always\"></object></object></body></html>");u.close();a=!0   
  348.         }   
  349.         var b=document.getElementById("hplogot");   
  350.         b&&(sa=typeof b.style.opacity!="undefined");za();m=!0;Ya();!a&&Wa&&Ia();Wa=!1;ra();   
  351.         if(ea)try{document.execCommand("BackgroundImageCache",!1,!0)}catch(c){}   
  352.     }},   
  353. Ya=function(){   
  354.     o&&(o.kb(),da=window.setTimeout(Ya,30));   
  355.     var a=document.getElementById("hplogo-led");   
  356.     if(a&&G)a.style.backgroundPosition=-540-23*Math.abs(Math.round(5*Math.sin(G*Math.PI/12)))+"px -139px",G++   
  357. },   
  358. K=function(){   
  359.     var a=document.getElementById("hplogo-led");if(a)a.style.backgroundPosition="1000px 1000px"},   
  360. $=function(){   
  361.     try{window.clearTimeout(da);O();Fa();ja();o&&(o.ya(),o=g);t&&(C(t),t=g,r=!1);v&&(C(v),v=g);A&&A.stop();B=A=g;F(0);var a=document.getElementById("hplogo-lcd-text");if(a)a.value="";var b=document.getElementById("hplogo-lcd-screen");if(b)b.style.backgroundPosition="1000px 1000px";K();google.msg&&window.setTimeout(function(){google.msg.unlisten(22,$)},0)}catch(c){}   
  362. };   
  363. Xa()   
  364. })();   
  365. </script>   

google的电吉他原版:

http://www.google.com/logos/2011/lespaul.html

weinxin
我的微信
分享交流WordPress经验与技巧,关注前端设计与网站制作。仅用于功能演示。
Begin主题购买
Begin主题购买

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

目前评论:5   其中:访客  4   博主  0   引用   1

    • 诸葛诺博客 2

      很好玩 lz辛苦啦……

      • 懒人 0

        犀利!

        • 女生 3

          厉害啊,把谷歌的东西都弄出来了

        • 来自外部的引用: 1

          • google电吉他扩展版分享 | mikej's blog