- Author:
- n3wjack
- Twitter:
- @
- GitHub:
- Facebook:
- Google+:
- +
- Reddit:
- /r/
- Pouet:
- Website:
- n3wjack.net
- Compo:
- classic
- Demo link:
- https://js1k.com/2010-first/demo/643
- Shortlink:
- https://js1k.com/643
- Blog post:
- please update here!
- Bytes:
- 988
- Chars:
- 988
- Submission
D=document;B=D.body;M=Math;iw=screen.width;function r(n,o){return M.round(M.random()*(n))+(o?o:0)}function c(n){h=(n?n:r(256)).toString(16);return(h.length==1?"0"+h:h)}function t(x,y,w,fs){return"position:absolute;left:"+x+"px;top:"+y+"px;"+";width:"+w+";font:"+fs+"px "+'"lucida console"'}function p(d,i){y=r(90*(i+1),-50);x=r(0,-150*(r(3)+1+i));f=r(50,50+(M.pow(3,i)));s=d.style;s.cssText=t(x,y,iw+"px",f);s.color="#"+c()+c()+c()}b=D.createElement("DIV");B.appendChild(b);b.innerHTML=B.innerHTML.replace(/</g,'<').replace(/>/g,'>');for(j=0;j<3;j++){b.innerHTML+=b.innerHTML}b.style.cssText="color:#333;width:100%;"+t(0,0,"100%","16");for(i=0;i<5;i++){d=D.createElement("DIV");B.appendChild(d);a=b.innerHTML.replace(/{/g,";").split(";");d.innerHTML=a[r(a.length-1)];p(d,i)}B.bgColor="#181818";var e=D.getElementsByTagName("DIV");function mv(){for(i=1;i<e.length;i++){l=parseInt(e[i].style.left);e[i].style.left=(l+(i*2)).toString()+"px";if(l+100>iw){p(e[i],i)}}}setInterval(mv,80);
- Description
- It's all about the code. This script uses it's own code to supply the visuals. How cool is that?
- Base64 encoded
RD1kb2N1bWVudDtCPUQuYm9keTtNPU1hdGg7aXc9c2NyZWVuLndpZHRoO2Z1bmN0aW9uIHIobixvKXtyZXR1cm4gTS5yb3VuZChNLnJhbmRvbSgpKihuKSkrKG8/bzowKX1mdW5jdGlvbiBjKG4pe2g9KG4/bjpyKDI1NikpLnRvU3RyaW5nKDE2KTtyZXR1cm4oaC5sZW5ndGg9PTE/IjAiK2g6aCl9ZnVuY3R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ldLGkpfX19c2V0SW50ZXJ2YWwobXYsODApOw==
- Original source
D = document;
B = D.body;
M = Math;
iw = screen.width;
function r(n, o) {
// randomizer
return M.round(M.random()*(n)) + (o ? o : 0);
}
function c(n) {
// convert numbers to hexadecimal strings
// n = optional number to convert, if omitted a random number is generated
h = (n ? n : r(256)).toString(16);
return (h.length == 1 ? "0" + h : h);
}
function t(x, y, w, fs) {
return "position:absolute;left:" + x + "px;top:" + y + "px;" + ";width:" + w + ";font:" + fs + "px " + '"lucida console"'
}
function p(d, i) {
// position a div: d = div, i = index
y = r(90*(i+1), -50);
x = r(0, -150 * (r(3) + 1 + i));
// randomize the font size
f = r(50, 50 + (M.pow(3, i)));
s = d.style;
s.cssText = t(x, y, iw + "px", f);
s.color = "#" + c() + c() + c();
// Wish I could leave the next line in, but it just makes the scrolling text too slow. :(
//s.textShadow = "2px 2px 8px #000";
}
// let's make a nice backdrop using our own code
b = D.createElement("DIV");
B.appendChild(b);
b.innerHTML = B.innerHTML.replace(/</g, '<').replace(/>/g, '>');
for (j = 0; j < 3; j++) {
b.innerHTML += b.innerHTML;
}
b.style.cssText = "color:#333;width:100%;" + t(0,0,"100%","16");//+ ";text-shadow:0px 0px 3px #666";
// create the div elements to hold our scrolling text
for (i = 0; i < 5; i++) {
d = D.createElement("DIV");
B.appendChild(d);
a = b.innerHTML.replace(/{/g, ";").split(";");
d.innerHTML = a[r(a.length-1)];
p(d, i);
}
B.bgColor = "#181818";
var e = D.getElementsByTagName("DIV");
function mv() {
// let the div's scroll!
for (i = 1; i < e.length; i++) {
l = parseInt(e[i].style.left);
e[i].style.left = (l + (i * 2)).toString() + "px";
// reset position when the end of the screen is reached
if (l + 100 > iw) {
p(e[i], i);
}
}
}
setInterval(mv, 80);