/** * NF Preview Selector - Floating Window Styles */ .nf-float { position: absolute; z-index: 999999; border: 2px solid #333; background-color: rgba(45, 45, 45, 0.95); border-radius: 8px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); min-width: 300px; max-width: 800px; min-height: 300px; /* Minimum height for proper layout */ font-family: Arial, sans-serif; resize: both; overflow: hidden; display: flex; flex-direction: column; } .nf-float.hidden { display: none; } .nf-float-header { width: 100%; text-align: center; background-color: rgba(70, 130, 180, 0.9); color: white; border-bottom: 1px solid #333; padding: 8px 12px; font-size: 14px; font-weight: bold; cursor: move; border-radius: 6px 6px 0 0; user-select: none; flex-shrink: 0; /* Don't shrink header */ } .nf-float-header:hover { background-color: rgba(70, 130, 180, 1); } .nf-float-body { padding: 12px; color: white; display: flex; flex-direction: column; gap: 8px; flex: 1; /* Take remaining space */ min-height: 0; /* Allow shrinking */ } /* Image Grid */ .nf-image-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(var(--min-column-width, 150px), 1fr)); gap: 8px; flex: 1; /* Take up remaining space */ overflow-y: auto; min-height: 0; /* Allow shrinking */ align-items: start; } /* Smart grid layout that adapts to content and window size */ .nf-image-grid.smart-grid-layout { display: grid; grid-template-columns: repeat(auto-fit, minmax(var(--min-column-width, 150px), 1fr)); gap: 8px; align-items: start; } /* ComfyUI-style layout with optimized calculations */ .nf-image-grid.comfyui-layout { display: grid; grid-template-columns: repeat(var(--max-columns, auto-fit), var(--min-column-width, 150px)); grid-template-rows: repeat(var(--max-rows, auto-fit), var(--cell-height, auto)); gap: 8px; align-items: center; justify-content: center; align-content: start; } .nf-image-container { position: relative; border: 2px solid transparent; border-radius: 4px; cursor: pointer; transition: border-color 0.2s; display: flex; align-items: center; justify-content: center; } /* ComfyUI-style image containers with fixed dimensions */ .nf-image-grid.comfyui-layout .nf-image-container { width: var(--min-column-width, 150px); height: var(--cell-height, 150px); } /* Responsive image containers */ .nf-image-grid.smart-grid-layout .nf-image-container { width: 100%; max-width: 100%; } .nf-image-container:hover { border-color: #70a0d0; } .nf-image-container.selected { border-color: #4CAF50; background-color: rgba(76, 175, 80, 0.1); } .nf-image { width: 100%; height: auto; display: block; border-radius: 2px; } /* ComfyUI-style images with fixed dimensions */ .nf-image-grid.comfyui-layout .nf-image { width: 100%; height: 100%; object-fit: contain; } .nf-image-overlay { position: absolute; top: 4px; right: 4px; background-color: rgba(0, 0, 0, 0.7); color: white; padding: 2px 6px; border-radius: 3px; font-size: 11px; } .nf-image-container.selected .nf-image-overlay { background-color: rgba(76, 175, 80, 0.9); } /* Controls */ .nf-controls { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-top: 1px solid #555; margin-top: auto; /* Push to bottom */ flex-shrink: 0; /* Don't shrink */ } .nf-selection-info { font-size: 12px; color: #ccc; } .nf-buttons { display: flex; gap: 8px; } .nf-button { padding: 6px 12px; border: none; border-radius: 4px; cursor: pointer; font-size: 12px; transition: background-color 0.2s; } .nf-button.primary { background-color: #4CAF50; color: white; } .nf-button.primary:hover { background-color: #45a049; } .nf-button.primary:disabled { background-color: #666; cursor: not-allowed; } .nf-button.secondary { background-color: #666; color: white; } .nf-button.secondary:hover { background-color: #777; } .nf-button.pin { background-color: #2196F3; color: white; padding: 8px 12px; min-width: 40px; font-size: 14px; } .nf-button.pin:hover { background-color: #1976D2; } .nf-button.pin.active { background-color: #FF9800; box-shadow: 0 0 8px rgba(255, 152, 0, 0.5); } .nf-button.pin.active:hover { background-color: #F57C00; } /* Countdown */ .nf-countdown { font-size: 11px; color: #ff9800; text-align: center; padding: 4px; } /* Waiting Message */ .nf-waiting-message { display: flex; align-items: center; justify-content: center; height: 200px; font-size: 16px; color: #888; text-align: center; font-style: italic; border: 2px dashed #666; border-radius: 8px; margin: 20px; } /* Max width is now configurable via settings */ /* v1.2.5: Expanded Image View System */ /* Full-screen overlay for expanded image view */ .nf-expanded-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background-color: rgba(0, 0, 0, 0.95); z-index: 1000000; display: none; justify-content: center; align-items: center; cursor: default; opacity: 0; transition: opacity 0.3s ease; } .nf-expanded-overlay.visible { display: flex; opacity: 1; } /* Main container for zoom and pan */ .nf-expanded-container { position: relative; width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; overflow: hidden; cursor: grab; } .nf-expanded-container.dragging { cursor: grabbing; } /* The actual expanded image */ .nf-expanded-image { max-width: 90vw; max-height: 90vh; object-fit: contain; user-select: none; pointer-events: auto; transform-origin: center; transition: transform 0.1s ease-out; } /* Navigation controls (close, prev, next) */ .nf-expanded-nav { position: absolute; top: 20px; right: 20px; display: flex; gap: 10px; z-index: 1000001; } .nf-expanded-nav button { width: 40px; height: 40px; border: none; border-radius: 50%; background-color: rgba(0, 0, 0, 0.7); color: white; font-size: 18px; font-weight: bold; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; user-select: none; } .nf-expanded-nav button:hover { background-color: rgba(0, 0, 0, 0.9); transform: scale(1.1); } .nf-expanded-nav button:active { transform: scale(0.95); } .nf-expanded-nav button:disabled { background-color: rgba(0, 0, 0, 0.3); color: rgba(255, 255, 255, 0.3); cursor: not-allowed; transform: none; } .nf-expanded-close { font-size: 24px !important; } /* Zoom controls */ .nf-zoom-controls { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; background-color: rgba(0, 0, 0, 0.8); padding: 10px 15px; border-radius: 25px; z-index: 1000001; } .nf-zoom-controls button { width: 35px; height: 35px; border: none; border-radius: 50%; background-color: rgba(255, 255, 255, 0.2); color: white; font-size: 18px; font-weight: bold; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; user-select: none; } .nf-zoom-controls button:hover { background-color: rgba(255, 255, 255, 0.3); transform: scale(1.05); } .nf-zoom-controls button:active { transform: scale(0.95); } /* Zoom level indicator */ .nf-zoom-level { color: white; font-size: 14px; font-weight: bold; min-width: 50px; text-align: center; user-select: none; } /* Image info display */ .nf-image-info { position: absolute; top: 20px; left: 20px; background-color: rgba(0, 0, 0, 0.8); color: white; padding: 10px 15px; border-radius: 8px; font-size: 14px; display: flex; gap: 15px; z-index: 1000001; } /* Help button */ .nf-help-button { position: absolute; bottom: 20px; right: 20px; width: 35px; height: 35px; border: none; border-radius: 50%; background-color: rgba(0, 0, 0, 0.8); color: white; font-size: 16px; font-weight: bold; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; z-index: 1000001; user-select: none; } .nf-help-button:hover { background-color: rgba(0, 0, 0, 0.9); transform: scale(1.05); } .nf-image-counter { font-weight: bold; } .nf-image-zoom { color: #4CAF50; } /* Mobile responsive adjustments */ @media (max-width: 768px) { .nf-expanded-nav { top: 10px; right: 10px; gap: 8px; } .nf-expanded-nav button { width: 35px; height: 35px; font-size: 16px; } .nf-zoom-controls { bottom: 10px; padding: 8px 12px; gap: 8px; } .nf-zoom-controls button { width: 32px; height: 32px; font-size: 16px; } .nf-zoom-level { font-size: 12px; min-width: 45px; } .nf-image-info { top: 10px; left: 10px; padding: 8px 12px; font-size: 12px; gap: 10px; } .nf-expanded-image { max-width: 95vw; max-height: 95vh; } .nf-help-button { bottom: 60px; right: 10px; width: 32px; height: 32px; font-size: 14px; } } /* Touch device adjustments */ @media (hover: none) { .nf-expanded-container { cursor: default; } .nf-expanded-nav button:hover { transform: none; background-color: rgba(0, 0, 0, 0.7); } .nf-zoom-controls button:hover { transform: none; background-color: rgba(255, 255, 255, 0.2); } .nf-help-button:hover { transform: none; background-color: rgba(0, 0, 0, 0.8); } } /* High DPI display optimizations */ @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) { .nf-expanded-image { image-rendering: -webkit-optimize-contrast; image-rendering: crisp-edges; } } /* Focus styles for accessibility */ .nf-expanded-overlay:focus { outline: none; } .nf-expanded-nav button:focus, .nf-zoom-controls button:focus, .nf-help-button:focus { outline: 2px solid #4CAF50; outline-offset: 2px; } /* Animation for smooth transitions */ .nf-expanded-overlay { backdrop-filter: blur(2px); } /* Ensure proper layering */ .nf-expanded-overlay * { box-sizing: border-box; }