aframe-babia-components 1.2.6 → 1.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/common/noti-buffer.js +4 -1
- package/components/filters/babia-treebuilder.js +14 -4
- package/components/others/babia-slider.js +296 -296
- package/components/visualizers/babia-boats.js +218 -84
- package/components/visualizers/babia-html.js +255 -0
- package/cypress.json +1 -1
- package/dist/aframe-babia-components.js +41889 -46000
- package/dist/aframe-babia-components.min.js +2 -7
- package/dist/aframe-babia-components.min.js.LICENSE.txt +12 -0
- package/dist/aframe-babia-components.min.js.map +1 -1
- package/docs/APIs/CHARTS.md +5 -1
- package/docs/APIs/OTHERS.md +18 -8
- package/docs/RELEASE_NOTES.md +4 -0
- package/docs/Tutorials/get_started.md +2 -2
- package/docs/Tutorials/temporal_evol_with_boats.md +3 -3
- package/examples/ar/multichart/index.html +75 -0
- package/examples/assets/fonts/regular.json +1 -0
- package/examples/async/index.html +3 -3
- package/examples/async/index_filter.html +3 -3
- package/examples/async/index_noti_buffer.html +3 -3
- package/examples/async/index_noti_buffer_filter.html +3 -3
- package/examples/boats/boats/index.html +3 -3
- package/examples/boats/boats2/data.json +13 -206
- package/examples/boats/boats2/index.html +4 -4
- package/examples/boats/boats_city/index.html +4 -4
- package/examples/boats/boats_city_plan_view/index.html +4 -4
- package/examples/boats/boats_dependency/experiment.html +8 -7
- package/examples/boats/boats_dependency/index.html +1 -1
- package/examples/boats/boats_dependency/index_gradient.html +1 -1
- package/examples/boats/boats_dependency/index_normalcity.html +1 -1
- package/examples/boats/boats_dependency/index_quarter_levels_01.html +1 -1
- package/examples/boats/boats_dependency/index_quarter_levels_02.html +1 -1
- package/examples/boats/boats_dependency/index_quarter_levels_03.html +1 -1
- package/examples/boats/boats_dependency/index_quarter_levels_querystring.html +1 -1
- package/examples/boats/boats_dependency/index_tree.html +1 -1
- package/examples/boats/boats_dependency/index_tree_gradient.html +1 -1
- package/examples/boats/boats_dependency/index_tree_wireframe.html +1 -1
- package/examples/boats/boats_new_element/index.html +3 -3
- package/examples/boats/boats_new_quarter/index.html +3 -3
- package/examples/boats/boats_plan_view/index.html +3 -3
- package/examples/boats/boats_plan_view2/index.html +4 -4
- package/examples/boats/boats_quarter_resize/index.html +3 -3
- package/examples/boats/boats_quarter_resize2/index.html +3 -3
- package/examples/boats/boats_resize/index.html +3 -3
- package/examples/boats/boats_temporal/index.html +3 -3
- package/examples/boats/boats_treegenerator/index.html +3 -3
- package/examples/boats/jetuml_evol/ar.html +333 -0
- package/examples/boats/jetuml_evol/data.json +62382 -0
- package/examples/boats/jetuml_evol/index.html +381 -0
- package/examples/charts/bars/bars_change.html +2 -2
- package/examples/charts/bars/bars_json.html +2 -2
- package/examples/charts/bars/index.html +3 -3
- package/examples/charts/barsmap/index.html +3 -3
- package/examples/charts/bubbles/index.html +3 -3
- package/examples/charts/cyls/index.html +3 -3
- package/examples/charts/cyls/primitive.html +3 -3
- package/examples/charts/cylsmap/index.html +3 -3
- package/examples/charts/doughnut/index.html +3 -3
- package/examples/charts/multichart/index.html +3 -3
- package/examples/charts/network_chart/network_chart.html +1 -1
- package/examples/charts/network_chart/network_large_chart.html +3 -3
- package/examples/charts/network_chart/network_nodes_links_chart.html +3 -3
- package/examples/charts/network_chart/network_nodes_links_directed_chart.html +2 -2
- package/examples/charts/network_chart/network_random_chart.html +2 -2
- package/examples/charts/pie/index.html +2 -2
- package/examples/charts_querier/bars_querier/bars_axis_name.html +3 -3
- package/examples/charts_querier/bars_querier/index.html +3 -3
- package/examples/charts_querier/bars_querier/index_csv.html +3 -3
- package/examples/charts_querier/barsmap_querier/barsmap_axis_name.html +3 -3
- package/examples/charts_querier/barsmap_querier/index.html +3 -3
- package/examples/charts_querier/bubbles_querier/index.html +3 -3
- package/examples/charts_querier/cyls_querier/index.html +3 -3
- package/examples/charts_querier/cylsmap_querier/index.html +3 -3
- package/examples/charts_querier/doughnut_querier/index.html +3 -3
- package/examples/charts_querier/multichart_querier/index.html +3 -3
- package/examples/charts_querier/multichart_querier/manual_colors.html +3 -3
- package/examples/charts_querier/pie_querier/index.html +3 -3
- package/examples/codecityjs/argouml/index.html +4 -4
- package/examples/codecityjs/basic/index.html +2 -2
- package/examples/codecityjs/basic_treegenerator/index.html +2 -2
- package/examples/codecityjs/perceval/index.html +2 -2
- package/examples/codecityjs/perceval2021/index.html +4 -4
- package/examples/codecityjs/projects_analysis/argouml_landscape.html +2 -2
- package/examples/codecityjs/projects_analysis/argouml_numfuns.html +2 -2
- package/examples/codecityjs/projects_analysis/argouml_table.html +2 -2
- package/examples/codecityjs/projects_analysis/argouml_tokens.html +2 -2
- package/examples/codecityjs/projects_analysis/experiment_interface.html +2 -2
- package/examples/codecityjs/projects_analysis/experiment_interface_task5.html +2 -2
- package/examples/codecityjs/projects_analysis/experiment_interface_vr_2021.html +2 -2
- package/examples/codecityjs/projects_analysis/experiment_interface_vr_task5.html +2 -2
- package/examples/codecityjs/projects_analysis/perceval_landscape.html +2 -2
- package/examples/codecityjs/projects_analysis/perceval_table.html +2 -2
- package/examples/codecityjs/sortinghat/index.html +2 -2
- package/examples/codecityjs/sortinghat/indexcolor.html +2 -2
- package/examples/codecityjs/time_evolution_angular/index.html +2 -2
- package/examples/dashboard/chaoss-dashboards.html +1 -1
- package/examples/dashboard/chaoss-issues.html +1 -1
- package/examples/dashboard/chaoss-pr.html +1 -1
- package/examples/dashboard/index.html +1 -1
- package/examples/dashboard/range.html +3 -3
- package/examples/dashboard/template.html +1 -1
- package/examples/demos/1.0.11/index.html +4 -4
- package/examples/demos/1.0.11/index_multiuser.html +3 -3
- package/examples/demos/1.0.11/index_multiuser_ui.html +3 -3
- package/examples/demos/1.0.7/index.html +3 -3
- package/examples/demos/citations/babiaxr.json +1 -0
- package/examples/demos/citations/citations.html +72 -0
- package/examples/demos/citations/music.mp3 +0 -0
- package/examples/demos/citations/stl.js +28 -0
- package/examples/elevation/elevation basic/index.html +2 -2
- package/examples/elevation/elevation filled/index.html +2 -2
- package/{example-template.html → examples/example-template.html} +10 -9
- package/examples/experiment/city.html +15 -11
- package/examples/experiment/index.html +1 -1
- package/examples/experiment/pie.html +2 -2
- package/examples/experiment/third_party.html +92 -0
- package/examples/htmlinxr/complex.html +219 -0
- package/examples/htmlinxr/simple.html +163 -0
- package/examples/img/codecitytree.png +0 -0
- package/examples/img/codecityvs.png +0 -0
- package/examples/img/dashboard.png +0 -0
- package/examples/img/elevatedcity.png +0 -0
- package/examples/img/experiment.png +0 -0
- package/examples/img/time.png +0 -0
- package/examples/img/uinetwork.png +0 -0
- package/examples/img/uinetwork_json.png +0 -0
- package/examples/multi_bars/index.html +3 -3
- package/examples/multi_bars/index1.html +3 -3
- package/examples/multi_bars/index2.html +3 -3
- package/examples/multi_bars/index3.html +3 -3
- package/examples/multi_boats/index_multi_boats.html +3 -3
- package/examples/multi_boats/jetuml.html +3 -3
- package/examples/multi_boats/jetuml_evolution_experiment.html +3 -3
- package/examples/multi_boats/only_queryjson.html +3 -3
- package/examples/multi_boats/only_queryjson2.html +3 -3
- package/examples/multi_boats/only_queryjson3.html +3 -3
- package/examples/multi_boats/queryjson_treebuilder.html +3 -3
- package/examples/multi_boats/with_selector.html +3 -3
- package/examples/multiuser/choose_avatar/desert_demo.html +3 -3
- package/examples/multiuser/demo_esLibre_audio.html +3 -3
- package/examples/multiuser/demo_esLibre_no_audio.html +3 -3
- package/examples/multiuser/demo_no_share_ui.html +3 -3
- package/examples/multiuser/meaningful.html +3 -3
- package/examples/multiuser/new_demo.html +3 -3
- package/examples/multiuser/no_persistence.html +3 -3
- package/examples/multiuser/persistence.html +3 -3
- package/examples/multiuser/simple_scene.html +3 -3
- package/examples/performance/500bars_100anime/index.html +3 -3
- package/examples/performance/500bars_anime/index.html +3 -3
- package/examples/performance/500simplebars_100anime/index.html +3 -3
- package/examples/publications/codecityvs/aframe-lounge-component.min.js +1 -0
- package/examples/publications/codecityvs/index.html +535 -0
- package/examples/publications/codecityvs/jetuml_code_data.json +1 -0
- package/examples/publications/dashboard/index.html +764 -0
- package/examples/publications/dashboard/staticdata/80-percent-open-time-issues2.json +1 -0
- package/examples/publications/dashboard/staticdata/80-percent-open-time-pr.json +1 -0
- package/examples/publications/dashboard/staticdata/issues-by-organization.json +1 -0
- package/examples/publications/dashboard/staticdata/issues.json +1 -0
- package/examples/publications/dashboard/staticdata/median-open-time-issues.json +1 -0
- package/examples/publications/dashboard/staticdata/median-open-time-pr.json +1 -0
- package/examples/publications/dashboard/staticdata/organizations-issues.json +1 -0
- package/examples/publications/dashboard/staticdata/organizations-pr.json +1 -0
- package/examples/publications/dashboard/staticdata/projects-issues.json +1 -0
- package/examples/publications/dashboard/staticdata/projects-pr.json +1 -0
- package/examples/publications/dashboard/staticdata/pull-requests-by-organization.json +1 -0
- package/examples/publications/dashboard/staticdata/pull-requests.json +1 -0
- package/examples/publications/dashboard/staticdata/repositories-issues-asignees.json +1 -0
- package/examples/publications/dashboard/staticdata/repositories-issues-avgdays.json +1 -0
- package/examples/publications/dashboard/staticdata/repositories-issues-count.json +1 -0
- package/examples/publications/dashboard/staticdata/repositories-issues-submitters.json +1 -0
- package/examples/publications/dashboard/staticdata/repositories-pr-asignees.json +1 -0
- package/examples/publications/dashboard/staticdata/repositories-pr-avgdays.json +1 -0
- package/examples/publications/dashboard/staticdata/repositories-pr-count.json +1 -0
- package/examples/publications/dashboard/staticdata/repositories-pr-submitters.json +1 -0
- package/examples/publications/dashboard/staticdata/status-issues.json +1 -0
- package/examples/publications/dashboard/staticdata/status-pr.json +1 -0
- package/examples/publications/dashboard/staticdata/submitter-issues-avgdays.json +1 -0
- package/examples/publications/dashboard/staticdata/submitter-issues-count.json +1 -0
- package/examples/publications/dashboard/staticdata/submitter-issues-repo.json +1 -0
- package/examples/publications/dashboard/staticdata/submitter-pr-avgdays.json +1 -0
- package/examples/publications/dashboard/staticdata/submitter-pr-count.json +1 -0
- package/examples/publications/dashboard/staticdata/submitter-pr-repo.json +1 -0
- package/examples/publications/dashboard/staticdata/submitters-issues.json +1 -0
- package/examples/publications/dashboard/staticdata/submitters-pr.json +1 -0
- package/examples/publications/elevated/dependencieslist_ghdesktop.json +127660 -0
- package/examples/publications/elevated/dependencieslist_pm2.json +13726 -0
- package/examples/publications/elevated/dependencieslist_portainer.json +41818 -0
- package/examples/publications/elevated/dependencieslist_sh.json +5194 -0
- package/examples/publications/elevated/index.html +278 -0
- package/examples/selector/index.html +2 -2
- package/examples/selector_boats/index.html +3 -3
- package/examples/selector_boats/index2.html +3 -3
- package/examples/selector_boats/jetuml.html +3 -3
- package/examples/selector_boats/jetumltest.html +3 -3
- package/examples/temporal_evol/bars/index.html +3 -3
- package/examples/temporal_evol/barsmap/index.html +3 -3
- package/examples/timeline/index.html +3 -3
- package/examples/timeline/index2.html +3 -3
- package/examples/timeline/index3.html +3 -3
- package/examples/ui/bars/index.html +3 -3
- package/examples/ui/barsmap/index.html +3 -3
- package/examples/ui/boats_treegenerator/index.html +3 -3
- package/examples/ui/city_treegenerator/index.html +3 -3
- package/examples/ui/cylsmap/index.html +3 -3
- package/examples/ui/link/index.html +3 -3
- package/examples/ui/network/network.html +3 -3
- package/examples/ui/network/network_nodes_links.html +2 -2
- package/examples/ui/oculus/index.html +3 -3
- package/examples/ui/pie/index.html +3 -3
- package/examples/ui/ui_treegenerator/index.html +3 -3
- package/examples/watcher/querier_watcher/index.html +2 -2
- package/index.html +186 -168
- package/index.js +6 -1
- package/package.json +15 -14
- package/tests/index.html +2 -2
- package/tests/treebuilder.js +69 -0
- package/webpack.dev.js +12 -7
- package/webpack.devall.js +12 -7
- package/webpack.devnossl.js +5 -4
- package/webpack.prod.js +1 -1
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<title>BabiaXR - Babia-boats Demo</title>
|
|
7
|
+
<meta name="description" content="BabiaXR CodeCity evolution demo.">
|
|
8
|
+
</meta>
|
|
9
|
+
<!-- Aframe -->
|
|
10
|
+
<script src="https://aframe.io/releases/1.4.0/aframe.min.js"></script>
|
|
11
|
+
<script src="https://cdn.jsdelivr.net/gh/donmccurdy/aframe-extras@v7.1.0/dist/aframe-extras.min.js"></script>
|
|
12
|
+
<script
|
|
13
|
+
src="https://unpkg.com/aframe-environment-component@1.2.0/dist/aframe-environment-component.min.js"></script>
|
|
14
|
+
<script
|
|
15
|
+
src="../../../dist/aframe-babia-components.js"></script>
|
|
16
|
+
<script
|
|
17
|
+
src="https://rawgit.com/fernandojsg/aframe-teleport-controls/master/dist/aframe-teleport-controls.min.js"></script>
|
|
18
|
+
<script src="https://unpkg.com/aframe-tooltip-component/dist/aframe-tooltip-component.min.js"></script>
|
|
19
|
+
<script src="https://supereggbert.github.io/aframe-htmlembed-component/dist/build.js"></script>
|
|
20
|
+
|
|
21
|
+
<script
|
|
22
|
+
src="https://unpkg.com/@editvr/aframe-dialog-popup-component@1.7.3/dist/aframe-dialog-popup-component.min.js"></script>
|
|
23
|
+
<!-- Gitlab Corner -->
|
|
24
|
+
<link rel="stylesheet" href="../../assets/gitlab-corner.css">
|
|
25
|
+
</head>
|
|
26
|
+
|
|
27
|
+
<body>
|
|
28
|
+
<a-scene id="AframeScene">
|
|
29
|
+
|
|
30
|
+
<a-assets>
|
|
31
|
+
<!-- Dummy asset to make the scene sync (WIP)-->
|
|
32
|
+
<img src="https://wallpapercave.com/wp/wp2345390.jpg?dummy=8484744">
|
|
33
|
+
<img id="sky" src="../../assets/textures/360-panorama.jpg">
|
|
34
|
+
<img id="floor" src="../../assets/textures/floor-texture.jpg">
|
|
35
|
+
<img id="metalic" src="../../assets/textures/metalic-texture.jpg">
|
|
36
|
+
<img id="wall" src="../../assets/textures/concrete.png">
|
|
37
|
+
<a-asset-item id="door-obj" src="../../assets/door/door.obj"></a-asset-item>
|
|
38
|
+
<a-asset-item id="door-mtl" src="../../assets/door/door.mtl"></a-asset-item>
|
|
39
|
+
|
|
40
|
+
</a-assets>
|
|
41
|
+
|
|
42
|
+
<!-- Controls and Camera -->
|
|
43
|
+
<a-entity id="cameraRig" position="0 1.5 0" movement-controls="fly: false">
|
|
44
|
+
<a-entity id="head" position="0 0 1.6" camera
|
|
45
|
+
babia-camera="raycasterMouse: .babiaxraycasterclass;
|
|
46
|
+
raycasterHand: .babiaxraycasterclass; teleportCollision: #floorRoom" look-controls
|
|
47
|
+
wasd-controls="fly: true">
|
|
48
|
+
<a-entity></a-entity>
|
|
49
|
+
</a-entity>
|
|
50
|
+
</a-entity>
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
<!-- Slider -->
|
|
56
|
+
<a-entity id="nav" babia-navigator position="1.4 1 -1" rotation="0 0 0" scale="0.3 0.3 0.3"></a-entity>
|
|
57
|
+
|
|
58
|
+
<!-- Querier -->
|
|
59
|
+
<a-entity id="querier" babia-queryjson="url:./data.json;"></a-entity>
|
|
60
|
+
<!-- 3 Selector -->
|
|
61
|
+
<a-entity id="selector" babia-selector="from: querier; controller: nav; state: play"></a-entity>
|
|
62
|
+
<!-- Treebuilder -->
|
|
63
|
+
<a-entity id="treebuilder" babia-treebuilder="field: file_path; split_by: /; from: selector"></a-entity>
|
|
64
|
+
|
|
65
|
+
<!-- Boats Visualizer -->
|
|
66
|
+
<a-entity id="boats"
|
|
67
|
+
babia-boats="from: treebuilder; area: num_funs; height: loc_per_function; color: ccn; height_building_legend: -0.5; legend_scale: 0.25; height_quarter_legend_box: 1; height_quarter_legend_title: 1.5; legend_lookat: [laser-controls]; zone_elevation: 0.01; maxBuildingHeight: 1"
|
|
68
|
+
position="-1 0.3 -2" scale="0.015 1 0.015"></a-entity>
|
|
69
|
+
|
|
70
|
+
<!-- Close tooltips -->
|
|
71
|
+
<a-plane id="closelegends" babia-lookat="[laser-controls]" class="babiaxraycasterclass" scale="0.8 0.8 0.8"
|
|
72
|
+
position="2 2.5 -2.5" geometry="primitive: plane; width: 2; height: 0.5" color="#012752"
|
|
73
|
+
text="value: Close All Tooltips; color: white; align: center; wrapCount: 30; width: 3.6; transparent: false; alphaTest: 6; opacity: 6">
|
|
74
|
+
</a-plane>
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
<!-- Lights -->
|
|
78
|
+
<a-entity position="5 50 0" light="type: hemisphere; color: #CEE4F0; intensity: 1; groundColor: #454545">
|
|
79
|
+
</a-entity>
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
<!-- Audio Button -->
|
|
87
|
+
<!-- <a-plane id="audio_button" position="1 2.5 0" rotation="0 0 0" height="0.5" width="1.5" color="#800"
|
|
88
|
+
scale="0.5 0.5 0.5">
|
|
89
|
+
<a-text id="audio_label" value="Stop Audio" color="#fff" width="4" position="-0.5 0 0" rotation="0 0 0">
|
|
90
|
+
</a-text>
|
|
91
|
+
</a-plane> -->
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
</a-scene>
|
|
99
|
+
|
|
100
|
+
<script>
|
|
101
|
+
let listenersDone = false;
|
|
102
|
+
document.querySelector('a-scene').addEventListener('loaded', function () {
|
|
103
|
+
// rotate popups to the camera
|
|
104
|
+
let popups = document.querySelectorAll('[dialog-popup]');
|
|
105
|
+
if (!listenersDone) {
|
|
106
|
+
popups.forEach(function (popup) {
|
|
107
|
+
popup.addEventListener('click', function (event) {
|
|
108
|
+
let plane = document.getElementById(`${event.target.id}--dialog-plane`);
|
|
109
|
+
if (plane) {
|
|
110
|
+
// Opened task
|
|
111
|
+
hidePopups(popup)
|
|
112
|
+
plane.setAttribute("babia-lookat", "[laser-controls]")
|
|
113
|
+
} else {
|
|
114
|
+
// Closed task
|
|
115
|
+
showPopups()
|
|
116
|
+
}
|
|
117
|
+
}, false);
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
let infoPanel = document.getElementById(`navbarpopup--dialog-plane`);
|
|
121
|
+
infoPanel.setAttribute("visible", "true")
|
|
122
|
+
listenersDone = true;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function hidePopups(popupExcept) {
|
|
126
|
+
popups.forEach(popup => {
|
|
127
|
+
if (popup !== popupExcept) {
|
|
128
|
+
popup.setAttribute("visible", "false")
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function showPopups() {
|
|
134
|
+
popups.forEach(popup => {
|
|
135
|
+
popup.setAttribute("visible", "true")
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
})
|
|
139
|
+
|
|
140
|
+
let exitScene = document.getElementById("exitscene");
|
|
141
|
+
|
|
142
|
+
document.getElementById("ninesurvey").addEventListener('click', function (event) {
|
|
143
|
+
console.log(event)
|
|
144
|
+
if (event.target.id === "ninesurvey--close-icon") {
|
|
145
|
+
exitScene.setAttribute("visible", "false")
|
|
146
|
+
} else if (event.target.id === "ninesurvey") {
|
|
147
|
+
exitScene.setAttribute("visible", "true")
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
}, false);
|
|
151
|
+
|
|
152
|
+
exitScene.addEventListener('click', function (event) {
|
|
153
|
+
if (exitScene.getAttribute("visible")) {
|
|
154
|
+
window.location.replace("./end_first_vr.html")
|
|
155
|
+
}
|
|
156
|
+
}, false);
|
|
157
|
+
|
|
158
|
+
document.getElementById("closelegends").addEventListener('click', function (event) {
|
|
159
|
+
let ewl = document.getElementById("boats").components['babia-boats'].entitiesWithLegend
|
|
160
|
+
let newEwl = []
|
|
161
|
+
for (let i = 0; i < ewl.length; i++) {
|
|
162
|
+
newEwl.push(ewl[i])
|
|
163
|
+
}
|
|
164
|
+
for (let v = 0; v < newEwl.length; v++) {
|
|
165
|
+
newEwl[v].entity.click()
|
|
166
|
+
}
|
|
167
|
+
}, false);
|
|
168
|
+
</script>
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
<script>
|
|
172
|
+
|
|
173
|
+
document.addEventListener('controllerconnected', (event) => {
|
|
174
|
+
let hand_left = document.getElementById('babia-leftHand');
|
|
175
|
+
// stop audio left hand
|
|
176
|
+
hand_left.addEventListener('gripdown', function (evt) {
|
|
177
|
+
let tooltipAudioButton = document.getElementById('babia-tooltip_grip_L')
|
|
178
|
+
if (tooltipAudioButton.components.tooltip.data.text === 'Stop Audio') {
|
|
179
|
+
NAF.connection.adapter.enableMicrophone(false);
|
|
180
|
+
tooltipAudioButton.setAttribute('tooltip', { 'text': "Turn on Audio" });
|
|
181
|
+
} else {
|
|
182
|
+
NAF.connection.adapter.enableMicrophone(true);
|
|
183
|
+
tooltipAudioButton.setAttribute('tooltip', { 'text': "Stop Audio" });
|
|
184
|
+
}
|
|
185
|
+
})
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
/* Camera */
|
|
190
|
+
let rig = document.getElementById('rig')
|
|
191
|
+
let avatar = document.getElementById('avatar')
|
|
192
|
+
let usernameTag = document.getElementById('username-tag')
|
|
193
|
+
|
|
194
|
+
let color = getRandomColor();
|
|
195
|
+
usernameTag.setAttribute('value', color)
|
|
196
|
+
avatar.setAttribute('color', color)
|
|
197
|
+
|
|
198
|
+
function getRandomColor() {
|
|
199
|
+
var digits = '0123456789ABCDEF';
|
|
200
|
+
var color = '#';
|
|
201
|
+
for (var i = 0; i < 6; i++) {
|
|
202
|
+
color += digits[Math.floor(Math.random() * 16)];
|
|
203
|
+
}
|
|
204
|
+
return color;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/* Audio */
|
|
208
|
+
// let audioButton = document.getElementById('audio_button');
|
|
209
|
+
// let audioLabel = document.getElementById('audio_label');
|
|
210
|
+
|
|
211
|
+
// audioButton.addEventListener('click', function (event) {
|
|
212
|
+
// if (audioLabel.getAttribute('value') === 'Stop Audio') {
|
|
213
|
+
// stopAudio();
|
|
214
|
+
// } else {
|
|
215
|
+
// turnOnAudio();
|
|
216
|
+
// }
|
|
217
|
+
// });
|
|
218
|
+
function turnOnAudio() {
|
|
219
|
+
NAF.connection.adapter.enableMicrophone(true);
|
|
220
|
+
audioButton.setAttribute('color', '#800');
|
|
221
|
+
audioLabel.setAttribute('color', '#fff');
|
|
222
|
+
audioLabel.setAttribute('value', 'Stop Audio');
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
function stopAudio() {
|
|
226
|
+
NAF.connection.adapter.enableMicrophone(false);
|
|
227
|
+
audioButton.setAttribute('color', '#fff');
|
|
228
|
+
audioLabel.setAttribute('color', '#000');
|
|
229
|
+
audioLabel.setAttribute('value', 'Turn on Audio');
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
</script>
|
|
235
|
+
<script>
|
|
236
|
+
NAF.schemas.add({
|
|
237
|
+
template: '#selector-template',
|
|
238
|
+
components: [
|
|
239
|
+
'babia-selector'
|
|
240
|
+
]
|
|
241
|
+
})
|
|
242
|
+
NAF.schemas.add({
|
|
243
|
+
template: '#nav-template',
|
|
244
|
+
components: [
|
|
245
|
+
'babia-navigator'
|
|
246
|
+
]
|
|
247
|
+
})
|
|
248
|
+
/*
|
|
249
|
+
NAF.schemas.add({
|
|
250
|
+
template: '#controls-template',
|
|
251
|
+
components: [
|
|
252
|
+
'babia-controls'
|
|
253
|
+
]
|
|
254
|
+
})*/
|
|
255
|
+
|
|
256
|
+
// Avatar
|
|
257
|
+
NAF.schemas.add({
|
|
258
|
+
template: '#rig-template',
|
|
259
|
+
components: [
|
|
260
|
+
'position',
|
|
261
|
+
'rotation'
|
|
262
|
+
]
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
NAF.schemas.add({
|
|
266
|
+
template: '#camera-template',
|
|
267
|
+
components: [
|
|
268
|
+
'position',
|
|
269
|
+
'rotation'
|
|
270
|
+
]
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
NAF.schemas.add({
|
|
274
|
+
template: '#avatar-template',
|
|
275
|
+
components: [
|
|
276
|
+
'position',
|
|
277
|
+
'rotation',
|
|
278
|
+
'color',
|
|
279
|
+
'scale'
|
|
280
|
+
]
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
NAF.schemas.add({
|
|
284
|
+
template: '#username-tag-template',
|
|
285
|
+
components: [
|
|
286
|
+
'value',
|
|
287
|
+
'color',
|
|
288
|
+
'width',
|
|
289
|
+
'position',
|
|
290
|
+
'rotation'
|
|
291
|
+
]
|
|
292
|
+
});
|
|
293
|
+
</script>
|
|
294
|
+
|
|
295
|
+
<!-- GITLAB CORNER-->
|
|
296
|
+
<div class="gitlab-corner-wrapper"><a
|
|
297
|
+
href="https://gitlab.com/babiaxr/aframe-babia-components/-/blob/master/examples/multi_boats/jetuml.html"
|
|
298
|
+
class="gitlab-corner" aria-label="View source on GitLab"><svg id="logo_art" data-name="logo art"
|
|
299
|
+
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 586 559">
|
|
300
|
+
<g id="g44">
|
|
301
|
+
<path id="path46" class="cls-1"
|
|
302
|
+
d="M461.17,301.83l-18.91-58.12L404.84,128.43a6.47,6.47,0,0,0-12.27,0L355.15,243.64H230.82L193.4,128.43a6.46,6.46,0,0,0-12.26,0L143.78,243.64l-18.91,58.19a12.88,12.88,0,0,0,4.66,14.39L293,435,456.44,316.22a12.9,12.9,0,0,0,4.73-14.39" />
|
|
303
|
+
</g>
|
|
304
|
+
<g id="g48">
|
|
305
|
+
<path id="path50" class="cls-2" d="M293,434.91h0l62.16-191.28H230.87L293,434.91Z" />
|
|
306
|
+
</g>
|
|
307
|
+
<g id="g56">
|
|
308
|
+
<path id="path58" class="cls-1" d="M293,434.91,230.82,243.63h-87L293,434.91Z" />
|
|
309
|
+
</g>
|
|
310
|
+
<g id="g64">
|
|
311
|
+
<path id="path66" class="cls-3"
|
|
312
|
+
d="M143.75,243.69h0l-18.91,58.12a12.88,12.88,0,0,0,4.66,14.39L293,435,143.75,243.69Z" />
|
|
313
|
+
</g>
|
|
314
|
+
<g id="g72">
|
|
315
|
+
<path id="path74" class="cls-2"
|
|
316
|
+
d="M143.78,243.69h87.11L193.4,128.49a6.47,6.47,0,0,0-12.27,0l-37.35,115.2Z" />
|
|
317
|
+
</g>
|
|
318
|
+
<g id="g76">
|
|
319
|
+
<path id="path78" class="cls-1" d="M293,434.91l62.16-191.28H442.3L293,434.91Z" />
|
|
320
|
+
</g>
|
|
321
|
+
<g id="g80">
|
|
322
|
+
<path id="path82" class="cls-3"
|
|
323
|
+
d="M442.24,243.69h0l18.91,58.12a12.85,12.85,0,0,1-4.66,14.39L293,434.91l149.2-191.22Z" />
|
|
324
|
+
</g>
|
|
325
|
+
<g id="g84">
|
|
326
|
+
<path id="path86" class="cls-2"
|
|
327
|
+
d="M442.28,243.69h-87.1l37.42-115.2a6.46,6.46,0,0,1,12.26,0l37.42,115.2Z" />
|
|
328
|
+
</g>
|
|
329
|
+
</svg></a></div>
|
|
330
|
+
</body>
|
|
331
|
+
|
|
332
|
+
</html>
|
|
333
|
+
|