cryptopunks-gui 0.0.5 → 0.0.9

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: d349e8c9967a50ce0c6af942f6cc3c3673f65a3daffcad18f9bd237ec70958d2
4
- data.tar.gz: 25ed4d8548aad51cc5dba533ed70edc42032e4850bddbbed3e659e2b1ebe9ca1
3
+ metadata.gz: e8d25a5e618dcccd4040032c7a0957938d5b349688e701751f96e09cddb51917
4
+ data.tar.gz: 3afc23cc9be06e3dba292ed17248133e4250195c256f06f6986fd8011976c3a1
5
5
  SHA512:
6
- metadata.gz: 4d06d0a8c6c1c4a8f65290e85f7d645a0b19206d58c53b7ed365827a4ba46a99d14db0a41d8bf774abb07e8bc7e43ec008233e3f8b241ccf305ecb341f5bacb0
7
- data.tar.gz: 4ba66061f49bb601ccf0bebb5e8712526ec081831dc3a792af57b967d769d4c75212184636114999396ae43d48632b2f2ed34d1566c43eb4a5fa8fb63fb236f5
6
+ metadata.gz: 858543e8a8385eccbe3af5476aed027e99fe991eeea40bf8fbcdbd3fef45866bf712725c3833d9c6b9225e4b95cabd462045a84c266da2179189ca3b3cab5038
7
+ data.tar.gz: c1679d9d0cd0d6091d4a4abf270cb419e4dac4ce3b5a5953d0a9682f9dae2eef504d9b5df661004e8af3f0092cf948ac5375132f0e090a41a8f9dc1285b5bb30
data/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # Change Log
2
2
 
3
+ ## 0.0.9
4
+
5
+ - Added Halloween special collections: Scream, Jack 'O' Lantern, Joker, and Frankestein
6
+
7
+ ## 0.0.8
8
+
9
+ - Added missing Bored Apes (vanilla) collection
10
+ - Fixed Bored Apes collection image dimensions (28x28 instead of default 24x24)
11
+
12
+ ## 0.0.7
13
+
14
+ - Multiple Punk Collections (https://github.com/cryptopunksnotdead/awesome-24px)
15
+
16
+ ## 0.0.6
17
+
18
+ - Provide option to change output location
19
+ - Update default output location not to be a hidden location, switching `~/.cryptopunks` to `~/cryptopunks`
20
+ - Remember last selected output location upon app start
21
+ - Avoid hardcoding punk count in code (change 9999 to size of `@punks` array)
22
+
3
23
  ## 0.0.5
4
24
 
5
25
  - Led style spacing option
data/README.md CHANGED
@@ -1,12 +1,12 @@
1
- # <img src="https://raw.githubusercontent.com/AndyObtiva/cryptopunks-gui/master/icons/cryptopunks-gui.png" height=85 /> CryptoPunks GUI 0.0.5
1
+ # <img src="https://raw.githubusercontent.com/AndyObtiva/cryptopunks-gui/master/icons/cryptopunks-gui.png" height=85 /> CryptoPunks GUI 0.0.9
2
2
  ## Simplified Minting
3
3
  [![Gem Version](https://badge.fury.io/rb/cryptopunks-gui.svg)](http://badge.fury.io/rb/cryptopunks-gui)
4
4
 
5
5
  This is a Graphical User Interface for the famous [cryptopunks Ruby gem](https://github.com/cryptopunksnotdead/cryptopunks/tree/master/cryptopunks).
6
6
 
7
- It automatically downloads `punks.png` from https://github.com/larvalabs/cryptopunks on first use.
7
+ It automatically downloads image collection sprites on first use (e.g. `punks.png` from https://github.com/larvalabs/cryptopunks).
8
8
 
9
- Minted cryptopunks are stored at `~/.cryptopunks/`.
9
+ Minted cryptopunks are stored at `~/cryptopunks/` by default ([output location can be changed](#output-location)).
10
10
 
11
11
  ![Screenshot](/screenshots/cryptopunks-gui-screenshot.png)
12
12
 
@@ -25,7 +25,7 @@ You can use CryptoPunks GUI via gem or via cloning repository.
25
25
  Run:
26
26
 
27
27
  ```
28
- gem install cryptopunks-gui -v0.0.5
28
+ gem install cryptopunks-gui -v0.0.9
29
29
  ```
30
30
 
31
31
  Afterwards, run app via:
@@ -69,9 +69,65 @@ ruby app/cryptopunks_gui.rb
69
69
 
70
70
  ## Instructions
71
71
 
72
- ### Punk Index
73
-
74
- Change punk index to pick a different punk.
72
+ ### Collection
73
+
74
+ Change collection to pick a different collection of images.
75
+
76
+ There are currently 38 available collections (from https://github.com/cryptopunksnotdead/awesome-24px):
77
+ - [Punks](https://raw.githubusercontent.com/larvalabs/cryptopunks/master/punks.png) ![image examples](https://github.com/cryptopunksnotdead/awesome-24px/raw/master/i/punks-strip.png)
78
+ - [Mohawks](https://raw.githubusercontent.com/cryptopunksnotdead/programming-cryptopunks/master/i/mohawks.png) ![image examples](https://github.com/cryptopunksnotdead/awesome-24px/raw/master/i/mohawks-strip.png)
79
+ - [Blondies](https://raw.githubusercontent.com/cryptopunksnotdead/programming-cryptopunks/master/i/blondies.png) ![image examples](https://github.com/cryptopunksnotdead/awesome-24px/raw/master/i/blondies-strip.png)
80
+ - [Zombies](https://raw.githubusercontent.com/cryptopunksnotdead/programming-cryptopunks/master/i/zombies.png) ![image examples](https://github.com/cryptopunksnotdead/awesome-24px/raw/master/i/zombies-strip.png)
81
+ - [Apes](https://raw.githubusercontent.com/cryptopunksnotdead/programming-cryptopunks/master/i/apes.png) ![image examples](https://github.com/cryptopunksnotdead/awesome-24px/raw/master/i/apes-strip.png)
82
+ - [Aliens](https://raw.githubusercontent.com/cryptopunksnotdead/programming-cryptopunks/master/i/aliens.png) ![image examples](https://github.com/cryptopunksnotdead/awesome-24px/raw/master/i/aliens-strip.png)
83
+ - [Golden Punks](https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/goldenpunks.png) ![image examples](https://github.com/cryptopunksnotdead/awesome-24px/raw/master/i/goldenpunks-strip.png)
84
+ - [Halloween Punks](https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/halloweenpunks.png) ![image examples](https://github.com/cryptopunksnotdead/awesome-24px/raw/master/i/halloweenpunks-strip.png)
85
+ - [Scream Punks](https://raw.githubusercontent.com/cryptopunksnotdead/cryptopunks/master/halloween/i/screampunks%402x.png)
86
+ - [Jack 'O' Lantern Punks](https://raw.githubusercontent.com/cryptopunksnotdead/cryptopunks/master/halloween/i/jackpunks%402x.png)
87
+ - [Joker Punks](https://raw.githubusercontent.com/cryptopunksnotdead/cryptopunks/master/halloween/i/jokerpunks%402x.png)
88
+ - [Frankenstein Punks](https://raw.githubusercontent.com/cryptopunksnotdead/cryptopunks/master/halloween/i/frankensteinpunks%402x.png)
89
+ - [Front Punks](https://raw.githubusercontent.com/cryptopunksnotdead/programming-cryptopunks/master/i/frontpunks.png) ![image examples](https://github.com/cryptopunksnotdead/awesome-24px/raw/master/i/frontpunks-strip.png)
90
+ - [More Punks](https://raw.githubusercontent.com/cryptopunksnotdead/programming-cryptopunks/master/i/morepunks.png') ![image examples](https://github.com/cryptopunksnotdead/awesome-24px/raw/master/i/morepunks-strip.png)
91
+ - [Expansion Punks](https://expansionpunks.com/provenance/expansionpunks.png) ![image examples](https://github.com/cryptopunksnotdead/awesome-24px/raw/master/i/expansionpunks-strip.png)
92
+ - [Avalanche Punks](https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/avalanchepunks.png) ![image examples](https://github.com/cryptopunksnotdead/awesome-24px/raw/master/i/avalanchepunks-strip.png)
93
+ - [International Punks](https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/intlpunks.png) ![image examples](https://github.com/cryptopunksnotdead/awesome-24px/raw/master/i/intlpunks-strip.png)
94
+ - [Ape Punks](https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/apepunks.png) ![image examples](https://github.com/cryptopunksnotdead/awesome-24px/raw/master/i/apepunks-strip.png)
95
+ - [Alien Clan](https://raw.githubusercontent.com/cryptopunksnotdead/programming-cryptopunks/master/i/alienclan.png) ![image examples](https://github.com/cryptopunksnotdead/awesome-24px/raw/master/i/alienclan-strip.png)
96
+ - [Bored Apes](https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/boredapes.png) ![image examples](https://github.com/cryptopunksnotdead/awesome-24px/raw/master/i/boredapes-strip.png)
97
+ - [Bored Apes Blue](https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/boredapes_blue.png) ![image examples](https://github.com/cryptopunksnotdead/awesome-24px/raw/master/i/boredapes_blue-strip.png)
98
+ - [Bored Apes Red](https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/boredapes_red.png) ![image examples](https://github.com/cryptopunksnotdead/awesome-24px/raw/master/i/boredapes_red-strip.png)
99
+ - [Bored Apes Neon Glow](https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/boredapes_neon_glow.png) ![image examples](https://github.com/cryptopunksnotdead/awesome-24px/raw/master/i/boredapes_neon_glow-strip.png)
100
+ - [Bored Apes Stars and Stripes](https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/boredapes_stars_and_stripes.png) ![image examples](https://github.com/cryptopunksnotdead/awesome-24px/raw/master/i/boredapes_stars_and_stripes-strip.png)
101
+ - [Bored Apes Acid](https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/boredapes_acid.png) ![image examples](https://github.com/cryptopunksnotdead/awesome-24px/raw/master/i/boredapes_acid-strip.png)
102
+ - [Cool Cats](https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/coolcats.png) ![image examples](https://github.com/cryptopunksnotdead/awesome-24px/raw/master/i/coolcats-strip.png)
103
+ - [Cool Cats Mohawks](https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/coolcats_mohawks.png) ![image examples](https://github.com/cryptopunksnotdead/awesome-24px/raw/master/i/coolcats_mohawks-strip.png)
104
+ - [Cool Cats Ninjas](https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/coolcats_ninjas.png) ![image examples](https://github.com/cryptopunksnotdead/awesome-24px/raw/master/i/coolcats_ninjas-strip.png)
105
+ - [Cool Cats TV Heads](https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/coolcats_tvheads.png) ![image examples](https://github.com/cryptopunksnotdead/awesome-24px/raw/master/i/coolcats_tvheads-strip.png)
106
+ - [Cool Cats Pirates](https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/coolcats_pirates.png) ![image examples](https://github.com/cryptopunksnotdead/awesome-24px/raw/master/i/coolcats_pirates-strip.png)
107
+ - [Cool Cats Unicorns](https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/coolcats_unicorns.png) ![image examples](https://github.com/cryptopunksnotdead/awesome-24px/raw/master/i/coolcats_unicorns-strip.png)
108
+ - [Cool Cats Dragons](https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/coolcats_dragons.png) ![image examples](https://github.com/cryptopunksnotdead/awesome-24px/raw/master/i/coolcats_dragons-strip.png)
109
+ - [Cool Cats Frogs](https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/coolcats_frogs.png) ![image examples](https://github.com/cryptopunksnotdead/awesome-24px/blob/master/i/coolcats_frogs-strip.png)
110
+ - [Pudgy Penguins](https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/pudgypenguins.png) ![image examples](https://github.com/cryptopunksnotdead/awesome-24px/raw/master/i/pudgypenguins-strip.png)
111
+ - [Dodge](https://raw.githubusercontent.com/cryptopunksnotdead/programming-cryptopunks/master/i/dodge.png) ![image examples](https://github.com/cryptopunksnotdead/awesome-24px/raw/master/i/dodge-strip.png)
112
+ - [Rocks](https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/rocks.png) ![image examples](https://github.com/cryptopunksnotdead/awesome-24px/raw/master/i/rocks-strip.png)
113
+ - [Punk Rocks](https://raw.githubusercontent.com/cryptopunksnotdead/programming-cryptopunks/master/i/punkrocks.png) ![image examples](https://github.com/cryptopunksnotdead/awesome-24px/raw/master/i/punkrocks-strip.png)
114
+ - [Tulips](https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/tulips.png) ![image examples](https://github.com/cryptopunksnotdead/awesome-24px/raw/master/i/tulips-strip.png)
115
+
116
+ ![Screenshot](/screenshots/cryptopunks-gui-screenshot-collection-zombies.png)
117
+
118
+ ![Screenshot](/screenshots/cryptopunks-gui-screenshot-collection-apes.png)
119
+
120
+ ![Screenshot](/screenshots/cryptopunks-gui-screenshot-collection-alien-clan.png)
121
+
122
+ ![Screenshot](/screenshots/cryptopunks-gui-screenshot-collection-bored-apes-stars-and-stripes.png)
123
+
124
+ ![Screenshot](/screenshots/cryptopunks-gui-screenshot-collection-cool-cats-ninjas.png)
125
+
126
+ ![Screenshot](/screenshots/cryptopunks-gui-screenshot-collection-dodge.png)
127
+
128
+ ### Image Index
129
+
130
+ Change image index to pick a different image.
75
131
 
76
132
  ![Screenshot](/screenshots/cryptopunks-gui-screenshot-different-punk-index.png)
77
133
 
@@ -125,7 +181,7 @@ Change style to get different punk looks.
125
181
 
126
182
  ### Mirror/Flip
127
183
 
128
- Check mirror and/or flip to apply punk transformation. Can combine with different palettes and styles.
184
+ Check mirror and/or flip to apply punk transformations. Can be combined with different palettes and styles.
129
185
 
130
186
  ![Screenshot](/screenshots/cryptopunks-gui-screenshot-no-mirror-no-flip.png)
131
187
 
@@ -137,6 +193,12 @@ Check mirror and/or flip to apply punk transformation. Can combine with differen
137
193
 
138
194
  ![Screenshot](/screenshots/cryptopunks-gui-screenshot-palette-false-style-led-mirror-flip.png)
139
195
 
196
+ ### Output Location
197
+
198
+ You may select a new output location by clicking on the `...` button.
199
+
200
+ ![Screenshot](/screenshots/cryptopunks-gui-screenshot-output-location.png)
201
+
140
202
  ## TODO
141
203
 
142
204
  [TODO.md](TODO.md)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.5
1
+ 0.0.9
@@ -5,6 +5,7 @@ require 'fileutils'
5
5
  require 'net/http'
6
6
  require 'uri'
7
7
  require 'glimmer/data_binding/observer'
8
+ require 'yaml'
8
9
  require 'puts_debuggerer'
9
10
 
10
11
  class CryptopunksGui
@@ -12,18 +13,64 @@ class CryptopunksGui
12
13
 
13
14
  PALETTES = ['Standard'] + (Palette8bit.constants).map(&:name).map {|palette| palette.split('_').map(&:capitalize).join(' ')}.reject { |palette| palette.include?(' ') }.sort
14
15
  STYLES = ['Normal', 'Led', 'Sketch']
16
+ COLLECTION_URL_MAP = {
17
+ 'Punks' => {url: 'https://raw.githubusercontent.com/larvalabs/cryptopunks/master/punks.png', width: 24, height: 24, default_zoom: 12},
18
+ 'Mohawks' => {url: 'https://raw.githubusercontent.com/cryptopunksnotdead/programming-cryptopunks/master/i/mohawks.png', width: 24, height: 24, default_zoom: 12},
19
+ 'Blondies' => {url: 'https://raw.githubusercontent.com/cryptopunksnotdead/programming-cryptopunks/master/i/blondies.png', width: 24, height: 24, default_zoom: 12},
20
+ 'Zombies' => {url: 'https://raw.githubusercontent.com/cryptopunksnotdead/programming-cryptopunks/master/i/zombies.png', width: 24, height: 24, default_zoom: 12},
21
+ 'Apes' => {url: 'https://raw.githubusercontent.com/cryptopunksnotdead/programming-cryptopunks/master/i/apes.png', width: 24, height: 24, default_zoom: 12},
22
+ 'Aliens' => {url: 'https://raw.githubusercontent.com/cryptopunksnotdead/programming-cryptopunks/master/i/aliens.png', width: 24, height: 24, default_zoom: 12},
23
+ 'Golden Punks' => {url: 'https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/goldenpunks.png', width: 24, height: 24, default_zoom: 12},
24
+ 'Halloween Punks' => {url: 'https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/halloweenpunks.png', width: 24, height: 24, default_zoom: 12},
25
+ 'Scream Punks' => {url: 'https://raw.githubusercontent.com/cryptopunksnotdead/cryptopunks/master/halloween/i/screampunks%402x.png', width: 48, height: 48, default_zoom: 6},
26
+ "Jack 'O' Lantern Punks" => {url: 'https://raw.githubusercontent.com/cryptopunksnotdead/cryptopunks/master/halloween/i/jackpunks%402x.png', width: 48, height: 48, default_zoom: 6},
27
+ 'Joker Punks' => {url: 'https://raw.githubusercontent.com/cryptopunksnotdead/cryptopunks/master/halloween/i/jokerpunks%402x.png', width: 48, height: 48, default_zoom: 6},
28
+ 'Frankenstein Punks' => {url: 'https://raw.githubusercontent.com/cryptopunksnotdead/cryptopunks/master/halloween/i/frankensteinpunks%402x.png', width: 48, height: 48, default_zoom: 6},
29
+ 'Front Punks' => {url: 'https://raw.githubusercontent.com/cryptopunksnotdead/programming-cryptopunks/master/i/frontpunks.png', width: 24, height: 24, default_zoom: 12},
30
+ 'More Punks' => {url: 'https://raw.githubusercontent.com/cryptopunksnotdead/programming-cryptopunks/master/i/morepunks.png', width: 24, height: 24, default_zoom: 12},
31
+ 'Expansion Punks' => {url: 'https://expansionpunks.com/provenance/expansionpunks.png', width: 24, height: 24, default_zoom: 12},
32
+ 'Avalanche Punks' => {url: 'https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/avalanchepunks.png', width: 24, height: 24, default_zoom: 12},
33
+ 'International Punks' => {url: 'https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/intlpunks.png', width: 24, height: 24, default_zoom: 12},
34
+ 'Ape Punks' => {url: 'https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/apepunks.png', width: 24, height: 24, default_zoom: 12},
35
+ 'Alien Clan' => {url: 'https://raw.githubusercontent.com/cryptopunksnotdead/programming-cryptopunks/master/i/alienclan.png', width: 24, height: 24, default_zoom: 12},
36
+ 'Bored Apes' => {url: 'https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/boredapes.png', width: 28, height: 28, default_zoom: 10},
37
+ 'Bored Apes Blue' => {url: 'https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/boredapes_blue.png', width: 28, height: 28, default_zoom: 10},
38
+ 'Bored Apes Red' => {url: 'https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/boredapes_red.png', width: 28, height: 28, default_zoom: 10},
39
+ 'Bored Apes Neon Glow' => {url: 'https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/boredapes_neon_glow.png', width: 28, height: 28, default_zoom: 10},
40
+ 'Bored Apes Stars and Stripes' => {url: 'https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/boredapes_stars_and_stripes.png', width: 28, height: 28, default_zoom: 10},
41
+ 'Bored Apes Acid' => {url: 'https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/boredapes_acid.png', width: 28, height: 28, default_zoom: 10},
42
+ 'Cool Cats' => {url: 'https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/coolcats.png', width: 24, height: 24, default_zoom: 12},
43
+ 'Cool Cats Mohawks' => {url: 'https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/coolcats_mohawks.png', width: 24, height: 24, default_zoom: 12},
44
+ 'Cool Cats Ninjas' => {url: 'https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/coolcats_ninjas.png', width: 24, height: 24, default_zoom: 12},
45
+ 'Cool Cats TV Heads' => {url: 'https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/coolcats_tvheads.png', width: 24, height: 24, default_zoom: 12},
46
+ 'Cool Cats Pirates' => {url: 'https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/coolcats_pirates.png', width: 24, height: 24, default_zoom: 12},
47
+ 'Cool Cats Unicorns' => {url: 'https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/coolcats_unicorns.png', width: 24, height: 24, default_zoom: 12},
48
+ 'Cool Cats Dragons' => {url: 'https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/coolcats_dragons.png', width: 24, height: 24, default_zoom: 12},
49
+ 'Cool Cats Frogs' => {url: 'https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/coolcats_frogs.png', width: 24, height: 24, default_zoom: 12},
50
+ 'Pudgy Penguins' => {url: 'https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/pudgypenguins.png', width: 24, height: 24, default_zoom: 12},
51
+ 'Dodge' => {url: 'https://raw.githubusercontent.com/cryptopunksnotdead/programming-cryptopunks/master/i/dodge.png', width: 24, height: 24, default_zoom: 12},
52
+ 'Rocks' => {url: 'https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/rocks.png', width: 24, height: 24, default_zoom: 12},
53
+ 'Punk Rocks' => {url: 'https://raw.githubusercontent.com/cryptopunksnotdead/programming-cryptopunks/master/i/punkrocks.png', width: 24, height: 24, default_zoom: 12},
54
+ 'Tulips' => {url: 'https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/tulips.png', width: 24, height: 24, default_zoom: 12},
55
+ }
15
56
 
16
- attr_accessor :punk_index, :zoom, :palette, :style, :led_spacing, :led_round_corner, :sketch_line, :flip, :mirror
57
+ attr_accessor :collection, :image_index, :zoom, :palette, :style, :led_spacing, :led_round_corner, :sketch_line, :flip, :mirror
17
58
 
18
59
  def initialize
19
- initialize_punks
60
+ initialize_punk_directory
61
+ initialize_collection
62
+ load_config
20
63
  initialize_defaults
21
64
  observe_image_attribute_changes
22
65
  create_gui
23
- self.punk_index = 0
66
+ self.image_index = 0
24
67
  @root.open
25
68
  end
26
69
 
70
+ def collection_options
71
+ COLLECTION_URL_MAP.keys
72
+ end
73
+
27
74
  def palette_options
28
75
  PALETTES
29
76
  end
@@ -32,15 +79,39 @@ class CryptopunksGui
32
79
  STYLES
33
80
  end
34
81
 
35
- def initialize_punks
36
- @punk_directory = File.join(Dir.home, '.cryptopunks')
82
+ def initialize_punk_directory
83
+ @punk_directory = @punk_config_directory = File.join(Dir.home, 'cryptopunks')
37
84
  FileUtils.mkdir_p(@punk_directory)
38
- @punk_file = File.join(@punk_directory, 'punks.png')
39
- File.write(@punk_file, Net::HTTP.get(URI('https://raw.githubusercontent.com/larvalabs/cryptopunks/master/punks.png'))) unless File.exist?(@punk_file)
40
- @punks = Punks::Image::Composite.read(@punk_file)
85
+ end
86
+
87
+ def initialize_collection
88
+ return if @collection && @collection == @last_collection
89
+ @collection ||= COLLECTION_URL_MAP.keys.first
90
+ url = COLLECTION_URL_MAP[@collection][:url]
91
+ width = COLLECTION_URL_MAP[@collection][:width]
92
+ height = COLLECTION_URL_MAP[@collection][:height]
93
+ @punk_file = File.join(@punk_config_directory, File.basename(url, '.png'))
94
+ File.write(@punk_file, Net::HTTP.get(URI(url))) unless File.exist?(@punk_file)
95
+ @images ||= {}
96
+ @images[@collection] ||= Punks::Image::Composite.read(@punk_file, width: width, height: height)
97
+ @last_collection = @collection
98
+ self.image_index = 0
99
+ @image_index_spinbox.to = @images[@collection].size - 1 if @image_index_spinbox
100
+ end
101
+
102
+ def load_config
103
+ @punk_config_file = File.join(@punk_config_directory, 'cryptopunks.yml')
104
+ FileUtils.touch(@punk_config_file)
105
+ @punk_config = YAML.load(File.read(@punk_config_file)) || {punk_directory: @punk_directory}
106
+ @punk_directory = @punk_config[:punk_directory]
107
+ end
108
+
109
+ def save_config
110
+ File.write(@punk_config_file, YAML.dump(@punk_config))
41
111
  end
42
112
 
43
113
  def initialize_defaults
114
+ @collection = COLLECTION_URL_MAP.keys.first
44
115
  @zoom = 12
45
116
  @palette = PALETTES.first
46
117
  @style = STYLES.first
@@ -53,7 +124,8 @@ class CryptopunksGui
53
124
 
54
125
  def observe_image_attribute_changes
55
126
  observer = Glimmer::DataBinding::Observer.proc { generate_image }
56
- observer.observe(self, :punk_index)
127
+ observer.observe(self, :collection)
128
+ observer.observe(self, :image_index)
57
129
  observer.observe(self, :zoom)
58
130
  observer.observe(self, :palette)
59
131
  observer.observe(self, :style)
@@ -65,12 +137,16 @@ class CryptopunksGui
65
137
  end
66
138
 
67
139
  def generate_image
68
- return if @punk_index.to_i > 9999
69
- image_location = File.join(@punk_directory, "punk-#{@punk_index}#{"x#{@zoom}" if @zoom.to_i > 1}#{"-#{@palette.underscore}" if @palette != PALETTES.first}#{"-#{@style.underscore}" if @style != STYLES.first}.png")
140
+ initialize_collection
141
+ return if @image_index.to_i > @images[@collection].size
142
+ image_location = File.join(@punk_directory, "#{@collection.gsub(' ', '').downcase}-#{@image_index}#{"x#{@zoom}" if @zoom.to_i > 1}#{"-#{@palette.underscore}" if @palette != PALETTES.first}#{"-#{@style.underscore}" if @style != STYLES.first}.png")
70
143
  puts "Writing punk image to #{image_location}"
71
- selected_punk = @punks[@punk_index.to_i]
144
+ selected_punk = @images[@collection][@image_index.to_i]
72
145
  selected_punk = selected_punk.change_palette8bit(Palette8bit.const_get(@palette.gsub(' ', '_').upcase.to_sym)) if @palette != PALETTES.first
73
146
  @original_zoom = @zoom
147
+ if @previous_collection && @collection != @previous_collection && COLLECTION_URL_MAP[@collection][:width] != COLLECTION_URL_MAP[@previous_collection][:width]
148
+ @zoom = COLLECTION_URL_MAP[@collection][:default_zoom]
149
+ end
74
150
  if @style != STYLES.first
75
151
  style_options = {}
76
152
  if @style == 'Led'
@@ -87,8 +163,9 @@ class CryptopunksGui
87
163
  selected_punk = selected_punk.zoom(@zoom.to_i) if @style == STYLES.first
88
164
  selected_punk.save(image_location)
89
165
  @image_label.image = image_location
90
- @message_entry.text = image_location
166
+ @output_location_entry.text = image_location
91
167
  @previous_style = @style
168
+ @previous_collection = @collection
92
169
  notify_observers(:zoom) if @zoom != @original_zoom
93
170
  end
94
171
 
@@ -99,17 +176,20 @@ class CryptopunksGui
99
176
 
100
177
  frame {
101
178
  label {
102
- text 'Select Punk Index and Zoom To Mint Cryptopunk'
103
- font weight: 'bold'
179
+ text 'Collection:'
180
+ }
181
+ combobox {
182
+ readonly true
183
+ text <=> [self, :collection]
104
184
  }
105
185
 
106
186
  label {
107
- text 'Punk Index:'
187
+ text 'Image Index:'
108
188
  }
109
- spinbox {
189
+ @image_index_spinbox = spinbox {
110
190
  from 0
111
- to @punks.size - 1
112
- text <=> [self, :punk_index]
191
+ to @images[@collection].size - 1
192
+ text <=> [self, :image_index]
113
193
  }
114
194
 
115
195
  label {
@@ -174,8 +254,26 @@ class CryptopunksGui
174
254
  label {
175
255
  text 'Output Location:'
176
256
  }
177
- @message_entry = entry {
178
- readonly true
257
+ frame {
258
+ padding 0
259
+
260
+ @output_location_entry = entry {
261
+ grid row: 0, column: 0
262
+ readonly true
263
+ width 47
264
+ }
265
+ button {
266
+ grid row: 0, column: 1
267
+ text '...'
268
+ width 1.1
269
+
270
+ on('command') do
271
+ @punk_directory = choose_directory(parent: @root)
272
+ @punk_config[:punk_directory] = @punk_directory
273
+ save_config
274
+ generate_image
275
+ end
276
+ }
179
277
  }
180
278
 
181
279
  @image_label = label {
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: cryptopunks-gui 0.0.5 ruby app
5
+ # stub: cryptopunks-gui 0.0.9 ruby app
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "cryptopunks-gui".freeze
9
- s.version = "0.0.5"
9
+ s.version = "0.0.9"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["app".freeze]
13
13
  s.authors = ["Andy Maleh".freeze]
14
- s.date = "2021-10-25"
14
+ s.date = "2021-10-30"
15
15
  s.description = "CryptoPunks GUI for Simplified Minting - Built with Glimmer DSL for Tk (requires ActiveTcl to run cryptopunks-gui command)".freeze
16
16
  s.email = "andy.am@gmail.com".freeze
17
17
  s.executables = ["cryptopunks-gui".freeze]
@@ -41,7 +41,7 @@ Gem::Specification.new do |s|
41
41
  end
42
42
 
43
43
  if s.respond_to? :add_runtime_dependency then
44
- s.add_runtime_dependency(%q<glimmer-dsl-tk>.freeze, ["~> 0.0.30"])
44
+ s.add_runtime_dependency(%q<glimmer-dsl-tk>.freeze, ["~> 0.0.33"])
45
45
  s.add_runtime_dependency(%q<cryptopunks>.freeze, ["~> 2.0.1"])
46
46
  s.add_development_dependency(%q<rspec>.freeze, ["~> 3.5.0"])
47
47
  s.add_development_dependency(%q<rdoc>.freeze, ["~> 3.12"])
@@ -49,7 +49,7 @@ Gem::Specification.new do |s|
49
49
  s.add_development_dependency(%q<simplecov>.freeze, [">= 0"])
50
50
  s.add_development_dependency(%q<rake-tui>.freeze, [">= 0"])
51
51
  else
52
- s.add_dependency(%q<glimmer-dsl-tk>.freeze, ["~> 0.0.30"])
52
+ s.add_dependency(%q<glimmer-dsl-tk>.freeze, ["~> 0.0.33"])
53
53
  s.add_dependency(%q<cryptopunks>.freeze, ["~> 2.0.1"])
54
54
  s.add_dependency(%q<rspec>.freeze, ["~> 3.5.0"])
55
55
  s.add_dependency(%q<rdoc>.freeze, ["~> 3.12"])
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cryptopunks-gui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Maleh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-25 00:00:00.000000000 Z
11
+ date: 2021-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: glimmer-dsl-tk
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.0.30
19
+ version: 0.0.33
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.0.30
26
+ version: 0.0.33
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: cryptopunks
29
29
  requirement: !ruby/object:Gem::Requirement