- Author:
- NickyOne
- Twitter:
- @
- GitHub:
- Facebook:
- Google+:
- +
- Reddit:
- /r/
- Pouet:
- Website:
- sml.cpcscene.com
- Compo:
- classic
- Demo link:
- https://js1k.com/2010-first/demo/465
- Shortlink:
- https://js1k.com/465
- Blog post:
- please update here!
- Bytes:
- 865
- Chars:
- 865
- Submission
var a=300;var b=0;var c=300;var d=1;var e=-0.1;var f=0.9;var g=0.05;var h=20;var d2=1;var e2=-0.3;var f2=0.1;var g2=0.03;var h2=25;var j=300;var k=100;function l(){setTimeout("m()",f)}function m(){var decalex=0;for(var i=0;i<j;i++){document.getElementById("d"+i).style.left=k+decalex+Math.round((Math.sin(d-(i*g))*h)+(Math.sin(d2-(i*g2))*h2))+"px";document.getElementById("dd"+i).style.left=k+decalex+Math.round((Math.cos(d-(i*g))*h)+(Math.cos(d2-(i*g2))*h2))+"px";decalex=decalex+0.5}d=d+e;d2=d2+e2;setTimeout("m()",f)}document.open();while(b<a){document.write("<div id='d"+b+"' style='width:"+c+"px;height:1px;position:absolute;background-color:#555555;margin-top:"+b+"px;'></div>");document.write("<div id='dd"+b+"' style='width:"+c+"px;height:1px;position:absolute;background-color:#999999;margin-top:"+b+"px;opacity:0.5;'></div>");++b;--c}document.close();l();
- Description
- Generate 600 divs and make simples ondulations...
- Base64 encoded
dmFyIGE9MzAwO3ZhciBiPTA7dmFyIGM9MzAwO3ZhciBkPTE7dmFyIGU9LTAuMTt2YXIgZj0wLjk7dmFyIGc9MC4wNTt2YXIgaD0yMDt2YXIgZDI9MTt2YXIgZTI9LTAuMzt2YXIgZjI9MC4xO3ZhciBnMj0wLjAzO3ZhciBoMj0yNTt2YXIgaj0zMDA7dmFyIGs9MTAwO2Z1bmN0aW9uIGwoKXtzZXRUaW1lb3V0KCJtKCkiLGYpfWZ1bmN0aW9uIG0oKXt2YXIgZGVjYWxleD0wO2Zvcih2YXIgaT0wO2k8ajtpKyspe2RvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJkIitpKS5zdHlsZS5sZWZ0PWsrZGVjYWxleCtNYXRoLnJvdW5kKChNYXRoLnNpbihkLShpKmcpKSpoKSsoTWF0aC5zaW4oZDItKGkqZzIpKSpoMikpKyJweCI7ZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoImRkIitpKS5zdHlsZS5sZWZ0PWsrZGVjYWxleCtNYXRoLnJvdW5kKChNYXRoLmNvcyhkLShpKmcpKSpoKSsoTWF0aC5jb3MoZDItKGkqZzIpKSpoMikpKyJweCI7ZGVjYWxleD1kZWNhbGV4KzAuNX1kPWQrZTtkMj1kMitlMjtzZXRUaW1lb3V0KCJtKCkiLGYpfWRvY3VtZW50Lm9wZW4oKTt3aGlsZShiPGEpe2RvY3VtZW50LndyaXRlKCI8ZGl2IGlkPSdkIitiKyInIHN0eWxlPSd3aWR0aDoiK2MrInB4O2hlaWdodDoxcHg7cG9zaXRpb246YWJzb2x1dGU7YmFja2dyb3VuZC1jb2xvcjojNTU1NTU1O21hcmdpbi10b3A6IitiKyJweDsnPjwvZGl2PiIpO2RvY3VtZW50LndyaXRlKCI8ZGl2IGlkPSdkZCIrYisiJyBzdHlsZT0nd2lkdGg6IitjKyJweDtoZWlnaHQ6MXB4O3Bvc2l0aW9uOmFic29sdXRlO2JhY2tncm91bmQtY29sb3I6Izk5OTk5OTttYXJnaW4tdG9wOiIrYisicHg7b3BhY2l0eTowLjU7Jz48L2Rpdj4iKTsrK2I7LS1jfWRvY3VtZW50LmNsb3NlKCk7bCgpOw==
- Original source
var nblines=300;
var compteur=0;
var width=300;
// Sinus 1
var sin_position_x=1 ;
var sin_amplitude_x=-0.1 ;
var frequence=0.9 ;
var ecart_x=0.05 ;
var multiplicateur_x=20 ;
// Sinus 2
var sin_position_x2=1 ;
var sin_amplitude_x2=-0.3 ;
var frequence2=0.1 ;
var ecart_x2=0.03 ;
var multiplicateur_x2=25 ;
var nombre_div=300;
var divx=100 ;
function init() {
setTimeout("movedivs()",frequence);
}
function movedivs() {
var decalex=0 ;
for(var i=0; i<nombre_div;i++){
document.getElementById("div"+i).style.left=divx+decalex+Math.round((Math.sin(sin_position_x-(i*ecart_x))*multiplicateur_x)+(Math.sin(sin_position_x2-(i*ecart_x2))*multiplicateur_x2))+"px";
document.getElementById("divdiv"+i).style.left=divx+decalex+Math.round((Math.cos(sin_position_x-(i*ecart_x))*multiplicateur_x)+(Math.cos(sin_position_x2-(i*ecart_x2))*multiplicateur_x2))+"px";
decalex=decalex+0.5 ;
}
sin_position_x=sin_position_x+sin_amplitude_x ;
sin_position_x2=sin_position_x2+sin_amplitude_x2 ;
setTimeout("movedivs()",frequence);
}
document.open();
while (compteur<nblines) {
document.write("<div id='div"+compteur+"' style='width:"+width+"px;height:1px;position:absolute;background-color:#555555;margin-top:"+compteur+"px;'></div>");
document.write("<div id='divdiv"+compteur+"' style='width:"+width+"px;height:1px;position:absolute;background-color:#999999;margin-top:"+compteur+"px;opacity:0.5;'></div>");
++compteur;
--width;
}
document.close();
init();