atome 0.5.6.3.9 → 0.5.6.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 50aa2e035c24b8f040b78e9c89d21f24a6b01c85964648144ca824ff233660b7
4
- data.tar.gz: 39f4bb9912f2ab249b9b9ab243a11e56ba8849e8a6c5d58a0cc5a8030b4c9ac4
3
+ metadata.gz: be5a4e028a94d97ed9c98c222aadee8ff85e4be1e2e920c68cf3004dd7e1d0ee
4
+ data.tar.gz: 771096cb369eaed0fcc571e174e5c3b772b88fb227e4a3df8c34487530923a5c
5
5
  SHA512:
6
- metadata.gz: f3ed175fb148279bf81a429537d72fe34ed764a70faef89752a023287ea4ff8326fa91043fa435e52b6a5df748e608d74e0e7f61c729124b5166555b5b73f623
7
- data.tar.gz: 6c63feaf029082134e92ea2477fed7bd53ae6bcc22d310a112199bcb4f18fd0cfa9c3bf1a2a5686479b6b9d2e2fbcc30cac53b400786e640d404ad60ff0fdcf9
6
+ metadata.gz: 01fb8cb48f2cf2c4a5be2001dc2db338f9a9f1792c96d81760226384936f675b0fc67338647ccdfcec459158a801a8c498149a01c8d27859f8c0ead10eb63507
7
+ data.tar.gz: f7d499f608aef58e19148e435e6fa57b16a6aaa72e6bbb0f34a993571327950281540dd1e67822025cd858a3d05fbac861c55c31c67fdd1b54bb8a94ccc22539
data/lib/atome/atome.rb CHANGED
@@ -7,40 +7,52 @@ class Atome
7
7
  def aid(_v=nil)
8
8
  @aid
9
9
  end
10
+
10
11
  def initialize(new_atome = {}, &atomes_proc)
11
12
  # TODO: atome format should always be as followed : {value: 0.44, unit: :px, opt1: 554}
12
13
  # when using optimised version of atome you must type eg : a.set({left: {value: 33, unit: '%', reference: :center}})
14
+ # if Universe.atomes[new_atome[:id]]
15
+ # # puts "------ 2 #{new_atome[:id]} => #{Universe.atomes[new_atome[:id]]}"
16
+ # # puts 'atome_id already exist'
17
+ # # old_atome= grab(new_atome[:id])
18
+ # # new_atome.each do |element, value|
19
+ # # old_atome.send(element, value)
20
+ # # end
21
+ # # return false
22
+ # alert "atome found : #{ grab(new_atome[:id])}"
23
+ # grab(new_atome[:id])
24
+ # else
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
+ @unit = {}
33
+ @collect = {}
34
+ @collect = {}
35
+ @int8= {}
36
+ @css = {}
37
+ @aid = identity_generator(:a)
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
+ @category = []
44
+ # @display = { mode: :default }
45
+ # @backup={} # mainly used to restore particle when using grid /table /list display mode
46
+ @html = HTML.new(@id, self)
47
+ @headless = Headless.new(@id, self)
48
+ # now we store the proc in a an atome's property called :bloc
49
+ new_atome[:code] = atomes_proc if atomes_proc
50
+ # we reorder the hash
51
+ reordered_atome =reorder_particles(new_atome)
52
+ # FIXME : try to remove the condition below (it crash in the method : def generator ... in genesis.rb)
53
+ collapse(reordered_atome)
54
+ # end
13
55
 
14
- # the keys :renderers, :type and :id should be placed in the first position in the hash
15
- @history = {}
16
- # @language = :english
17
- # @callback = {}
18
- @tag = {}
19
- @selected = false
20
- #@metrics = {}
21
- @unit = {}
22
- @collect = {}
23
- @collect = {}
24
- @int8= {}
25
- @css = {}
26
- @aid = identity_generator(:a)
27
- Universe.add_to_atomes( @aid, self)
28
- @id = new_atome[:id] || @aid
29
- Universe.id_to_aid(@id,@aid)
30
- @type = new_atome[:type] || :element
31
- @attached = []
32
- @category = []
33
- # @display = { mode: :default }
34
- # @backup={} # mainly used to restore particle when using grid /table /list display mode
35
- @html = HTML.new(@id, self)
36
- @headless = Headless.new(@id, self)
37
- # now we store the proc in a an atome's property called :bloc
38
- new_atome[:code] = atomes_proc if atomes_proc
39
- # we reorder the hash
40
- reordered_atome =reorder_particles(new_atome)
41
-
42
- # FIXME : try to remove the condition below (it crash in the method : def generator ... in genesis.rb)
43
- collapse(reordered_atome)
44
56
  end
45
57
 
46
58
  def js
@@ -1,13 +1,19 @@
1
1
  # frozen_string_literal: true
2
- new({ atome: :color, type: :hash }) do |params|
3
- # # TODO : hack must call it properly thru renderer
4
- # if params[:affect]
5
- # params[:affect].each do |affected|
6
- # grab(affected).html.reset_background
7
- # end
8
- # end
9
2
 
10
- end
3
+ new({ atome: :color, type: :hash })
4
+
5
+ # new({ post: :color }) do |params|
6
+ # puts "====> #{params}"
7
+ # params
8
+ # end
9
+ # new({ pre: :color}) do |params|
10
+ # alert "==> pre color params : #{params}"
11
+ # end
12
+
13
+ # new({ atome: :color, type: :hash })do |params|
14
+ # puts "1 #{params}______"
15
+ # params
16
+ # end
11
17
 
12
18
  # new ({post: :color}) do |params|
13
19
  # # # TODO : hack must call it properly thru renderer
@@ -16,7 +22,11 @@ end
16
22
  # # end
17
23
  # end
18
24
  new({ sanitizer: :color }) do |params|
25
+ # alert "sanitizer color: #{params}"
19
26
  params = create_color_hash(params) unless params.instance_of? Hash
27
+ # if params[:id]
28
+ # alert "id is #{params[:id]}"
29
+ # end
20
30
  # the condition below is to prevent the creation of multiple unwanted colors with same property and no ID specified
21
31
  unless params[:id]
22
32
  uniq_value = "#{params[:red].to_s.sub('.', '_')}_#{params[:green].to_s.sub('.', '_')}_#{params[:blue].to_s.sub('.', '_')}_#{params[:alpha].to_s.sub('.', '_')}_#{params[:left].to_s.sub('.', '_')}_#{params[:top].to_s.sub('.', '_')}_#{params[:diffusion].to_s.sub('.', '_')}"
@@ -37,6 +47,7 @@ new({ sanitizer: :image }) do |params|
37
47
  end
38
48
  # TODO : the line below should get the value from default params Essentials
39
49
  params
50
+
40
51
  end
41
52
  new({ post: :image }) do
42
53
  # we have find the size od the image to set it in the atome
@@ -6,7 +6,7 @@ class Genesis
6
6
 
7
7
  def create_particle(element, store, render)
8
8
  Atome.define_method "set_#{element}" do |params, &user_proc|
9
- particle_creation(element, params, store, render, &user_proc)
9
+ particle_creation(element, params, store, render, &user_proc)
10
10
  end
11
11
  end
12
12
 
@@ -72,8 +72,17 @@ class Genesis
72
72
  end
73
73
 
74
74
  def new_particle(element, store, render, &_method_proc)
75
+ # unless @id
76
+ # alert self.id
77
+ # end
78
+
75
79
  Atome.define_method element do |params = nil, &user_proc|
80
+ # if @id
81
+ # alert "======> #{self.class}"
76
82
  @history[element] ||= []
83
+ # else
84
+ # alert "======> #{self.inspect}"
85
+ # end
77
86
  if (params || params == false) && write_auth(element)
78
87
  params = particle_sanitizer(element, params, &user_proc)
79
88
  # the line below execute the main code when creating a new particle
@@ -87,7 +96,7 @@ class Genesis
87
96
  end
88
97
  end
89
98
 
90
- computed_params= send("set_#{element}", params, &user_proc) # sent to : create_particle / Atome.define_method "set_#{element}"
99
+ computed_params = send("set_#{element}", params, &user_proc) # sent to : create_particle / Atome.define_method "set_#{element}"
91
100
 
92
101
  # we historicize all write action below
93
102
  # we add the changes to the stack that must be synchronised
@@ -108,7 +117,9 @@ class Genesis
108
117
  else
109
118
  "send a valid password to read #{element} value"
110
119
  end
111
-
120
+ # else
121
+ #
122
+ # end
112
123
  end
113
124
  end
114
125
 
@@ -162,7 +173,18 @@ class Genesis
162
173
  # Object.const_set(element, Module.new)
163
174
  # we add the newly created atome to the list of "child in it's category, eg if it's a shape we add the new atome
164
175
  # to the shape particles list : @!atome[:shape] << params[:id]
165
- Atome.new(params, &user_proc)
176
+ # Atome.new(params, &user_proc)
177
+
178
+ if Universe.atomes[params[:id]]
179
+ # if atome id already exist we grab the previous one
180
+ # this prevent the creation of new atome if the atome already exist
181
+ previous_atome= grab(params[:id])
182
+ # now we must re-affect affected atomes
183
+ previous_atome.affect(params[:affect])
184
+ previous_atome
185
+ else
186
+ Atome.new(params, &user_proc)
187
+ end
166
188
  # Now we return the newly created atome instead of the current atome that is the parent cf: b=box; c=b.circle
167
189
  end
168
190
 
@@ -52,7 +52,6 @@ end
52
52
  new({ particle: :apply, category: :hierarchy, type: :string, render: false, store: false }) do |parents_ids, &user_proc|
53
53
  # TODO: optimize the 2 lines below:
54
54
  # html.reset_background
55
- # alert :ok
56
55
  @apply ||= []
57
56
  parents_ids = [parents_ids] unless parents_ids.instance_of?(Array)
58
57
  parents_ids.each do |parent_id|
@@ -7,20 +7,20 @@ new({ sanitizer: :id }) do |params|
7
7
  # first we sanitize the the id below
8
8
 
9
9
  params = params.to_sym
10
- # we check id is already assign
11
- if Universe.atomes[params]
12
- # we reassign the old id
13
- puts "the id : #{params} is already used"
14
- params = @id
15
- # return false
16
- else
10
+ # # we check id is already assign
11
+ # if Universe.atomes[params]
12
+ # # we reassign the old id
13
+ # puts "the id : #{params} is already used"
14
+ # params = @id
15
+ # # return false
16
+ # else
17
17
  if @id.to_sym != params
18
18
  Universe.update_atome_id(params, self, @id)
19
19
  else
20
20
  Universe.add_to_atomes(params, self)
21
21
  end
22
22
 
23
- end
23
+ # end
24
24
  params
25
25
  end
26
26
  new({ particle: :name, category: :identity, type: :string })
@@ -12,19 +12,35 @@ end
12
12
  new({ particle: :hide, category: :material, type: :boolean })
13
13
 
14
14
  new({ particle: :remove, category: :property, type: :hash }) do |params|
15
+ if params.instance_of? Hash
16
+ if params[:row]
17
+ data.delete_at(params[:row])
15
18
 
16
- if params[:row]
17
- data.delete_at(params[:row])
18
-
19
- elsif params[:column]
20
- column = params[:column]
21
- data.map do |hash|
22
- hash.delete(hash.keys[column]) if hash.keys[column]
23
- hash
19
+ elsif params[:column]
20
+ column = params[:column]
21
+ data.map do |hash|
22
+ hash.delete(hash.keys[column]) if hash.keys[column]
23
+ hash
24
+ end
25
+ # elsif params[:all]
26
+ # apply.each do |applied_atome|
27
+ # if grab(applied_atome).type.to_sym == params[:all].to_sym
28
+ # puts "!go"
29
+ # end
30
+ # end
31
+ # puts "so_good #{params}"
32
+ # puts "***> #{apply}"
24
33
  end
34
+ params
35
+ else
36
+
37
+ params
25
38
  end
26
- params
39
+
40
+
27
41
  end
42
+ # new({ particle: :remove, category: :property, type: :hash })
43
+
28
44
 
29
45
  new({ post: :remove }) do |params|
30
46
  # TODO : we have to rethink the removal of atome and particles (with exception like category) and maybe 'use particle type' to handle removal
@@ -38,13 +54,17 @@ new({ post: :remove }) do |params|
38
54
  paint.each do |atome_id_found|
39
55
  @apply.delete(atome_id_found)
40
56
  end
57
+ when :shadow
58
+ shadow.each do |atome_id_found|
59
+ @apply.delete(atome_id_found)
60
+ end
41
61
  else
42
62
  params.each do |particle, value|
43
63
  case particle
44
64
  when :category
45
65
  @category.delete(value) if particle == :category
46
66
  else
47
- puts 'write code'
67
+ puts 'write code to remove atome applied'
48
68
  end
49
69
  end
50
70
 
@@ -45,7 +45,12 @@ class Atome
45
45
  def preset_common(params, &bloc)
46
46
  ## if an atome with current id exist we update the ID in the params
47
47
  # params[:id] = "#{params[:id]}_#{Universe.atomes.length}" if grab(params[:id])
48
+ # if Universe.atomes[params[:id]]
49
+ # alert "atome found : #{ grab(params[:id])}"
50
+ # grab(params[:id])
51
+ # else
48
52
  Atome.new(params, &bloc)
53
+ # end
49
54
  end
50
55
 
51
56
  def box(params = {}, &bloc)
data/lib/atome/version.rb CHANGED
@@ -2,6 +2,5 @@
2
2
 
3
3
  # return atome version
4
4
  class Atome
5
- VERSION = '0.5.6.3.9'
5
+ VERSION = '0.5.6.4.1'
6
6
  end
7
-
data/lib/atome.rb CHANGED
@@ -13,7 +13,7 @@ require 'atome/helpers/color_helper/color'
13
13
  require 'atome/extensions/atome'
14
14
  require 'atome/extensions/mathematics'
15
15
  require 'atome/atome'
16
- require 'atome/genesis/atome'
16
+ require 'atome/genesis/atomes'
17
17
  require 'atome/presets/atome'
18
18
  require 'atome/genesis/particles/atome'
19
19
  require 'atome/genesis/particles/communication'
@@ -12,7 +12,7 @@ require_relative './atome/helpers/color_helper/color'
12
12
  require_relative './atome/extensions/atome'
13
13
  require_relative './atome/extensions/mathematics'
14
14
  require_relative './atome/atome'
15
- require_relative './atome/genesis/atome'
15
+ require_relative './atome/genesis/atomes'
16
16
  require_relative './atome/presets/atome'
17
17
  require_relative './atome/genesis/particles/atome'
18
18
  require_relative './atome/genesis/particles/communication'
@@ -210,8 +210,8 @@ class HTML
210
210
  end
211
211
 
212
212
  def connect(params, &bloc)
213
- type= params[:type]
214
- server= params[:address]
213
+ type = params[:type]
214
+ server = params[:address]
215
215
  # user=params[:user]
216
216
  # pass=params[:pass]
217
217
  # atomes=params[:atomes]
@@ -1401,72 +1401,136 @@ class HTML
1401
1401
 
1402
1402
  end
1403
1403
 
1404
- def table_remove(params)
1405
- if params[:row]
1406
- row_index = params[:row]
1407
- table_element = JS.global[:document].querySelector("##{@id} table")
1408
-
1409
- if table_element.nil?
1410
- puts 'Table not found'
1411
- return
1412
- end
1404
+ def remove(params)
1405
+ # puts "remove => #{params}"
1406
+ # TODO: FIXME: "html : must create a case here #{params} (#{@original_atome.id})"
1407
+ case params
1408
+ when Hash
1409
+ params.each do |k, v|
1410
+ case k
1411
+ when :row
1412
+ row_index = params[:row]
1413
+ table_element = JS.global[:document].querySelector("##{@id} table")
1414
+
1415
+ if table_element.nil?
1416
+ puts 'Table not found'
1417
+ return
1418
+ end
1413
1419
 
1414
- rows = table_element.querySelectorAll('tbody tr').to_a
1420
+ rows = table_element.querySelectorAll('tbody tr').to_a
1415
1421
 
1416
- if row_index >= rows.length
1417
- puts "row not found : #{row_index}"
1418
- return
1419
- end
1420
- row_to_remove = rows[row_index]
1422
+ if row_index >= rows.length
1423
+ puts "row not found : #{row_index}"
1424
+ return
1425
+ end
1426
+ row_to_remove = rows[row_index]
1421
1427
 
1422
- row_to_remove[:parentNode].removeChild(row_to_remove)
1428
+ row_to_remove[:parentNode].removeChild(row_to_remove)
1423
1429
 
1424
- rows.each_with_index do |row, i|
1425
- next if i <= row_index
1426
- end
1427
- elsif params[:column]
1428
- column_index = params[:column]
1429
- table_element = JS.global[:document].querySelector("##{@id} table")
1430
+ rows.each_with_index do |row, i|
1431
+ next if i <= row_index
1432
+ end
1433
+ when :column
1434
+ column_index = params[:column]
1435
+ table_element = JS.global[:document].querySelector("##{@id} table")
1430
1436
 
1431
- if table_element.nil?
1432
- puts 'Table not found'
1433
- return
1434
- end
1437
+ if table_element.nil?
1438
+ puts 'Table not found'
1439
+ return
1440
+ end
1435
1441
 
1436
- rows = table_element.querySelectorAll('tbody tr').to_a
1437
- rows.each do |row|
1438
- cells = row.querySelectorAll('td').to_a
1439
- if column_index < cells.length
1440
- cell_to_remove = cells[column_index]
1441
- cell_to_remove[:parentNode].removeChild(cell_to_remove)
1442
+ rows = table_element.querySelectorAll('tbody tr').to_a
1443
+ rows.each do |row|
1444
+ cells = row.querySelectorAll('td').to_a
1445
+ if column_index < cells.length
1446
+ cell_to_remove = cells[column_index]
1447
+ cell_to_remove[:parentNode].removeChild(cell_to_remove)
1448
+ end
1449
+ end
1450
+ when :all
1451
+ case v
1452
+ when :paint
1453
+ style(:background, 'black')
1454
+ # style('box-shadow', 'none')
1455
+ # style('text-shadow', 'none')
1456
+ when :color
1457
+ when :shadow
1458
+ style('box-shadow', 'none')
1459
+ style('text-shadow', 'none')
1460
+ end
1442
1461
  end
1443
1462
  end
1444
-
1445
- end
1446
- end
1447
-
1448
- def reset_background
1449
- style(:background, 'black')
1450
- end
1451
-
1452
- def remove(params)
1453
- #TODO: FIXME: "html : must create a case here #{params} (#{@original_atome.id})"
1454
-
1455
- # puts @original_atome.color[0]
1456
-
1457
- reset_background
1463
+ else
1464
+ @original_atome.apply.delete(params)
1465
+ style(:background, 'black')
1466
+ style('box-shadow', 'none')
1467
+ style('text-shadow', 'none')
1468
+ @original_atome.apply(@original_atome.apply)
1469
+ end
1470
+ # alert "remove : #{params} , type: #{@original_atome.type}"
1471
+ # reset_background
1458
1472
  # style(:background, '')
1459
1473
  # style(:background, 'black')
1460
1474
  # @original_atome.color(:red)
1461
1475
  # @original_atome.apply(@original_atome.color[0])
1462
1476
  end
1477
+
1478
+ def table_remove(params)
1479
+ if params[:row]
1480
+ # row_index = params[:row]
1481
+ # table_element = JS.global[:document].querySelector("##{@id} table")
1482
+ #
1483
+ # if table_element.nil?
1484
+ # puts 'Table not found'
1485
+ # return
1486
+ # end
1487
+ #
1488
+ # rows = table_element.querySelectorAll('tbody tr').to_a
1489
+ #
1490
+ # if row_index >= rows.length
1491
+ # puts "row not found : #{row_index}"
1492
+ # return
1493
+ # end
1494
+ # row_to_remove = rows[row_index]
1495
+ #
1496
+ # row_to_remove[:parentNode].removeChild(row_to_remove)
1497
+ #
1498
+ # rows.each_with_index do |row, i|
1499
+ # next if i <= row_index
1500
+ # end
1501
+ elsif params[:column]
1502
+ # column_index = params[:column]
1503
+ # table_element = JS.global[:document].querySelector("##{@id} table")
1504
+ #
1505
+ # if table_element.nil?
1506
+ # puts 'Table not found'
1507
+ # return
1508
+ # end
1509
+ #
1510
+ # rows = table_element.querySelectorAll('tbody tr').to_a
1511
+ # rows.each do |row|
1512
+ # cells = row.querySelectorAll('td').to_a
1513
+ # if column_index < cells.length
1514
+ # cell_to_remove = cells[column_index]
1515
+ # cell_to_remove[:parentNode].removeChild(cell_to_remove)
1516
+ # end
1517
+ # end
1518
+
1519
+ end
1520
+ end
1521
+
1522
+ # def reset_background
1523
+ # style(:background, 'black')
1524
+ # style('box-shadow', 'none')
1525
+ # style('text-shadow', 'none')
1526
+ # end
1527
+
1463
1528
  # atomisation!
1464
1529
  def atomized(html_object)
1465
1530
  html_object = html_object[0] if html_object.instance_of? Array
1466
1531
  @element = html_object
1467
1532
  end
1468
1533
 
1469
-
1470
1534
  # def center(options, attach)
1471
1535
  # parent = grab(attach)
1472
1536
  #
@@ -25,14 +25,29 @@ end
25
25
  new({ method: :border, type: :hash, renderer: :html }) do |value, _user_proc|
26
26
  thickness = value[:thickness] || 5
27
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
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
34
39
 
35
- html.style(:border, "#{type} #{thickness}px rgba(#{color})")
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)")
36
51
  end
37
52
 
38
53
  new({ method: :clean, renderer: :html, type: :hash }) do |params|
@@ -44,7 +59,8 @@ new({ method: :insert, renderer: :html, type: :hash }) do |params|
44
59
  end
45
60
 
46
61
  new({ method: :remove, renderer: :html, type: :hash }) do |params|
47
- html.table_remove(params)
62
+ # alert "===> #{params}"
63
+ # html.table_remove(params)
48
64
  html.remove(params)
49
65
  end
50
66
 
@@ -1,14 +1,29 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
 
4
- col=color({red: 1, blue: 1, id: :the_col})
4
+ col=color({red: 1, green: 0.2, id: :the_col})
5
5
  c=circle
6
6
  b=box({left: 333})
7
7
  c2=circle({top: 190, width: 99, height: 99})
8
- c2.border({ thickness: 5, color: color(:blue), pattern: :dotted })
8
+ # let's add the border
9
+ c2.border({ thickness: 5, color: :blue, pattern: :dotted })
9
10
  c.border({ thickness: 5, color: col, pattern: :dotted })
10
11
  b.border({ thickness: 5, color: col, pattern: :dotted })
11
12
 
13
+ wait 1 do
14
+ c2.border({ thickness: 5, color: :green, pattern: :dotted })
15
+ c.border({ thickness: 5, color: :green, pattern: :dotted })
16
+ b.border({ thickness: 5, color: :green, pattern: :dotted })
17
+ end
18
+
19
+ b.touch(true) do
20
+
21
+ b.border({ thickness: 5, color: { red: 1, green: 0 }, pattern: :dotted })
22
+ puts " no new atome added!, number of atomes: #{Universe.atomes.length}"
23
+ end
24
+ # wait 6 do
25
+ # iamge(:red_planet)
26
+ # end
12
27
 
13
28
  # # frozen_string_literal: true
14
29
  #
@@ -2,15 +2,23 @@
2
2
 
3
3
  b = box()
4
4
  b.text('click me')
5
-
5
+ orange=''
6
6
  b.touch(true) do
7
- c = grab(:view).circle({id: :circling, left: 222, color: :orange, blur: 6 })
8
- c.box({id: :boxing,color: :orange, width: 33, height: 33, left: 123})
9
- c.box({id: :boxy,color: :red, width: 33, height: 33, left: 333})
7
+ c = grab(:view).circle({id: :circling, left: 222, color: :orange, blur: 1.9 })
8
+ orange=c.box({id: :boxing,color: {id: :orange_col, red: 1, blue: 0.2 }, width: 33, height: 33, left: 123})
9
+ orange.shadow({
10
+ id: :s1,
11
+ # affect: [:the_circle],
12
+ left: 9, top: 3, blur: 9,
13
+ invert: false,
14
+ red: 0, green: 0, blue: 0, alpha: 1
15
+ })
16
+ c.box({id: :boxy,color: {id: :red_col, red: 1 }, width: 33, height: 33, left: 333})
10
17
  c.text('tap here')
11
18
  wait 0.5 do
12
19
  c.delete(:left)
13
20
  wait 0.5 do
21
+ # orange.color(:pink)
14
22
  c.delete(:blur)
15
23
  end
16
24
  end
@@ -18,8 +26,12 @@ b.touch(true) do
18
26
  c.touch(true) do
19
27
  c.delete({ recursive: true })
20
28
  end
29
+ # alert orange.apply
21
30
  end
22
31
 
32
+
33
+
34
+
23
35
  ############
24
36
  # b = box({left: 333, id: :the_box_1})
25
37
  # b.color({id: :the_orange_col, red: 1, blue: 0.5})
@@ -36,4 +36,4 @@ the_text.left(333)
36
36
 
37
37
  the_text.paint({ gradient: [col_1.id, col_2.id], direction: :left , id: :painted_love })
38
38
 
39
- # #TODO : gradient on text!
39
+
@@ -14,22 +14,34 @@ b.shadow({
14
14
  invert: false,
15
15
  red: 0, green: 0, blue: 0, alpha: 1
16
16
  })
17
+
18
+
17
19
  wait 1 do
18
20
  b.remove(:other_col)
19
21
  wait 1 do
20
22
  b.remove(:new_col)
21
23
  wait 1 do
22
24
  b.remove(:box_color)
25
+
23
26
  wait 1 do
24
27
  b.apply(:last_col)
25
28
  wait 1 do
26
29
  b.apply(:last_col2)
30
+ b.remove(:s1)
27
31
  end
28
32
  end
29
33
  end
30
34
  end
31
35
  end
32
36
  b.touch(true) do
37
+ b.shadow({
38
+ id: :s1,
39
+ # affect: [:the_circle],
40
+ left: 9, top: 3, blur: 9,
41
+ invert: false,
42
+ red: 0, green: 0, blue: 0, alpha: 1
43
+ })
44
+
33
45
  puts "before => #{b.apply}"
34
46
  b.remove({all: :color})
35
47
  puts "after => #{b.apply}"
@@ -40,6 +52,7 @@ b.touch(true) do
40
52
  b.remove(:the_gradient)
41
53
  wait 1 do
42
54
  b.remove(all: :shadow)
55
+ b.color(:cyan)
43
56
  end
44
57
  end
45
58
  end
@@ -7,7 +7,7 @@ c.touch(true) do
7
7
  alert :okk
8
8
  end
9
9
  m = matrix({ renderers: [:html], attach: :view, id: :my_test_box, type: :matrix, apply: [:shape_color],
10
- left: 333, top: 0, width: 600, smooth: 15, height: 900, overflow: :scroll, option: { header: true },
10
+ left: 333, top: 0, width: 900, smooth: 15, height: 900, overflow: :scroll, option: { header: true },
11
11
  component: {
12
12
  border: { thickness: 5, color: color(:blue), pattern: :dotted },
13
13
  overflow: :auto,
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.3.9
4
+ version: 0.5.6.4.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-02-28 00:00:00.000000000 Z
11
+ date: 2024-02-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: artoo
@@ -374,7 +374,6 @@ files:
374
374
  - LICENSE.txt
375
375
  - README.md
376
376
  - Rakefile
377
- - atome-0.5.6.2.7.gem
378
377
  - atome.gemspec
379
378
  - documentation/atome.md
380
379
  - documentation/basic.md
@@ -421,7 +420,7 @@ files:
421
420
  - lib/atome/extensions/mathematics.rb
422
421
  - lib/atome/extensions/ping.rb
423
422
  - lib/atome/extensions/sha.rb
424
- - lib/atome/genesis/atome.rb
423
+ - lib/atome/genesis/atomes.rb
425
424
  - lib/atome/genesis/genesis.rb
426
425
  - lib/atome/genesis/particles/atome.rb
427
426
  - lib/atome/genesis/particles/communication.rb
data/atome-0.5.6.2.7.gem DELETED
Binary file