/** * 通用样式及动画库 * 提供全局共享的动画效果和特定功能组件样式 */ /* ========================================================================== 1. 关键帧动画 (Keyframes) ========================================================================== */ /* 输入框高亮闪烁 */ @keyframes inputHighlight { 0% { background-color: transparent; } 20% { background-color: rgba(93, 243, 146, 0.07); } 100% { background-color: transparent; } } /* 按钮呼吸效果 */ @keyframes buttonBreathing { 0% { transform: scale(1); box-shadow: 0 0 0 rgba(100, 100, 255, 0); } 50% { transform: scale(1.15); box-shadow: 0 0 8px rgba(100, 100, 255, 0.6); } 100% { transform: scale(1); box-shadow: 0 0 0 rgba(100, 100, 255, 0); } } /* 状态提示浮动消失 */ @keyframes tipFloatUp { 0% { opacity: 1; transform: translate(-50%, -100%) translateY(-8px); } 20% { opacity: 0.9; transform: translate(-50%, -100%) translateY(-15px); } 100% { opacity: 0; transform: translate(-50%, -100%) translateY(-40px); } } /* 状态提示缩放出现 */ @keyframes tipScaleIn { 0% { opacity: 0; transform: translate(-50%, -100%) translateY(-8px) scale(0.8); } 70% { opacity: 1; transform: translate(-50%, -100%) translateY(-8px) scale(1.05); } 100% { opacity: 1; transform: translate(-50%, -100%) translateY(-8px) scale(1); } } /* 淡入淡出组合 */ @keyframes clipFadeInUp { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } } @keyframes clipFadeInDown { from { opacity: 0; transform: translateY(10px) scale(1); } to { opacity: 1; transform: translateY(0) scale(1); } } @keyframes clipFadeOutUp { from { opacity: 1; transform: translateY(0) scale(1); } to { opacity: 0; transform: translateY(10px) scale(1); } } @keyframes clipFadeOutDown { from { opacity: 1; transform: translateY(0) scale(1); } to { opacity: 0; transform: translateY(-10px) scale(1); } } @keyframes clipFadeIn { from { opacity: 0; } to { opacity: 1; } } /* 标签内容渐显 */ @keyframes tagContentFadeIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } } /* 对话框入场 */ @keyframes dialogFadeIn { from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } } /* Loading 旋转 */ @keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } /* ========================================================================== 2. 通用工具类 (Utilities) ========================================================================== */ /* 应用高亮动画 */ .input-highlight { animation: inputHighlight 0.2s ease-out; background-color: transparent !important; /* 兜底:即使动画卡住,类名存在时也确保透明 */ will-change: background-color; /* 优化合成层渲染 */ } /* ========================================================================== 3. 标签组件样式 (Tag Components) ========================================================================== */ /* 标签内容包装器 (用于 tag.js) */ .tag_content_wrapper { width: 100%; height: 100%; opacity: 0; transition: opacity 0.2s ease-in-out, transform 0.2s ease-out; transform: translateY(-5px); } .tag_content_wrapper.visible { opacity: 1; transform: translateY(0); } /* ========================================================================== 4. 图像反推对话框 (Image Caption Dialog) ========================================================================== */ .image-assistant-copy-dialog { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background-color: var(--p-dialog-background); color: var(--p-text-muted-color); border-radius: 8px; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6); z-index: 10220; width: 400px; height: 300px; padding: 20px; font-family: var(--litegraph-font, Arial, sans-serif); animation: dialogFadeIn 0.2s ease-out; } /* 关闭按钮 */ .image-assistant-copy-dialog-close { position: absolute; top: 12px; right: 12px; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; background: none; border: none; border-radius: 12px; color: var(--p-button-text-secondary-color); cursor: pointer; transition: all 0.2s ease; } .image-assistant-copy-dialog-close:hover { background-color: rgba(255, 255, 255, 0.1); } .image-assistant-copy-dialog-close .svg-icon { width: 16px; height: 16px; } /* 对话框标题 */ .image-assistant-copy-dialog-title { font-size: 14px; font-weight: bold; line-height: 1.4; margin: 0 0 16px 0; padding-right: 30px; } /* 文本区域 */ .image-assistant-copy-dialog-textarea { width: 100%; height: 160px; padding: 12px; margin-bottom: 16px; box-sizing: border-box; background-color: var(--comfy-input-bg); color: var(--input-text); border: 1px solid var(--p-content-border-color); border-radius: 6px; font-family: var(--litegraph-font, Arial, sans-serif); font-size: 13px; line-height: 1.5; resize: none; outline: none; } .image-assistant-copy-dialog-textarea:focus { border-color: var(--p-primary-hover-color); box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2); } /* 复制按钮 */ .image-assistant-copy-dialog-copy-btn { display: block; margin: 0 auto; padding: 10px 24px; min-width: 120px; background-color: var(--p-primary-color); color: var(--p-button-primary-color); border: none; border-radius: 6px; font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.2s ease; } .image-assistant-copy-dialog-copy-btn:hover { background-color: var(--p-primary-hover-color); } .image-assistant-copy-dialog-copy-btn:active { background-color: var(--p-primary-hover-color); transform: translateY(0); box-shadow: 0 1px 4px rgba(74, 144, 226, 0.3); } /* ========================================================================== 5. Loading 组件 ========================================================================== */ .loading-container { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px; text-align: center; } .loading-spinner { width: 32px; height: 32px; border: 3px solid var(--p-divider-color); border-top-color: var(--p-primary-color); border-radius: 50%; margin-bottom: 12px; animation: spin 0.8s linear infinite; } .loading-text { font-size: 14px; color: var(--p-text-muted-color); margin-top: 8px; }