atome 0.5.5.8.1 → 0.5.5.8.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +1 -1
- data/exe/atome +4 -4
- data/lib/atome/atome.rb +1 -1
- data/lib/atome/extensions/atome.rb +171 -34
- data/lib/atome/genesis/generators/atome.rb +10 -1
- data/lib/atome/genesis/generators/communication.rb +4 -0
- data/lib/atome/genesis/generators/event.rb +4 -3
- data/lib/atome/genesis/generators/geometry.rb +31 -4
- data/lib/atome/genesis/generators/identity.rb +3 -0
- data/lib/atome/genesis/generators/material.rb +1 -0
- data/lib/atome/genesis/generators/property.rb +75 -1
- data/lib/atome/genesis/generators/spatial.rb +2 -0
- data/lib/atome/genesis/generators/utility.rb +26 -12
- data/lib/atome/helpers/essentials.rb +3 -2
- data/lib/atome/version.rb +1 -1
- data/lib/renderers/html/atome.rb +0 -1
- data/lib/renderers/html/geometry.rb +11 -5
- data/lib/renderers/html/html.rb +374 -19
- data/lib/renderers/html/identity.rb +8 -0
- data/lib/renderers/html/material.rb +14 -0
- data/lib/renderers/html/property.rb +21 -0
- data/lib/renderers/html/spatial.rb +5 -1
- data/lib/renderers/html/utility.rb +25 -1
- data/vendor/assets/application/examples/atomizer.rb +86 -0
- data/vendor/assets/application/examples/center.rb +8 -0
- data/vendor/assets/application/examples/compute.rb +16 -0
- data/vendor/assets/application/examples/dig.rb +13 -0
- data/vendor/assets/application/examples/fit.rb +26 -0
- data/vendor/assets/application/examples/infos.rb +10 -0
- data/vendor/assets/application/examples/shortcut.rb +2 -2
- data/vendor/assets/application/examples/size.rb +17 -0
- data/vendor/assets/application/examples/table.rb +76 -0
- data/vendor/assets/application/examples/text.rb +1 -1
- data/vendor/assets/src/index.html +15 -15
- data/vendor/assets/src/index_wasm.html +47 -0
- data/vendor/assets/src/js/atome/atome_helpers/communication.js +5 -4
- metadata +11 -2
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
|
4
|
+
c = circle({ height: 400, width: 200, top: 100, left:99, top: 79 })
|
5
|
+
b = c.box({ width: 200, height: 100, left: 280, top: 190, id: :my_box })
|
6
|
+
i= image(:red_planet)
|
7
|
+
c.touch(true) do
|
8
|
+
c.fit({ value: 100, axis: :x })
|
9
|
+
end
|
10
|
+
|
11
|
+
puts '------'
|
12
|
+
puts "b.compute left return the position on the screen of the item : #{b.compute({reference: c.id, particle: :left, unit: :pixel})}"
|
13
|
+
puts "b.compute left : #{b.compute({ particle: :left })[:value]}, c left : #{b.left}"
|
14
|
+
puts "b.compute top :#{b.compute({ particle: :top })[:value]}, c top: #{b.top}"
|
15
|
+
alert "i.compute width :#{i.compute({ particle: :width })[:value]}, i width: #{i.width}"
|
16
|
+
alert "i.compute height :#{i.compute({ particle: :height })[:value]}, i height: #{i.height}"
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
|
4
|
+
c = circle({ height: 400, width: 200, top: 100, left: 0, top: 100 , id: :the_circle})
|
5
|
+
b = c.box({ width: 200, height: 100, left: 600, top: 200, id: :my_box })
|
6
|
+
c.circle({ width: 200, height: 100, left: 120, top: -80, id: :my_text, data: :hi })
|
7
|
+
b.circle({ color: :yellow, width: 55, height: 88, left: 100 })
|
8
|
+
b.box
|
9
|
+
|
10
|
+
|
11
|
+
atome_founds = c.dig
|
12
|
+
puts "dig allow to retrieve all attached atomes recursively,
|
13
|
+
it return a table of ID including the ID of the parent (here : :the_circle) :\n#{atome_founds}"
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
c = circle({ height: 400, width: 200, top: 100, left: 0, top: 100 })
|
4
|
+
b = c.box({ width: 200, height: 100, left: 600, top: 200, id: :my_box })
|
5
|
+
c.circle({ width: 200, height: 100, left: 120, top: -80, id: :my_text, data: :hi })
|
6
|
+
b.circle({ color: :yellow, width: 55, height: 88, left: 100 })
|
7
|
+
b.box
|
8
|
+
i=c.image({path: 'medias/images/red_planet.png', id: :the_pix })
|
9
|
+
# b.text(:red_planet)
|
10
|
+
|
11
|
+
wait 1 do
|
12
|
+
|
13
|
+
c.fit({ value: 100, axis: :x })
|
14
|
+
|
15
|
+
wait 1 do
|
16
|
+
c.fit({ value: 66, axis: :y })
|
17
|
+
wait 1 do
|
18
|
+
c.fit({ value: 600, axis: :x })
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
# alert i.width
|
23
|
+
# alert i.height
|
24
|
+
# i.fit({ value: 66, axis: :x })
|
25
|
+
# i.width(66)
|
26
|
+
# i.height(66)
|
@@ -12,10 +12,10 @@ shortcut(key: :b, affect: :all) do |key, object_id|
|
|
12
12
|
end
|
13
13
|
text({data: "Key 'b' on :all", top: 0})
|
14
14
|
|
15
|
-
shortcut(key: :
|
15
|
+
shortcut(key: :e, option: :meta,affect: [:my_circle, :red_box]) do |key, object_id|
|
16
16
|
puts "Key #{key} press on #{object_id}"
|
17
17
|
end
|
18
|
-
text({data: "Key '
|
18
|
+
text({data: "Key 'e' with Meta on [:my_circle, :red_box]", top: 30, left: 0, position: :absolute})
|
19
19
|
|
20
20
|
|
21
21
|
shortcut(key: :j, option: :ctrl, affect: :all, exclude: [:my_circle, :my_box]) do |key, object_id|
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
c = circle({ height: 400, width: 200, top: 100, left: 0, top: 100 })
|
4
|
+
b = c.box({ width: 200, height: 100, left: 600, top: 200, id: :my_box })
|
5
|
+
c.circle({ width: 200, height: 100, left: 120, top: -80, id: :my_text, data: :hi })
|
6
|
+
b.circle({ color: :yellow, width: 55, height: 88, left: 500 })
|
7
|
+
b.box
|
8
|
+
|
9
|
+
wait 1 do
|
10
|
+
# recursive apply the new size to all attached atomes recursively
|
11
|
+
# reference : change the size according the to wanted axis
|
12
|
+
c.size({value: 50, recursive: true, reference: :y })
|
13
|
+
end
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
|
@@ -0,0 +1,76 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
|
4
|
+
c = circle({ id: :my_cirle, color: :red, drag: true })
|
5
|
+
c.box({ left: 0, width: 22, height: 22, top: 65 })
|
6
|
+
c.touch(true) do
|
7
|
+
alert :okk
|
8
|
+
end
|
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 },
|
11
|
+
component: {
|
12
|
+
border: { thickness: 5, color: color(:blue), pattern: :dotted },
|
13
|
+
overflow: :auto,
|
14
|
+
color: "white",
|
15
|
+
shadow: {
|
16
|
+
id: :s4,
|
17
|
+
left: 20, top: 0, blur: 9,
|
18
|
+
option: :natural,
|
19
|
+
red: 0, green: 1, blue: 0, alpha: 1
|
20
|
+
},
|
21
|
+
height: 50,
|
22
|
+
width: 50,
|
23
|
+
component: { size: 12, color: :black }
|
24
|
+
},
|
25
|
+
data: [
|
26
|
+
{ titi: :toto },
|
27
|
+
{ dfgdf: 1, name: 'Alice', age: 30, no: 'oko', t: 123, r: 654, f: 123, g: 654, w: 123, x: 654, c: 123, v: 654 },
|
28
|
+
{ id: 2, name: 'Bob', age: 22 },
|
29
|
+
{ dfg: 4, name: 'Vincent', age: 33, no: grab(:my_cirle) },
|
30
|
+
{ dfgd: 3, name: 'Roger', age: 18, no: image(:red_planet), now: :nothing }
|
31
|
+
|
32
|
+
]
|
33
|
+
})
|
34
|
+
|
35
|
+
# tests
|
36
|
+
m.color(:orange)
|
37
|
+
m.border({ thickness: 5, color: color(:blue), pattern: :dotted })
|
38
|
+
|
39
|
+
puts m.get({ cell: [1, 2] })
|
40
|
+
wait 2 do
|
41
|
+
m.insert({ cell: [2, 2], content: 999 })
|
42
|
+
m.insert({ row: 1 })
|
43
|
+
wait 1 do
|
44
|
+
m.remove({ row: 2 })
|
45
|
+
end
|
46
|
+
wait 2 do
|
47
|
+
m.remove({ column: 1 })
|
48
|
+
end
|
49
|
+
wait 3 do
|
50
|
+
m.insert({ column: 3 })
|
51
|
+
end
|
52
|
+
|
53
|
+
wait 4 do
|
54
|
+
m.sort({ column: 1, method: :alphabetic })
|
55
|
+
puts 1
|
56
|
+
wait 1 do
|
57
|
+
puts 2
|
58
|
+
m.sort({ column: 2, method: :numeric })
|
59
|
+
wait 1 do
|
60
|
+
puts 3
|
61
|
+
m.sort({ column: 3, method: :numeric })
|
62
|
+
wait 1 do
|
63
|
+
puts 4
|
64
|
+
m.sort({ column: 1, method: :numeric })
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
end
|
71
|
+
|
72
|
+
# cell.fusion() # to be implemented later
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
@@ -1,4 +1,4 @@
|
|
1
|
-
frozen_string_literal
|
1
|
+
# frozen_string_literal
|
2
2
|
|
3
3
|
t2 = text({ data: ['this is ', :super, { data: 'cool', color: :red, id: :new_one }], component: { size: 33 }, left: 120 })
|
4
4
|
the_text = text({ data: 'hello for al the people in front of their machine', center: true, top: 120, width: 77, component: { size: 11 } })
|
@@ -9,15 +9,20 @@
|
|
9
9
|
<meta name="msapplication-tap-highlight" content="no">
|
10
10
|
<link type="text/css" rel="stylesheet" href="css/style.css">
|
11
11
|
<style id="atomic_style"></style>
|
12
|
-
<script defer src="js/third_parties/browser.script.iife.min.js" type="text/javascript"></script>
|
13
12
|
<script type="text/javascript" src="js/third_parties/interact.min.js" defer></script>
|
14
13
|
<script type="text/javascript" src="js/third_parties/popmotion.min.js" defer></script>
|
15
14
|
<script type="text/javascript" src="js/third_parties/sortable.min.js" defer></script>
|
16
15
|
<script type="text/javascript" src="js/third_parties/wad.min.js" defer></script>
|
17
16
|
<script type="text/javascript" src="js/third_parties/sha256.min.js" defer></script>
|
18
17
|
<script type="text/javascript" src="js/third_parties/ping.min.js" defer></script>
|
19
|
-
<script
|
18
|
+
<script defer src="js/third_parties/fabric.min.js" type="text/javascript"></script>
|
20
19
|
<script type="text/javascript" src="js/third_parties/papaparse.min.js" defer></script>
|
20
|
+
<script src='js/opal/opal.js' defer></script>
|
21
|
+
<script src='js/opal/opal_parser.js' defer></script>
|
22
|
+
<script src='js/aui.js' defer></script>
|
23
|
+
<script defer defer src='js/host_mode.js'></script>
|
24
|
+
<script src='js/opal/atome_opal_extensions.js' defer></script>
|
25
|
+
<script src='js/atome/kernel.js' defer></script>
|
21
26
|
<script defer src="js/atome/atome_helpers/communication.js" type="text/javascript"></script>
|
22
27
|
<script defer src="js/atome/atome_helpers/file.js" type="text/javascript"></script>
|
23
28
|
<!-- <script>-->
|
@@ -29,19 +34,14 @@
|
|
29
34
|
<title>atome</title>
|
30
35
|
</head>
|
31
36
|
<body id='user_view' class='atome'>
|
32
|
-
|
33
|
-
<div id='copyright'>©atome 2023</div>
|
37
|
+
<div id='copyright'>©atome 2027</div>
|
34
38
|
</body>
|
35
|
-
<script type="text/
|
36
|
-
require 'js'
|
37
|
-
require '/lib/platform_specific/wasm/atome_wasm_extensions'
|
38
|
-
require '/utilities/aui'
|
39
|
-
require '/utilities/host_mode'
|
40
|
-
require '/lib/atome_relative'
|
41
|
-
require './index'
|
42
|
-
#puts Universe.host
|
43
|
-
atome_infos
|
44
|
-
</script>
|
45
|
-
<script defer src="js/atome/specific/wasm.js" type="text/javascript"></script>
|
39
|
+
<script defer src="js/atome/specific/opal.js" type="text/javascript"></script>
|
46
40
|
<script defer src="js/atome/atome.js" type="text/javascript"></script>
|
41
|
+
<script src='js/application.js' defer></script>
|
42
|
+
<script>
|
43
|
+
window.addEventListener('load', function () {
|
44
|
+
Opal.eval('atome_infos')
|
45
|
+
})
|
46
|
+
</script>
|
47
47
|
</html>
|
@@ -0,0 +1,47 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="En">
|
3
|
+
<head>
|
4
|
+
<link rel="icon" type="image/x-icon"
|
5
|
+
href="https://github.com/atomecorp/atome/blob/master/vendor/assets/src/favicon.ico">
|
6
|
+
<meta name='viewport' content='initial-scale=1, width=device-width, viewport-fit=cover'>
|
7
|
+
<meta charset='UTF-8'/>
|
8
|
+
<meta name="format-detection" content="telephone=no">
|
9
|
+
<meta name="msapplication-tap-highlight" content="no">
|
10
|
+
<link type="text/css" rel="stylesheet" href="css/style.css">
|
11
|
+
<style id="atomic_style"></style>
|
12
|
+
<script defer src="js/third_parties/browser.script.iife.min.js" type="text/javascript"></script>
|
13
|
+
<script type="text/javascript" src="js/third_parties/interact.min.js" defer></script>
|
14
|
+
<script type="text/javascript" src="js/third_parties/popmotion.min.js" defer></script>
|
15
|
+
<script type="text/javascript" src="js/third_parties/sortable.min.js" defer></script>
|
16
|
+
<script type="text/javascript" src="js/third_parties/wad.min.js" defer></script>
|
17
|
+
<script type="text/javascript" src="js/third_parties/sha256.min.js" defer></script>
|
18
|
+
<script type="text/javascript" src="js/third_parties/ping.min.js" defer></script>
|
19
|
+
<script type="text/javascript" src="js/third_parties/fabric.min.js" defer></script>
|
20
|
+
<script type="text/javascript" src="js/third_parties/papaparse.min.js" defer></script>
|
21
|
+
<script defer src="js/atome/atome_helpers/communication.js" type="text/javascript"></script>
|
22
|
+
<script defer src="js/atome/atome_helpers/file.js" type="text/javascript"></script>
|
23
|
+
<!-- <script>-->
|
24
|
+
<!-- // to prevent right click-->
|
25
|
+
<!-- document.addEventListener("contextmenu", function (e) {-->
|
26
|
+
<!-- e.preventDefault();-->
|
27
|
+
<!-- });-->
|
28
|
+
<!-- </script>-->
|
29
|
+
<title>atome</title>
|
30
|
+
</head>
|
31
|
+
<body id='user_view' class='atome'>
|
32
|
+
|
33
|
+
<div id='copyright'>©atome 2023</div>
|
34
|
+
</body>
|
35
|
+
<script type="text/ruby">
|
36
|
+
require 'js'
|
37
|
+
require '/lib/platform_specific/wasm/atome_wasm_extensions'
|
38
|
+
require '/utilities/aui'
|
39
|
+
require '/utilities/host_mode'
|
40
|
+
require '/lib/atome_relative'
|
41
|
+
require './index'
|
42
|
+
#puts Universe.host
|
43
|
+
atome_infos
|
44
|
+
</script>
|
45
|
+
<script defer src="js/atome/specific/wasm.js" type="text/javascript"></script>
|
46
|
+
<script defer src="js/atome/atome.js" type="text/javascript"></script>
|
47
|
+
</html>
|
@@ -97,7 +97,6 @@ const communication = {
|
|
97
97
|
|
98
98
|
function connect(address) {
|
99
99
|
|
100
|
-
// alert('kool');
|
101
100
|
websocket = new WebSocket(address);
|
102
101
|
|
103
102
|
websocket.onopen = function (event) {
|
@@ -121,7 +120,9 @@ function connect(address) {
|
|
121
120
|
|
122
121
|
}
|
123
122
|
|
124
|
-
// function ws_sender() {
|
125
|
-
// websocket.send("the Hello, WebSocket!!!")
|
126
|
-
// }
|
127
123
|
|
124
|
+
|
125
|
+
function controller_message(msg){
|
126
|
+
// message receiver from controller (Vie)
|
127
|
+
console.log(msg)
|
128
|
+
}
|
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.5.8.
|
4
|
+
version: 0.5.5.8.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-01-
|
11
|
+
date: 2024-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: eventmachine
|
@@ -484,6 +484,7 @@ files:
|
|
484
484
|
- vendor/assets/application/examples/apply.rb
|
485
485
|
- vendor/assets/application/examples/atome.rb
|
486
486
|
- vendor/assets/application/examples/atome_sparkle_use.rb
|
487
|
+
- vendor/assets/application/examples/atomizer.rb
|
487
488
|
- vendor/assets/application/examples/attach.rb
|
488
489
|
- vendor/assets/application/examples/attached.rb
|
489
490
|
- vendor/assets/application/examples/basic_understanding.rb
|
@@ -492,16 +493,19 @@ files:
|
|
492
493
|
- vendor/assets/application/examples/browse.rb
|
493
494
|
- vendor/assets/application/examples/callback.rb
|
494
495
|
- vendor/assets/application/examples/category.rb
|
496
|
+
- vendor/assets/application/examples/center.rb
|
495
497
|
- vendor/assets/application/examples/clear.rb
|
496
498
|
- vendor/assets/application/examples/clones.rb
|
497
499
|
- vendor/assets/application/examples/code.rb
|
498
500
|
- vendor/assets/application/examples/color.rb
|
501
|
+
- vendor/assets/application/examples/compute.rb
|
499
502
|
- vendor/assets/application/examples/console.rb
|
500
503
|
- vendor/assets/application/examples/convert.rb
|
501
504
|
- vendor/assets/application/examples/copy.rb
|
502
505
|
- vendor/assets/application/examples/copybck.rb
|
503
506
|
- vendor/assets/application/examples/debug.rb
|
504
507
|
- vendor/assets/application/examples/delete.rb
|
508
|
+
- vendor/assets/application/examples/dig.rb
|
505
509
|
- vendor/assets/application/examples/display.rb
|
506
510
|
- vendor/assets/application/examples/display_bck.rb
|
507
511
|
- vendor/assets/application/examples/drag.rb
|
@@ -511,6 +515,7 @@ files:
|
|
511
515
|
- vendor/assets/application/examples/encode.rb
|
512
516
|
- vendor/assets/application/examples/file.rb
|
513
517
|
- vendor/assets/application/examples/find.rb
|
518
|
+
- vendor/assets/application/examples/fit.rb
|
514
519
|
- vendor/assets/application/examples/generator_and_build.rb
|
515
520
|
- vendor/assets/application/examples/getter.rb
|
516
521
|
- vendor/assets/application/examples/grab.rb
|
@@ -521,6 +526,7 @@ files:
|
|
521
526
|
- vendor/assets/application/examples/hypertext.rb
|
522
527
|
- vendor/assets/application/examples/image.rb
|
523
528
|
- vendor/assets/application/examples/import.rb
|
529
|
+
- vendor/assets/application/examples/infos.rb
|
524
530
|
- vendor/assets/application/examples/keyboard.rb
|
525
531
|
- vendor/assets/application/examples/layout.rb
|
526
532
|
- vendor/assets/application/examples/login.rb
|
@@ -550,9 +556,11 @@ files:
|
|
550
556
|
- vendor/assets/application/examples/shadow.rb
|
551
557
|
- vendor/assets/application/examples/shapes.rb
|
552
558
|
- vendor/assets/application/examples/shortcut.rb
|
559
|
+
- vendor/assets/application/examples/size.rb
|
553
560
|
- vendor/assets/application/examples/smooth.rb
|
554
561
|
- vendor/assets/application/examples/style.rb
|
555
562
|
- vendor/assets/application/examples/sync.rb
|
563
|
+
- vendor/assets/application/examples/table.rb
|
556
564
|
- vendor/assets/application/examples/tagged.rb
|
557
565
|
- vendor/assets/application/examples/terminal.rb
|
558
566
|
- vendor/assets/application/examples/text.rb
|
@@ -608,6 +616,7 @@ files:
|
|
608
616
|
- vendor/assets/src/index_opal.html
|
609
617
|
- vendor/assets/src/index_server.html
|
610
618
|
- vendor/assets/src/index_server_wasm.html
|
619
|
+
- vendor/assets/src/index_wasm.html
|
611
620
|
- vendor/assets/src/js/atome/atome.js
|
612
621
|
- vendor/assets/src/js/atome/atome_helpers/add_font.js
|
613
622
|
- vendor/assets/src/js/atome/atome_helpers/atome_animate.js
|