-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
247 lines (220 loc) · 6.55 KB
/
index.html
File metadata and controls
247 lines (220 loc) · 6.55 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
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script async src="https://unpkg.com/[email protected]/dist/es-module-shims.js"></script>
<script type="importmap">
{
"imports": {
"three": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.module.js",
"three/addons/": "https://cdn.jsdelivr.net/npm/[email protected]/examples/jsm/",
"mindar-image-three": "https://cdn.jsdelivr.net/npm/[email protected]/dist/mindar-image-three.prod.js"
}
}
</script>
<script src="./main.js" type="module"></script>
<style>
html, body {
position: relative;
margin: 0;
width: 100%;
height: 100%;
overflow: hidden;
}
#container {
width: 100vw;
height: 100vh;
position: relative;
overflow: hidden;
}
#scanning {
display: flex;
align-items: center;
justify-content: center;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
background: transparent;
z-index: 2;
}
/* Responsive design */
@media (min-aspect-ratio: 1/1) {
#scanning .inner {
width: 50vh;
height: 50vh;
}
}
@media (max-aspect-ratio: 1/1) {
#scanning .inner {
width: 80vw;
height: 80vw;
}
}
#scanning .inner {
display: flex;
align-items: center;
justify-content: center;
position: relative;
}
/* Angoli colorati personalizzati */
#scanning .corner {
position: absolute;
width: 60px;
height: 60px;
border-width: 6px;
border-style: solid;
border-radius: 8px;
animation: pulse 2s ease-in-out infinite;
}
/* Angolo in alto a sinistra - Rosa */
#scanning .corner.top-left {
top: -10px;
left: -10px;
border-color: #de6fbe transparent transparent #de6fbe;
border-right: none;
border-bottom: none;
}
/* Angolo in alto a destra - Grigio */
#scanning .corner.top-right {
top: -10px;
right: -10px;
border-color: #a1a5a6 #a1a5a6 transparent transparent;
border-left: none;
border-bottom: none;
}
/* Angolo in basso a sinistra - Verde */
#scanning .corner.bottom-left {
bottom: -10px;
left: -10px;
border-color: transparent transparent #7f8877 #7f8877;
border-top: none;
border-right: none;
}
/* Angolo in basso a destra - Viola */
#scanning .corner.bottom-right {
bottom: -10px;
right: -10px;
border-color: transparent #85306a #85306a transparent;
border-top: none;
border-left: none;
}
/* Classe per nascondere l'elemento */
#scanning.hidden {
display: none;
}
/* Linea di scansione con proprietà base COMPLETE */
#scanning .inner .scanline {
position: absolute;
width: 90%;
height: 8px;
background: transparent;
animation: move 3s ease-in-out infinite;
}
/* Geo Blocks completo */
#scanning .inner .scanline::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background:
linear-gradient(90deg, #de6fbe 0%, #de6fbe 20%, transparent 20%),
linear-gradient(90deg, transparent 20%, #a1a5a6 20%, #a1a5a6 40%, transparent 40%),
linear-gradient(90deg, transparent 40%, #7f8877 40%, #7f8877 60%, transparent 60%),
linear-gradient(90deg, transparent 60%, #85306a 60%, #85306a 80%, transparent 80%),
linear-gradient(90deg, transparent 80%, #574d4e 80%, #574d4e 100%);
background-size: 100% 100%;
background-repeat: no-repeat;
transform: perspective(100px) rotateX(15deg);
filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
box-shadow: 0 0 15px rgba(222, 111, 190, 0.5);
}
/* Animazione movimento */
@keyframes move {
0% {
top: 10%;
opacity: 0;
}
10% {
opacity: 1;
}
90% {
opacity: 1;
}
100% {
top: 90%;
opacity: 0;
}
}
/* Pulsanti */
.btn {
position: absolute;
z-index: 10;
border: none;
border-radius: 12px;
padding: 16px 28px;
font: 700 1rem Arial;
color: #fff;
cursor: pointer;
box-shadow: 0 4px 8px rgba(0,0,0,.25);
transition: transform .2s;
}
.btn:hover {
transform: scale(1.05);
}
#start-btn {
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background: #4caf50;
}
#stop-btn {
bottom: 32px;
left: 50%;
transform: translateX(-50%);
background: #f44336;
display: none;
}
#msg {
position: absolute;
bottom: 96px;
left: 50%;
transform: translateX(-50%);
z-index: 10;
background: rgba(0,0,0,0.8);
color: #fff;
border-radius: 8px;
padding: 12px 20px;
font-size: 1.1rem;
display: none;
text-align: center;
max-width: 80%;
}
</style>
</head>
<body>
<!-- Pulsanti -->
<button id="start-btn" class="btn">🎷 Inizia AR</button>
<button id="stop-btn" class="btn">🔇 STOP Audio</button>
<!-- Messaggio permessi -->
<p id="permission-msg" style="position: absolute; top: 20%; left: 50%; transform: translateX(-50%); z-index: 10; background: rgba(0,0,0,0.8); color: #fff; border-radius: 8px; padding: 16px 24px; font-size: 0.95rem; text-align: center; max-width: 85%; display: block;">
Questa esperienza di realtà aumentata richiede l'accesso alla fotocamera e audio del dispositivo
</p>
<div id="msg"></div>
<div id="scanning" class="hidden">
<div class="inner">
<div class="corner top-left"></div>
<div class="corner top-right"></div>
<div class="corner bottom-left"></div>
<div class="corner bottom-right"></div>
<div class="scanline"></div>
</div>
</div>
<div id="container"></div>
<audio id="voice-guide" src="./assets/audio/guida.mp3" preload="auto"></audio>
</body>
</html>