-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
142 lines (134 loc) · 4.21 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
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<html>
<head>
<meta charset="utf-8" />
<title>WebXR - CPAmazonia</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<script src="https://aframe.io/releases/1.4.2/aframe.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/donmccurdy/[email protected]/dist/aframe-extras.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/mindar-image-aframe.prod.js"></script>
<style>
#example-scanning-overlay {
display: flex;
align-items: center;
justify-content: center;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
background: transparent;
z-index: 2;
}
@media (min-aspect-ratio: 1/1) {
#example-scanning-overlay .inner {
width: 50vh;
height: 50vh;
}
}
@media (max-aspect-ratio: 1/1) {
#example-scanning-overlay .inner {
width: 80vw;
height: 80vw;
}
}
#example-scanning-overlay .inner {
display: flex;
align-items: center;
justify-content: center;
position: relative;
background: linear-gradient(to right, white 10px, transparent 10px) 0 0,
linear-gradient(to right, white 10px, transparent 10px) 0 100%,
linear-gradient(to left, white 10px, transparent 10px) 100% 0,
linear-gradient(to left, white 10px, transparent 10px) 100% 100%,
linear-gradient(to bottom, white 10px, transparent 10px) 0 0,
linear-gradient(to bottom, white 10px, transparent 10px) 100% 0,
linear-gradient(to top, white 10px, transparent 10px) 0 100%,
linear-gradient(to top, white 10px, transparent 10px) 100% 100%;
background-repeat: no-repeat;
background-size: 40px 40px;
}
#example-scanning-overlay.hidden {
display: none;
}
#example-scanning-overlay img {
opacity: 0.6;
width: 90%;
align-self: center;
}
#example-scanning-overlay .inner .scanline {
position: absolute;
width: 100%;
height: 10px;
background: white;
animation: move 2s linear infinite;
}
@keyframes move {
0%,
100% {
top: 0%;
}
50% {
top: calc(100% - 10px);
}
}
</style>
</head>
<body>
<div id="example-scanning-overlay" class="">
<div class="inner">
<img alt="" src="./assets/CPAmazonia_galo-da-serra-lado.jpg" />
<div class="scanline"></div>
</div>
</div>
<a-scene
mindar-image="uiScanning: #example-scanning-overlay; imageTargetSrc: ./assets/targets.mind; missTolerance: 1; warmupTolerance: 1; filterMinCF:0.1; filterBeta: 10"
color-space="sRGB"
renderer="colorManagement: true, physicallyCorrectLights"
vr-mode-ui="enabled: false"
device-orientation-permission-ui="enabled: false"
>
<a-assets>
<img
id="card"
alt="Banner CPAmazonia"
src="./assets/banner-CPAmazonia.png"
/>
<a-asset-item
id="avatarModel"
src="./assets/rupicola.glb"
></a-asset-item>
</a-assets>
<a-camera position="0 0 0" look-controls="enabled: false"></a-camera>
<a-entity mindar-image-target="targetIndex: 0">
<a-plane
src="#card"
position="0 0 0"
height="1.2"
width="1.5"
rotation="0 0 0"
></a-plane>
<a-gltf-model
position="0 -0.45 0.3"
rotation="0 -90 0"
scale="0.3 0.3 0.3"
src="#avatarModel"
/>
</a-entity>
<a-entity mindar-image-target="targetIndex: 1">
<a-plane
src="#card"
position="0 0 0"
height="1.2"
width="1.5"
rotation="0 0 0"
></a-plane>
<a-gltf-model
position="0 -0.45 0.3"
rotation="0 -90 0"
scale="0.3 0.3 0.3"
src="#avatarModel"
/>
</a-entity>
</a-scene>
</body>
</html>