-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
66 lines (59 loc) · 3.16 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Xreal WebXR Demo + Open Source Driver Directory - Team Make Real</title>
<link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
<style>
body {
background-color: #000;
}
</style>
</head>
<body class="flex flex-col justify-center items-center h-screen text-white bg-black">
<h1 class="text-4xl font-bold text-purple-800 p-4 block">Xreal, meet WebXR</h1>
<br/>
<!-- Button to kick off a USBHID session device request -->
<button id="usbhid-button" class="block mt-4 bg-purple-800 hover:bg-purple-700 text-white font-bold py-2 px-4 rounded">
😎 Connect
</button>
<br/>
<div id="credits" class="fixed w-full h-auto overflow-hidden text-center left-0 top-auto right-0 bottom-0 block pb-4">
<p class="text-gray-600">other open source xreal drivers:</p>
<ul class="list-none flex flex-row space-between text-center justify-center items-center text-purple-200">
<li><a target="_blank" href="https://github.com/MSmithDev/AirAPI_Windows">Windows</a></li> |
<li><a target="_blank" href="https://github.com/SARankDirector-Minecraft/XR-android-driver">Android</a></li> |
<li><a target="_blank" href="https://gitlab.com/TheJackiMonster/nrealAirLinuxDriver">Linux</a></li> |
<li><a target="_blank" href="https://gitlab.com/DanBurkhardt/nrealAirLinuxDriver/">Mac</a></li> |
<li><a target="_blank" href="https://github.com/jakedowns/xreal-webxr">Web</a></li> |
<li><a target="_blank" href="https://github.com/badicsalex/ar-drivers-rs">Rust</a></li>
</ul>
<hr/>
<ul>
<li><br/><a class="" href="https://jakedowns.github.io/webxr.html">WebXR + WebGPU Demos!</a></li>
<li><br/><a class="" href="https://github.com/jakedowns/xreal-webxr">View Source For This Repo on Github</a></li>
<li><a target="_blank" href="https://air.msmithdev.com/">Nreal Air Firmware Update Mirror</a></li>
<!-- <li><br/><a class="" href="https://gist.github.com/CGamesPlay/b3ea7740ea8715d19e89f5511491519f">HELP! We need your help finishing these FREE, OPEN-SOURCE COMMUNITY-CONTRIBUTED, DRIVERS! Please help us fix the YAW drift!</a></li> -->
</ul>
</div>
<script>
// Get the button element
const usbhidButton = document.getElementById('usbhid-button');
// Add event listener for the button click
usbhidButton.addEventListener('click', async () => {
// Request USB device
let device;
try {
device = await navigator.usb.requestDevice({ filters: [{ vendorId: 0x2341 }] });
} catch (err) {
console.error("No device was selected", err);
}
// If device is selected, start a session
if (device !== undefined) {
console.log("USBHID session started with device: ", device.productName);
}
});
</script>
</body>
</html>