index.html 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="x-ua-compatible" content="ie=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>IRremote Controller</title>
  8. <link rel="stylesheet" href="static/css/foundation.css">
  9. </head>
  10. <body>
  11. <div class="grid-x">
  12. <h1 class="large-12 medium-12 small-12 cell text-center">IRremote Controller</h1>
  13. <div class="large-6 medium-6 small-6 cell text-center">
  14. <h3>TV:</h3>
  15. <p>
  16. <button type="button" class="alert button" onclick="sendCommandTV('power')">Power</button><br>
  17. <button type="button" class="button" onclick="sendCommandTV('back')">Back</button> <button type="button" class="button" onclick="sendCommandTV('home')">Home</button><br>
  18. <button type="button" class="button" onclick="sendCommandTV('up')">/\</button><br>
  19. <button type="button" class="button" onclick="sendCommandTV('left')"><</button> <button type="button" class="success button" onclick="sendCommandTV('ok')">Ok</button> <button type="button" class="button" onclick="sendCommandTV('right')">></button><br>
  20. <button type="button" class="button" onclick="sendCommandTV('down')">\/</button><br>
  21. <button type="button" class="button" onclick="sendCommandTV('reload')">Reload</button> <button type="button" class="button" onclick="sendCommandTV('star')">*</button><br>
  22. <button type="button" class="button" onclick="sendCommandTV('rewind')"><<</button> <button type="button" class="button" onclick="sendCommandTV('play-pause')">Play/Pause</button> <button type="button" class="button" onclick="sendCommandTV('fast-forward')">>></button><br>
  23. <button type="button" class="button" onclick="sendCommandTV('vol+')">Vol +</button> <button type="button" class="button" onclick="sendCommandTV('mute')">Vol Mute</button> <button type="button" class="button" onclick="sendCommandTV('vol-')">Vol -</button><br>
  24. </p>
  25. </div>
  26. <div class="large-6 medium-6 small6 cell text-center">
  27. <h3>MOVIE BOX:</h3>
  28. <p>
  29. <button type="button" class="alert button" onclick="sendCommandMB('power')">Power</button><br>
  30. <button type="button" class="button" onclick="sendCommandMB('home')">Home</button> <button type="button" class="button" onclick="sendCommandMB('back')">Back</button><br>
  31. <button type="button" class="button" onclick="sendCommandMB('up')">/\</button><br>
  32. <button type="button" class="button" onclick="sendCommandMB('left')"><</button> <button type="button" class="success button" onclick="sendCommandMB('ok')">Ok</button> <button type="button" class="button" onclick="sendCommandMB('right')">></button><br>
  33. <button type="button" class="button" onclick="sendCommandMB('down')">\/</button><br>
  34. </p>
  35. </div>
  36. </div>
  37. <script>
  38. function sendCommandTV(cmd) {
  39. const xhttp = new XMLHttpRequest();
  40. xhttp.onload = function() {}
  41. xhttp.open("GET", "tv/"+cmd, true);
  42. xhttp.send();
  43. }
  44. function sendCommandMB(cmd) {
  45. const xhttp = new XMLHttpRequest();
  46. xhttp.onload = function() {}
  47. xhttp.open("GET", "mb/"+cmd, true);
  48. xhttp.send();
  49. }
  50. </script>
  51. </body>
  52. </html>