index.html 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <title>华力机电SIMANC</title>
  7. <style>
  8. html,
  9. body {
  10. width: 100%;
  11. height: 100%;
  12. margin: 0;
  13. padding: 0;
  14. overflow: hidden;
  15. }
  16. body {
  17. background: url("assets/img/login-bg-1.jpg") no-repeat center center
  18. fixed;
  19. background-size: cover;
  20. font-family: "PT Sans", Helvetica, Arial, sans-serif;
  21. text-align: center;
  22. color: #fff;
  23. transition: background-image 1s ease-in-out;
  24. }
  25. .login-container {
  26. width: 320px;
  27. margin: 120px auto auto auto;
  28. text-align: center;
  29. position: relative;
  30. }
  31. .login-title {
  32. color: white;
  33. text-align: center;
  34. margin-bottom: 30px;
  35. font-size: 30px;
  36. font-weight: 700;
  37. text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  38. }
  39. .mb-4 {
  40. margin-bottom: 1.5rem !important;
  41. }
  42. .form-control {
  43. width: 100%;
  44. box-sizing: border-box;
  45. background: rgba(45, 45, 45, 0.15) !important;
  46. border-radius: 6px !important;
  47. border: 2px solid white !important;
  48. box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.1) inset !important;
  49. font-family: "PT Sans", Helvetica, Arial, sans-serif !important;
  50. font-size: 14px !important;
  51. color: #fff !important;
  52. text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
  53. padding: 0.5rem 1rem !important;
  54. }
  55. .form-control::placeholder {
  56. color: rgba(255, 255, 255, 0.7) !important;
  57. text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
  58. }
  59. .form-control:focus {
  60. outline: none !important;
  61. border-color: white !important;
  62. background: rgba(45, 45, 45, 0.15) !important;
  63. color: #fff !important;
  64. text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
  65. box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.1) inset !important;
  66. }
  67. .form-control.form-control-lg {
  68. height: 50px !important;
  69. padding: 0.8rem 1.2rem !important;
  70. font-size: 16px !important;
  71. }
  72. .btn-login {
  73. height: 50px;
  74. font-size: 16px;
  75. background-color: #6f42c1;
  76. color: white;
  77. font-weight: 700;
  78. width: 100%;
  79. border: none;
  80. border-radius: 4px;
  81. margin-top: 10px;
  82. }
  83. .btn-login:hover {
  84. box-shadow: 0 15px 30px 0 rgba(255, 255, 255, 0.15) inset,
  85. 0 2px 7px 0 rgba(0, 0, 0, 0.2);
  86. color: white;
  87. background-color: #6f42c1;
  88. }
  89. .tcs-footer {
  90. margin-top: 100px;
  91. width: 100%;
  92. text-align: center;
  93. color: white;
  94. }
  95. </style>
  96. </head>
  97. <body>
  98. <div class="login-container">
  99. <h1 class="login-title">华力机电SIMANC</h1>
  100. <form id="loginForm">
  101. <div class="mb-4">
  102. <input
  103. type="text"
  104. class="form-control form-control-lg"
  105. placeholder="用户名"
  106. required
  107. oninvalid="this.setCustomValidity('请输入用户名')"
  108. oninput="this.setCustomValidity('')"
  109. />
  110. </div>
  111. <div class="mb-4">
  112. <input
  113. type="password"
  114. class="form-control form-control-lg"
  115. placeholder="密码"
  116. required
  117. oninvalid="this.setCustomValidity('请输入密码')"
  118. oninput="this.setCustomValidity('')"
  119. />
  120. </div>
  121. <button type="submit" class="btn btn-login">登录</button>
  122. </form>
  123. <div class="tcs-footer">
  124. <small>山东华力机电有限公司<br />© 2018</small>
  125. </div>
  126. </div>
  127. <!-- Tabler Core JS -->
  128. <!-- <script src="node_modules/@tabler/core/dist/js/tabler.min.js"></script> -->
  129. <script src="assets/js/jquery-3.7.1.min.js"></script>
  130. <script>
  131. $(document).ready(function () {
  132. $("#loginForm").on("submit", function (e) {
  133. e.preventDefault();
  134. // 获取表单数据
  135. const username = $('input[type="text"]').val();
  136. const password = $('input[type="password"]').val();
  137. // 这里可以添加用户名密码验证逻辑
  138. // 为了演示,我们直接跳转
  139. window.location.href = "pages/dashboard.html"; // 跳转到仪表盘页面
  140. });
  141. const backgrounds = [
  142. "assets/img/login-bg-1.jpg",
  143. "assets/img/login-bg-2.jpg",
  144. "assets/img/login-bg-3.jpg",
  145. ];
  146. let currentIndex = 0;
  147. function changeBackground() {
  148. currentIndex = (currentIndex + 1) % backgrounds.length;
  149. $("body").css(
  150. "background-image",
  151. `url(${backgrounds[currentIndex]})`
  152. );
  153. }
  154. setInterval(changeBackground, 5000);
  155. });
  156. </script>
  157. </body>
  158. </html>