atome 0.5.4.1.0 → 0.5.4.1.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/extensions/atome.rb +4 -0
- data/lib/atome/genesis/generators/identity.rb +3 -0
- data/lib/atome/genesis/generators/material.rb +1 -30
- data/lib/atome/helpers/essentials.rb +3 -0
- data/lib/atome/presets/atome.rb +6 -0
- data/lib/atome/renderers/browser/browser.rb +1 -0
- data/lib/atome/renderers/browser/material.rb +32 -3
- data/lib/atome/renderers/browser/opal_add_on.rb +31 -0
- data/lib/atome/version.rb +1 -1
- data/vendor/assets/src/index.html +9 -7
- data/vendor/assets/src/medias/rubies/examples/vector.rb +6 -4
- 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: d25a52a19d43efc9be423d30200a1e9449c33a1cfd83236bf2decb48b8a9edde
|
4
|
+
data.tar.gz: a8498b1eebc5f7d1a02960a65173f37fe9f4c9bff861b0420d999afd1bb229fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b54d244241eacb79b8c89f46fe97759826b6cde783224f16c629f822f0a8cbc556dc3f6ab1b29195b8b6dc0b0659a88e865aa1e32259aef85d08aab795b664d9
|
7
|
+
data.tar.gz: 9ad98aac937ffdba6019f19b66bd2fc3b2025c78db0e5260b49c1ef32e997ca5ab7522a91f9facf97d731105a4d536d0f695234d6c4ccb635de84594a2d35ea5
|
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
new({ particle: :attach })
|
4
4
|
new({ sanitizer: :attach }) do |parents_ids|
|
5
|
+
puts "=> attach it! : #{parents_ids} <="
|
6
|
+
|
5
7
|
parents_ids = parents_ids if parents_ids.instance_of? Atome
|
6
8
|
parents_ids = [parents_ids] unless parents_ids.instance_of?(Array)
|
7
9
|
parents_ids.each do |parents_id|
|
@@ -28,6 +30,7 @@ end
|
|
28
30
|
|
29
31
|
new({ particle: :attached })
|
30
32
|
new({ sanitizer: :attached }) do |children_ids|
|
33
|
+
puts "=> attached now! : #{children_ids}<="
|
31
34
|
children_ids = children_ids if children_ids.instance_of? Atome
|
32
35
|
children_ids = [children_ids] unless children_ids.instance_of?(Array)
|
33
36
|
children_ids.each do |child_id|
|
@@ -56,33 +56,4 @@ new ({particle: :opacity})
|
|
56
56
|
# vector shape
|
57
57
|
new({particle: :definition})
|
58
58
|
|
59
|
-
new({ browser: :definition, type: :string })
|
60
|
-
# alert "value is #{value}"
|
61
|
-
target=id
|
62
|
-
`
|
63
|
-
|
64
|
-
var divElement = document.querySelector('#'+#{target});;
|
65
|
-
|
66
|
-
// select the first svg tag inside the div
|
67
|
-
var svgElement = divElement.querySelector('svg');
|
68
|
-
|
69
|
-
// delete the first svg tag inside the div if it exist
|
70
|
-
if (svgElement) {
|
71
|
-
divElement.removeChild(svgElement);
|
72
|
-
}
|
73
|
-
|
74
|
-
|
75
|
-
let svg_content='<svg style="width: 1em; height: 1em;vertical-align: middle;fill: currentColor;overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg">'+#{value}+'</svg>'
|
76
|
-
let svgContainer = document.getElementById(#{target});
|
77
|
-
let parser = new DOMParser();
|
78
|
-
let svgDoc = parser.parseFromString(svg_content, "image/svg+xml");
|
79
|
-
let importedSVG = svgDoc.getElementsByTagName("svg")[0];
|
80
|
-
importedSVG.style.width = "100%";
|
81
|
-
importedSVG.style.height = "100%";
|
82
|
-
let elements = importedSVG.getElementsByTagName("path");
|
83
|
-
|
84
|
-
svgContainer.appendChild(importedSVG);
|
85
|
-
|
86
|
-
`
|
87
|
-
|
88
|
-
end
|
59
|
+
new({ browser: :definition, type: :string })
|
@@ -17,6 +17,9 @@ module Essentials
|
|
17
17
|
box: { type: :shape, width: 99, height: 99,
|
18
18
|
attached: :box_color, attach: [:view],
|
19
19
|
left: 100, top: 100, clones: [], preset: :box },
|
20
|
+
vector: { type: :shape, width: 99, height: 99,
|
21
|
+
attach: [:view],
|
22
|
+
left: 100, top: 100, clones: [], preset: :vector },
|
20
23
|
circle: { type: :shape, width: 99, height: 99, smooth: '100%',
|
21
24
|
attached: :circle_color, attach: [:view],
|
22
25
|
left: 100, top: 100, clones: [], preset: :circle },
|
data/lib/atome/presets/atome.rb
CHANGED
@@ -22,6 +22,12 @@ class Atome
|
|
22
22
|
Atome.new({ atome_type => params }, &bloc)
|
23
23
|
end
|
24
24
|
|
25
|
+
def vector(params = {}, &bloc)
|
26
|
+
atome_type = :vector
|
27
|
+
params = atome_common(atome_type, params)
|
28
|
+
Atome.new({ atome_type => params }, &bloc)
|
29
|
+
end
|
30
|
+
|
25
31
|
def circle(params = {}, &bloc)
|
26
32
|
atome_type = :circle
|
27
33
|
# puts "counter#{Universe.counter}"
|
@@ -62,11 +62,11 @@ generator.build_render(:browser_edit) do |value|
|
|
62
62
|
if value == true
|
63
63
|
caret_color = 'white'
|
64
64
|
user_select = 'text'
|
65
|
-
selection_color= 'blue'
|
65
|
+
selection_color = 'blue'
|
66
66
|
else
|
67
67
|
caret_color = 'transparent'
|
68
68
|
user_select = 'none'
|
69
|
-
selection_color= 'transparent'
|
69
|
+
selection_color = 'transparent'
|
70
70
|
end
|
71
71
|
|
72
72
|
@browser_object.attributes[:contenteditable] = value
|
@@ -90,6 +90,35 @@ generator.build_render(:browser_remove_classes) do |value, _user_proc|
|
|
90
90
|
@browser_object.remove_class(value)
|
91
91
|
end
|
92
92
|
|
93
|
-
new ({browser: :opacity}) do |value|
|
93
|
+
new ({ browser: :opacity }) do |value|
|
94
94
|
@browser_object.style['opacity'] = value
|
95
|
+
end
|
96
|
+
|
97
|
+
new ({ browser: :definition }) do |value|
|
98
|
+
target=id
|
99
|
+
`
|
100
|
+
|
101
|
+
var divElement = document.querySelector('#'+#{target});;
|
102
|
+
|
103
|
+
// select the first svg tag inside the div
|
104
|
+
var svgElement = divElement.querySelector('svg');
|
105
|
+
|
106
|
+
// delete the first svg tag inside the div if it exist
|
107
|
+
if (svgElement) {
|
108
|
+
divElement.removeChild(svgElement);
|
109
|
+
}
|
110
|
+
|
111
|
+
|
112
|
+
let svg_content='<svg style="width: 1em; height: 1em;vertical-align: middle;fill: currentColor;overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg">'+#{value}+'</svg>'
|
113
|
+
let svgContainer = document.getElementById(#{target});
|
114
|
+
let parser = new DOMParser();
|
115
|
+
let svgDoc = parser.parseFromString(svg_content, "image/svg+xml");
|
116
|
+
let importedSVG = svgDoc.getElementsByTagName("svg")[0];
|
117
|
+
importedSVG.style.width = "100%";
|
118
|
+
importedSVG.style.height = "100%";
|
119
|
+
let elements = importedSVG.getElementsByTagName("path");
|
120
|
+
|
121
|
+
svgContainer.appendChild(importedSVG);
|
122
|
+
|
123
|
+
`
|
95
124
|
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
def add_new_class(class_name, tag_name, tag_content)
|
2
|
+
|
3
|
+
`
|
4
|
+
var styleTag = document.getElementById("atomic_style");
|
5
|
+
styleTag.innerHTML += "\n ."+#{class_name}+'{\n '+#{tag_name}+': '+#{tag_content}+';\n}';
|
6
|
+
`
|
7
|
+
end
|
8
|
+
|
9
|
+
add_new_class('new_class', 'background-color','yellow')
|
10
|
+
add_new_class('other_class', 'color','red')
|
11
|
+
|
12
|
+
def update_css_tag(tag_name, var_name, value)
|
13
|
+
`
|
14
|
+
var rules = null;
|
15
|
+
var cssRules = document.styleSheets[0].cssRules;
|
16
|
+
for (var i = 0; i < cssRules.length; i++) {
|
17
|
+
var rule = cssRules[i];
|
18
|
+
if (rule.selectorText === '.'+#{tag_name}) {
|
19
|
+
rules = rule;
|
20
|
+
break;
|
21
|
+
}
|
22
|
+
}
|
23
|
+
|
24
|
+
if (rules) {
|
25
|
+
|
26
|
+
rules.style.setProperty(#{var_name}, #{value});
|
27
|
+
}
|
28
|
+
`
|
29
|
+
end
|
30
|
+
|
31
|
+
update_css_tag('other_class', '--end-color', 'blue')
|
data/lib/atome/version.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
<!DOCTYPE html>
|
2
2
|
<html lang="En">
|
3
3
|
<head>
|
4
|
-
<!-- <link rel="icon" type="image/x-icon" href="./favicon.ico">-->
|
5
|
-
<link rel="icon" type="image/x-icon"
|
4
|
+
<!-- <link rel="icon" type="image/x-icon" href="./favicon.ico">-->
|
5
|
+
<link rel="icon" type="image/x-icon"
|
6
|
+
href="https://github.com/atomecorp/atome/blob/master/vendor/assets/src/favicon.ico">
|
6
7
|
|
7
8
|
|
8
9
|
<meta name='viewport' content='initial-scale=1, width=device-width, viewport-fit=cover'>
|
@@ -10,21 +11,22 @@
|
|
10
11
|
<meta name="format-detection" content="telephone=no">
|
11
12
|
<meta name="msapplication-tap-highlight" content="no">
|
12
13
|
<link type="text/css" rel="stylesheet" href="css/style.css">
|
14
|
+
<style id="atomic_style"></style>
|
13
15
|
<script type="text/javascript" src="js/third_parties/interact.min.js"></script>
|
14
16
|
<script type="text/javascript" src="js/third_parties/popmotion.min.js"></script>
|
15
17
|
<script type="text/javascript" src="js/third_parties/sortable.min.js"></script>
|
16
18
|
<script type="text/javascript" src="js/third_parties/wad.min.js"></script>
|
17
|
-
<!-- <script type="text/javascript" src="js/third_parties/tone.min.js"></script>-->
|
18
|
-
<!-- <script type="text/javascript" src="js/third_parties/xsound.min.js"></script>-->
|
19
|
+
<!-- <script type="text/javascript" src="js/third_parties/tone.min.js"></script>-->
|
20
|
+
<!-- <script type="text/javascript" src="js/third_parties/xsound.min.js"></script>-->
|
19
21
|
<script type="text/javascript" src="js/third_parties/sha256.min.js"></script>
|
20
22
|
<script type="text/javascript" src="js/third_parties/ping.min.js"></script>
|
21
|
-
<!-- <script src='js/third_parties/w3color.js'></script>-->
|
23
|
+
<!-- <script src='js/third_parties/w3color.js'></script>-->
|
22
24
|
<script src='js/opal/opal.js'></script>
|
23
25
|
<script src='js/opal/opal_browser.js'></script>
|
24
26
|
<!-- TODO: we line below is commented when using stand alone mode and loaded on demand when using server mode-->
|
25
|
-
|
27
|
+
<script type="text/javascript" src="js/third_parties/fabric.min.js"></script>
|
26
28
|
<!-- <script type="text/javascript" src="js/third_parties/three.min.js"></script>-->
|
27
|
-
|
29
|
+
<script src='js/opal/opal_parser.js'></script>
|
28
30
|
<script src='js/aui.js'></script>
|
29
31
|
|
30
32
|
<script src='js/atome/atome_helpers/atome_animate.js' defer></script>
|
@@ -1,10 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
# b=Atome.new(
|
4
|
+
# { shape: { renderers: [:browser], id: :the_shape, type: :shape, attach: [:view],
|
5
|
+
# left: 0, right: 0, top: 0, bottom: 0, width: 30, height: 30, overflow: :hidden, tag: {system: false}
|
6
|
+
# } })
|
3
7
|
|
4
|
-
b=
|
5
|
-
{ shape: { renderers: [:browser], id: :the_shape, type: :shape, attach: [:view],
|
6
|
-
left: 0, right: 0, top: 0, bottom: 0, width: 30, height: 30, overflow: :hidden, tag: {system: false}
|
7
|
-
} })
|
8
|
+
b=vector
|
8
9
|
|
9
10
|
edition = <<~STR
|
10
11
|
<path id="p1" d="M257.7 752c2 0 4-0.2 6-0.5L431.9 722c2-0.4 3.9-1.3 5.3-2.8l423.9-423.9c3.9-3.9 3.9-10.2 0-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2c-1.9 11.1 1.5 21.9 9.4 29.8 6.6 6.4 14.9 9.9 23.8 9.9z m67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z"/>
|
@@ -28,4 +29,5 @@ end
|
|
28
29
|
|
29
30
|
wait 3 do
|
30
31
|
b.color(:orange)
|
32
|
+
b.width(33)
|
31
33
|
end
|
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.4.1.
|
4
|
+
version: 0.5.4.1.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: 2023-05-
|
11
|
+
date: 2023-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: arduino_firmata
|
@@ -453,6 +453,7 @@ files:
|
|
453
453
|
- lib/atome/renderers/browser/helpers/web_helper.rb
|
454
454
|
- lib/atome/renderers/browser/identity.rb
|
455
455
|
- lib/atome/renderers/browser/material.rb
|
456
|
+
- lib/atome/renderers/browser/opal_add_on.rb
|
456
457
|
- lib/atome/renderers/browser/opal_browser.rb
|
457
458
|
- lib/atome/renderers/browser/spatial.rb
|
458
459
|
- lib/atome/renderers/browser/time.rb
|