| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865 |
- /* 确保 body 和 html 占满整个 iframe */
- html, body {
- margin: 0;
- padding: 0;
- width: 100%;
- height: 100%;
- overflow: hidden;
- }
- /* 弹出框遮罩层 */
- .export-overlay {
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- width: 100%;
- height: 100%;
- background: rgba(0, 0, 0, 0.7);
- display: flex;
- align-items: center;
- justify-content: center;
- z-index: 999999;
- backdrop-filter: blur(4px);
- animation: overlayFadeIn 0.3s ease-out;
- margin: 0;
- padding: 0;
- }
- /* 关闭按钮(在弹窗右上角) */
- .modal-close-btn {
- position: absolute;
- width: 44px;
- height: 44px;
- border-radius: 50%;
- background: white;
- border: 2px solid #e5e7eb;
- color: #6b7280;
- cursor: pointer;
- display: flex;
- align-items: center;
- justify-content: center;
- transition: background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.2s;
- z-index: 10;
- padding: 0;
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
- top: -22px;
- right: -22px;
- }
- .modal-close-btn:hover {
- background: #f9fafb;
- color: #1f2937;
- border-color: #d1d5db;
- transform: scale(1.1);
- box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
- }
- .modal-close-btn:active {
- transform: scale(0.95);
- }
- .modal-close-btn svg {
- width: 20px;
- height: 20px;
- }
- @keyframes overlayFadeIn {
- from {
- background: rgba(0, 0, 0, 0);
- backdrop-filter: blur(0);
- }
- to {
- background: rgba(0, 0, 0, 0.7);
- backdrop-filter: blur(4px);
- }
- }
- /* 弹出框容器 */
- .export-modal {
- background: white;
- border-radius: 16px;
- box-shadow:
- 0 20px 60px rgba(0, 0, 0, 0.3),
- 0 0 0 1px rgba(0, 0, 0, 0.05);
- min-width: 800px;
- max-width: 1200px;
- width: 90%;
- max-height: 90vh;
- display: flex;
- flex-direction: column;
- animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
- overflow: visible;
- position: relative;
- z-index: 1000000;
- margin: auto;
- }
- @keyframes modalSlideIn {
- from {
- opacity: 0;
- transform: translateY(-30px) scale(0.95);
- }
- to {
- opacity: 1;
- transform: translateY(0) scale(1);
- }
- }
- /* 图片预览容器 - 左右两个图框 */
- .export-preview-container {
- width: 100%;
- min-height: 500px;
- max-height: 70vh;
- display: flex;
- gap: 32px;
- padding: 32px;
- box-sizing: border-box;
- background: #fafbfc;
- }
- /* 预览图框 - 左右各占一半 */
- .export-preview-box {
- flex: 1;
- min-height: 400px;
- background: repeating-conic-gradient(#f3f4f6 0% 25%, white 0% 50%) 50% / 20px 20px;
- border: 2px solid #e5e7eb;
- border-radius: 12px;
- display: flex;
- align-items: center;
- justify-content: center;
- position: relative;
- overflow: auto;
- box-sizing: border-box;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
- transition: box-shadow 0.2s;
- }
- .export-preview-box:hover {
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
- }
- /* 右侧 Spritesheet 区域容器 */
- .export-spritesheet-section {
- flex: 1;
- display: flex;
- flex-direction: column;
- }
- /* 左侧:参考图上传区域 */
- .export-reference-section {
- flex: 1;
- display: flex;
- flex-direction: column;
- gap: 12px;
- }
- .export-reference-box {
- cursor: pointer;
- transition: border-color 0.2s;
- flex: 1;
- }
- .export-reference-box:hover {
- border-color: #667eea;
- }
- .reference-upload-area {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- gap: 12px;
- color: #9ca3af;
- pointer-events: none;
- width: 100%;
- height: 100%;
- position: absolute;
- top: 0;
- left: 0;
- }
- .reference-upload-area.hide {
- display: none;
- }
- .upload-icon {
- font-size: 48px;
- font-weight: 300;
- color: #d1d5db;
- line-height: 1;
- }
- .upload-text {
- font-size: 14px;
- font-weight: 500;
- }
- .reference-image-wrapper {
- position: relative;
- width: 100%;
- height: 100%;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .reference-image {
- max-width: 100%;
- max-height: 100%;
- object-fit: contain;
- }
- .reference-remove-btn {
- position: absolute;
- top: 12px;
- right: 12px;
- width: 32px;
- height: 32px;
- border-radius: 50%;
- background: rgba(0, 0, 0, 0.6);
- backdrop-filter: blur(4px);
- border: none;
- color: white;
- cursor: pointer;
- display: flex;
- align-items: center;
- justify-content: center;
- transition: all 0.2s;
- z-index: 10;
- padding: 0;
- }
- .reference-remove-btn:hover {
- background: rgba(239, 68, 68, 0.9);
- transform: scale(1.1);
- box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
- }
- .reference-remove-btn:active {
- transform: scale(0.95);
- }
- .reference-remove-btn svg {
- width: 16px;
- height: 16px;
- }
- /* 替换按钮 */
- .replace-btn {
- padding: 10px 24px;
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
- color: white;
- border: none;
- border-radius: 8px;
- font-size: 14px;
- font-weight: 500;
- cursor: pointer;
- transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
- box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
- align-self: center;
- min-width: 100px;
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
- }
- .replace-btn:hover {
- box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
- transform: translateY(-1px);
- }
- .replace-btn:active {
- transform: translateY(0) scale(0.98);
- }
- .replace-btn:disabled {
- background: #d1d5db;
- color: #9ca3af;
- box-shadow: none;
- cursor: not-allowed;
- transform: none;
- }
- /* 右侧:Spritesheet 预览 */
- .export-spritesheet-box {
- background: repeating-conic-gradient(#f3f4f6 0% 25%, white 0% 50%) 50% / 20px 20px;
- }
- #previewImage {
- max-width: 100%;
- max-height: 100%;
- width: auto;
- height: auto;
- object-fit: contain;
- display: none;
- margin: auto;
- }
- #previewImage.show {
- display: block;
- }
- /* 悬浮下载按钮 - 右下角 */
- .floating-download-btn {
- position: absolute;
- bottom: 16px;
- right: 16px;
- width: 52px;
- height: 52px;
- border-radius: 50%;
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
- border: none;
- color: white;
- cursor: pointer;
- display: flex;
- align-items: center;
- justify-content: center;
- box-shadow:
- 0 8px 24px rgba(102, 126, 234, 0.4),
- 0 4px 12px rgba(0, 0, 0, 0.15);
- transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
- z-index: 100;
- padding: 0;
- overflow: hidden;
- }
- .floating-download-btn::before {
- content: '';
- position: absolute;
- top: 50%;
- left: 50%;
- width: 0;
- height: 0;
- border-radius: 50%;
- background: rgba(255, 255, 255, 0.2);
- transform: translate(-50%, -50%);
- transition: width 0.6s, height 0.6s;
- }
- .floating-download-btn:hover::before {
- width: 200px;
- height: 200px;
- }
- .floating-download-btn:hover {
- background: linear-gradient(135deg, #7c8ef0 0%, #8a5fb8 100%);
- box-shadow:
- 0 12px 32px rgba(102, 126, 234, 0.5),
- 0 6px 16px rgba(0, 0, 0, 0.2);
- transform: translateY(-3px) scale(1.08);
- }
- .floating-download-btn:active {
- background: linear-gradient(135deg, #5a6fd8 0%, #6a3d92 100%);
- transform: translateY(-1px) scale(1.03);
- box-shadow:
- 0 6px 20px rgba(102, 126, 234, 0.4),
- 0 4px 12px rgba(0, 0, 0, 0.15);
- }
- .floating-download-btn:disabled {
- opacity: 0.4;
- cursor: not-allowed;
- transform: none;
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
- background: linear-gradient(135deg, #d1d5db 0%, #9ca3af 100%);
- }
- .floating-download-btn svg {
- width: 22px;
- height: 22px;
- flex-shrink: 0;
- position: relative;
- z-index: 1;
- filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
- transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
- }
- .floating-download-btn:hover:not(:disabled) svg {
- transform: translateY(3px);
- }
- .floating-download-btn:active:not(:disabled) svg {
- transform: translateY(5px);
- }
- .preview-placeholder {
- position: absolute;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- gap: 16px;
- color: #9ca3af;
- }
- .preview-placeholder.hide {
- display: none;
- }
- .loading-spinner {
- width: 40px;
- height: 40px;
- border: 4px solid #e5e7eb;
- border-top-color: #667eea;
- border-radius: 50%;
- animation: spin 0.8s linear infinite;
- }
- .loading-text {
- font-size: 15px;
- font-weight: 500;
- color: #6b7280;
- }
- @keyframes spin {
- to {
- transform: rotate(360deg);
- }
- }
- /* 按钮区域 */
- .export-actions {
- padding: 20px 32px;
- display: flex;
- gap: 12px;
- justify-content: flex-end;
- align-items: center;
- flex-shrink: 0;
- border-top: 1px solid #e5e7eb;
- background: white;
- }
- .export-btn {
- padding: 12px 32px;
- border: none;
- border-radius: 10px;
- font-size: 15px;
- cursor: pointer;
- transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
- font-weight: 600;
- letter-spacing: 0.3px;
- min-width: 120px;
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .export-cancel {
- background: white;
- color: #374151;
- border: 2px solid #d1d5db;
- font-weight: 600;
- }
- .export-cancel:hover {
- background: #f9fafb;
- color: #1f2937;
- border-color: #9ca3af;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
- transform: translateY(-1px);
- }
- .export-cancel:active {
- transform: translateY(0) scale(0.98);
- box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
- }
- .export-confirm {
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
- color: white;
- box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
- }
- .export-confirm:hover {
- box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
- transform: translateY(-1px);
- }
- .export-confirm:active {
- transform: translateY(0) scale(0.98);
- }
- .export-confirm:disabled {
- background: #d1d5db;
- color: #9ca3af;
- box-shadow: none;
- cursor: not-allowed;
- transform: none;
- }
- .export-confirm svg {
- flex-shrink: 0;
- transition: transform 0.2s;
- }
- .export-confirm:hover:not(:disabled) svg {
- transform: translateY(2px);
- }
- .export-confirm:active:not(:disabled) svg {
- transform: translateY(4px);
- }
- /* 替换按钮 */
- .replace-btn {
- padding: 10px 24px;
- border: none;
- border-radius: 8px;
- font-size: 14px;
- cursor: pointer;
- transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
- font-weight: 500;
- letter-spacing: 0.3px;
- background: linear-gradient(135deg, #10b981 0%, #059669 100%);
- color: white;
- box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
- align-self: center;
- min-width: 120px;
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
- }
- .replace-btn:hover {
- box-shadow: 0 6px 16px rgba(16, 185, 129, 0.5);
- transform: translateY(-1px);
- }
- .replace-btn:active {
- transform: translateY(0) scale(0.98);
- }
- .replace-btn:disabled {
- background: #d1d5db;
- color: #9ca3af;
- box-shadow: none;
- cursor: not-allowed;
- transform: none;
- }
- /* 提示词配置区域 */
- .prompt-config-section {
- padding: 24px 32px;
- border-top: 1px solid #e5e7eb;
- border-bottom: 1px solid #e5e7eb;
- background: white;
- display: flex;
- flex-direction: column;
- gap: 20px;
- }
- .config-row {
- display: flex;
- flex-direction: column;
- gap: 8px;
- }
- .config-label-wrapper {
- display: flex;
- align-items: center;
- gap: 8px;
- }
- .config-label {
- font-size: 14px;
- font-weight: 500;
- color: #374151;
- }
- .download-icon-hint {
- display: flex;
- align-items: center;
- justify-content: center;
- width: 24px;
- height: 24px;
- cursor: pointer;
- opacity: 0.7;
- transition: all 0.2s;
- border-radius: 4px;
- padding: 2px;
- }
- .download-icon-hint:hover {
- opacity: 1;
- background: rgba(102, 126, 234, 0.1);
- transform: scale(1.1);
- }
- .download-icon-hint svg {
- width: 20px;
- height: 20px;
- }
- .config-input {
- padding: 10px 12px;
- border: 1px solid #d1d5db;
- border-radius: 6px;
- font-size: 14px;
- color: #1f2937;
- background: white;
- outline: none;
- transition: all 0.2s;
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
- }
- .config-input:focus {
- border-color: #667eea;
- box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
- }
- .config-textarea {
- padding: 10px 12px;
- border: 1px solid #d1d5db;
- border-radius: 6px;
- font-size: 14px;
- color: #1f2937;
- background: white;
- outline: none;
- transition: all 0.2s;
- resize: vertical;
- min-height: 80px;
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
- line-height: 1.5;
- }
- .config-textarea:focus {
- border-color: #667eea;
- box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
- }
- .prompt-actions {
- display: flex;
- justify-content: flex-end;
- align-items: center;
- gap: 12px;
- padding-top: 10px;
- }
- /* 操作按钮通用样式 */
- .action-btn {
- display: flex;
- align-items: center;
- justify-content: center;
- gap: 8px;
- padding: 12px 24px;
- border: none;
- border-radius: 10px;
- font-size: 15px;
- font-weight: 600;
- cursor: pointer;
- transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
- letter-spacing: 0.3px;
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
- position: relative;
- overflow: hidden;
- }
- .action-btn::before {
- content: '';
- position: absolute;
- top: 50%;
- left: 50%;
- width: 0;
- height: 0;
- border-radius: 50%;
- background: rgba(255, 255, 255, 0.3);
- transform: translate(-50%, -50%);
- transition: width 0.6s, height 0.6s;
- }
- .action-btn:hover::before {
- width: 300px;
- height: 300px;
- }
- .action-btn:hover {
- transform: translateY(-2px);
- box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
- }
- .action-btn:active {
- transform: translateY(0) scale(0.98);
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
- }
- .action-btn:disabled {
- opacity: 0.5;
- cursor: not-allowed;
- transform: none;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
- }
- .action-btn svg {
- width: 20px;
- height: 20px;
- flex-shrink: 0;
- transition: transform 0.3s;
- }
- .action-btn:hover svg {
- transform: scale(1.1);
- }
- /* 下载按钮 */
- .download-action-btn {
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
- color: white;
- box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
- }
- .download-action-btn:hover {
- box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
- background: linear-gradient(135deg, #7c8ef0 0%, #8a5fb8 100%);
- }
- .download-action-btn:active {
- background: linear-gradient(135deg, #5a6fd8 0%, #6a3d92 100%);
- }
- /* 替换按钮 */
- .replace-action-btn {
- background: linear-gradient(135deg, #10b981 0%, #059669 100%);
- color: white;
- box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
- }
- .replace-action-btn:hover {
- box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
- background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
- }
- .replace-action-btn:active {
- background: linear-gradient(135deg, #059669 0%, #047857 100%);
- }
- /* 响应式设计 */
- @media (max-width: 900px) {
- .export-modal {
- min-width: auto;
- width: 95%;
- }
-
- .export-preview-container {
- flex-direction: column;
- }
-
- .export-preview-box {
- min-height: 300px;
- }
- }
- /* 下载确认对话框 */
- .download-confirm-overlay {
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- width: 100%;
- height: 100%;
- background: rgba(0, 0, 0, 0.7);
- display: none; /* 默认隐藏 */
- align-items: center;
- justify-content: center;
- z-index: 10000000;
- backdrop-filter: blur(4px);
- animation: overlayFadeIn 0.3s ease-out;
- }
- .download-confirm-modal {
- background: white;
- border-radius: 16px;
- padding: 0;
- max-width: 600px;
- width: 90%;
- max-height: 90vh;
- overflow: hidden;
- box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
- animation: modalSlideIn 0.3s ease-out;
- }
- .download-confirm-header {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 24px;
- border-bottom: 1px solid #e5e7eb;
- }
- .download-confirm-header h3 {
- margin: 0;
- font-size: 20px;
- font-weight: 600;
- color: #111827;
- }
- .download-confirm-close {
- width: 36px;
- height: 36px;
- border-radius: 50%;
- background: #f3f4f6;
- border: none;
- color: #6b7280;
- cursor: pointer;
- display: flex;
- align-items: center;
- justify-content: center;
- transition: all 0.2s;
- padding: 0;
- }
- .download-confirm-close:hover {
- background: #e5e7eb;
- color: #374151;
- }
- .download-confirm-content {
- padding: 24px;
- display: flex;
- flex-direction: column;
- gap: 16px;
- }
- .download-option {
- display: flex;
- align-items: center;
- gap: 16px;
- padding: 20px;
- border: 2px solid #e5e7eb;
- border-radius: 12px;
- cursor: pointer;
- transition: all 0.2s;
- background: #f9fafb;
- }
- .download-option:hover {
- border-color: #667eea;
- background: #f0f4ff;
- transform: translateY(-2px);
- box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
- }
- .download-option-icon {
- font-size: 32px;
- flex-shrink: 0;
- }
- .download-option-info {
- flex: 1;
- }
- .download-option-title {
- font-size: 16px;
- font-weight: 600;
- color: #111827;
- margin-bottom: 4px;
- }
- .download-option-desc {
- font-size: 14px;
- color: #6b7280;
- line-height: 1.5;
- }
|