-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.html
More file actions
94 lines (78 loc) · 3.38 KB
/
Copy pathtest.html
File metadata and controls
94 lines (78 loc) · 3.38 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>MR Valentines</title>
<!-- <script src="aframe-master.js"></script> -->
<script src ="https://aframe.io/releases/1.0.3/aframe.min.js"></script>
<script src="https://unpkg.com/aframe-environment-component/dist/aframe-environment-component.min.js"></script>
<script src="https://rawgit.com/protyze/aframe-curve-component/master/dist/aframe-curve-component.min.js"></script>
<script src="https://rawgit.com/protyze/aframe-alongpath-component/master/dist/aframe-alongpath-component.min.js"></script>
<script src="https://rawgit.com/mayognaise/aframe-mouse-cursor-component/master/dist/aframe-mouse-cursor-component.min.js"></script>
</head>
<script>
AFRAME.registerComponent('cursor-listener', {
init: function () {
console.log("in register")
this.el.addEventListener('click', function (evt) {
console.log('I was clicked at: ', evt.detail.intersection.point);
});
}
});
</script>
<body>
<a-scene>
<a-camera>
<a-text id="score-element" value="Welcome to RQI" position="-0.60 0.5 -0.8"></a-text>
<a-text id="select-langage" value="Select Language" position="-0.60 0.1 -0.5"></a-text>
<a-cursor></a-cursor>
</a-camera>
<a-entity cursor-listener id="hindi-language" text= "value:Hindi ; width: 4" position="0 2 -0.8"
animation__position="property: object3D.position.z; to: -0.6; dir: alternate; dur: 4000; loop: true"
animation__collect="property: position; to: 0 0 0; dur: 300; startEvents: collected"
animation__minimize="property: scale; to: 0 0 0; dur: 300; startEvents: collected"></a-entity>
<a-entity id="english-language" text= "value:English ; width: 4" position="2 2 -0.8" onclick="displayScore()"
animation__position="property: object3D.position.z; to: -0.6; dir: alternate; dur: 4000; loop: true"
></a-entity>
<a-entity environment="preset:japan"></a-entity>
<a-entity laser-controls camera look-controls mouse-cursor></a-entity>
</a-scene>
<!-- <a-entity id="heart-model" gltf-model="playButton3D.gltf" position="0 1.5 -5"
animation__collect="property: position; to: 0 0 0; dur: 300; startEvents: collected"
animation__minimize="property: scale; to: 0 0 0; dur: 300; startEvents: collected"></a-entity> -->
<script >
const sceneEl = document.querySelector("a-scene")
const hindiEl = document.querySelector("#hindi-language")
const cameraEl = document.querySelector('a-camera');
const englishEl = document.querySelector("#english-language")
function randomPosition() {
return {
x: (Math.random() - 0.5) * 20,
y: 1.5,
z: (Math.random() - 0.5) * 20
};
}
let score = 0;
function displayScore() {
console.log("just test")
}
hindiEl.addEventListener('click', () => {
console.log("hindi")
//clone.dispatchEvent(new Event('collected'));
//displayScore();
//window.location.href = "http://localhost:8000/aframe_component.html";
})
englishEl.addEventListener('mousedown', () => {
console.log("english")
//clone.dispatchEvent(new Event('collected'));
//displayScore();
//window.location.href = "http://localhost:8000/aframe_component.html";
})
//for(let i=0 ; i<2; i++){
//}
//displayScore()
//selectLangauge()
</script>
</body>
</html>