profilepic 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2ffc9a8e667f60136de35f02afcf76ffe1726b987630b06e5476f8319fc1389c
4
- data.tar.gz: 35358297cc5182a6af8a7b83d1abdbfa9826e16f2dd5a20937e4162f1961042e
3
+ metadata.gz: 5d41ebabc80cb160ec234b527e6c1fc7d04ef28794a57fc7c1bba83fa9d357fc
4
+ data.tar.gz: 83175dee4ce2769394a40aff87ad1358082c9a3f89522e918977577b69eaf0e2
5
5
  SHA512:
6
- metadata.gz: 35f8b682f2fe4985c47a5e34d3f1b711b4657e137bc324635b79e16e7fb7a63381dfc6f352f24ecf5236f821aedf0457357bf47a8fc1719f30d2359e563062d5
7
- data.tar.gz: 36f6275b5c5fee241f489dc7f19206d786fe4204611a0bea83ff77c232ef77fc8cce0b9913b1e9799a3f96df4f041e338636f0e777bdd493397803ec08e3c2dd
6
+ metadata.gz: b47049d03f7a3d935b31e2e3d9682d02ba55e9bc0238b4b8a55b9b93d6cd84518e2384945acaf562de43a1661094657f3e2ffb3ef8ca51765ee567e631863b6a
7
+ data.tar.gz: 2cd589f2713dfa6f007290566037b8956fe11b1f4010b358dcfd07dc5f1487a01ceb23cce0d2a9cc2cef92d1ebf63f211cedefd4286f736409e68dfcf05aa0bb
data/Manifest.txt CHANGED
@@ -5,7 +5,14 @@ Rakefile
5
5
  bin/profilepic
6
6
  lib/profilepic.rb
7
7
  lib/profilepic/builder.rb
8
+ lib/profilepic/public/doge-24x24.csv
9
+ lib/profilepic/public/doge-24x24.png
10
+ lib/profilepic/public/marcs-24x24.csv
11
+ lib/profilepic/public/marcs-24x24.png
12
+ lib/profilepic/public/spritesheet.js
8
13
  lib/profilepic/public/style.css
14
+ lib/profilepic/public/yeoldepunks-24x24.csv
15
+ lib/profilepic/public/yeoldepunks-24x24.png
9
16
  lib/profilepic/service.rb
10
17
  lib/profilepic/version.rb
11
18
  lib/profilepic/views/doge.erb
@@ -0,0 +1,23 @@
1
+ id, category, name, more_names
2
+ 0, , classic,
3
+ 1, , dark,
4
+ 2, , zombie,
5
+ 3, , alien,
6
+ 4, , crazyhair,
7
+ 5, , beanie,
8
+ 6, , cap,
9
+ 7, , capforward,
10
+ 8, , cowboyhat,
11
+ 9, , fedora,
12
+ 10, , knittedcap,
13
+ 11, , tophat,
14
+ 12, , bandana,
15
+ 13, , headband,
16
+ 14, , tiara,
17
+ 15, , 3dglasses,
18
+ 16, , bigshades,
19
+ 17, , classicshades,
20
+ 18, , regularshades,
21
+ 19, , smallshades,
22
+ 20, , nerdglasses,
23
+ 21, , eyepatch,
@@ -0,0 +1,149 @@
1
+ id, category, name, more_names
2
+ 0, , marc-classic,
3
+ 1, , ape-classic,
4
+ 2, , Marc 1, Marc Dark
5
+ 3, , Marc 2, Marc Mid | Marc Medium
6
+ 4, , Marc 3, Marc | Marc Light
7
+ 5, , Marc 4, Marc Albino
8
+ 6, , Marc Gold, Gold | Marc Golden
9
+ 7, , madlad,
10
+ 8, , zombie,
11
+ 9, , ape,
12
+ 10, , Golden Ape, Ape Gold | Ape Golden
13
+ 11, , Pink Ape, Ape Pink
14
+ 12, , Blue Alien, Alien | Alien Blue
15
+ 13, , Green Alien, Alien Green
16
+ 14, , Devil 1, Devil | Demon | Demon 1
17
+ 15, , Devil 2, Demon 2
18
+ 16, , Devil 3, Demon 3
19
+ 17, , orc,
20
+ 18, , skeleton,
21
+ 19, , bot,
22
+ 20, , blue_eyes,
23
+ 21, , green_eyes,
24
+ 22, , blue_eye_shadow,
25
+ 23, , green_eye_shadow,
26
+ 24, , purple_eye_shadow,
27
+ 25, , bagner,
28
+ 26, , horns,
29
+ 27, , marc_tyson,
30
+ 28, , cleft,
31
+ 29, , mole,
32
+ 30, , rosy_cheeks,
33
+ 31, , shine,
34
+ 32, , spots,
35
+ 33, , black_lipstick,
36
+ 34, , hot_lipstick,
37
+ 35, , purple_lipstick,
38
+ 36, , buck_teeth,
39
+ 37, , clown_nose,
40
+ 38, , gold_ring,
41
+ 39, , diamond_earring,
42
+ 40, , gold_earring,
43
+ 41, , diamond_helix,
44
+ 42, , gold_helix,
45
+ 43, , frown,
46
+ 44, , smile,
47
+ 45, , big_beard_white,
48
+ 46, , big_beard,
49
+ 47, , chinstrap,
50
+ 48, , front_beard,
51
+ 49, , front_beard_dark,
52
+ 50, , full_mustache,
53
+ 51, , full_mustache_dark,
54
+ 52, , goat,
55
+ 53, , goat_dark,
56
+ 54, , handlebar,
57
+ 55, , luxurious_beard,
58
+ 56, , mustache,
59
+ 57, , mutton_chop,
60
+ 58, , normal_beard,
61
+ 59, , normal_beard_black,
62
+ 60, , shadow_beard,
63
+ 61, , soul_patch,
64
+ 62, , bandana,
65
+ 63, , beanie,
66
+ 64, , bunny_ears,
67
+ 65, , cap,
68
+ 66, , skull_cap,
69
+ 67, , cap_forward,
70
+ 68, , police_cap,
71
+ 69, , cowboy_hat,
72
+ 70, , do_rag,
73
+ 71, , fast_food,
74
+ 72, , marcdonalds,
75
+ 73, , fedora,
76
+ 74, , headband,
77
+ 75, , roaring_headband,
78
+ 76, , hoodie,
79
+ 77, , purple_hoodie,
80
+ 78, , knitted_cap,
81
+ 79, , laurels,
82
+ 80, , shemagh,
83
+ 81, , tassle_hat,
84
+ 82, , tiarra,
85
+ 83, , top_hat,
86
+ 84, , uncle_sam,
87
+ 85, , viking,
88
+ 86, , welding_goggles,
89
+ 87, , blonde_bob,
90
+ 88, , chad,
91
+ 89, , clown_hair,
92
+ 90, , crazy_white_hair,
93
+ 91, , crazy_hair,
94
+ 92, , frumpy_hair,
95
+ 93, , marc_three,
96
+ 94, , purple_hair,
97
+ 95, , stringy_hair,
98
+ 96, , vampire_hair,
99
+ 97, , wild_blonde_hair,
100
+ 98, , wild_hair,
101
+ 99, , clown_eyes_blue,
102
+ 100, , clown_eyes_green,
103
+ 101, , lasers,
104
+ 102, , tears,
105
+ 103, , 3d_glasses,
106
+ 104, , aviators,
107
+ 105, , big_shades,
108
+ 106, , classic_shades,
109
+ 107, , deal_with_it,
110
+ 108, , glasses,
111
+ 109, , gold_glasses,
112
+ 110, , horned_rim_glasses,
113
+ 111, , monocle,
114
+ 112, , nerd_glasses,
115
+ 113, , pink_shades,
116
+ 114, , polarized,
117
+ 115, , polarized_white,
118
+ 116, , regular_shades,
119
+ 117, , small_shades,
120
+ 118, , VR Headset, VR
121
+ 119, , eye_mask,
122
+ 120, , eye_patch,
123
+ 121, , cigar,
124
+ 122, , cigarette,
125
+ 123, , hookah,
126
+ 124, , pipe,
127
+ 125, , vape,
128
+ 126, , medical_mask,
129
+ 127, , bubble_gum,
130
+ 128, , black_tie,
131
+ 129, , blue_tie,
132
+ 130, , red_tie,
133
+ 131, , blue_shirt,
134
+ 132, , blue_t_shirt,
135
+ 133, , Fast Food Shirt,
136
+ 134, , green_shirt,
137
+ 135, , grey_shirt,
138
+ 136, , purple_t_shirt,
139
+ 137, , white_t_shirt,
140
+ 138, , jumpsuit,
141
+ 139, , labcoat,
142
+ 140, , choker,
143
+ 141, , double_gold_chain,
144
+ 142, , gold_chain,
145
+ 143, , silver_chain,
146
+ 144, , thick_chain,
147
+ 145, , hemp,
148
+ 146, , ice,
149
+ 147, , medallion,
@@ -0,0 +1,126 @@
1
+ function parseCsv( str ) {
2
+ const lines = str.split( /\r?\n/ );
3
+ let rows = [];
4
+
5
+ for( let line of lines ) {
6
+ line = line.trim();
7
+
8
+ // skip empty & comment lines
9
+ if( line.length === 0 || line.startsWith('#') ) {
10
+ continue;
11
+ }
12
+ values = line.split(',');
13
+
14
+ values = values.map( (val, index) => val.trim() );
15
+ console.log( values );
16
+
17
+ rows.push( values );
18
+ }
19
+
20
+ return rows
21
+ }
22
+
23
+
24
+ class Spritesheet {
25
+ constructor( img, names,
26
+ tileWidth=24,
27
+ tileHeight=24 ) {
28
+ this.img = img;
29
+ this.names = this._build_names( names );
30
+ this.tileWidth = tileWidth;
31
+ this.tileHeight = tileHeight;
32
+ }
33
+ static read( src, names,
34
+ tileWidth=24,
35
+ tileHeight=24 ) {
36
+ let img = new Image();
37
+ img.src = src;
38
+ return new Spritesheet( img, names, tileWidth, tileHeight );
39
+ }
40
+
41
+
42
+ _build_names( str ) {
43
+ // assume text records in comma-separated values (.csv)
44
+ // e.g.
45
+ // 0, Male 1
46
+ // 1, Male 2
47
+ // ...
48
+ // 11, Rosy Cheeks (m)
49
+
50
+ const rows = parseCsv( str );
51
+ let names = {};
52
+ for( let row of rows ) {
53
+ let id = parseInt( row[0] );
54
+ let name = this._norm_name( row[1] );
55
+
56
+ names[ name ] = id;
57
+ }
58
+
59
+ return names;
60
+ }
61
+
62
+ _norm_name( str ) {
63
+ str = str.toLowerCase();
64
+ str = str.replaceAll( /[ _-]/ig, '' );
65
+ console.log( str );
66
+ return str;
67
+ }
68
+
69
+ drawSprite( name, sel, zoom=1 ) {
70
+ let el = (typeof sel === 'string') ?
71
+ document.querySelector( sel )
72
+ :
73
+ sel;
74
+
75
+ let num = this.names[ this._norm_name( name ) ];
76
+ this._drawSprite( num, el, zoom );
77
+ }
78
+
79
+ _drawSprite( num, el, zoom=1 ) {
80
+
81
+ let canvas = document.createElement( 'canvas' );
82
+
83
+ canvas.width = this.tileWidth*zoom;
84
+ canvas.height =this.tileHeight*zoom;
85
+
86
+ console.log( "==> Spritesheet.drawSprite" );
87
+ console.log( canvas.width, canvas.height );
88
+
89
+ let cols = this.img.naturalWidth / this.tileHeight;
90
+ let rows = this.img.naturalHeight / this.tileWidth;
91
+ console.log( cols, rows );
92
+
93
+ let dy = Math.floor( num / cols );
94
+ let dx = num % cols;
95
+ console.log( dx, dy );
96
+
97
+ let cx = canvas.getContext( "2d" );
98
+ cx.clearRect( 0, 0, this.tileWidth, this.tileHeight );
99
+ cx.imageSmoothingEnabled = false;
100
+ cx.drawImage( this.img,
101
+ // source rect
102
+ dx*this.tileWidth, dy*this.tileHeight, this.tileWidth, this.tileHeight,
103
+ // dest rect
104
+ 0, 0, this.tileWidth*zoom, this.tileHeight*zoom );
105
+
106
+ el.appendChild( canvas );
107
+ }
108
+
109
+ draw( sel='span.sprite', zoom=1 ) {
110
+ // note: use onload (async) callback to wait for (required) image download to complete
111
+ this.img.onload = () => {
112
+ console.log( " image.onload callback " );
113
+ let els = document.querySelectorAll( sel );
114
+ // console.log( els );
115
+
116
+ for( let el of Array.from( els ) ) {
117
+ let name = el.dataset.name;
118
+ console.log( name );
119
+
120
+ this.drawSprite( name, el, zoom );
121
+ }
122
+ console.log( "done Spritesheet.draw()" );
123
+ }
124
+ }
125
+ }
126
+
@@ -0,0 +1,134 @@
1
+ id, name, gender, size, type, more_names
2
+ 0, Male 1, m, l, Archetype,
3
+ 1, Male 2, m, l, Archetype,
4
+ 2, Male 3, m, l, Archetype,
5
+ 3, Male 4, m, l, Archetype,
6
+ 4, Female 1, f, s, Archetype,
7
+ 5, Female 2, f, s, Archetype,
8
+ 6, Female 3, f, s, Archetype,
9
+ 7, Female 4, f, s, Archetype,
10
+ 8, Zombie, m, l, Archetype,
11
+ 9, Ape, m, l, Archetype,
12
+ 10, Alien, m, l, Archetype,
13
+ 11, Rosy Cheeks, m, l, ?,
14
+ 12, Luxurious Beard, m, l, ?,
15
+ 13, Clown Hair Green, m, l, ?,
16
+ 14, Mohawk Dark, m, l, ?,
17
+ 15, Cowboy Hat, m, l, ?,
18
+ 16, Mustache, m, l, ?,
19
+ 17, Clown Nose, m, l, ?,
20
+ 18, Cigarette, m, l, ?,
21
+ 19, Nerd Glasses, m, l, ?,
22
+ 20, Regular Shades, m, l, ?,
23
+ 21, Knitted Cap, m, l, ?,
24
+ 22, Shadow Beard, m, l, ?,
25
+ 23, Frown, m, l, ?,
26
+ 24, Cap Forward, m, l, ?,
27
+ 25, Goat, m, l, ?,
28
+ 26, Mole, m, l, ?,
29
+ 27, Purple Hair, m, l, ?,
30
+ 28, Small Shades, m, l, ?,
31
+ 29, Shaved Head, m, l, ?,
32
+ 30, Classic Shades, m, l, ?,
33
+ 31, Vape, m, l, ?,
34
+ 32, Silver Chain, m, l, ?,
35
+ 33, Smile, m, l, ?,
36
+ 34, Big Shades, m, l, ?,
37
+ 35, Mohawk Thin, m, l, ?,
38
+ 36, Beanie, m, l, ?,
39
+ 37, Cap, m, l, ?,
40
+ 38, Clown Eyes Green, m, l, ?,
41
+ 39, Normal Beard Black, m, l, ?,
42
+ 40, Medical Mask, m, l, ?,
43
+ 41, Normal Beard, m, l, ?,
44
+ 42, VR, m, l, ?,
45
+ 43, Eye Patch, m, l, ?,
46
+ 44, Wild Hair, m, l, ?,
47
+ 45, Top Hat, m, l, ?,
48
+ 46, Bandana, m, l, ?,
49
+ 47, Handlebars, m, l, ?,
50
+ 48, Frumpy Hair, m, l, ?,
51
+ 49, Crazy Hair, m, l, ?,
52
+ 50, Police Cap, m, l, ?,
53
+ 51, Buck Teeth, m, l, ?,
54
+ 52, Do-rag, m, l, ?,
55
+ 53, Front Beard, m, l, ?,
56
+ 54, Spots, m, l, ?,
57
+ 55, Big Beard, m, l, ?,
58
+ 56, Vampire Hair, m, l, ?,
59
+ 57, Peak Spike, m, l, ?,
60
+ 58, Chinstrap, m, l, ?,
61
+ 59, Fedora, m, l, ?,
62
+ 60, Earring, m, l, ?,
63
+ 61, Horned Rim Glasses, m, l, ?,
64
+ 62, Headband, m, l, ?,
65
+ 63, Pipe, m, l, ?,
66
+ 64, Messy Hair, m, l, ?,
67
+ 65, Front Beard Dark, m, l, ?,
68
+ 66, Hoodie, m, l, ?,
69
+ 67, Gold Chain, m, l, ?,
70
+ 68, Muttonchops, m, l, ?,
71
+ 69, Stringy Hair, m, l, ?,
72
+ 70, Eye Mask, m, l, ?,
73
+ 71, 3D Glasses, m, l, ?,
74
+ 72, Clown Eyes Blue, m, l, ?,
75
+ 73, Mohawk, m, l, ?,
76
+ 74, Pilot Helmet, f, s, ?,
77
+ 75, Tassle Hat, f, s, ?,
78
+ 76, Hot Lipstick, f, s, ?,
79
+ 77, Blue Eye Shadow, f, s, ?,
80
+ 78, Straight Hair Dark, f, s, ?,
81
+ 79, Choker, f, s, ?,
82
+ 80, Crazy Hair, f, s, ?,
83
+ 81, Regular Shades, f, s, ?,
84
+ 82, Wild Blonde, f, s, ?,
85
+ 83, 3D Glasses, f, s, ?,
86
+ 84, Mole, f, s, ?,
87
+ 85, Wild White Hair, f, s, ?,
88
+ 86, Spots, f, s, ?,
89
+ 87, Frumpy Hair, f, s, ?,
90
+ 88, Nerd Glasses, f, s, ?,
91
+ 89, Tiara, f, s, ?,
92
+ 90, Orange Side, f, s, ?,
93
+ 91, Red Mohawk, f, s, ?,
94
+ 92, Messy Hair, f, s, ?,
95
+ 93, Clown Eyes Blue, f, s, ?,
96
+ 94, Pipe, f, s, ?,
97
+ 95, Wild Hair, f, s, ?,
98
+ 96, Purple Eye Shadow, f, s, ?,
99
+ 97, Stringy Hair, f, s, ?,
100
+ 98, Dark Hair, f, s, ?,
101
+ 99, Eye Patch, f, s, ?,
102
+ 100, Blonde Short, f, s, ?,
103
+ 101, Classic Shades, f, s, ?,
104
+ 102, Eye Mask, f, s, ?,
105
+ 103, Clown Hair Green, f, s, ?,
106
+ 104, Cap, f, s, ?,
107
+ 105, Medical Mask, f, s, ?,
108
+ 106, Bandana, f, s, ?,
109
+ 107, Purple Lipstick, f, s, ?,
110
+ 108, Clown Nose, f, s, ?,
111
+ 109, Headband, f, s, ?,
112
+ 110, Pigtails, f, s, ?,
113
+ 111, Straight Hair Blonde, f, s, ?,
114
+ 112, Knitted Cap, f, s, ?,
115
+ 113, Clown Eyes Green, f, s, ?,
116
+ 114, Cigarette, f, s, ?,
117
+ 115, Welding Goggles, f, s, ?,
118
+ 116, Mohawk Thin, f, s, ?,
119
+ 117, Gold Chain, f, s, ?,
120
+ 118, VR, f, s, ?,
121
+ 119, Vape, f, s, ?,
122
+ 120, Pink With Hat, f, s, ?,
123
+ 121, Blonde Bob, f, s, ?,
124
+ 122, Mohawk, f, s, ?,
125
+ 123, Big Shades, f, s, ?,
126
+ 124, Earring, f, s, ?,
127
+ 125, Green Eye Shadow, f, s, ?,
128
+ 126, Straight Hair, f, s, ?,
129
+ 127, Rosy Cheeks, f, s, ?,
130
+ 128, Half Shaved, f, s, ?,
131
+ 129, Mohawk Dark, f, s, ?,
132
+ 130, Black Lipstick, f, s, ?,
133
+ 131, Horned Rim Glasses, f, s, ?,
134
+ 132, Silver Chain, f, s, ?,
@@ -3,6 +3,62 @@
3
3
  # helpers
4
4
  # to generate
5
5
 
6
+ def radio_options_w_sprites( options,
7
+ name:,
8
+ legend: )
9
+
10
+ buf = <<TXT
11
+ <fieldset>
12
+ <legend>#{legend}:</legend>
13
+ TXT
14
+
15
+ options.each_with_index do |option,i|
16
+
17
+ value = option.downcase
18
+
19
+ ## auto-extract qualifiers e.g. (m)ale/(f)emale
20
+ qualifiers = if value.index( '(m)' ) then ['m']
21
+ elsif value.index( '(f)' ) then ['f']
22
+ elsif value.index( '(m/f)' ) then ['m', 'f']
23
+ else []
24
+ end
25
+
26
+ value = value.sub( '(m)', '' ).sub( '(f)', '' ).sub( '(m/f)', '' ).sub( '¹', '' )
27
+ value = value.strip
28
+
29
+
30
+
31
+ label = option
32
+
33
+ buf += <<TXT
34
+ <div>
35
+ <input type="radio" id="#{name}#{i}" name="#{name}" value="#{value}"
36
+ #{ i==0 ? 'checked' : '' }>
37
+ TXT
38
+
39
+ if ['none'].include?( value )
40
+ ## do nothing - no sprite(s) - for none & friends
41
+ elsif qualifiers.empty?
42
+ buf += %Q[ <span class="sprite" data-name="#{value}"></span>\n]
43
+ else
44
+ qualifiers.each do |qualifier|
45
+ buf += %Q[ <span class="sprite" data-name="#{value} (#{qualifier})"></span>\n]
46
+ end
47
+ end
48
+
49
+ buf += <<TXT
50
+ <label for="#{name}#{i}">#{label}</label>
51
+ </div>
52
+ TXT
53
+ end
54
+
55
+
56
+ buf += "</fieldset>\n"
57
+ buf
58
+
59
+ end
60
+
61
+
6
62
  def radio_options( options,
7
63
  name:,
8
64
  legend: )
@@ -16,12 +72,14 @@ options.each_with_index do |option,i|
16
72
 
17
73
  value = option.downcase
18
74
  value = value.sub( '(m)', '' ).sub( '(f)', '' ).sub( '(m/f)', '' ).sub( '¹', '' )
75
+ value = value.strip
76
+
19
77
  label = option
20
78
 
21
79
  buf += <<TXT
22
80
  <div>
23
81
  <input type="radio" id="#{name}#{i}" name="#{name}" value="#{value}"
24
- #{ i==0 ? 'checked' : '' }
82
+ #{ i==0 ? 'checked' : '' }>
25
83
  <label for="#{name}#{i}">#{label}</label>
26
84
  </div>
27
85
  TXT
@@ -3,7 +3,7 @@
3
3
  module Profilepic
4
4
  MAJOR = 0
5
5
  MINOR = 1
6
- PATCH = 3
6
+ PATCH = 4
7
7
  VERSION = [MAJOR,MINOR,PATCH].join('.')
8
8
 
9
9
  def self.version
@@ -16,22 +16,22 @@ own 100% forever.
16
16
  <form action="/generate_doge" method="get" id="form1">
17
17
 
18
18
 
19
- <%= radio_options( DOGE_ARCHETYPE,
19
+ <%= radio_options_w_sprites( DOGE_ARCHETYPE,
20
20
  name: 't',
21
21
  legend: 'Select a doge shiba inu base (archetype)' ) %>
22
22
 
23
23
  Options:
24
24
 
25
- <%= radio_options( ['None']+DOGE_HAIR,
25
+ <%= radio_options_w_sprites( ['None']+DOGE_HAIR,
26
26
  name: 'hair',
27
27
  legend: 'Select hair' ) %>
28
28
 
29
- <%= radio_options( ['None']+DOGE_HEADWEAR,
29
+ <%= radio_options_w_sprites( ['None']+DOGE_HEADWEAR,
30
30
  name: 'headwear',
31
31
  legend: 'Select headwear' ) %>
32
32
 
33
33
 
34
- <%= radio_options( ['None']+DOGE_EYEWEAR,
34
+ <%= radio_options_w_sprites( ['None']+DOGE_EYEWEAR,
35
35
  name: 'eyewear',
36
36
  legend: 'Select eyewear' ) %>
37
37
 
@@ -41,30 +41,34 @@ Options:
41
41
  </div>
42
42
 
43
43
 
44
-
45
- Or
46
-
47
- <fieldset>
48
- <legend>Type (more) attribute description / specification:</legend>
49
-
50
- <div>
51
- <input type="text" id="attributes" name="attributes"
52
- minlength="0" maxlength="200" size="80"
53
- style="font-size: 200%;"
54
- placeholder="Attribute 1, Attribute 2, Attribute 3, ...">
55
-
56
- <p>
57
- Examples:
58
- </p>
59
- <ul>
60
- <li>Crazy Hair, 3D Glasses</li>
61
- <li>Headband</li>
62
- </ul>
63
-
64
- </div>
65
- </fieldset>
66
-
67
-
68
44
  <%= erb :'shared/_more_options' %>
69
45
 
70
46
  </form>
47
+
48
+
49
+ <script>
50
+ var sheet = Spritesheet.read( 'doge-24x24.png',
51
+ `0, classic
52
+ 1, dark
53
+ 2, zombie
54
+ 3, alien
55
+ 4, crazyhair
56
+ 5, beanie
57
+ 6, cap
58
+ 7, capforward
59
+ 8, cowboyhat
60
+ 9, fedora
61
+ 10, knittedcap
62
+ 11, tophat
63
+ 12, bandana
64
+ 13, headband
65
+ 14, tiara
66
+ 15, 3dglasses
67
+ 16, bigshades
68
+ 17, classicshades
69
+ 18, regularshades
70
+ 19, smallshades
71
+ 20, nerdglasses
72
+ 21, eyepatch` );
73
+ sheet.draw();
74
+ </script>
@@ -6,6 +6,7 @@
6
6
  <title>Profile Pic(ture) As A Service</title>
7
7
 
8
8
  <link href="<%= url('/style.css') %>" rel='stylesheet'>
9
+ <script src="spritesheet.js"></script>
9
10
  </head>
10
11
  <body>
11
12
 
@@ -15,39 +15,39 @@ own 100% forever.
15
15
  <form action="/generate_marcs" method="get" id="form1">
16
16
 
17
17
 
18
- <%= radio_options( MARC_ARCHETYPE,
18
+ <%= radio_options_w_sprites( MARC_ARCHETYPE,
19
19
  name: 't',
20
20
  legend: 'Select a marc base (archetype)' ) %>
21
21
 
22
22
  Options:
23
23
 
24
24
 
25
- <%= radio_options( ['None']+MARC_EYES,
25
+ <%= radio_options_w_sprites( ['None']+MARC_EYES,
26
26
  name: 'eyes',
27
27
  legend: 'Select eyes (extras)' ) %>
28
28
 
29
- <%= radio_options( ['None']+MARC_FACE,
29
+ <%= radio_options_w_sprites( ['None']+MARC_FACE,
30
30
  name: 'face',
31
31
  legend: 'Select face (extras)' ) %>
32
32
 
33
- <%= radio_options( ['None']+MARC_BEARD,
33
+ <%= radio_options_w_sprites( ['None']+MARC_BEARD,
34
34
  name: 'beard',
35
35
  legend: 'Select beard' ) %>
36
36
 
37
- <%= radio_options( ['None']+MARC_HAIR,
37
+ <%= radio_options_w_sprites( ['None']+MARC_HAIR,
38
38
  name: 'hair',
39
39
  legend: 'Select hair' ) %>
40
40
 
41
- <%= radio_options( ['None']+MARC_HEADWEAR,
41
+ <%= radio_options_w_sprites( ['None']+MARC_HEADWEAR,
42
42
  name: 'headwear',
43
43
  legend: 'Select headwear' ) %>
44
44
 
45
45
 
46
- <%= radio_options( ['None']+MARC_EYEWEAR,
46
+ <%= radio_options_w_sprites( ['None']+MARC_EYEWEAR,
47
47
  name: 'eyewear',
48
48
  legend: 'Select eyewear' ) %>
49
49
 
50
- <%= radio_options( ['None']+MARC_MOUTH_PROP,
50
+ <%= radio_options_w_sprites( ['None']+MARC_MOUTH_PROP,
51
51
  name: 'mouth',
52
52
  legend: 'Select mouth prop' ) %>
53
53
 
@@ -57,32 +57,162 @@ Options:
57
57
  style="font-size: 400%; color: white; background-color: blue;">Generate Profile Pic(ture) in .PNG Format</button>
58
58
  </div>
59
59
 
60
+ <%= erb :'shared/_more_options' %>
60
61
 
62
+ </form>
61
63
 
62
- Or
63
-
64
- <fieldset>
65
- <legend>Type (more) attribute description / specification:</legend>
66
-
67
- <div>
68
- <input type="text" id="attributes" name="attributes"
69
- minlength="0" maxlength="200" size="80"
70
- style="font-size: 200%;"
71
- placeholder="Attribute 1, Attribute 2, Attribute 3, ...">
72
-
73
- <p>
74
- Examples:
75
- </p>
76
- <ul>
77
- <li>Normal Beard, Big Shades</li>
78
- <li>Crazy Hair, 3D Glasses</li>
79
- <li>Headband</li>
80
- </ul>
81
-
82
- </div>
83
- </fieldset>
84
64
 
85
65
 
86
- <%= erb :'shared/_more_options' %>
87
66
 
88
- </form>
67
+ <script>
68
+ var sheet = Spritesheet.read( 'marcs-24x24.png',
69
+ `0, marc classic
70
+ 1, ape classic
71
+ 2, Marc Dark
72
+ 3, Marc Mid
73
+ 4, Marc
74
+ 5, Marc Albino
75
+ 6, Marc Golden
76
+ 7, madlad
77
+ 8, zombie
78
+ 9, ape
79
+ 10, Ape Golden
80
+ 11, Ape Pink
81
+ 12, Alien
82
+ 13, Alien Green
83
+ 14, Devil
84
+ 15, Devil 2
85
+ 16, Devil 3
86
+ 17, orc
87
+ 18, skeleton
88
+ 19, bot
89
+ 20, blue_eyes
90
+ 21, green_eyes
91
+ 22, blue_eye_shadow
92
+ 23, green_eye_shadow
93
+ 24, purple_eye_shadow
94
+ 25, bagner
95
+ 26, horns
96
+ 27, marc_tyson
97
+ 28, cleft
98
+ 29, mole
99
+ 30, rosy_cheeks
100
+ 31, shine
101
+ 32, spots
102
+ 33, black_lipstick
103
+ 34, hot_lipstick
104
+ 35, purple_lipstick
105
+ 36, buck_teeth
106
+ 37, clown_nose
107
+ 38, gold_ring
108
+ 39, diamond_earring
109
+ 40, gold_earring
110
+ 41, diamond_helix
111
+ 42, gold_helix
112
+ 43, frown
113
+ 44, smile
114
+ 45, big_beard_white
115
+ 46, big_beard
116
+ 47, chinstrap
117
+ 48, front_beard
118
+ 49, front_beard_dark
119
+ 50, full_mustache
120
+ 51, full_mustache_dark
121
+ 52, goat
122
+ 53, goat_dark
123
+ 54, handlebar
124
+ 55, luxurious_beard
125
+ 56, mustache
126
+ 57, mutton_chop
127
+ 58, normal_beard
128
+ 59, normal_beard_black
129
+ 60, shadow_beard
130
+ 61, soul_patch
131
+ 62, bandana
132
+ 63, beanie
133
+ 64, bunny_ears
134
+ 65, cap
135
+ 66, skull_cap
136
+ 67, cap_forward
137
+ 68, police_cap
138
+ 69, cowboy_hat
139
+ 70, do_rag
140
+ 71, fast_food
141
+ 72, marcdonalds
142
+ 73, fedora
143
+ 74, headband
144
+ 75, roaring_headband
145
+ 76, hoodie
146
+ 77, purple_hoodie
147
+ 78, knitted_cap
148
+ 79, laurels
149
+ 80, shemagh
150
+ 81, tassle_hat
151
+ 82, tiarra
152
+ 83, top_hat
153
+ 84, uncle_sam
154
+ 85, viking
155
+ 86, welding_goggles
156
+ 87, blonde_bob
157
+ 88, chad
158
+ 89, clown_hair
159
+ 90, crazy_white_hair
160
+ 91, crazy_hair
161
+ 92, frumpy_hair
162
+ 93, marc_three
163
+ 94, purple_hair
164
+ 95, stringy_hair
165
+ 96, vampire_hair
166
+ 97, wild_blonde_hair
167
+ 98, wild_hair
168
+ 99, clown_eyes_blue
169
+ 100, clown_eyes_green
170
+ 101, lasers
171
+ 102, tears
172
+ 103, 3d_glasses
173
+ 104, aviators
174
+ 105, big_shades
175
+ 106, classic_shades
176
+ 107, deal_with_it
177
+ 108, glasses
178
+ 109, gold_glasses
179
+ 110, horned_rim_glasses
180
+ 111, monocle
181
+ 112, nerd_glasses
182
+ 113, pink_shades
183
+ 114, polarized
184
+ 115, polarized_white
185
+ 116, regular_shades
186
+ 117, small_shades
187
+ 118, VR Headset
188
+ 119, eye_mask
189
+ 120, eye_patch
190
+ 121, cigar
191
+ 122, cigarette
192
+ 123, hookah
193
+ 124, pipe
194
+ 125, vape
195
+ 126, medical_mask
196
+ 127, bubble_gum
197
+ 128, black_tie
198
+ 129, blue_tie
199
+ 130, red_tie
200
+ 131, blue_shirt
201
+ 132, blue_t_shirt
202
+ 133, Fast Food Shirt
203
+ 134, green_shirt
204
+ 135, grey_shirt
205
+ 136, purple_t_shirt
206
+ 137, white_t_shirt
207
+ 138, jumpsuit
208
+ 139, labcoat
209
+ 140, choker
210
+ 141, double_gold_chain
211
+ 142, gold_chain
212
+ 143, silver_chain
213
+ 144, thick_chain
214
+ 145, hemp
215
+ 146, ice
216
+ 147, medallion` );
217
+ sheet.draw();
218
+ </script>
@@ -16,65 +16,65 @@ own 100% forever.
16
16
  <form action="/generate_yeoldepunks" method="get" id="form1">
17
17
 
18
18
 
19
- <%= radio_options( YEOLDEPUNK_ARCHETYPE,
19
+ <%= radio_options_w_sprites( YEOLDEPUNK_ARCHETYPE,
20
20
  name: 't',
21
21
  legend: "Select a ye olde' punk base (archetype)" ) %>
22
22
 
23
23
  Options:
24
24
 
25
- <%= radio_options( ['None']+YEOLDEPUNK_HAIR,
25
+ <%= radio_options_w_sprites( ['None']+YEOLDEPUNK_HAIR,
26
26
  name: 'hair',
27
27
  legend: 'Select hair' ) %>
28
28
 
29
29
  ¹: Note: Pink With Hat is a hair+headwear combo.
30
30
 
31
- <%= radio_options( ['None']+YEOLDEPUNK_BEARD,
31
+ <%= radio_options_w_sprites( ['None']+YEOLDEPUNK_BEARD,
32
32
  name: 'beard',
33
33
  legend: 'Select beard' ) %>
34
34
 
35
- <%= radio_options( ['None']+YEOLDEPUNK_EYES,
35
+ <%= radio_options_w_sprites( ['None']+YEOLDEPUNK_EYES,
36
36
  name: 'eyes',
37
37
  legend: 'Select eyes (make-up)' ) %>
38
38
 
39
39
 
40
40
 
41
- <%= radio_options( ['None']+YEOLDEPUNK_EYEWEAR,
41
+ <%= radio_options_w_sprites( ['None']+YEOLDEPUNK_EYEWEAR,
42
42
  name: 'eyewear',
43
43
  legend: 'Select eyewear' ) %>
44
44
 
45
45
 
46
- <%= radio_options( ['None']+YEOLDEPUNK_NOSE,
46
+ <%= radio_options_w_sprites( ['None']+YEOLDEPUNK_NOSE,
47
47
  name: 'nose',
48
48
  legend: 'Select nose accessory' ) %>
49
49
 
50
- <%= radio_options( ['None']+YEOLDEPUNK_BLEMISH,
50
+ <%= radio_options_w_sprites( ['None']+YEOLDEPUNK_BLEMISH,
51
51
  name: 'blemish',
52
52
  legend: 'Select blemish' ) %>
53
53
 
54
54
 
55
- <%= radio_options( ['None']+YEOLDEPUNK_MOUTH,
55
+ <%= radio_options_w_sprites( ['None']+YEOLDEPUNK_MOUTH,
56
56
  name: 'mouth',
57
57
  legend: 'Select mouth expression / lipstick make-up' ) %>
58
58
 
59
59
 
60
- <%= radio_options( ['None']+YEOLDEPUNK_MOUTH_PROP,
60
+ <%= radio_options_w_sprites( ['None']+YEOLDEPUNK_MOUTH_PROP,
61
61
  name: 'mouthprop',
62
62
  legend: 'Select mouth prop' ) %>
63
63
 
64
64
 
65
- <%= radio_options( ['None']+YEOLDEPUNK_EARRING,
65
+ <%= radio_options_w_sprites( ['None']+YEOLDEPUNK_EARRING,
66
66
  name: 'earring',
67
67
  legend: 'Select earring' ) %>
68
68
 
69
69
 
70
- <%= radio_options( ['None']+YEOLDEPUNK_HEADWEAR,
70
+ <%= radio_options_w_sprites( ['None']+YEOLDEPUNK_HEADWEAR,
71
71
  name: 'headwear',
72
72
  legend: 'Select headwear' ) %>
73
73
 
74
74
  ¹: Note: Headband (f) is a (black) hair+headwear combo.
75
75
 
76
76
 
77
- <%= radio_options( ['None']+YEOLDEPUNK_NECK,
77
+ <%= radio_options_w_sprites( ['None']+YEOLDEPUNK_NECK,
78
78
  name: 'neck',
79
79
  legend: 'Select neck accessory' ) %>
80
80
 
@@ -89,3 +89,143 @@ Options:
89
89
  <%= erb :'shared/_more_options' %>
90
90
 
91
91
  </form>
92
+
93
+
94
+
95
+ <script>
96
+ var sheet = Spritesheet.read( 'yeoldepunks-24x24.png',
97
+ `0, Male 1
98
+ 1, Male 2
99
+ 2, Male 3
100
+ 3, Male 4
101
+ 4, Female 1
102
+ 5, Female 2
103
+ 6, Female 3
104
+ 7, Female 4
105
+ 8, Zombie
106
+ 9, Ape
107
+ 10, Alien
108
+ 11, Rosy Cheeks (m)
109
+ 12, Luxurious Beard (m)
110
+ 13, Clown Hair Green (m)
111
+ 14, Mohawk Dark (m)
112
+ 15, Cowboy Hat (m)
113
+ 16, Mustache (m)
114
+ 17, Clown Nose (m)
115
+ 18, Cigarette (m)
116
+ 19, Nerd Glasses (m)
117
+ 20, Regular Shades (m)
118
+ 21, Knitted Cap (m)
119
+ 22, Shadow Beard (m)
120
+ 23, Frown (m)
121
+ 24, Cap Forward (m)
122
+ 25, Goat (m)
123
+ 26, Mole (m)
124
+ 27, Purple Hair (m)
125
+ 28, Small Shades (m)
126
+ 29, Shaved Head (m)
127
+ 30, Classic Shades (m)
128
+ 31, Vape (m)
129
+ 32, Silver Chain (m)
130
+ 33, Smile (m)
131
+ 34, Big Shades (m)
132
+ 35, Mohawk Thin (m)
133
+ 36, Beanie (m)
134
+ 37, Cap (m)
135
+ 38, Clown Eyes Green (m)
136
+ 39, Normal Beard Black (m)
137
+ 40, Medical Mask (m)
138
+ 41, Normal Beard (m)
139
+ 42, VR (m)
140
+ 43, Eye Patch (m)
141
+ 44, Wild Hair (m)
142
+ 45, Top Hat (m)
143
+ 46, Bandana (m)
144
+ 47, Handlebars (m)
145
+ 48, Frumpy Hair (m)
146
+ 49, Crazy Hair (m)
147
+ 50, Police Cap (m)
148
+ 51, Buck Teeth (m)
149
+ 52, Do-rag (m)
150
+ 53, Front Beard (m)
151
+ 54, Spots (m)
152
+ 55, Big Beard (m)
153
+ 56, Vampire Hair (m)
154
+ 57, Peak Spike (m)
155
+ 58, Chinstrap (m)
156
+ 59, Fedora (m)
157
+ 60, Earring (m)
158
+ 61, Horned Rim Glasses (m)
159
+ 62, Headband (m)
160
+ 63, Pipe (m)
161
+ 64, Messy Hair (m)
162
+ 65, Front Beard Dark (m)
163
+ 66, Hoodie (m)
164
+ 67, Gold Chain (m)
165
+ 68, Muttonchops (m)
166
+ 69, Stringy Hair (m)
167
+ 70, Eye Mask (m)
168
+ 71, 3D Glasses (m)
169
+ 72, Clown Eyes Blue (m)
170
+ 73, Mohawk (m)
171
+ 74, Pilot Helmet (f)
172
+ 75, Tassle Hat (f)
173
+ 76, Hot Lipstick (f)
174
+ 77, Blue Eye Shadow (f)
175
+ 78, Straight Hair Dark (f)
176
+ 79, Choker (f)
177
+ 80, Crazy Hair (f)
178
+ 81, Regular Shades (f)
179
+ 82, Wild Blonde (f)
180
+ 83, 3D Glasses (f)
181
+ 84, Mole (f)
182
+ 85, Wild White Hair (f)
183
+ 86, Spots (f)
184
+ 87, Frumpy Hair (f)
185
+ 88, Nerd Glasses (f)
186
+ 89, Tiara (f)
187
+ 90, Orange Side (f)
188
+ 91, Red Mohawk (f)
189
+ 92, Messy Hair (f)
190
+ 93, Clown Eyes Blue (f)
191
+ 94, Pipe (f)
192
+ 95, Wild Hair (f)
193
+ 96, Purple Eye Shadow (f)
194
+ 97, Stringy Hair (f)
195
+ 98, Dark Hair (f)
196
+ 99, Eye Patch (f)
197
+ 100, Blonde Short (f)
198
+ 101, Classic Shades (f)
199
+ 102, Eye Mask (f)
200
+ 103, Clown Hair Green (f)
201
+ 104, Cap (f)
202
+ 105, Medical Mask (f)
203
+ 106, Bandana (f)
204
+ 107, Purple Lipstick (f)
205
+ 108, Clown Nose (f)
206
+ 109, Headband (f)
207
+ 110, Pigtails (f)
208
+ 111, Straight Hair Blonde (f)
209
+ 112, Knitted Cap (f)
210
+ 113, Clown Eyes Green (f)
211
+ 114, Cigarette (f)
212
+ 115, Welding Goggles (f)
213
+ 116, Mohawk Thin (f)
214
+ 117, Gold Chain (f)
215
+ 118, VR (f)
216
+ 119, Vape (f)
217
+ 120, Pink With Hat (f)
218
+ 121, Blonde Bob (f)
219
+ 122, Mohawk (f)
220
+ 123, Big Shades (f)
221
+ 124, Earring (f)
222
+ 125, Green Eye Shadow (f)
223
+ 126, Straight Hair (f)
224
+ 127, Rosy Cheeks (f)
225
+ 128, Half Shaved (f)
226
+ 129, Mohawk Dark (f)
227
+ 130, Black Lipstick (f)
228
+ 131, Horned Rim Glasses (f)
229
+ 132, Silver Chain (f)` );
230
+ sheet.draw();
231
+ </script>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: profilepic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gerald Bauer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-06 00:00:00.000000000 Z
11
+ date: 2022-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: originals
@@ -103,7 +103,14 @@ files:
103
103
  - bin/profilepic
104
104
  - lib/profilepic.rb
105
105
  - lib/profilepic/builder.rb
106
+ - lib/profilepic/public/doge-24x24.csv
107
+ - lib/profilepic/public/doge-24x24.png
108
+ - lib/profilepic/public/marcs-24x24.csv
109
+ - lib/profilepic/public/marcs-24x24.png
110
+ - lib/profilepic/public/spritesheet.js
106
111
  - lib/profilepic/public/style.css
112
+ - lib/profilepic/public/yeoldepunks-24x24.csv
113
+ - lib/profilepic/public/yeoldepunks-24x24.png
107
114
  - lib/profilepic/service.rb
108
115
  - lib/profilepic/version.rb
109
116
  - lib/profilepic/views/doge.erb