-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
166 lines (145 loc) · 3.95 KB
/
index.html
File metadata and controls
166 lines (145 loc) · 3.95 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Jo'naas Kinera</title>
<!-- Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-2HCLY0FD98"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-2HCLY0FD98', {
page_title: 'Jonaas Kinera AR',
page_path: '/jonaas-kinera-ar/'
});
</script>
<script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/3.3.0/model-viewer.min.js"></script>
<style>
* { margin:0; padding:0; box-sizing:border-box; }
body {
font-family: system-ui, sans-serif;
background: linear-gradient(135deg, #1e3a8a, #3b82f6);
min-height:100vh;
display:flex;
align-items:center;
justify-content:center;
padding:20px;
}
.container {
background:#fff;
border-radius:24px;
padding:30px;
max-width:600px;
width:100%;
box-shadow:0 20px 60px rgba(0,0,0,.3);
}
h1 {
text-align:center;
color:#1e3a8a;
margin-bottom:8px;
}
.subtitle {
text-align:center;
color:#64748b;
margin-bottom:24px;
}
model-viewer {
width:100%;
height:500px;
background:#f8fafc;
border-radius:16px;
}
.instructions {
background:#eff6ff;
border-left:4px solid #3b82f6;
padding:16px 20px;
margin-top:20px;
border-radius:8px;
font-size:14px;
color:#1e40af;
}
.instructions strong {
display:block;
margin-bottom:8px;
}
</style>
</head>
<body>
<div class="container">
<h1>Jo'naas Kinera</h1>
<p class="subtitle">Rotate and resize before entering AR</p>
<model-viewer
id="mv"
src="jonaas-kinera.glb"
camera-controls
touch-action="pan-y"
ar
ar-modes="webxr scene-viewer quick-look"
ar-placement="floor"
autoplay
shadow-intensity="1"
shadow-softness="1"
exposure="1"
camera-orbit="0deg 90deg 2m"
min-camera-orbit="auto auto 1m"
max-camera-orbit="auto auto 4m"
alt="Jo'naas Kinera – 5'10 animated character">
<button id="arBtn" slot="ar-button" style="
background:#3b82f6;
color:#fff;
border:none;
border-radius:12px;
padding:14px 28px;
font-size:16px;
font-weight:600;
cursor:pointer;
position:absolute;
bottom:20px;
left:50%;
transform:translateX(-50%);
">
📱 View in Your Space
</button>
</model-viewer>
<div class="instructions">
<strong>Before AR:</strong>
Rotate and resize the character until it looks right. Use two fingers to resize and move around physically to view from different angles.
<br><br>
<strong>View in AR:</strong>
Tap “View in Your Space” to place the character.
</div>
</div>
<script>
const mv = document.getElementById('mv');
const arBtn = document.getElementById('arBtn');
let activeAnimation = null;
mv.addEventListener('load', () => {
mv.scale = '1 1 1';
const anims = mv.availableAnimations;
if (anims.length) {
activeAnimation = anims[0];
mv.animationName = activeAnimation;
mv.timeScale = 1.0;
}
});
// Restart animation when AR begins
mv.addEventListener('ar-status', e => {
if (e.detail.status === 'session-started' && activeAnimation) {
mv.animationName = activeAnimation;
mv.play();
}
});
// Track AR button clicks
arBtn.addEventListener('click', () => {
if (window.gtag) {
gtag('event', 'ar_launch', {
character: 'Jo'naas Kinera',
folder: 'jonaas-kinera-ar'
});
}
});
</script>
</body>
</html>