60 lines
2.5 KiB
HTML
60 lines
2.5 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Dark Theme Centered H1 with Tailwind</title>
|
|
<!-- Include Tailwind CSS from CDN -->
|
|
<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 the Web.</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">
|
|
Start USBHID Session
|
|
</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 AR drivers from Team Make Real:</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://gitlab.com/TheJackiMonster/nrealAirLinuxDriver">Linux</a></li> |
|
|
<li><a target="_blank" href="https://gitlab.com/DanBurkhardt/nrealAirLinuxDriver/-/tree/main">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>
|
|
</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>
|