browser / index.html
malcolmrey's picture
Upload 12 files
41da4ec verified
Raw History Blame Contribute Delete
153 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Mal's Models</title> <script type="text/javascript" src="data-civitai.js"></script> <script type="text/javascript" src="data-huggingface.js"></script> <script type="text/javascript" src="data-filenames.js"></script> <script type="text/javascript" src="data-hf-images.js"></script> <script type="text/javascript" src="data-thumbnails.js"></script> <script type="text/javascript" src="data-hf-uploaded.js"></script> <script type="text/javascript" src="data-huggingface-loras.js"></script> <script type="text/javascript" src="data-person-classifications.js"></script> <script type="text/javascript" src="data-person-tags.js"></script> <script type="text/javascript" src="data-person-urls.js"></script> <script type="text/javascript" src="comparator.js"></script> <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet"> <style> /* Theme CSS Variables */ :root { /* Dark theme (default) */ --bg-gradient-start: #0f172a; --bg-gradient-end: #1e293b; --text-primary: #f1f5f9; --text-secondary: #94a3b8; --text-muted: #64748b; --link-color: #60a5fa; --link-hover: #93c5fd; --card-bg: rgba(30, 41, 59, 0.7); --card-bg-solid: #1e293b; --card-border: rgba(148, 163, 184, 0.1); --input-bg: rgba(15, 23, 42, 0.6); --input-border: rgba(148, 163, 184, 0.2); --input-text: #e2e8f0; --hover-bg: rgba(96, 165, 250, 0.2); --modal-overlay: rgba(0, 0, 0, 0.8); --shadow-color: rgba(0, 0, 0, 0.3); --accent-blue: #60a5fa; --accent-purple: #a78bfa; } [data-theme="light"] { --bg-gradient-start: #f8fafc; --bg-gradient-end: #e2e8f0; --text-primary: #1e293b; --text-secondary: #475569; --text-muted: #64748b; --link-color: #2563eb; --link-hover: #1d4ed8; --card-bg: rgba(255, 255, 255, 0.9); --card-bg-solid: #ffffff; --card-border: rgba(148, 163, 184, 0.3); --input-bg: rgba(255, 255, 255, 0.8); --input-border: rgba(148, 163, 184, 0.4); --input-text: #1e293b; --hover-bg: rgba(37, 99, 235, 0.1); --modal-overlay: rgba(0, 0, 0, 0.5); --shadow-color: rgba(0, 0, 0, 0.1); --accent-blue: #2563eb; --accent-purple: #7c3aed; } * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%); color: var(--text-primary); min-height: 100vh; padding: 20px; transition: background 0.3s ease, color 0.3s ease; } a { text-decoration: none; color: var(--link-color); transition: color 0.2s; } a:hover { color: var(--link-hover); } .header { max-width: 1400px; margin: 0 auto 30px; background: var(--card-bg); backdrop-filter: blur(10px); border-radius: 16px; padding: 24px; box-shadow: 0 8px 32px var(--shadow-color); border: 1px solid var(--card-border); transition: background 0.3s ease, border-color 0.3s ease; } .header-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 16px; flex-wrap: wrap; } .header h1 { font-size: 28px; font-weight: 700; margin: 0; background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; } .profile-links { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 8px 12px; background: var(--input-bg); border-radius: 8px; transition: background 0.3s ease; } .profile-links a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; background: rgba(96, 165, 250, 0.1); border-radius: 6px; font-size: 14px; transition: all 0.2s; } .profile-links a:hover { background: rgba(96, 165, 250, 0.2); transform: translateY(-1px); } .last-update { text-align: center; font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; } .controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center; } .search-container { flex: 1 1 auto; min-width: 300px; max-width: 600px; position: relative; } .search-container input[type="text"] { width: 100%; padding: 12px 16px; padding-right: 100px; background: var(--input-bg); border: 2px solid var(--input-border); border-radius: 12px; color: var(--input-text); font-size: 15px; font-family: inherit; transition: all 0.3s; } .search-container input[type="text"]:focus { outline: none; border-color: var(--accent-blue); background: var(--input-bg); box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.1); } .search-container input[type="text"]::placeholder { color: var(--text-muted); } .clear-btn { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); padding: 6px 14px; background: rgba(239, 68, 68, 0.2); border: 1px solid rgba(239, 68, 68, 0.3); border-radius: 8px; color: #fca5a5; font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.2s; } .clear-btn:hover { background: rgba(239, 68, 68, 0.3); color: #fecaca; } .mode-select { padding: 12px 40px 12px 16px; background: var(--input-bg); border: 2px solid var(--input-border); border-radius: 12px; color: var(--input-text); font-size: 15px; font-family: inherit; cursor: pointer; transition: all 0.3s; font-weight: 500; height: 48px; line-height: 20px; min-width: 150px; flex-shrink: 0; appearance: none; -webkit-appearance: none; -moz-appearance: none; background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 12px center; background-size: 20px; box-shadow: none; outline: none; } .mode-select::-ms-expand { display: none; } .mode-select:focus { outline: none; border-color: var(--accent-blue); box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.1); } .mode-select option { background: var(--card-bg-solid); color: var(--input-text); padding: 16px 20px; font-size: 15px; font-weight: 500; border: none; outline: none; } .mode-select option:hover { background: linear-gradient(90deg, rgba(96, 165, 250, 0.15) 0%, rgba(96, 165, 250, 0.05) 100%); color: var(--accent-blue); font-weight: 600; } .mode-select option:checked, .mode-select option:focus { background: linear-gradient(90deg, rgba(96, 165, 250, 0.25) 0%, rgba(96, 165, 250, 0.15) 100%); color: #93c5fd; font-weight: 600; box-shadow: none; outline: none; } .checkbox-group { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; } .checkbox-label { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--input-bg); border: 2px solid var(--input-border); border-radius: 10px; cursor: pointer; transition: all 0.2s; font-size: 14px; font-weight: 500; user-select: none; } .checkbox-label:hover { background: var(--hover-bg); border-color: var(--input-border); } .checkbox-label input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; accent-color: var(--accent-blue); } .checkbox-label input[type="checkbox"]:checked + span { color: var(--accent-blue); } .filter-section { display: flex; flex-direction: column; gap: 8px; align-items: center; } .filter-section + .filter-section { margin-top: 4px; padding-top: 16px; border-top: 1px solid var(--card-border); width: 100%; } .filter-section-label { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); } .filter-section-toggle { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; background: transparent; border: none; cursor: pointer; font-family: inherit; transition: color 0.2s; } .filter-section-toggle:hover { color: var(--accent-blue); } .filter-section-toggle:hover .filter-section-label { color: var(--accent-blue); } .filter-tags-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; background: var(--accent-blue); color: #fff; border-radius: 10px; font-size: 12px; font-weight: 700; } .filter-section-chevron { color: var(--text-muted); transition: transform 0.2s; font-size: 12px; } .filter-section-toggle.expanded .filter-section-chevron { transform: rotate(90deg); } .stats-bar { display: flex; align-items: center; gap: 12px; padding: 12px 20px; background: var(--input-bg); border-radius: 10px; font-size: 14px; font-weight: 600; flex-shrink: 0; transition: background 0.3s ease; } .stats-bar label { color: var(--text-secondary); } .stats-bar input { width: 70px; padding: 6px 10px; background: var(--card-bg); border: 1px solid var(--input-border); border-radius: 6px; color: var(--accent-blue); text-align: center; font-weight: 700; font-size: 16px; } .multi-lora-toggle-wrap { display: flex; align-items: center; gap: 8px; } .multi-lora-toggle-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 36px; padding: 0; background: var(--input-bg); border: 2px solid var(--input-border); border-radius: 10px; cursor: pointer; transition: all 0.2s; position: relative; font-size: 20px; } .multi-lora-toggle-btn:hover { background: var(--hover-bg); border-color: var(--accent-blue); } .multi-lora-toggle-btn.active { background: rgba(96, 165, 250, 0.2); border-color: var(--accent-blue); } .multi-lora-toggle-btn .multi-lora-icon { position: absolute; transition: opacity 0.2s; } .multi-lora-toggle-btn .multi-lora-icon.off { opacity: 1; } .multi-lora-toggle-btn .multi-lora-icon.on { opacity: 0; } .multi-lora-toggle-btn.active .multi-lora-icon.off { opacity: 0; } .multi-lora-toggle-btn.active .multi-lora-icon.on { opacity: 1; } .mainContent { max-width: 1400px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; padding: 0 4px; } .hf-loras-section { display: none; max-width: 1400px; margin: 0 auto 24px; padding: 0 4px; } .hf-loras-section.active { display: block; } .hf-loras-section-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; } .hf-loras-section-header h2 { font-size: 18px; margin: 0; color: var(--text-primary); } .hf-loras-summary { color: var(--text-secondary); font-size: 13px; } .hf-loras-search-container { position: relative; flex: 1 1 220px; min-width: 180px; max-width: 400px; } .hf-loras-search-input { width: 100%; padding: 10px 90px 10px 14px; background: var(--input-bg); border: 2px solid var(--input-border); border-radius: 10px; color: var(--input-text); font-size: 14px; font-family: inherit; transition: all 0.3s; } .hf-loras-search-input:focus { outline: none; border-color: var(--accent-blue); box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.1); } .hf-loras-repo-link { font-size: 20px; line-height: 1; text-decoration: none; opacity: 0.7; transition: opacity 0.2s, transform 0.2s; } .hf-loras-repo-link:hover { opacity: 1; transform: scale(1.15); } #hfLorasPaginationTop, #hfLorasPaginationBottom { justify-content: space-between; } .hf-loras-pager-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .hf-loras-page-size-label { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 13px; } .hf-loras-search-input::placeholder { color: var(--text-muted); } .hf-loras-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; } .hf-lora-card { background: var(--card-bg); backdrop-filter: blur(10px); border-radius: 16px; overflow: hidden; border: 1px solid var(--card-border); box-shadow: 0 4px 16px var(--shadow-color); display: flex; flex-direction: column; } .hf-lora-card-name { padding: 10px 12px; font-weight: 600; font-size: 13px; color: var(--input-text); border-bottom: 1px solid var(--card-border); background: var(--input-bg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .hf-lora-card-image { position: relative; width: 100%; padding-top: 100%; background: var(--input-bg); overflow: hidden; } .hf-lora-card-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; } .hf-lora-no-sample { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 12px; } .hf-lora-card-footer { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; font-size: 11px; color: var(--text-secondary); gap: 8px; } .hf-lora-card-footer a { color: var(--link-color); text-decoration: none; } .hf-lora-card-footer a:hover { color: var(--link-hover); } .hf-loras-empty { color: var(--text-muted); font-size: 13px; padding: 16px 0; } .element { background: var(--card-bg); backdrop-filter: blur(10px); border-radius: 16px; overflow: hidden; border: 1px solid var(--card-border); transition: all 0.3s; box-shadow: 0 4px 16px var(--shadow-color); display: flex; flex-direction: column; cursor: pointer; } .element:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4); border-color: rgba(96, 165, 250, 0.3); } .model-name-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; background: var(--input-bg); border-bottom: 1px solid var(--card-border); gap: 8px; } .element .modelName { font-weight: 600; font-size: 14px; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; color: var(--input-text); flex: 1; min-width: 0; } .google-search-icon, .copy-link-icon, .profile-link-icon { font-size: 14px; text-decoration: none; opacity: 0.6; transition: all 0.2s; cursor: pointer; flex-shrink: 0; } .google-search-icon:hover, .copy-link-icon:hover, .profile-link-icon:hover { opacity: 1; transform: scale(1.2); } .copy-link-icon.copied { opacity: 1; color: #4caf50; } .model-calendar-icon { font-size: 14px; cursor: help; opacity: 0.7; transition: opacity 0.2s; flex-shrink: 0; } .model-calendar-icon:hover { opacity: 1; } .element .imageContainer { position: relative; width: 100%; padding-top: 137.5%; /* 192/264 aspect ratio */ overflow: hidden; background: var(--input-bg); } .download-tooltip { position: absolute; left: 50%; top: 12px; transform: translate(-50%, -8px); background: rgba(15, 23, 42, 0.9); color: var(--text-primary); padding: 6px 10px; border-radius: 6px; font-size: 12px; line-height: 1.3; white-space: nowrap; opacity: 0; pointer-events: none; border: 1px solid var(--card-border); transition: opacity 0.2s, transform 0.2s; z-index: 10; max-width: 90%; text-overflow: ellipsis; overflow: hidden; z-index: 12; } .download-btn:hover + .download-tooltip, .download-btn:focus-visible + .download-tooltip { opacity: 1; transform: translate(-50%, 0); } .element .imageContainer img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; } .element .imageContainer .download-btn { position: absolute; right: 8px; bottom: 8px; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 6px; background: rgba(15, 23, 42, 0.75); border: 1px solid var(--card-border); color: var(--text-primary); text-decoration: none; font-size: 14px; opacity: 0; transform: translateY(2px); transition: opacity 0.2s, transform 0.2s, background 0.2s; z-index: 5; } .element:hover .imageContainer .download-btn { opacity: 1; transform: translateY(0); } .element .imageContainer .download-btn:hover { background: rgba(96, 165, 250, 0.25); } .image-viewer .download-btn { position: absolute; right: 14px; bottom: 14px; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: rgba(15, 23, 42, 0.75); border: 1px solid var(--card-border); color: var(--text-primary); font-size: 16px; cursor: pointer; opacity: 0.9; transition: opacity 0.2s, transform 0.2s, background 0.2s; z-index: 6; } .image-info .download-btn { position: static; width: 26px; height: 26px; margin-left: 6px; background: rgba(15, 23, 42, 0.6); border: 1px solid rgba(255, 255, 255, 0.08); font-size: 13px; opacity: 1; transform: none; border-radius: 6px; display: flex; align-items: center; justify-content: center; } .image-info .download-btn:hover, .image-info .download-btn:focus-visible { background: rgba(96, 165, 250, 0.25); border-color: rgba(96, 165, 250, 0.45); } .image-viewer .download-btn:hover { opacity: 1; transform: translateY(-2px); background: rgba(96, 165, 250, 0.25); } .element:hover .imageContainer img { transform: scale(1.05); } .statsBox { padding: 16px; background: var(--input-bg); font-size: 13px; line-height: 1.8; flex: 1; display: none; /* Hidden in main view */ } .statsBox .stat-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; } .statsBox .stat-row:last-child { margin-bottom: 0; } .statsBox .stat-label { font-weight: 600; color: var(--text-muted); min-width: 75px; } .statsBox .stat-value { display: flex; align-items: center; gap: 6px; } /* Modal Styles */ .modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: var(--modal-overlay); backdrop-filter: blur(8px); z-index: 1000; align-items: center; justify-content: center; padding: 20px; animation: fadeIn 0.2s ease-out; } .modal-overlay.active { display: flex; } .modal-content { background: linear-gradient(135deg, var(--bg-gradient-end) 0%, var(--bg-gradient-start) 100%); border-radius: 20px; max-width: 1100px; width: 100%; max-height: 90vh; overflow: hidden; position: relative; border: 2px solid var(--card-border); box-shadow: 0 20px 60px var(--shadow-color); animation: slideUp 0.3s ease-out; display: flex; flex-direction: column; transition: background 0.3s ease, border-color 0.3s ease; } @keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } } .modal-header { padding: 24px; border-bottom: 1px solid var(--card-border); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: var(--card-bg); backdrop-filter: blur(10px); z-index: 10; transition: background 0.3s ease, border-color 0.3s ease; } .modal-title { font-size: 24px; font-weight: 700; color: var(--text-primary); margin: 0; } .modal-close { width: 36px; height: 36px; border-radius: 10px; background: rgba(239, 68, 68, 0.2); border: 1px solid rgba(239, 68, 68, 0.3); color: #fca5a5; font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; font-weight: 700; } .modal-close:hover { background: rgba(239, 68, 68, 0.3); color: #fecaca; transform: rotate(90deg); } .modal-body { display: flex; flex: 1; overflow: hidden; gap: 0; } .modal-left { flex: 0 0 45%; display: flex; align-items: center; justify-content: center; background: var(--input-bg); padding: 24px; transition: background 0.3s ease; } .modal-image-container { width: 100%; border-radius: 12px; overflow: hidden; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); max-height: 100%; position: relative; } .modal-image-container img { width: 100%; height: auto; display: block; } .modal-right { flex: 1; padding: 24px; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: 16px; } .modal-stats { display: grid; gap: 12px; } .modal-stat-row { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; background: var(--input-bg); border-radius: 12px; border: 1px solid var(--card-border); transition: all 0.2s; } /* Reduce margins in Details & Downloads for mobile */ @media (max-width: 768px) { .modal-stat-row { padding: 12px 14px; } .modal-right { padding: 16px; } } .modal-stat-row:hover { background: var(--hover-bg); border-color: var(--card-border); } .modal-stat-label { font-weight: 600; font-size: 15px; color: var(--text-secondary); display: flex; align-items: center; gap: 8px; } .modal-stat-value { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; } .modal-hf-links-container { display: flex; flex-direction: column; gap: 6px; margin-left: 8px; } .modal-hf-link { padding: 6px 12px; background: rgba(255, 107, 0, 0.15); border: 1px solid rgba(255, 107, 0, 0.3); border-radius: 8px; font-size: 12px; font-weight: 600; color: #ff9d5c; transition: all 0.2s; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; } .modal-hf-link:hover { background: rgba(255, 107, 0, 0.25); border-color: rgba(255, 107, 0, 0.5); transform: translateY(-1px); color: #ffb380; } .modal-hf-placeholder { padding: 6px 12px; background: var(--input-bg); border: 1px solid var(--card-border); border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--text-muted); display: inline-flex; align-items: center; gap: 6px; opacity: 0.5; } .hf-logo { width: 16px; height: 16px; display: inline-block; } @media (max-width: 900px) { .modal-body { flex-direction: column; } .modal-left { flex: 0 0 auto; /* max-height: 400px; - Removed limit for better view */ padding: 4px; /* Reduced padding here too */ } .modal-right { flex: 1; } } .status-icon { font-size: 16px; display: inline-block; } .status-available { color: #4ade80; } .status-unavailable { color: #f87171; } .status-unknown { color: #fbbf24; } .hf-link { padding: 2px 8px; background: rgba(96, 165, 250, 0.1); border: 1px solid rgba(96, 165, 250, 0.2); border-radius: 6px; font-size: 11px; font-weight: 600; color: var(--accent-blue); transition: all 0.2s; display: inline-block; } .hf-link:hover { background: rgba(96, 165, 250, 0.2); border-color: rgba(96, 165, 250, 0.4); } @media (max-width: 768px) { .controls { flex-direction: column; align-items: stretch; } .search-container { min-width: 0; /* Allow shrinking below 300px to prevent overflow */ } .checkbox-group { justify-content: center; } .mainContent { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; } } /* Loading animation */ @keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } } .element { animation: fadeIn 0.4s ease-out; } /* Scrollbar styling */ ::-webkit-scrollbar { width: 12px; } ::-webkit-scrollbar-track { background: var(--input-bg); } ::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.3); border-radius: 6px; } ::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.5); } /* Image viewer with navigation */ .image-viewer { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; } .modal-image { max-width: 100%; max-height: 70vh; object-fit: contain; border-radius: 8px; } .image-nav-arrow { position: absolute; top: 50%; transform: translateY(-50%); background: var(--card-bg-solid); border: 2px solid var(--input-border); color: var(--accent-blue); font-size: 48px; font-weight: bold; width: 60px; height: 60px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.3s ease; z-index: 10; line-height: 1; padding: 0; user-select: none; } .image-nav-arrow:hover { background: rgba(96, 165, 250, 0.3); border-color: var(--accent-blue); color: var(--link-hover); transform: translateY(-50%) scale(1.1); box-shadow: 0 0 20px rgba(96, 165, 250, 0.5); } .image-nav-arrow:active { transform: translateY(-50%) scale(0.95); } .image-nav-prev { left: 10px; } .image-nav-next { right: 10px; } .image-info { display: flex; justify-content: flex-start; align-items: center; margin-top: 12px; padding: 8px 12px; background: var(--input-bg); border-radius: 8px; gap: 12px; } .image-counter { font-size: 14px; font-weight: 500; color: var(--text-muted); } .framework-label { font-size: 13px; font-weight: 600; padding: 4px 12px; border-radius: 12px; background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%); color: #fff; text-transform: uppercase; letter-spacing: 0.5px; box-shadow: 0 2px 8px rgba(96, 165, 250, 0.3); margin-left: auto; } .framework-label[data-framework="WAN"] { background: linear-gradient(135deg, #dc2626 0%, #f59e0b 100%); } .framework-label[data-framework="LyCORIS"] { background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%); } .framework-label[data-framework="Lora"] { background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%); } .framework-label[data-framework="Embedding"] { background: linear-gradient(135deg, #92400e 0%, #f59e0b 100%); } .framework-label[data-framework="Qwen"] { background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%); } .framework-label[data-framework="Flux"] { background: linear-gradient(135deg, #7c3aed 0%, #c026d3 100%); } .framework-label[data-framework="Klein9"] { background: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%); } .framework-label[data-framework="SDXL"] { background: linear-gradient(135deg, #65a30d 0%, #84cc16 100%); } .framework-label[data-framework="ZImage"] { background: linear-gradient(135deg, #e11d48 0%, #fb7185 100%); } .framework-label[data-framework="ZBase"] { background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%); } .framework-label[data-framework="Thumbnail"] { background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%); color: #1e293b; } .framework-label[data-framework="LTX"] { background: linear-gradient(135deg, #0369a1 0%, #22d3ee 100%); } .framework-label[data-framework="Ernie"] { background: linear-gradient(135deg, #be185d 0%, #f472b6 100%); } .framework-label[data-framework="Ideogram4"] { background: linear-gradient(135deg, #d97706 0%, #fbbf24 100%); } .framework-label[data-framework="Krea2"] { background: linear-gradient(135deg, #059669 0%, #34d399 100%); } .framework-label[data-framework="MinimaxH3"] { background: linear-gradient(135deg, #4338ca 0%, #818cf8 100%); } /* Pagination Controls */ .pagination-controls { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 24px; margin-bottom: 16px; flex-wrap: wrap; } .pagination-btn { padding: 10px 16px; background: var(--input-bg); border: 2px solid var(--input-border); border-radius: 10px; color: var(--text-primary); font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.2s; } .pagination-btn:hover:not(:disabled) { background: var(--hover-bg); border-color: var(--accent-blue); } .pagination-btn:disabled { opacity: 0.5; cursor: not-allowed; } .pagination-info { padding: 10px 20px; background: var(--input-bg); border-radius: 10px; color: var(--text-muted); font-size: 14px; font-weight: 500; } /* Sorting and Page Size Controls */ .advanced-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center; margin-top: 12px; } .control-group { display: flex; align-items: center; gap: 8px; } .control-label { color: var(--text-muted); font-size: 13px; font-weight: 500; } .control-select { padding: 8px 32px 8px 12px; background: var(--input-bg); border: 2px solid var(--input-border); border-radius: 8px; color: var(--text-primary); font-size: 13px; font-family: inherit; cursor: pointer; transition: all 0.2s; appearance: none; background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 8px center; background-size: 16px; } .control-select:focus { outline: none; border-color: var(--accent-blue); } .control-select option { background: var(--card-bg-solid); color: var(--input-text); } .updates-group { display: flex; align-items: center; gap: 12px; } .last-update-inline { font-size: 12px; color: var(--text-secondary); padding: 6px 12px; background: var(--input-bg); border-radius: 8px; border: 1px solid var(--input-border); white-space: nowrap; transition: all 0.3s ease; } /* Theme Toggle Button */ .theme-toggle { position: fixed; top: 20px; right: 20px; width: 44px; height: 44px; border-radius: 50%; background: var(--card-bg); border: 2px solid var(--card-border); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 20px; transition: all 0.3s ease; z-index: 1000; box-shadow: 0 4px 12px var(--shadow-color); } .theme-toggle:hover { transform: scale(1.1); border-color: var(--accent-blue); } .samples-toggle { position: fixed; top: 20px; right: 72px; width: 44px; height: 44px; border-radius: 50%; background: var(--card-bg); border: 2px solid var(--card-border); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 18px; transition: all 0.3s ease; z-index: 1000; box-shadow: 0 4px 12px var(--shadow-color); } .samples-toggle:hover { transform: scale(1.1); border-color: var(--accent-blue); } .samples-toggle .samples-on-icon { display: block; } .samples-toggle .samples-off-icon { display: none; } [data-samples="off"] .samples-toggle .samples-on-icon { display: none; } [data-samples="off"] .samples-toggle .samples-off-icon { display: block; } .theme-toggle .sun-icon { display: none; } .theme-toggle .moon-icon { display: block; } [data-theme="light"] .theme-toggle .sun-icon { display: block; } [data-theme="light"] .theme-toggle .moon-icon { display: none; } .theme-toggle, .samples-toggle { /* ... existing styles ... */ transition: all 0.3s ease, opacity 0.3s ease, transform 0.3s ease; } .floating-hidden { opacity: 0; pointer-events: none; transform: scale(0.8); } .daily-uploads-btn { padding: 10px 20px; background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%); border: none; border-radius: 10px; color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; gap: 8px; } .daily-uploads-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(245, 158, 11, 0.3); } /* Daily Uploads Modal */ .daily-modal-content { max-width: 900px; max-height: 80vh; } .daily-modal-body { padding: 24px; overflow-y: auto; max-height: calc(80vh - 100px); } .daily-date-selector { margin-bottom: 20px; } .daily-date-select { width: 100%; padding: 14px 40px 14px 16px; background: var(--input-bg); border: 2px solid var(--input-border); border-radius: 12px; color: var(--input-text); font-size: 16px; font-family: inherit; cursor: pointer; appearance: none; background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 12px center; background-size: 20px; transition: all 0.3s ease; } .daily-date-select:focus { outline: none; border-color: var(--accent-blue); } .daily-date-select option { background: var(--card-bg-solid); color: var(--input-text); } .daily-uploads-list { display: grid; gap: 12px; } .daily-upload-item { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; background: var(--input-bg); border-radius: 12px; border: 1px solid var(--card-border); transition: all 0.2s; } .daily-upload-item:hover { background: var(--hover-bg); border-color: var(--card-border); } .daily-upload-person { font-weight: 600; color: var(--text-primary); font-size: 15px; } .daily-upload-person-row { display: flex; align-items: center; gap: 8px; } .person-modal-link { font-size: 14px; opacity: 0.6; transition: all 0.2s; cursor: pointer; display: flex; align-items: center; justify-content: center; text-decoration: none; } .person-modal-link:hover { opacity: 1; transform: scale(1.2); } .daily-upload-models { display: flex; flex-wrap: wrap; gap: 8px; } .daily-upload-model { padding: 4px 10px; background: rgba(96, 165, 250, 0.2); border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--accent-blue); text-transform: uppercase; text-decoration: none; cursor: pointer; transition: all 0.15s ease; } .daily-upload-model:hover { transform: translateY(-2px); filter: brightness(1.2); text-decoration: underline; } .daily-upload-model[data-type="wan"] { background: rgba(220, 38, 38, 0.22); color: #fdba74; } .daily-upload-model[data-type="flux"] { background: rgba(124, 58, 237, 0.22); color: #e9d5ff; } .daily-upload-model[data-type="klein9"] { background: rgba(234, 179, 8, 0.22); color: #fde047; } .daily-upload-model[data-type="ernie"] { background: rgba(190, 24, 93, 0.22); color: #f9a8d4; } .daily-upload-model[data-type="krea2"] { background: rgba(5, 150, 105, 0.22); color: #6ee7b7; } .daily-upload-model[data-type="minimaxh3"] { background: rgba(67, 56, 202, 0.22); color: #a5b4fc; } .daily-upload-model[data-type="sdxl"] { background: rgba(101, 163, 13, 0.22); color: #d9f99d; } .daily-upload-model[data-type="zimage"] { background: rgba(225, 29, 72, 0.22); color: #fda4af; } .daily-upload-model[data-type="zbase"] { background: rgba(15, 118, 110, 0.22); color: #99f6e4; } .daily-upload-model[data-type="qwen"] { background: rgba(2, 132, 199, 0.22); color: #bae6fd; } .daily-upload-model[data-type="lora"] { background: rgba(59, 130, 246, 0.2); color: #93c5fd; } .daily-upload-model[data-type="locon"] { background: rgba(20, 184, 166, 0.2); color: #5eead4; } .daily-upload-model[data-type="embedding"] { background: rgba(249, 115, 22, 0.2); color: #fdba74; } .no-uploads-message { text-align: center; padding: 40px; color: var(--text-secondary); font-size: 15px; } .daily-stats { padding: 16px; background: var(--input-bg); border-radius: 10px; margin-bottom: 16px; display: flex; justify-content: center; gap: 24px; transition: background 0.3s ease; } .daily-stat { text-align: center; } .daily-stat-value { font-size: 24px; font-weight: 700; color: var(--accent-blue); } .daily-stat-label { font-size: 12px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; } /* Base Overlay Styles for Page View */ .base-overlay { position: absolute; top: 8px; right: 8px; background: rgba(0, 0, 0, 0.35); backdrop-filter: blur(4px); padding: 6px 10px; border-radius: 6px; color: rgba(255, 255, 255, 0.85); font-size: 10px; font-weight: 500; max-width: 180px; max-height: 200px; overflow-y: auto; text-align: right; line-height: 1.3; z-index: 5; border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); } .base-overlay::-webkit-scrollbar { width: 3px; } .base-overlay::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.3); border-radius: 2px; } .base-overlay-item { display: block; margin-bottom: 2px; text-transform: uppercase; letter-spacing: 0.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: rgba(255, 255, 255, 0.85); text-decoration: none; transition: all 0.2s ease; } .base-overlay-item:hover { color: #fff; text-decoration: underline; filter: brightness(1.2); } .base-overlay-item:last-child { margin-bottom: 0; } /* Date header for daily sorting */ .date-header { grid-column: 1 / -1; margin: 20px 0 10px; padding: 12px 16px; background: var(--card-bg); border-radius: 12px; border-left: 4px solid var(--accent-blue); font-weight: 600; color: var(--accent-blue); font-size: 16px; box-shadow: 0 2px 8px var(--shadow-color); } /* Mobile Responsive Adjustments */ @media (max-width: 768px) { .header-title-row { flex-direction: column; align-items: stretch; gap: 8px; } .header h1 { text-align: center; margin-bottom: 4px; } .link-text { display: none; } .profile-links { justify-content: flex-start; width: 100%; gap: 6px; /* Closer gap */ padding: 4px; flex-wrap: nowrap; /* FORCE single row */ overflow-x: auto; /* Hide scrollbar */ scrollbar-width: none; -ms-overflow-style: none; } .profile-links::-webkit-scrollbar { display: none; } .profile-links a { padding: 6px 8px; justify-content: center; flex: 0 0 auto; font-size: 18px; /* Larger icon */ } .advanced-toggle-btn { display: flex !important; margin-left: auto !important; /* Push to right */ flex: 0 0 40px; width: 40px; height: 38px; /* Match link height */ border-radius: 6px; min-width: 0 !important; padding: 0 !important; background-image: none !important; } .advanced-options-container { display: none; width: 100%; flex-direction: column; gap: 12px; } .advanced-options-container.active { display: flex; flex-direction: column; } .modal-mobile-tabs { display: flex !important; } .modal-body { flex-direction: column; } .modal-left, .modal-right { display: none; width: 100%; flex: 1; } .modal-left.active { display: flex; padding: 0; background: transparent; } .modal-right.active { display: flex; flex-direction: column; padding: 10px; /* Reduced padding */ } .modal-image-container { border-radius: 0; box-shadow: none; } /* Compact modal stats for mobile */ .modal-stat-row { min-height: 36px; gap: 8px; } .modal-stat-label { font-size: 13px; min-width: auto; /* Allow shrinking */ white-space: nowrap; } .modal-stat-value { flex: 1; justify-content: flex-end; flex-wrap: wrap; } .modal-hf-link { padding: 3px 8px; font-size: 11px; height: 24px; } .modal-hf-links-container { align-items: flex-end; /* Align links to right */ } .modal-overlay { padding: 0 !important; } .modal-content { max-height: 100dvh; /* Dynamic viewport height */ height: 100dvh; border-radius: 0; border: none; } .modal-header { padding: 12px 16px; flex-shrink: 0; } .modal-title { font-size: 18px; } } .advanced-toggle-btn { display: none; /* Hidden on desktop by default */ width: 44px; height: 44px; /* Match link height approximately */ min-width: 0 !important; /* Override mode-select min-width */ padding: 0 !important; /* Override mode-select padding */ border-radius: 8px; /* Match links */ background: var(--input-bg); border: 1px solid var(--input-border); color: var(--text-secondary); font-size: 20px; cursor: pointer; align-items: center; justify-content: center; transition: all 0.2s; box-shadow: none; appearance: none; background-image: none !important; /* Remove arrow icon from mode-select */ } .advanced-toggle-btn:hover, .advanced-toggle-btn.active { background: var(--hover-bg); border-color: var(--accent-blue); color: var(--accent-blue); } /* Display is controlled inline via JS (hidden until repo data exists), not by this rule. */ .hf-loras-toggle-btn { width: 44px; height: 44px; /* Match link height approximately */ min-width: 0 !important; /* Override mode-select min-width */ padding: 0 !important; /* Override mode-select padding */ border-radius: 8px; /* Match links */ background: var(--input-bg); border: 1px solid var(--input-border); color: var(--text-secondary); font-size: 20px; cursor: pointer; align-items: center; justify-content: center; transition: all 0.2s; box-shadow: none; appearance: none; background-image: none !important; /* Remove arrow icon from mode-select */ } .hf-loras-toggle-btn:hover, .hf-loras-toggle-btn.active { background: var(--hover-bg); border-color: var(--accent-blue); color: var(--accent-blue); } .modal-mobile-tabs { display: none; width: 100%; background: var(--input-bg); border-bottom: 1px solid var(--card-border); } .mobile-tab-btn { flex: 1; padding: 12px; background: none; border: none; color: var(--text-secondary); font-weight: 600; cursor: pointer; transition: all 0.2s; border-bottom: 2px solid transparent; } .mobile-tab-btn.active { color: var(--accent-blue); border-bottom-color: var(--accent-blue); background: rgba(96, 165, 250, 0.05); } /* Smaller nav arrows */ .image-nav-arrow { width: 40px; height: 40px; font-size: 24px; } .image-nav-prev { left: 5px; } .image-nav-next { right: 5px; } </style> </head> <body> <!-- Theme Toggle Button --> <button class="theme-toggle" onclick="toggleTheme()" title="Toggle dark/light mode"> <span class="moon-icon">🌙</span> <span class="sun-icon">☀️</span> </button> <button class="samples-toggle" onclick="toggleSamples()" title="Toggle sample images"> <span class="samples-on-icon">🖼️</span> <span class="samples-off-icon">🚫</span> </button> <div class="header"> <div class="header-title-row"> <h1>🎨 Mal's Models</h1> <div class="profile-links"> <a href="https://civitai.com/user/malcolmrey" target="_blank">🎨 <span class="link-text">CivitAI</span></a> <a href="https://huggingface.com/malcolmrey" target="_blank">🤗 <span class="link-text">HuggingFace</span></a> <a href="https://buymeacoffee.com/malcolmrey" target="_blank">☕ <span class="link-text">BuyMeACoffee</span></a> <a href="https://reddit.com/r/malcolmrey" target="_blank">💬 <span class="link-text">Reddit</span></a> <button id="hfLorasToggleBtn" class="mode-select hf-loras-toggle-btn" onclick="toggleHfLorasSection()" title="HuggingFace LoRA Repos" style="display: none;"> 🤗 </button> <button id="toggleAdvanced" class="mode-select advanced-toggle-btn" onclick="toggleAdvancedOptions()" title="Advanced Options"> ⚙️ </button> </div> </div> <div class="controls" id="regularBrowseControls"> <div class="search-container"> <input id="search" type="text" onkeyup="javascript:searchModels(this.value);" placeholder="Search models..." /> <button class="clear-btn" onclick="javascript:clearCurrentSearchValue(); javascript:searchModels(getCurrentSearchValue())" > Clear </button> </div> <select class="mode-select" id="genderFilter" onchange="resetToFirstPage(); searchModels(getCurrentSearchValue());" > <option value="all">All genders</option> <option value="woman">Women</option> <option value="man">Men</option> <option value="other">Other</option> </select> <div id="advancedOptions" class="advanced-options-container"> <div class="controls"> <select class="mode-select" id="searchMode" onchange="javascript:searchModels(getCurrentSearchValue());" > <option value="available">Trained</option> <option value="missing">Not trained</option> </select> <div class="stats-bar"> <label>Found:</label> <input id="found" type="text" readonly /> </div> <div class="updates-group"> <button class="daily-uploads-btn" onclick="openDailyUploadsModal()"> 📋 Recent Updates </button> <a class="daily-uploads-btn" href="gallery.html" style="text-decoration:none;"> 🖼️ Samples Gallery </a> <span id="lastUpdateLabel" class="last-update-inline">Updated: N/A</span> </div> </div> <div class="advanced-controls"> <div class="control-group"> <span class="control-label">Sort by:</span> <select id="sortBy" class="control-select" onchange="resetToFirstPage(); searchModels(getCurrentSearchValue());"> <option value="name-asc">Name (A-Z)</option> <option value="name-desc">Name (Z-A)</option> <option value="date-desc">Update Date (Newest)</option> <option value="date-asc">Update Date (Oldest)</option> <option value="daily-desc">Daily (Newest)</option> <option value="daily-asc">Daily (Oldest)</option> </select> </div> <!-- Date Range Selectors --> <div class="control-group"> <span class="control-label">From:</span> <select id="dateFrom" class="control-select" onchange="resetToFirstPage(); searchModels(getCurrentSearchValue());"> <option value="">One day</option> </select> </div> <div class="control-group"> <span class="control-label">To:</span> <select id="dateTo" class="control-select" onchange="resetToFirstPage(); searchModels(getCurrentSearchValue());"> <option value="">One day</option> </select> </div> <div class="control-group"> <span class="control-label">Per page:</span> <select id="pageSize" class="control-select" onchange="resetToFirstPage(); searchModels(getCurrentSearchValue());"> <option value="10">10</option> <option value="25">25</option> <option value="30" selected>30</option> <option value="50">50</option> <option value="100">100</option> <option value="250">250</option> <option value="500">500</option> <option value="1000">1000</option> <option value="all">All</option> </select> </div> <div class="control-group multi-lora-toggle-wrap"> <span class="control-label">MultiLora:</span> <button type="button" id="multiLoraToggleBtn" class="multi-lora-toggle-btn" title="Show only models that have more than one lora version in a single category" onclick="toggleMultiLora();"> <span class="multi-lora-icon off">📖</span> <span class="multi-lora-icon on">📚</span> </button> </div> </div> <div class="controls" style="margin-top: 16px;"> <div class="filter-section"> <div class="filter-section-label">Model Type</div> <div class="checkbox-group"> <label class="checkbox-label"> <input id="selectedLora" type="checkbox" onclick="javascript:searchModels(getCurrentSearchValue());" /> <span>SD LoRA</span> </label> <label class="checkbox-label"> <input id="selectedLocon" type="checkbox" onclick="javascript:searchModels(getCurrentSearchValue());" /> <span>SD LoCon</span> </label> <label class="checkbox-label"> <input id="selectedEmbedding" type="checkbox" onclick="javascript:searchModels(getCurrentSearchValue());" /> <span>SD Embedding</span> </label> <label class="checkbox-label"> <input id="selectedFlux" type="checkbox" onclick="javascript:searchModels(getCurrentSearchValue());" /> <span>Flux</span> </label> <label class="checkbox-label"> <input id="selectedWan" type="checkbox" onclick="javascript:searchModels(getCurrentSearchValue());" /> <span>WAN</span> </label> <label class="checkbox-label"> <input id="selectedSdxl" type="checkbox" onclick="javascript:searchModels(getCurrentSearchValue());" /> <span>SDXL</span> </label> <label class="checkbox-label"> <input id="selectedLtx" type="checkbox" onclick="javascript:searchModels(getCurrentSearchValue());" /> <span>LTX</span> </label> <label class="checkbox-label"> <input id="selectedZimage" type="checkbox" onclick="javascript:searchModels(getCurrentSearchValue());" /> <span>Z Image Turbo</span> </label> <label class="checkbox-label"> <input id="selectedZbase" type="checkbox" onclick="javascript:searchModels(getCurrentSearchValue());" /> <span>Z Image Base</span> </label> <label class="checkbox-label"> <input id="selectedKlein9" type="checkbox" onclick="javascript:searchModels(getCurrentSearchValue());" /> <span>Klein9</span> </label> <label class="checkbox-label"> <input id="selectedErnie" type="checkbox" onclick="javascript:searchModels(getCurrentSearchValue());" /> <span>Ernie</span> </label> <label class="checkbox-label"> <input id="selectedIdeogram4" type="checkbox" onclick="javascript:searchModels(getCurrentSearchValue());" /> <span>Ideogram4</span> </label> <label class="checkbox-label"> <input id="selectedKrea2" type="checkbox" onclick="javascript:searchModels(getCurrentSearchValue());" /> <span>Krea 2</span> </label> <label class="checkbox-label"> <input id="selectedMinimaxh3" type="checkbox" onclick="javascript:searchModels(getCurrentSearchValue());" /> <span>MiniMax H3</span> </label> <label class="checkbox-label"> <input id="selectedQwen" type="checkbox" onclick="javascript:searchModels(getCurrentSearchValue());" /> <span>Qwen</span> </label> </div> </div> <div class="filter-section filter-section-collapsible"> <button type="button" class="filter-section-toggle" id="tagsFilterToggle" onclick="toggleTagsFilterGroup();" aria-expanded="false" aria-controls="tagsFilterGroup" > <span class="filter-section-label">Tags</span> <span id="tagsFilterCount" class="filter-tags-count" style="display:none;"></span> <span class="filter-section-chevron">▸</span> </button> <div class="checkbox-group" id="tagsFilterGroup" style="display:none;"> <label class="checkbox-label"> <input id="tag-actor" type="checkbox" onclick="javascript:updateTagsFilterCount(); searchModels(getCurrentSearchValue());" /> <span>Actor</span> </label> <label class="checkbox-label"> <input id="tag-model" type="checkbox" onclick="javascript:updateTagsFilterCount(); searchModels(getCurrentSearchValue());" /> <span>Model</span> </label> <label class="checkbox-label"> <input id="tag-musician" type="checkbox" onclick="javascript:updateTagsFilterCount(); searchModels(getCurrentSearchValue());" /> <span>Musician</span> </label> <label class="checkbox-label"> <input id="tag-singer" type="checkbox" onclick="javascript:updateTagsFilterCount(); searchModels(getCurrentSearchValue());" /> <span>Singer</span> </label> <label class="checkbox-label"> <input id="tag-influencer" type="checkbox" onclick="javascript:updateTagsFilterCount(); searchModels(getCurrentSearchValue());" /> <span>Influencer</span> </label> <label class="checkbox-label"> <input id="tag-instagrammer" type="checkbox" onclick="javascript:updateTagsFilterCount(); searchModels(getCurrentSearchValue());" /> <span>Instagrammer</span> </label> <label class="checkbox-label"> <input id="tag-youtuber" type="checkbox" onclick="javascript:updateTagsFilterCount(); searchModels(getCurrentSearchValue());" /> <span>YouTuber</span> </label> <label class="checkbox-label"> <input id="tag-streamer" type="checkbox" onclick="javascript:updateTagsFilterCount(); searchModels(getCurrentSearchValue());" /> <span>Streamer</span> </label> <label class="checkbox-label"> <input id="tag-sportsman" type="checkbox" onclick="javascript:updateTagsFilterCount(); searchModels(getCurrentSearchValue());" /> <span>Athlete</span> </label> <label class="checkbox-label"> <input id="tag-politician" type="checkbox" onclick="javascript:updateTagsFilterCount(); searchModels(getCurrentSearchValue());" /> <span>Politician</span> </label> <label class="checkbox-label"> <input id="tag-adult_star" type="checkbox" onclick="javascript:updateTagsFilterCount(); searchModels(getCurrentSearchValue());" /> <span>Adult Star</span> </label> <label class="checkbox-label"> <input id="tag-character" type="checkbox" onclick="javascript:updateTagsFilterCount(); searchModels(getCurrentSearchValue());" /> <span>Character</span> </label> <label class="checkbox-label"> <input id="tag-game" type="checkbox" onclick="javascript:updateTagsFilterCount(); searchModels(getCurrentSearchValue());" /> <span>Game</span> </label> <label class="checkbox-label"> <input id="tag-movie" type="checkbox" onclick="javascript:updateTagsFilterCount(); searchModels(getCurrentSearchValue());" /> <span>Movie</span> </label> <label class="checkbox-label"> <input id="tag-animation" type="checkbox" onclick="javascript:updateTagsFilterCount(); searchModels(getCurrentSearchValue());" /> <span>Animation</span> </label> <label class="checkbox-label"> <input id="tag-anime" type="checkbox" onclick="javascript:updateTagsFilterCount(); searchModels(getCurrentSearchValue());" /> <span>Anime</span> </label> <label class="checkbox-label"> <input id="tag-manga" type="checkbox" onclick="javascript:updateTagsFilterCount(); searchModels(getCurrentSearchValue());" /> <span>Manga</span> </label> <label class="checkbox-label"> <input id="tag-comics" type="checkbox" onclick="javascript:updateTagsFilterCount(); searchModels(getCurrentSearchValue());" /> <span>Comics</span> </label> <label class="checkbox-label"> <input id="tag-other" type="checkbox" onclick="javascript:updateTagsFilterCount(); searchModels(getCurrentSearchValue());" /> <span>Other</span> </label> </div> </div> </div> </div> </div> </div> <div id="paginationControls" class="pagination-controls" style="display: none;"> <button id="firstPageBtn" class="pagination-btn" onclick="firstPage()">⇤ First</button> <button id="prevPageBtn" class="pagination-btn" onclick="previousPage()">← Previous</button> <span id="paginationInfo" class="pagination-info"></span> <button id="nextPageBtn" class="pagination-btn" onclick="nextPage()">Next →</button> <button id="lastPageBtn" class="pagination-btn" onclick="lastPage()">Last ⇥</button> </div> <div id="mainContent" class="mainContent"></div> <div id="paginationControlsBottom" class="pagination-controls" style="display: none;"> <button id="firstPageBtnBottom" class="pagination-btn" onclick="firstPage()">⇤ First</button> <button id="prevPageBtnBottom" class="pagination-btn" onclick="previousPage()">← Previous</button> <span id="paginationInfoBottom" class="pagination-info"></span> <button id="nextPageBtnBottom" class="pagination-btn" onclick="nextPage()">Next →</button> <button id="lastPageBtnBottom" class="pagination-btn" onclick="lastPage()">Last ⇥</button> </div> <!-- Hidden by default (toggled via the 🤗 button next to the profile links above), so it never sits on top of Mal's Models, which stays the default view. --> <div class="hf-loras-section" id="hfLorasSection"> <div class="hf-loras-section-header"> <h2>🤗 HuggingFace LoRA Repos</h2> <select id="hfLorasRepoSelect" class="mode-select" onchange="onHfLorasRepoChange()"></select> <a id="hfLorasRepoLink" class="hf-loras-repo-link" href="#" target="_blank" rel="noopener" title="View on HuggingFace" style="display: none;" >🔗</a> <div class="hf-loras-search-container"> <input id="hfLorasSearch" type="text" class="hf-loras-search-input" placeholder="Search LoRAs..." oninput="onHfLorasSearchInput(this.value)" /> <button class="clear-btn" onclick="clearHfLorasSearch()">Clear</button> </div> <span id="hfLorasSummary" class="hf-loras-summary"></span> </div> <div id="hfLorasPaginationTop" class="pagination-controls" style="display: none;"> <span class="hf-loras-pager-nav"> <button class="pagination-btn hf-loras-prev-btn" onclick="hfLorasPreviousPage()">← Previous</button> <span class="pagination-info hf-loras-page-info"></span> <button class="pagination-btn hf-loras-next-btn" onclick="hfLorasNextPage()">Next →</button> </span> <label class="hf-loras-page-size-label"> Per page: <select id="hfLorasPageSize" class="mode-select" onchange="onHfLorasPageSizeChange()"> <option value="10">10</option> <option value="25">25</option> <option value="30" selected>30</option> <option value="50">50</option> <option value="100">100</option> <option value="250">250</option> <option value="500">500</option> <option value="1000">1000</option> <option value="all">All</option> </select> </label> </div> <div id="hfLorasGrid" class="hf-loras-grid"></div> <div id="hfLorasPaginationBottom" class="pagination-controls" style="display: none;"> <span class="hf-loras-pager-nav"> <button class="pagination-btn hf-loras-prev-btn" onclick="hfLorasPreviousPage()">← Previous</button> <span class="pagination-info hf-loras-page-info"></span> <button class="pagination-btn hf-loras-next-btn" onclick="hfLorasNextPage()">Next →</button> </span> </div> </div> <!-- Recent Updates Modal --> <div id="dailyUploadsModal" class="modal-overlay" onclick="closeDailyUploadsModalOnOverlay(event)"> <div class="modal-content daily-modal-content" onclick="event.stopPropagation()"> <div class="modal-header"> <h2 class="modal-title">📋 Recent Updates</h2> <button class="modal-close" onclick="closeDailyUploadsModal()" aria-label="Close">×</button> </div> <div class="daily-modal-body"> <div class="daily-date-selector"> <select id="dailyDateSelect" class="daily-date-select" onchange="renderDailyUploads()"> </select> </div> <div id="dailyStats" class="daily-stats"></div> <div id="dailyUploadsList" class="daily-uploads-list"></div> </div> </div> </div> <!-- Modal --> <div id="modalOverlay" class="modal-overlay" onclick="closeModalOnOverlay(event)"> <div class="modal-content" onclick="event.stopPropagation()"> <div class="modal-header"> <h2 id="modalTitle" class="modal-title"></h2> <button class="modal-close" onclick="closeModal()" aria-label="Close">×</button> </div> <div class="modal-mobile-tabs"> <button id="tabImage" class="mobile-tab-btn active" onclick="switchModalTab('image')">Image</button> <button id="tabDetails" class="mobile-tab-btn" onclick="switchModalTab('details')">Details & Downloads</button> </div> <div class="modal-body"> <div class="modal-left"> <div class="modal-image-container"> <div class="image-viewer"> <button id="prevImageBtn" class="image-nav-arrow image-nav-prev" onclick="previousImage()" aria-label="Previous image" style="display:none;">‹</button> <img id="modalImage" src="" alt="" class="modal-image" /> <video id="modalVideo" class="modal-image" style="display:none;" controls muted playsinline preload="metadata"></video> <button id="modalDownloadBtn" class="download-btn" onclick="downloadCurrentImage()" aria-label="Download image">⬇️</button> <span id="modalDownloadTooltip" class="download-tooltip"></span> <button id="nextImageBtn" class="image-nav-arrow image-nav-next" onclick="nextImage()" aria-label="Next image" style="display:none;">›</button> </div> <div id="imageInfo" class="image-info" style="display:none;"> <div id="imageCounter" class="image-counter"></div> <button id="modalDownloadAllBtn" class="download-btn" onclick="downloadAllImages()" aria-label="Download all images" title="Download all samples">⬇️</button> <div id="frameworkLabel" class="framework-label"></div> </div> </div> </div> <div class="modal-right"> <div id="modalStats" class="modal-stats"></div> </div> </div> </div> </div> <script type="text/javascript"> // Theme management function toggleTheme() { const body = document.body; const currentTheme = body.getAttribute('data-theme'); const newTheme = currentTheme === 'light' ? 'dark' : 'light'; if (newTheme === 'dark') { body.removeAttribute('data-theme'); } else { body.setAttribute('data-theme', newTheme); } // Save preference localStorage.setItem('theme', newTheme); } let showSamples = true; function toggleSamples() { showSamples = !showSamples; document.body.setAttribute('data-samples', showSamples ? 'on' : 'off'); localStorage.setItem('showSamples', showSamples ? 'on' : 'off'); renderCurrentPage(); } function toggleAdvancedOptions() { const container = document.getElementById('advancedOptions'); const btn = document.getElementById('toggleAdvanced'); if (container.classList.contains('active')) { container.classList.remove('active'); btn.classList.remove('active'); } else { container.classList.add('active'); btn.classList.add('active'); } } function switchModalTab(tabName) { const modalLeft = document.querySelector('.modal-left'); const modalRight = document.querySelector('.modal-right'); const tabImage = document.getElementById('tabImage'); const tabDetails = document.getElementById('tabDetails'); // Reset active classes tabImage.classList.remove('active'); tabDetails.classList.remove('active'); modalLeft.classList.remove('active'); modalRight.classList.remove('active'); if (tabName === 'image') { tabImage.classList.add('active'); modalLeft.classList.add('active'); } else { tabDetails.classList.add('active'); modalRight.classList.add('active'); } } function initSwipe() { const imageViewer = document.querySelector('.image-viewer'); if (!imageViewer) return; let touchStartX = 0; let touchEndX = 0; imageViewer.addEventListener('touchstart', e => { touchStartX = e.changedTouches[0].screenX; }, { passive: true }); imageViewer.addEventListener('touchend', e => { touchEndX = e.changedTouches[0].screenX; handleSwipe(); }, { passive: true }); function handleSwipe() { if (touchEndX < touchStartX - 50) { // Swipe Left (Next) nextImage(); } if (touchEndX > touchStartX + 50) { // Swipe Right (Prev) previousImage(); } } } // Scroll handler for floating buttons window.addEventListener('scroll', () => { const btns = document.querySelectorAll('.theme-toggle, .samples-toggle'); if (window.scrollY > 100) { btns.forEach(btn => btn.classList.add('floating-hidden')); } else { btns.forEach(btn => btn.classList.remove('floating-hidden')); } }); // Call on page load window.addEventListener('load', initSwipe); // Initialize theme from localStorage function initTheme() { const savedTheme = localStorage.getItem('theme'); if (savedTheme === 'light') { document.body.setAttribute('data-theme', 'light'); } } function initSamplesToggle() { const saved = localStorage.getItem('showSamples'); showSamples = saved !== 'off'; document.body.setAttribute('data-samples', showSamples ? 'on' : 'off'); } // Tags filter group: collapsed by default, remembered across visits. function toggleTagsFilterGroup(forceExpanded) { const group = document.getElementById('tagsFilterGroup'); const toggle = document.getElementById('tagsFilterToggle'); const isExpanded = forceExpanded !== undefined ? forceExpanded : group.style.display === 'none'; group.style.display = isExpanded ? 'flex' : 'none'; toggle.classList.toggle('expanded', isExpanded); toggle.setAttribute('aria-expanded', String(isExpanded)); localStorage.setItem('tagsFilterExpanded', isExpanded ? 'on' : 'off'); } function updateTagsFilterCount() { const checkedCount = document.querySelectorAll('#tagsFilterGroup input[type="checkbox"]:checked').length; const countEl = document.getElementById('tagsFilterCount'); countEl.textContent = String(checkedCount); countEl.style.display = checkedCount > 0 ? 'inline-flex' : 'none'; } function initTagsFilterGroup() { toggleTagsFilterGroup(localStorage.getItem('tagsFilterExpanded') === 'on'); updateTagsFilterCount(); } // Search/pagination state for the HF loras view — deliberately separate from the regular // browser's currentPage/totalPages/filteredResults, which belong to a different dataset. // Declared here, ahead of initHfLoras() below, since `let`/`const` (unlike `function`) are // not hoisted — referencing them from a call this early in the script threw otherwise. let hfLorasSearchTerm = ''; let hfLorasCurrentPage = 1; let hfLorasTotalPages = 1; // Call on page load initTheme(); initSamplesToggle(); initTagsFilterGroup(); initHfLoras(); // HuggingFace LoRA repos section (data-huggingface-loras.js, generated via // `npm run huggingface-loras:generate` from the repos in HUGGINGFACE_LORA_REPOS). // Sample images and safetensors downloads are hotlinked straight to // huggingface.co — nothing is mirrored locally, matching the other data-hf-*.js // sources on this page. // Repo file paths often carry spaces/parentheses (real filenames seen in these repos: // "K2 Dichen Lachman (vrtlDichenLachman)-ID.webp"). Encode each path segment, not the // whole path, so a subfolder's own "/" separators survive. function encodeHfPath(path) { return path.split('/').map(encodeURIComponent).join('/'); } function formatHfLoraBytes(bytes) { if (bytes === null || bytes === undefined) return ''; const units = ['B', 'KB', 'MB', 'GB']; let value = bytes; let unitIndex = 0; while (value >= 1024 && unitIndex < units.length - 1) { value /= 1024; unitIndex += 1; } return `${value.toFixed(1)} ${units[unitIndex]}`; } function populateHfLorasRepoSelect() { const select = document.getElementById('hfLorasRepoSelect'); const registry = window.hfLorasRegistry || {}; const repoIds = Object.keys(registry); select.innerHTML = repoIds .map((repoId) => `<option value="${escapeHtml(repoId)}">${escapeHtml(repoId)}</option>`) .join(''); // Section visibility is controlled by toggleHfLorasSection() (the 🤗 button), not here — // this only decides whether there's anything to toggle to in the first place. const toggleBtn = document.getElementById('hfLorasToggleBtn'); if (toggleBtn) { toggleBtn.style.display = repoIds.length === 0 ? 'none' : 'flex'; } } // A switch, not an additional panel: showing the HuggingFace repos hides Malcolm Rey's own // models (search/filters, the person grid, both pagination bars) rather than stacking below // them, and vice versa. Default on page load is Malcolm Rey's models, since #hfLorasSection // starts without the `active` class that makes it visible at all. function toggleHfLorasSection() { const hfSection = document.getElementById('hfLorasSection'); const btn = document.getElementById('hfLorasToggleBtn'); const regularControls = document.getElementById('regularBrowseControls'); const mainContent = document.getElementById('mainContent'); const paginationTop = document.getElementById('paginationControls'); const paginationBottom = document.getElementById('paginationControlsBottom'); const showingHfLoras = !hfSection.classList.contains('active'); hfSection.classList.toggle('active', showingHfLoras); btn.classList.toggle('active', showingHfLoras); regularControls.style.display = showingHfLoras ? 'none' : ''; mainContent.style.display = showingHfLoras ? 'none' : ''; if (showingHfLoras) { paginationTop.style.display = 'none'; paginationBottom.style.display = 'none'; } else { // Its own visibility depends on page count, independent of this switch — let it decide // rather than forcing 'flex' back on regardless of whether there's more than one page. updatePaginationControls(); } } function onHfLorasSearchInput(value) { hfLorasSearchTerm = value; hfLorasCurrentPage = 1; renderHfLorasRepo(); } function clearHfLorasSearch() { document.getElementById('hfLorasSearch').value = ''; onHfLorasSearchInput(''); } function onHfLorasRepoChange() { hfLorasCurrentPage = 1; renderHfLorasRepo(); } function onHfLorasPageSizeChange() { hfLorasCurrentPage = 1; renderHfLorasRepo(); } function getHfLorasPageSize() { const value = document.getElementById('hfLorasPageSize').value; return value === 'all' ? Infinity : parseInt(value, 10); } function hfLorasPreviousPage() { if (hfLorasCurrentPage > 1) { hfLorasCurrentPage -= 1; renderHfLorasRepo(); } } function hfLorasNextPage() { if (hfLorasCurrentPage < hfLorasTotalPages) { hfLorasCurrentPage += 1; renderHfLorasRepo(); } } // The per-page select lives inside the same bar as Previous/Next, but must stay reachable // even when there's only one page (e.g. "All" is selected) — otherwise picking "All" would // be a dead end with no way back to a smaller page size. Only `.hf-loras-pager-nav` (the // Previous/count/Next trio) hides in that case; the bar itself, and the select, do not. function updateHfLorasPaginationControls(matchCount, hasData) { const pageSize = getHfLorasPageSize(); const showNav = hasData && matchCount > pageSize; const infoText = `${hfLorasCurrentPage}/${hfLorasTotalPages}`; document.querySelectorAll('#hfLorasPaginationTop, #hfLorasPaginationBottom').forEach((el) => { el.style.display = hasData ? 'flex' : 'none'; }); document.querySelectorAll('.hf-loras-pager-nav').forEach((el) => { el.style.display = showNav ? 'flex' : 'none'; }); document.querySelectorAll('.hf-loras-page-info').forEach((el) => { el.textContent = infoText; }); document.querySelectorAll('.hf-loras-prev-btn').forEach((el) => { el.disabled = hfLorasCurrentPage <= 1; }); document.querySelectorAll('.hf-loras-next-btn').forEach((el) => { el.disabled = hfLorasCurrentPage >= hfLorasTotalPages; }); } function renderHfLorasRepo() { const select = document.getElementById('hfLorasRepoSelect'); const grid = document.getElementById('hfLorasGrid'); const summary = document.getElementById('hfLorasSummary'); const repoLink = document.getElementById('hfLorasRepoLink'); const registry = window.hfLorasRegistry || {}; const snapshot = registry[select.value]; if (!snapshot) { grid.innerHTML = '<div class="hf-loras-empty">No data for this repo yet — run `npm run huggingface-loras:generate`.</div>'; summary.textContent = ''; repoLink.style.display = 'none'; updateHfLorasPaginationControls(0, false); return; } repoLink.href = `https://huggingface.co/${encodeHfPath(snapshot.repoId)}`; repoLink.style.display = ''; const term = hfLorasSearchTerm.trim().toLowerCase(); const filtered = term ? snapshot.loras.filter((lora) => lora.name.toLowerCase().includes(term)) : snapshot.loras; const pageSize = getHfLorasPageSize(); hfLorasTotalPages = Math.max(1, Math.ceil(filtered.length / pageSize)); if (hfLorasCurrentPage > hfLorasTotalPages) hfLorasCurrentPage = hfLorasTotalPages; const fetchedLabel = new Date(snapshot.fetchedAt).toLocaleString(); summary.textContent = term ? `${filtered.length} of ${snapshot.loras.length} LoRA(s) · fetched ${fetchedLabel}` : `${snapshot.loras.length} LoRA(s) · fetched ${fetchedLabel}`; // pageSize is Infinity for "All". (hfLorasCurrentPage - 1) * Infinity is NaN when the // page is 1 (0 * Infinity), and Infinity itself otherwise — either way `slice` on that // start returns nothing. Substituting the actual filtered length sidesteps Infinity // arithmetic entirely rather than special-casing every place it could leak in. const effectivePageSize = pageSize === Infinity ? Math.max(filtered.length, 1) : pageSize; const start = (hfLorasCurrentPage - 1) * effectivePageSize; const pageItems = filtered.slice(start, start + effectivePageSize); grid.innerHTML = pageItems.length === 0 ? '<div class="hf-loras-empty">No matching LoRAs.</div>' : pageItems.map((lora) => { const sampleFile = lora.sampleFiles[0]; const sampleUrl = sampleFile ? `https://huggingface.co/${snapshot.repoId}/resolve/${snapshot.revision}/${encodeHfPath(sampleFile)}` : null; const downloadUrl = `https://huggingface.co/${snapshot.repoId}/resolve/${snapshot.revision}/${encodeHfPath(lora.safetensorsFile)}?download=true`; const imageHtml = sampleUrl ? `<img src="${sampleUrl}" alt="${escapeHtml(lora.name)}" loading="lazy" />` : '<div class="hf-lora-no-sample">No sample</div>'; return ` <div class="hf-lora-card"> <div class="hf-lora-card-name" title="${escapeHtml(lora.name)}">${escapeHtml(lora.name)}</div> <div class="hf-lora-card-image">${imageHtml}</div> <div class="hf-lora-card-footer"> <span>${formatHfLoraBytes(lora.safetensorsSizeBytes)}</span> <a href="${downloadUrl}" target="_blank" rel="noopener">⬇️ Download</a> </div> </div> `; }).join(''); updateHfLorasPaginationControls(filtered.length, true); } function initHfLoras() { populateHfLorasRepoSelect(); renderHfLorasRepo(); } // Pagination state let currentPage = 1; let totalPages = 1; let filteredResults = []; let isMultiLoraEnabled = false; // Upload data (from data-hf-uploaded.js) const uploadData = { uploadDates: window.uploadDates || [], data: window.uploadedData || {} }; // Get available upload dates (unique, sorted newest first) function getAvailableUploadDates() { const dates = uploadData.uploadDates || []; // Remove duplicates and sort newest first const uniqueDates = [...new Set(dates)].sort((a, b) => b.localeCompare(a)); return uniqueDates; } // Populate date selectors with available dates function populateDateSelectors() { const fromSelect = document.getElementById('dateFrom'); const toSelect = document.getElementById('dateTo'); const dates = getAvailableUploadDates(); // Clear existing options (keep the "One day" option) const fromOptions = fromSelect.querySelectorAll('option:not([value=""])'); const toOptions = toSelect.querySelectorAll('option:not([value=""])'); fromOptions.forEach(opt => opt.remove()); toOptions.forEach(opt => opt.remove()); // Add date options dates.forEach(date => { const formattedDate = new Date(date).toLocaleDateString('en-US', { year: 'numeric', month: 'short', day: 'numeric' }); const optionFrom = document.createElement('option'); optionFrom.value = date; optionFrom.textContent = formattedDate; const optionTo = document.createElement('option'); optionTo.value = date; optionTo.textContent = formattedDate; fromSelect.appendChild(optionFrom.cloneNode(true)); toSelect.appendChild(optionTo.cloneNode(true)); }); } // Get selected date range function getDateRange() { const fromValue = document.getElementById('dateFrom').value; const toValue = document.getElementById('dateTo').value; // If both are empty, return null (no filtering) if (!fromValue && !toValue) { return null; } // If only one is selected, use that as both from and to (exact date) if (!fromValue && toValue) { return { from: toValue, to: toValue }; } if (fromValue && !toValue) { return { from: fromValue, to: fromValue }; } // If both are selected, ensure from <= to (swap if needed) let fromDate = fromValue; let toDate = toValue; if (fromDate > toDate) { // Swap dates [fromDate, toDate] = [toDate, fromDate]; // Also swap the UI values for user feedback setTimeout(() => { document.getElementById('dateFrom').value = fromDate; document.getElementById('dateTo').value = toDate; }, 0); } return { from: fromDate, to: toDate }; } // Check if a date string is within the selected range function isWithinDateRange(dateStr, dateRange) { if (!dateRange || !dateStr) return true; // Normalise everything to YYYY-MM-DD const d = dateStr.split('T')[0]; const from = dateRange.from; const to = dateRange.to; return d >= from && d <= to; } // Update the "Last Updated" label with the latest date function updateLastUpdateLabel() { const label = document.getElementById('lastUpdateLabel'); if (label && uploadData.uploadDates.length > 0) { const d = new Date(uploadData.uploadDates[0]); const formatted = `${d.getFullYear()}.${String(d.getMonth() + 1).padStart(2, '0')}.${String(d.getDate()).padStart(2, '0')}`; label.textContent = `Updated: ${formatted}`; } } // Initialize the label and date selectors updateLastUpdateLabel(); populateDateSelectors(); function getPageSize() { const value = document.getElementById('pageSize').value; return value === 'all' ? Infinity : parseInt(value, 10); } function getSortBy() { return document.getElementById('sortBy').value; } function resetToFirstPage() { currentPage = 1; } function getPersonUploadDate(personKey, selectedTypes = null, dateOnly = false) { const personData = uploadData.data[personKey]; if (!personData || !personData.models) return null; // Determine which types to check let typesToCheck; if (selectedTypes && selectedTypes.length > 0) { // Specific types selected - only check those typesToCheck = selectedTypes; } else { // No types selected - check ALL types that exist for this person typesToCheck = Object.keys(personData.models); } // Find the most recent upload date among the selected model types let mostRecentDate = null; for (const modelType of typesToCheck) { const models = personData.models[modelType]; if (models && models.length > 0) { // Check ALL models of this type, not just the first one for (const model of models) { if (model.uploadedAt) { const modelDate = model.uploadedAt; if (!mostRecentDate || modelDate > mostRecentDate) { mostRecentDate = modelDate; } } } } } // If no dates found for the selected types, return null if (!mostRecentDate) return null; return dateOnly ? mostRecentDate.split('T')[0] : mostRecentDate; } function getLatestDateInRange(personKey, selectedTypes, dateRange) { const personData = uploadData.data[personKey]; if (!personData || !personData.models || !dateRange) return null; // Determine which types to check let typesToCheck; if (selectedTypes && selectedTypes.length > 0) { // Specific types selected - only check those typesToCheck = selectedTypes; } else { // No types selected - check ALL types that exist for this person typesToCheck = Object.keys(personData.models); } // Find the most recent upload date WITHIN THE RANGE among the selected model types let latestDateInRange = null; for (const modelType of typesToCheck) { const models = personData.models[modelType]; if (models && models.length > 0) { for (const model of models) { if (model.uploadedAt && isWithinDateRange(model.uploadedAt, dateRange)) { const modelDate = model.uploadedAt; if (!latestDateInRange || modelDate > latestDateInRange) { latestDateInRange = modelDate; } } } } } return latestDateInRange; } // Get the latest model version for a specific base type within date range function getLatestModelForType(personKey, modelType, dateRange) { const personData = uploadData.data[personKey]; if (!personData || !personData.models) return null; const models = personData.models[modelType]; if (!models || models.length === 0) return null; let latestModel = null; let latestDate = null; for (const model of models) { if (model.uploadedAt && isWithinDateRange(model.uploadedAt, dateRange)) { const modelDate = new Date(model.uploadedAt); if (!latestDate || modelDate > latestDate) { latestDate = modelDate; latestModel = model; } } } return latestModel; } // Get bases within date range for a person function getBasesInDateRange(personKey, selectedTypes, dateRange) { const personData = uploadData.data[personKey]; if (!personData || !personData.models) return []; const bases = []; // Determine which types to check let typesToCheck; if (selectedTypes && selectedTypes.length > 0) { // Specific types selected - only check those typesToCheck = selectedTypes; } else { // No types selected - check ALL types that exist for this person typesToCheck = Object.keys(personData.models); } // Check each model type for (const modelType of typesToCheck) { const latestModel = getLatestModelForType(personKey, modelType, dateRange); if (latestModel) { // Found a model of this type within the date range if (!bases.includes(modelType)) { bases.push(modelType); } } } return bases; } // Format base name for display function formatBaseName(baseType) { const baseNames = { locon: 'SD LoCon', lora: 'SD LoRA', embedding: 'SD Embedding', flux: 'Flux', wan: 'WAN', sdxl: 'SDXL', ltx: 'LTX', zimage: 'Z Image Turbo', zbase: 'Z Image Base', klein9: 'Klein9', ernie: 'Ernie', ideogram4: 'Ideogram4', krea2: 'Krea 2', minimaxh3: 'MiniMax H3', qwen: 'Qwen' }; return baseNames[baseType] || baseType; } // Get download URL for the latest model version function getLatestModelDownloadUrl(personKey, modelType, dateRange) { const latestModel = getLatestModelForType(personKey, modelType, dateRange); if (!latestModel) return null; const folderMap = { locon: 'lycoris', lora: 'small-loras', embedding: 'embeddings', flux: 'flux', klein9: 'klein9', ernie: 'ernie', ideogram4: 'ideogram', krea2: 'krea2', minimaxh3: 'minimaxh3', wan: 'wan', sdxl: 'sdxl', ltx: 'ltx', qwen: 'qwen', zimage: 'zimage', zbase: 'zbase' }; const folder = folderMap[modelType]; if (!folder) return null; // Get the filename from filenames data const filenamesData = window.filenames || {}; const personFilenames = filenamesData[personKey]; const filenames = personFilenames?.[modelType]; if (!filenames || filenames.length === 0) { // Fallback to repo page return `https://huggingface.co/malcolmrey/${folder}`; } // Try to match the filename with the model data let filename = filenames[0]; if (latestModel.filename && filenames.includes(latestModel.filename)) { filename = latestModel.filename; } // For WAN models, add wan2.1/ prefix const filePath = modelType === 'wan' ? `wan2.1/${filename}` : filename; return `https://huggingface.co/malcolmrey/${folder}/resolve/main/${filePath}?download=true`; } // Create clickable base overlay element for page view cards function createBaseOverlay(personKey, selectedTypes, dateRange) { const basesInRange = getBasesInDateRange(personKey, selectedTypes, dateRange); if (basesInRange.length === 0) { return null; } // Sort bases by upload date (latest first) const sortedBases = basesInRange.sort((a, b) => { const modelA = getLatestModelForType(personKey, a, dateRange); const modelB = getLatestModelForType(personKey, b, dateRange); const dateA = modelA ? new Date(modelA.uploadedAt) : null; const dateB = modelB ? new Date(modelB.uploadedAt) : null; return (dateB || 0) - (dateA || 0); }); // Create overlay element const overlay = document.createElement('div'); overlay.className = 'base-overlay'; const itemsHtml = sortedBases.map(baseType => { const downloadUrl = getLatestModelDownloadUrl(personKey, baseType, dateRange); const displayName = formatBaseName(baseType); if (downloadUrl) { return `<a href="${downloadUrl}" target="_blank" class="base-overlay-item" onclick="event.stopPropagation();">${displayName}</a>`; } else { return `<span class="base-overlay-item">${displayName}</span>`; } }).join(''); overlay.innerHTML = itemsHtml; return overlay; } function sortModels(models, sortBy, selectedTypes = null, dateRange = null) { const sorted = [...models]; switch (sortBy) { case 'name-asc': sorted.sort((a, b) => a.key.localeCompare(b.key)); break; case 'name-desc': sorted.sort((a, b) => b.key.localeCompare(a.key)); break; case 'date-desc': // "Update Date (Newest)" sorted.sort((a, b) => { const dateA = dateRange ? getLatestDateInRange(a.key, selectedTypes, dateRange) : getPersonUploadDate(a.key, selectedTypes); const dateB = dateRange ? getLatestDateInRange(b.key, selectedTypes, dateRange) : getPersonUploadDate(b.key, selectedTypes); return (dateB || '1970-01-01').localeCompare(dateA || '1970-01-01'); }); break; case 'date-asc': // "Update Date (Oldest)" sorted.sort((a, b) => { const dateA = dateRange ? getLatestDateInRange(a.key, selectedTypes, dateRange) : getPersonUploadDate(a.key, selectedTypes); const dateB = dateRange ? getLatestDateInRange(b.key, selectedTypes, dateRange) : getPersonUploadDate(b.key, selectedTypes); return (dateA || '2100-01-01').localeCompare(dateB || '2100-01-01'); }); break; case 'daily-desc': // "Daily (Newest)" - Group by date, newest days first, then A-Z sorted.sort((a, b) => { // Get just the date portion (YYYY-MM-DD) for grouping const dateA = dateRange ? (getLatestDateInRange(a.key, selectedTypes, dateRange) || '').split('T')[0] : getPersonUploadDate(a.key, selectedTypes, true); const dateB = dateRange ? (getLatestDateInRange(b.key, selectedTypes, dateRange) || '').split('T')[0] : getPersonUploadDate(b.key, selectedTypes, true); // First, sort by date descending (newest days first) if (dateB !== dateA) { return (dateB || '1970-01-01').localeCompare(dateA || '1970-01-01'); } // If same date, sort by name A-Z return a.key.localeCompare(b.key); }); break; case 'daily-asc': // "Daily (Oldest)" - Group by date, oldest days first, then A-Z sorted.sort((a, b) => { // Get just the date portion (YYYY-MM-DD) for grouping const dateA = dateRange ? (getLatestDateInRange(a.key, selectedTypes, dateRange) || '').split('T')[0] : getPersonUploadDate(a.key, selectedTypes, true); const dateB = dateRange ? (getLatestDateInRange(b.key, selectedTypes, dateRange) || '').split('T')[0] : getPersonUploadDate(b.key, selectedTypes, true); // First, sort by date ascending (oldest days first) if (dateA !== dateB) { return (dateA || '2100-01-01').localeCompare(dateB || '2100-01-01'); } // If same date, sort by name A-Z return a.key.localeCompare(b.key); }); break; } return sorted; } function updatePaginationControls() { const controls = document.getElementById('paginationControls'); const info = document.getElementById('paginationInfo'); const prevBtn = document.getElementById('prevPageBtn'); const nextBtn = document.getElementById('nextPageBtn'); const firstBtn = document.getElementById('firstPageBtn'); const lastBtn = document.getElementById('lastPageBtn'); const controlsBottom = document.getElementById('paginationControlsBottom'); const infoBottom = document.getElementById('paginationInfoBottom'); const prevBtnBottom = document.getElementById('prevPageBtnBottom'); const nextBtnBottom = document.getElementById('nextPageBtnBottom'); const firstBtnBottom = document.getElementById('firstPageBtnBottom'); const lastBtnBottom = document.getElementById('lastPageBtnBottom'); const pageSize = getPageSize(); if (pageSize === Infinity || totalPages <= 1) { controls.style.display = 'none'; controlsBottom.style.display = 'none'; return; } controls.style.display = 'flex'; controlsBottom.style.display = 'flex'; const pageText = `${currentPage}/${totalPages}`; info.textContent = pageText; infoBottom.textContent = pageText; // Update buttons content firstBtn.textContent = '⇤'; lastBtn.textContent = '⇥'; prevBtn.textContent = '←'; nextBtn.textContent = '→'; firstBtnBottom.textContent = '⇤'; lastBtnBottom.textContent = '⇥'; prevBtnBottom.textContent = '←'; nextBtnBottom.textContent = '→'; const isFirstPage = currentPage <= 1; const isLastPage = currentPage >= totalPages; prevBtn.disabled = isFirstPage; firstBtn.disabled = isFirstPage; nextBtn.disabled = isLastPage; lastBtn.disabled = isLastPage; prevBtnBottom.disabled = isFirstPage; firstBtnBottom.disabled = isFirstPage; nextBtnBottom.disabled = isLastPage; lastBtnBottom.disabled = isLastPage; } function firstPage() { if (currentPage > 1) { currentPage = 1; renderCurrentPage(); document.getElementById('paginationControls').scrollIntoView({ behavior: 'smooth' }); } } function previousPage() { if (currentPage > 1) { currentPage--; renderCurrentPage(); document.getElementById('paginationControls').scrollIntoView({ behavior: 'smooth' }); } } function nextPage() { if (currentPage < totalPages) { currentPage++; renderCurrentPage(); document.getElementById('paginationControls').scrollIntoView({ behavior: 'smooth' }); } } function lastPage() { if (currentPage < totalPages) { currentPage = totalPages; renderCurrentPage(); document.getElementById('paginationControls').scrollIntoView({ behavior: 'smooth' }); } } function renderCurrentPage() { const pageSize = getPageSize(); const sortBy = getSortBy(); const dateRange = getDateRange(); const contentDiv = document.getElementById('mainContent'); contentDiv.innerHTML = ''; let pageItems; if (pageSize === Infinity) { pageItems = filteredResults; } else { const start = (currentPage - 1) * pageSize; const end = start + pageSize; pageItems = filteredResults.slice(start, end); } // Get selected types for date calculation and overlay const selectedTypes = getSelectedTypes(); let lastDate = null; pageItems.forEach((element) => { // Get the date for this element - when date range is active, use getLatestDateInRange let dateStr; if (dateRange) { const latestDate = getLatestDateInRange(element.key, selectedTypes, dateRange); dateStr = latestDate ? latestDate.split('T')[0] : null; } else { dateStr = getPersonUploadDate(element.key, selectedTypes, true); } // Add date header if doing daily sort and date changed if (sortBy.startsWith('daily-') && dateStr && dateStr !== lastDate) { const formattedDate = formatDateForDisplay(dateStr); const dateHeader = document.createElement('div'); dateHeader.className = 'date-header'; dateHeader.innerHTML = `📅 ${formattedDate}`; contentDiv.appendChild(dateHeader); lastDate = dateStr; } const card = document.createElement('div'); card.className = 'element'; const uploadDate = dateRange ? getLatestDateInRange(element.key, selectedTypes, dateRange) : getPersonUploadDate(element.key, selectedTypes); const copyLinkHtml = `<span class="copy-link-icon" title="Copy link to ${escapeHtml(element.key)}" onclick="event.stopPropagation(); copyPersonLink('${escapeHtml(element.key)}', this)">🔗</span>`; const googleSearchHtml = `<a href="https://www.google.com/search?q=${encodeURIComponent(element.key)}" target="_blank" class="google-search-icon" title="Search on Google" onclick="event.stopPropagation()">🔍</a>`; const personUrl = getResolvedPersonUrl(element.key); const profileLinkHtml = personUrl ? `<a href="${escapeHtml(personUrl)}" target="_blank" class="profile-link-icon" title="Open profile" onclick="event.stopPropagation()">🌐</a>` : ''; const calendarHtml = uploadDate ? `<span class="model-calendar-icon" title="${getPersonUpdateTooltip(element.key)}">📅</span>` : ''; const previewImages = showSamples ? buildImagesList(element.key, element) : []; const primaryPreview = previewImages.find((img) => !img.url.toLowerCase().endsWith('.mp4')); const imageUrl = showSamples ? (primaryPreview?.url ?? element.imageUrl ?? unknownImage) : unknownImage; const imageName = primaryPreview?.filename || element.imageName || getFilenameFromUrl(imageUrl) || element.key; const isThumbnailPreview = primaryPreview?.framework === 'Thumbnail'; const safeImageName = escapeHtml(imageName); const downloadButtonHtml = showSamples && imageUrl && !isThumbnailPreview ? `<button class="download-btn" data-url="${imageUrl}" data-filename="${safeImageName}" onclick="event.stopPropagation(); downloadImage(this.dataset.url, this.dataset.filename)">⬇️</button> <span class="download-tooltip">${safeImageName}</span>` : ''; card.innerHTML = ` <div class="model-name-row"> <span class="modelName" title="${escapeHtml(element.key)}">${element.key}</span> ${copyLinkHtml} ${googleSearchHtml} ${profileLinkHtml} ${calendarHtml} </div> <div class="imageContainer"> <img src="${imageUrl}" alt="${safeImageName}" /> ${downloadButtonHtml} </div> `; // Add clickable base overlay to the image container if date range is active const baseOverlay = createBaseOverlay(element.key, selectedTypes, dateRange); if (baseOverlay) { const imageContainer = card.querySelector('.imageContainer'); imageContainer.appendChild(baseOverlay); } card.addEventListener('click', () => openModal(element)); contentDiv.appendChild(card); }); updatePaginationControls(); } // Helper function to get selected types function getSelectedTypes() { const selectedTypes = []; if (document.getElementById('selectedLocon').checked) selectedTypes.push('locon'); if (document.getElementById('selectedLora').checked) selectedTypes.push('lora'); if (document.getElementById('selectedEmbedding').checked) selectedTypes.push('embedding'); if (document.getElementById('selectedFlux').checked) selectedTypes.push('flux'); if (document.getElementById('selectedWan').checked) selectedTypes.push('wan'); if (document.getElementById('selectedSdxl').checked) selectedTypes.push('sdxl'); if (document.getElementById('selectedZimage').checked) selectedTypes.push('zimage'); if (document.getElementById('selectedZbase').checked) selectedTypes.push('zbase'); if (document.getElementById('selectedQwen').checked) selectedTypes.push('qwen'); if (document.getElementById('selectedLtx').checked) selectedTypes.push('ltx'); if (document.getElementById('selectedKlein9').checked) selectedTypes.push('klein9'); if (document.getElementById('selectedErnie').checked) selectedTypes.push('ernie'); if (document.getElementById('selectedIdeogram4').checked) selectedTypes.push('ideogram4'); if (document.getElementById('selectedKrea2').checked) selectedTypes.push('krea2'); if (document.getElementById('selectedMinimaxh3').checked) selectedTypes.push('minimaxh3'); return selectedTypes; } // Helper function to format date for display function formatDateForDisplay(dateStr) { if (!dateStr) return 'Unknown Date'; const date = new Date(dateStr); const today = new Date(); const yesterday = new Date(today); yesterday.setDate(yesterday.getDate() - 1); // Check if it's today if (date.toDateString() === today.toDateString()) { return 'Today'; } // Check if it's yesterday if (date.toDateString() === yesterday.toDateString()) { return 'Yesterday'; } // Otherwise format normally return date.toLocaleDateString('en-US', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }); } function getPersonUpdateTooltip(personKey) { const personData = uploadData.data?.[personKey]; if (!personData || !personData.models) { return 'No update info available'; } const typeNames = { locon: 'SD LoCon', lora: 'SD LoRA', embedding: 'SD Embedding', flux: 'Flux', klein9: 'Klein9', ernie: 'Ernie', ideogram4: 'Ideogram4', krea2: 'Krea 2', minimaxh3: 'MiniMax H3', wan: 'WAN', sdxl: 'SDXL', ltx: 'LTX', qwen: 'Qwen', zimage: 'Z Image Turbo', zbase: 'Z Image Base' }; // Collect all dates with their model types const dateEntries = []; for (const [modelType, modelInfoArray] of Object.entries(personData.models)) { if (Array.isArray(modelInfoArray) && modelInfoArray.length > 0) { const mostRecent = modelInfoArray[0]; if (mostRecent?.uploadedAt) { const dateStr = mostRecent.uploadedAt; const d = new Date(dateStr); const displayDate = `${d.getFullYear()}.${String(d.getMonth() + 1).padStart(2, '0')}.${String(d.getDate()).padStart(2, '0')}`; const displayName = typeNames[modelType] || modelType; dateEntries.push({ name: displayName, date: displayDate, sortDate: dateStr }); } } } if (dateEntries.length === 0) { return 'No update info available'; } // Sort by date descending to find newest dateEntries.sort((a, b) => b.sortDate.localeCompare(a.sortDate)); const newestDate = dateEntries[0].sortDate; const lines = ['Update History:']; // Re-sort alphabetically for display dateEntries.sort((a, b) => a.name.localeCompare(b.name)); for (const entry of dateEntries) { // Add ⭐ to newest date, but only if there's more than one entry const isNewest = entry.sortDate === newestDate && dateEntries.length > 1; const prefix = isNewest ? '⭐ ' : ''; lines.push(`${prefix}${entry.name}: ${entry.date}`); } return lines.join('\n'); } // Recent Updates Modal Functions - Updated to pick latest version within date range function openDailyUploadsModal() { const modal = document.getElementById('dailyUploadsModal'); const dateSelect = document.getElementById('dailyDateSelect'); // Populate date dropdown with sorted dates (newest first) const dates = getAvailableUploadDates(); dateSelect.innerHTML = dates.map(date => { const displayDate = new Date(date).toLocaleDateString('en-US', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }); return `<option value="${date}">${displayDate}</option>`; }).join(''); if (dates.length === 0) { dateSelect.innerHTML = '<option value="">No upload data available</option>'; } modal.classList.add('active'); document.body.style.overflow = 'hidden'; renderDailyUploads(); } function closeDailyUploadsModal() { const modal = document.getElementById('dailyUploadsModal'); modal.classList.remove('active'); document.body.style.overflow = ''; } function closeDailyUploadsModalOnOverlay(event) { if (event.target.id === 'dailyUploadsModal') { closeDailyUploadsModal(); } } function renderDailyUploads() { const dateSelect = document.getElementById('dailyDateSelect'); const listContainer = document.getElementById('dailyUploadsList'); const statsContainer = document.getElementById('dailyStats'); const selectedDate = dateSelect.value; if (!selectedDate || !uploadData.data) { listContainer.innerHTML = '<div class="no-uploads-message">No update data available. Run the update scan first.</div>'; statsContainer.innerHTML = ''; return; } // Create a date range for just this day const dateRange = { from: selectedDate, to: selectedDate }; // Find all people who had uploads on this date const modelTypeOrder = [ 'locon', 'lora', 'embedding', 'flux', 'wan', 'sdxl', 'ltx', 'zimage', 'zbase', 'klein9', 'ernie', 'ideogram4', 'krea2', 'minimaxh3', 'qwen' ]; const orderIndex = new Map(modelTypeOrder.map((t, i) => [t, i])); const uploadsOnDate = []; for (const [personKey, personData] of Object.entries(uploadData.data)) { const modelsOnDate = []; const models = personData.models || {}; for (const modelType of modelTypeOrder) { const latestModel = getLatestModelForType(personKey, modelType, dateRange); if (latestModel) { modelsOnDate.push(modelType); } } if (modelsOnDate.length > 0) { modelsOnDate.sort((a, b) => { const ai = orderIndex.get(String(a).toLowerCase()) ?? Number.POSITIVE_INFINITY; const bi = orderIndex.get(String(b).toLowerCase()) ?? Number.POSITIVE_INFINITY; if (ai !== bi) return ai - bi; return String(a).localeCompare(String(b)); }); uploadsOnDate.push({ person: personKey, models: modelsOnDate }); } } // Sort alphabetically uploadsOnDate.sort((a, b) => a.person.localeCompare(b.person)); // Calculate stats const totalPeople = uploadsOnDate.length; const totalModels = uploadsOnDate.reduce((sum, item) => sum + item.models.length, 0); statsContainer.innerHTML = ` <div class="daily-stat"> <div class="daily-stat-value">${totalPeople}</div> <div class="daily-stat-label">People</div> </div> <div class="daily-stat"> <div class="daily-stat-value">${totalModels}</div> <div class="daily-stat-label">Models</div> </div> `; if (uploadsOnDate.length === 0) { listContainer.innerHTML = '<div class="no-uploads-message">No updates found for this date.</div>'; return; } listContainer.innerHTML = uploadsOnDate.map(item => ` <div class="daily-upload-item"> <div class="daily-upload-person-row"> <span class="daily-upload-person">${escapeHtml(item.person)}</span> <a href="?personcode=${encodeURIComponent(item.person)}" target="_blank" class="person-modal-link" title="Open model in new tab" onclick="event.stopPropagation();"> 🔗 </a> </div> <div class="daily-upload-models"> ${item.models.map(m => { const link = getLatestModelDownloadUrl(item.person, m, dateRange); return `<a href="${link || '#'}" target="_blank" class="daily-upload-model" data-type="${m.toLowerCase()}" onclick="event.stopPropagation();">${m}</a>`; }).join('')} </div> </div> `).join(''); } function getModelDownloadLink(personKey, modelType) { // This is the old function - use getLatestModelDownloadUrl instead const dateRange = getDateRange(); return getLatestModelDownloadUrl(personKey, modelType, dateRange) || '#'; } function yesNo(value) { if (value === undefined) { return '<span class="status-icon status-unknown">❓</span>'; } return value ? '<span class="status-icon status-available">✅</span>' : '<span class="status-icon status-unavailable">❌</span>'; } function formatHFLink(link, hasHF) { if (!link) return ''; return `<a href="${link}" target="_blank" class="hf-link">HF</a>`; } function formatModalHFLink(isAvailable, link) { if (isAvailable && link) { return `<a href="${link}" target="_blank" class="modal-hf-link">🤗 HuggingFace</a>`; } else if (isAvailable) { return `<span class="modal-hf-placeholder">🤗 HuggingFace</span>`; } return ''; } function formatModalHFLinks(isAvailable, folder, filenames, isWan = false) { if (!isAvailable || !filenames || filenames.length === 0) { return isAvailable ? `<span class="modal-hf-placeholder">🤗 No files found</span>` : ''; } // Generate a link for each filename, wrapped in a container for vertical layout const links = filenames.map((filename, index) => { // For WAN models, add wan2.1/ prefix to the filename in the path const filePath = isWan ? `wan2.1/${filename}` : filename; const link = `https://huggingface.co/malcolmrey/${folder}/resolve/main/${filePath}?download=true`; const versionLabel = filenames.length > 1 ? ` (v${index + 1})` : ''; return `<a href="${link}" target="_blank" class="modal-hf-link">🤗 HuggingFace${versionLabel}</a>`; }).join(''); return `<div class="modal-hf-links-container">${links}</div>`; } function openModal(element) { const modal = document.getElementById('modalOverlay'); const modalTitle = document.getElementById('modalTitle'); // Reset mobile tabs switchModalTab('image'); const modalImage = document.getElementById('modalImage'); const modalStats = document.getElementById('modalStats'); const modalVideo = document.getElementById('modalVideo'); // Generate HuggingFace links using actual filenames from data-filenames.js const personName = element.key; const filenamesData = window.filenames || {}; const personFilenames = filenamesData[personName] || {}; modalTitle.textContent = element.key; modalImage.src = element.imageUrl ?? unknownImage; modalImage.alt = element.key; if (modalVideo) { modalVideo.pause?.(); modalVideo.removeAttribute('src'); modalVideo.load?.(); modalVideo.style.display = 'none'; } modalStats.innerHTML = ` <div class="modal-stat-row"> <span class="modal-stat-label">${yesNo(element.locon)} SD LoCon</span> <span class="modal-stat-value"> ${formatModalHFLinks(element.locon, 'lycoris', personFilenames.locon)} </span> </div> <div class="modal-stat-row"> <span class="modal-stat-label">${yesNo(element.lora)} SD LoRA</span> <span class="modal-stat-value"> ${formatModalHFLinks(element.lora, 'small-loras', personFilenames.lora)} </span> </div> <div class="modal-stat-row"> <span class="modal-stat-label">${yesNo(element.embedding)} SD Embedding</span> <span class="modal-stat-value"> ${formatModalHFLinks(element.embedding, 'embeddings', personFilenames.embedding)} </span> </div> <div class="modal-stat-row"> <span class="modal-stat-label">${yesNo(element.flux)} Flux</span> <span class="modal-stat-value"> ${formatModalHFLinks(element.flux, 'flux', personFilenames.flux)} </span> </div> <div class="modal-stat-row"> <span class="modal-stat-label">${yesNo(element.wan)} WAN</span> <span class="modal-stat-value"> ${formatModalHFLinks(element.wan, 'wan', personFilenames.wan, true)} </span> </div> <div class="modal-stat-row"> <span class="modal-stat-label">${yesNo(element.sdxl)} SDXL</span> <span class="modal-stat-value"> ${formatModalHFLinks(element.sdxl, 'sdxl', personFilenames.sdxl)} </span> </div> <div class="modal-stat-row"> <span class="modal-stat-label">${yesNo(element.ltx)} LTX</span> <span class="modal-stat-value"> ${formatModalHFLinks(element.ltx, 'ltx', personFilenames.ltx)} </span> </div> <div class="modal-stat-row"> <span class="modal-stat-label">${yesNo(element.zimage)} Z Image Turbo</span> <span class="modal-stat-value"> ${formatModalHFLinks(element.zimage, 'zimage', personFilenames.zimage)} </span> </div> <div class="modal-stat-row"> <span class="modal-stat-label">${yesNo(element.zbase)} Z Image Base</span> <span class="modal-stat-value"> ${formatModalHFLinks(element.zbase, 'zbase', personFilenames.zbase)} </span> </div> <div class="modal-stat-row"> <span class="modal-stat-label">${yesNo(element.klein9)} Klein9</span> <span class="modal-stat-value"> ${formatModalHFLinks(element.klein9, 'klein9', personFilenames.klein9)} </span> </div> <div class="modal-stat-row"> <span class="modal-stat-label">${yesNo(element.ernie)} Ernie</span> <span class="modal-stat-value"> ${formatModalHFLinks(element.ernie, 'ernie', personFilenames.ernie)} </span> </div> <div class="modal-stat-row"> <span class="modal-stat-label">${yesNo(element.ideogram4)} Ideogram4</span> <span class="modal-stat-value"> ${formatModalHFLinks(element.ideogram4, 'ideogram', personFilenames.ideogram4)} </span> </div> <div class="modal-stat-row"> <span class="modal-stat-label">${yesNo(element.krea2)} Krea 2</span> <span class="modal-stat-value"> ${formatModalHFLinks(element.krea2, 'krea2', personFilenames.krea2)} </span> </div> <div class="modal-stat-row"> <span class="modal-stat-label">${yesNo(element.minimaxh3)} MiniMax H3</span> <span class="modal-stat-value"> ${formatModalHFLinks(element.minimaxh3, 'minimaxh3', personFilenames.minimaxh3)} </span> </div> <div class="modal-stat-row"> <span class="modal-stat-label">${yesNo(element.qwen)} Qwen</span> <span class="modal-stat-value"> ${formatModalHFLinks(element.qwen, 'qwen', personFilenames.qwen)} </span> </div> `; modal.classList.add('active'); document.body.style.overflow = 'hidden'; } function closeModal() { const modal = document.getElementById('modalOverlay'); modal.classList.remove('active'); document.body.style.overflow = ''; } function closeModalOnOverlay(event) { if (event.target.id === 'modalOverlay') { closeModal(); } } // Close modal on ESC key document.addEventListener('keydown', function(event) { if (event.key === 'Escape') { closeModal(); } }); const notMatched = { lycoris: [], lora: [], embedding: [], flux: [], wan: [], sdxl: [], ltx: [], qwen: [], zbase: [], }; models.lycorises.forEach((lycoris) => { const key = prepareKey(lycoris.name); if (presence[key] !== undefined) { presence[key].loconCivitai = true; setImageUrl(key, lycoris.imageUrl); presence[key].loconCivitaiLink = lycoris.url; } else if (!isKnownSkippableKey(key)) { notMatched.lycoris.push(key); } }); models.loras.forEach((lora) => { const key = prepareKey(lora.name); if (presence[key] !== undefined) { presence[key].loraCivitai = true; setImageUrl(key, lora.imageUrl); presence[key].loraCivitaiLink = lora.url; } else if (!isKnownSkippableKey(key)) { notMatched.lora.push(key); } }); models.embeddings.forEach((embedding) => { const key = prepareKey(embedding.name); if (presence[key] !== undefined) { presence[key].embeddingCivitai = true; setImageUrl(key, embedding.imageUrl); presence[key].embeddingCivitaiLink = embedding.url; } else if (!isKnownSkippableKey(key)) { notMatched.embedding.push(key); } }); models.fluxes.forEach((flux) => { const key = prepareKey(flux.name); if (presence[key] !== undefined) { presence[key].fluxCivitai = true; setImageUrl(key, flux.imageUrl); presence[key].fluxCivitaiLink = flux.url; } else if (!isKnownSkippableKey(key)) { notMatched.flux.push(key); } }); models.wans.forEach((wan) => { const key = prepareKey(wan.name); if (presence[key] !== undefined) { presence[key].wanCivitai = true; setImageUrl(key, wan.imageUrl); presence[key].wanCivitaiLink = wan.url; } else if (!isKnownSkippableKey(key)) { notMatched.wan.push(key); } }); models.sdxls.forEach((sdxl) => { const key = prepareKey(sdxl.name); if (presence[key] !== undefined) { presence[key].sdxlCivitai = true; setImageUrl(key, sdxl.imageUrl); presence[key].sdxlCivitaiLink = sdxl.url; } else if (!isKnownSkippableKey(key)) { notMatched.sdxl.push(key); } }); if (models.ltxes) { models.ltxes.forEach((ltx) => { const key = prepareKey(ltx.name); if (presence[key] !== undefined) { presence[key].ltxCivitai = true; setImageUrl(key, ltx.imageUrl); presence[key].ltxCivitaiLink = ltx.url; } else if (!isKnownSkippableKey(key)) { if (!notMatched.ltx) { notMatched.ltx = []; } notMatched.ltx.push(key); } }); } models.qwens.forEach((qwen) => { const key = prepareKey(qwen.name); if (presence[key] !== undefined) { presence[key].qwenCivitai = true; setImageUrl(key, qwen.imageUrl); presence[key].qwenCivitaiLink = qwen.url; } else if (!isKnownSkippableKey(key)) { notMatched.qwen.push(key); } }); console.log(notMatched); // Set primary imageUrl based on Thumbnail > ZBase > ZImage > WAN > Civitai > others priority for (const key in presence) { const personImages = buildImagesList(key, presence[key]); if (personImages.length > 0) { const primaryImage = personImages[0]; presence[key].imageUrl = primaryImage.url; presence[key].imageName = primaryImage.filename || getFilenameFromUrl(primaryImage.url); presence[key].isThumbnail = primaryImage.framework === 'Thumbnail'; } } const presenceModels = []; for (const property in presence) { const element = { key: property, locon: presence[property].locon, lora: presence[property].lora, embedding: presence[property].embedding, flux: presence[property].flux, klein9: presence[property].klein9, ernie: presence[property].ernie, ideogram4: presence[property].ideogram4, krea2: presence[property].krea2, minimaxh3: presence[property].minimaxh3, wan: presence[property].wan, sdxl: presence[property].sdxl, ltx: presence[property].ltx, zimage: presence[property].zimage, zbase: presence[property].zbase, qwen: presence[property].qwen, mega: undefined, imageUrl: presence[property]?.imageUrl ?? undefined, imageName: presence[property]?.imageName ?? undefined, isThumbnail: presence[property]?.isThumbnail ?? false, loconHFLink: presence[property]?.loconHFLink, loraHFLink: presence[property]?.loraHFLink, embeddingHFLink: presence[property]?.embeddingHFLink, fluxHFLink: presence[property]?.fluxHFLink, klein9HFLink: presence[property]?.klein9HFLink, ernieHFLink: presence[property]?.ernieHFLink, ideogram4HFLink: presence[property]?.ideogram4HFLink, krea2HFLink: presence[property]?.krea2HFLink, minimaxh3HFLink: presence[property]?.minimaxh3HFLink, wanHFLink: presence[property]?.wanHFLink, sdxlHFLink: presence[property]?.sdxlHFLink, ltxHFLink: presence[property]?.ltxHFLink, zimageHFLink: presence[property]?.zimageHFLink, zbaseHFLink: presence[property]?.zbaseHFLink, qwenHFLink: presence[property]?.qwenHFLink, }; presenceModels.push(element); } function hasMultiLoraForTypes(personKey, types) { const personData = uploadData.data[personKey]; if (!personData || !personData.models) return false; const allTypes = ['locon', 'lora', 'embedding', 'flux', 'wan', 'sdxl', 'ltx', 'qwen', 'zimage', 'zbase', 'klein9', 'ernie', 'ideogram4', 'krea2', 'minimaxh3']; const typesToCheck = types && types.length > 0 ? types : allTypes; for (const modelType of typesToCheck) { const arr = personData.models[modelType]; if (Array.isArray(arr) && arr.length > 1) return true; } return false; } function toggleMultiLora() { isMultiLoraEnabled = !isMultiLoraEnabled; const btn = document.getElementById('multiLoraToggleBtn'); if (btn) btn.classList.toggle('active', isMultiLoraEnabled); resetToFirstPage(); searchModels(getCurrentSearchValue()); } function getCurrentGenderFilter() { const select = document.getElementById('genderFilter'); return select ? select.value : 'all'; } function getResolvedPersonClassification(name) { const normalizedKey = prepareKey(name); const classifications = window.personClassificationsData?.classifications ?? {}; return classifications[normalizedKey] ?? 'other'; } function filterByGender(element) { const genderFilter = getCurrentGenderFilter(); if (genderFilter === 'all') { return true; } return getResolvedPersonClassification(element.key) === genderFilter; } const TAG_VALUES = [ 'actor', 'model', 'musician', 'singer', 'influencer', 'instagrammer', 'youtuber', 'streamer', 'sportsman', 'politician', 'adult_star', 'character', 'game', 'movie', 'animation', 'anime', 'manga', 'comics', 'other', ]; function getSelectedTags() { return TAG_VALUES.filter((tag) => document.getElementById('tag-' + tag)?.checked); } function getResolvedPersonTags(name) { const normalizedKey = prepareKey(name); const tags = window.personTagsData?.tags ?? {}; return tags[normalizedKey] ?? []; } function getResolvedPersonUrl(name) { const normalizedKey = prepareKey(name); const urls = window.personUrlsData?.urls ?? {}; return urls[normalizedKey] ?? null; } function filterByTags(element) { const selectedTags = getSelectedTags(); const personTags = getResolvedPersonTags(element.key); return selectedTags.every((tag) => personTags.includes(tag)); } function filterByType(element) { const mode = document.getElementById('searchMode').value; const filters = [ { selected: document.getElementById('selectedLocon').checked, property: element.locon }, { selected: document.getElementById('selectedLora').checked, property: element.lora }, { selected: document.getElementById('selectedEmbedding').checked, property: element.embedding }, { selected: document.getElementById('selectedFlux').checked, property: element.flux }, { selected: document.getElementById('selectedWan').checked, property: element.wan }, { selected: document.getElementById('selectedSdxl').checked, property: element.sdxl }, { selected: document.getElementById('selectedLtx').checked, property: element.ltx }, { selected: document.getElementById('selectedZimage').checked, property: element.zimage }, { selected: document.getElementById('selectedZbase').checked, property: element.zbase }, { selected: document.getElementById('selectedKlein9').checked, property: element.klein9 }, { selected: document.getElementById('selectedErnie').checked, property: element.ernie }, { selected: document.getElementById('selectedIdeogram4').checked, property: element.ideogram4 }, { selected: document.getElementById('selectedKrea2').checked, property: element.krea2 }, { selected: document.getElementById('selectedMinimaxh3').checked, property: element.minimaxh3 }, { selected: document.getElementById('selectedQwen').checked, property: element.qwen }, ]; // If no filters are selected, show all const anySelected = filters.some((f) => f.selected); if (!anySelected) { return true; } // Check each selected filter for (const filter of filters) { if (filter.selected) { if (mode === 'available' && !filter.property) { return false; } if (mode === 'missing' && filter.property) { return false; } } } return true; } function hasAnyUploadInDateRange(personKey, selectedTypes, dateRange) { const personData = uploadData.data[personKey]; if (!personData || !personData.models || !dateRange) return false; // Determine which types to check let typesToCheck; if (selectedTypes && selectedTypes.length > 0) { // Specific types selected - only check those typesToCheck = selectedTypes; } else { // No types selected - check ALL types that exist for this person typesToCheck = Object.keys(personData.models); } // Check if ANY model of the selected types has a date within the range for (const modelType of typesToCheck) { const models = personData.models[modelType]; if (models && models.length > 0) { for (const model of models) { if (model.uploadedAt && isWithinDateRange(model.uploadedAt, dateRange)) { return true; // Found at least one upload within the range } } } } return false; // No uploads found within the range } function searchModelsModern(value) { const lowerCaseValue = value.toLowerCase(); const sortBy = getSortBy(); const dateRange = getDateRange(); const pageSize = getPageSize(); // Get which model types are selected const selectedTypes = getSelectedTypes(); // Filter by search term and type let filtered = presenceModels.filter((element) => { if (isMultiLoraEnabled) { const typesToCheck = selectedTypes.length > 0 ? selectedTypes : null; if (!hasMultiLoraForTypes(element.key, typesToCheck)) return false; } return ( (element.key.toLowerCase().includes(lowerCaseValue) || value === '*') && filterByType(element) && filterByGender(element) && filterByTags(element) ); }); // Filter by date range if (dateRange) { filtered = filtered.filter((element) => { // Check if this person has ANY upload within the date range // for the selected types (or all types if none selected) return hasAnyUploadInDateRange(element.key, selectedTypes, dateRange); }); } // Sort - pass selectedTypes AND dateRange when sorting by date const isSortingByDate = sortBy.includes('date') || sortBy.includes('daily'); filtered = sortModels( filtered, sortBy, (isSortingByDate && selectedTypes.length > 0) ? selectedTypes : null, dateRange // Pass the date range for sorting too! ); // Store for pagination filteredResults = filtered; // Calculate total pages if (pageSize === Infinity) { totalPages = 1; } else { totalPages = Math.ceil(filtered.length / pageSize); } // Ensure current page is valid if (currentPage > totalPages) { currentPage = Math.max(1, totalPages); } document.getElementById('found').value = filtered.length; renderCurrentPage(); } // Override the searchModels function window.searchModels = searchModelsModern; // Copy person link to clipboard function copyPersonLink(personKey, iconElement) { const url = new URL(window.location.href); url.searchParams.set('personcode', personKey); navigator.clipboard.writeText(url.toString()).then(() => { // Visual feedback iconElement.classList.add('copied'); iconElement.title = 'Link copied!'; setTimeout(() => { iconElement.classList.remove('copied'); iconElement.title = `Copy link to ${personKey}`; }, 2000); }).catch(err => { console.error('Failed to copy link:', err); alert('Failed to copy link to clipboard'); }); } // Check for URL parameters and auto-search/open modal function checkUrlParams() { const urlParams = new URLSearchParams(window.location.search); const personcode = urlParams.get('personcode'); const dateFrom = urlParams.get('dateFrom'); const dateTo = urlParams.get('dateTo'); // Set date filters from URL if provided if (dateFrom) { document.getElementById('dateFrom').value = dateFrom; } if (dateTo) { document.getElementById('dateTo').value = dateTo; } if (personcode) { // Set the search value document.getElementById('search').value = personcode; // Perform the search searchModels(personcode); // Try to find and open the modal for the person setTimeout(() => { const lowerPersoncode = personcode.toLowerCase(); const matchingPerson = presenceModels.find(element => element.key.toLowerCase() === lowerPersoncode ); if (matchingPerson) { openModal(matchingPerson); } }, 100); } else { searchModels(getCurrentSearchValue()); } } checkUrlParams(); // Image navigation for modal let currentImages = []; let currentImageIndex = 0; let currentPersonKey = ''; function getFilenameFromUrl(url) { if (!url) return ''; try { const resolved = new URL(url, window.location.href); const base = resolved.pathname.split('/').pop() ?? ''; return decodeURIComponent(base); } catch (_error) { const withoutQuery = url.split('?')[0]; const base = withoutQuery.split('/').pop() ?? ''; return decodeURIComponent(base); } } function getThumbnailUrl(personKey) { return `https://huggingface.co/datasets/malcolmrey/samples/resolve/main/thumbnails/${encodeURIComponent(personKey)}.jpg`; } function buildImagesList(personKey, personData) { const images = []; const hfImages = window.hfImages || {}; const personHFImages = hfImages[personKey] || {}; const civitaiTypMapping = { 'LoCon': 'LyCORIS', 'LORA': 'Lora', 'TextualInversion': 'Embedding' }; // 0. Thumbnail has absolute highest priority — local file, loads instantly const thumbnailsData = window.thumbnails || {}; if (thumbnailsData[personKey]) { images.push({ url: getThumbnailUrl(personKey), framework: 'Thumbnail', filename: `${personKey}.jpg`, }); } // 1. Add ZBase samples first (from HF samples data) - highest priority if (personHFImages.ZBase) { images.push(...personHFImages.ZBase); } // 2. Add ZImage samples next (from HF samples data) if (personHFImages.ZImage) { images.push(...personHFImages.ZImage); } // 3. Add Klein9 samples second (from HF samples data) if (personHFImages.Klein9) { images.push(...personHFImages.Klein9); } // 4. Add Ernie samples (from HF samples data) if (personHFImages.Ernie) { images.push(...personHFImages.Ernie); } // 4b. Add Ideogram4 samples (from HF samples data) if (personHFImages.Ideogram4) { images.push(...personHFImages.Ideogram4); } // 4c. Add Krea2 samples (from HF samples data) if (personHFImages.Krea2) { images.push(...personHFImages.Krea2); } // 4c-bis. Add Qwen Image 2.1 samples (from HF samples data) if (personHFImages.Qwen) { images.push(...personHFImages.Qwen); } // 4d. Add MinimaxH3 samples (from HF samples data) if (personHFImages.MinimaxH3) { images.push(...personHFImages.MinimaxH3); } // 5. Add WAN samples (from HF samples data) if (personHFImages.WAN) { images.push(...personHFImages.WAN); } // 5. Add LTX samples (from HF samples data) if (personHFImages.LTX) { images.push(...personHFImages.LTX); } // 5. Add Civitai images by type // Check each framework in personData for Civitai models const checkCivitaiImage = (framework, civitaiModels) => { if (!civitaiModels) return; const civitaiModel = civitaiModels.find(m => { const normalizedName = m.name.toLowerCase().replaceAll(' ', '').replaceAll('-', '').replaceAll("'", ''); return normalizedName === personKey; }); if (civitaiModel && civitaiModel.imageUrl) { const mappedFramework = civitaiTypMapping[civitaiModel.type] || civitaiModel.type; if (mappedFramework !== 'Civitai') { images.push({ url: civitaiModel.imageUrl, framework: mappedFramework, filename: getFilenameFromUrl(civitaiModel.imageUrl), }); } } }; checkCivitaiImage('LyCORIS', models.lycorises); checkCivitaiImage('Lora', models.loras); checkCivitaiImage('Embedding', models.embeddings); checkCivitaiImage('Flux', models.fluxes); checkCivitaiImage('WAN', models.wans); checkCivitaiImage('SDXL', models.sdxls); if (models.ltxes) { checkCivitaiImage('LTX', models.ltxes); } checkCivitaiImage('Qwen', models.qwens); // 6. Add other HF samples (excluding ZImage, Klein9, Qwen, WAN and LTX which are already added) const frameworkOrder = ['LyCORIS', 'Lora', 'Embedding', 'Flux', 'SDXL']; for (const fw of frameworkOrder) { if (personHFImages[fw]) { images.push(...personHFImages[fw]); } } return images; } function updateImageDisplay() { const modalImage = document.getElementById('modalImage'); const modalVideo = document.getElementById('modalVideo'); const imageCounter = document.getElementById('imageCounter'); const frameworkLabel = document.getElementById('frameworkLabel'); const imageInfo = document.getElementById('imageInfo'); const prevBtn = document.getElementById('prevImageBtn'); const nextBtn = document.getElementById('nextImageBtn'); const downloadBtn = document.getElementById('modalDownloadBtn'); const downloadTooltip = document.getElementById('modalDownloadTooltip'); if (currentImages.length > 0) { const currentImage = currentImages[currentImageIndex]; const imageName = currentImage.filename || getFilenameFromUrl(currentImage.url) || currentPersonKey; const isVideo = currentImage.url.toLowerCase().endsWith('.mp4'); if (isVideo) { if (modalVideo) { modalVideo.src = currentImage.url; modalVideo.style.display = 'block'; } modalImage.style.display = 'none'; } else { modalImage.src = currentImage.url; modalImage.alt = imageName; modalImage.style.display = 'block'; if (modalVideo) { modalVideo.pause?.(); modalVideo.removeAttribute('src'); modalVideo.load?.(); modalVideo.style.display = 'none'; } } const isThumbnailImage = currentImage.framework === 'Thumbnail'; if (downloadBtn) { downloadBtn.style.display = isThumbnailImage ? 'none' : 'flex'; } if (downloadTooltip) { downloadTooltip.textContent = imageName; } if (currentImages.length > 1) { imageCounter.textContent = `${currentImageIndex + 1} / ${currentImages.length}`; imageInfo.style.display = 'flex'; prevBtn.style.display = 'flex'; nextBtn.style.display = 'flex'; } else { imageCounter.textContent = ''; prevBtn.style.display = 'none'; nextBtn.style.display = 'none'; imageInfo.style.display = 'flex'; } const frameworkDisplayName = isThumbnailImage ? 'THUMBNAIL' : currentImage.framework === 'ZImage' ? 'ZTURBO' : currentImage.framework; frameworkLabel.textContent = frameworkDisplayName; frameworkLabel.setAttribute('data-framework', currentImage.framework); } else if (downloadBtn) { downloadBtn.style.display = 'none'; } } function previousImage() { if (currentImages.length > 1) { currentImageIndex = (currentImageIndex - 1 + currentImages.length) % currentImages.length; updateImageDisplay(); } } function nextImage() { if (currentImages.length > 1) { currentImageIndex = (currentImageIndex + 1) % currentImages.length; updateImageDisplay(); } } function downloadCurrentImage() { if (!currentImages.length) { return; } const currentImage = currentImages[currentImageIndex]; const imageName = currentImage.filename || getFilenameFromUrl(currentImage.url) || currentPersonKey; downloadImage(currentImage.url, imageName); } async function downloadAllImages() { if (!currentImages.length) { return; } for (const image of currentImages) { const imageName = image.filename || getFilenameFromUrl(image.url) || currentPersonKey; await downloadImage(image.url, imageName); await new Promise((resolve) => setTimeout(resolve, 120)); } } // Update openModal to use image navigation const originalOpenModal = openModal; openModal = function(element) { currentPersonKey = element.key; currentImages = buildImagesList(element.key, element); currentImageIndex = 0; originalOpenModal(element); if (currentImages.length > 0) { updateImageDisplay(); } }; // Keyboard navigation document.addEventListener('keydown', function(e) { const modal = document.getElementById('modalOverlay'); const dailyModal = document.getElementById('dailyUploadsModal'); if (e.key === 'Escape') { if (dailyModal.classList.contains('active')) { closeDailyUploadsModal(); } else if (modal.classList.contains('active')) { closeModal(); } } if (modal.classList.contains('active')) { if (e.key === 'ArrowLeft') { e.preventDefault(); previousImage(); } else if (e.key === 'ArrowRight') { e.preventDefault(); nextImage(); } } }); // Utility functions function escapeHtml(text) { const div = document.createElement('div'); div.textContent = text; return div.innerHTML; } async function downloadImage(url, filename) { if (!url) return; const fallbackName = filename || 'image'; try { const response = await fetch(url); if (!response.ok) { throw new Error('Failed to fetch image'); } const blob = await response.blob(); const objectUrl = URL.createObjectURL(blob); const anchor = document.createElement('a'); anchor.href = objectUrl; anchor.download = fallbackName; document.body.appendChild(anchor); anchor.click(); anchor.remove(); URL.revokeObjectURL(objectUrl); } catch (_error) { const anchor = document.createElement('a'); anchor.href = url; anchor.download = fallbackName; anchor.target = '_blank'; anchor.rel = 'noopener'; document.body.appendChild(anchor); anchor.click(); anchor.remove(); } } function getCurrentSearchValue() { return document.getElementById('search').value; } function clearCurrentSearchValue() { document.getElementById('search').value = ''; } </script> </body> </html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Mal's Models</title>
<script type="text/javascript" src="data-civitai.js"></script>
<script type="text/javascript" src="data-huggingface.js"></script>
<script type="text/javascript" src="data-filenames.js"></script>
<script type="text/javascript" src="data-hf-images.js"></script>
<script type="text/javascript" src="data-thumbnails.js"></script>
<script type="text/javascript" src="data-hf-uploaded.js"></script>
<script type="text/javascript" src="data-huggingface-loras.js"></script>
<script type="text/javascript" src="data-person-classifications.js"></script>
<script type="text/javascript" src="data-person-tags.js"></script>
<script type="text/javascript" src="data-person-urls.js"></script>
<script type="text/javascript" src="comparator.js"></script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
<style>
/* Theme CSS Variables */
:root {
/* Dark theme (default) */
--bg-gradient-start: #0f172a;
--bg-gradient-end: #1e293b;
--text-primary: #f1f5f9;
--text-secondary: #94a3b8;
--text-muted: #64748b;
--link-color: #60a5fa;
--link-hover: #93c5fd;
--card-bg: rgba(30, 41, 59, 0.7);
--card-bg-solid: #1e293b;
--card-border: rgba(148, 163, 184, 0.1);
--input-bg: rgba(15, 23, 42, 0.6);
--input-border: rgba(148, 163, 184, 0.2);
--input-text: #e2e8f0;
--hover-bg: rgba(96, 165, 250, 0.2);
--modal-overlay: rgba(0, 0, 0, 0.8);
--shadow-color: rgba(0, 0, 0, 0.3);
--accent-blue: #60a5fa;
--accent-purple: #a78bfa;
}
[data-theme="light"] {
--bg-gradient-start: #f8fafc;
--bg-gradient-end: #e2e8f0;
--text-primary: #1e293b;
--text-secondary: #475569;
--text-muted: #64748b;
--link-color: #2563eb;
--link-hover: #1d4ed8;
--card-bg: rgba(255, 255, 255, 0.9);
--card-bg-solid: #ffffff;
--card-border: rgba(148, 163, 184, 0.3);
--input-bg: rgba(255, 255, 255, 0.8);
--input-border: rgba(148, 163, 184, 0.4);
--input-text: #1e293b;
--hover-bg: rgba(37, 99, 235, 0.1);
--modal-overlay: rgba(0, 0, 0, 0.5);
--shadow-color: rgba(0, 0, 0, 0.1);
--accent-blue: #2563eb;
--accent-purple: #7c3aed;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
color: var(--text-primary);
min-height: 100vh;
padding: 20px;
transition: background 0.3s ease, color 0.3s ease;
}
a {
text-decoration: none;
color: var(--link-color);
transition: color 0.2s;
}
a:hover {
color: var(--link-hover);
}
.header {
max-width: 1400px;
margin: 0 auto 30px;
background: var(--card-bg);
backdrop-filter: blur(10px);
border-radius: 16px;
padding: 24px;
box-shadow: 0 8px 32px var(--shadow-color);
border: 1px solid var(--card-border);
transition: background 0.3s ease, border-color 0.3s ease;