From d7016f285fbef4b45650043ddbcea0da68d8a64c Mon Sep 17 00:00:00 2001 From: Li Zhineng Date: Thu, 12 Jun 2025 23:07:50 +0800 Subject: display unsupported browser message --- index.html | 30 ++++++++++++++++++------------ main.mjs | 13 +++++++++++-- 2 files changed, 29 insertions(+), 14 deletions(-) diff --git a/index.html b/index.html index eb9a563..b2a6736 100644 --- a/index.html +++ b/index.html @@ -4,17 +4,23 @@ -

Setup AIRMX Pro

-
- -
-
- -
-
- -
+ + +
+

Setup AIRMX Pro

+
+ +
+
+ +
+
+ +
+
diff --git a/main.mjs b/main.mjs index 618efa0..31d4056 100644 --- a/main.mjs +++ b/main.mjs @@ -216,5 +216,14 @@ function handleDeviceResponse(event) { console.log(`Received data from device: ${receivedBytes.join(' ')}`) } -const button = document.getElementById('connect') -button.addEventListener('click', connect) +function supportBluetoothApi() { + return 'bluetooth' in navigator +} + +if (! supportBluetoothApi()) { + const unsupportedMessage = document.getElementById('unsupported-message') + unsupportedMessage.style.display = 'block' + + const main = document.querySelector('main') + main.style.display = 'none' +} -- cgit v1.2.3