atome 0.5.7.3.6 → 0.5.7.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1 -1
  3. data/documentation/deep learning/architecture.txt +4 -4
  4. data/documentation/deep learning/basic_infos.txt +2 -2
  5. data/documentation/deep learning/example_of_users_code.rb +43 -43
  6. data/documentation/installation/buiding_atome.md +2 -2
  7. data/lib/atome/atome.rb +24 -56
  8. data/lib/atome/extensions/atome.rb +31 -77
  9. data/lib/atome/extensions/sha.rb +7 -7
  10. data/lib/atome/genesis/atomes.rb +1 -1
  11. data/lib/atome/genesis/genesis.rb +6 -95
  12. data/lib/atome/genesis/particles/communication.rb +1 -1
  13. data/lib/atome/genesis/particles/event.rb +0 -8
  14. data/lib/atome/genesis/particles/geometry.rb +3 -4
  15. data/lib/atome/genesis/particles/hierarchy.rb +28 -27
  16. data/lib/atome/genesis/particles/identity.rb +0 -30
  17. data/lib/atome/genesis/particles/material.rb +13 -12
  18. data/lib/atome/genesis/particles/property.rb +41 -16
  19. data/lib/atome/genesis/particles/security.rb +0 -45
  20. data/lib/atome/genesis/particles/utility.rb +77 -137
  21. data/lib/atome/genesis/sparkle.rb +3 -12
  22. data/lib/atome/kernel/black_matter.rb +2 -0
  23. data/lib/atome/kernel/universe.rb +5 -45
  24. data/lib/atome/presets/atome.rb +0 -22
  25. data/lib/atome/utilities/utilities.rb +19 -8
  26. data/lib/atome/version.rb +2 -1
  27. data/lib/molecules/init.rb +0 -14
  28. data/lib/molecules/intuition/tools.rb +24 -43
  29. data/lib/molecules/intuition/utilities.rb +261 -135
  30. data/lib/platform_specific/opal/atome_opal_extensions.rb +0 -1
  31. data/lib/platform_specific/opal/extensions/color.rb +0 -5
  32. data/lib/platform_specific/opal/extensions/geolocation.rb +5 -5
  33. data/lib/platform_specific/opal/extensions/object.rb +1 -1
  34. data/lib/platform_specific/opal/extensions/ping.rb +11 -20
  35. data/lib/renderers/html/effect.rb +0 -11
  36. data/lib/renderers/html/event.rb +0 -7
  37. data/lib/renderers/html/geometry.rb +0 -31
  38. data/lib/renderers/html/html.rb +32 -128
  39. data/lib/renderers/html/material.rb +0 -22
  40. data/lib/renderers/html/spatial.rb +0 -9
  41. data/lib/renderers/html/utility.rb +5 -8
  42. data/lib/renderers/renderer.rb +0 -1
  43. data/vendor/assets/application/examples/account.rb +35 -0
  44. data/vendor/assets/application/examples/actor&role.rb +23 -0
  45. data/vendor/assets/application/examples/animation.rb +1 -1
  46. data/vendor/assets/application/examples/applications.rb +26 -77
  47. data/vendor/assets/application/examples/atome.rb +1 -1
  48. data/vendor/assets/application/examples/attach.rb +7 -7
  49. data/vendor/assets/application/examples/attached.rb +13 -15
  50. data/vendor/assets/application/examples/basic_understanding.rb +1 -1
  51. data/vendor/assets/application/examples/buttons.rb +48 -0
  52. data/vendor/assets/application/examples/clear.rb +12 -12
  53. data/vendor/assets/application/examples/clones&monitoring.rb +1 -1
  54. data/vendor/assets/application/examples/delete.rb +19 -14
  55. data/vendor/assets/application/examples/detach.rb +8 -0
  56. data/vendor/assets/application/examples/dig.rb +1 -1
  57. data/vendor/assets/application/examples/display.rb +6 -6
  58. data/vendor/assets/application/examples/drag.rb +1 -1
  59. data/vendor/assets/application/examples/duplicate.rb +6 -6
  60. data/vendor/assets/application/examples/exchange.rb +17 -0
  61. data/vendor/assets/application/examples/generator_and_build.rb +3 -3
  62. data/vendor/assets/application/examples/hierarchy.rb +5 -5
  63. data/vendor/assets/application/examples/layout.rb +1 -1
  64. data/vendor/assets/application/examples/preset.rb +3 -3
  65. data/vendor/assets/application/examples/selected.rb +1 -1
  66. data/vendor/assets/application/examples/shapes.rb +1 -1
  67. data/vendor/assets/application/examples/size.rb +1 -1
  68. data/vendor/assets/application/examples/test.rb +0 -320
  69. data/vendor/assets/application/examples/tools.rb +136 -192
  70. data/vendor/assets/application/examples/unfasten.rb +23 -0
  71. data/vendor/assets/application/index.rb +1 -1
  72. data/vendor/assets/server/atome_server.rb +1 -0
  73. data/vendor/assets/server/capture.rb +0 -1
  74. data/vendor/assets/server/database.rb +0 -1
  75. data/vendor/assets/server/eDen.rb +16 -94
  76. data/vendor/assets/src/index_server_wasm.html +1 -0
  77. data/vendor/assets/src/index_wasm.html +0 -6
  78. data/vendor/assets/src/js/atome/specific/wasm.js +22 -4
  79. data/vendor/assets/src/js/third_parties/three.min.js +1 -1
  80. data/vendor/assets/src/medias/fonts/Roboto/LICENSE.txt +1 -1
  81. data/vendor/assets/src/medias/fonts/Roboto_Slab/LICENSE.txt +1 -1
  82. metadata +8 -6
  83. data/lib/molecules/_deprecated_examples/site.rb +0 -34
  84. data/lib/molecules/intuition/_deprecated_inputs.rb +0 -111
  85. data/lib/molecules/intuition/_deprecated_toolbox.rb +0 -282
  86. data/lib/platform_specific/opal/extensions/sha.rb +0 -25
@@ -6,7 +6,7 @@ b = box({ color: :red, id: :the_box, left: 3 })
6
6
  b.duplicate({ left: b.left + index * (width_found + 45), top: 0, category: :custom_category })
7
7
  end
8
8
 
9
- grab(:view).attached.each do |atome_found|
9
+ grab(:view).fasten.each do |atome_found|
10
10
  grab(atome_found).selected(true)
11
11
  end
12
12
  grab(:the_box_copy_1).text(:hello)
@@ -7,7 +7,7 @@
7
7
  my_box=box
8
8
  # using the code line above a lot of particles will be implicitly created, if we inspect my_box
9
9
  puts my_box.inspect # this will print :
10
- #[Log] #<Atome: @broadcast={}, @callback={}, @tag={}, @attached=[], @unit={}, @collected={}, @id=:box_14, @type=:shape, @html=#<HTML:0x0662a164 @element=[object HTMLDivElement], @id="box_14", @original_atome=#<Atome: @broadcast={}, @callback={}, @tag={}, @attached=[], @unit={}, @collected={}, @id=:box_14, @type=:shape, @html=#<HTML:0x0662a164 ...>, @attach=[:view], @renderers=[:html], @width=99, @height=99, @apply=[:box_color], @left=100, @top=100, @clones=[], @preset={:box=>{:width=>99, :height=>99, :apply=>[:box_color], :left=>100, :top=>100, :clones=>[]}}>, @element_type="div">, @attach=[:view], @renderers=[:html], @width=99, @height=99, @apply=[:box_color], @left=100, @top=100, @clones=[], @preset={:box=>{:width=>99, :height=>99, :apply=>[:box_color], :left=>100, :top=>100, :clones=>[]}}> (browser.script.iife.min.js, line 13)
10
+ #[Log] #<Atome: @broadcast={}, @callback={}, @tag={}, @fasten=[], @unit={}, @collected={}, @id=:box_14, @type=:shape, @html=#<HTML:0x0662a164 @element=[object HTMLDivElement], @id="box_14", @original_atome=#<Atome: @broadcast={}, @callback={}, @tag={}, @fasten=[], @unit={}, @collected={}, @id=:box_14, @type=:shape, @html=#<HTML:0x0662a164 ...>, @attach=[:view], @renderers=[:html], @width=99, @height=99, @apply=[:box_color], @left=100, @top=100, @clones=[], @preset={:box=>{:width=>99, :height=>99, :apply=>[:box_color], :left=>100, :top=>100, :clones=>[]}}>, @element_type="div">, @attach=[:view], @renderers=[:html], @width=99, @height=99, @apply=[:box_color], @left=100, @top=100, @clones=[], @preset={:box=>{:width=>99, :height=>99, :apply=>[:box_color], :left=>100, :top=>100, :clones=>[]}}> (browser.script.iife.min.js, line 13)
11
11
 
12
12
  # please note that an ID is automatically created using a simple strategy id : atome_type_total_number_of_users_atomes ex here : @id="box_14"
13
13
 
@@ -18,7 +18,7 @@ puts " my_box preset is : #{my_box.preset}"
18
18
 
19
19
  c=circle
20
20
  puts " c is : #{c.inspect }"
21
- # this print : [Log] c is : #<Atome: @type=:shape, @smooth="100%", @width=99, @id=:circle_16, @renderers=[:html], @height=99, @broadcast={}, @callback={}, @tag={}, @attached=[], @unit={}, @collected={}, @html=#<HTML:0x06579be8 @element=[object HTMLDivElement], @id="circle_16", @original_atome=#<Atome: @type=:shape, @smooth="100%", @width=99, @id=:circle_16, @renderers=[:html], @height=99, @broadcast={}, @callback={}, @tag={}, @attached=[], @unit={}, @collected={}, @html=#<HTML:0x06579be8 ...>, @top=100, @attach=[:view], @left=100, @apply=[:circle_color], @clones=[], @preset={:circle=>{:width=>99, :height=>99, :smooth=>"100%", :apply=>[:circle_color], :left=>100, :top=>100, :clones=>[]}}>, @element_type="div">, @top=100, @attach=[:view], @left=100, @apply=[:circle_color], @clones=[], @preset={:circle=>{:width=>99, :height=>99, :smooth=>"100%", :apply=>[:circle_color], :left=>100, :top=>100, :clones=>[]}}> (browser.script.iife.min.js, line 13)
21
+ # this print : [Log] c is : #<Atome: @type=:shape, @smooth="100%", @width=99, @id=:circle_16, @renderers=[:html], @height=99, @broadcast={}, @callback={}, @tag={}, @fasten=[], @unit={}, @collected={}, @html=#<HTML:0x06579be8 @element=[object HTMLDivElement], @id="circle_16", @original_atome=#<Atome: @type=:shape, @smooth="100%", @width=99, @id=:circle_16, @renderers=[:html], @height=99, @broadcast={}, @callback={}, @tag={}, @fasten=[], @unit={}, @collected={}, @html=#<HTML:0x06579be8 ...>, @top=100, @attach=[:view], @left=100, @apply=[:circle_color], @clones=[], @preset={:circle=>{:width=>99, :height=>99, :smooth=>"100%", :apply=>[:circle_color], :left=>100, :top=>100, :clones=>[]}}>, @element_type="div">, @top=100, @attach=[:view], @left=100, @apply=[:circle_color], @clones=[], @preset={:circle=>{:width=>99, :height=>99, :smooth=>"100%", :apply=>[:circle_color], :left=>100, :top=>100, :clones=>[]}}> (browser.script.iife.min.js, line 13)
22
22
  # it's pôssible to alter basic preset using the particle .preset
23
23
  my_box.preset({ circle: {type: :shape, :width=>99, :height=>99, :smooth=>"100%", color: :red, :left=>100, :top=>100 }})
24
24
  puts " my_box preset is now : #{my_box.preset}"
@@ -29,5 +29,5 @@ my_box.touch(true) do
29
29
 
30
30
  new_circle=circle # as the preset circle has been modified tha circle is now red as specified in the updated preset
31
31
  puts "new_circle is : #{new_circle.inspect}"
32
- # this print : new_circle is : #<Atome: @type=:shape, @smooth="100%", @width=99, @id=:circle_18, @renderers=[:html], @height=99, @broadcast={}, @callback={}, @tag={}, @attached=[], @unit={}, @collected={}, @html=#<HTML:0x0664e99c @element=[object HTMLDivElement], @id="circle_18", @original_atome=#<Atome: @type=:shape, @smooth="100%", @width=99, @id=:circle_18, @renderers=[:html], @height=99, @broadcast={}, @callback={}, @tag={}, @attached=[], @unit={}, @collected={}, @html=#<HTML:0x0664e99c ...>, @top=100, @attach=[:box_14], @left=100, @apply=[:circle_18_color_1_0_0_0_0_0____], @clones=[]>, @element_type="div">, @top=100, @attach=[:box_14], @left=100, @apply=[:circle_18_color_1_0_0_0_0_0____], @clones=[]>
32
+ # this print : new_circle is : #<Atome: @type=:shape, @smooth="100%", @width=99, @id=:circle_18, @renderers=[:html], @height=99, @broadcast={}, @callback={}, @tag={}, @fasten=[], @unit={}, @collected={}, @html=#<HTML:0x0664e99c @element=[object HTMLDivElement], @id="circle_18", @original_atome=#<Atome: @type=:shape, @smooth="100%", @width=99, @id=:circle_18, @renderers=[:html], @height=99, @broadcast={}, @callback={}, @tag={}, @fasten=[], @unit={}, @collected={}, @html=#<HTML:0x0664e99c ...>, @top=100, @attach=[:box_14], @left=100, @apply=[:circle_18_color_1_0_0_0_0_0____], @clones=[]>, @element_type="div">, @top=100, @attach=[:box_14], @left=100, @apply=[:circle_18_color_1_0_0_0_0_0____], @clones=[]>
33
33
  end
@@ -28,7 +28,7 @@
28
28
  # t.touch(true) do
29
29
  # puts "1 current_user - #{grab(Universe.current_user).selection}"
30
30
  # puts "1 - b selected : #{b.selected}"
31
- # grab(:view).attached.each do |atome_found|
31
+ # grab(:view).fasten.each do |atome_found|
32
32
  # grab(atome_found).selected(true)
33
33
  # end
34
34
  # puts "2 - current_user : #{grab(Universe.current_user).selection}"
@@ -2,5 +2,5 @@
2
2
 
3
3
  shape(
4
4
  { renderers: [:html], id: :my_test_box, type: :shape, apply: [:shape_color],
5
- left: 120, top: 0, width: 100, smooth: 15, height: 100, overflow: :visible, attached: [], center: true
5
+ left: 120, top: 0, width: 100, smooth: 15, height: 100, overflow: :visible, fasten: [], center: true
6
6
  })
@@ -7,7 +7,7 @@ b.circle({ color: :yellow, width: 55, height: 88, left: 500 })
7
7
  b.box
8
8
 
9
9
  wait 1 do
10
- # recursive apply the new size to all attached atomes recursively
10
+ # recursive apply the new size to all fasten atomes recursively
11
11
  # reference : change the size according the to wanted axis
12
12
  c.size({value: 50, recursive: true, reference: :y })
13
13
  end
@@ -1,321 +1 @@
1
1
  # frozen_string_literal: true
2
- # wait 0.5 do
3
- # JS.eval("console.clear()")
4
- # end
5
- ########################### Test check and verification below ############################
6
-
7
- new({ tool: :combined }) do |params|
8
-
9
- active_code = lambda {
10
- puts :alteration_tool_code_activated
11
- }
12
-
13
- inactive_code = lambda { |param|
14
- puts :alteration_tool_code_inactivated
15
- }
16
- pre_code = lambda { |params|
17
- puts "pre_creation_code,atome_touched: #{:params}"
18
-
19
- }
20
- post_code = lambda { |params|
21
- puts "post_creation_code,atome_touched: #{:params}"
22
-
23
- }
24
-
25
- zone_spe = lambda { |current_tool|
26
- # puts "current tool is : #{:current_tool} now creating specific zone"
27
- # b = box({ width: 33, height: 12 })
28
- # b.text({ data: :all })
29
-
30
- }
31
-
32
- {
33
- activation: active_code,
34
- inactivation: inactive_code,
35
- alteration: { width: 22, blur: 3 },
36
- pre: pre_code,
37
- post: post_code,
38
- zone: zone_spe,
39
- icon: :color,
40
- int8: { french: :couleur, english: :color, german: :colorad } }
41
-
42
- end
43
-
44
- new({ tool: :box }) do |params|
45
-
46
- active_code = lambda {
47
- puts :creation_tool_code_activated
48
- }
49
-
50
- inactive_code = lambda { |atomes_treated|
51
- puts :creation_tool_code_inactivated
52
-
53
- }
54
- pre_creation_code = lambda { |params|
55
- puts "pre_creation_code : atome_touched : #{:params} "
56
-
57
- }
58
-
59
- post_creation_code = lambda { |params|
60
- puts "post_creation_code,atome_touched: #{:params}"
61
- }
62
-
63
- { creation: { box: { color: :blue, width: 66, height: 66 } },
64
- activation: active_code,
65
- inactivation: inactive_code,
66
- pre: pre_creation_code,
67
- post: post_creation_code,
68
- int8: { french: :formes, english: :shape, german: :jesaispas } }
69
-
70
- end
71
-
72
- new({ tool: :project }) do
73
- active_code = lambda {
74
-
75
- alert :get_projects_now
76
- # if Atome.selection.instance_of? Array
77
- # end
78
- # Atome.selection.each do |atome_id_to_treat|
79
- # # # # reinit first to avoid multiple drag event
80
- # # # grab(atome_id_to_treat).drag(false)
81
- # end
82
- # drag_remove
83
- # puts :alteration_tool_code_activated
84
- }
85
- { activation: active_code }
86
- end
87
-
88
- new({ tool: :move }) do
89
- active_code = lambda {
90
- puts 'move activated1'
91
- }
92
- move_code = lambda {
93
- drag(true)
94
- }
95
- inactive_code = lambda { |data|
96
- data[:treated].each do |atome_f|
97
- atome_f.drag(false)
98
- end
99
- }
100
-
101
- { activation: active_code,
102
- alteration: { event: move_code },
103
- inactivation: inactive_code}
104
- end
105
-
106
- new({ tool: :drag }) do
107
- active_code = lambda {
108
- puts 'move activated2'
109
- }
110
- move_code = lambda {
111
- drag(true) do
112
- puts left
113
- end
114
- }
115
-
116
- { activation: active_code, alteration: { event: move_code } }
117
- end
118
-
119
- new({ tool: :touch }) do
120
- move_code = lambda {
121
- touch(:down) do
122
- color(:red)
123
- end
124
- }
125
- { alteration: { event: move_code } }
126
- end
127
-
128
- new({ tool: :toolbox1 }) do
129
- active_code = lambda {
130
- toolbox({ tools: [:combined], toolbox: { orientation: :ew, left: 90, bottom: 9, spacing: 9 } })
131
- }
132
- { activation: active_code }
133
- end
134
-
135
- new({ tool: :color }) do
136
- active_code = lambda {
137
- puts 'color activated1'
138
- }
139
- color_code = lambda {
140
- # color(:green)
141
- # tools_values
142
- }
143
- inactive_code = lambda { |data|
144
- data[:treated].each do |atome_f|
145
- # atome_f.drag(false)
146
- # atome_f.color(:green)
147
- end
148
- }
149
-
150
- { activation: active_code,
151
- alteration: { event: color_code },
152
- inactivation: inactive_code,
153
- target: :color,
154
- particles: { red: 0, green: 0.5, blue: 1, alpha: 1 }}
155
- end
156
-
157
- # Universe.tools_root= {tools: [:blur, :box, :test, :toolbox1],toolbox: { orientation: :ew, left:90 , bottom: 9, spacing: 9} }
158
- Universe.tools_root = {id: :root_tools, tools: [:box, :drag, :touch,:color, :move, :toolbox1], toolbox: { orientation: :ew, left: 9, bottom: 9, spacing: 9 } }
159
- puts "above we added an id because each tool may be in many toolbox and have an uniq ID"
160
- Atome.init_intuition
161
-
162
- b = box({ id: :the_test__box, selected: true })
163
- circle({ left: 90, id: :the_test_circle, selected: true })
164
- b.touch(true) do
165
- if b.width == 170
166
- b.width(55)
167
- else
168
- b.width(170)
169
- end
170
-
171
- end
172
-
173
- # box({id: :the_box})
174
- # circle({left: 90, id: :the_circle})
175
- # alert b.aid
176
-
177
- # b=box
178
- #
179
- # active_code = lambda {
180
- # b=grab(:view).circle({color: :red, left: 88})
181
- # b.touch(true) do
182
- # alert :kool
183
- # end
184
- # }
185
- # b.touch(true) do
186
- # # c=circle({color: :red})
187
- # active_code.call
188
- # # c.touch(true) do
189
- # # # active_code.call
190
- # # end
191
- # end
192
-
193
- # ################### check below
194
-
195
- # b = box({ left: 123, top: 66, selected: false, id: :the_box, color: :green })
196
- # b.touch(:down) do
197
- # puts " on touch : #{Universe.allow_localstorage}"
198
- # end
199
- # b.resize(true) do
200
- # puts :good!
201
- # end
202
- # the_circ = circle({ left: 123, top: 120, selected: false, id: :the_circle })
203
- #
204
- # the_circ.touch(:down) do |params|
205
- # puts " down : params: #{params}, id: #{the_circ.id}"
206
- # end
207
- #
208
- # the_circ.touch(:up) do
209
- # puts "up :kool"
210
- # end
211
- # the_circ.drag(true) do
212
- # puts "drag : now"
213
- # end
214
- #
215
- # bb = box({ left: 333, width: 120, selected: false, id: :big_box })
216
- #
217
- # b = box({ id: :the_big_boxy })
218
-
219
- #################@
220
- # text({ data: :hello, selected: true, left: 120, id: :texting, blur: 12 })
221
- # text({data: :hello, left: 120, id: :texting})
222
- # Universe.tools.each_with_index do |(tool_name, bloc), index|
223
- # Atome.instance_exec(&bloc) if bloc.is_a?(Proc)
224
- # # alert "#{tool_name} : #{tool_content}"
225
- # # alert b.id
226
- # end
227
-
228
- # wait 2 do
229
- # # c.preset( {:box=>{:width=>39, :height=>39, :apply=>[:box_color], :left=>0, :top=>0}} )
230
- # c.preset( :box )
231
- # end
232
- # b=box({left: 333, top: 333})
233
- # b.touch(true) do
234
- # alert Atome.selection
235
- # end
236
- # grab(:the_texting).color(:white)
237
- # grab(:the_texting).left(33)
238
- # grab(:the_texting).top(133)
239
- # grab(:the_texting).width(133)
240
- # grab(:the_texting).top(133)
241
- # grab(:the_texting).data(:kool)
242
- # grab(:the_texting).type(:text)
243
- # grab(:the_texting).rotate(:text)
244
-
245
- # b=box
246
- # b.touch(true) do
247
- # puts :ok
248
- # # alert b.instance_variable_get('@touch')
249
- # # alert b.instance_variable_get('@touch_code')
250
- # b.touch(false)
251
- # wait 3 do
252
- # puts :ready
253
- # b.touch(true) do
254
- # puts :kool
255
- # end
256
- # # alert b.touch
257
- # # alert b.instance_variable_get('@touch')
258
- # # alert b.instance_variable_get('@touch_code')
259
- # end
260
- # end
261
-
262
- # A.html.record
263
-
264
- # A.html.record
265
-
266
- # edition = "M257.7 752c2 0 4-0.2 6-0.5L431.9 722c2-0.4 3.9-1.3 5.3-2.8l423.9-423.9c3.9-3.9 3.9-10.2 0-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2c-1.9 11.1 1.5 21.9 9.4 29.8 6.6 6.4 14.9 9.9 23.8 9.9z m67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z"
267
- #
268
- # v = vector({left: 99, data: { path: { d: edition, id: :p1, stroke: :black, 'stroke-width' => 37, fill: :red } } })
269
- # v2 = vector({top: 66,data: { circle: { cx: 300, cy: 300, r: 340, id: :p2, stroke: :blue, 'stroke-width' => 35, fill: :yellow } } } )
270
- # wait 1 do
271
- # v.color(:blue)
272
- # wait 1 do
273
- # v2.color(:blue)
274
- # end
275
- # end
276
-
277
- s = box({ color: :red, left: 123, top: 123 })
278
- # tap event content :
279
- # 1. Common Properties:
280
- # • target: The element that is being interacted with.
281
- # • interaction: The Interaction object that the event belongs to.
282
- # • x0, y0: The page coordinates where the interaction started.
283
- # • clientX0, clientY0: The client coordinates where the interaction started.
284
- # • dx, dy: The change in coordinates since the last event.
285
- # • velocityX, velocityY: The velocity of the pointer.
286
- # • speed: The speed of the pointer.
287
- # • timeStamp: The time when the event was created.
288
- # 2. Tap Specific Properties:
289
- # • pointerId: The identifier of the pointer used for the tap.
290
- # • pageX, pageY: The X and Y coordinates of the event relative to the page.
291
- # • clientX, clientY: The X and Y coordinates of the event relative to the viewport.
292
-
293
- s.touch(true) do |event|
294
- x_pos = event[:clientX]
295
- { left: '20', alert: 'hello! and big bisous!!, position : ' + x_pos.to_s }
296
-
297
- end
298
- s.remove(:box_color)
299
- ####### empty local storage :
300
- JS.eval("localStorage.clear();")
301
- ############## soluce below
302
-
303
- # def verif(val, &pro)
304
- # datas= pro.call(val)
305
- # alert datas.delete(:left)
306
- # datas.each do |k,v|
307
- # send(k,v)
308
- # end
309
- # end
310
- #
311
- # verif(val=33) do |var|
312
- # # puts left = '20' + var.to_s
313
- # {left: '20' + var.to_s, alert: 'hello! and big bisous!!'}
314
- # end
315
-
316
-
317
- b=box
318
- b.touch({tap: true}) do
319
- alert :hello
320
- end
321
-