-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
247 lines (175 loc) · 10.7 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
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
<!DOCTYPE html>
<html lang="pt-br">
<head>
<title>Jaibs - Vitrine virtual</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="msapplication-tap-highlight" content="no">
<meta name="mobile-web-app-capable" content="yes">
<meta name="application-name" lang="pt-br" content="Havaianas">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-title" content="Havaianas">
<meta name="theme-color" content="#EBB61F">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<link rel="stylesheet" href="assets/styles.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500&display=swap" rel="stylesheet">
<!-- The following libraries and polyfills are recommended to maximize browser support -->
<!-- NOTE: you must adjust the paths as appropriate for your project -->
<!-- 🚨 REQUIRED: Web Components polyfill to support Edge and Firefox < 63 -->
<script src="https://unpkg.com/@webcomponents/[email protected]/webcomponents-loader.js"></script>
<!-- 💁 OPTIONAL: Intersection Observer polyfill for better performance in Safari and IE11 -->
<script src="https://unpkg.com/[email protected]/intersection-observer.js"></script>
<!-- 💁 OPTIONAL: Resize Observer polyfill improves resize behavior in non-Chrome browsers -->
<script src="https://unpkg.com/[email protected]/dist/ResizeObserver.js"></script>
<!-- 💁 OPTIONAL: The :focus-visible polyfill removes the focus ring for some input types -->
<!-- MALA MAIS LEVE src="https://cdn.glitch.com/26f00b29-51b7-4811-9ca7-3f1c898bb4b3%2Fmala_animada.glb?v=1619990634104"-->
<script src="https://unpkg.com/[email protected]/dist/focus-visible.js" defer></script>
</head>
<body id="corpo">
<div id="card">
<model-viewer id="modelViewer" src="assets/havaianas.glb" alt="Havaianas - Vitrine virtual" shadow-intensity="2.8" camera-controls exposure="1" loading="lazy" auto-rotate shadow-softness="1.5" camera-orbit="-227.6deg 66.15deg 6.878m" min-camera-orbit="auto auto auto"
max-camera-orbit="auto auto 6.878m" camera-target="auto 0m 0m" environment-image="assets/aircraft_workshop_01_1k.hdr" ar>
</model-viewer>
<div id="logo">
</div>
<div id="comprar">
<img src="assets/comprar.png">
</div>
<div id="instrucoes">
<p>
Tap spin the havaianas. Use scroll or pinch to zoom.</p><a href="https://www.Jaibs.co" target="_blank">By Ali Zaib @Jaibs.</a>
</div>
<div id="controles_3d">
<div class="horizontal">
<p>
Side
</p>
</div>
<div class="vertical">
<p>
Forehead
</p>
</div>
</div>
<div id="footer">
<h1>Hawaiian Brazil Colors R $ 45,00</h1>
<p>Comfortable, amazing and pants perfectly in 90% of the feet</p>
<span>See in other colors</span>
<div class="controls" id="color-controls">
<div class="azul">
<img src="assets/azul.png">
</div>
<div class="verde">
<img src="assets/verde_amarelo.png">
</div>
<div class="amarelo">
<img src="assets/amarelo_verde.png">
</div>
</div>
</div>
<script>
var modelViewerColor = document.querySelector("model-viewer#modelViewer");
//modelViewer.addEventListener('model-visibility', function(evt) {
//const materialTira = modelViewerColor.model.materials[0];materialTira.pbrMetallicRoughness.setRoughnessFactor(0.6);
//modelViewerColor.orientation = "0deg 90deg 0m";
//modelViewerColor.scale = "0.7 0.7 0.7";
//modelViewerColor.cameraTarget = "auto 0m 0m";
//modelViewerColor.cameraOrbit = '0deg', '45deg', '7.095m';
//modelViewerColor.updateFraming();
//})
document.querySelector('#color-controls .azul').addEventListener('click', (event) => {
const materialTira = modelViewerColor.model.materials[0];
const materialPalmilia = modelViewerColor.model.materials[1];
const materialBorda = modelViewerColor.model.materials[2];
const materialLogo = modelViewerColor.model.materials[3];
materialTira.pbrMetallicRoughness.setBaseColorFactor([0.3, 0.3, 0.3, 1]);
materialTira.pbrMetallicRoughness.setRoughnessFactor(0.3);
materialPalmilia.pbrMetallicRoughness.setBaseColorFactor([0.3, 0.3, 0.3, 1]);
materialPalmilia.pbrMetallicRoughness.setRoughnessFactor(0.7);
materialLogo.pbrMetallicRoughness.setBaseColorFactor([0, 0.008, 0.04, 1]);
//console.log(materialPalmilia.pbrMetallicRoughness.baseColorTexture);
materialPalmilia.pbrMetallicRoughness.baseColorTexture.texture.source.setURI('assets/Base_palmilia_azul.png');
materialBorda.pbrMetallicRoughness.setBaseColorFactor([0.3, 0.3, 0.3, 1]);
materialBorda.pbrMetallicRoughness.setRoughnessFactor(0.3);
materialBorda.pbrMetallicRoughness.baseColorTexture.texture.source.setURI('assets/borda_chinelo_diffuse_azul.png');
});
document.querySelector('#color-controls .verde').addEventListener('click', (event) => {
const materialTira = modelViewerColor.model.materials[0];
const materialPalmilia = modelViewerColor.model.materials[1];
const materialBorda = modelViewerColor.model.materials[2];
const materialLogo = modelViewerColor.model.materials[3];
materialTira.pbrMetallicRoughness.setBaseColorFactor([0.5, 0.2, 0.007, 1]);
materialTira.pbrMetallicRoughness.setRoughnessFactor(0.5);
materialPalmilia.pbrMetallicRoughness.setBaseColorFactor([0.3, 0.3, 0.3, 1]);
materialPalmilia.pbrMetallicRoughness.setRoughnessFactor(0.9);
materialLogo.pbrMetallicRoughness.setBaseColorFactor([0, 0.008, 0.04, 1]);
//console.log(materialPalmilia.pbrMetallicRoughness.baseColorTexture);
materialPalmilia.pbrMetallicRoughness.baseColorTexture.texture.source.setURI('assets/Base_palmilia_verde.png');
materialBorda.pbrMetallicRoughness.setBaseColorFactor([0.8, 0.8, 0.8, 1]);
materialBorda.pbrMetallicRoughness.setRoughnessFactor(0.8);
materialBorda.pbrMetallicRoughness.baseColorTexture.texture.source.setURI('assets/borda_chinelo_diffuse.png');
});
document.querySelector('#color-controls .amarelo').addEventListener('click', (event) => {
const materialTira = modelViewerColor.model.materials[0];
const materialPalmilia = modelViewerColor.model.materials[1];
const materialBorda = modelViewerColor.model.materials[2];
const materialLogo = modelViewerColor.model.materials[3];
materialTira.pbrMetallicRoughness.setBaseColorFactor([0.0009, 0.02, 0.002, 1]);
materialTira.pbrMetallicRoughness.setRoughnessFactor(0.7);
materialPalmilia.pbrMetallicRoughness.setBaseColorFactor([0.8, 0.8, 0.8, 1]);
materialPalmilia.pbrMetallicRoughness.setRoughnessFactor(0.8);
materialLogo.pbrMetallicRoughness.setBaseColorFactor([1, 1, 1, 1]);
//console.log(materialPalmilia.pbrMetallicRoughness.baseColorTexture);
materialPalmilia.pbrMetallicRoughness.baseColorTexture.texture.source.setURI('assets/Base_palmilia.png');
materialBorda.pbrMetallicRoughness.setBaseColorFactor([0.8, 0.8, 0.8, 1]);
materialBorda.pbrMetallicRoughness.setRoughnessFactor(0.8);
materialBorda.pbrMetallicRoughness.baseColorTexture.texture.source.setURI('assets/borda_chinelo_diffuse.png');
});
document.querySelector('#controles_3d .vertical').addEventListener('click', (event) => {
modelViewerColor.orientation = "0deg 90deg 0m";
modelViewerColor.scale = "0.7 0.7 0.7";
modelViewerColor.cameraTarget = "auto 0m 0m";
modelViewerColor.cameraOrbit = '45deg', '45deg', '7.095m';
});
document.querySelector('#controles_3d .horizontal').addEventListener('click', (event) => {
modelViewerColor.orientation = "0deg 0deg 0m";
modelViewerColor.scale = "1 1 1";
modelViewerColor.cameraTarget = "auto 0m 0m";
modelViewerColor.cameraOrbit = '-227.6deg', '66.15deg', '.878m';
});
window.addEventListener("resize", () => {
if ((window.innerWidth <= 800)) {
modelViewerColor.orientation = "0deg 90deg 0m";
modelViewerColor.scale = "0.7 0.7 0.7";
modelViewerColor.cameraTarget = "auto 0m 0m";
modelViewerColor.cameraOrbit = '45deg', '45deg', '7.095m';
} else {
modelViewerColor.orientation = "0deg 0deg 0m";
modelViewerColor.scale = "1 1 1";
modelViewerColor.cameraTarget = "auto 0m 0m";
modelViewerColor.cameraOrbit = '-227.6deg', '66.15deg', '.878m';
}
});
if ((window.innerWidth <= 800)) {
modelViewerColor.orientation = "0deg 90deg 0m";
modelViewerColor.scale = "0.7 0.7 0.7";
modelViewerColor.cameraTarget = "auto 0m 0m";
modelViewerColor.cameraOrbit = '45deg', '45deg', '7.095m';
} else {
modelViewerColor.orientation = "0deg 0deg 0m";
modelViewerColor.scale = "1 1 1";
modelViewerColor.cameraTarget = "auto 0m 0m";
modelViewerColor.cameraOrbit = '-227.6deg', '66.15deg', '.878m';
}
</script>
</div>
<!-- 💁 Include both scripts below to support all browsers! -->
<!-- Loads <model-viewer> for modern browsers: -->
<script type="module" src="https://unpkg.com/@google/model-viewer/dist/model-viewer.min.js">
</script>
<!-- Loads <model-viewer> for old browsers like IE11: -->
<script nomodule src="https://unpkg.com/@google/model-viewer/dist/model-viewer-legacy.js">
</script>
</body>
</html>