atome 0.5.6.7.5 → 0.5.6.7.6

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: 133a51a9b05e6523fd8d58e95d5dc81231f42d9eb7de62e6d9f1250cffb536e9
4
- data.tar.gz: 36b89d41fe7889bd664d0d76cf867e5511d62373106969144cd5135a618e2dee
3
+ metadata.gz: 424c459dc6cff2e44ae6600039d9e91cbf338302369671892cadaadadf53c970
4
+ data.tar.gz: 5661aee48e399ec36d4cf934f0fc5fac4c63f2b4d5daedab617e8da09bf55377
5
5
  SHA512:
6
- metadata.gz: 07ab1e800d4ece217f908f45f6eae699277e0abc29bb8913deb2cd3d94cea2ee3846f02e742e32e5724ee17cc890e815940669c3c3cbe48cd8a1f6cf5ac7eb0c
7
- data.tar.gz: b627d51e6ad6af8bc9d13713e867f3bc78613a6d3369dfa016d19ebd7a7b51013e5d00f7beb106d2648b1d6abfdab64b84ae1810474aa8b79f6127d77a7cfbca
6
+ metadata.gz: 138987dc6c69b96ddd1d157bd57f2406306b8c559e721688d8e3cec226f2f9e694bb75f5ec51ef8931227d29ec0a60c57b137aba801fad37d7ad4a65cc3c387d
7
+ data.tar.gz: be69bbd4ee58dc92c5231958ecdd3bca7e82d96451db416bc97edb9f4e2caefd80ad04273a09cc0d86594398ba5634d99c69b4dc396786a58a73ee7311763a76
@@ -134,3 +134,4 @@ new({particle: :inside, render: false})
134
134
  new({ initialized: :inside }) do |params, &user_proc|
135
135
  render(:inside, params, &user_proc)
136
136
  end
137
+ new({ particle: :margin })
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.6.7.5'
5
+ VERSION = '0.5.6.7.6'
6
6
  end
data/lib/atome.rb CHANGED
@@ -36,4 +36,4 @@ require 'renderers/server/index'
36
36
  require 'atome/utilities/sanitizer'
37
37
  require 'atome/genesis/sparkle'
38
38
  require 'molecules/init'
39
- require 'molecules/intuition/sliders'
39
+ require 'molecules/intuition/utillities'
@@ -35,4 +35,4 @@ require_relative './renderers/server/index_relative'
35
35
  require_relative './atome/utilities/sanitizer'
36
36
  require_relative './atome/genesis/sparkle'
37
37
  require_relative './molecules/init'
38
- require_relative './molecules/intuition/sliders'
38
+ require_relative './molecules/intuition/utillities'
@@ -0,0 +1,79 @@
1
+ # frozen_string_literal: true
2
+
3
+
4
+ module Molecule
5
+ def slider(params,&bloc)
6
+ slider_width=params[:width] || 333
7
+ cursor_width=33
8
+ cursor_height=33
9
+ left_pos=params[:left] || 0
10
+ top_pos=params[:top] || 0
11
+ attach_to= params[:attach] || :view
12
+ cursor_left=0
13
+ cursor_top=0
14
+ slider=grab(attach_to).box({ top: top_pos, left: left_pos,width: slider_width, height: 25, smooth: 9, color:{red: 0.3, green: 0.3, blue: 0.3}})
15
+ slider.shadow({
16
+ id: :s2,
17
+ left: 3, top: 3, blur: 9,
18
+ invert: true,
19
+ red: 0, green: 0, blue: 0, alpha: 0.7
20
+ })
21
+ cursor= slider.circle({width: cursor_width, height: cursor_height, left: 2, top: 1, color:{red: 0.3, green: 0.3, blue: 0.3}})
22
+ cursor.left(cursor_left)
23
+ cursor.top(cursor_top)
24
+ cursor.shadow({
25
+ id: :s4,
26
+ left: 1, top: 1, blur: 3,
27
+ option: :natural,
28
+ red: 0, green: 0, blue: 0, alpha: 0.6
29
+ })
30
+ cursor.drag({ restrict: {max:{ left: slider_width-cursor_width, top: 0}} }) do |_event|
31
+ value = (cursor.left+cursor.width)/slider_width*100
32
+ bloc.call(value)
33
+ end
34
+ slider
35
+ end
36
+
37
+ def list(params)
38
+
39
+ # listing: listing
40
+ listing = params[:listing]
41
+ styles_found=params.delete(:styles)
42
+ element=params.delete(:element)
43
+ listing=params.delete(:listing)
44
+ # lets create the listing container
45
+ list = box({ attach: id , color: {alpha: 0}}.merge(params))
46
+
47
+ styles_found = styles_found ||= {
48
+ width: 99,
49
+ height: 33,
50
+ margin: 6,
51
+ shadow: { blur: 9, left: 3, top: 3, id: :cell_shadow, red: 0, green: 0, blue: 0, alpha: 0.6 },
52
+ left: 0,
53
+ color: :yellowgreen
54
+ }
55
+ element = element ||= { width: 33,
56
+ height: 33,
57
+ left: :center,
58
+ top: :center,
59
+ color: :orange,
60
+ type: :text }
61
+
62
+ unless element[:width]
63
+ element[:width] = styles_found[width]
64
+ end
65
+ margin = styles_found[:margin]
66
+ height_found = styles_found[:height]
67
+ renderer_found = renderers
68
+ listing.each_with_index do |data, index|
69
+ # let's create the container
70
+ new_atome = { renderers: renderer_found, attach: list.id }.merge(styles_found).merge({ type: :shape })
71
+ el = Atome.new(new_atome)
72
+ el.top((height_found + margin) * index)
73
+ # now the content
74
+ Atome.new({ renderers: renderer_found, attach: el.id }.merge(element).merge(data))
75
+
76
+ end
77
+ list
78
+ end
79
+ end
@@ -0,0 +1,69 @@
1
+ # frozen_string_literal: true
2
+
3
+ styles = {
4
+ width: 199,
5
+ height: 33,
6
+ margin: 6,
7
+ shadow: { blur: 9, left: 3, top: 3, id: :cell_shadow, red: 0, green: 0, blue: 0, alpha: 0.6 },
8
+ left: 0,
9
+ color: :yellowgreen
10
+ }
11
+
12
+ element = { width: 33,
13
+ height: 33,
14
+ component: { size: 11 },
15
+ left: :center,
16
+ top: :center,
17
+ color: :black,
18
+ center: { x: 0, y: 0 },
19
+ type: :text }
20
+
21
+ listing = [
22
+ { data: :'hello' },
23
+ { data: :'salut', color: :red },
24
+ { data: :hi },
25
+ { data: :ho }
26
+ ]
27
+
28
+ A.list({
29
+ styles: styles,
30
+ element: element,
31
+ listing: listing
32
+ })
33
+
34
+
35
+
36
+ styles = {
37
+ width: 199,
38
+ height: 33,
39
+ margin: 6,
40
+ shadow: { blur: 9, left: 3, top: 3, id: :cell_shadow, red: 0, green: 0, blue: 0, alpha: 0.6 },
41
+ left: 0,
42
+ color: :yellowgreen
43
+ }
44
+
45
+ element = { width: 25,
46
+ height: 25,
47
+ smooth: '100%',
48
+ center: { x: 0, y: 0 },
49
+ color: :orange,
50
+ type: :shape }
51
+
52
+ listing = [
53
+ { smooth: '100%' },
54
+ { color: :red },
55
+ {},
56
+ {},
57
+
58
+ { width: 33 },
59
+ {},
60
+ ]
61
+
62
+ list_2 = A.list({ left: 300,
63
+ styles: styles,
64
+ element: element,
65
+ listing: listing
66
+ })
67
+ wait 1 do
68
+ list_2.left(120)
69
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: atome
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.6.7.5
4
+ version: 0.5.6.7.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean-Eric Godard
@@ -476,8 +476,8 @@ files:
476
476
  - lib/molecules/examples/site.rb
477
477
  - lib/molecules/init.rb
478
478
  - lib/molecules/intuition/inputs.rb
479
- - lib/molecules/intuition/sliders.rb
480
479
  - lib/molecules/intuition/toolbox.rb
480
+ - lib/molecules/intuition/utillities.rb
481
481
  - lib/platform_specific/opal/atome_opal_extensions.rb
482
482
  - lib/platform_specific/opal/extensions/color.rb
483
483
  - lib/platform_specific/opal/extensions/geolocation.rb
@@ -590,6 +590,7 @@ files:
590
590
  - vendor/assets/application/examples/js&ruby.rb
591
591
  - vendor/assets/application/examples/keyboard.rb
592
592
  - vendor/assets/application/examples/layout.rb
593
+ - vendor/assets/application/examples/list.rb
593
594
  - vendor/assets/application/examples/localstorage.rb
594
595
  - vendor/assets/application/examples/login.rb
595
596
  - vendor/assets/application/examples/markup.rb
@@ -1,36 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
-
4
- module Molecule
5
- def slider(params,&bloc)
6
- slider_width=params[:width] || 333
7
- cursor_width=33
8
- cursor_height=33
9
- left_pos=params[:left] || 0
10
- top_pos=params[:top] || 0
11
- attach_to= params[:attach] || :view
12
- cursor_left=0
13
- cursor_top=0
14
- slider=grab(attach_to).box({ top: top_pos, left: left_pos,width: slider_width, height: 25, smooth: 9, color:{red: 0.3, green: 0.3, blue: 0.3}})
15
- slider.shadow({
16
- id: :s2,
17
- left: 3, top: 3, blur: 9,
18
- invert: true,
19
- red: 0, green: 0, blue: 0, alpha: 0.7
20
- })
21
- cursor= slider.circle({width: cursor_width, height: cursor_height, left: 2, top: 1, color:{red: 0.3, green: 0.3, blue: 0.3}})
22
- cursor.left(cursor_left)
23
- cursor.top(cursor_top)
24
- cursor.shadow({
25
- id: :s4,
26
- left: 1, top: 1, blur: 3,
27
- option: :natural,
28
- red: 0, green: 0, blue: 0, alpha: 0.6
29
- })
30
- cursor.drag({ restrict: {max:{ left: slider_width-cursor_width, top: 0}} }) do |_event|
31
- value = (cursor.left+cursor.width)/slider_width*100
32
- bloc.call(value)
33
- end
34
- slider
35
- end
36
- end