surfaceRunoffInputFlux.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. <template>
  2. <div class="container">
  3. <div class="gradient-card">
  4. <div class="card-header">
  5. <h1>地表径流计算器</h1>
  6. <p>评估地表径流量及其环境影响</p>
  7. </div>
  8. <div class="card-content">
  9. <div class="input-section">
  10. <div class="input-group">
  11. <label class="label">地表径流 (g/ha/a)</label>
  12. <input v-model="leakage" placeholder="请输入地表径流" class="custom-input" />
  13. </div>
  14. <div class="info-panel">
  15. <div class="info-item">
  16. <i class="fas fa-info-circle"></i>
  17. <span>当前值: {{ leakage || '0.368' }}</span>
  18. </div>
  19. <div class="info-item">
  20. <i class="fas fa-chart-line"></i>
  21. <span>建议范围: 0.01 - 0.05</span>
  22. </div>
  23. </div>
  24. </div>
  25. <div class="button-section">
  26. <button class="calculate-btn" @click="onCalculate">
  27. <i class="fas fa-calculator"></i> 计算地表径流
  28. </button>
  29. </div>
  30. </div>
  31. <div class="card-footer">
  32. <p><i class="fas fa-lightbulb"></i> 提示: 输入地表径流后点击计算按钮获取详细分析</p>
  33. </div>
  34. </div>
  35. </div>
  36. </template>
  37. <script>
  38. import { ref } from 'vue';
  39. export default {
  40. name: 'LeakageCalculator',
  41. setup() {
  42. const leakage = ref('0.368');
  43. const onCalculate = () => {
  44. alert(`计算完成!当前地表径流: ${leakage.value || '0.368'} g/ha/a`);
  45. };
  46. return {
  47. leakage,
  48. onCalculate
  49. };
  50. }
  51. };
  52. </script>
  53. <style scoped>
  54. body, html {
  55. margin: 0;
  56. padding: 0;
  57. height: 100%;
  58. overflow: hidden; /* 禁止页面滚动 */
  59. }
  60. .gradient-card {
  61. background: linear-gradient(135deg,
  62. rgba(250, 253, 255, 0.8),
  63. rgba(137, 223, 252, 0.8));
  64. border-radius: 20px;
  65. box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
  66. padding: 30px;
  67. width: 100%;
  68. max-width: 500px;
  69. margin-left: 350px; /* 左侧留出空间 */
  70. backdrop-filter: blur(8px);
  71. border: none;
  72. display: flex;
  73. flex-direction: column;
  74. overflow: hidden;
  75. }
  76. .card-header {
  77. text-align: center;
  78. margin-bottom: 20px;
  79. }
  80. .card-header h1 {
  81. font-size: 2rem;
  82. color: #006064;
  83. margin-bottom: 10px;
  84. font-weight: 700;
  85. text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
  86. }
  87. .card-header p {
  88. font-size: 1.1rem;
  89. color: #00838f;
  90. opacity: 0.9;
  91. }
  92. .input-section {
  93. margin: 20px 0;
  94. }
  95. .input-group {
  96. margin-bottom: 20px;
  97. }
  98. .label {
  99. display: block;
  100. font-weight: 600;
  101. font-size: 1.2rem;
  102. margin-bottom: 10px;
  103. color: #006064;
  104. }
  105. .custom-input {
  106. width: 100%;
  107. padding: 15px 10px;
  108. border-radius: 12px;
  109. border: 2px solid #80deea;
  110. font-size: 1rem;
  111. background: rgba(255, 255, 255, 0.7);
  112. transition: all 0.3s ease;
  113. box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  114. }
  115. .custom-input:focus {
  116. outline: none;
  117. border-color: #26c6da;
  118. box-shadow: 0 0 0 4px rgba(38, 198, 218, 0.3);
  119. }
  120. .info-panel {
  121. background: rgba(178, 235, 242, 0.4);
  122. border-radius: 12px;
  123. padding: 15px;
  124. margin-top: 15px;
  125. }
  126. .info-item {
  127. display: flex;
  128. align-items: center;
  129. margin-bottom: 10px;
  130. font-size: 1rem;
  131. color: #006064;
  132. }
  133. .info-item i {
  134. margin-right: 10px;
  135. font-size: 1.2rem;
  136. color: #00838f;
  137. }
  138. .button-section {
  139. margin: 25px 0;
  140. text-align: center;
  141. flex-grow: 1;
  142. display: flex;
  143. align-items: flex-end;
  144. justify-content: center;
  145. }
  146. .calculate-btn {
  147. background: linear-gradient(to right, #8DF9F0, #26B046);
  148. color: white;
  149. border: none;
  150. border-radius: 50px;
  151. padding: 15px 30px;
  152. font-size: 1.2rem;
  153. font-weight: 600;
  154. cursor: pointer;
  155. transition: all 0.4s ease;
  156. box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  157. display: inline-flex;
  158. align-items: center;
  159. justify-content: center;
  160. min-width: 250px;
  161. position: relative;
  162. overflow: hidden;
  163. }
  164. .calculate-btn i {
  165. margin-right: 10px;
  166. font-size: 1.4rem;
  167. }
  168. .calculate-btn:hover {
  169. transform: translateY(-5px);
  170. box-shadow: 0 12px 25px rgba(0, 0, 0, 0.3);
  171. background: linear-gradient(to right, #7de8df, #20a03d);
  172. }
  173. .calculate-btn:active {
  174. transform: translateY(-2px);
  175. }
  176. .card-footer {
  177. text-align: center;
  178. font-size: 1rem;
  179. color: #00838f;
  180. font-style: italic;
  181. padding-top: 15px;
  182. border-top: 1px solid rgba(0, 150, 136, 0.2);
  183. }
  184. .card-footer i {
  185. margin-right: 10px;
  186. }
  187. /* 水波纹效果 */
  188. .calculate-btn::after {
  189. content: "";
  190. position: absolute;
  191. top: 50%;
  192. left: 50%;
  193. width: 0;
  194. height: 0;
  195. background: rgba(255, 255, 255, 0.3);
  196. border-radius: 50%;
  197. transform: translate(-50%, -50%);
  198. transition: width 0.6s, height 0.6s;
  199. }
  200. .calculate-btn:active::after {
  201. width: 200px;
  202. height: 200px;
  203. }
  204. /* 响应式设计 */
  205. @media (max-width: 480px) {
  206. .gradient-card {
  207. padding: 20px;
  208. width: 100%;
  209. max-width: 100%;
  210. }
  211. .card-header h1 {
  212. font-size: 1.8rem;
  213. }
  214. .label {
  215. font-size: 1rem;
  216. }
  217. .custom-input {
  218. padding: 12px;
  219. font-size: 0.9rem;
  220. }
  221. .calculate-btn {
  222. padding: 12px 25px;
  223. font-size: 1rem;
  224. min-width: 200px;
  225. }
  226. .info-item span {
  227. font-size: 0.9rem;
  228. }
  229. }
  230. </style>