CDE

CDE

cde.qfox.nl

cde.qfox.nl

cde.qfox.nl

The CDE javascript is syntactic sugar that helps creating DHTML easier and faster by creating Custom DOM Elements.

// Find the object with the highest z-index and click on it!

var i=10, repeat, vp, last, start, rand, rc;
vp = CDE.viewportSize();
rand = function(n){ return Math.round(Math.random()*n); };
rc = function(){ return CDE.rgb(rand(256), rand(256), rand(256)); };
start = (new Date()).getTime();
repeat = function(cde){
  cde.ease( {
      left: Math.max(10, rand(vp.w) - 200),
      top: Math.max(10, rand(vp.h)-200),
      width: rand(200),
      height: rand(200),
      backgroundColor: rc()
    },
    {
      callback: function(){ repeat(cde); },
      intEaseTime: 500+rand(5000)
  });
};
while (i--) {
  repeat(last = CDE.div().css('start').ns().o(0).dba().center().fadeIn());
}
last.on('click',function(){
  var stop = Math.round(((new Date()).getTime() - start));
  CDE.popup(
    "You got me!",
    "Time since last click: "+(stop/1000)+"s",
    function(){ start = (new Date()).getTime(); },
    {strOk:'W00t!', boolNoCancel: true}
  );
});