shoes 4.0.0.pre11 → 4.0.0.pre12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/shoes-stub +8 -0
- data/lib/shoes/samples.rb +8 -0
- data/samples/README +122 -0
- data/samples/avatar.png +0 -0
- data/samples/blue-box.png +0 -0
- data/samples/class-book.yaml +387 -0
- data/samples/class_book.rb +46 -0
- data/samples/cy.png +0 -0
- data/samples/expert_definr.rb +24 -0
- data/samples/expert_funnies.rb +60 -0
- data/samples/expert_game_of_life.rb +224 -0
- data/samples/expert_irb.rb +109 -0
- data/samples/expert_minesweeper.rb +272 -0
- data/samples/expert_othello.rb +323 -0
- data/samples/expert_pong.rb +69 -0
- data/samples/expert_snake.rb +88 -0
- data/samples/expert_tankspank.rb +425 -0
- data/samples/expert_tetris.rb +322 -0
- data/samples/good_arc.rb +51 -0
- data/samples/good_bounce.rb +34 -0
- data/samples/good_clock.rb +55 -0
- data/samples/good_displace.rb +99 -0
- data/samples/good_follow.rb +27 -0
- data/samples/good_image_dl.rb +13 -0
- data/samples/good_potato_chopping.rb +23 -0
- data/samples/good_psychidelic_circles.rb +73 -0
- data/samples/good_reminder.rb +163 -0
- data/samples/good_vjot.rb +65 -0
- data/samples/lib/require_me.rb +6 -0
- data/samples/loogink.png +0 -0
- data/samples/menu-corner1.png +0 -0
- data/samples/menu-corner2.png +0 -0
- data/samples/menu-gray.png +0 -0
- data/samples/menu-left.png +0 -0
- data/samples/menu-right.png +0 -0
- data/samples/menu-top.png +0 -0
- data/samples/nks_booklist.rb +25 -0
- data/samples/nks_breadsticks.rb +8 -0
- data/samples/nks_dancing_circle.rb +14 -0
- data/samples/nks_dictionary.rb +24 -0
- data/samples/nks_edit_box.rb +5 -0
- data/samples/nks_edit_line.rb +7 -0
- data/samples/nks_notes.rb +16 -0
- data/samples/nks_poem.rb +23 -0
- data/samples/nks_self.rb +7 -0
- data/samples/nks_text_sizes.rb +11 -0
- data/samples/nks_trurl.rb +6 -0
- data/samples/potato_chopping/1258_s001.gif +0 -0
- data/samples/potato_chopping/1258_s002.gif +0 -0
- data/samples/potato_chopping/1258_s003.gif +0 -0
- data/samples/potato_chopping/1258_s004.gif +0 -0
- data/samples/potato_chopping/1258_s005.gif +0 -0
- data/samples/potato_chopping/1258_s006.gif +0 -0
- data/samples/potato_chopping/1258_s007.gif +0 -0
- data/samples/potato_chopping/1258_s008.gif +0 -0
- data/samples/potato_chopping/1258_s009.gif +0 -0
- data/samples/potato_chopping/1258_s010.gif +0 -0
- data/samples/potato_chopping/1258_s011.gif +0 -0
- data/samples/potato_chopping/1258_s012.gif +0 -0
- data/samples/potato_chopping/1258_s013.gif +0 -0
- data/samples/potato_chopping/1258_s014.gif +0 -0
- data/samples/potato_chopping/1258_s015.gif +0 -0
- data/samples/potato_chopping/1258_s016.gif +0 -0
- data/samples/potato_chopping/1258_s017.gif +0 -0
- data/samples/potato_chopping/1258_s018.gif +0 -0
- data/samples/potato_chopping/1258_s019.gif +0 -0
- data/samples/potato_chopping/1258_s020.gif +0 -0
- data/samples/potato_chopping/1258_s021.gif +0 -0
- data/samples/potato_chopping/1258_s022.gif +0 -0
- data/samples/potato_chopping/1258_s023.gif +0 -0
- data/samples/potato_chopping/1258_s024.gif +0 -0
- data/samples/potato_chopping/1258_s025.gif +0 -0
- data/samples/potato_chopping/1258_s026.gif +0 -0
- data/samples/potato_chopping/1258_s027.gif +0 -0
- data/samples/potato_chopping/1258_s028.gif +0 -0
- data/samples/potato_chopping/1258_s029.gif +0 -0
- data/samples/potato_chopping/1258_s030.gif +0 -0
- data/samples/potato_chopping/1258_s031.gif +0 -0
- data/samples/potato_chopping/1258_s032.gif +0 -0
- data/samples/potato_chopping/1258_s033.gif +0 -0
- data/samples/potato_chopping/1258_s034.gif +0 -0
- data/samples/potato_chopping/1258_s035.gif +0 -0
- data/samples/potato_chopping/1258_s036.gif +0 -0
- data/samples/potato_chopping/1258_s037.gif +0 -0
- data/samples/potato_chopping/1258_s038.gif +0 -0
- data/samples/potato_chopping/1258_s039.gif +0 -0
- data/samples/potato_chopping/1258_s040.gif +0 -0
- data/samples/potato_chopping/1258_s041.gif +0 -0
- data/samples/potato_chopping/1258_s042.gif +0 -0
- data/samples/potato_chopping/1258_s043.gif +0 -0
- data/samples/potato_chopping/1258_s044.gif +0 -0
- data/samples/potato_chopping/1258_s045.gif +0 -0
- data/samples/potato_chopping/1258_s046.gif +0 -0
- data/samples/potato_chopping/1258_s047.gif +0 -0
- data/samples/potato_chopping/1258_s048.gif +0 -0
- data/samples/potato_chopping/1258_s049.gif +0 -0
- data/samples/potato_chopping/1258_s050.gif +0 -0
- data/samples/potato_chopping/1258_s051.gif +0 -0
- data/samples/potato_chopping/1258_s052.gif +0 -0
- data/samples/potato_chopping/1258_s053.gif +0 -0
- data/samples/potato_chopping/1258_s054.gif +0 -0
- data/samples/potato_chopping/1258_s055.gif +0 -0
- data/samples/potato_chopping/1258_s056.gif +0 -0
- data/samples/potato_chopping/1258_s057.gif +0 -0
- data/samples/potato_chopping/1258_s058.gif +0 -0
- data/samples/potato_chopping/1258_s059.gif +0 -0
- data/samples/red-box.png +0 -0
- data/samples/shape_arc_to.rb +10 -0
- data/samples/simple-form.shy +0 -0
- data/samples/simple_accordion.rb +98 -0
- data/samples/simple_alert.rb +10 -0
- data/samples/simple_altered_para.rb +11 -0
- data/samples/simple_anim_shapes.rb +18 -0
- data/samples/simple_anim_text.rb +14 -0
- data/samples/simple_animate.rb +12 -0
- data/samples/simple_arc.rb +25 -0
- data/samples/simple_attach.rb +26 -0
- data/samples/simple_border_image.rb +9 -0
- data/samples/simple_borderless.rb +4 -0
- data/samples/simple_bounce.rb +27 -0
- data/samples/simple_breadsticks.rb +11 -0
- data/samples/simple_breadsticks2.rb +11 -0
- data/samples/simple_brightness_transitions.rb +16 -0
- data/samples/simple_button_animate.rb +17 -0
- data/samples/simple_buttons.rb +4 -0
- data/samples/simple_calc.rb +67 -0
- data/samples/simple_calc_2.rb +49 -0
- data/samples/simple_clipboard.rb +17 -0
- data/samples/simple_color_selector.rb +11 -0
- data/samples/simple_color_transitions.rb +12 -0
- data/samples/simple_concentric_circles.rb +9 -0
- data/samples/simple_console.rb +12 -0
- data/samples/simple_control_sizes.rb +25 -0
- data/samples/simple_count_and_draw.rb +19 -0
- data/samples/simple_curve.rb +34 -0
- data/samples/simple_dialogs.rb +33 -0
- data/samples/simple_dialogs_outside.rb +17 -0
- data/samples/simple_displace.rb +16 -0
- data/samples/simple_downloader.rb +29 -0
- data/samples/simple_draw.rb +16 -0
- data/samples/simple_editor.rb +30 -0
- data/samples/simple_face.rb +15 -0
- data/samples/simple_flashing.rb +22 -0
- data/samples/simple_flow_wrap.rb +12 -0
- data/samples/simple_font.rb +18 -0
- data/samples/simple_form.rb +30 -0
- data/samples/simple_fullscreen.rb +5 -0
- data/samples/simple_gradient_shapes.rb +23 -0
- data/samples/simple_guess_game.rb +30 -0
- data/samples/simple_image_as_stroke.rb +22 -0
- data/samples/simple_image_fill.rb +13 -0
- data/samples/simple_image_stroke.rb +13 -0
- data/samples/simple_info.rb +10 -0
- data/samples/simple_iterated_content.rb +8 -0
- data/samples/simple_keypress.rb +15 -0
- data/samples/simple_logo_display.rb +15 -0
- data/samples/simple_loogink_cy.rb +33 -0
- data/samples/simple_lorem_ipsum.rb +19 -0
- data/samples/simple_manual.rb +5 -0
- data/samples/simple_menu.rb +42 -0
- data/samples/simple_mouse_follow.rb +9 -0
- data/samples/simple_oval.rb +6 -0
- data/samples/simple_polygon_line.rb +19 -0
- data/samples/simple_position_as_we_go.rb +10 -0
- data/samples/simple_progress_bar.rb +15 -0
- data/samples/simple_random_bubbles.rb +15 -0
- data/samples/simple_require.rb +9 -0
- data/samples/simple_sample_executor.rb +7 -0
- data/samples/simple_sample_executor_all.rb +14 -0
- data/samples/simple_sesame_street_shoes.rb +6 -0
- data/samples/simple_shoes_intro.rb +22 -0
- data/samples/simple_slide.rb +57 -0
- data/samples/simple_stack_flow_buttons.rb +16 -0
- data/samples/simple_stripes.rb +9 -0
- data/samples/simple_system_background.rb +5 -0
- data/samples/simple_text_movement.rb +8 -0
- data/samples/simple_tictactoe.rb +224 -0
- data/samples/simple_timer.rb +16 -0
- data/samples/simple_translate.rb +10 -0
- data/samples/simple_visibility.rb +20 -0
- metadata +186 -7
data/samples/loogink.png
ADDED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
class BookList < Shoes
|
3
|
+
url '/', :index
|
4
|
+
url '/twain', :twain
|
5
|
+
url '/kv', :vonnegut
|
6
|
+
|
7
|
+
def index
|
8
|
+
para "Books I've read: ",
|
9
|
+
link("by Mark Twain", click: "/twain"),
|
10
|
+
link("by Kurt Vonnegut", click: "/kv")
|
11
|
+
end
|
12
|
+
|
13
|
+
def twain
|
14
|
+
para "Just Huck Finn.\n",
|
15
|
+
link("Go back.", click: "/")
|
16
|
+
end
|
17
|
+
|
18
|
+
def vonnegut
|
19
|
+
para "Cat's Cradle. Sirens of Titan. ",
|
20
|
+
"Breakfast of Champions.\n",
|
21
|
+
link("Go back.", click: "/")
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
Shoes.app width: 400, height: 500
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
Shoes.app do
|
3
|
+
@o = oval top: 0, left: 0,
|
4
|
+
radius: 40
|
5
|
+
|
6
|
+
stack margin: 40 do
|
7
|
+
title "Dancing With a Circle"
|
8
|
+
subtitle "How graceful and round."
|
9
|
+
end
|
10
|
+
|
11
|
+
motion do |x, y|
|
12
|
+
@o.move width - x, height - y
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
class Dictionary < Shoes
|
3
|
+
url '/', :index
|
4
|
+
url '/(\w+)', :word
|
5
|
+
|
6
|
+
def index
|
7
|
+
stack do
|
8
|
+
title "Enter a Word"
|
9
|
+
@word = edit_line
|
10
|
+
button "OK" do
|
11
|
+
visit "/#{@word.text}"
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def word(string)
|
17
|
+
stack do
|
18
|
+
para "No definition found for #{string}. ",
|
19
|
+
"Sorry this doesn't actually work."
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
Shoes.app
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
Shoes.app do
|
3
|
+
stack margin: 20, width: 250 do
|
4
|
+
subtitle "Shoes Notebook"
|
5
|
+
para "Add a note."
|
6
|
+
@add = edit_line
|
7
|
+
|
8
|
+
button "Save" do
|
9
|
+
@notes.append do
|
10
|
+
para @add.text, " ", link("delete") { |x| x.parent.remove }
|
11
|
+
end
|
12
|
+
@add.text = ""
|
13
|
+
end
|
14
|
+
end
|
15
|
+
@notes = stack margin: 20, width: -250
|
16
|
+
end
|
data/samples/nks_poem.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
Shoes.app width: 280, height: 350 do
|
3
|
+
flow width: 280, margin: 10 do
|
4
|
+
stack width: "100%" do
|
5
|
+
banner "A POEM"
|
6
|
+
end
|
7
|
+
stack width: "80px" do
|
8
|
+
para "Goes like:"
|
9
|
+
end
|
10
|
+
stack width: "-90px" do
|
11
|
+
para "the sun.\n",
|
12
|
+
"a lemon.\n",
|
13
|
+
"the goalie.\n",
|
14
|
+
"a fireplace.\n",
|
15
|
+
"i want to write\n",
|
16
|
+
"a poem for the\n",
|
17
|
+
"kids who haven't\n",
|
18
|
+
"even heard one yet.\n\n",
|
19
|
+
"and the goalie guards\n",
|
20
|
+
"the fireplace"
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/samples/nks_self.rb
ADDED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/samples/red-box.png
ADDED
Binary file
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
Shoes.app do
|
3
|
+
shape do
|
4
|
+
move_to(90, 55)
|
5
|
+
arc_to(50, 55, 50, 20, 0, Shoes::PI / 2)
|
6
|
+
arc_to(50, 55, 60, 60, Shoes::PI / 2, Shoes::PI)
|
7
|
+
arc_to(50, 55, 70, 70, Shoes::PI, Shoes::TWO_PI - Shoes::PI / 2)
|
8
|
+
arc_to(50, 55, 80, 80, Shoes::TWO_PI - Shoes::PI / 2, Shoes::TWO_PI)
|
9
|
+
end
|
10
|
+
end
|
Binary file
|
@@ -0,0 +1,98 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module Accordion
|
3
|
+
OPEN_HEIGHT = 240
|
4
|
+
|
5
|
+
def open_page(stack)
|
6
|
+
if stack.height >= OPEN_HEIGHT
|
7
|
+
zero_other_pages(stack)
|
8
|
+
return
|
9
|
+
end
|
10
|
+
|
11
|
+
a = animate 60 do
|
12
|
+
stack.height += 20
|
13
|
+
decrement_other_pages(stack)
|
14
|
+
a.stop if stack.height >= OPEN_HEIGHT
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def other_pages(stack)
|
19
|
+
@pages.reject { |page| page == stack }
|
20
|
+
.reject { |page| page.height <= 0 }
|
21
|
+
end
|
22
|
+
|
23
|
+
def zero_other_pages(stack)
|
24
|
+
other_pages(stack).each do |page|
|
25
|
+
page.height = 0
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def decrement_other_pages(stack)
|
30
|
+
other_pages(stack).each do |page|
|
31
|
+
page.height -= [page.height, 20].min
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def page(title, active, text)
|
36
|
+
@pages ||= []
|
37
|
+
stack do
|
38
|
+
page_text = nil
|
39
|
+
header = stack width: "100%" do
|
40
|
+
background "#fff".."#eed"
|
41
|
+
hi = background "#ddd".."#ba9", hidden: true
|
42
|
+
para link(title) {}, size: 26
|
43
|
+
hover { hi.show }
|
44
|
+
leave { hi.hide }
|
45
|
+
end
|
46
|
+
|
47
|
+
height = active ? OPEN_HEIGHT : 0
|
48
|
+
page_text = stack width: "100%", height: height do
|
49
|
+
para text
|
50
|
+
end
|
51
|
+
@pages << page_text
|
52
|
+
|
53
|
+
header.click do
|
54
|
+
open_page(page_text)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
Shoes.app do
|
61
|
+
extend Accordion
|
62
|
+
style(Shoes::Link, stroke: black, underline: nil, weight: "strong")
|
63
|
+
style(Shoes::LinkHover, stroke: black, fill: nil, underline: nil)
|
64
|
+
|
65
|
+
page "0.0", true, <<-'END'
|
66
|
+
There is a thought
|
67
|
+
I have just had
|
68
|
+
Which I don’t care to pass to
|
69
|
+
Anyone at all at this time.
|
70
|
+
|
71
|
+
I have even forgotten it now,
|
72
|
+
But kept only the pleasures
|
73
|
+
Of my property
|
74
|
+
And of my controlled mental slippage.
|
75
|
+
END
|
76
|
+
page "0.1", false, <<-'END'
|
77
|
+
My eyes have blinked again
|
78
|
+
And I have just realized
|
79
|
+
This upright world
|
80
|
+
I have been in.
|
81
|
+
|
82
|
+
My eyelids wipe
|
83
|
+
My eyes hundreds of times
|
84
|
+
Reseting and renovating
|
85
|
+
The scenery.
|
86
|
+
END
|
87
|
+
page "0.2", false, <<-'END'
|
88
|
+
Sister, without you,
|
89
|
+
The universe would
|
90
|
+
Have such a hole through it,
|
91
|
+
Where infinity has been shot.
|
92
|
+
|
93
|
+
This cannot be, though.
|
94
|
+
There will always be room
|
95
|
+
For you—all of us are
|
96
|
+
Holding the way open.
|
97
|
+
END
|
98
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
Shoes.app do
|
3
|
+
para "Click somewhere"
|
4
|
+
click do
|
5
|
+
# Earlier versions had trouble because para would get drawn while the
|
6
|
+
# alert was up, but before it got positioned. Make sure we don't regress.
|
7
|
+
para 'hahahahaha destroy everything'
|
8
|
+
alert 'muhhh'
|
9
|
+
end
|
10
|
+
end
|