cryptopunks-gui 0.0.1 → 0.0.2
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 +22 -2
- data/VERSION +1 -1
- data/app/cryptopunks_gui.rb +20 -2
- 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: 3c2dbdaae667d1a222c8d3484dce2903b6a7636fe8445287124c3fa9293f6ab3
|
4
|
+
data.tar.gz: d4066e8e07533ac59630f345cbd7496abffdbbcccee541100716e582bd0a5f03
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 47b5b1513fb6328af05d4adf9bdff57598596b747f3257c05d3fc7f6969cb06e02bf7d311442d71d890535e777e545765a66802773d898ed72bd39beedc1a6d7
|
7
|
+
data.tar.gz: 6c61ff9deeb391131f9a94da5c217afe6a228763aa7427bac374a99dde1d3af8cf84794166faa5206dad9325a9b274ef54546bedd9b9b89094c5dee6408e236c
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
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.2
|
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
|
|
@@ -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.2
|
29
29
|
```
|
30
30
|
|
31
31
|
Afterwards, run app via:
|
@@ -67,6 +67,26 @@ Alternatively, run app manually via:
|
|
67
67
|
ruby app/cryptopunks_gui.rb
|
68
68
|
```
|
69
69
|
|
70
|
+
## Instructions
|
71
|
+
|
72
|
+
### Punk Index
|
73
|
+
|
74
|
+
Change punk index to pick a different punk.
|
75
|
+
|
76
|
+
![Screenshot](/screenshots/cryptopunks-gui-screenshot-different-punk-index.png)
|
77
|
+
|
78
|
+
### Zoom
|
79
|
+
|
80
|
+
Change zoom to enlarge punk to your liking.
|
81
|
+
|
82
|
+
![Screenshot](/screenshots/cryptopunks-gui-screenshot-different-zoom.png)
|
83
|
+
|
84
|
+
### Palette
|
85
|
+
|
86
|
+
Change palette to get different punk colors.
|
87
|
+
|
88
|
+
![Screenshot](/screenshots/cryptopunks-gui-screenshot-different-palette.png)
|
89
|
+
|
70
90
|
## TODO
|
71
91
|
|
72
92
|
[TODO.md](TODO.md)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.2
|
data/app/cryptopunks_gui.rb
CHANGED
@@ -9,7 +9,9 @@ require 'puts_debuggerer'
|
|
9
9
|
class CryptopunksGui
|
10
10
|
include Glimmer
|
11
11
|
|
12
|
-
|
12
|
+
PALETTES = ['Standard'] + (Palette8bit.constants).map(&:name).map {|palette| palette.split('_').map(&:capitalize).join(' ')}.reject { |palette| palette.include?(' ') }
|
13
|
+
|
14
|
+
attr_accessor :punk_index, :zoom, :palette
|
13
15
|
|
14
16
|
def initialize
|
15
17
|
@punk_directory = File.join(Dir.home, '.cryptopunks')
|
@@ -18,22 +20,29 @@ class CryptopunksGui
|
|
18
20
|
File.write(@punk_file, Net::HTTP.get(URI('https://raw.githubusercontent.com/larvalabs/cryptopunks/master/punks.png'))) unless File.exist?(@punk_file)
|
19
21
|
@punks = Punks::Image::Composite.read(@punk_file)
|
20
22
|
@zoom = 12
|
23
|
+
@palette = 'Standard'
|
21
24
|
|
22
25
|
observer = Glimmer::DataBinding::Observer.proc do
|
23
26
|
generate_image
|
24
27
|
end
|
25
28
|
observer.observe(self, :punk_index)
|
26
29
|
observer.observe(self, :zoom)
|
30
|
+
observer.observe(self, :palette)
|
27
31
|
|
28
32
|
create_gui
|
29
33
|
self.punk_index = 0
|
30
34
|
@root.open
|
31
35
|
end
|
32
36
|
|
37
|
+
def palette_options
|
38
|
+
PALETTES
|
39
|
+
end
|
40
|
+
|
33
41
|
def generate_image
|
34
|
-
image_location = File.join(@punk_directory, "punk-#{@punk_index}#{"x#{@zoom}" if @zoom.to_i > 1}.png")
|
42
|
+
image_location = File.join(@punk_directory, "punk-#{@punk_index}#{"x#{@zoom}" if @zoom.to_i > 1}#{"-#{@palette.downcase.gsub(' ', '_')}" if @palette != 'Standard'}.png")
|
35
43
|
puts "Writing punk image to #{image_location}"
|
36
44
|
selected_punk = @punks[@punk_index.to_i]
|
45
|
+
selected_punk = selected_punk.change_palette8bit(Palette8bit.const_get(@palette.gsub(' ', '_').upcase.to_sym)) if @palette != 'Standard'
|
37
46
|
selected_punk = selected_punk.zoom(@zoom.to_i)
|
38
47
|
selected_punk.save(image_location)
|
39
48
|
@image_label.image = image_location
|
@@ -69,6 +78,15 @@ class CryptopunksGui
|
|
69
78
|
text <=> [self, :zoom]
|
70
79
|
}
|
71
80
|
|
81
|
+
label {
|
82
|
+
text 'Palette:'
|
83
|
+
}
|
84
|
+
combobox {
|
85
|
+
# TODO (mirrored, grayscale, sepia, etc...)
|
86
|
+
readonly true # this applies to text editing only (item selection still triggers a write to model)
|
87
|
+
text <=> [self, :palette]
|
88
|
+
}
|
89
|
+
|
72
90
|
label {
|
73
91
|
text 'Output Location:'
|
74
92
|
}
|
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.2 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.2"
|
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]
|