login.html 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  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. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css">
  8. <style>
  9. :root {
  10. --primary-color: #4CAF50;
  11. --primary-dark: #388E3C;
  12. --primary-light: #C8E6C9;
  13. --accent-color: #8BC34A;
  14. --text-color: #333;
  15. }
  16. body {
  17. font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  18. color: var(--text-color);
  19. background-color: #f5f7f9;
  20. background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M30,10 Q50,0 70,10 T90,30 Q100,50 90,70 T70,90 Q50,100 30,90 T10,70 Q0,50 10,30 T30,10" fill="none" stroke="%234CAF5022" stroke-width="2"/></svg>');
  21. background-size: 300px;
  22. }
  23. .login-container {
  24. background-color: white;
  25. box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  26. border-radius: 8px;
  27. overflow: hidden;
  28. }
  29. .login-header {
  30. background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  31. color: white;
  32. padding: 20px;
  33. text-align: center;
  34. }
  35. .input-group {
  36. position: relative;
  37. margin-bottom: 24px;
  38. }
  39. .input-group input {
  40. width: 100%;
  41. padding: 12px 16px;
  42. border: 1px solid #ddd;
  43. border-radius: 4px;
  44. font-size: 16px;
  45. transition: all 0.3s;
  46. }
  47. .input-group input:focus {
  48. border-color: var(--primary-color);
  49. box-shadow: 0 0 0 2px var(--primary-light);
  50. outline: none;
  51. }
  52. .input-group label {
  53. position: absolute;
  54. left: 16px;
  55. top: 12px;
  56. color: #999;
  57. pointer-events: none;
  58. transition: all 0.3s;
  59. }
  60. .input-group input:focus + label,
  61. .input-group input:not(:placeholder-shown) + label {
  62. transform: translateY(-24px);
  63. font-size: 12px;
  64. color: var(--primary-color);
  65. background-color: white;
  66. padding: 0 4px;
  67. }
  68. .login-btn {
  69. width: 100%;
  70. padding: 12px;
  71. background-color: var(--primary-color);
  72. color: white;
  73. border: none;
  74. border-radius: 4px;
  75. font-size: 16px;
  76. font-weight: 500;
  77. cursor: pointer;
  78. transition: all 0.3s;
  79. }
  80. .login-btn:hover {
  81. background-color: var(--primary-dark);
  82. }
  83. .bg-decoration {
  84. position: absolute;
  85. z-index: -1;
  86. }
  87. .bg-circle-1 {
  88. width: 300px;
  89. height: 300px;
  90. background-color: rgba(76, 175, 80, 0.05);
  91. border-radius: 50%;
  92. top: -100px;
  93. left: -100px;
  94. }
  95. .bg-circle-2 {
  96. width: 200px;
  97. height: 200px;
  98. background-color: rgba(139, 195, 74, 0.05);
  99. border-radius: 50%;
  100. bottom: -50px;
  101. right: -50px;
  102. }
  103. .login-image {
  104. background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M20,80 C40,70 60,90 80,80 L80,20 C60,10 40,30 20,20 Z" fill="%234CAF5033"/><path d="M30,70 C45,65 55,75 70,70 L70,30 C55,25 45,35 30,30 Z" fill="%234CAF5022"/><circle cx="50" cy="50" r="10" fill="%234CAF5044"/></svg>');
  105. background-size: cover;
  106. background-position: center;
  107. }
  108. </style>
  109. </head>
  110. <body>
  111. <div class="min-h-screen flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8 relative">
  112. <div class="bg-decoration bg-circle-1"></div>
  113. <div class="bg-decoration bg-circle-2"></div>
  114. <div class="login-container max-w-md w-full mx-auto">
  115. <div class="login-header">
  116. <h2 class="text-2xl font-bold">爱智农智慧农业平台</h2>
  117. <p class="mt-2 text-sm opacity-80">科技赋能农业,智慧创造未来</p>
  118. </div>
  119. <div class="flex">
  120. <div class="w-full p-6">
  121. <h3 class="text-xl font-medium text-center mb-6">账号登录</h3>
  122. <form id="loginForm">
  123. <div class="input-group">
  124. <input type="text" id="username" placeholder=" " value="admin">
  125. <label for="username">用户名</label>
  126. </div>
  127. <div class="input-group">
  128. <input type="password" id="password" placeholder=" " value="123456">
  129. <label for="password">密码</label>
  130. </div>
  131. <div class="flex items-center justify-between mb-6">
  132. <div class="flex items-center">
  133. <input id="remember" type="checkbox" class="h-4 w-4 text-green-600 focus:ring-green-500 border-gray-300 rounded">
  134. <label for="remember" class="ml-2 block text-sm text-gray-600">记住我</label>
  135. </div>
  136. <a href="#" class="text-sm text-green-600 hover:text-green-800">忘记密码?</a>
  137. </div>
  138. <button type="submit" class="login-btn">登 录</button>
  139. </form>
  140. </div>
  141. </div>
  142. <div class="px-6 pb-6 text-center">
  143. <p class="text-sm text-gray-500">© 2023 爱智农智慧农业平台 版权所有</p>
  144. </div>
  145. </div>
  146. </div>
  147. <script>
  148. document.getElementById('loginForm').addEventListener('submit', function(e) {
  149. e.preventDefault();
  150. const username = document.getElementById('username').value;
  151. const password = document.getElementById('password').value;
  152. // 简单的前端验证
  153. if (username === 'admin' && password === '123456') {
  154. // 登录成功,跳转到主页
  155. window.location.href = 'index.html';
  156. } else {
  157. alert('用户名或密码错误,请使用默认账号:admin / 123456');
  158. }
  159. });
  160. </script>
  161. </body>
  162. </html>