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
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ bbb = box({left: 66})
4
+ ccc = bbb.circle(id: :the_circle)
5
+
6
+ bbb.role(:first)
7
+ bbb.role(:second)
8
+ bbb.delete(:left)
9
+ bbb.delete(:role)
10
+
11
+ bbb.role(:fourth)
12
+ bbb.role(:five)
13
+ bbb.role({ remove: :last })
14
+
15
+ bbb.actor({ the_circle: :buttons })
16
+ bbb.actor({ the_circle: :dummy })
17
+ bbb.actor({ the_circle: :menu })
18
+
19
+ bbb.actor({ remove: { the_circle: :dummy } })
20
+
21
+ puts "1 ===> #{bbb.role}"
22
+ puts "2 ===> #{bbb.actor}"
23
+ puts "3 ===> #{ccc.role}"
@@ -10,7 +10,7 @@
10
10
  # red: 0, green: 0, blue: 0, alpha: 1
11
11
  # })
12
12
  #
13
- # Atome.new(animation: { renderers: [:browser], id: :the_animation1, type: :animation, attach: [],attached: []})
13
+ # Atome.new(animation: { renderers: [:browser], id: :the_animation1, type: :animation, attach: [],fasten: []})
14
14
  # aa = animation({
15
15
  # targets: %i[my_box the_circle],
16
16
  # begin: {
@@ -1,11 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
-
4
3
  a = application({
5
4
  id: :arp,
6
5
  margin: 3,
7
- # circle: { id: :test, color: :red },
8
- menu: { width: 220, height: 33, depth: 333, color: :black },
6
+ spacing: 6
9
7
  })
10
8
 
11
9
  page1_code = lambda do |back|
@@ -17,10 +15,6 @@ verif = lambda do
17
15
  b.touch(true) do
18
16
  alert grab(:mod_1).touch
19
17
  end
20
-
21
- # a=grab('page2').circle({id: :heu, color: :black})
22
- # a.color(:red)
23
- # alert 'ok'
24
18
  end
25
19
 
26
20
  page1 = {
@@ -31,90 +25,45 @@ page1 = {
31
25
  header: { color: :yellow },
32
26
  left_side_bar: { color: :yellowgreen },
33
27
  right_side_bar: { color: :blue },
34
- # box: { id: :mod_1, touch: {tap: true, code: page1_code} }
35
28
  }
36
29
 
37
30
  color({ id: :titi, red: 1 })
38
31
  page2 = { id: :page2,
39
32
  color: :white,
40
- # apply: :titi,
33
+ menu: false,
41
34
  run: verif,
42
- # drag: true,
43
35
  box: { id: :mod_1, left: 333, top: 123, touch: { down: true, code: page1_code } }
44
-
45
- }
46
-
47
- page3 = { id: :page3,
48
- color: :red,
49
- # run: verif,
50
- # box: { id: :mod_1,left: 333, touch: {tap: :down, code: page1_code} }
51
36
  }
52
37
 
53
38
  page0 = { id: :page0,
54
39
  color: :purple,
55
-
56
40
  }
41
+
42
+ a.page(page0)
57
43
  a.page(page1)
58
44
  a.page(page2)
59
- a.page(page3)
60
- # wait 1 do
61
- # a.page(page2)
62
- # wait 1 do
63
- # a.page(page1)
64
- # puts 'second load'
65
- # wait 5 do
66
- # a.page(page3)
67
- # wait 5 do
68
- # a.page(page2)
69
- # puts 'third load'
70
- # end
71
- # end
72
- # end
73
- # end
74
- # c=grab(:page1).circle({left: 99})
75
- # c.touch(true) do
76
- # alert grab(:mod_1).inspect
77
- # end
45
+ a.page({ id: :page3,
46
+ color: :red,
47
+ })
48
+
49
+
50
+
51
+ menu_f=a.menu
52
+ menus_found= menu_f.fasten # replace fasten for entries
53
+ puts a.pages
54
+ puts " pages => #{a.pages}"
55
+ puts " menus_found => #{menus_found}"
56
+
57
+ bloc_to_add= {height: 156, color: :green}
58
+ bloc_to_add2= {height: 99, color: :blue}
59
+ bloc_to_add3= {height: 333, color: :orange}
60
+ a.insert({page3: {block1: bloc_to_add , block2: bloc_to_add2, block3: bloc_to_add3}})
61
+ puts " blocks => #{a.blocks}"
62
+ wait 3 do
63
+ # how to remove blocks
64
+ a.extract({page3: :block1})
65
+ end
78
66
 
79
- # wait 1 do
80
- # a.page(page2)
81
- # end
82
- # wait 2 do
83
- # a.page(page1)
84
- # end
85
- #
86
- # wait 3 do
87
- # a.page(page2)
88
- # end
89
- #
90
- # # wait 5 do
91
- # # a.page(page0)
92
- # # end
93
- # #
94
- # # wait 6 do
95
- # # a.page(page1)
96
- # # end
67
+ a.show(:page3)
97
68
 
98
- # wait 4 do
99
- # cc=box
100
- # cc.touch(true) do
101
- # alert grab(:heu).inspect
102
- # end
103
- # end
104
69
 
105
- # a=lambda do |_val|
106
- # grab(:testing).color(:red)
107
- # wait 1 do
108
- # grab(:testing).delete({recursive: true})
109
- # end
110
- # end
111
- #
112
- # c=circle
113
- # c.touch(true) do
114
- # b=box({id: :testing, left: 99})
115
- # b.touch({ tap: true , code: a})
116
- # end
117
- # wait 1 do
118
- a.show(:page1)
119
- # # alert :kool
120
- # end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  Atome.new( { renderers: [:html], attach: :view,id: :my_test_box, type: :shape, apply: [:shape_color],
4
- left: 120, top: 0, width: 100, smooth: 15, height: 100, overflow: :visible, attached: [], center: true
4
+ left: 120, top: 0, width: 100, smooth: 15, height: 100, overflow: :visible, fasten: [], center: true
5
5
  })
@@ -2,14 +2,14 @@
2
2
 
3
3
  # Here is the attach explanation and example
4
4
  # the attach method in atome is both a getter and a setter
5
- # attach and attached particles serve the same purpose but just in the opposite direction
5
+ # attach and fasten particles serve the same purpose but just in the opposite direction
6
6
  # please note that atome.attach([:atome_id]) means that atome will be the parent of the atome with the id :atome_id
7
- # to sum up : attach and attached are both setter and getter :
7
+ # to sum up : attach and fasten are both setter and getter :
8
8
  # a.attach(b.ib) will attach the current object to the IDs passed in the params. The current atome will be the child of the the atomes width IDS passed in the the params,
9
9
  # a.attach(b.ib) means (insert 'b' into 'a') or a is parent b is child
10
10
 
11
- # while a.attached(b.id) (insert 'a' into 'b')is the opposite to attached it will attach IDs passed in the params to the current atome. The current atome will be the parent of of the the atomes width IDS passed in the the params
12
- # a.attached(b.ib) means (insert 'a' into 'b') or a is child b is parent
11
+ # while a.fasten(b.id) (insert 'a' into 'b')is the opposite to fasten it will attach IDs passed in the params to the current atome. The current atome will be the parent of of the the atomes width IDS passed in the the params
12
+ # a.fasten(b.ib) means (insert 'a' into 'b') or a is child b is parent
13
13
 
14
14
  # atome.attach([:atome_id]) means that atome will be the child of the atome with the id :atome_id
15
15
  # Here is how to use it as a setter :
@@ -27,8 +27,8 @@ box({ id: :my_test_box })
27
27
  wait 1 do
28
28
  b.attach(:c_12)
29
29
  # Here is how to use it as a getter :
30
- # to retrieve witch atomes b315 is attached to to the atome c_12 just type
30
+ # to retrieve witch atomes b315 is fasten to to the atome c_12 just type
31
31
  puts b.attach # => [:c_12]
32
- # to retrieve atome attached to the atome c_12 just type tha other method
33
- puts c.attached #=> [:b_1]
32
+ # to retrieve atome fasten to the atome c_12 just type tha other method
33
+ puts c.fasten #=> [:b_1]
34
34
  end
@@ -1,15 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # Here is the fasten explanation and example :
3
4
 
4
- # Here is the attached explanation and example :
5
-
6
- # the attached method in atome is both a getter and a setter
7
- # attach and attached particles serve the same purpose but just in the opposite direction
5
+ # the fasten method in atome is both a getter and a setter
6
+ # attach and fasten particles serve the same purpose but just in the opposite direction
8
7
  # please note that atome.attach([:atome_id]) means that atome will be the parent of the atome with the id :atome_id
9
- # to sum up : attach and attached are both setter and getter :
8
+ # to sum up : attach and fasten are both setter and getter :
10
9
  # attach will attach the current object to the IDs passed in the params. The current atome will be the child of the the atomes width IDS passed in the the params,
11
- # while attached is the opposite to attached it will attach IDs passed in the params to the current atome. The current atome will be the parent of of the the atomes width IDS passed in the the params
12
-
10
+ # while fasten is the opposite to fasten it will attach IDs passed in the params to the current atome. The current atome will be the parent of of the the atomes width IDS passed in the the params
13
11
 
14
12
  # Here is how to use it as a setter :
15
13
  grab(:black_matter).color({ red: 1, green: 0.6, blue: 0.6, id: :active_color })
@@ -19,23 +17,23 @@ b = box({ left: 99, drag: true, id: :the_box })
19
17
  wait 1 do
20
18
  b.apply([:active_color])
21
19
  end
22
- c = circle({ left: 333, id: :the_circle })
20
+ c = circle({ left: 333, id: :the_circle, drag: true })
23
21
  wait 1 do
24
22
 
25
23
  puts "before: -------"
26
- puts "c.attach #{c.attach}"
27
- puts "b.attached : #{b.attached}"
24
+ puts "c.attach #{c.attach}"
25
+ puts "b.fasten : #{b.fasten}"
28
26
  puts "b.color : #{b.color}"
29
27
  puts "c.color : #{c.color}"
30
28
  c.apply(:inactive_color)
31
- b.attached([c.id])
29
+ b.fasten([c.id])
32
30
  puts "After: -------"
33
31
 
34
32
  # Here is how to use it as a getter :
35
- # to retrieve witch atomes b315 is attached to to the atome c_12 just type
36
- puts "c.attach #{c.attach}" # => [:the_box]
37
- # to retrieve atome attached to the atome c_12 just type tha other method
38
- puts "b.attached : #{b.attached}" #=> [:the_circle]
33
+ # to retrieve witch atomes b315 is fasten to to the atome c_12 just type
34
+ puts "c.attach #{c.attach}" # => [:the_box]
35
+ # to retrieve atome fasten to the atome c_12 just type tha other method
36
+ puts "b.fasten : #{b.fasten}" #=> [:the_circle]
39
37
  puts "b.color : #{b.color}"
40
38
  puts "c.color : #{c.color}"
41
39
  end
@@ -49,6 +49,6 @@ a.apply([:box_color])
49
49
  wait 2 do
50
50
  # a bit less efficient and a bit more processor intensive solution is to use the box preset, that render a box too
51
51
  b=box
52
- # we can add a color atome onto the new atome my_shape. as stated before for some atome types such as color, shadows ,the relation between the two atomes won't be attach and attached but apply and affect instead the atome color with the particle red onto the
52
+ # we can add a color atome onto the new atome my_shape. as stated before for some atome types such as color, shadows ,the relation between the two atomes won't be attach and fasten but apply and affect instead the atome color with the particle red onto the
53
53
  b.color(:red)
54
54
  end
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ box({color: :gray, width: 666, height: 666})
4
+ box({ id: :the_box, drag: true, color: { alpha: 2 } })
5
+
6
+ menu1_code = lambda do
7
+ puts :menu1_code
8
+ end
9
+ menu2_code = lambda do
10
+ puts :menu2
11
+ end
12
+
13
+ but = buttons({
14
+ id: :menu1,
15
+ attach: :the_box,
16
+ inactive: { text: { color: :gray }, width: 66, height: 12, spacing: 3, disposition: :horizontal,
17
+ color: :orange, margin: { left: 33, top: 12 } },
18
+ active: { text: { color: :white, shadow: {} }, color: :blue, shadow: {} },
19
+ item_1: {
20
+ text: :acceuil,
21
+ code: menu1_code
22
+ },
23
+ item_2: {
24
+ text: :page_2,
25
+ code: menu2_code
26
+
27
+ },
28
+ item_3: {
29
+ text: :page_3,
30
+ code: lambda { puts :item_3_touched }
31
+ },
32
+ })
33
+
34
+ c = text({ top: 99, left: 99, data: 'add a button' })
35
+
36
+ c.touch(:down) do
37
+ but.add_button(new_button: {
38
+ text: :button1,
39
+ code: lambda { puts :button1_touched }
40
+ })
41
+ end
42
+
43
+
44
+ wait 2 do
45
+ grab(:menu1).remove_menu_item(:item_2)
46
+ end
47
+
48
+ # TODO: remove menu_item ,reset_menu, reorder, delete
@@ -18,56 +18,56 @@ end
18
18
 
19
19
 
20
20
  #Atome.new(
21
- # { renderers: [], id: :eDen, type: :element, tag: { system: true }, attach: [], attached: [] }
21
+ # { renderers: [], id: :eDen, type: :element, tag: { system: true }, attach: [], fasten: [] }
22
22
  # )
23
23
  # Atome.new(
24
24
  # { renderers: [], id: :user_view, type: :element, tag: { system: true },
25
- # attach: [:eDen], attached: [] }
25
+ # attach: [:eDen], fasten: [] }
26
26
  # )
27
27
  #
28
28
  # # color creation
29
29
  # Atome.new(
30
30
  # { renderers: default_render, id: :view_color, type: :color, tag: ({ system: true, persistent: true }),
31
- # red: 0.15, green: 0.15, blue: 0.15, alpha: 1, top: 12, left: 12, diffusion: :linear, attach: [], attached: [] }
31
+ # red: 0.15, green: 0.15, blue: 0.15, alpha: 1, top: 12, left: 12, diffusion: :linear, attach: [], fasten: [] }
32
32
  # )
33
33
  #
34
34
  # Atome.new(
35
35
  # { renderers: default_render, id: :shape_color, type: :color, tag: ({ system: true, persistent: true }),
36
- # red: 0.4, green: 0.4, blue: 0.4, alpha: 1, attach: [], attached: [] }
36
+ # red: 0.4, green: 0.4, blue: 0.4, alpha: 1, attach: [], fasten: [] }
37
37
  # )
38
38
  #
39
39
  # Atome.new(
40
40
  # { renderers: default_render, id: :box_color, type: :color, tag: ({ system: true, persistent: true }),
41
- # red: 0.5, green: 0.5, blue: 0.5, alpha: 1, attach: [], attached: [] }
41
+ # red: 0.5, green: 0.5, blue: 0.5, alpha: 1, attach: [], fasten: [] }
42
42
  # )
43
43
  #
44
44
  # Atome.new(
45
45
  # { renderers: default_render, id: :invisible_color, type: :color, tag: ({ system: true, persistent: true }),
46
- # red: 0, green: 0, blue: 0, alpha: 1, attach: [], attached: [] }
46
+ # red: 0, green: 0, blue: 0, alpha: 1, attach: [], fasten: [] }
47
47
  # )
48
48
  #
49
49
  # Atome.new(
50
50
  # { renderers: default_render, id: :text_color, type: :color, tag: ({ system: true, persistent: true }),
51
- # red: 0.9, green: 0.9, blue: 0.9, alpha: 1, attach: [], attached: [] }
51
+ # red: 0.9, green: 0.9, blue: 0.9, alpha: 1, attach: [], fasten: [] }
52
52
  # )
53
53
  #
54
54
  # Atome.new(
55
55
  # { renderers: default_render, id: :circle_color, type: :color, tag: ({ system: true, persistent: true }),
56
- # red: 0.6, green: 0.6, blue: 0.6, alpha: 1, attach: [], attached: [] }
56
+ # red: 0.6, green: 0.6, blue: 0.6, alpha: 1, attach: [], fasten: [] }
57
57
  # )
58
58
  #
59
59
  # # system object creation
60
60
  # # the black_matter is used to store un materialized atomes
61
61
  # Atome.new(
62
62
  # { renderers: default_render, id: :black_matter, type: :shape, attach: [:user_view],apply: [],
63
- # left: 0, right: 0, top: 0, bottom: 0, width: 0, height: 0, overflow: :hidden, tag: { system: true }, attached: []
63
+ # left: 0, right: 0, top: 0, bottom: 0, width: 0, height: 0, overflow: :hidden, tag: { system: true }, fasten: []
64
64
  # })
65
65
  #
66
66
  # # view port
67
67
  # Atome.new(
68
68
  # { renderers: default_render, id: :view, type: :shape, attach: [:user_view], apply: [:view_color],
69
69
  # tag: { system: true },
70
- # attached: [], left: 0, right: 0, top: 0, bottom: 0, width: :auto, height: :auto, overflow: :auto,
70
+ # fasten: [], left: 0, right: 0, top: 0, bottom: 0, width: :auto, height: :auto, overflow: :auto,
71
71
  # }
72
72
  #
73
73
  # )
@@ -75,7 +75,7 @@ end
75
75
  # # unreal port, hold system object and tools
76
76
  # Atome.new(
77
77
  # { renderers: default_render, id: :intuition, type: :shape, attach: [:user_view], tag: { system: true },
78
- # left: 0, top: 0, width: 0, height: 0, overflow: :visible, attached: [],apply: []
78
+ # left: 0, top: 0, width: 0, height: 0, overflow: :visible, fasten: [],apply: []
79
79
  # }
80
80
  # )
81
81
  #
@@ -92,5 +92,5 @@ end
92
92
  # Universe.current_machine = machine_id
93
93
  # # the constant A is used to access alla atomes methods
94
94
  # A = Atome.new(
95
- # { renderers: default_render, id: :atome, type: :element, tag: { system: true }, attach: [], attached: [] }
95
+ # { renderers: default_render, id: :atome, type: :element, tag: { system: true }, attach: [], fasten: [] }
96
96
  # )
@@ -51,7 +51,7 @@ wait 1 do
51
51
  end
52
52
 
53
53
  # TODO : make multi parents works
54
- # TODO : make it works for event like touch , also attach and attached
54
+ # TODO : make it works for event like touch , also attach and fasten
55
55
  # wait 2 do
56
56
  # col = color({ id: :col1, red: 1, blue: 1 })
57
57
  # Atome.monitoring([col], [:red, :blue], [:variable1, :variable2])
@@ -1,7 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- b = box()
4
- b.text('click me')
3
+ b = box({left: 99, top: 99})
4
+ b.text({ data: 'click me' })
5
+
6
+ # wait 5 do
7
+ # b.delete(:left)
8
+ # puts 'o'
9
+ # end
5
10
  orange=''
6
11
  b.touch(true) do
7
12
 
@@ -20,18 +25,17 @@ b.touch(true) do
20
25
  c.delete(:left)
21
26
  wait 0.5 do
22
27
  # orange.color(:pink)
23
- c.delete(:blur)
28
+ c.delete(:blur)
24
29
  end
25
30
  end
26
31
 
27
32
  c.touch(:down) do
28
- puts '1?'
29
33
  grab(:circling).delete({ recursive: true }) if grab(:circling)
30
34
  end
31
35
  # alert orange.apply
32
- wait 4 do
33
- grab(:circling).delete({ recursive: true })if grab(:circling)
34
- end
36
+ # wait 4 do
37
+ # grab(:circling).delete({ recursive: true })if grab(:circling)
38
+ # end
35
39
  end
36
40
 
37
41
 
@@ -52,10 +56,10 @@ end
52
56
  # #
53
57
  # wait 3 do
54
58
  #
55
- # b.shape.each do |attached_atome_id|
56
- # attached_atome_id.left(333)
59
+ # b.shape.each do |fasten_atome_id|
60
+ # fasten_atome_id.left(333)
57
61
  # wait 2 do
58
- # attached_atome_id.delete(true)
62
+ # fasten_atome_id.delete(true)
59
63
  # end
60
64
  # end
61
65
  #
@@ -77,14 +81,14 @@ end
77
81
  #
78
82
  # # alert "before creation : #{bb}"
79
83
  # bb.touch(true) do
80
- # bb.box({attached: col.id, id: :attached_box})
84
+ # bb.box({fasten: col.id, id: :fasten_box})
81
85
  # c=bb.circle(({ id: :circle_1 }))
82
86
  # c.text({id: :text_1, data: :hello})
83
87
  # bb.text(:good)
84
88
  # # alert "after creation : #{bb}"
85
89
  # wait 1 do
86
- # bb.physical.each do |attached_atome_id|
87
- # bb.delete({id: attached_atome_id, recursive: true})
90
+ # bb.physical.each do |fasten_atome_id|
91
+ # bb.delete({id: fasten_atome_id, recursive: true})
88
92
  # end
89
93
  #
90
94
  # # wait 1 do
@@ -98,7 +102,7 @@ end
98
102
  # puts Universe.user_atomes
99
103
  # puts Universe.system_atomes
100
104
 
101
- # physical_found=["text_0","attached_box","circle_1","attached_box","circle_1"]
105
+ # physical_found=["text_0","fasten_box","circle_1","fasten_box","circle_1"]
102
106
  # clean_physical=physical_found.uniq
103
107
  # alert clean_physical
104
108
 
@@ -108,3 +112,4 @@ end
108
112
  # b.attach(c.id)
109
113
  # alert b
110
114
  # alert c
115
+
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ b = box({ drag: true, id: :the_b })
4
+ c = b.circle({ left: 99, id: :the_c })
5
+ d = b.text({ data: :hello, left: 44, top: 44, id: :the_t })
6
+ c.touch(:down) do
7
+ c.detach(b.id)
8
+ end
@@ -9,5 +9,5 @@ b.box
9
9
 
10
10
 
11
11
  atome_founds = c.dig
12
- puts "dig allow to retrieve all attached atomes recursively,
12
+ puts "dig allow to retrieve all fasten atomes recursively,
13
13
  it return a table of ID including the ID of the parent (here : :the_circle) :\n#{atome_founds}"
@@ -230,8 +230,8 @@ def duplicate(ids)
230
230
 
231
231
  atome_passed=grab(id_passed)
232
232
  # atome_passed.particles.delete(:left)
233
- # we remove attached
234
- particle_to_remove=[:id, :broadcast, :history,:callback, :html_object, :store_allow,:attached]
233
+ # we remove fasten
234
+ particle_to_remove=[:id, :broadcast, :history,:callback, :html_object, :store_allow,:fasten]
235
235
  particles_found=atome_passed.particles.dup
236
236
  particles_found.delete_if { |key, value| particle_to_remove.include?(key) }
237
237
  particles_found[:id]=identity_generator(particles_found[:type])
@@ -252,8 +252,8 @@ def duplicate(ids)
252
252
  wait 2 do
253
253
  nw_atome.left(333)
254
254
  end
255
- # Atome.new({"renderers"=>["html"], "id"=>nil, "type"=>"shape", "attach"=>["view"], "tag"=>{}, "attached"=>["text_15"], "unit"=>{}, "collected"=>{}, "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"=>[]}}, "touch"=>{"tap"=>true}, "touch_code"=>{"touch"=>:jhjh}})
256
- # Atome.new({"renderers"=>["html"], "id"=>:jgjhg, "type"=>"shape", "attach"=>["view"], "tag"=>{}, "attached"=>["text_15"], "unit"=>{}, "collected"=>{}, "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"=>[]}}, "touch"=>{"tap"=>true}, "touch_code"=>{"touch"=>:jhjh}})
255
+ # Atome.new({"renderers"=>["html"], "id"=>nil, "type"=>"shape", "attach"=>["view"], "tag"=>{}, "fasten"=>["text_15"], "unit"=>{}, "collected"=>{}, "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"=>[]}}, "touch"=>{"tap"=>true}, "touch_code"=>{"touch"=>:jhjh}})
256
+ # Atome.new({"renderers"=>["html"], "id"=>:jgjhg, "type"=>"shape", "attach"=>["view"], "tag"=>{}, "fasten"=>["text_15"], "unit"=>{}, "collected"=>{}, "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"=>[]}}, "touch"=>{"tap"=>true}, "touch_code"=>{"touch"=>:jhjh}})
257
257
  end
258
258
  end
259
259
 
@@ -263,14 +263,14 @@ c.text(:hello)
263
263
  b.touch(true) do
264
264
  puts @id
265
265
  end
266
- b.clones([{ left: 300, top: 300, color: :blue, entangled: [:width, :attached, :height] },
266
+ b.clones([{ left: 300, top: 300, color: :blue, entangled: [:width, :fasten, :height] },
267
267
  { left: 600, top: 366, color: :green, entangled: [:left, :height] }])
268
268
 
269
269
  # duplicate([b.id])
270
270
 
271
271
 
272
272
  # Atome.new( { renderers: [:html], attach: [:view],id: :my_test_box, type: :shape, apply: [:shape_color],
273
- # left: 120, top: 0, width: 100, smooth: 15, height: 100, overflow: :visible, attached: [], center: true
273
+ # left: 120, top: 0, width: 100, smooth: 15, height: 100, overflow: :visible, fasten: [], center: true
274
274
  # })
275
275
  # model={shape}
276
276
 
@@ -7,7 +7,7 @@ clone = ""
7
7
  b.drag(:start) do
8
8
  b.color(:black)
9
9
  b.height(123)
10
- # beware you must use grab(:view) else it'll be attached to the context, that means to 'b' in this case
10
+ # beware you must use grab(:view) else it'll be fasten to the context, that means to 'b' in this case
11
11
  clone = grab(:view).circle({ color: :white, left: b.left, top: b.top, depth: 3 })
12
12
  end
13
13
 
@@ -10,8 +10,8 @@
10
10
  # new_atome_id = "#{@id}_copy_#{copy_number}"
11
11
  # new_atome = Atome.new({ type: @type, renderers: @renderers, id: new_atome_id })
12
12
  #
13
- # attached_atomes = []
14
- # attached_found = attached.dup
13
+ # fasten_atomes = []
14
+ # fasten_found = fasten.dup
15
15
  # particles_found = instance_variables.dup
16
16
  #
17
17
  # particles_found.delete(:@history)
@@ -20,14 +20,14 @@
20
20
  # particles_found.delete(:@touch_code)
21
21
  # # touch_code=instance_variable_get('@touch_code')
22
22
  # particles_found.delete(:@html)
23
- # particles_found.delete(:@attached)
23
+ # particles_found.delete(:@fasten)
24
24
  # particles_found.delete(:@id)
25
25
  # params[:id] = new_atome_id
26
- # attached_found.each do |child_id_found|
26
+ # fasten_found.each do |child_id_found|
27
27
  # child_found = grab(child_id_found)
28
28
  # if child_found
29
29
  # new_child = child_found.duplicate({})
30
- # attached_atomes << new_child.id
30
+ # fasten_atomes << new_child.id
31
31
  # end
32
32
  # end
33
33
  # particles_found.each do |particle_found|
@@ -36,7 +36,7 @@
36
36
  # new_atome.set(particle_name => particle_content)
37
37
  # # new_atome.instance_variable_set('@touch_code',touch_code)
38
38
  # end
39
- # params[:attached] = attached_atomes
39
+ # params[:fasten] = fasten_atomes
40
40
  #
41
41
  # if params.instance_of? Hash
42
42
  # params.each do |k, v|
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ b = box({ width: 200, height: 200, color: :white })
4
+
5
+ a = b.box({ color: :green, left: 33, id: :box, shadow: {
6
+ id: :menu_active_shade,
7
+ left: 9,
8
+ top: -3,
9
+ blur: 10,
10
+ invert: false,
11
+ red: 0,
12
+ green: 0,
13
+ blue: 0,
14
+ alpha: 1 } })
15
+ wait 2 do
16
+ a.exchange({ color: :red, top: 33})
17
+ end
@@ -7,9 +7,9 @@ grab(:bundler_1).color(:blue)
7
7
 
8
8
 
9
9
  # Atome.new(
10
- # { renderers: [:html], id: :atomix, type: :element, tag: { system: true }, attach: [], attached: [] }
10
+ # { renderers: [:html], id: :atomix, type: :element, tag: { system: true }, attach: [], fasten: [] }
11
11
  # )
12
12
  #
13
13
  #
14
- # {:id=>:eDen, :type=>:element, :renderers=>[], :tag=>{:system=>true}, :attach=>[], :attached=>[]}
15
- # {:renderers=>[], :id=>:eDen, :type=>:element, :tag=>{:system=>true}, :attach=>[], :attached=>[]}
14
+ # {:id=>:eDen, :type=>:element, :renderers=>[], :tag=>{:system=>true}, :attach=>[], :fasten=>[]}
15
+ # {:renderers=>[], :id=>:eDen, :type=>:element, :tag=>{:system=>true}, :attach=>[], :fasten=>[]}
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # here is how to setup a hierarchy within atome using a more simple way than attached and attach .simply adding atome inside another atome. here is a example to do to so : b = box({ id: :the_box })
3
+ # here is how to setup a hierarchy within atome using a more simple way than fasten and attach .simply adding atome inside another atome. here is a example to do to so : b = box({ id: :the_box })
4
4
  b=box
5
5
  # the line below will create a circle inside the box b
6
6
  c = b.circle({ id: :the_circle })
@@ -11,11 +11,11 @@ t.image({ path: 'medias/images/logos/atome.svg', width: 33 })
11
11
 
12
12
  # note that creating a hierarchy this way automatically
13
13
 
14
- # Note that when you create a hierarchy in this way, it automatically creates a relationship by populating the 'attach' and 'attached' properties. So, if you enter:
14
+ # Note that when you create a hierarchy in this way, it automatically creates a relationship by populating the 'attach' and 'fasten' properties. So, if you enter:
15
15
 
16
16
 
17
- puts "b attach : #{b.attach}" # prints [:view] in the console as it is attached to the view atom
18
- puts "b attached :#{b.attached}" # prints [:the_circle, :the_cirle] in the console
17
+ puts "b attach : #{b.attach}" # prints [:view] in the console as it is fasten to the view atom
18
+ puts "b fasten :#{b.fasten}" # prints [:the_circle, :the_cirle] in the console
19
19
 
20
20
  puts "c attach: #{c.attach}" # prints [:the_box] in the console
21
- puts "c attached: #{c.attached}" # prints [:box_14] in the console as there's no child
21
+ puts "c fasten: #{c.fasten}" # prints [:box_14] in the console as there's no child