atome 0.5.7.0.5 → 0.5.7.0.7

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: 23166944704e42b25801cc052708c19f265c1f8247dd3ff9b099944ecb415401
4
- data.tar.gz: 38a31b2cdcc6ceeef5453b926ee4d7eaf704e48c58039830126a94b5a430c188
3
+ metadata.gz: 64323bdc4b0ecf2f9a130c3632dcf0934dc15797035b20bf6549c11b11dcd672
4
+ data.tar.gz: 00ee111af8d4bed4b7ab415173fdd1aaa4aa84cbfbb5298457ff18dcad5f2c3a
5
5
  SHA512:
6
- metadata.gz: 86db3598d96617483482c8e97006bf3fe2e981be529cd871e75b7370b55838002914192c64dcb4b46cf72313f470a91a9ff3f2408fa5914439b84126c924cd44
7
- data.tar.gz: 655b083c5529f5ed4c642ee5c7457d2940062914433e072a582964ae1e7a4932423731b3a353d0f927d1d6db5b5d56386907d91d7011dfca53979b4e3c532608
6
+ metadata.gz: b47d3e83540561669ad27ebe0ad2a3f7fa7cb74c8ec7524248aa67edc9dd42f50d57b9aa32bd627940e02fd60b0289245a26b162791ceaf2de5856c7df4a9eff
7
+ data.tar.gz: 2c6bdc853586f7c0f9a516212c2f972b7070fcf2e229b64f16a70f76862c0443087c6d3d7b233f77620890130064d45691f8e8a93580476070b1f53bff1e7126
@@ -14,7 +14,7 @@ new({ particle: :size, category: :geometry, type: :int }) do |params|
14
14
  if params[:reference] == :x
15
15
  original_width = width
16
16
  width(params[:value])
17
- height(height * params[:value] / original_width)
17
+ height(height * params[:value] / original_width) if value
18
18
  else
19
19
  original_height = height
20
20
  height(params[:value])
@@ -64,7 +64,6 @@ end
64
64
  new(particle: :selected, category: :identity, type: :boolean) do |params|
65
65
  if params == true
66
66
  @selection_style = []
67
- # select_style= border({ thickness: 3, red: 1, green: 1, blue: 1, alpha: 1, pattern: :dotted })
68
67
  default_style = Universe.default_selection_style
69
68
  select_style = ''
70
69
  default_style.each do |atome_f, part_f|
@@ -215,3 +215,7 @@ end
215
215
  # Universe.allow_localstorage = true # to stop data to be stored in localstorage
216
216
  # Universe.allow_sync= false # to stop data to be sync on server
217
217
  touch_allow(false) # this lock the system right click in web view
218
+ # add a few default font
219
+ # A.add_text_visual({ path: 'Roboto', name: 'Roboto-Bold' })
220
+ # A.add_text_visual({ path: 'Roboto', name: 'Roboto-Thin' })
221
+ # A.add_text_visual({ path: 'Roboto', name: 'Roboto-LightItalic' })
@@ -27,7 +27,7 @@ class Universe
27
27
  @allow_tool_operations = false
28
28
  @active_tools = []
29
29
  @atome_preset = []
30
- @default_selection_style={border: { thickness: 3, red: 1, green: 1, blue: 1, alpha: 1, pattern: :dotted }}
30
+ @default_selection_style={border: { thickness: 1, red: 1, green: 0, blue: 0, alpha: 1, pattern: :dotted }}
31
31
  @applicable_atomes= %i[color shadow border paint animation]
32
32
  # @historicize=false
33
33
  class << self
data/lib/atome/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  # return atome version
4
4
  class Atome
5
- VERSION = '0.5.7.0.5'
5
+ VERSION = '0.5.7.0.7'
6
6
  end
@@ -309,6 +309,46 @@ new(molecule: :button) do |params, bloc|
309
309
  button
310
310
  end
311
311
 
312
+ new({ particle: :cells })
313
+
314
+ class Atome
315
+ def resize_matrix(params)
316
+
317
+ width(params[:width])
318
+ height(params[:height])
319
+ current_matrix=self
320
+ real_width = current_matrix.to_px(:width)
321
+ real_height = current_matrix.to_px(:height)
322
+ spacing = current_matrix.data[:spacing]
323
+ matrix_cells= current_matrix.data[:matrix]
324
+
325
+ total_spacing_x = spacing * (matrix_cells.collect.length ** (0.5) + 1)
326
+ total_spacing_y = spacing * (matrix_cells.collect.length ** (0.5) + 1)
327
+
328
+ if real_width > real_height
329
+ full_size = real_width
330
+ available_width = full_size - total_spacing_x
331
+ available_height = full_size - total_spacing_y
332
+ else
333
+ full_size = real_width
334
+ available_width = full_size - total_spacing_x
335
+ available_height = full_size - total_spacing_y
336
+ end
337
+
338
+ box_width = available_width / matrix_cells.collect.length ** (0.5)
339
+ box_height = available_height / matrix_cells.collect.length ** (0.5)
340
+
341
+ matrix_cells.collect.each_with_index do |box_id, index|
342
+ box = grab(box_id)
343
+ box.width(box_width)
344
+ box.height(box_height)
345
+ box.left((box_width + spacing) * (index % matrix_cells.collect.length ** (0.5)) + spacing)
346
+ box.top((box_height + spacing) * (index / matrix_cells.collect.length ** (0.5)).floor + spacing)
347
+ end
348
+
349
+ end
350
+ end
351
+
312
352
  new(molecule: :matrix) do |params, &bloc|
313
353
  id = params[:id]
314
354
  rows = params[:rows]
@@ -333,13 +373,13 @@ new(molecule: :matrix) do |params, &bloc|
333
373
  matrix_back = box({ id: "#{id}_background", width: size, height: size, color: { alpha: 0 } })
334
374
 
335
375
  if view_width > view_height
336
- full_size=view_height * size_coefficient
376
+ full_size = view_height * size_coefficient
337
377
  available_width = full_size - total_spacing_x
338
378
  available_height = full_size - total_spacing_y
339
379
  matrix_back.width(full_size)
340
380
  matrix_back.height(full_size)
341
381
  else
342
- full_size=view_width * size_coefficient
382
+ full_size = view_width * size_coefficient
343
383
  available_width = full_size - total_spacing_x
344
384
  available_height = full_size - total_spacing_y
345
385
  matrix_back.width(full_size)
@@ -360,15 +400,15 @@ new(molecule: :matrix) do |params, &bloc|
360
400
  end
361
401
  end
362
402
  current_matrix.collect(matrix_cells)
363
- current_matrix
364
- # end
403
+ matrix_back.cells(current_matrix)
404
+ params= params.merge({matrix: current_matrix})
405
+ matrix_back.data(params)
406
+ matrix_back
365
407
  end
366
408
  new(molecule: :page) do |params, &bloc|
367
-
368
409
  b = box({ color: :red, left: 99, drag: true })
369
410
  b.text(params)
370
411
  end
371
-
372
412
  new(molecule: :application) do |params, &bloc|
373
413
 
374
414
  main_page = box({ drag: true, width: :auto, height: :auto, top: 0, bottom: 0, left: 0, right: 0 })
@@ -4,6 +4,12 @@
4
4
 
5
5
  class HTML
6
6
 
7
+
8
+
9
+ # def id
10
+ # :poil
11
+ # end
12
+
7
13
  def self.locate(selector, base_element = JS.global[:document][:body])
8
14
  return base_element if selector.empty?
9
15
 
@@ -21,6 +27,7 @@ class HTML
21
27
  end
22
28
 
23
29
  def initialize(id_found, current_atome)
30
+
24
31
  @element ||= JS.global[:document].getElementById(id_found.to_s)
25
32
  @id = id_found
26
33
  @original_atome = current_atome
@@ -11,7 +11,7 @@ t.touch(true) do
11
11
  puts "#{b.touch} , #{b.touch_code}"
12
12
  b.touch_code[:touch].call
13
13
  end
14
- col = color({ id: :col1, red: 1, blue: 1 })
14
+ color({ id: :col1, red: 1, blue: 1 })
15
15
  # #######################
16
16
  atomes_monitored = [c, b]
17
17
  # particles_monitored=[:left, :width, :touch, :apply]
@@ -1,77 +1,20 @@
1
- # frozen_string_literal: true
2
-
3
- matrix_zone=box({width: 333, height: 333, drag: true, id: :the_box})
4
-
5
- # matrix creation
1
+ # # frozen_string_literal: true
2
+ #
3
+ matrix_zone = box({ width: 333, height: 333, drag: true, id: :the_box })
4
+ #
5
+ # # matrix creation
6
6
  main_matrix = matrix_zone.matrix({ id: :vie_0, rows: 8, columns: 8, spacing: 6, size: '100%' })
7
7
  main_matrix.smooth(3)
8
8
  main_matrix.color(:red)
9
9
 
10
- # on resize
11
- def resize_matrix(current_matrix, new_width, new_height, spacing, size)
12
- parent_found = current_matrix
13
- if size.instance_of? String
14
- size_coefficient = size.end_with?('%') ? (size.to_f / 100) : size.to_f / parent_found.to_px(:width)
15
- matrix_back = grab(:vie_0_background)
16
- spacing = spacing * size_coefficient
17
- total_spacing_x = spacing * (current_matrix.collect.length ** (0.5) + 1)
18
- total_spacing_y = spacing * (current_matrix.collect.length ** (0.5) + 1)
19
-
20
- if new_width > new_height
21
- full_size = new_height * size_coefficient
22
- available_width = full_size - total_spacing_x
23
- available_height = full_size - total_spacing_y
24
- matrix_back.width(full_size)
25
- matrix_back.height(full_size)
26
- else
27
- full_size = new_width * size_coefficient
28
- available_width = full_size - total_spacing_x
29
- available_height = full_size - total_spacing_y
30
- matrix_back.width(full_size)
31
- matrix_back.height(full_size)
32
- end
33
-
34
- box_width = available_width / current_matrix.collect.length ** (0.5)
35
- box_height = available_height / current_matrix.collect.length ** (0.5)
36
- current_matrix.collect.each_with_index do |box_id, index|
37
- box = grab(box_id)
38
- box.width(box_width)
39
- box.height(box_height)
40
- box.left((box_width + spacing) * (index % current_matrix.collect.length ** (0.5)) + spacing)
41
- box.top((box_height + spacing) * (index / current_matrix.collect.length ** (0.5)).floor + spacing)
42
- end
43
- else
44
- # dunno if we have to resize if size is specified in px
45
- # size.to_f / parent_found.to_px(:width)
46
- end
47
-
48
- end
49
-
50
10
  grab(:view).on(:resize) do
51
- matrix_parent = grab(:view)
52
- new_width = matrix_parent.width
53
- new_height = matrix_parent.height
54
- unless new_width.instance_of?(Numeric)
55
- new_width = matrix_parent.to_px(:width)
56
- end
57
- unless new_height.instance_of?(Numeric)
58
- new_height = matrix_parent.to_px(:height)
59
- end
60
- new_size = if new_height > new_width
61
- new_width
62
- else
63
- new_height
64
- end
65
- ratio = new_size / grab(:vie_0_background).width.to_f
66
- main_matrix.data[:spacing] = main_matrix.data[:spacing] * ratio
67
- matrix_spacing = main_matrix.data[:spacing]
68
- matrix_size = main_matrix.data[:size]
69
- resize_matrix(main_matrix, new_width, new_height, matrix_spacing, matrix_size)
70
- end
71
-
72
- matrix_to_treat=main_matrix
73
11
 
74
- #######################################################@
12
+ end
13
+ #
14
+ # matrix_to_treat=main_matrix
15
+ #
16
+ # #######################################################@
17
+ matrix_to_treat = main_matrix.cells
75
18
  matrix_to_treat.color(:blue)
76
19
  matrix_to_treat.smooth(6)
77
20
  matrix_to_treat.shadow({
@@ -80,15 +23,15 @@ matrix_to_treat.shadow({
80
23
  invert: false,
81
24
  red: 0, green: 0, blue: 0, alpha: 0.6
82
25
  })
83
- ###################
26
+ # ###################
84
27
  col_1 = color(:yellow)
85
28
  col_2 = color({ red: 1, id: :red_col })
86
29
 
87
30
  wait 3 do
88
- matrix_to_treat.paint({ gradient: [col_1.id, col_2.id], direction: :top })
31
+ matrix_to_treat.paint({ gradient: [col_1.id, col_2.id], direction: :top })
89
32
  end
90
33
 
91
- ###################
34
+ # ###################
92
35
 
93
36
  test_cell = grab(:vie_0_2_3)
94
37
  wait 1 do
@@ -116,3 +59,19 @@ wait 2 do
116
59
  grab(:vie_0_background).left(250)
117
60
  grab(:vie_0_background).drag(true)
118
61
  end
62
+ matrix_to_treat.touch(:down) do |event|
63
+ # alert el.inspect
64
+ current_cell= grab(event[:target][:id].to_s)
65
+ current_cell.color(:blue)
66
+ current_cell.selected(true)
67
+ end
68
+ main_matrix.cells.smooth(9)
69
+ main_matrix.color(:red)
70
+ main_matrix.cells.color(:yellow)
71
+ wait 5 do
72
+ main_matrix.resize_matrix({width: 555, height: 555})
73
+ end
74
+
75
+
76
+
77
+
@@ -1,55 +1,56 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- t = text({ data: 'touch me to select all', id: :the_text })
4
- b = box({ left: 12, id: :the_box })
5
- c = circle({ left: 230, id: :the_circle, color: { blue: 1, id: :c1 } })
6
- c.color({ green: 1, id: :c2 })
7
- # to change default selection style
8
- Universe.default_selection_style = { border: { thickness: 3, red: 1, green: 0, blue: 1, alpha: 1, pattern: :dotted } }
9
-
10
- c.touch(true) do
11
- if c.selected
12
- c.selected(false)
13
- else
14
- # c.selected(true)
15
- # example of custom selection style
16
- c.selected({ shadow: { id: :titi,
17
- left: 9, top: 3, blur: 9,
18
- invert: false,
19
- red: 0, green: 0, blue: 0, alpha: 1
20
- }, border: { id: :toto, thickness: 5, red: 1, green: 1, blue: 1, alpha: 1,
21
- pattern: :dotted, inside: true }
22
- })
23
- end
24
- end
25
-
26
- image({ path: 'medias/images/red_planet.png', id: :the__red_planet, top: 233 })
27
-
28
- t.touch(true) do
29
- puts "1 current_user - #{grab(Universe.current_user).selection}"
30
- puts "1 - b selected : #{b.selected}"
31
- grab(:view).attached.each do |atome_found|
32
- grab(atome_found).selected(true)
33
- end
34
- puts "2 - current_user : #{grab(Universe.current_user).selection}"
35
- puts "2 - b selected : #{b.selected}"
36
- selected_items = grab(Universe.current_user).selection # we create a group
37
-
38
- selected_items.each do |atome_id_selected|
39
- atome_selected = grab(atome_id_selected)
40
- atome_selected.width = rand(333)
41
- atome_selected.height = rand(333)
42
-
43
- end
44
- b.selected(false)
45
- puts "3 current_user- #{grab(Universe.current_user).selection}"
46
- puts "3 - b selected : #{b.selected}"
47
-
48
- grab(Universe.current_user).selection.color(:red)
49
- grab(Universe.current_user).selection.each do |el|
50
- puts el
51
- end
52
- puts grab(Universe.current_user).selection.collect
53
- end
54
-
3
+ # t = text({ data: 'touch me to select all', id: :the_text })
4
+ # b = box({ left: 12, id: :the_box })
5
+ # c = circle({ left: 230, id: :the_circle, color: { blue: 1, id: :c1 } })
6
+ # c.color({ green: 1, id: :c2 })
7
+ # # to change default selection style
8
+ # Universe.default_selection_style = { border: { thickness: 3, red: 1, green: 0, blue: 1, alpha: 1, pattern: :dotted } }
9
+ #
10
+ # c.touch(true) do
11
+ # if c.selected
12
+ # c.selected(false)
13
+ # else
14
+ # # c.selected(true)
15
+ # # example of custom selection style
16
+ # c.selected({ shadow: { id: :titi,
17
+ # left: 9, top: 3, blur: 9,
18
+ # invert: false,
19
+ # red: 0, green: 0, blue: 0, alpha: 1
20
+ # }, border: { id: :toto, thickness: 5, red: 1, green: 1, blue: 1, alpha: 1,
21
+ # pattern: :dotted, inside: true }
22
+ # })
23
+ # end
24
+ # end
25
+ #
26
+ # image({ path: 'medias/images/red_planet.png', id: :the__red_planet, top: 233 })
27
+ #
28
+ # t.touch(true) do
29
+ # puts "1 current_user - #{grab(Universe.current_user).selection}"
30
+ # puts "1 - b selected : #{b.selected}"
31
+ # grab(:view).attached.each do |atome_found|
32
+ # grab(atome_found).selected(true)
33
+ # end
34
+ # puts "2 - current_user : #{grab(Universe.current_user).selection}"
35
+ # puts "2 - b selected : #{b.selected}"
36
+ # selected_items = grab(Universe.current_user).selection # we create a group
37
+ #
38
+ # selected_items.each do |atome_id_selected|
39
+ # atome_selected = grab(atome_id_selected)
40
+ # atome_selected.width = rand(333)
41
+ # atome_selected.height = rand(333)
42
+ #
43
+ # end
44
+ # b.selected(false)
45
+ # puts "3 current_user- #{grab(Universe.current_user).selection}"
46
+ # puts "3 - b selected : #{b.selected}"
47
+ #
48
+ # grab(Universe.current_user).selection.color(:red)
49
+ # grab(Universe.current_user).selection.each do |el|
50
+ # puts el
51
+ # end
52
+ # puts grab(Universe.current_user).selection.collect
53
+ # end
54
+
55
+ image({ path: "./medias/images/logos/vie.svg", left: :auto, right: 3, top: 0 , size: 30})
55
56
 
@@ -16,10 +16,11 @@ html, body {
16
16
  z-index: 0;
17
17
  color: lightgray;
18
18
  }
19
- /*@font-face {*/
20
- /* font-family: 'MaPolicePersonnelle';*/
21
- /* src: url('../medias/fonts/Roboto/Roboto-Black.ttf') format('truetype');*/
22
- /*}*/
19
+ @font-face {
20
+ font-family: 'Roboto-Thin';
21
+ src: url('../medias/fonts/Roboto/Roboto-Thin.ttf') format('truetype');
22
+ }
23
+
23
24
  pre {
24
25
  min-width: 100px;
25
26
  margin: 0;
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.7.0.5
4
+ version: 0.5.7.0.7
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-04-26 00:00:00.000000000 Z
11
+ date: 2024-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: artoo
@@ -814,7 +814,6 @@ files:
814
814
  - vendor/assets/src/medias/images/icons/undo.svg
815
815
  - vendor/assets/src/medias/images/icons/undo2.svg
816
816
  - vendor/assets/src/medias/images/icons/validate.svg
817
- - vendor/assets/src/medias/images/icons/vie.svg
818
817
  - vendor/assets/src/medias/images/icons/wave-saw.svg
819
818
  - vendor/assets/src/medias/images/icons/wave-sine.svg
820
819
  - vendor/assets/src/medias/images/icons/wave-square-.svg
@@ -850,6 +849,7 @@ files:
850
849
  - vendor/assets/src/medias/images/logos/gray/youtube2.svg
851
850
  - vendor/assets/src/medias/images/logos/instagram.svg
852
851
  - vendor/assets/src/medias/images/logos/tiktok_back.svg
852
+ - vendor/assets/src/medias/images/logos/vie.svg
853
853
  - vendor/assets/src/medias/images/logos/vimeo.svg
854
854
  - vendor/assets/src/medias/images/noise.svg
855
855
  - vendor/assets/src/medias/images/red_planet.png