index.html 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <!DOCTYPE html>
  2. <html lang="en">
  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, shrink-to-fit=no">
  7. <meta name="description" content="DezuKVM | Local Mode">
  8. <meta name="author" content="dezukvm.aroz.org">
  9. <title>DezuKVM | Local Mode</title>
  10. <!-- Tocas UI -->
  11. <link rel="stylesheet" href="tocas/tocas.min.css">
  12. <script src="tocas/tocas.min.js"></script>
  13. <!-- Noto Sans TC (local) -->
  14. <style>
  15. @font-face {
  16. font-family: 'Noto Sans TC';
  17. src: url('./tocas/NotoSansTc-VariableFont_wght.ttf') format('truetype');
  18. font-weight: 100 200 300 400 500 600 700;
  19. font-style: normal;
  20. font-display: swap;
  21. }
  22. </style>
  23. <style>
  24. body {
  25. margin: 0;
  26. padding: 0;
  27. height: 100vh;
  28. width: 100vw;
  29. display: flex;
  30. justify-content: center;
  31. align-items: center;
  32. box-sizing: border-box;
  33. overflow: hidden;
  34. background-color: black;
  35. font-family: 'Noto Sans TC';
  36. }
  37. #video {
  38. max-width: 100vw;
  39. max-height: 100vh;
  40. width: auto;
  41. height: auto;
  42. display: block;
  43. margin: auto;
  44. object-fit: contain;
  45. z-index: 0;
  46. }
  47. #menu {
  48. position: fixed;
  49. top: 0px;
  50. left: 50%;
  51. width: 80%;
  52. transform: translateX(-50%);
  53. padding: 0.4em;
  54. display: flex;
  55. gap: 3px;
  56. z-index: 1000;
  57. background-color: rgba(255,255,255,0.7);
  58. border-bottom-left-radius: 10px;
  59. border-bottom-right-radius: 10px;
  60. }
  61. @media (max-width: 1280px) {
  62. #menu {
  63. width: calc(100% - 1em);
  64. }
  65. }
  66. #touchscreen {
  67. position: fixed;
  68. top: 0;
  69. left: 0;
  70. width: 100vw;
  71. height: 100vh;
  72. z-index: 500;
  73. }
  74. </style>
  75. </head>
  76. <body>
  77. <div id="menu">
  78. <div class="ts-image">
  79. <img src="img/logo.svg" width="120" style="margin-top:-6px;">
  80. </div>
  81. <!-- Select video feed -->
  82. <div class="ts-select is-small has-start-spaced-small">
  83. <select id="videoSource"></select>
  84. </div>
  85. <button id="refreshCameras" class="ts-button is-icon is-small"><span class="ts-icon is-arrows-rotate-icon"></span></button>
  86. <!-- Select audio feed -->
  87. <div class="ts-select is-small has-start-spaced-small">
  88. <select id="audioSource"></select>
  89. </div>
  90. <button id="refreshAudioSources" class="ts-button is-icon is-small"><span class="ts-icon is-arrows-rotate-icon"></span></button>
  91. <!-- Serial Ports -->
  92. <button id="selectSerialPort" class="ts-button is-icon is-small has-start-spaced-small"><span class="ts-icon is-keyboard-icon"></span></button>
  93. <span id="selectedPort" class="has-start-spaced-small" style="margin-top: 0.1em;"> Not Connected</span>
  94. <!-- Fullscreen -->
  95. <button id="fullscreenBtn" class="ts-button is-icon is-small has-start-spaced-small"><span class="ts-icon is-maximize-icon"></span></button>
  96. <!-- Software HID reset -->
  97. <button id="resetHIDBtn" class="ts-button is-small is-negative has-start-spaced-small" style="margin-left:auto;">Reset HID</button>
  98. <!-- Hide menu button -->
  99. <button id="hideMenuBtn" class="ts-button is-icon is-small" style="margin-left:auto;"><span class="ts-icon is-chevron-up-icon"></span></button>
  100. </div>
  101. <video id="video" autoplay playsinline style="width:100%;max-width:100%;"></video>
  102. <div id="touchscreen"></div>
  103. <script src="local-kvm.js"></script>
  104. <script>
  105. const menu = document.getElementById('menu');
  106. const hideMenuBtn = document.getElementById('hideMenuBtn');
  107. // Hide menu when button is clicked
  108. hideMenuBtn.addEventListener('click', () => {
  109. menu.style.display = 'none';
  110. showMenuBtn.style.display = 'block';
  111. });
  112. // Create a show menu button
  113. const showMenuBtn = document.createElement('button');
  114. showMenuBtn.id = 'showMenuBtn';
  115. showMenuBtn.className = 'ts-button is-icon is-small';
  116. showMenuBtn.style.position = 'fixed';
  117. showMenuBtn.style.top = '0.5em';
  118. showMenuBtn.style.right = '0.5em';
  119. showMenuBtn.style.zIndex = '1001';
  120. showMenuBtn.style.display = 'none';
  121. showMenuBtn.innerHTML = '<span class="ts-icon is-chevron-down-icon"></span>';
  122. document.body.appendChild(showMenuBtn);
  123. // Show menu when show button is clicked
  124. showMenuBtn.addEventListener('click', () => {
  125. menu.style.display = 'flex';
  126. showMenuBtn.style.display = 'none';
  127. });
  128. </script>
  129. </body>
  130. </html>