Static File Index.HTML 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <!DOCTYPE html>
  2. <!-- saved from url=(0025)http://192.168.1.20:5000/ -->
  3. <!-- socket.on('msg', msg => console.log(msg)) -->
  4. <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  5. <title>
  6. Static File Index.HTML
  7. </title>
  8. <script src='https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.2.0/socket.io.js'></script>
  9. <style>
  10. input {
  11. width: 200px;
  12. height: 40px;
  13. }
  14. button {
  15. width: 150px;
  16. height: 30px;
  17. }
  18. .wrapA {
  19. width: 100%;
  20. height: 600px;
  21. display: flex;
  22. justify-content: center;
  23. align-items: center;
  24. }
  25. </style>
  26. </head>
  27. <body>
  28. <div id="formContainer">
  29. <div class="wrapA">
  30. <div>
  31. <h1 id='out'></h1>
  32. <input type="text" id="nick">
  33. <input type="text" id="message">
  34. <button id="send">ЖМИ</button>
  35. </div>
  36. <script>
  37. const socket = io('http://localhost:4000');
  38. send.onclick = () => socket.emit('msg', {nick: nick.value, message: message.value});
  39. </script>
  40. </body></html>