index.html 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="apple-mobile-web-app-capable" content="yes" />
  6. <meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1"/>
  7. <meta name="theme-color" content="#4b75ff">
  8. <link rel="stylesheet" href="../script/semantic/semantic.min.css">
  9. <script src="../script/jquery.min.js"></script>
  10. <script src="../script/ao_module.js"></script>
  11. <script src="../script/semantic/semantic.min.js"></script>
  12. <link rel="icon" type="image/png" href="img/module_icon.png">
  13. <link rel="manifest" crossorigin="use-credentials" href="manifest.json">
  14. <title>Message</title>
  15. <style>
  16. body{
  17. background-color: rgb(250, 250, 250);
  18. }
  19. #banner{
  20. background: rgb(74,179,255);
  21. background: linear-gradient(153deg, rgba(74,179,255,1) 0%, rgba(182,183,247,1) 52%, rgba(133,87,255,1) 100%);
  22. padding: 1.2em;
  23. -webkit-border-bottom-right-radius: 20px;
  24. -webkit-border-bottom-left-radius: 20px;
  25. -moz-border-radius-bottomright: 20px;
  26. -moz-border-radius-bottomleft: 20px;
  27. border-bottom-right-radius: 20px;
  28. border-bottom-left-radius: 20px;
  29. margin-bottom: 0.4em;
  30. }
  31. #banner h2{
  32. color: white;
  33. }
  34. .latestMessage{
  35. color: rgb(43, 40, 40);
  36. }
  37. .chatroom{
  38. cursor: pointer;
  39. transition: opacity 0.1s ease-in-out;
  40. }
  41. .chatroom:hover{
  42. opacity: 0.7;
  43. }
  44. </style>
  45. </head>
  46. <body>
  47. <div id="banner">
  48. <div class="ui container">
  49. <h2>Message</h2>
  50. <div class="ui fluid small icon input">
  51. <input type="text" placeholder="Search">
  52. <i class="circular search link icon"></i>
  53. </div>
  54. </div>
  55. </div>
  56. <div id="chatHistoryList" class="ui container">
  57. </div>
  58. <div class="ui divider"></div>
  59. <br><br>
  60. <script>
  61. function initUserList(){
  62. $.get("../system/users/list", function(data){
  63. console.log(data);
  64. data.forEach(function(user){
  65. let username = user[0];
  66. let usericon = user[2];
  67. if (usericon == ""){
  68. usericon = "img/noicon.png";
  69. }
  70. let chatroomID = username;
  71. $("#chatHistoryList").append(`<div class="ui message chatroom">
  72. <a class="ui feed" href="chat.html#${chatroomID}">
  73. <div class="event">
  74. <div class="label" style="padding-top: 0.3em;">
  75. <img src="${usericon}">
  76. </div>
  77. <div class="content" style="margin-top: 0; position: relative;">
  78. <div class="summary">
  79. <h3 style="margin-bottom: 0; font-size: 1.2em;">${username}</h3>
  80. <small class="latestMessage">
  81. (No Message)
  82. </small>
  83. </div>
  84. <div class="date" style="position: absolute; right: 0;top:0;">
  85. Offline
  86. </div>
  87. </div>
  88. </div>
  89. </a>
  90. </div>`);
  91. })
  92. });
  93. }
  94. initUserList();
  95. </script>
  96. </body>
  97. </html>