Update index.html

This commit is contained in:
ErikrafT 2025-04-11 20:04:58 -03:00 committed by GitHub
parent 58a319d780
commit 6ecb436806
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 28 additions and 0 deletions

View File

@ -95,6 +95,12 @@
<use xlink:href="#homescreen"></use>
</svg>
</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">
<svg class="icon">
<use xlink:href="#pair-device-icon"></use>
@ -947,6 +953,28 @@
</svg>
<!-- 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>
document.getElementById('githubDownloadAndroid').addEventListener('click', async function(event) {