login.html 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  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>登录 - 展厅控制</title>
  7. <style>
  8. :root {
  9. --primary-color: #4ecdc4;
  10. --secondary-color: #ff6b6b;
  11. --accent-color: #feca57;
  12. --dark-text: #333;
  13. --light-text: #fff;
  14. --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  15. --card-bg: #ffffff;
  16. }
  17. * {
  18. margin: 0;
  19. padding: 0;
  20. box-sizing: border-box;
  21. }
  22. body {
  23. font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  24. background: var(--bg-gradient);
  25. min-height: 100vh;
  26. min-height: 100dvh;
  27. display: flex;
  28. align-items: center;
  29. justify-content: center;
  30. color: var(--dark-text);
  31. padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  32. }
  33. .login-container {
  34. background: var(--card-bg);
  35. border-radius: 15px;
  36. padding: clamp(20px, 5vw, 40px);
  37. width: 100%;
  38. max-width: 400px;
  39. box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  40. animation: fadeIn 0.5s ease-out;
  41. }
  42. @keyframes fadeIn {
  43. from { opacity: 0; transform: translateY(-20px); }
  44. to { opacity: 1; transform: translateY(0); }
  45. }
  46. .header {
  47. text-align: center;
  48. margin-bottom: 30px;
  49. }
  50. .header h1 {
  51. color: #2c3e50;
  52. font-size: 24px;
  53. margin-bottom: 10px;
  54. }
  55. .header p {
  56. color: #7f8c8d;
  57. font-size: 14px;
  58. }
  59. .form-group {
  60. margin-bottom: 20px;
  61. }
  62. label {
  63. display: block;
  64. margin-bottom: 8px;
  65. color: #555;
  66. font-weight: 600;
  67. font-size: 14px;
  68. }
  69. input {
  70. width: 100%;
  71. padding: 12px 14px;
  72. border: 1px solid #ddd;
  73. border-radius: 8px;
  74. font-size: 16px;
  75. min-height: 44px;
  76. transition: border-color 0.3s;
  77. }
  78. input:focus {
  79. border-color: var(--primary-color);
  80. outline: none;
  81. }
  82. .btn-submit {
  83. width: 100%;
  84. padding: 14px;
  85. min-height: 48px;
  86. background-color: var(--primary-color);
  87. color: white;
  88. border: none;
  89. border-radius: 8px;
  90. font-size: 16px;
  91. font-weight: 600;
  92. cursor: pointer;
  93. transition: background-color 0.3s, transform 0.1s;
  94. }
  95. .btn-submit:hover {
  96. background-color: #3dbdb4;
  97. }
  98. .btn-submit:active {
  99. transform: translateY(1px);
  100. }
  101. .alert {
  102. padding: 12px;
  103. border-radius: 8px;
  104. margin-bottom: 20px;
  105. font-size: 14px;
  106. text-align: center;
  107. }
  108. .alert-error {
  109. background-color: #ffebee;
  110. color: #c62828;
  111. border: 1px solid #ffcdd2;
  112. }
  113. .sso-divider {
  114. margin: 20px 0;
  115. text-align: center;
  116. color: #95a5a6;
  117. font-size: 14px;
  118. }
  119. .btn-sso {
  120. display: block;
  121. width: 100%;
  122. padding: 14px;
  123. min-height: 48px;
  124. line-height: 1.2;
  125. margin-top: 10px;
  126. background-color: #3498db;
  127. color: white;
  128. text-align: center;
  129. text-decoration: none;
  130. border-radius: 8px;
  131. font-size: 16px;
  132. font-weight: 600;
  133. transition: background-color 0.3s;
  134. box-sizing: border-box;
  135. }
  136. .btn-sso:hover {
  137. background-color: #2980b9;
  138. }
  139. </style>
  140. </head>
  141. <body>
  142. <div class="login-container">
  143. <div class="header">
  144. <h1>展厅控制系统</h1>
  145. <p>请登录以继续</p>
  146. </div>
  147. {% with messages = get_flashed_messages(with_categories=true) %}
  148. {% if messages %}
  149. {% for category, message in messages %}
  150. <div class="alert alert-{{ category }}">
  151. {{ message }}
  152. </div>
  153. {% endfor %}
  154. {% endif %}
  155. {% endwith %}
  156. <form method="POST" action="/login">
  157. <div class="form-group">
  158. <label for="username">账号</label>
  159. <input type="text" id="username" name="username" placeholder="请输入账号" required autofocus>
  160. </div>
  161. <div class="form-group">
  162. <label for="password">密码</label>
  163. <input type="password" id="password" name="password" placeholder="请输入密码" required>
  164. </div>
  165. <button type="submit" class="btn-submit">登录</button>
  166. <div class="sso-divider">
  167. <span>或</span>
  168. </div>
  169. <a href="/login/sso" class="btn-sso">统一登录</a>
  170. </form>
  171. </div>
  172. </body>
  173. </html>