diff --git a/client/app.js b/client/app.js new file mode 100644 index 0000000..1d9c578 --- /dev/null +++ b/client/app.js @@ -0,0 +1,28 @@ +const alertBox = document.getElementById('alert-box'); + +function showAlert(message) { + alertBox.textContent = message; + alertBox.className = 'error'; + alertBox.style.display = 'block'; + setTimeout(() => { alertBox.style.display = 'none'; }, 5000); +} + +// Signaling Error Handling +const socket = new WebSocket('ws://your-server-url'); +socket.onerror = () => showAlert('Signaling server unreachable.'); +socket.onclose = () => showAlert('Connection to server lost.'); + +// WebRTC Error Handling +const peerConnection = new RTCPeerConnection(); +peerConnection.oniceconnectionstatechange = () => { + if (peerConnection.iceConnectionState === 'failed' || peerConnection.iceConnectionState === 'disconnected') { + showAlert('WebRTC connection failed.'); + } +}; + +// File Transfer Error Handling +function handleTransfer(file) { + const reader = new FileReader(); + reader.onerror = () => showAlert('File transfer interrupted.'); + // ... transfer logic +} \ No newline at end of file diff --git a/client/index.html b/client/index.html index 4a8a231..fc389a4 100644 --- a/client/index.html +++ b/client/index.html @@ -1,96 +1,15 @@ - + - - - - - OpenDrop - Secure Local WebRTC File Transfer - - - - - - - - - - - - - - -
- -
- -
-
- Connecting... -
-
-
- -
-
- -
-
- -
-
- Loading... - You -
- -
-
-
- - -
-
-
- - -
- - - - - - - - + + + OpenDrop + + + +
+ + + \ No newline at end of file