aframe-babia-components 1.2.7 → 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/components/filters/babia-treebuilder.js +1 -1
- package/components/visualizers/babia-boats.js +153 -67
- package/components/visualizers/babia-html.js +255 -0
- package/dist/aframe-babia-components.js +387 -47
- package/dist/aframe-babia-components.min.js +1 -1
- 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/examples/boats/boats2/data.json +13 -206
- 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/example-template.html +7 -6
- package/examples/experiment/city.html +13 -9
- package/examples/htmlinxr/complex.html +219 -0
- package/examples/htmlinxr/simple.html +163 -0
- package/examples/publications/codecityvs/index.html +12 -10
- package/examples/publications/dashboard/index.html +3 -2
- package/examples/publications/elevated/index.html +2 -1
- package/index.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
<title>VISSOFT Citations (over time)</title>
|
|
7
|
+
<meta name="description" content="Citations to papers presented in VISSOFT, in 3D, using BabiaXR.">
|
|
8
|
+
<script src="https://aframe.io/releases/1.5.0/aframe.min.js"></script>
|
|
9
|
+
<script src="https://cdn.jsdelivr.net/gh/c-frame/aframe-extras@7.4.0/dist/aframe-extras.min.js"></script>
|
|
10
|
+
<script src="../../../dist/aframe-babia-components.js"></script>
|
|
11
|
+
<!-- <script
|
|
12
|
+
src="https://gl.githack.com/babiaxr/aframe-babia-components/-/raw/refactor/dist/aframe-babia-components.min.js">
|
|
13
|
+
</script> -->
|
|
14
|
+
|
|
15
|
+
<script
|
|
16
|
+
src="https://cdn.jsdelivr.net/gh/jgbarah/aframe-stl-exporter-component@aframe-1.5.0/dist/aframe-stl-exporter-component.min.js"></script>
|
|
17
|
+
<script src="stl.js"></script>
|
|
18
|
+
<link href="overlay.css" rel="stylesheet" />
|
|
19
|
+
</head>
|
|
20
|
+
|
|
21
|
+
<body>
|
|
22
|
+
<div class="container">
|
|
23
|
+
<button id="export_btn" class="button"><span>Export as STL</span></button>
|
|
24
|
+
<button id="music_btn" class="button"><span>Music on</span></button>
|
|
25
|
+
<button id="source_btn" class="button"><span><a href="https://gitlab.com/jgbarah/biblio3d/">Source
|
|
26
|
+
code</a></span></button>
|
|
27
|
+
<button id="info_btn" class="button"><span><a href="https://gitlab.com/jgbarah/biblio3d/-/blob/main/README.md">+
|
|
28
|
+
Info</a></span></button>
|
|
29
|
+
<button id="static_btn" class="button"><span><a href="citations-static.html">Static</a></span></button>
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<a-scene renderer="antialias: true" background="color: #c9f4f9" stl-exporter>
|
|
33
|
+
<a-assets>
|
|
34
|
+
<audio id="music" src="music.mp3" preload="auto"></audio>
|
|
35
|
+
</a-assets>
|
|
36
|
+
|
|
37
|
+
<!-- Navigator -->
|
|
38
|
+
<a-entity id="nav" babia-navigator position="8 12 4" rotation="0 0 0"></a-entity>
|
|
39
|
+
|
|
40
|
+
<a-entity id="querier" babia-queryjson="url: ./babiaxr.json;"></a-entity>
|
|
41
|
+
|
|
42
|
+
<a-entity id="selector" babia-selector="from: querier; controller: nav;
|
|
43
|
+
speed: 0.3">
|
|
44
|
+
</a-entity>
|
|
45
|
+
|
|
46
|
+
<a-entity id="tree" babia-treebuilder="field: title; split_by: /; from: selector;
|
|
47
|
+
build_root: true">
|
|
48
|
+
</a-entity>
|
|
49
|
+
|
|
50
|
+
<!-- Boats Visualizer -->
|
|
51
|
+
<a-entity animation="property: rotation; to: 0 360 0; loop: true;
|
|
52
|
+
easing: linear; dur: 60000" id="biblio" babia-boats="from: tree; area: area; height: cites; legendsAsChildren: true; legendsAsChildrenHeight: 10;
|
|
53
|
+
zone_elevation: 1; maxBuildingHeight: 14; hideQuarterBoxLegend: true; highlightQuarterByClick: true; building_separation: 0;
|
|
54
|
+
extra: 0; border: 0;
|
|
55
|
+
legend_lookat: [camera]" position="0 0.1 0" sound="src: #music; loop: true">
|
|
56
|
+
</a-entity>
|
|
57
|
+
|
|
58
|
+
<a-entity light="type: ambient; color: #BBB; intensity: 0.2"></a-entity>
|
|
59
|
+
<a-entity light="type: directional; color: #FFF; intensity: 0.6" position="-0.5 1 1"></a-entity>
|
|
60
|
+
|
|
61
|
+
<a-entity movement-controls="fly: true" position="0 7 15" rotation="0 0 0">
|
|
62
|
+
<a-entity id="head" camera babia-camera="raycasterMouse: .babiaxraycasterclass;
|
|
63
|
+
raycasterHand: .babiaxraycasterclass; teleportCollision: #floorRoom" look-controls
|
|
64
|
+
wasd-controls="fly: true; acceleration: 10">
|
|
65
|
+
<a-entity></a-entity>
|
|
66
|
+
</a-entity>
|
|
67
|
+
</a-entity>
|
|
68
|
+
</a-scene>
|
|
69
|
+
|
|
70
|
+
</body>
|
|
71
|
+
|
|
72
|
+
</html>
|
|
Binary file
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
|
|
2
|
+
let music_on = "Music on"
|
|
3
|
+
let music_off = "Music off"
|
|
4
|
+
|
|
5
|
+
let to_export_id = "biblio"
|
|
6
|
+
|
|
7
|
+
document.addEventListener("DOMContentLoaded", () => {
|
|
8
|
+
let export_btn = document.getElementById('export_btn');
|
|
9
|
+
export_btn.addEventListener('click', function () {
|
|
10
|
+
console.log("Exporting STL");
|
|
11
|
+
to_export = document.getElementById(to_export_id);
|
|
12
|
+
AFRAME.scenes[0].systems['stl-exporter'].export(to_export, {binary: true});
|
|
13
|
+
});
|
|
14
|
+
let music_btn = document.getElementById('music_btn');
|
|
15
|
+
music_btn.innerHTML = music_on;
|
|
16
|
+
music_btn.addEventListener('click', function () {
|
|
17
|
+
console.log("Switching music...");
|
|
18
|
+
let entity = document.querySelector('[sound]');
|
|
19
|
+
console.log(this.innerHTML);
|
|
20
|
+
if ( this.innerHTML === music_on) {
|
|
21
|
+
this.innerHTML = music_off;
|
|
22
|
+
entity.components.sound.playSound();
|
|
23
|
+
} else {
|
|
24
|
+
this.innerHTML = music_on;
|
|
25
|
+
entity.components.sound.pauseSound();
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
});
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
<script src="https://aframe.io/releases/1.5.0/aframe.min.js"></script>
|
|
9
9
|
<script src="https://cdn.jsdelivr.net/gh/donmccurdy/aframe-extras@v7.2.0/dist/aframe-extras.min.js"></script>
|
|
10
10
|
<script src="https://unpkg.com/aframe-environment-component@1.3.3/dist/aframe-environment-component.min.js"></script>
|
|
11
|
-
<script src="https://unpkg.com/aframe-text-geometry-component@0.5.1/dist/aframe-text-geometry-component.min.js"></script>
|
|
12
11
|
<script src="../../../dist/aframe-babia-components.min.js"></script>
|
|
13
12
|
<link rel="stylesheet" href="../../assets/gitlab-corner.css">
|
|
14
13
|
</head>
|
|
@@ -20,11 +19,13 @@
|
|
|
20
19
|
|
|
21
20
|
<!-- scene -->
|
|
22
21
|
|
|
23
|
-
<!-- Camera -->
|
|
24
|
-
<a-entity
|
|
25
|
-
<a-entity camera
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
<!-- Controls and Camera -->
|
|
23
|
+
<a-entity id="cameraRig" position="0 1.6 3">
|
|
24
|
+
<a-entity id="head" camera babia-camera="raycasterMouse: .babiaxraycasterclass;
|
|
25
|
+
raycasterHand: .babiaxraycasterclass; teleportCollision: #floorRoom" look-controls
|
|
26
|
+
wasd-controls="fly: true; acceleration: 10">
|
|
27
|
+
<a-entity></a-entity>
|
|
28
|
+
</a-entity>
|
|
28
29
|
</a-entity>
|
|
29
30
|
|
|
30
31
|
</a-scene>
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
<a-sky src="#sky"></a-sky>
|
|
62
62
|
|
|
63
63
|
<!-- Information popup -->
|
|
64
|
-
<a-entity rotation="0 -90 0" position="
|
|
64
|
+
<a-entity rotation="0 -90 0" position="3 5 -4.5">
|
|
65
65
|
<a-entity id="navbarpopup" position="2 -1 -5"
|
|
66
66
|
dialog-popup="
|
|
67
67
|
openIconImage: ../assets/popups/info.jpg;
|
|
@@ -84,11 +84,11 @@
|
|
|
84
84
|
|
|
85
85
|
|
|
86
86
|
<!-- Aframe Lounge -->
|
|
87
|
-
<a-entity position="
|
|
87
|
+
<a-entity position="-1 0.6 0.9" id="city"
|
|
88
88
|
babia-boats="height_building_legend: -0.5; legend_scale: 0.25; extra: 1; zone_elevation: 0.01; from: jetumlcity; area: num_funs; height: loc_per_function; color: ccn; height_quarter_legend_box: 1; height_quarter_legend_title: -3; autoscale: true">
|
|
89
89
|
</a-entity>
|
|
90
90
|
|
|
91
|
-
<a-entity id="lounge" position="5 0
|
|
91
|
+
<a-entity id="lounge" position="1 5.6 0" lounge="width: 20; depth: 25; height: 11;
|
|
92
92
|
north: barrier;
|
|
93
93
|
floorTexture: ../assets/textures/floor-texture.jpg">
|
|
94
94
|
|
|
@@ -104,8 +104,7 @@
|
|
|
104
104
|
|
|
105
105
|
|
|
106
106
|
|
|
107
|
-
<a-entity id="bardescription" position="7.4 -4.7 -1.5" rotation="-30 0 0" scale="0.8 0.8 0.8">
|
|
108
|
-
<!-- Close tooltips -->
|
|
107
|
+
<!-- <a-entity id="bardescription" position="7.4 -4.7 -1.5" rotation="-30 0 0" scale="0.8 0.8 0.8">
|
|
109
108
|
<a-plane id="closelegends" babia-lookat="[camera]" class="babiaxraycasterclass" scale="0.8 0.8 0.8"
|
|
110
109
|
position="0 1.5 0" geometry="primitive: plane; width: 2; height: 0.5" color="#012752"
|
|
111
110
|
text="value: Close All Tooltips; color: white; align: center; wrapCount: 30; width: 3.6; transparent: false; alphaTest: 6; opacity: 6">
|
|
@@ -127,7 +126,7 @@
|
|
|
127
126
|
<p>Interactions: Click (or hover) on a building or click on a quarter to discover more.
|
|
128
127
|
</p>
|
|
129
128
|
</a-entity>
|
|
130
|
-
</a-entity>
|
|
129
|
+
</a-entity> -->
|
|
131
130
|
|
|
132
131
|
<!-- Lights -->
|
|
133
132
|
<a-entity position="5 50 0" light="type: hemisphere; color: #CEE4F0; intensity: 1; groundColor: #454545">
|
|
@@ -137,9 +136,14 @@
|
|
|
137
136
|
<a-entity lounge-entry-point rotation="0 -90 0">
|
|
138
137
|
|
|
139
138
|
</a-entity>
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
139
|
+
<!-- Controls and Camera -->
|
|
140
|
+
<a-entity id="cameraRig" position="0 1.6 5" movement-controls>
|
|
141
|
+
<a-entity id="head" camera
|
|
142
|
+
babia-camera="raycasterMouse: .babiaxraycasterclass; raycasterHand: .babiaxraycasterclass; teleportCollision: #floorRoom"
|
|
143
|
+
look-controls wasd-controls="fly: true">
|
|
144
|
+
<a-entity></a-entity>
|
|
145
|
+
</a-entity>
|
|
146
|
+
</a-entity>
|
|
143
147
|
</a-entity>
|
|
144
148
|
|
|
145
149
|
</a-scene>
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<title></title>
|
|
7
|
+
<meta name="description" content="A BabiaXR example - " />
|
|
8
|
+
<script src="https://aframe.io/releases/1.5.0/aframe.min.js"></script>
|
|
9
|
+
<script src="https://cdn.jsdelivr.net/gh/donmccurdy/aframe-extras@v7.2.0/dist/aframe-extras.min.js"></script>
|
|
10
|
+
<script
|
|
11
|
+
src="https://unpkg.com/aframe-environment-component@1.3.3/dist/aframe-environment-component.min.js"></script>
|
|
12
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js"></script>
|
|
13
|
+
<script src="../../dist/aframe-babia-components.js"></script>
|
|
14
|
+
<script src="../../components/visualizers/babia-html.js"></script>
|
|
15
|
+
<link rel="stylesheet" href="../../assets/gitlab-corner.css">
|
|
16
|
+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
|
|
17
|
+
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
|
|
18
|
+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
|
|
19
|
+
</head>
|
|
20
|
+
|
|
21
|
+
<body>
|
|
22
|
+
<a-scene xr-mode-ui="XRMode: xr" background="color: #A8F3FF" id="AframeScene">
|
|
23
|
+
<!-- <a-entity environment="playArea: 10"></a-entity> -->
|
|
24
|
+
<a-light type="point" intensity="1" position="-10 20 30"></a-light>
|
|
25
|
+
|
|
26
|
+
<!-- scene -->
|
|
27
|
+
<a-entity scale="0.3 0.3 0.3" position="-2 2 0" id="htmlDOM" babia-html='renderHTML: true; renderHTMLOnlyLeafs: true; distanceLevels: 0.7; html:
|
|
28
|
+
<div class="container">
|
|
29
|
+
<h2>Alerts 1</h2>
|
|
30
|
+
<div class="alert alert-success">
|
|
31
|
+
Success! This alert box could indicate a successful or positive action.
|
|
32
|
+
</div>
|
|
33
|
+
<div class="alert alert-info">
|
|
34
|
+
Info! This alert box could indicate a neutral informative change or action.
|
|
35
|
+
</div>
|
|
36
|
+
<div class="alert alert-warning">
|
|
37
|
+
Warning! This alert box could indicate a warning that might need attention.
|
|
38
|
+
</div>
|
|
39
|
+
<div class="alert alert-danger">
|
|
40
|
+
Danger! This alert box could indicate a dangerous or potentially negative action.
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
<div class="wrapper">
|
|
45
|
+
<header>
|
|
46
|
+
<div class="branding">
|
|
47
|
+
<h1>Brand Name</h1>
|
|
48
|
+
<nav>
|
|
49
|
+
<ul>
|
|
50
|
+
<li><a href="#home">Home</a></li>
|
|
51
|
+
<li><a href="#products">Products</a>
|
|
52
|
+
<ul>
|
|
53
|
+
<li><a href="#product1">Product 1</a></li>
|
|
54
|
+
<li><a href="#product2">Product 2</a></li>
|
|
55
|
+
</ul>
|
|
56
|
+
</li>
|
|
57
|
+
<li><a href="#services">Services</a></li>
|
|
58
|
+
<li><a href="#contact">Contact</a></li>
|
|
59
|
+
</ul>
|
|
60
|
+
</nav>
|
|
61
|
+
</div>
|
|
62
|
+
</header>
|
|
63
|
+
<main>
|
|
64
|
+
<section class="intro">
|
|
65
|
+
<h2>Welcome</h2>
|
|
66
|
+
<p>Introduction content here.</p>
|
|
67
|
+
</section>
|
|
68
|
+
<section class="features">
|
|
69
|
+
<div class="feature">
|
|
70
|
+
<h3>Feature 1</h3>
|
|
71
|
+
<p>Description of feature 1.</p>
|
|
72
|
+
</div>
|
|
73
|
+
<div class="feature">
|
|
74
|
+
<h3>Feature 2</h3>
|
|
75
|
+
<p>Description of feature 2.</p>
|
|
76
|
+
</div>
|
|
77
|
+
</section>
|
|
78
|
+
<article class="highlight">
|
|
79
|
+
<h2>Highlighted Article</h2>
|
|
80
|
+
<p>Content of the highlighted article.</p>
|
|
81
|
+
<table>
|
|
82
|
+
<thead>
|
|
83
|
+
<tr>
|
|
84
|
+
<th>Column 1</th>
|
|
85
|
+
<th>Column 2</th>
|
|
86
|
+
<th>Column 3</th>
|
|
87
|
+
</tr>
|
|
88
|
+
</thead>
|
|
89
|
+
<tbody>
|
|
90
|
+
<tr>
|
|
91
|
+
<td>Data 1</td>
|
|
92
|
+
<td>Data 2</td>
|
|
93
|
+
<td>Data 3</td>
|
|
94
|
+
</tr>
|
|
95
|
+
<tr>
|
|
96
|
+
<td>Data 4</td>
|
|
97
|
+
<td>Data 5</td>
|
|
98
|
+
<td>Data 6</td>
|
|
99
|
+
</tr>
|
|
100
|
+
</tbody>
|
|
101
|
+
</table>
|
|
102
|
+
</article>
|
|
103
|
+
</main>
|
|
104
|
+
<footer>
|
|
105
|
+
<p>© 2024 Company Name</p>
|
|
106
|
+
</footer>
|
|
107
|
+
</div>
|
|
108
|
+
'></a-entity>
|
|
109
|
+
|
|
110
|
+
<!-- buttons -->
|
|
111
|
+
<a-entity position="0 3 0">
|
|
112
|
+
<!-- RotateX button -->
|
|
113
|
+
<a-plane id="rotateX" class="babiaxraycasterclass" position="-1 1 -3" width="1" height="0.5" color="blue"
|
|
114
|
+
rotation="0 0 0" text="value: RotateX; color: white; align: center; width: 3;"></a-plane>
|
|
115
|
+
|
|
116
|
+
<!-- RotateY button -->
|
|
117
|
+
<a-plane id="rotateY" class="babiaxraycasterclass" position="0 1 -3" width="1" height="0.5" color="green"
|
|
118
|
+
rotation="0 0 0" text="value: RotateY; color: white; align: center; width: 3;"></a-plane>
|
|
119
|
+
|
|
120
|
+
<!-- RotateZ button -->
|
|
121
|
+
<a-plane id="rotateZ" class="babiaxraycasterclass" position="1 1 -3" width="1" height="0.5" color="red"
|
|
122
|
+
rotation="0 0 0" text="value: RotateZ; color: white; align: center; width: 3;"></a-plane>
|
|
123
|
+
|
|
124
|
+
<!-- Collapse button -->
|
|
125
|
+
<a-plane id="collapse" class="babiaxraycasterclass" position="-1 0.5 -3" width="1" height="0.5"
|
|
126
|
+
color="yellow" rotation="0 0 0"
|
|
127
|
+
text="value: Collapse; color: black; align: center; width: 3;"></a-plane>
|
|
128
|
+
|
|
129
|
+
<!-- Expand button -->
|
|
130
|
+
<a-plane id="expand" class="babiaxraycasterclass" position="1 0.5 -3" width="1" height="0.5" color="purple"
|
|
131
|
+
rotation="0 0 0" text="value: Expand; color: white; align: center; width: 3;"></a-plane>
|
|
132
|
+
</a-entity>
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
<!-- Controls and Camera -->
|
|
136
|
+
<a-entity id="cameraRig" position="0 1.6 3">
|
|
137
|
+
<a-entity id="head" camera babia-camera="raycasterMouse: .babiaxraycasterclass;
|
|
138
|
+
raycasterHand: .babiaxraycasterclass; teleportCollision: #floorRoom" look-controls
|
|
139
|
+
wasd-controls="fly: true; acceleration: 10">
|
|
140
|
+
<a-entity></a-entity>
|
|
141
|
+
</a-entity>
|
|
142
|
+
</a-entity>
|
|
143
|
+
|
|
144
|
+
</a-scene>
|
|
145
|
+
|
|
146
|
+
<script>// RotateX button
|
|
147
|
+
document.querySelector('#rotateX').addEventListener('click', function () {
|
|
148
|
+
let entity = document.querySelector('#htmlDOM');
|
|
149
|
+
let rotation = entity.getAttribute('rotation');
|
|
150
|
+
entity.setAttribute('rotation', { x: rotation.x + 90, y: rotation.y, z: rotation.z });
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
// RotateY button
|
|
154
|
+
document.querySelector('#rotateY').addEventListener('click', function () {
|
|
155
|
+
let entity = document.querySelector('#htmlDOM');
|
|
156
|
+
let rotation = entity.getAttribute('rotation');
|
|
157
|
+
entity.setAttribute('rotation', { x: rotation.x, y: rotation.y + 90, z: rotation.z });
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
// RotateZ button
|
|
161
|
+
document.querySelector('#rotateZ').addEventListener('click', function () {
|
|
162
|
+
let entity = document.querySelector('#htmlDOM');
|
|
163
|
+
let rotation = entity.getAttribute('rotation');
|
|
164
|
+
entity.setAttribute('rotation', { x: rotation.x, y: rotation.y, z: rotation.z + 90 });
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
// Collapse button
|
|
168
|
+
document.querySelector('#collapse').addEventListener('click', function () {
|
|
169
|
+
let entity = document.querySelector('#htmlDOM');
|
|
170
|
+
entity.setAttribute('babia-html', 'distanceLevels: 0.01');
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
// Expand button
|
|
174
|
+
document.querySelector('#expand').addEventListener('click', function () {
|
|
175
|
+
let entity = document.querySelector('#htmlDOM');
|
|
176
|
+
entity.setAttribute('babia-html', 'distanceLevels: 0.7');
|
|
177
|
+
});
|
|
178
|
+
</script>
|
|
179
|
+
|
|
180
|
+
<!-- GITLAB CORNER-->
|
|
181
|
+
<div class="gitlab-corner-wrapper"><a
|
|
182
|
+
href="https://gitlab.com/babiaxr/aframe-babia-components/-/blob/master/examples///index.html"
|
|
183
|
+
class="gitlab-corner" aria-label="View source on GitLab"><svg id="logo_art" data-name="logo art"
|
|
184
|
+
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 586 559">
|
|
185
|
+
<g id="g44">
|
|
186
|
+
<path id="path46" class="cls-1"
|
|
187
|
+
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" />
|
|
188
|
+
</g>
|
|
189
|
+
<g id="g48">
|
|
190
|
+
<path id="path50" class="cls-2" d="M293,434.91h0l62.16-191.28H230.87L293,434.91Z" />
|
|
191
|
+
</g>
|
|
192
|
+
<g id="g56">
|
|
193
|
+
<path id="path58" class="cls-1" d="M293,434.91,230.82,243.63h-87L293,434.91Z" />
|
|
194
|
+
</g>
|
|
195
|
+
<g id="g64">
|
|
196
|
+
<path id="path66" class="cls-3"
|
|
197
|
+
d="M143.75,243.69h0l-18.91,58.12a12.88,12.88,0,0,0,4.66,14.39L293,435,143.75,243.69Z" />
|
|
198
|
+
</g>
|
|
199
|
+
<g id="g72">
|
|
200
|
+
<path id="path74" class="cls-2"
|
|
201
|
+
d="M143.78,243.69h87.11L193.4,128.49a6.47,6.47,0,0,0-12.27,0l-37.35,115.2Z" />
|
|
202
|
+
</g>
|
|
203
|
+
<g id="g76">
|
|
204
|
+
<path id="path78" class="cls-1" d="M293,434.91l62.16-191.28H442.3L293,434.91Z" />
|
|
205
|
+
</g>
|
|
206
|
+
<g id="g80">
|
|
207
|
+
<path id="path82" class="cls-3"
|
|
208
|
+
d="M442.24,243.69h0l18.91,58.12a12.85,12.85,0,0,1-4.66,14.39L293,434.91l149.2-191.22Z" />
|
|
209
|
+
</g>
|
|
210
|
+
<g id="g84">
|
|
211
|
+
<path id="path86" class="cls-2"
|
|
212
|
+
d="M442.28,243.69h-87.1l37.42-115.2a6.46,6.46,0,0,1,12.26,0l37.42,115.2Z" />
|
|
213
|
+
</g>
|
|
214
|
+
</svg></a></div>
|
|
215
|
+
|
|
216
|
+
</body>
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
</html>
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<title></title>
|
|
7
|
+
<meta name="description" content="A BabiaXR example - " />
|
|
8
|
+
<script src="https://aframe.io/releases/1.5.0/aframe.min.js"></script>
|
|
9
|
+
<script src="https://cdn.jsdelivr.net/gh/donmccurdy/aframe-extras@v7.2.0/dist/aframe-extras.min.js"></script>
|
|
10
|
+
<script
|
|
11
|
+
src="https://unpkg.com/aframe-environment-component@1.3.3/dist/aframe-environment-component.min.js"></script>
|
|
12
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js"></script>
|
|
13
|
+
<script src="../../dist/aframe-babia-components.js"></script>
|
|
14
|
+
<script src="../../components/visualizers/babia-html.js"></script>
|
|
15
|
+
<link rel="stylesheet" href="../../assets/gitlab-corner.css">
|
|
16
|
+
</head>
|
|
17
|
+
|
|
18
|
+
<body>
|
|
19
|
+
<a-scene xr-mode-ui="XRMode: xr" background="color: #A8F3FF" id="AframeScene">
|
|
20
|
+
<!-- <a-entity environment="playArea: 10"></a-entity> -->
|
|
21
|
+
<a-light type="point" intensity="1" position="-10 20 30"></a-light>
|
|
22
|
+
|
|
23
|
+
<!-- scene -->
|
|
24
|
+
<a-entity id="htmlDOM" scale="0.3 0.3 0.3" position="-2 2 0" babia-html='renderHTML: true; renderHTMLOnlyLeafs: true; distanceLevels: 0.7; html: <header>
|
|
25
|
+
<h1>Website Title</h1>
|
|
26
|
+
<nav>
|
|
27
|
+
<ul>
|
|
28
|
+
<li><a href="#home">Home</a></li>
|
|
29
|
+
<li><a href="#about">About</a></li>
|
|
30
|
+
<li><a href="#contact">Contact</a></li>
|
|
31
|
+
</ul>
|
|
32
|
+
</nav>
|
|
33
|
+
</header>
|
|
34
|
+
<main>
|
|
35
|
+
<section>
|
|
36
|
+
<h2>Main Content</h2>
|
|
37
|
+
<article>
|
|
38
|
+
<h3>Article Title</h3>
|
|
39
|
+
<p>Article content goes here.</p>
|
|
40
|
+
</article>
|
|
41
|
+
<aside>
|
|
42
|
+
<h4>Related Links</h4>
|
|
43
|
+
<ul>
|
|
44
|
+
<li><a href="#link1">Link 1</a></li>
|
|
45
|
+
<li><a href="#link2">Link 2</a></li>
|
|
46
|
+
</ul>
|
|
47
|
+
</aside>
|
|
48
|
+
</section>
|
|
49
|
+
</main>
|
|
50
|
+
<footer>
|
|
51
|
+
<p>© 2024 Website</p>
|
|
52
|
+
</footer>'></a-entity>
|
|
53
|
+
|
|
54
|
+
<!-- buttons -->
|
|
55
|
+
<a-entity position="0 3 0">
|
|
56
|
+
<!-- RotateX button -->
|
|
57
|
+
<a-plane id="rotateX" class="babiaxraycasterclass" position="-1 1 -3" width="1" height="0.5" color="blue"
|
|
58
|
+
rotation="0 0 0" text="value: RotateX; color: white; align: center; width: 3;"></a-plane>
|
|
59
|
+
|
|
60
|
+
<!-- RotateY button -->
|
|
61
|
+
<a-plane id="rotateY" class="babiaxraycasterclass" position="0 1 -3" width="1" height="0.5" color="green"
|
|
62
|
+
rotation="0 0 0" text="value: RotateY; color: white; align: center; width: 3;"></a-plane>
|
|
63
|
+
|
|
64
|
+
<!-- RotateZ button -->
|
|
65
|
+
<a-plane id="rotateZ" class="babiaxraycasterclass" position="1 1 -3" width="1" height="0.5" color="red"
|
|
66
|
+
rotation="0 0 0" text="value: RotateZ; color: white; align: center; width: 3;"></a-plane>
|
|
67
|
+
|
|
68
|
+
<!-- Collapse button -->
|
|
69
|
+
<a-plane id="collapse" class="babiaxraycasterclass" position="-1 0.5 -3" width="1" height="0.5"
|
|
70
|
+
color="yellow" rotation="0 0 0"
|
|
71
|
+
text="value: Collapse; color: black; align: center; width: 3;"></a-plane>
|
|
72
|
+
|
|
73
|
+
<!-- Expand button -->
|
|
74
|
+
<a-plane id="expand" class="babiaxraycasterclass" position="1 0.5 -3" width="1" height="0.5" color="purple"
|
|
75
|
+
rotation="0 0 0" text="value: Expand; color: white; align: center; width: 3;"></a-plane>
|
|
76
|
+
</a-entity>
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
<!-- Controls and Camera -->
|
|
81
|
+
<a-entity id="cameraRig" movement-controls="fly: true; speed: 0.1" position="0 1.6 3">
|
|
82
|
+
<a-entity id="head" camera babia-camera="raycasterMouse: .babiaxraycasterclass;
|
|
83
|
+
raycasterHand: .babiaxraycasterclass" look-controls>
|
|
84
|
+
<a-entity></a-entity>
|
|
85
|
+
</a-entity>
|
|
86
|
+
</a-entity>
|
|
87
|
+
|
|
88
|
+
</a-scene>
|
|
89
|
+
|
|
90
|
+
<script>// RotateX button
|
|
91
|
+
document.querySelector('#rotateX').addEventListener('click', function () {
|
|
92
|
+
let entity = document.querySelector('#htmlDOM');
|
|
93
|
+
let rotation = entity.getAttribute('rotation');
|
|
94
|
+
entity.setAttribute('rotation', { x: rotation.x + 90, y: rotation.y, z: rotation.z });
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
// RotateY button
|
|
98
|
+
document.querySelector('#rotateY').addEventListener('click', function () {
|
|
99
|
+
let entity = document.querySelector('#htmlDOM');
|
|
100
|
+
let rotation = entity.getAttribute('rotation');
|
|
101
|
+
entity.setAttribute('rotation', { x: rotation.x, y: rotation.y + 90, z: rotation.z });
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
// RotateZ button
|
|
105
|
+
document.querySelector('#rotateZ').addEventListener('click', function () {
|
|
106
|
+
let entity = document.querySelector('#htmlDOM');
|
|
107
|
+
let rotation = entity.getAttribute('rotation');
|
|
108
|
+
entity.setAttribute('rotation', { x: rotation.x, y: rotation.y, z: rotation.z + 90 });
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
// Collapse button
|
|
112
|
+
document.querySelector('#collapse').addEventListener('click', function () {
|
|
113
|
+
let entity = document.querySelector('#htmlDOM');
|
|
114
|
+
entity.setAttribute('babia-html', 'distanceLevels: 0.01');
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
// Expand button
|
|
118
|
+
document.querySelector('#expand').addEventListener('click', function () {
|
|
119
|
+
let entity = document.querySelector('#htmlDOM');
|
|
120
|
+
entity.setAttribute('babia-html', 'distanceLevels: 0.7');
|
|
121
|
+
});
|
|
122
|
+
</script>
|
|
123
|
+
|
|
124
|
+
<!-- GITLAB CORNER-->
|
|
125
|
+
<div class="gitlab-corner-wrapper"><a
|
|
126
|
+
href="https://gitlab.com/babiaxr/aframe-babia-components/-/blob/master/examples///index.html"
|
|
127
|
+
class="gitlab-corner" aria-label="View source on GitLab"><svg id="logo_art" data-name="logo art"
|
|
128
|
+
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 586 559">
|
|
129
|
+
<g id="g44">
|
|
130
|
+
<path id="path46" class="cls-1"
|
|
131
|
+
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" />
|
|
132
|
+
</g>
|
|
133
|
+
<g id="g48">
|
|
134
|
+
<path id="path50" class="cls-2" d="M293,434.91h0l62.16-191.28H230.87L293,434.91Z" />
|
|
135
|
+
</g>
|
|
136
|
+
<g id="g56">
|
|
137
|
+
<path id="path58" class="cls-1" d="M293,434.91,230.82,243.63h-87L293,434.91Z" />
|
|
138
|
+
</g>
|
|
139
|
+
<g id="g64">
|
|
140
|
+
<path id="path66" class="cls-3"
|
|
141
|
+
d="M143.75,243.69h0l-18.91,58.12a12.88,12.88,0,0,0,4.66,14.39L293,435,143.75,243.69Z" />
|
|
142
|
+
</g>
|
|
143
|
+
<g id="g72">
|
|
144
|
+
<path id="path74" class="cls-2"
|
|
145
|
+
d="M143.78,243.69h87.11L193.4,128.49a6.47,6.47,0,0,0-12.27,0l-37.35,115.2Z" />
|
|
146
|
+
</g>
|
|
147
|
+
<g id="g76">
|
|
148
|
+
<path id="path78" class="cls-1" d="M293,434.91l62.16-191.28H442.3L293,434.91Z" />
|
|
149
|
+
</g>
|
|
150
|
+
<g id="g80">
|
|
151
|
+
<path id="path82" class="cls-3"
|
|
152
|
+
d="M442.24,243.69h0l18.91,58.12a12.85,12.85,0,0,1-4.66,14.39L293,434.91l149.2-191.22Z" />
|
|
153
|
+
</g>
|
|
154
|
+
<g id="g84">
|
|
155
|
+
<path id="path86" class="cls-2"
|
|
156
|
+
d="M442.28,243.69h-87.1l37.42-115.2a6.46,6.46,0,0,1,12.26,0l37.42,115.2Z" />
|
|
157
|
+
</g>
|
|
158
|
+
</svg></a></div>
|
|
159
|
+
|
|
160
|
+
</body>
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
</html>
|