Update index.html
This commit is contained in:
parent
58a319d780
commit
6ecb436806
|
@ -95,6 +95,12 @@
|
||||||
<use xlink:href="#homescreen"></use>
|
<use xlink:href="#homescreen"></use>
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<button id="bluetoothBtn" class="bluetooth-button">
|
||||||
|
<i class="fa-brands fa-bluetooth-b"></i>
|
||||||
|
</button>
|
||||||
|
|
||||||
<div id="pair-device" class="icon-button" data-i18n-key="header.pair-device" data-i18n-attrs="title">
|
<div id="pair-device" class="icon-button" data-i18n-key="header.pair-device" data-i18n-attrs="title">
|
||||||
<svg class="icon">
|
<svg class="icon">
|
||||||
<use xlink:href="#pair-device-icon"></use>
|
<use xlink:href="#pair-device-icon"></use>
|
||||||
|
@ -947,6 +953,28 @@
|
||||||
</svg>
|
</svg>
|
||||||
<!-- Scripts -->
|
<!-- Scripts -->
|
||||||
|
|
||||||
|
<script>
|
||||||
|
document.getElementById("bluetoothBtn").addEventListener("click", async () => {
|
||||||
|
if (!navigator.bluetooth) {
|
||||||
|
alert("Bluetooth Web API não é suportado neste navegador.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const device = await navigator.bluetooth.requestDevice({
|
||||||
|
acceptAllDevices: true
|
||||||
|
});
|
||||||
|
|
||||||
|
alert(`🔗 Dispositivo pareado: ${device.name || 'Sem nome'}`);
|
||||||
|
// Aqui você pode iniciar conexão GATT e enviar info
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Erro ao conectar:", error);
|
||||||
|
alert("❌ Conexão cancelada ou falhou.");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<!-- Script de Download para Android -->
|
<!-- Script de Download para Android -->
|
||||||
<script>
|
<script>
|
||||||
document.getElementById('githubDownloadAndroid').addEventListener('click', async function(event) {
|
document.getElementById('githubDownloadAndroid').addEventListener('click', async function(event) {
|
||||||
|
|
Loading…
Reference in New Issue