ai-generate-view.css 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666
  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: 24px;
  67. padding: 28px;
  68. padding-top: 56px;
  69. flex: 1;
  70. min-height: 0;
  71. overflow: auto;
  72. }
  73. /* 预览区块 */
  74. .ai-generate-reference-section,
  75. .ai-generate-spritesheet-section {
  76. display: flex;
  77. flex-direction: column;
  78. }
  79. /* 预览框通用样式 */
  80. .ai-generate-preview-box {
  81. border-radius: 16px;
  82. overflow: hidden;
  83. position: relative;
  84. display: flex;
  85. align-items: center;
  86. justify-content: center;
  87. min-height: 320px;
  88. max-height: 420px;
  89. flex: 1;
  90. box-sizing: border-box;
  91. transition: all 0.3s ease;
  92. }
  93. /* 左侧参考图区域 */
  94. .ai-generate-reference-box {
  95. background: linear-gradient(135deg, #f8faff 0%, #f0f4ff 100%);
  96. border: 2px dashed #a5b4fc;
  97. overflow: visible;
  98. box-shadow: 0 4px 20px rgba(102, 126, 234, 0.08);
  99. }
  100. .ai-generate-reference-box:hover {
  101. border-color: #667eea;
  102. box-shadow: 0 6px 24px rgba(102, 126, 234, 0.15);
  103. }
  104. /* 右侧预览区域 */
  105. .ai-generate-spritesheet-box {
  106. background:
  107. linear-gradient(45deg, #f3f4f6 25%, transparent 25%),
  108. linear-gradient(-45deg, #f3f4f6 25%, transparent 25%),
  109. linear-gradient(45deg, transparent 75%, #f3f4f6 75%),
  110. linear-gradient(-45deg, transparent 75%, #f3f4f6 75%);
  111. background-size: 16px 16px;
  112. background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
  113. background-color: #ffffff;
  114. border: 1px solid #e5e7eb;
  115. box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  116. }
  117. /* 预览图 */
  118. .ai-generate-preview-box img {
  119. max-width: 100%;
  120. max-height: 100%;
  121. object-fit: contain;
  122. display: none;
  123. }
  124. .ai-generate-preview-box img.show {
  125. display: block;
  126. }
  127. /* 上传区域 */
  128. .reference-upload-area {
  129. display: flex;
  130. flex-direction: column;
  131. align-items: center;
  132. justify-content: center;
  133. cursor: pointer;
  134. padding: 40px;
  135. width: 100%;
  136. height: 100%;
  137. transition: all 0.3s ease;
  138. border-radius: 14px;
  139. }
  140. .reference-upload-area:hover {
  141. background: rgba(102, 126, 234, 0.08);
  142. }
  143. .reference-upload-area:hover .upload-icon {
  144. transform: scale(1.1);
  145. }
  146. .reference-upload-area.hide {
  147. display: none;
  148. }
  149. .upload-icon {
  150. color: #9ca3af;
  151. font-size: 48px;
  152. font-weight: 200;
  153. line-height: 1;
  154. transition: color 0.2s ease;
  155. }
  156. .reference-upload-area:hover .upload-icon {
  157. color: #6b7280;
  158. }
  159. /* 参考图容器 */
  160. .reference-image-wrapper {
  161. position: absolute;
  162. top: 0;
  163. left: 0;
  164. right: 0;
  165. bottom: 0;
  166. display: flex;
  167. align-items: center;
  168. justify-content: center;
  169. z-index: 1;
  170. padding: 16px;
  171. box-sizing: border-box;
  172. }
  173. .reference-image {
  174. max-width: 100%;
  175. max-height: 100%;
  176. width: auto;
  177. height: auto;
  178. object-fit: contain;
  179. display: block !important;
  180. border-radius: 12px;
  181. box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  182. }
  183. /* 删除参考图按钮 */
  184. .reference-remove-btn {
  185. position: absolute;
  186. top: 12px;
  187. right: 12px;
  188. width: 36px;
  189. height: 36px;
  190. border-radius: 50%;
  191. background: rgba(0, 0, 0, 0.65);
  192. backdrop-filter: blur(8px);
  193. border: 2px solid rgba(255, 255, 255, 0.2);
  194. cursor: pointer;
  195. display: flex;
  196. align-items: center;
  197. justify-content: center;
  198. color: white;
  199. transition: all 0.25s ease;
  200. z-index: 100;
  201. box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  202. }
  203. .reference-remove-btn:hover {
  204. background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  205. border-color: rgba(255, 255, 255, 0.3);
  206. transform: scale(1.1) rotate(90deg);
  207. box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
  208. }
  209. /* 加载状态 */
  210. .preview-placeholder {
  211. position: absolute;
  212. display: flex;
  213. flex-direction: column;
  214. align-items: center;
  215. justify-content: center;
  216. gap: 16px;
  217. color: #9ca3af;
  218. }
  219. .preview-placeholder.hide {
  220. display: none;
  221. }
  222. .loading-spinner {
  223. width: 40px;
  224. height: 40px;
  225. border: 4px solid #e5e7eb;
  226. border-top-color: #667eea;
  227. border-radius: 50%;
  228. animation: spin 0.8s linear infinite;
  229. }
  230. @keyframes spin {
  231. to { transform: rotate(360deg); }
  232. }
  233. .loading-text {
  234. font-size: 14px;
  235. color: #6b7280;
  236. }
  237. /* AI生图队列区域 */
  238. .ai-queue-section {
  239. padding: 0 20px 16px;
  240. }
  241. .ai-queue-title {
  242. font-size: 13px;
  243. font-weight: 600;
  244. color: #667eea;
  245. margin-bottom: 12px;
  246. display: flex;
  247. align-items: center;
  248. gap: 6px;
  249. }
  250. .ai-queue-title::before {
  251. content: '';
  252. width: 3px;
  253. height: 14px;
  254. background: linear-gradient(135deg, #667eea, #764ba2);
  255. border-radius: 2px;
  256. }
  257. .ai-queue-list {
  258. display: flex;
  259. gap: 12px;
  260. overflow-x: auto;
  261. overflow-y: hidden;
  262. padding-bottom: 10px;
  263. scroll-behavior: smooth;
  264. -webkit-overflow-scrolling: touch;
  265. }
  266. .ai-queue-list::-webkit-scrollbar {
  267. height: 6px;
  268. }
  269. .ai-queue-list::-webkit-scrollbar-track {
  270. background: #f1f1f1;
  271. border-radius: 3px;
  272. }
  273. .ai-queue-list::-webkit-scrollbar-thumb {
  274. background: linear-gradient(135deg, #667eea, #764ba2);
  275. border-radius: 3px;
  276. }
  277. .ai-queue-item {
  278. flex-shrink: 0;
  279. width: 100px;
  280. height: 100px;
  281. border-radius: 12px;
  282. overflow: hidden;
  283. position: relative;
  284. background: #f8fafc;
  285. border: 2px solid #e5e7eb;
  286. cursor: pointer;
  287. transition: all 0.3s;
  288. }
  289. .ai-queue-item:hover {
  290. border-color: #667eea;
  291. transform: translateY(-2px);
  292. box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
  293. }
  294. .ai-queue-item.rendering {
  295. border-color: #667eea;
  296. }
  297. .ai-queue-item.completed {
  298. border-color: #10b981;
  299. }
  300. .ai-queue-item.failed {
  301. border-color: #ef4444;
  302. }
  303. .ai-queue-item-preview {
  304. width: 100%;
  305. height: 100%;
  306. object-fit: cover;
  307. filter: blur(4px) brightness(0.8);
  308. }
  309. .ai-queue-item.completed .ai-queue-item-preview {
  310. filter: none;
  311. }
  312. .ai-queue-item-overlay {
  313. position: absolute;
  314. top: 0;
  315. left: 0;
  316. right: 0;
  317. bottom: 0;
  318. display: flex;
  319. flex-direction: column;
  320. align-items: center;
  321. justify-content: center;
  322. background: rgba(0, 0, 0, 0.3);
  323. }
  324. .ai-queue-item.completed .ai-queue-item-overlay {
  325. background: transparent;
  326. opacity: 0;
  327. transition: opacity 0.2s;
  328. }
  329. .ai-queue-item.completed:hover .ai-queue-item-overlay {
  330. opacity: 1;
  331. background: rgba(0, 0, 0, 0.5);
  332. }
  333. .ai-queue-item-spinner {
  334. width: 24px;
  335. height: 24px;
  336. border: 3px solid rgba(255, 255, 255, 0.3);
  337. border-top-color: white;
  338. border-radius: 50%;
  339. animation: spin 1s linear infinite;
  340. }
  341. .ai-queue-item-status {
  342. font-size: 10px;
  343. color: white;
  344. margin-top: 6px;
  345. font-weight: 500;
  346. text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  347. }
  348. .ai-queue-item-icon {
  349. font-size: 20px;
  350. }
  351. .ai-queue-item-actions {
  352. display: flex;
  353. gap: 4px;
  354. }
  355. .ai-queue-item-action {
  356. width: 28px;
  357. height: 28px;
  358. border-radius: 50%;
  359. border: none;
  360. background: white;
  361. color: #667eea;
  362. cursor: pointer;
  363. display: flex;
  364. align-items: center;
  365. justify-content: center;
  366. transition: all 0.2s;
  367. }
  368. .ai-queue-item-action:hover {
  369. background: #667eea;
  370. color: white;
  371. transform: scale(1.1);
  372. }
  373. /* 提示词配置区域 */
  374. .prompt-config-section {
  375. padding: 0 28px 24px;
  376. display: flex;
  377. flex-direction: column;
  378. gap: 16px;
  379. background: linear-gradient(180deg, transparent 0%, rgba(248, 250, 252, 0.5) 100%);
  380. }
  381. .config-row {
  382. display: flex;
  383. gap: 16px;
  384. align-items: flex-start;
  385. }
  386. .config-textarea {
  387. flex: 1;
  388. min-height: 72px;
  389. max-height: 120px;
  390. padding: 14px 16px;
  391. border: 2px solid #e5e7eb;
  392. border-radius: 14px;
  393. font-size: 14px;
  394. line-height: 1.5;
  395. resize: none;
  396. transition: all 0.25s ease;
  397. font-family: inherit;
  398. background: white;
  399. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  400. }
  401. .config-textarea:focus {
  402. outline: none;
  403. border-color: #667eea;
  404. box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1), 0 4px 12px rgba(0, 0, 0, 0.06);
  405. }
  406. .config-textarea::placeholder {
  407. color: #9ca3af;
  408. }
  409. /* 操作按钮区域 */
  410. .prompt-actions {
  411. display: flex;
  412. justify-content: flex-end;
  413. gap: 12px;
  414. }
  415. .action-btn {
  416. display: flex;
  417. align-items: center;
  418. gap: 8px;
  419. padding: 14px 28px;
  420. border-radius: 14px;
  421. font-size: 15px;
  422. font-weight: 600;
  423. cursor: pointer;
  424. transition: all 0.25s ease;
  425. border: none;
  426. }
  427. .generate-action-btn {
  428. background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  429. color: white;
  430. box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
  431. position: relative;
  432. overflow: hidden;
  433. }
  434. .generate-action-btn::before {
  435. content: '';
  436. position: absolute;
  437. top: 0;
  438. left: -100%;
  439. width: 100%;
  440. height: 100%;
  441. background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  442. transition: left 0.5s ease;
  443. }
  444. .generate-action-btn:hover:not(:disabled)::before {
  445. left: 100%;
  446. }
  447. .generate-action-btn:hover:not(:disabled) {
  448. transform: translateY(-3px);
  449. box-shadow: 0 10px 28px rgba(16, 185, 129, 0.45);
  450. }
  451. .generate-action-btn:active:not(:disabled) {
  452. transform: translateY(-1px);
  453. }
  454. .generate-action-btn:disabled {
  455. opacity: 0.5;
  456. cursor: not-allowed;
  457. transform: none;
  458. box-shadow: none;
  459. }
  460. .btn-price {
  461. background: rgba(255, 255, 255, 0.2);
  462. padding: 4px 10px;
  463. border-radius: 8px;
  464. font-size: 13px;
  465. }
  466. /* 飞走动画 */
  467. .ai-task-fly-animation {
  468. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  469. color: white;
  470. padding: 12px 20px;
  471. border-radius: 12px;
  472. box-shadow: 0 8px 32px rgba(102, 126, 234, 0.4);
  473. display: flex;
  474. align-items: center;
  475. gap: 8px;
  476. }
  477. /* 图片预览弹窗 */
  478. .image-preview-modal {
  479. position: fixed;
  480. top: 0;
  481. left: 0;
  482. right: 0;
  483. bottom: 0;
  484. z-index: 200000;
  485. display: flex;
  486. align-items: center;
  487. justify-content: center;
  488. opacity: 0;
  489. transition: opacity 0.3s ease;
  490. }
  491. .image-preview-modal.show {
  492. opacity: 1;
  493. }
  494. .image-preview-modal-backdrop {
  495. position: absolute;
  496. top: 0;
  497. left: 0;
  498. right: 0;
  499. bottom: 0;
  500. background: rgba(0, 0, 0, 0.85);
  501. backdrop-filter: blur(8px);
  502. }
  503. .image-preview-modal-content {
  504. position: relative;
  505. max-width: 90vw;
  506. max-height: 90vh;
  507. transform: scale(0.9);
  508. transition: transform 0.3s ease;
  509. }
  510. .image-preview-modal.show .image-preview-modal-content {
  511. transform: scale(1);
  512. }
  513. .image-preview-modal-content img {
  514. max-width: 100%;
  515. max-height: 85vh;
  516. border-radius: 12px;
  517. box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  518. }
  519. .image-preview-modal-close {
  520. position: absolute;
  521. top: -40px;
  522. right: 0;
  523. width: 36px;
  524. height: 36px;
  525. border: none;
  526. background: rgba(255, 255, 255, 0.2);
  527. color: white;
  528. font-size: 24px;
  529. border-radius: 50%;
  530. cursor: pointer;
  531. transition: all 0.2s;
  532. display: flex;
  533. align-items: center;
  534. justify-content: center;
  535. line-height: 1;
  536. }
  537. .image-preview-modal-close:hover {
  538. background: rgba(255, 255, 255, 0.3);
  539. transform: scale(1.1);
  540. }
  541. .image-preview-modal-download {
  542. position: absolute;
  543. bottom: -50px;
  544. left: 50%;
  545. transform: translateX(-50%);
  546. display: flex;
  547. align-items: center;
  548. gap: 8px;
  549. padding: 10px 24px;
  550. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  551. color: white;
  552. text-decoration: none;
  553. border-radius: 25px;
  554. font-size: 14px;
  555. font-weight: 600;
  556. transition: all 0.2s;
  557. box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  558. }
  559. .image-preview-modal-download:hover {
  560. transform: translateX(-50%) translateY(-2px);
  561. box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
  562. }
  563. /* 响应式设计 */
  564. @media (max-width: 768px) {
  565. .ai-generate-preview-container {
  566. grid-template-columns: 1fr;
  567. padding: 20px;
  568. padding-top: 48px;
  569. gap: 20px;
  570. }
  571. .ai-generate-preview-box {
  572. min-height: 220px;
  573. max-height: 300px;
  574. }
  575. .prompt-config-section {
  576. padding: 0 20px 20px;
  577. }
  578. .config-textarea {
  579. min-height: 60px;
  580. }
  581. .action-btn {
  582. padding: 12px 20px;
  583. font-size: 14px;
  584. }
  585. }