-
Notifications
You must be signed in to change notification settings - Fork 0
/
ar-card.html
103 lines (95 loc) · 3.31 KB
/
ar-card.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
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
95
96
97
98
99
100
101
102
103
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Treshank</title>
<script src="https://aframe.io/releases/1.4.0/aframe.min.js"></script>
<!-- we import arjs version without NFT but with marker + location based support -->
<script src="static/js/aframe-ar.js"></script>
<style type="text/css">
@font-face {
font-family: "Cuprum SemiBold";
src: url("static/fonts/Cuprum-SemiBold.ttf");
}
</style>
<script>
// Rounded rectangle
AFRAME.registerGeometry('rounded-rectangle', {
schema: {
width: {default: 1, min: 0},
height: {default: 0.2, min: 0},
radius: {default: 0.1, min: 0, max: 0.5}
},
init: function (data) {
var width = data.width;
var height = data.height;
var radius = data.radius;
var curveSegments = 32;
var shape = new THREE.Shape();
shape.moveTo(0, radius);
shape.lineTo(0, height - radius);
shape.quadraticCurveTo(0, height, radius, height);
shape.lineTo(width - radius, height);
shape.quadraticCurveTo(width, height, width, height - radius);
shape.lineTo(width, radius);
shape.quadraticCurveTo(width, 0, width - radius, 0);
shape.lineTo(radius, 0);
shape.quadraticCurveTo(0, 0, 0, radius);
this.geometry = new THREE.ShapeGeometry(shape, curveSegments);
}
});
AFRAME.registerComponent("linkedin-listener",{
init: function(){
console.log("Init")
this.el.addEventListener("click", function(){
window.location.href = "https://in.linkedin.com/in/treshank-prasad-3627a1168";
});
}
})
</script>
</head>
<body>
<a-scene embedded arjs>
<a-marker preset="hiro">
<a-entity
geometry="primitive: circle"
scale="0.5 0.5 0.5"
position="1.25 0 0"
rotation="-90 0 0"
material="src: static/images/profile-picture.jpeg;"
>
</a-entity>
<a-text
value="Treshank\nPrasad"
rotation="-90 0 0"
position="2 0 0.2"
negate="false"
font="static/fonts/Cuprum-SemiBold-msdf/Cuprum-SemiBold-msdf.json"
font-image="static/fonts/Cuprum-SemiBold-msdf/Cuprum-SemiBold.png"
>
</a-text>
<a-entity
linkedin-listener
cursor="rayOrigin: mouse"
geometry="primitive: rounded-rectangle"
position="2 0 1"
rotation="-90 0 0"
material="color: #ffffff"
></a-plane>
<a-text
value="About Me"
position="0.1 0.15 0.01"
scale="0.5 0.5 0.5"
rotation="0 0 0"
color="#000000"></a-text>
</a-entity>
</a-marker>
<a-entity camera></a-entity>
</a-scene>
<script>
// document.querySelector('#linkedin').addEventListener('click', function () {
// window.location.href = "https://in.linkedin.com/in/treshank-prasad-3627a1168";
// });
</script>
</body>
</html>