asciiblaster

- draw irc art in your web browser
git clone git://git.acid.vegas/asciiblaster.git
Log | Files | Refs | Archive | README

goodies.js (2403B)

      1 var goodies = (function(){
      2   var goodies = {}
      3 
      4   goodies.build = () => {
      5     Object.keys(goodies.list).map(() => {
      6       goodies_rapper.appendChild(tool_canvas.el)
      7     })
      8   }
      9 
     10   goodies.list = {}
     11 
     12   goodies.list.choppy = {
     13     mode: 'brush',
     14     fn: `var char = choice("      abcdef      ")
     15         lex.bg = +choice("0124")
     16         lex.fg = +choice("01234")
     17         lex.char = char
     18         lex.opacity = char == " " ? 0 : 1`,
     19   }
     20 
     21   goodies.list.foggy = {
     22     mode: 'brush',
     23     fn: `var char = choice("      abcdef      ")
     24         lex.bg = choice([14,15])
     25         lex.fg = choice("367")
     26         lex.char = char
     27         lex.opacity = char == " " ? 0 : 1`,
     28   }
     29   // goodies.list.name = {
     30   //   fn: ``,
     31   // }
     32   // goodies.list.name = {
     33   //   fn: ``,
     34   // }
     35   // goodies.list.name = {
     36   //   fn: ``,
     37   // }
     38   // goodies.list.name = {
     39   //   fn: ``,
     40   // }
     41 
     42 // >> mirror brush (up-down)
     43 
     44 // NOTE: Animate this on the canvas, then draw:
     45 
     46 // if (x > h/2) {
     47 //   lex.assign( canvas.aa[h-y][x] )
     48 // }
     49 
     50 
     51 
     52 // >> rainbow stardust brush
     53 
     54 // Uncheck BG and animate this to brush:
     55 
     56 // lex.fg = hue(t)
     57 // lex.char = choice("            ,'.,.','******    ")
     58 
     59 
     60 
     61 // >> noise brushes, works on a black background:
     62 
     63 // lex.bg = max(5, yellow(randint(t)))
     64 // lex.opacity = lex.bg == colors.black ? 0 : 1
     65 
     66 
     67 
     68 // >> simple rainbow:
     69 
     70 // if (lex.bg != 1) lex.bg = randint(t)
     71 // lex.opacity = lex.bg == colors.black ? 0 : 1
     72 
     73 
     74 
     75 // >> self-erasing:
     76 
     77 // if (lex.bg != 1) lex.bg = yellow(randint(t))
     78 // lex.opacity = lex.bg == colors.black ? 0 : 1
     79 
     80 
     81 
     82 // >> cycling rainbow brush
     83 
     84 // if (lex.bg != 1) lex.bg = hue( all_color_hue_order.indexOf( color_names[ lex.bg ] ) + 1 )
     85 // lex.opacity = lex.bg == colors.black ? 0 : 1
     86 
     87 
     88 
     89 // >> "stars" brush.. set your brush to paint just the character "#"
     90 
     91 // if (lex.char == "#") {
     92 //   lex.fg = hue(randint(15))
     93 //   lex.char = random() > 0.1 ? " " : "+@*.,\"+'*-"[randint(10)]
     94 // }
     95 
     96 
     97 
     98 // >> use fg char to mask mask what you're drawing on the bg
     99 
    100 // if (lex.char != "/") { lex.bg = 1 }
    101 
    102 
    103 
    104 // >> sharded glitch brush
    105 
    106 // Example: http://asdf.us/z/kksnvs.png 
    107 
    108 // Use on a brush:
    109 
    110 // lex.bg = t/y/x
    111 // lex.opacity = lex.bg % 1 ? 0 : 1
    112 
    113 
    114 
    115 // >> incremental brush
    116 
    117 // Set your brush to be the ^ character, square, about 10x10
    118 // Draw "char" only
    119 // Then animate this shader on the canvas:
    120 
    121 // if (lex.char=="^") {
    122 //   lex.bg += 1
    123 //   lex.char = " "
    124 // }
    125 // lex.bg += 1
    126 
    127 
    128 
    129 
    130 
    131   return goodies
    132 })