FarmDialog.scss 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. .farm-container {
  2. padding: 20rpx;
  3. display: flex;
  4. flex-direction: column;
  5. gap: 20rpx;
  6. }
  7. .farm-beds {
  8. display: flex;
  9. flex-direction: column;
  10. gap: 30rpx;
  11. }
  12. .farm-grid {
  13. display: flex;
  14. flex-direction: column;
  15. gap: 10rpx;
  16. background-color: #8B4513;
  17. padding: 20rpx;
  18. border-radius: 10rpx;
  19. position: relative;
  20. &::before {
  21. content: '';
  22. position: absolute;
  23. top: 0;
  24. left: 0;
  25. right: 0;
  26. bottom: 0;
  27. background: rgba(173, 216, 230, 0.3);
  28. border-radius: 10rpx;
  29. pointer-events: none;
  30. }
  31. .row {
  32. display: flex;
  33. justify-content: center;
  34. gap: 10rpx;
  35. &.row-1, &.row-3 {
  36. padding: 0 60rpx;
  37. }
  38. }
  39. }
  40. .farm-plot {
  41. flex: 1;
  42. aspect-ratio: 1;
  43. max-width: 120rpx;
  44. background-color: #654321;
  45. border-radius: 8rpx;
  46. position: relative;
  47. cursor: pointer;
  48. transition: all 0.2s;
  49. &.is-locked {
  50. background-color: #333333;
  51. &::after {
  52. content: '🔒';
  53. position: absolute;
  54. top: 50%;
  55. left: 50%;
  56. transform: translate(-50%, -50%);
  57. font-size: 24rpx;
  58. }
  59. }
  60. &.is-empty {
  61. background-color: #8B4513;
  62. }
  63. &.is-growing {
  64. background-color: #556B2F;
  65. }
  66. &.is-harvestable {
  67. background-color: #228B22;
  68. }
  69. &.highlight-empty {
  70. animation: pulse 1s infinite;
  71. border: 2rpx solid #FFD700;
  72. }
  73. &.highlight-harvestable {
  74. animation: pulse 1s infinite;
  75. border: 2rpx solid #FFD700;
  76. }
  77. .plot-content {
  78. width: 100%;
  79. height: 100%;
  80. display: flex;
  81. align-items: center;
  82. justify-content: center;
  83. position: relative;
  84. &.needs-water::after {
  85. content: '';
  86. position: absolute;
  87. top: 0;
  88. left: 0;
  89. right: 0;
  90. bottom: 0;
  91. background: rgba(0, 0, 255, 0.2);
  92. border-radius: 8rpx;
  93. }
  94. &.has-weeds::before {
  95. content: '';
  96. position: absolute;
  97. top: 0;
  98. left: 0;
  99. right: 0;
  100. bottom: 0;
  101. // background: url('/static/weeds.png') center/cover;
  102. opacity: 0.5;
  103. border-radius: 8rpx;
  104. }
  105. }
  106. .plot-state-text {
  107. position: absolute;
  108. bottom: 0;
  109. left: 0;
  110. right: 0;
  111. background: rgba(0, 0, 0, 0.6);
  112. color: white;
  113. font-size: 20rpx;
  114. padding: 2rpx 0;
  115. text-align: center;
  116. border-bottom-left-radius: 8rpx;
  117. border-bottom-right-radius: 8rpx;
  118. transition: all 0.3s;
  119. &.state-changed {
  120. animation: stateChange 0.3s ease-in-out;
  121. }
  122. }
  123. .crop-stage {
  124. width: 80%;
  125. height: 80%;
  126. display: flex;
  127. align-items: center;
  128. justify-content: center;
  129. .crop-image {
  130. width: 100%;
  131. height: 100%;
  132. object-fit: contain;
  133. }
  134. }
  135. }
  136. @keyframes pulse {
  137. 0% {
  138. transform: scale(1);
  139. box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.4);
  140. }
  141. 70% {
  142. transform: scale(1.05);
  143. box-shadow: 0 0 0 10rpx rgba(255, 215, 0, 0);
  144. }
  145. 100% {
  146. transform: scale(1);
  147. box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
  148. }
  149. }
  150. @keyframes stateChange {
  151. 0% {
  152. transform: scale(1);
  153. opacity: 0.5;
  154. }
  155. 50% {
  156. transform: scale(1.1);
  157. opacity: 1;
  158. }
  159. 100% {
  160. transform: scale(1);
  161. opacity: 1;
  162. }
  163. }
  164. .action-panel {
  165. display: flex;
  166. flex-direction: column;
  167. gap: 20rpx;
  168. padding: 20rpx;
  169. background-color: rgba(255, 255, 255, 0.9);
  170. border-radius: 10rpx;
  171. position: relative;
  172. .farm-state-indicator {
  173. position: absolute;
  174. bottom: 100%;
  175. left: 0;
  176. background: rgba(0, 0, 0, 0.7);
  177. color: white;
  178. padding: 10rpx 20rpx;
  179. border-top-left-radius: 10rpx;
  180. border-top-right-radius: 10rpx;
  181. font-size: 24rpx;
  182. margin-bottom: 10rpx;
  183. transition: all 0.3s;
  184. &.state-changed {
  185. animation: stateChange 0.3s ease-in-out;
  186. }
  187. }
  188. .action-buttons {
  189. display: flex;
  190. gap: 10rpx;
  191. justify-content: space-around;
  192. button {
  193. flex: 1;
  194. min-width: 160rpx;
  195. padding: 15rpx 30rpx;
  196. border: none;
  197. border-radius: 5rpx;
  198. background-color: #4CAF50;
  199. color: white;
  200. font-size: 28rpx;
  201. transition: all 0.2s;
  202. &:disabled {
  203. background-color: #cccccc;
  204. cursor: not-allowed;
  205. }
  206. &:active {
  207. transform: scale(0.95);
  208. }
  209. }
  210. }
  211. .selected-plot-info {
  212. display: flex;
  213. flex-direction: column;
  214. gap: 10rpx;
  215. padding: 10rpx;
  216. background-color: rgba(0, 0, 0, 0.05);
  217. border-radius: 5rpx;
  218. text {
  219. font-size: 24rpx;
  220. color: #333;
  221. }
  222. }
  223. }