-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
255 lines (210 loc) · 11.8 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
248
249
250
251
252
253
254
255
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- Title -->
<title>MRjs</title>
<!-- Favicon -->
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<!-- SEO -->
<meta name="description" content="An extensible library of Web Components for the spatial web." />
<!-- Basic Open Graph -->
<meta content="MRjs" itemProp="name" class="next-head" />
<meta content="An extensible library of Web Components for the spatial web." itemProp="description" class="next-head" />
<meta content="https://mrjs.io/opengraph.jpg" itemProp="image" class="next-head" />
<!-- Generic Open Graph -->
<meta property="og:type" content="article" class="next-head" />
<meta content="MRjs" property="og:title" class="next-head" />
<meta content="https://mrjs.io" property="og:url" class="next-head" />
<meta content="https://mrjs.io/opengraph.jpg" property="og:image" class="next-head" />
<meta content="An extensible library of Web Components for the spatial web." property="og:description"
class="next-head" />
<meta content="MRjs" property="og:site_name" class="next-head" />
<!-- CSS Styles -->
<link rel="stylesheet" type="text/css" href="style.css" />
<!-- MRjs -->
<script src="https://cdn.jsdelivr.net/npm/mrjs@latest/dist/mr.js"></script>
</head>
<body>
<!-- <mr-app debug="true"> -->
<mr-app>
<mr-light color="white" intensity="2" data-position="0 0.5 0.5"></mr-light>
<mr-light id="mouselight" color="white" intensity="0.25" data-position="0 0 0.5"></mr-light>
<mr-panel>
<mr-div class="gapped padded section">
<mr-model style="height: 100px; width: 220px; scale: 0.07; z-index: 10;"
src="./assets/mrjs_logo_large.glb"></mr-model>
<mr-text class="h1">An extensible library of Web Components for the spatial web.</mr-text>
<mr-text class="chapeau">MRjs is a mixed-reality-first, WebXR interface library meant to bootstrap
spatial web app development. It implements much of the foundational work so that developers can
spend less time on the basics and more time on their app.</mr-text>
<mr-a target="_blank" href="https://github.com/Volumetrics-io/mrjs">See on GitHub</mr-a>
<mr-a target="_blank" href="https://discord.gg/volumetrics">Join us on Discord</mr-a>
<mr-button class="documentation" onclick="redirectToDocumentation()">Documentation</mr-button>
</mr-div>
<mr-div class="triptych">
<mr-div class="gapped padded section">
<mr-model id="extendable" data-position="0.01 0.01 5"
style="height: 120px; width: 140px; scale: 2.7; z-index: 50 ;"
src="./assets/jigsaw.glb"></mr-model>
<mr-text class="h2">Extensible</mr-text>
<mr-text class="narrow">Being open-source and built on top of web standards, you can easily
implement custom elements and contribute to the ecosystem.</mr-text>
</mr-div>
<mr-div class="gapped padded section">
<mr-model id="familiar" data-position="0 0 5"
style="height: 120px; width: 140px; scale: 1.7; z-index: 50 ;"
src="./assets/familiar.glb"></mr-model>
<mr-text class="h2">Familiar</mr-text>
<mr-text class="narrow">Looks and feels like native HTML and CSS, but designed from the ground up
for mixed-reality. Start with 2D and ease your way into creating 3D content.</mr-text>
</mr-div>
<mr-div class="gapped padded section">
<mr-model id="all-in-one" data-position="0 0 0"
style="height: 120px; width: 140px; scale: 1.7; z-index: 30;"
src="./assets/all-in-one.glb"></mr-model>
<mr-text class="h2">All-in-one</mr-text>
<mr-text class="narrow">Asset management, physics, and user interaction come built in, so you can
spend less time laying the foundation and more time building your app.</mr-text>
</mr-div>
</mr-div>
<!-- <mr-div class="diptych">
<mr-div class="gapped padded section">
<mr-text class="h2">Open-source and extendable</mr-text>
<mr-text class="narrow">Built on top of web standards, you can implement custom elements and
contribute to the ecosystem.</mr-text>
</mr-div>
<mr-div class="section">
<mr-div class="illustration">
<mr-model style="scale: 0.03; z-index: 20" src="./assets/koifish.glb"
data-comp-animation="clip: 0; action: play;"></mr-model>
</mr-div>
</mr-div>
</mr-div>
<mr-div class="diptych">
<mr-div class="section">
<mr-div class="illustration">
<mr-model style="scale: 0.03; z-index: 20" src="./assets/koifish.glb"
data-comp-animation="clip: 0; action: play;"></mr-model>
</mr-div>
</mr-div>
<mr-div class="gapped padded section first">
<mr-text class="h2">Familiar and powerful</mr-text>
<mr-text class="narrow">Looks and feels like existing libraries, but designed from the ground up for
mixed-reality. Start with 2D and ease your way into creating 3D content.</mr-text>
</mr-div>
</mr-div>
<mr-div class="diptych">
<mr-div class="gapped padded section">
<mr-text class="h2">All-in-one</mr-text>
<mr-text class="narrow">Asset management, physics, and user interaction come built in, so you can
spend less time laying the foundation and more time building your app.</mr-text>
</mr-div>
<mr-div class="section">
<mr-div class="illustration">
<mr-model style="scale: 0.03; z-index: 20" src="./assets/koifish.glb"
data-comp-animation="clip: 0; action: play;"></mr-model>
</mr-div>
</mr-div>
</mr-div> -->
<mr-div class="gapped padded section">
<mr-text class="h1">Examples</mr-text>
<mr-div class="mosaic">
<mr-div class="illustration">
<mr-a target="_blank" class="example-link"
href="https://examples.mrjs.io/examples/anchors.html">Anchoring</mr-a>
</mr-div>
<mr-div class="illustration">
<mr-a target="_blank" class="example-link"
href="https://examples.mrjs.io/examples/audio.html">Audio</mr-a>
</mr-div>
<mr-div class="illustration">
<mr-a target="_blank" class="example-link"
href="https://examples.mrjs.io/examples/camera.html">Camera</mr-a>
</mr-div>
<mr-div class="illustration">
<mr-a target="_blank" class="example-link"
href="https://examples.mrjs.io/examples/debug.html">Debugging</mr-a>
</mr-div>
<mr-div class="illustration">
<mr-a target="_blank" class="example-link"
href="https://examples.mrjs.io/examples/embed.html">Embed</mr-a>
</mr-div>
<mr-div class="illustration">
<mr-a target="_blank" class="example-link"
href="https://examples.mrjs.io/examples/images.html">Images</mr-a>
</mr-div>
<mr-div class="illustration">
<mr-a target="_blank" class="example-link"
href="https://examples.mrjs.io/examples/models.html">Models</mr-a>
</mr-div>
<mr-div class="illustration">
<mr-a target="_blank" class="example-link"
href="https://examples.mrjs.io/examples/skybox.html">Skybox</mr-a>
</mr-div>
<mr-div class="illustration">
<mr-a target="_blank" class="example-link"
href="https://examples.mrjs.io/examples/video.html">Video</mr-a>
</mr-div>
</mr-div>
</mr-div>
</mr-panel>
</mr-app>
<script>
function redirectToDocumentation() {
window.location.href = "https://docs.mrjs.io";
}
window.requestAnimationFrame(function rotate_extendable(timestamp) {
let rx = Math.cos(timestamp / 2000) * 5 + 50;
let ry = Math.cos(timestamp / 2000) * 5 - 40;
let rz = Math.sin(timestamp / 2000) * 5;
document.querySelector("#extendable").dataset.rotation = rx + " " + ry + " " + rz;
window.requestAnimationFrame(rotate_extendable);
});
window.requestAnimationFrame(function rotate_familiar(timestamp) {
let rx = Math.cos(timestamp / 2000) * 10 + 25;
let ry = Math.cos(timestamp / 2000) * 10 + 230;
let rz = Math.sin(timestamp / 2000) * 10 + 5;
document.querySelector("#familiar").dataset.rotation = rx + " " + ry + " " + rz;
window.requestAnimationFrame(rotate_familiar);
});
window.requestAnimationFrame(function rotate_allInOne(timestamp) {
let rx = Math.cos(timestamp / 2000) * -10 + 25;
let ry = Math.cos(timestamp / 2000) * -10 + 50;
let rz = Math.sin(timestamp / 2000) * -10 + 5;
document.querySelector("#all-in-one").dataset.rotation = rx + " " + ry + " " + rz;
window.requestAnimationFrame(rotate_allInOne);
});
// Light follow mouse
(function () {
"use strict";
document.onmousemove = handleMouseMove;
function handleMouseMove(event) {
var dot, eventDoc, doc, body, pageX, pageY;
event = event || window.event; // IE-ism
// If pageX/Y aren't available and clientX/Y
// are, calculate pageX/Y - logic taken from jQuery
// Calculate pageX/Y if missing and clientX/Y available
if (event.pageX == null && event.clientX != null) {
eventDoc = (event.target && event.target.ownerDocument) || document;
doc = eventDoc.documentElement;
body = eventDoc.body;
event.pageX =
event.clientX +
((doc && doc.scrollLeft) || (body && body.scrollLeft) || 0) -
((doc && doc.clientLeft) || (body && body.clientLeft) || 0);
event.pageY =
event.clientY +
((doc && doc.scrollTop) || (body && body.scrollTop) || 0) -
((doc && doc.clientTop) || (body && body.clientTop) || 0);
}
let ratioX = (event.pageX * 2) / window.innerWidth - 1;
let ratioY = -((event.pageY * 2) / window.innerHeight - 1);
document.querySelector("#mouselight").dataset.position =
ratioX + " " + ratioY + " 0.25";
}
})();
</script>
</body>
</html>