atome 0.5.6.4.8 → 0.5.6.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/atome/atome.rb +30 -30
- data/lib/atome/genesis/atomes.rb +9 -16
- data/lib/atome/genesis/genesis.rb +1 -1
- data/lib/atome/genesis/particles/effect.rb +9 -5
- data/lib/atome/genesis/particles/hierarchy.rb +7 -10
- data/lib/atome/genesis/particles/material.rb +8 -1
- data/lib/atome/genesis/particles/property.rb +40 -0
- data/lib/atome/genesis/particles/spatial.rb +6 -0
- data/lib/atome/helpers/essentials.rb +2 -1
- data/lib/atome/helpers/utilities.rb +21 -1
- data/lib/atome/presets/atome.rb +1 -1
- data/lib/atome/version.rb +1 -1
- data/lib/renderers/html/effect.rb +22 -0
- data/lib/renderers/html/hierarchy.rb +11 -1
- data/lib/renderers/html/material.rb +27 -11
- data/lib/renderers/html/property.rb +0 -27
- data/lib/renderers/html/spatial.rb +9 -2
- data/vendor/assets/application/examples/border.rb +35 -15
- data/vendor/assets/application/examples/increment.rb +23 -0
- data/vendor/assets/application/examples/matrix.rb +11 -3
- data/vendor/assets/application/examples/shadow.rb +11 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 851b897d4aa5b30db58c4ac2b6b9cf7398e1dc478e6e66f2a0d9e5ab181ae999
|
4
|
+
data.tar.gz: e0c43d5d928acf4ece30d315227c759f070c5206ed4488b82e29f1565dcf906b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a0b3f00737041ea0256b1955313f4c3ba462707558bb9459cd7cc39ccc7869692122c1edef2585eb69626c7a622329305fb01cbbe80fe7a11a2c489fce6a6a62
|
7
|
+
data.tar.gz: f7edd0ce4311f84b60ab3ef1e336a7a60ae3a215f09f93de1e1c41937b392e6a54206f0a6f71bca8c3bdcd79db2ce0b89eb2ed891af00e67d19bfbcef3eef368
|
data/lib/atome/atome.rb
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
class Atome
|
5
5
|
include Essentials
|
6
6
|
|
7
|
-
def aid(_v=nil)
|
7
|
+
def aid(_v = nil)
|
8
8
|
@aid
|
9
9
|
end
|
10
10
|
|
@@ -22,36 +22,36 @@ class Atome
|
|
22
22
|
# alert "atome found : #{ grab(new_atome[:id])}"
|
23
23
|
# grab(new_atome[:id])
|
24
24
|
# else
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
25
|
+
# the keys :renderers, :type and :id should be placed in the first position in the hash
|
26
|
+
@history = {}
|
27
|
+
# @language = :english
|
28
|
+
# @callback = {}
|
29
|
+
@tag = {}
|
30
|
+
@selected = false
|
31
|
+
#@metrics = {}
|
32
32
|
@unit = {}
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
33
|
+
@apply = []
|
34
|
+
@collect = {}
|
35
|
+
@int8 = {}
|
36
|
+
@css = {}
|
37
|
+
@aid = identity_generator
|
38
|
+
Universe.add_to_atomes(@aid, self)
|
39
|
+
@id = new_atome[:id] || @aid
|
40
|
+
Universe.id_to_aid(@id, @aid)
|
41
|
+
@type = new_atome[:type] || :element
|
42
|
+
@attached = []
|
43
|
+
@affect = []
|
44
|
+
@category = []
|
45
|
+
# @display = { mode: :default }
|
46
|
+
# @backup={} # mainly used to restore particle when using grid /table /list display mode
|
47
|
+
@html = HTML.new(@id, self)
|
48
|
+
@headless = Headless.new(@id, self)
|
49
|
+
# now we store the proc in a an atome's property called :bloc
|
50
|
+
new_atome[:code] = atomes_proc if atomes_proc
|
51
|
+
# we reorder the hash
|
52
|
+
reordered_atome = reorder_particles(new_atome)
|
53
|
+
# FIXME : try to remove the condition below (it crash in the method : def generator ... in genesis.rb)
|
54
|
+
collapse(reordered_atome)
|
55
55
|
# end
|
56
56
|
|
57
57
|
end
|
data/lib/atome/genesis/atomes.rb
CHANGED
@@ -35,7 +35,8 @@ new({ sanitizer: :color }) do |params|
|
|
35
35
|
params
|
36
36
|
end
|
37
37
|
# new({ post: :color }) do
|
38
|
-
#
|
38
|
+
#
|
39
|
+
# # Atome.global_monitoring(self, [:red, :blue, :blue, :alpha, :left, :right, :diffusion], [:variable1, :variable2])
|
39
40
|
# end
|
40
41
|
new({ atome: :image })
|
41
42
|
new({ sanitizer: :image }) do |params|
|
@@ -54,7 +55,6 @@ new({ post: :image }) do
|
|
54
55
|
instance_variable_set("@width", compute({ particle: :width })[:value])
|
55
56
|
instance_variable_set("@height", compute({ particle: :height })[:value])
|
56
57
|
end
|
57
|
-
|
58
58
|
new({ atome: :video })
|
59
59
|
new({ sanitizer: :video }) do |params|
|
60
60
|
unless params.instance_of? Hash
|
@@ -69,23 +69,17 @@ new({ sanitizer: :video }) do |params|
|
|
69
69
|
end
|
70
70
|
new({ atome: :www })
|
71
71
|
new({ atome: :shadow }) do |params|
|
72
|
-
# if params
|
73
|
-
# if params.delete(:affect)
|
74
|
-
# attach_value = params.delete(:affect)
|
75
|
-
# else
|
76
|
-
# attach_value=id
|
77
|
-
# end
|
78
|
-
#
|
79
|
-
# params[:affect] = attach_value
|
80
|
-
# alert "=> params : #{params}"
|
81
|
-
#
|
82
|
-
# end
|
83
|
-
|
84
72
|
if params
|
85
73
|
attach_value = params.delete(:affect)
|
86
74
|
params[:affect] = attach_value
|
87
75
|
end
|
88
|
-
|
76
|
+
params
|
77
|
+
end
|
78
|
+
new({ atome: :border }) do |params|
|
79
|
+
if params
|
80
|
+
attach_value = params.delete(:affect)
|
81
|
+
params[:affect] = attach_value
|
82
|
+
end
|
89
83
|
params
|
90
84
|
end
|
91
85
|
new({ atome: :raw })
|
@@ -130,7 +124,6 @@ end
|
|
130
124
|
new({ atome: :machine })
|
131
125
|
new({ atome: :paint })
|
132
126
|
new({ atome: :vector })
|
133
|
-
|
134
127
|
new({ atome: :matrix })
|
135
128
|
new({ atome: :atomized, type: :hash })
|
136
129
|
|
@@ -150,7 +150,7 @@ class Genesis
|
|
150
150
|
# end
|
151
151
|
# TODO : add category for atome( material/physical vs modifier : color, shadow, .. vs shape, image ..)
|
152
152
|
# then add condition same things fo code in presets/atome atome_common
|
153
|
-
if %i[color shadow paint].include?(element)
|
153
|
+
if %i[color shadow paint border].include?(element)
|
154
154
|
# we do the same for apply to be able to retrieve 'color' and other atome that apply instead of being attached
|
155
155
|
@apply.each do |attached_atome|
|
156
156
|
collected_atomes << attached_atome if grab(attached_atome).type.to_sym == element.to_sym
|
@@ -2,9 +2,13 @@
|
|
2
2
|
|
3
3
|
new({ particle: :smooth, category: :effect, type: :int })
|
4
4
|
|
5
|
-
|
6
5
|
new({ particle: :blur, category: :effect, type: :int }) do |params|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
6
|
+
if affect.nil?
|
7
|
+
affect_to = affect
|
8
|
+
else
|
9
|
+
affect_to = [:self]
|
10
|
+
end
|
11
|
+
val= { value: params, affect: affect_to } unless params.instance_of?(Hash)
|
12
|
+
val
|
13
|
+
end
|
14
|
+
|
@@ -2,9 +2,9 @@
|
|
2
2
|
def detach_child(child)
|
3
3
|
return unless child.attach
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
parent = grab(child.attach)
|
6
|
+
parent.attached.delete(@id)
|
7
|
+
|
8
8
|
end
|
9
9
|
|
10
10
|
# def detach_from_parent(parent_found, child_found)
|
@@ -50,14 +50,14 @@ new({ sanitizer: :attached }) do |children_ids|
|
|
50
50
|
end
|
51
51
|
|
52
52
|
new({ particle: :apply, category: :hierarchy, type: :string, render: false, store: false }) do |parents_ids, &user_proc|
|
53
|
-
|
54
|
-
# html.reset_background
|
53
|
+
|
55
54
|
@apply ||= []
|
56
55
|
parents_ids = [parents_ids] unless parents_ids.instance_of?(Array)
|
57
56
|
parents_ids.each do |parent_id|
|
58
57
|
@apply.delete(parent_id)
|
59
58
|
@apply << parent_id
|
60
59
|
end
|
60
|
+
puts affect
|
61
61
|
parents_ids = @apply
|
62
62
|
children_ids = [id]
|
63
63
|
parents_ids.each do |parent_id|
|
@@ -66,16 +66,13 @@ new({ particle: :apply, category: :hierarchy, type: :string, render: false, stor
|
|
66
66
|
parent_found.instance_variable_set('@affect', []) unless parent_affect.instance_of? Array
|
67
67
|
affect_element = parent_found.instance_variable_get('@affect')
|
68
68
|
children_ids.each do |child_id|
|
69
|
-
# affect_element << child_id unless affect_element.include?(child_id)
|
70
69
|
affect_element.delete(child_id)
|
71
|
-
# affect_element.push(child_id)
|
72
70
|
affect_element << child_id
|
73
71
|
child_found = grab(child_id)
|
74
72
|
child_found&.render(:apply, parent_found, &user_proc)
|
75
73
|
end
|
76
74
|
end
|
77
75
|
@apply = parents_ids
|
78
|
-
|
79
76
|
parents_ids
|
80
77
|
end
|
81
78
|
|
@@ -83,9 +80,9 @@ new({ particle: :affect, category: :hierarchy, type: :string, render: false }) d
|
|
83
80
|
children_ids = [children_ids] unless children_ids.instance_of? Array
|
84
81
|
children_ids.each do |child_id|
|
85
82
|
child_found = grab(child_id)
|
86
|
-
#FIXME : found why it crash when removing the condition below
|
83
|
+
# FIXME : found why it crash when removing the condition below
|
87
84
|
unless child_found.id == :black_matter
|
88
|
-
child_found.remove({all: :paint})
|
85
|
+
child_found.remove({ all: :paint })
|
89
86
|
end
|
90
87
|
child_found.apply([id], &user_proc)
|
91
88
|
end
|
@@ -58,6 +58,10 @@ new({ post: :remove }) do |params|
|
|
58
58
|
shadow.each do |atome_id_found|
|
59
59
|
@apply.delete(atome_id_found)
|
60
60
|
end
|
61
|
+
when :border
|
62
|
+
border.each do |atome_id_found|
|
63
|
+
@apply.delete(atome_id_found)
|
64
|
+
end
|
61
65
|
else
|
62
66
|
params.each do |particle, value|
|
63
67
|
case particle
|
@@ -92,4 +96,7 @@ new({ sanitizer: :definition }) do |params|
|
|
92
96
|
end
|
93
97
|
|
94
98
|
new({ particle: :gradient, category: :material, type: :int })
|
95
|
-
|
99
|
+
|
100
|
+
new({ particle: :thickness, category: :material, type: :int })
|
101
|
+
new({ particle: :pattern, category: :material, type: :string })
|
102
|
+
# new({ particle: :border, category: :material, type: :int })
|
@@ -7,24 +7,64 @@ def extract_rgb_alpha(color_string)
|
|
7
7
|
blue = match_data[3].to_i
|
8
8
|
alpha = match_data[4] ? match_data[4].to_f : nil
|
9
9
|
{ red: red, green: green, blue: blue, alpha: alpha }
|
10
|
+
|
10
11
|
end
|
11
12
|
|
12
13
|
new({ particle: :red, category: :property, type: :string }) do
|
14
|
+
# alert :ok
|
13
15
|
# we return self to allow syntax of the type : a.color(:black).red(1).green(0.3)
|
14
16
|
self
|
15
17
|
end
|
18
|
+
# FIXME we have to apply both at post and after to make it work
|
19
|
+
# used to refresh all affected atomes
|
20
|
+
new({after: :red}) do |params|
|
21
|
+
a=affect.dup # FIXME we have to dup else some items in the array array other duplicated
|
22
|
+
a.each do |atome_to_refresh|
|
23
|
+
grab(atome_to_refresh).apply(id)
|
24
|
+
end
|
25
|
+
params
|
26
|
+
end
|
27
|
+
|
28
|
+
|
16
29
|
new({ particle: :green, category: :property, type: :string }) do
|
17
30
|
# we return self to allow syntax of the type : a.color(:black).red(1).green(0.3)
|
18
31
|
self
|
19
32
|
end
|
33
|
+
|
34
|
+
# used to refresh all affected atomes
|
35
|
+
new({after: :green}) do |params|
|
36
|
+
a=affect.dup # FIXME we have to dup else some items in the array array other duplicated
|
37
|
+
a.each do |atome_to_refresh|
|
38
|
+
grab(atome_to_refresh).apply(id)
|
39
|
+
end
|
40
|
+
params
|
41
|
+
end
|
42
|
+
|
20
43
|
new({ particle: :blue, category: :property, type: :string }) do
|
21
44
|
# we return self to allow syntax of the type : a.color(:black).red(1).green(0.3)
|
22
45
|
self
|
23
46
|
end
|
47
|
+
|
48
|
+
# used to refresh all affected atomes
|
49
|
+
new({after: :blue}) do |params|
|
50
|
+
a=affect.dup # FIXME we have to dup else some items in the array array other duplicated
|
51
|
+
a.each do |atome_to_refresh|
|
52
|
+
grab(atome_to_refresh).apply(id)
|
53
|
+
end
|
54
|
+
params
|
55
|
+
end
|
24
56
|
new({ particle: :alpha, category: :property, type: :string }) do
|
25
57
|
# we return self to allow syntax of the type : a.color(:black).red(1).green(0.3)
|
26
58
|
self
|
27
59
|
end
|
60
|
+
# used to refresh all affected atomes
|
61
|
+
new({after: :alpha}) do |params|
|
62
|
+
a=affect.dup # FIXME we have to dup else some items in the array array other duplicated
|
63
|
+
a.each do |atome_to_refresh|
|
64
|
+
grab(atome_to_refresh).apply(id)
|
65
|
+
end
|
66
|
+
params
|
67
|
+
end
|
28
68
|
new({ particle: :diffusion, category: :property, type: :string }) do
|
29
69
|
# we return self to allow syntax of the type : a.color(:black).red(1).green(0.3)
|
30
70
|
self
|
@@ -90,3 +90,9 @@ new({ particle: :center, category: :spatial, type: :hash }) do |params|
|
|
90
90
|
params = { x: 0, y: 0, dynamic: true } if params == true
|
91
91
|
params
|
92
92
|
end
|
93
|
+
new ({ particle: :increment, category: :spatial, type: :hash }) do |params|
|
94
|
+
params.each do |particle, value|
|
95
|
+
prev_value=send(particle)
|
96
|
+
send(particle, value+prev_value)
|
97
|
+
end
|
98
|
+
end
|
@@ -37,7 +37,8 @@ module Essentials
|
|
37
37
|
apply: [:text_color],
|
38
38
|
width: :auto, height: :auto, language: :english },
|
39
39
|
drm: { type: :drm, attach: :black_matter },
|
40
|
-
shadow: { type: :shadow, red: 0, green: 0, blue: 0, alpha:
|
40
|
+
shadow: { type: :shadow, red: 0, green: 0, blue: 0, alpha: 1, blur: 3, left: 3, top: 3 },
|
41
|
+
border: { type: :border, red: 0, green: 0, blue: 0, alpha: 0, pattern: :solid, thickness: 6 },
|
41
42
|
color: { type: :color, red: 0, green: 0, blue: 0, alpha: 1}
|
42
43
|
}
|
43
44
|
|
@@ -7,6 +7,21 @@ class Atome
|
|
7
7
|
class << self
|
8
8
|
|
9
9
|
|
10
|
+
def sync(params, &bloc)
|
11
|
+
alert :server_sync
|
12
|
+
# params = { data: params } unless params.instance_of? Hash
|
13
|
+
# # params[:user] = 'dfghg4df5gdfgh654'
|
14
|
+
# # params[:pass] = 'gfhkzrhgzr4h98948'
|
15
|
+
# # instance_variable_set('@message_code', {}) unless instance_variable_get('@message_code')
|
16
|
+
# # store_proc= instance_variable_get('@message_code')
|
17
|
+
# message_id= "msg_#{Universe.messages.length}"
|
18
|
+
# params[:message_id]=message_id
|
19
|
+
# # store_proc[mmessage_id]=bloc
|
20
|
+
# Universe.store_messages({msg_nb:message_id, proc: bloc })
|
21
|
+
# html.send_message(params)
|
22
|
+
|
23
|
+
end
|
24
|
+
|
10
25
|
def file_handler(parent, content, bloc)
|
11
26
|
grab(parent).instance_exec(content, &bloc)
|
12
27
|
end
|
@@ -303,11 +318,16 @@ class Atome
|
|
303
318
|
end
|
304
319
|
|
305
320
|
def refresh
|
321
|
+
# we get the current color because they will be removed
|
322
|
+
# prev_color=color
|
323
|
+
# alert color.class
|
306
324
|
particles_found = to_hash
|
307
325
|
particles_found.each do |particle_found, value_found|
|
308
326
|
send(particle_found, value_found)
|
309
327
|
end
|
310
|
-
|
328
|
+
color.each do |col|
|
329
|
+
apply(col)
|
330
|
+
end
|
311
331
|
end
|
312
332
|
|
313
333
|
def each(&proc)
|
data/lib/atome/presets/atome.rb
CHANGED
@@ -26,7 +26,7 @@ class Atome
|
|
26
26
|
# condition to handle color/shadow/paint atomes that shouldn't be attach to view
|
27
27
|
# TODO : add category for atome( material/physical vs modifier : color, shadow, .. vs shape, image ..)
|
28
28
|
# then add condition same things fo code in genesis new_atome
|
29
|
-
if %i[color shadow paint].include?(atome_preset)
|
29
|
+
if %i[color shadow paint border].include?(atome_preset)
|
30
30
|
unless params[:affect]
|
31
31
|
params[:affect] = if @id == :view
|
32
32
|
[:black_matter]
|
data/lib/atome/version.rb
CHANGED
@@ -27,3 +27,25 @@ new({ renderer: :html, method: :blur, type: :integer }) do |params, _user_proc|
|
|
27
27
|
html.filter(:blur, "#{params[:value]}px")
|
28
28
|
end
|
29
29
|
end
|
30
|
+
|
31
|
+
|
32
|
+
new({ renderer: :html, method: :blur, type: :integer, specific: :shadow }) do |params, _user_proc|
|
33
|
+
if params[:affect] == :back
|
34
|
+
html.backdropFilter(:blur, "#{params[:value]}px")
|
35
|
+
else
|
36
|
+
html.filter(:blur, "#{params[:value]}px")
|
37
|
+
end
|
38
|
+
# now we refresh if needed for dynamic refresh od affected atomes
|
39
|
+
affect(affect)
|
40
|
+
end
|
41
|
+
|
42
|
+
# new({ particle: :blur, category: :effect, type: :int , specific: :shadow}) do |params|
|
43
|
+
# alert :cool
|
44
|
+
# if affect.nil?
|
45
|
+
# affect_to = affect
|
46
|
+
# else
|
47
|
+
# affect_to = [:self]
|
48
|
+
# end
|
49
|
+
# val= { value: params, affect: affect_to } unless params.instance_of?(Hash)
|
50
|
+
# val
|
51
|
+
# end
|
@@ -38,7 +38,6 @@ new({ renderer: :html, method: :apply, type: :string }) do |parent_found, _user_
|
|
38
38
|
alpha = parent_found.alpha
|
39
39
|
html.style(:backgroundColor, "rgba(#{red}, #{green}, #{blue}, #{alpha})")
|
40
40
|
when :paint
|
41
|
-
|
42
41
|
# if when found colors when use it for the gradient , else whe use the colors within the current atome
|
43
42
|
# gradient_found = params[:colors] || @apply
|
44
43
|
# we get all the paint atomes applied to the current atome
|
@@ -75,6 +74,17 @@ new({ renderer: :html, method: :apply, type: :string }) do |parent_found, _user_
|
|
75
74
|
# full_gradient_to_apply=gradients_to_apply.join(',')
|
76
75
|
full_gradient_to_apply = gradients_to_apply.last
|
77
76
|
html.style(:background, full_gradient_to_apply)
|
77
|
+
when :border
|
78
|
+
border.each do |border_id_found|
|
79
|
+
border_found = grab(border_id_found)
|
80
|
+
red = border_found.red * 255
|
81
|
+
green = border_found.green * 255
|
82
|
+
blue = border_found.blue * 255
|
83
|
+
alpha = border_found.alpha
|
84
|
+
thickness = border_found.thickness
|
85
|
+
pattern = border_found.pattern
|
86
|
+
html.style(:border, "#{pattern} #{thickness}px rgba(#{red},#{green},#{blue},#{alpha})")
|
87
|
+
end
|
78
88
|
else
|
79
89
|
#
|
80
90
|
end
|
@@ -52,16 +52,32 @@ new({ method: :remove, renderer: :html, type: :string }) do |object_id_to_remove
|
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
55
|
+
# new({ method: :border, type: :hash, renderer: :html }) do |value, _user_proc|
|
56
|
+
# thickness = value[:thickness] || 5
|
57
|
+
# type = value[:pattern] || :solid
|
58
|
+
#
|
59
|
+
# if value[:color].instance_of? Atome
|
60
|
+
# color_found = value[:color]
|
61
|
+
# else
|
62
|
+
# color_found = grab('black_matter').color(value[:color])
|
63
|
+
# end
|
64
|
+
#
|
65
|
+
# red = color_found.red * 255
|
66
|
+
# green = color_found.green * 255
|
67
|
+
# blue = color_found.blue * 255
|
68
|
+
# alpha = color_found.alpha
|
69
|
+
#
|
70
|
+
# html.style(:border, "#{type} #{thickness}px rgba(#{red},#{green},#{blue},#{alpha})")
|
71
|
+
# end
|
72
|
+
new({ method: :thickness, type: :integer, renderer: :html}) do |params|
|
73
|
+
# now we refresh if needed for dynamic refresh od affected atomes
|
74
|
+
# html.style(:border, "#{type} #{thickness}px rgba(#{red},#{green},#{blue},#{alpha})")
|
75
|
+
affect(affect)
|
76
|
+
end
|
55
77
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
"#{color_found.red * 255},#{color_found.green * 255},#{color_found.blue * 255},#{color_found.alpha} "
|
62
|
-
else
|
63
|
-
"0,0,0,1"
|
64
|
-
end
|
65
|
-
|
66
|
-
html.style(:border, "#{type} #{thickness}px rgba(#{color})")
|
78
|
+
# end
|
79
|
+
new({ method: :pattern, type: :integer, renderer: :html}) do |params|
|
80
|
+
# now we refresh if needed for dynamic refresh od affected atomes
|
81
|
+
# html.style(:border, "#{type} #{thickness}px rgba(#{red},#{green},#{blue},#{alpha})")
|
82
|
+
affect(affect)
|
67
83
|
end
|
@@ -22,33 +22,6 @@ new({ renderer: :html, method: :edit }) do |params|
|
|
22
22
|
html.update_data(params)
|
23
23
|
end
|
24
24
|
|
25
|
-
new({ method: :border, type: :hash, renderer: :html }) do |value, _user_proc|
|
26
|
-
thickness = value[:thickness] || 5
|
27
|
-
type = value[:pattern] || :solid
|
28
|
-
# color = if value[:color]
|
29
|
-
# color_found = value[:color]
|
30
|
-
# "#{color_found.red * 255},#{color_found.green * 255},#{color_found.blue * 255},#{color_found.alpha} "
|
31
|
-
# else
|
32
|
-
# "0,0,0,1"
|
33
|
-
# end
|
34
|
-
if value[:color].instance_of? Atome
|
35
|
-
color_found= value[:color]
|
36
|
-
else
|
37
|
-
color_found=grab('black_matter').color(value[:color])
|
38
|
-
end
|
39
|
-
|
40
|
-
# alert "atome found 2 : #{color_found}"
|
41
|
-
red = color_found.red* 255
|
42
|
-
green = color_found.green* 255
|
43
|
-
blue = color_found.blue* 255
|
44
|
-
alpha = color_found.alpha
|
45
|
-
# alert "rgba(#{red},#{green},#{blue},#{alpha})"
|
46
|
-
# color_found= "#{1 * 255},#{color_found.green * 255},#{0 * 255},#{0.3} "
|
47
|
-
|
48
|
-
html.style(:border, "#{type} #{thickness}px rgba(#{red},#{green},#{blue},#{alpha})")
|
49
|
-
# html.style(:border, "#{type} #{thickness}px rgba(#{color_found})")
|
50
|
-
# html.style(:border, "solid 12px rgba(255, 255, 120, 0,3)")
|
51
|
-
end
|
52
25
|
|
53
26
|
new({ method: :clean, renderer: :html, type: :hash }) do |params|
|
54
27
|
html.table_clean(params)
|
@@ -9,6 +9,7 @@ new({ method: :top, type: :integer, renderer: :html }) do |params|
|
|
9
9
|
unit = @unit[:top] || :px if params.is_a? Numeric
|
10
10
|
js[:style][:top] = "#{params}#{unit}"
|
11
11
|
end
|
12
|
+
|
12
13
|
new({ method: :bottom, type: :integer, renderer: :html }) do |params|
|
13
14
|
unit = @unit[:bottom] || :px if params.is_a? Numeric
|
14
15
|
js[:style][:bottom] = "#{params}#{unit}"
|
@@ -20,7 +21,10 @@ new({ method: :right, type: :integer, renderer: :html }) do |params|
|
|
20
21
|
js[:style][:right] = "#{params}#{unit}"
|
21
22
|
end
|
22
23
|
|
23
|
-
new({ method: :top, type: :integer, renderer: :html, specific: :shadow })
|
24
|
+
new({ method: :top, type: :integer, renderer: :html, specific: :shadow }) do
|
25
|
+
# now we refresh if needed for dynamic refresh od affected atomes
|
26
|
+
affect(affect)
|
27
|
+
end
|
24
28
|
|
25
29
|
# new({ method: :top, type: :integer, renderer: :html, specific: :text }) do |params|
|
26
30
|
# unit = @unit[:left] || :px
|
@@ -33,7 +37,10 @@ new({ method: :top, type: :integer, renderer: :html, specific: :shadow })
|
|
33
37
|
|
34
38
|
new({ method: :left, type: :integer, specific: :color, renderer: :html })
|
35
39
|
|
36
|
-
new({ method: :left, type: :integer, renderer: :html, specific: :shadow })
|
40
|
+
new({ method: :left, type: :integer, renderer: :html, specific: :shadow }) do
|
41
|
+
# now we refresh if needed for dynamic refresh od affected atomes
|
42
|
+
affect(affect)
|
43
|
+
end
|
37
44
|
|
38
45
|
new({ method: :top, type: :integer, specific: :color, renderer: :html })
|
39
46
|
|
@@ -1,28 +1,48 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
c2=circle({top: 190, width: 99, height: 99})
|
3
|
+
# col=color({red: 1, green: 0.2, id: :the_col})
|
4
|
+
c = circle({ id: :the_circle })
|
5
|
+
b = box({ left: 333, id: :the_box })
|
6
|
+
c2 = circle({ top: 190, width: 99, height: 99, id: :dont_break })
|
8
7
|
# let's add the border
|
9
|
-
c2.border({ thickness: 5, color: :blue, pattern: :dotted })
|
10
|
-
c.border({ thickness: 5, color: col, pattern: :dotted })
|
11
|
-
b.border({ thickness: 5, color: col, pattern: :dotted })
|
12
|
-
|
13
8
|
wait 1 do
|
14
|
-
c2.
|
15
|
-
|
16
|
-
|
9
|
+
c2.shadow({
|
10
|
+
# id: :s1,
|
11
|
+
# affect: [:the_circle],
|
12
|
+
left: 9,
|
13
|
+
top: 3,
|
14
|
+
blur: 9,
|
15
|
+
invert: false,
|
16
|
+
red: 0, green: 0, blue: 0, alpha: 1
|
17
|
+
})
|
18
|
+
c2.border({ thickness: 5, red: 1, green: 0, blue: 0, alpha: 1, pattern: :dotted, id: :borderline })
|
17
19
|
end
|
20
|
+
c.border({ thickness: 5, red: 1, green: 1, blue: 0, alpha: 1, pattern: :dotted })
|
21
|
+
b.border({ thickness: 5, red: 0, green: 1, blue: 0, alpha: 1, pattern: :dotted })
|
18
22
|
|
23
|
+
wait 2 do
|
24
|
+
c2.border({ thickness: 5, red: 1, green: 1, blue: 0, alpha: 1, pattern: :solid })
|
25
|
+
c.border({ thickness: 5, red: 1, green: 1, blue: 0, alpha: 1, pattern: :dotted })
|
26
|
+
b.border({ thickness: 3, red: 1, green: 1, blue: 0, alpha: 1, pattern: :dotted })
|
27
|
+
end
|
28
|
+
#
|
19
29
|
b.touch(true) do
|
20
30
|
|
21
|
-
|
22
|
-
|
31
|
+
b.border({ thickness: 5, red: 1, green: 1, blue: 1, alpha: 1, pattern: :dotted, id: :the_door })
|
32
|
+
puts " no new atome added!, number of atomes: #{Universe.atomes.length}"
|
33
|
+
b.apply([:the_door])
|
34
|
+
c.apply([:the_door])
|
35
|
+
c2.apply([:the_door])
|
36
|
+
wait 3 do
|
37
|
+
# if the_door (border) is change all affect atomes are refreshed
|
38
|
+
grab(:the_door).red(0)
|
39
|
+
grab(:the_door).thickness(20)
|
40
|
+
grab(:the_door).pattern(:solid)
|
41
|
+
end
|
23
42
|
end
|
43
|
+
|
24
44
|
# wait 6 do
|
25
|
-
#
|
45
|
+
# image(:red_planet)
|
26
46
|
# end
|
27
47
|
|
28
48
|
# # frozen_string_literal: true
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
cc=color({red: 1, blue: 0.1,id: :the_col})
|
4
|
+
b=box({ left: 12, id: :the_first_box, apply: cc.id })
|
5
|
+
c=circle({ left: 99, top: 99 })
|
6
|
+
|
7
|
+
wait 1 do
|
8
|
+
c.increment({left: 33, top: 99})
|
9
|
+
b.increment({left: 33, top: 99})
|
10
|
+
wait 1 do
|
11
|
+
c.increment({width: 33, top: -22})
|
12
|
+
b.increment({width: 33, top: -9})
|
13
|
+
cc.increment({red: -0.5})
|
14
|
+
wait 1 do
|
15
|
+
cc.increment({blue: 1})
|
16
|
+
end
|
17
|
+
# Atome.sync(:ok)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
# wait 3 do
|
22
|
+
# color(:red)
|
23
|
+
# end
|
@@ -22,12 +22,12 @@ def matrix(id, horizontal_nb, vertical_nb, spacing, size)
|
|
22
22
|
end
|
23
23
|
box_width = available_width / horizontal_nb
|
24
24
|
box_height = available_height / vertical_nb
|
25
|
-
|
25
|
+
background=box({id: :background, width: 666, height: 666, color:{alpha: 0}})
|
26
26
|
vertical_nb.times do |y|
|
27
27
|
horizontal_nb.times do |x|
|
28
28
|
id_generated = "#{id}_#{x}_#{y}"
|
29
29
|
matrix_cells << id_generated
|
30
|
-
new_box = box({ id: id_generated })
|
30
|
+
new_box = background.box({ id: id_generated })
|
31
31
|
new_box.width(box_width)
|
32
32
|
new_box.height(box_height)
|
33
33
|
new_box.left((box_width + spacing) * x + spacing)
|
@@ -142,4 +142,12 @@ test_cell.touch(true) do
|
|
142
142
|
# test_cell.color(:blue)
|
143
143
|
# end
|
144
144
|
|
145
|
-
end
|
145
|
+
end
|
146
|
+
wait 1 do
|
147
|
+
@current_matrix.width(33)
|
148
|
+
end
|
149
|
+
@current_matrix.drag(true)
|
150
|
+
wait 2 do
|
151
|
+
grab(:background).left(666)
|
152
|
+
grab(:background).drag(true)
|
153
|
+
end
|
@@ -34,7 +34,7 @@ wait 2 do
|
|
34
34
|
end
|
35
35
|
|
36
36
|
|
37
|
-
the_text = text({ data: 'text with shadow!', center: true, top: 222, width: 777, component: { size: 66 } })
|
37
|
+
the_text = text({ data: 'text with shadow!', center: true, top: 222, width: 777, component: { size: 66 }, id: :my_text })
|
38
38
|
|
39
39
|
|
40
40
|
the_text.shadow({
|
@@ -48,3 +48,13 @@ the_text.left(255)
|
|
48
48
|
the_text.top(66)
|
49
49
|
the_text.color(:red)
|
50
50
|
|
51
|
+
wait 1 do
|
52
|
+
text_shadow= grab(:my_shadow)
|
53
|
+
text_shadow.alpha(0.5)
|
54
|
+
text_shadow.left(120)
|
55
|
+
text_shadow.blur({ value: 1 })
|
56
|
+
|
57
|
+
# grab(:my_text).refresh(true)
|
58
|
+
|
59
|
+
end
|
60
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: atome
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.6.
|
4
|
+
version: 0.5.6.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jean-Eric Godard
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-03-
|
11
|
+
date: 2024-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: artoo
|
@@ -568,6 +568,7 @@ files:
|
|
568
568
|
- vendor/assets/application/examples/hypertext.rb
|
569
569
|
- vendor/assets/application/examples/image.rb
|
570
570
|
- vendor/assets/application/examples/import.rb
|
571
|
+
- vendor/assets/application/examples/increment.rb
|
571
572
|
- vendor/assets/application/examples/infos.rb
|
572
573
|
- vendor/assets/application/examples/int8.rb
|
573
574
|
- vendor/assets/application/examples/keyboard.rb
|