kirakira

    @@ -12,7 +12,7 @@ var ip = arguments.callee.ip; if(!ip){ - canvas.width = canvas.height = "7"; + canvas.width = canvas.height = "15"; ip = new ImageProcessing(canvas); arguments.callee.ip = ip;
  • /*
     * @title kirakira
     * @description kirakira
     * @include http://*
     * @license MIT License
     * @require http://github.com/arikui/image_processing.js/raw/master/image_processing.js
     */
    
    (function(){
    var n = 7;
    setInterval(function(style, canvas){
      var ip = arguments.callee.ip;
    
      if(!ip){
        canvas.width = canvas.height = "15";
        ip = new ImageProcessing(canvas);
        arguments.callee.ip = ip;
    
        ip.lock().each(function(px, x, y, self){
          px = ImageProcessing.Color.fromHsv(Math.random() * 359, 255, 255);
          self.setPixel(x, y, px);
        }).unlock().update();
      }
    
      ip.lock().each(function(px, x, y, self){
        self.setPixel(x, y, ImageProcessing.Color.fromHsv(px.hsv()[0] + n + n * Math.random(), 255, 255));
      }).unlock().update();
    
      style.backgroundPosition = "repeat";
      style.backgroundImage = "url('" + ip.data() + "')";
    }, 100,
       document.body.style,
       document.createElement("canvas"));
    
    document.addEventListener("keydown", function(e){
      switch(e.keyCode){
        case 37: n = (n - 1) || 1; break;
        case 39: n = (n + 1 > 100)? n : n + 1; break;
      }
    }, false);
    })();
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2010/05/24 02:52:03 - 2010-05-24
  2. 2010/05/24 02:46:15 - 2010-05-24
  3. 2010/05/24 02:44:35 - 2010-05-24
  4. 2010/05/22 01:11:44 - 2010-05-22
  5. 2010/05/22 01:10:19 - 2010-05-22
  6. 2010/05/22 01:08:36 - 2010-05-22
  7. 2010/05/20 21:40:24 - 2010-05-20
  8. 2010/05/20 21:05:57 - 2010-05-20
  9. 2010/05/19 00:47:07 - 2010-05-19
  10. 2010/05/19 00:31:02 - 2010-05-19
  11. 2010/05/19 00:24:33 - 2010-05-19
  12. 2010/05/18 23:38:19 - 2010-05-18