cryptopunks-gui 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +59 -7
- data/VERSION +1 -1
- data/app/cryptopunks_gui.rb +79 -18
- data/cryptopunks-gui.gemspec +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 697c564d1fcf6db201efa8144a72df008861afc9cb0dad432b6554610acf7a41
|
4
|
+
data.tar.gz: b500b6957a6f03f5cf0d82acb3354ceeb8bdce676283431d3803b8f6a4cbe79b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88ae74464c874aac202584de37a467082bc2c32c98a503abf84ee34ed53f75a1ef337f97588bf04cfa7ccbc4bfa00fcd49881fe1d64a64525c4ce2f3bebf0146
|
7
|
+
data.tar.gz: adfcd69acbcd13814d9102038781b8550cf8488a5f9f8f009ec466e48274d154dcbfc75bc7946ddc41e3c8c109ea8bed6a655aaa703d2a86d9e2c80caab58944
|
data/CHANGELOG.md
CHANGED
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.
|
1
|
+
# <img src="https://raw.githubusercontent.com/AndyObtiva/cryptopunks-gui/master/icons/cryptopunks-gui.png" height=85 /> CryptoPunks GUI 0.0.7
|
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
|
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
|
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.
|
28
|
+
gem install cryptopunks-gui -v0.0.7
|
29
29
|
```
|
30
30
|
|
31
31
|
Afterwards, run app via:
|
@@ -69,9 +69,61 @@ ruby app/cryptopunks_gui.rb
|
|
69
69
|
|
70
70
|
## Instructions
|
71
71
|
|
72
|
-
###
|
73
|
-
|
74
|
-
Change
|
72
|
+
### Collection
|
73
|
+
|
74
|
+
Change collection to pick a different collection of images.
|
75
|
+
|
76
|
+
There are currently 73 available collections (from https://github.com/cryptopunksnotdead/awesome-24px):
|
77
|
+
- Punks
|
78
|
+
- Mohawks
|
79
|
+
- Blondies
|
80
|
+
- Zombies
|
81
|
+
- Apes
|
82
|
+
- Aliens
|
83
|
+
- Golden Punks
|
84
|
+
- Halloween Punks
|
85
|
+
- Front Punks
|
86
|
+
- More Punks
|
87
|
+
- Expansion Punks
|
88
|
+
- Avalanche Punks
|
89
|
+
- Intl Punks
|
90
|
+
- Ape Punks
|
91
|
+
- Alien Clan
|
92
|
+
- Bored Apes Blue
|
93
|
+
- Bored Apes Red
|
94
|
+
- Bored Apes Neon Glow
|
95
|
+
- Bored Apes Stars and Stripes
|
96
|
+
- Bored Apes Acid
|
97
|
+
- Cool Cats
|
98
|
+
- Cool Cats Mohawks
|
99
|
+
- Cool Cats Ninjas
|
100
|
+
- Cool Cats TV Heads
|
101
|
+
- Cool Cats Pirates
|
102
|
+
- Cool Cats Unicorns
|
103
|
+
- Cool Cats Dragons
|
104
|
+
- Cool Cats Frogs
|
105
|
+
- Pudgy Penguins
|
106
|
+
- Dodge
|
107
|
+
- Rocks
|
108
|
+
- Punk Rocks
|
109
|
+
- Tulips
|
110
|
+
|
111
|
+
|
112
|
+
![Screenshot](/screenshots/cryptopunks-gui-screenshot-collection-zombies.png)
|
113
|
+
|
114
|
+
![Screenshot](/screenshots/cryptopunks-gui-screenshot-collection-apes.png)
|
115
|
+
|
116
|
+
![Screenshot](/screenshots/cryptopunks-gui-screenshot-collection-alien-clasn.png)
|
117
|
+
|
118
|
+
![Screenshot](/screenshots/cryptopunks-gui-screenshot-collection-bored-apes-stars-and-stripes.png)
|
119
|
+
|
120
|
+
![Screenshot](/screenshots/cryptopunks-gui-screenshot-collection-cool-cats-ninjas.png)
|
121
|
+
|
122
|
+
![Screenshot](/screenshots/cryptopunks-gui-screenshot-collection-dodge.png)
|
123
|
+
|
124
|
+
### Image Index
|
125
|
+
|
126
|
+
Change image index to pick a different image.
|
75
127
|
|
76
128
|
![Screenshot](/screenshots/cryptopunks-gui-screenshot-different-punk-index.png)
|
77
129
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.7
|
data/app/cryptopunks_gui.rb
CHANGED
@@ -13,19 +13,59 @@ class CryptopunksGui
|
|
13
13
|
|
14
14
|
PALETTES = ['Standard'] + (Palette8bit.constants).map(&:name).map {|palette| palette.split('_').map(&:capitalize).join(' ')}.reject { |palette| palette.include?(' ') }.sort
|
15
15
|
STYLES = ['Normal', 'Led', 'Sketch']
|
16
|
+
COLLECTION_URL_MAP = {
|
17
|
+
'Punks' => 'https://raw.githubusercontent.com/larvalabs/cryptopunks/master/punks.png',
|
18
|
+
'Mohawks' => 'https://raw.githubusercontent.com/cryptopunksnotdead/programming-cryptopunks/master/i/mohawks.png',
|
19
|
+
'Blondies' => 'https://raw.githubusercontent.com/cryptopunksnotdead/programming-cryptopunks/master/i/blondies.png',
|
20
|
+
'Zombies' => 'https://raw.githubusercontent.com/cryptopunksnotdead/programming-cryptopunks/master/i/zombies.png',
|
21
|
+
'Apes' => 'https://raw.githubusercontent.com/cryptopunksnotdead/programming-cryptopunks/master/i/apes.png',
|
22
|
+
'Aliens' => 'https://raw.githubusercontent.com/cryptopunksnotdead/programming-cryptopunks/master/i/aliens.png',
|
23
|
+
'Golden Punks' => 'https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/goldenpunks.png',
|
24
|
+
'Halloween Punks' => 'https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/halloweenpunks.png',
|
25
|
+
'Front Punks' => 'https://raw.githubusercontent.com/cryptopunksnotdead/programming-cryptopunks/master/i/frontpunks.png',
|
26
|
+
'More Punks' => 'https://raw.githubusercontent.com/cryptopunksnotdead/programming-cryptopunks/master/i/morepunks.png',
|
27
|
+
'Expansion Punks' => 'https://expansionpunks.com/provenance/expansionpunks.png',
|
28
|
+
'Avalanche Punks' => 'https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/avalanchepunks.png',
|
29
|
+
'Intl Punks' => 'https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/intlpunks.png',
|
30
|
+
'Ape Punks' => 'https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/apepunks.png',
|
31
|
+
'Alien Clan' => 'https://raw.githubusercontent.com/cryptopunksnotdead/programming-cryptopunks/master/i/alienclan.png',
|
32
|
+
'Bored Apes Blue' => 'https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/boredapes_blue.png',
|
33
|
+
'Bored Apes Red' => 'https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/boredapes_red.png',
|
34
|
+
'Bored Apes Neon Glow' => 'https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/boredapes_neon_glow.png',
|
35
|
+
'Bored Apes Stars and Stripes' => 'https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/boredapes_stars_and_stripes.png',
|
36
|
+
'Bored Apes Acid' => 'https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/boredapes_acid.png',
|
37
|
+
'Cool Cats' => 'https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/coolcats.png',
|
38
|
+
'Cool Cats Mohawks' => 'https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/coolcats_mohawks.png',
|
39
|
+
'Cool Cats Ninjas' => 'https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/coolcats_ninjas.png',
|
40
|
+
'Cool Cats TV Heads' => 'https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/coolcats_tvheads.png',
|
41
|
+
'Cool Cats Pirates' => 'https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/coolcats_pirates.png',
|
42
|
+
'Cool Cats Unicorns' => 'https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/coolcats_unicorns.png',
|
43
|
+
'Cool Cats Dragons' => 'https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/coolcats_dragons.png',
|
44
|
+
'Cool Cats Frogs' => 'https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/coolcats_frogs.png',
|
45
|
+
'Pudgy Penguins' => 'https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/pudgypenguins.png',
|
46
|
+
'Dodge' => 'https://raw.githubusercontent.com/cryptopunksnotdead/programming-cryptopunks/master/i/dodge.png',
|
47
|
+
'Rocks' => 'https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/rocks.png',
|
48
|
+
'Punk Rocks' => 'https://raw.githubusercontent.com/cryptopunksnotdead/programming-cryptopunks/master/i/punkrocks.png',
|
49
|
+
'Tulips' => 'https://raw.githubusercontent.com/cryptopunksnotdead/awesome-24px/master/collection/tulips.png',
|
50
|
+
}
|
16
51
|
|
17
|
-
attr_accessor :
|
52
|
+
attr_accessor :collection, :image_index, :zoom, :palette, :style, :led_spacing, :led_round_corner, :sketch_line, :flip, :mirror
|
18
53
|
|
19
54
|
def initialize
|
20
|
-
|
55
|
+
initialize_punk_directory
|
56
|
+
initialize_collection
|
21
57
|
load_config
|
22
58
|
initialize_defaults
|
23
59
|
observe_image_attribute_changes
|
24
60
|
create_gui
|
25
|
-
self.
|
61
|
+
self.image_index = 0
|
26
62
|
@root.open
|
27
63
|
end
|
28
64
|
|
65
|
+
def collection_options
|
66
|
+
COLLECTION_URL_MAP.keys
|
67
|
+
end
|
68
|
+
|
29
69
|
def palette_options
|
30
70
|
PALETTES
|
31
71
|
end
|
@@ -34,16 +74,26 @@ class CryptopunksGui
|
|
34
74
|
STYLES
|
35
75
|
end
|
36
76
|
|
37
|
-
def
|
38
|
-
@punk_directory = File.join(Dir.home, 'cryptopunks')
|
77
|
+
def initialize_punk_directory
|
78
|
+
@punk_directory = @punk_config_directory = File.join(Dir.home, 'cryptopunks')
|
39
79
|
FileUtils.mkdir_p(@punk_directory)
|
40
|
-
|
41
|
-
|
42
|
-
|
80
|
+
end
|
81
|
+
|
82
|
+
def initialize_collection
|
83
|
+
return if @collection && @collection == @last_collection
|
84
|
+
@collection ||= COLLECTION_URL_MAP.keys.first
|
85
|
+
url = COLLECTION_URL_MAP[@collection]
|
86
|
+
@punk_file = File.join(@punk_config_directory, File.basename(url, '.png'))
|
87
|
+
File.write(@punk_file, Net::HTTP.get(URI(url))) unless File.exist?(@punk_file)
|
88
|
+
@images ||= {}
|
89
|
+
@images[@collection] ||= Punks::Image::Composite.read(@punk_file)
|
90
|
+
@last_collection = @collection
|
91
|
+
self.image_index = 0
|
92
|
+
@image_index_spinbox.to = @images[@collection].size - 1 if @image_index_spinbox
|
43
93
|
end
|
44
94
|
|
45
95
|
def load_config
|
46
|
-
@punk_config_file = File.join(@
|
96
|
+
@punk_config_file = File.join(@punk_config_directory, 'cryptopunks.yml')
|
47
97
|
FileUtils.touch(@punk_config_file)
|
48
98
|
@punk_config = YAML.load(File.read(@punk_config_file)) || {punk_directory: @punk_directory}
|
49
99
|
@punk_directory = @punk_config[:punk_directory]
|
@@ -54,6 +104,7 @@ class CryptopunksGui
|
|
54
104
|
end
|
55
105
|
|
56
106
|
def initialize_defaults
|
107
|
+
@collection = COLLECTION_URL_MAP.keys.first
|
57
108
|
@zoom = 12
|
58
109
|
@palette = PALETTES.first
|
59
110
|
@style = STYLES.first
|
@@ -66,7 +117,8 @@ class CryptopunksGui
|
|
66
117
|
|
67
118
|
def observe_image_attribute_changes
|
68
119
|
observer = Glimmer::DataBinding::Observer.proc { generate_image }
|
69
|
-
observer.observe(self, :
|
120
|
+
observer.observe(self, :collection)
|
121
|
+
observer.observe(self, :image_index)
|
70
122
|
observer.observe(self, :zoom)
|
71
123
|
observer.observe(self, :palette)
|
72
124
|
observer.observe(self, :style)
|
@@ -78,10 +130,11 @@ class CryptopunksGui
|
|
78
130
|
end
|
79
131
|
|
80
132
|
def generate_image
|
81
|
-
|
82
|
-
|
133
|
+
initialize_collection
|
134
|
+
return if @image_index.to_i > @images[@collection].size
|
135
|
+
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")
|
83
136
|
puts "Writing punk image to #{image_location}"
|
84
|
-
selected_punk = @
|
137
|
+
selected_punk = @images[@collection][@image_index.to_i]
|
85
138
|
selected_punk = selected_punk.change_palette8bit(Palette8bit.const_get(@palette.gsub(' ', '_').upcase.to_sym)) if @palette != PALETTES.first
|
86
139
|
@original_zoom = @zoom
|
87
140
|
if @style != STYLES.first
|
@@ -112,12 +165,20 @@ class CryptopunksGui
|
|
112
165
|
|
113
166
|
frame {
|
114
167
|
label {
|
115
|
-
text '
|
168
|
+
text 'Collection:'
|
116
169
|
}
|
117
|
-
|
170
|
+
combobox {
|
171
|
+
readonly true
|
172
|
+
text <=> [self, :collection]
|
173
|
+
}
|
174
|
+
|
175
|
+
label {
|
176
|
+
text 'Image Index:'
|
177
|
+
}
|
178
|
+
@image_index_spinbox = spinbox {
|
118
179
|
from 0
|
119
|
-
to @
|
120
|
-
text <=> [self, :
|
180
|
+
to @images[@collection].size - 1
|
181
|
+
text <=> [self, :image_index]
|
121
182
|
}
|
122
183
|
|
123
184
|
label {
|
@@ -188,7 +249,7 @@ class CryptopunksGui
|
|
188
249
|
@output_location_entry = entry {
|
189
250
|
grid row: 0, column: 0
|
190
251
|
readonly true
|
191
|
-
width
|
252
|
+
width 47
|
192
253
|
}
|
193
254
|
button {
|
194
255
|
grid row: 0, column: 1
|
data/cryptopunks-gui.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
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
|
+
# stub: cryptopunks-gui 0.0.7 ruby app
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "cryptopunks-gui".freeze
|
9
|
-
s.version = "0.0.
|
9
|
+
s.version = "0.0.7"
|
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]
|