-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
39 lines (35 loc) · 1.25 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Basic VR Training Module</title>
<!-- Include A-Frame library -->
<script src="https://aframe.io/releases/1.2.0/aframe.min.js"></script>
</head>
<body>
<!-- A-Frame VR Scene -->
<a-scene>
<!-- Set up the environment -->
<a-sky color="#ECECEC"></a-sky>
<!-- Ground -->
<a-plane color="#7BC8A4" rotation="-90 0 0" width="20" height="20"></a-plane>
<!-- Training Object (e.g., a box) -->
<a-box id="trainingBox" position="0 1 -3" rotation="0 45 0" color="#4CC3D9" shadow>
<!-- Add text as an instruction -->
<a-text value="Pick Me!" align="center" position="0 0.5 0"></a-text>
</a-box>
<!-- Camera with a cursor to interact with objects -->
<a-entity camera look-controls>
<a-cursor fuse="true" fuse-timeout="500" color="#FF0000"></a-cursor>
</a-entity>
</a-scene>
<!-- Add interactivity using JavaScript -->
<script>
document.querySelector('#trainingBox').addEventListener('click', function () {
alert('You picked up the box!');
this.setAttribute('color', '#EF2D5E'); // Change color on interaction
});
</script>
</body>
</html>