ai-generate-view.css 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581
  1. /* AI生图弹窗样式 */
  2. * {
  3. margin: 0;
  4. padding: 0;
  5. box-sizing: border-box;
  6. }
  7. body {
  8. font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  9. background: transparent;
  10. }
  11. /* 遮罩层 */
  12. .ai-generate-overlay {
  13. position: fixed;
  14. top: 0;
  15. left: 0;
  16. right: 0;
  17. bottom: 0;
  18. background: rgba(0, 0, 0, 0.6);
  19. display: flex;
  20. align-items: center;
  21. justify-content: center;
  22. z-index: 10000;
  23. backdrop-filter: blur(4px);
  24. }
  25. /* 弹窗主体 */
  26. .ai-generate-modal {
  27. background: white;
  28. border-radius: 20px;
  29. width: 90%;
  30. max-width: 1100px;
  31. max-height: 85vh;
  32. overflow: visible;
  33. box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
  34. position: relative;
  35. display: flex;
  36. flex-direction: column;
  37. margin: 20px;
  38. }
  39. /* 关闭按钮 */
  40. .modal-close-btn {
  41. position: absolute;
  42. top: 12px;
  43. right: 12px;
  44. width: 36px;
  45. height: 36px;
  46. border-radius: 50%;
  47. background: rgba(0, 0, 0, 0.05);
  48. border: none;
  49. cursor: pointer;
  50. display: flex;
  51. align-items: center;
  52. justify-content: center;
  53. color: #6b7280;
  54. transition: all 0.2s;
  55. z-index: 100;
  56. }
  57. .modal-close-btn:hover {
  58. background: rgba(0, 0, 0, 0.1);
  59. color: #374151;
  60. transform: scale(1.1);
  61. }
  62. /* 预览区域容器 */
  63. .ai-generate-preview-container {
  64. display: grid;
  65. grid-template-columns: 1fr 1fr;
  66. gap: 20px;
  67. padding: 24px;
  68. padding-top: 50px;
  69. flex: 1;
  70. min-height: 0;
  71. overflow: auto;
  72. }
  73. /* 预览框通用样式 */
  74. .ai-generate-preview-box {
  75. border-radius: 16px;
  76. overflow: hidden; /* 保持 hidden 以维持圆角效果 */
  77. position: relative;
  78. display: flex;
  79. align-items: center;
  80. justify-content: center;
  81. min-height: 300px;
  82. max-height: 450px;
  83. padding: 4px; /* 添加小量 padding,确保内部按钮不被裁剪 */
  84. box-sizing: border-box; /* 确保 padding 不影响尺寸计算 */
  85. }
  86. /* 左侧参考图区域 */
  87. .ai-generate-reference-box {
  88. background: linear-gradient(135deg, #f0f4ff 0%, #e8f0ff 100%);
  89. border: 2px dashed #667eea;
  90. }
  91. /* 右侧预览区域 */
  92. .ai-generate-spritesheet-box {
  93. background:
  94. linear-gradient(45deg, #e5e7eb 25%, transparent 25%),
  95. linear-gradient(-45deg, #e5e7eb 25%, transparent 25%),
  96. linear-gradient(45deg, transparent 75%, #e5e7eb 75%),
  97. linear-gradient(-45deg, transparent 75%, #e5e7eb 75%);
  98. background-size: 20px 20px;
  99. background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  100. background-color: #f9fafb;
  101. border: 1px solid #e5e7eb;
  102. }
  103. /* 预览图 */
  104. .ai-generate-preview-box img {
  105. max-width: 100%;
  106. max-height: 100%;
  107. object-fit: contain;
  108. display: none;
  109. }
  110. .ai-generate-preview-box img.show {
  111. display: block;
  112. }
  113. /* 上传区域 */
  114. .reference-upload-area {
  115. display: flex;
  116. flex-direction: column;
  117. align-items: center;
  118. justify-content: center;
  119. cursor: pointer;
  120. padding: 40px;
  121. width: 100%;
  122. height: 100%;
  123. transition: all 0.3s;
  124. }
  125. .reference-upload-area:hover {
  126. background: rgba(102, 126, 234, 0.1);
  127. }
  128. .reference-upload-area.hide {
  129. display: none;
  130. }
  131. .upload-icon {
  132. font-size: 48px;
  133. color: #667eea;
  134. margin-bottom: 12px;
  135. font-weight: 300;
  136. }
  137. .upload-text {
  138. color: #667eea;
  139. font-size: 14px;
  140. font-weight: 500;
  141. }
  142. /* 参考图容器 */
  143. .reference-image-wrapper {
  144. position: relative;
  145. width: 100%;
  146. height: 100%;
  147. display: flex;
  148. align-items: center;
  149. justify-content: center;
  150. }
  151. .reference-image {
  152. max-width: 100%;
  153. max-height: 100%;
  154. object-fit: contain;
  155. display: block !important; /* 覆盖 .ai-generate-preview-box img 的 display: none */
  156. }
  157. /* 删除参考图按钮 */
  158. .reference-remove-btn {
  159. position: absolute;
  160. top: 8px; /* 距离顶部足够远,不会被裁剪 */
  161. right: 8px; /* 距离右边足够远,不会被裁剪 */
  162. width: 32px;
  163. height: 32px;
  164. border-radius: 50%;
  165. background: rgba(0, 0, 0, 0.6);
  166. border: none;
  167. cursor: pointer;
  168. display: flex;
  169. align-items: center;
  170. justify-content: center;
  171. color: white;
  172. transition: all 0.2s;
  173. z-index: 10; /* 确保按钮在最上层 */
  174. }
  175. .reference-remove-btn:hover {
  176. background: #ef4444;
  177. transform: scale(1.1);
  178. }
  179. /* 加载状态 */
  180. .preview-placeholder {
  181. position: absolute;
  182. display: flex;
  183. flex-direction: column;
  184. align-items: center;
  185. justify-content: center;
  186. gap: 16px;
  187. color: #9ca3af;
  188. }
  189. .preview-placeholder.hide {
  190. display: none;
  191. }
  192. .loading-spinner {
  193. width: 40px;
  194. height: 40px;
  195. border: 4px solid #e5e7eb;
  196. border-top-color: #667eea;
  197. border-radius: 50%;
  198. animation: spin 0.8s linear infinite;
  199. }
  200. @keyframes spin {
  201. to { transform: rotate(360deg); }
  202. }
  203. .loading-text {
  204. font-size: 14px;
  205. color: #6b7280;
  206. }
  207. /* AI生图队列区域 */
  208. .ai-queue-section {
  209. padding: 0 20px 16px;
  210. }
  211. .ai-queue-title {
  212. font-size: 13px;
  213. font-weight: 600;
  214. color: #667eea;
  215. margin-bottom: 12px;
  216. display: flex;
  217. align-items: center;
  218. gap: 6px;
  219. }
  220. .ai-queue-title::before {
  221. content: '';
  222. width: 3px;
  223. height: 14px;
  224. background: linear-gradient(135deg, #667eea, #764ba2);
  225. border-radius: 2px;
  226. }
  227. .ai-queue-list {
  228. display: flex;
  229. gap: 12px;
  230. overflow-x: auto;
  231. overflow-y: hidden;
  232. padding-bottom: 10px;
  233. scroll-behavior: smooth;
  234. -webkit-overflow-scrolling: touch;
  235. }
  236. .ai-queue-list::-webkit-scrollbar {
  237. height: 6px;
  238. }
  239. .ai-queue-list::-webkit-scrollbar-track {
  240. background: #f1f1f1;
  241. border-radius: 3px;
  242. }
  243. .ai-queue-list::-webkit-scrollbar-thumb {
  244. background: linear-gradient(135deg, #667eea, #764ba2);
  245. border-radius: 3px;
  246. }
  247. .ai-queue-item {
  248. flex-shrink: 0;
  249. width: 100px;
  250. height: 100px;
  251. border-radius: 12px;
  252. overflow: hidden;
  253. position: relative;
  254. background: #f8fafc;
  255. border: 2px solid #e5e7eb;
  256. cursor: pointer;
  257. transition: all 0.3s;
  258. }
  259. .ai-queue-item:hover {
  260. border-color: #667eea;
  261. transform: translateY(-2px);
  262. box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
  263. }
  264. .ai-queue-item.rendering {
  265. border-color: #667eea;
  266. }
  267. .ai-queue-item.completed {
  268. border-color: #10b981;
  269. }
  270. .ai-queue-item.failed {
  271. border-color: #ef4444;
  272. }
  273. .ai-queue-item-preview {
  274. width: 100%;
  275. height: 100%;
  276. object-fit: cover;
  277. filter: blur(4px) brightness(0.8);
  278. }
  279. .ai-queue-item.completed .ai-queue-item-preview {
  280. filter: none;
  281. }
  282. .ai-queue-item-overlay {
  283. position: absolute;
  284. top: 0;
  285. left: 0;
  286. right: 0;
  287. bottom: 0;
  288. display: flex;
  289. flex-direction: column;
  290. align-items: center;
  291. justify-content: center;
  292. background: rgba(0, 0, 0, 0.3);
  293. }
  294. .ai-queue-item.completed .ai-queue-item-overlay {
  295. background: transparent;
  296. opacity: 0;
  297. transition: opacity 0.2s;
  298. }
  299. .ai-queue-item.completed:hover .ai-queue-item-overlay {
  300. opacity: 1;
  301. background: rgba(0, 0, 0, 0.5);
  302. }
  303. .ai-queue-item-spinner {
  304. width: 24px;
  305. height: 24px;
  306. border: 3px solid rgba(255, 255, 255, 0.3);
  307. border-top-color: white;
  308. border-radius: 50%;
  309. animation: spin 1s linear infinite;
  310. }
  311. .ai-queue-item-status {
  312. font-size: 10px;
  313. color: white;
  314. margin-top: 6px;
  315. font-weight: 500;
  316. text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  317. }
  318. .ai-queue-item-icon {
  319. font-size: 20px;
  320. }
  321. .ai-queue-item-actions {
  322. display: flex;
  323. gap: 4px;
  324. }
  325. .ai-queue-item-action {
  326. width: 28px;
  327. height: 28px;
  328. border-radius: 50%;
  329. border: none;
  330. background: white;
  331. color: #667eea;
  332. cursor: pointer;
  333. display: flex;
  334. align-items: center;
  335. justify-content: center;
  336. transition: all 0.2s;
  337. }
  338. .ai-queue-item-action:hover {
  339. background: #667eea;
  340. color: white;
  341. transform: scale(1.1);
  342. }
  343. /* 提示词配置区域 */
  344. .prompt-config-section {
  345. padding: 0 20px 20px;
  346. display: flex;
  347. flex-direction: column;
  348. gap: 12px;
  349. }
  350. .config-row {
  351. display: flex;
  352. gap: 12px;
  353. }
  354. .config-textarea {
  355. flex: 1;
  356. min-height: 80px;
  357. padding: 14px;
  358. border: 2px solid #e5e7eb;
  359. border-radius: 12px;
  360. font-size: 14px;
  361. resize: vertical;
  362. transition: border-color 0.2s;
  363. font-family: inherit;
  364. }
  365. .config-textarea:focus {
  366. outline: none;
  367. border-color: #667eea;
  368. }
  369. .config-textarea::placeholder {
  370. color: #9ca3af;
  371. }
  372. /* 操作按钮区域 */
  373. .prompt-actions {
  374. display: flex;
  375. justify-content: flex-end;
  376. gap: 12px;
  377. }
  378. .action-btn {
  379. display: flex;
  380. align-items: center;
  381. gap: 8px;
  382. padding: 12px 24px;
  383. border-radius: 12px;
  384. font-size: 14px;
  385. font-weight: 600;
  386. cursor: pointer;
  387. transition: all 0.2s;
  388. border: none;
  389. }
  390. .generate-action-btn {
  391. background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  392. color: white;
  393. box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  394. }
  395. .generate-action-btn:hover:not(:disabled) {
  396. transform: translateY(-2px);
  397. box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
  398. }
  399. .generate-action-btn:disabled {
  400. opacity: 0.5;
  401. cursor: not-allowed;
  402. transform: none;
  403. }
  404. /* 飞走动画 */
  405. .ai-task-fly-animation {
  406. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  407. color: white;
  408. padding: 12px 20px;
  409. border-radius: 12px;
  410. box-shadow: 0 8px 32px rgba(102, 126, 234, 0.4);
  411. display: flex;
  412. align-items: center;
  413. gap: 8px;
  414. }
  415. /* 图片预览弹窗 */
  416. .image-preview-modal {
  417. position: fixed;
  418. top: 0;
  419. left: 0;
  420. right: 0;
  421. bottom: 0;
  422. z-index: 200000;
  423. display: flex;
  424. align-items: center;
  425. justify-content: center;
  426. opacity: 0;
  427. transition: opacity 0.3s ease;
  428. }
  429. .image-preview-modal.show {
  430. opacity: 1;
  431. }
  432. .image-preview-modal-backdrop {
  433. position: absolute;
  434. top: 0;
  435. left: 0;
  436. right: 0;
  437. bottom: 0;
  438. background: rgba(0, 0, 0, 0.85);
  439. backdrop-filter: blur(8px);
  440. }
  441. .image-preview-modal-content {
  442. position: relative;
  443. max-width: 90vw;
  444. max-height: 90vh;
  445. transform: scale(0.9);
  446. transition: transform 0.3s ease;
  447. }
  448. .image-preview-modal.show .image-preview-modal-content {
  449. transform: scale(1);
  450. }
  451. .image-preview-modal-content img {
  452. max-width: 100%;
  453. max-height: 85vh;
  454. border-radius: 12px;
  455. box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  456. }
  457. .image-preview-modal-close {
  458. position: absolute;
  459. top: -40px;
  460. right: 0;
  461. width: 36px;
  462. height: 36px;
  463. border: none;
  464. background: rgba(255, 255, 255, 0.2);
  465. color: white;
  466. font-size: 24px;
  467. border-radius: 50%;
  468. cursor: pointer;
  469. transition: all 0.2s;
  470. display: flex;
  471. align-items: center;
  472. justify-content: center;
  473. line-height: 1;
  474. }
  475. .image-preview-modal-close:hover {
  476. background: rgba(255, 255, 255, 0.3);
  477. transform: scale(1.1);
  478. }
  479. .image-preview-modal-download {
  480. position: absolute;
  481. bottom: -50px;
  482. left: 50%;
  483. transform: translateX(-50%);
  484. display: flex;
  485. align-items: center;
  486. gap: 8px;
  487. padding: 10px 24px;
  488. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  489. color: white;
  490. text-decoration: none;
  491. border-radius: 25px;
  492. font-size: 14px;
  493. font-weight: 600;
  494. transition: all 0.2s;
  495. box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  496. }
  497. .image-preview-modal-download:hover {
  498. transform: translateX(-50%) translateY(-2px);
  499. box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
  500. }
  501. /* 响应式设计 */
  502. @media (max-width: 768px) {
  503. .ai-generate-preview-container {
  504. grid-template-columns: 1fr;
  505. }
  506. .ai-generate-preview-box {
  507. min-height: 200px;
  508. }
  509. }