Skip to content

Instantly share code, notes, and snippets.

@gucchan22
Created November 22, 2014 14:53
Show Gist options
  • Save gucchan22/8ab8635c06fe0779ccd9 to your computer and use it in GitHub Desktop.
Save gucchan22/8ab8635c06fe0779ccd9 to your computer and use it in GitHub Desktop.
function generateCounter2(a)
{
var b=String(a).split("");
if(b.length>=4)
{
b.splice(b.length-3,0,',')
}
if(b.length>=8)
{
b.splice(b.length-7,0,',')
}
if(b.length>=12)
{
b.splice(b.length-11,0,',')
}
var c=getWidth(b)[0];
var d=getWidth(b)[1];
var e='<div style="width: '+d+'px;
margin: auto;
height: 300px;
">';
for(var i=0;
i<b.length;
i++)
{
e+='<div style="width: '+Math.floor(((b[i]==',')?48:122)/c*1000)/10+'%" class="'+digitToEnglish(b[i])+'"></div>'
}
e+='<div class="manji" style="width:'+Math.floor(274/c*1000)/10+'%"></div></div>';
document.getElementById("report_countdown").innerHTML=e;
return true
}
function digitToEnglish(a)
{
var x=
{
'0':'zero','1':'one','2':'two','3':'three','4':'four','5':'five','6':'six','7':'seven','8':'eight','9':'nine',',':'kanma'
};
return x[a]
}
function getWidth(a)
{
var b=274;
for(var i=0;
i<a.length;
i++)
{
if(a[i]==',')b+=48;
else b+=122
}
return[b,(b<=document.getElementById("report_countdown").clientWidth)?b:document.getElementById("report_countdown").clientWidth]
}
function startCountdown()
{
setInterval('countdown()',10)
}
function countdown()
{
var a=new Date();
var b=a.getTime();
var c=new Date(2014,10,23,0,0,0);
var d=c.getTime();
if(d<b)
{
document.getElementById("wrapper").innerHTML=""
}
else
{
var e=d-b;
var f=30000000*e/10800000;
console.log(e);
generateCounter2(Math.floor(f))
}
}
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('k C(a){g b=1d(a).18("");l(b.h>=4){b.p(b.h-3,0,\',\')}l(b.h>=8){b.p(b.h-7,0,\',\')}l(b.h>=12){b.p(b.h-11,0,\',\')}g c=u(b)[0];g d=u(b)[1];g e=\'<j r="s: \'+d+\'M; N: P; 14: 15;">\';w(g i=0;i<b.h;i++){e+=\'<j r="s: \'+v.t(((b[i]==\',\')?E:y)/c*z)/10+\'%" A="\'+B(b[i])+\'"></j>\'}e+=\'<j A="1h" r="s:\'+v.t(D/c*z)/10+\'%"></j></j>\';n.m("q").F=e;o O}k B(a){g x={\'0\':\'Q\',\'1\':\'R\',\'2\':\'S\',\'3\':\'T\',\'4\':\'U\',\'5\':\'V\',\'6\':\'W\',\'7\':\'X\',\'8\':\'Y\',\'9\':\'Z\',\',\':\'13\'};o x[a]}k u(a){g b=D;w(g i=0;i<a.h;i++){l(a[i]==\',\')b+=E;G b+=y}o[b,(b<=n.m("q").H)?b:n.m("q").H]}k 16(){17(\'I()\',10)}k I(){g a=J K();g b=a.L();g c=J K(1a,10,1b,0,0,0);g d=c.L();l(d<b){n.m("1c").F=""}G{g e=d-b;g f=1e*e/1f;1g.19(e);C(v.t(f))}}',62,80,'||||||||||||||||var|length||div|function|if|getElementById|document|return|splice|report_countdown|style|width|floor|getWidth|Math|for||122|1000|class|digitToEnglish|generateCounter2|274|48|innerHTML|else|clientWidth|countdown|new|Date|getTime|px|margin|true|auto|zero|one|two|three|four|five|six|seven|eight|nine||||kanma|height|300px|startCountdown|setInterval|split|log|2014|23|wrapper|String|30000000|10800000|console|manji'.split('|'),0,{}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment