diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5b48cc9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,19 @@ +############# +# ignore all tmp directories + +tmp/ +tmp2/ +tmp3/ +tmp4/ +tmp5/ + + +############# +# ignore all (sqlite) dbs for now - why? why not? +*.db + +## +# ignnore all env files +.env +.env.yml +.env.yaml diff --git a/builder/helper.rb b/builder/helper.rb new file mode 100644 index 0000000..14b3182 --- /dev/null +++ b/builder/helper.rb @@ -0,0 +1,135 @@ +################ +# (view) helpers + + +def spritesheet( path ) ## spritesheet metadata / record helpers + recs = read_csv( path ) + +### +# id, category, name, more_names +# 0, , classic, +# 1, , dark, +# 2, , zombie, + +## +# id, name, gender, size, type, more_names +# 0, Male 1, m, l, Archetype, +# 1, Male 2, m, l, Archetype, +# 2, Male 3, m, l, Archetype, + + + buf = String.new('') + buf << "id, name\n" + + recs.each do |rec| + id = rec['id'] + name = rec['name'] + more_names = (rec['more_names'] || '').split( '|' ) + + names = [name] + names += more_names + + buf << "#{id}, #{names.join(' | ')}\n" + end + + buf +end + + + + +def render_options( spec ) + + buf = String.new('') + + spec.each do |name, h| + + options = h[:options] + options = ['None'] + options if h[:none] + + legend = h[:legend] + + buf += radio_options_w_sprites( options, + name: name, + legend: legend ) + + + buf += "\n#{h[:notes]}\n\n" if h[:notes] + end + + buf +end + + + + +def radio_button_tag( name, value, checked: false, id: ) + buf = %Q[ #{content}\n] +end + +def sprite_tag( name ) + %Q[ \n] +end + + + + +def radio_options_w_sprites( options, name:, legend: ) + radio_options( options, name: name, + legend: legend, + sprites: true ) +end + + +def radio_options( options, name:, + legend:, + sprites: false ) + +buf = < +#{legend}: +TXT + +options.each_with_index do |option,i| + + value = option.downcase.strip + + label = option + id = "#{name}#{i}" ## use for input (dom) id / label for [id] + + + ## note. add class columns - via css turns div into 250px inline-blocks +buf += "
\n" +buf += radio_button_tag( name, value, + id: id, + checked: i==0 ) + +buf2 = String.new( '' ) +if sprites + if ['none'].include?( value ) + ## do nothing - no sprite(s) - for none & friends + else + buf2 += sprite_tag( value ) + end + ## note: add sprites (spans) inside label e.g. + buf += label_tag( buf2 + label, id: id ) +else + buf += label_tag( label, id: id ) +end + +buf += "
\n" +end + + +buf += "\n" +buf + +end + diff --git a/builder/punk.html.erb b/builder/punk.html.erb new file mode 100644 index 0000000..8ee4b6a --- /dev/null +++ b/builder/punk.html.erb @@ -0,0 +1,137 @@ + + + + + + + + + +

+ « Node Punks +

+ + +

Build Your Own Node Punk (24×24) Wizard

+ + +

Yes, you can! +Build your own originals that you +own 100% forever. +Questions? Comments? +Join us in the Ordbase discord (chat server). + +
+Looking for monkes? +See Monke (28×28) Wizard » +

+ + + + + + + + +
+ + + 10x (240×240px)
+
+ + 4x (96×96px)
+
+ + 1x (24×24px)
+ + +
+ + +<%= render_options( PUNK ) %> + +
+ +

+ Open source public domain. + No rights reserved. + See + /nodepunks/builder » +

+ + + diff --git a/builder/punk.rb b/builder/punk.rb new file mode 100644 index 0000000..cb28d23 --- /dev/null +++ b/builder/punk.rb @@ -0,0 +1,178 @@ + +PUNK = { + t: { + legend: 'Select a punk (archetype or readymade)', + options: [ + 'dark', + 'light', + 'albino', + 'orange', + 'pink', + 'zombie', + 'orc', + 'alien', + 'black', + 'ape', + 'ape golden', + 'joe', + 'donald', + ] + }, + + hair: { + legend: 'Select hair', + none: true, + options: [ + 'mohawk blonde', + 'mohawk purple', + 'mohawk red', + 'mohawk', + 'mohawk 2blonde', + 'mohawk 2 purple', + 'mohawk 2 red', + 'mohawk 2', + 'peakspike blonde', + 'peakspike', + 'wildhair blonde', + 'wildhair purple', + 'wildhair red', + 'bob', + 'bob blonde', + 'bob 2 blonde', + 'bob 2 pink', + 'long hair', + 'long hair blonde', + 'long hair pink', + ], + }, + + eyes: { + legend: 'Select eyewear', + none: true, + options: [ + '3d glasses', + 'big shades', + 'small shades', + 'regular shades', + 'modern shades', + 'horned rim glasses', + 'nerd glasses', + 'classic shades', + 'clown eyes', + 'clown eyes blue', + 'cool shades', + 'eyemask', + 'eyepatch', + 'polarized shades', + 'vr', + 'lasereyes 3 red', + 'lasereyes 3 green', + 'lasereyes 3 blue', + 'lasereyes 3 gold', + ], + }, + beard: { + legend: 'Select beard', + none: true, + options: [ + 'beard', + 'beard light', + 'luxurious beard', + 'luxurious beard light', + 'chinstrap', + 'chinstrap light', + 'goat', + ], + }, + + nose: { + legend: 'Select nose accessory', + none: true, + options: [ + 'clown nose', + ], + }, + + blemish: { + legend: 'Select blemish', + none: true, + options: [ + 'mole', + ], + }, + + lipstick: { + legend: 'Select lipstick make-up', + none: true, + options: [ + 'purple lipstick', + ], + }, + + mouthprop: { + legend: 'Select mouth prop', + none: true, + options: [ + 'bubblegum', + 'pipe', + 'vape', + 'cigarette', + 'medical mask', + ], + }, + + earring: { + legend: 'Select earring', + none: true, + options: [ + 'earring', + ], + }, + neck: { + legend: 'Select neck accessory', + none: true, + options: [ + 'gold chain', + ], + }, + + headwear: { + legend: 'Select headwear (or hoodie)', + none: true, + options: [ + 'bandana', + 'bandana 2', + 'bandana 3', + 'beanie', + 'cap mcb', + 'cap mcd', + 'cap small', + 'cap', + 'cap blue', + 'cap red', + 'cap forward', + 'police cap', + 'cowboy hat', + 'crown', + 'french cap', + 'headband', + 'headband ii', + 'headband 2', + 'headphone', + 'headphone 2', + 'jester hat', + 'knitted cap', + 'fedora', + 'classic hat', + 'top hat', + 'wizard hat', + 'do-rag', + 'do-rag blue', + 'do-rag red', + 'hoodie', + 'hoodie dark', + 'hoodie light', + ] + }, +} + diff --git a/builder/render.rb b/builder/render.rb new file mode 100644 index 0000000..a99e68b --- /dev/null +++ b/builder/render.rb @@ -0,0 +1,27 @@ +require 'cocos' +require 'erb' + +require_relative 'punk' +require_relative 'helper' + + + +puts "punk config:" +pp PUNK + + + +html = read_text( "./punk.html.erb" ) +puts html + +tmpl = ERB.new( html ) +buf = tmpl.result + +puts +puts "---" +puts buf + + +write_text( "./tmp/index.html", buf ) + +puts "bye" diff --git a/docs/build/index.html b/docs/build/index.html new file mode 100644 index 0000000..81b831f --- /dev/null +++ b/docs/build/index.html @@ -0,0 +1,830 @@ + + + + + + + + + +

+ « Node Punks +

+ + +

Build Your Own Node Punk (24×24) Wizard

+ + +

Yes, you can! +Build your own originals that you +own 100% forever. +Questions? Comments? +Join us in the Ordbase discord (chat server). + +
+Looking for monkes? +See Monke (28×28) Wizard » +

+ + + + + + + + +
+ + + 10x (240×240px)
+
+ + 4x (96×96px)
+
+ + 1x (24×24px)
+ + +
+ + +
+Select a punk (archetype or readymade): +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+Select hair: +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+Select eyewear: +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+Select beard: +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+Select nose accessory: +
+ + +
+
+ + +
+
+
+Select blemish: +
+ + +
+
+ + +
+
+
+Select lipstick make-up: +
+ + +
+
+ + +
+
+
+Select mouth prop: +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+Select earring: +
+ + +
+
+ + +
+
+
+Select neck accessory: +
+ + +
+
+ + +
+
+
+Select headwear (or hoodie): +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +

+ Open source public domain. + No rights reserved. + See + /nodepunks/builder » +

+ + + diff --git a/docs/build/spritesheet.png b/docs/build/spritesheet.png new file mode 100644 index 0000000..2999146 Binary files /dev/null and b/docs/build/spritesheet.png differ