-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
255 lines (240 loc) · 15.3 KB
/
index.html
File metadata and controls
255 lines (240 loc) · 15.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title id="page-title">Catalog</title>
<script src="config.js"></script>
<script>
// Immediate setup - must run before DOM/CSS
try {
if (typeof CONFIG === 'undefined') {
throw new Error('CONFIG object is not defined. Please ensure config.js is loaded correctly.');
}
document.title = CONFIG.CATALOG_TITLE || 'Catalog';
document.documentElement.style.setProperty('--color-primary', CONFIG.COLORS?.primary || '#92991c');
document.documentElement.style.setProperty('--color-secondary', CONFIG.COLORS?.secondary || '#5d8095');
document.documentElement.style.setProperty('--color-accent', CONFIG.COLORS?.accent || '#0097b2');
document.documentElement.style.setProperty('--color-accent-dark', CONFIG.COLORS?.accentDark || '#4fd1eb');
document.documentElement.style.setProperty('--color-tag', CONFIG.COLORS?.tag || '#9bcb5e');
document.documentElement.style.setProperty('--font-family', CONFIG.FONT_FAMILY || 'Inter');
} catch (error) {
console.error('Error loading configuration:', error);
// Set fallback values
document.title = 'Catalog';
document.documentElement.style.setProperty('--color-primary', '#92991c');
document.documentElement.style.setProperty('--color-secondary', '#5d8095');
document.documentElement.style.setProperty('--color-accent', '#0097b2');
document.documentElement.style.setProperty('--color-accent-dark', '#4fd1eb');
document.documentElement.style.setProperty('--color-tag', '#9bcb5e');
document.documentElement.style.setProperty('--font-family', 'Inter');
// Display error message
document.addEventListener('DOMContentLoaded', function () {
const errorDiv = document.createElement('div');
errorDiv.style.cssText = 'position: fixed; top: 20px; left: 50%; transform: translateX(-50%); background: #fee; color: #c33; padding: 15px 20px; border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); z-index: 10000; max-width: 90%; text-align: center;';
errorDiv.innerHTML = '<strong>Configuration Error:</strong> Failed to load config.js. Using default settings.';
document.body.appendChild(errorDiv);
setTimeout(() => errorDiv.remove(), 10000);
});
}
</script>
<script>
// Check localStorage or System Preference on load to avoid FOUC
document.documentElement.classList.toggle(
"dark",
localStorage.theme === "dark" ||
(!("theme" in localStorage) && window.matchMedia("(prefers-color-scheme: dark)").matches),
);
</script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link id="font-link" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
rel="stylesheet">
<script>
// Update Google Fonts link based on config
try {
if (typeof CONFIG !== 'undefined' && CONFIG.FONT_FAMILY) {
const fontFamily = CONFIG.FONT_FAMILY.replace(/\s+/g, '+');
const fontLink = document.getElementById('font-link');
if (fontLink) {
fontLink.href = `https://fonts.googleapis.com/css2?family=${fontFamily}:wght@400;500;600;700&display=swap`;
}
}
} catch (error) {
console.error('Error setting font:', error);
}
</script>
<link rel="stylesheet" href="style.css">
<link rel="icon" id="favicon-link" href="" type="image/png">
<script>
// Set favicon from config
document.addEventListener('DOMContentLoaded', function () {
try {
if (typeof CONFIG !== 'undefined' && CONFIG.FAVICON_URL) {
document.getElementById('favicon-link').href = CONFIG.FAVICON_URL;
}
} catch (error) {
console.error('Error setting favicon:', error);
}
});
</script>
</head>
<body class="p-8 bg-gray-100 dark:bg-slate-900 transition-colors duration-200">
<!-- GitHub Ribbon -->
<a id="github-ribbon" href="#" target="_blank"
class="fixed top-6 right-6 hidden md:flex items-center gap-3 text-white py-2 px-4 rounded-lg shadow-md transition-all z-50 no-underline group font-sans border border-white/10">
<!-- Github Logo -->
<div class="flex-shrink-0">
<svg class="w-10 h-10 text-white" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true">
<path fill-rule="evenodd"
d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z"
clip-rule="evenodd"></path>
</svg>
</div>
<div class="flex flex-col justify-center">
<!-- Github Text -->
<span class="font-normal text-base leading-tight mb-0.5">GitHub</span>
<!-- Stats Container -->
<div class="flex items-center gap-3 text-xs font-light text-indigo-100">
<!-- Version -->
<div id="gh-version-container" class="hidden items-center gap-1">
<svg class="w-3 h-3 opacity-70" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z">
</path>
</svg>
<span id="gh-tag">...</span>
</div>
<!-- Stars -->
<div id="gh-star-container" class="hidden items-center gap-1">
<svg class="w-3 h-3 opacity-70" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z">
</path>
</svg>
<span id="gh-stars">--</span>
</div>
<!-- Forks -->
<div id="gh-fork-container" class="hidden items-center gap-1">
<svg class="w-3 h-3 opacity-70" fill="none" stroke="currentColor" viewBox="0 0 24 24"
stroke-linecap="round" stroke-linejoin="round" stroke-width="2">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M12 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" />
<path d="M7 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" />
<path d="M17 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" />
<path d="M7 8v2a2 2 0 0 0 2 2h6a2 2 0 0 0 2 -2v-2" />
<path d="M12 12l0 4" />
</svg>
<span id="gh-forks">--</span>
</div>
</div>
</div>
</a>
<button id="themeToggleBtn"
class="fixed top-6 left-6 z-50 p-2 rounded-lg bg-gray-200 dark:bg-slate-700 text-gray-800 dark:text-yellow-400 shadow-md hover:bg-gray-300 dark:hover:bg-slate-600 transition-all"
aria-label="Toggle Dark Mode">
<svg class="w-6 h-6 block dark:hidden" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z">
</path>
</svg>
<svg class="w-6 h-6 hidden dark:block" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"></path>
</svg>
</button>
<!-- Main Content Container -->
<div class="max-w-[95%] xl:max-w-[1440px] 2xl:max-w-[1600px] mx-auto">
<!-- Header Section -->
<header class="mb-8 text-center">
<img id="logo-img" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"
alt="Organization Logo" class="mx-auto mb-4 w-28 opacity-0 transition-opacity duration-300">
<h1 id="header-title" class="text-4xl font-extrabold mb-2"></h1>
<p id="header-description" class="text-xl text-gray-600 dark:text-gray-400"></p>
</header>
<!-- Search and Filter Section -->
<section class="mb-8">
<div
class="flex flex-col md:flex-row items-center justify-between gap-4 p-6 bg-white dark:bg-slate-800 shadow-md rounded-xl transition-colors duration-200">
<!-- Search Input -->
<div class="relative w-full md:w-1/3">
<input type="text" id="searchInput" placeholder="Search by keyword or tag..."
class="w-full pl-10 pr-4 py-2 border border-gray-300 dark:border-slate-600 rounded-lg dark:bg-slate-700 dark:text-white focus:ring-2 focus:border-transparent transition-all">
<svg class="w-5 h-5 absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400" fill="none"
stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"></path>
</svg>
</div>
<!-- Filters -->
<div class="flex flex-col sm:flex-row gap-4 w-full md:w-auto">
<!-- Repository Type Dropdown -->
<div class="w-full sm:w-auto">
<label for="repoType" class="sr-only">Repository Type</label>
<select id="repoType"
class="w-full py-2 px-4 border border-gray-300 dark:border-slate-600 rounded-lg bg-gray-50 dark:bg-slate-700 text-gray-700 dark:text-white transition-all focus:ring-2 focus:border-transparent">
<option value="all">Search All</option>
<option value="code">Code</option>
<option value="datasets">Datasets</option>
<option value="models">Models</option>
<option value="spaces">Spaces</option>
</select>
</div>
<!-- Sort by Dropdown -->
<div class="w-full sm:w-auto">
<label for="sortBy" class="sr-only">Sort By</label>
<select id="sortBy"
class="w-full py-2 px-4 border border-gray-300 dark:border-slate-600 rounded-lg bg-gray-50 dark:bg-slate-700 text-gray-700 dark:text-white transition-all focus:ring-2 focus:border-transparent">
<option value="lastModified">Last Updated (Newest)</option>
<option value="createdAt">Date Created (Newest)</option>
<option value="stars_desc">Stars / Likes (Highest)</option>
<option value="stars_asc">Stars / Likes (Lowest)</option>
<option value="alphabetical_asc">Alphabetical (A-Z)</option>
<option value="alphabetical_desc">Alphabetical (Z-A)</option>
</select>
</div>
<!-- Filter by Tags (Optional) -->
<div class="w-full sm:w-auto">
<label for="tagFilter" class="sr-only">Filter By Tag</label>
<select id="tagFilter"
class="w-full py-2 px-4 border border-gray-300 dark:border-slate-600 rounded-lg bg-gray-50 dark:bg-slate-700 text-gray-700 dark:text-white transition-all focus:ring-2 focus:border-transparent">
<option value="">All Tags</option>
</select>
</div>
</div>
</div>
</section>
<!-- Item Cards Container -->
<section>
<div id="itemList" class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6">
<!-- Skeleton Loading State (Initially displayed) -->
<div class="skeleton-card skeleton rounded-xl p-6 h-64"></div>
<div class="skeleton-card skeleton rounded-xl p-6 h-64 hidden sm:block bg-gray-200 dark:bg-slate-800">
</div>
<div class="skeleton-card skeleton rounded-xl p-6 h-64 hidden lg:block bg-gray-200 dark:bg-slate-800">
</div>
<div class="skeleton-card skeleton rounded-xl p-6 h-64 hidden xl:block bg-gray-200 dark:bg-slate-800">
</div>
</div>
<!-- Empty State Message -->
<div id="emptyState" class="hidden text-center text-gray-500 text-lg mt-10">
<p>No items found matching your criteria.</p>
</div>
</section>
</div>
<script type="module" src="main.js"></script>
<!-- Grant Acknowledgement -->
<footer class="mt-12 text-gray-500">
<p>
This work was supported by the <a href="https://imageomics.org" target="_blank"
class="text-[#0097b2] hover:underline">Imageomics Institute</a>.
The Imageomics Institute is funded by the US National Science Foundation's Harnessing the Data Revolution
(HDR) program under <a href="https://www.nsf.gov/awardsearch/showAward?AWD_ID=2118240" target="_blank"
class="text-[#0097b2] hover:underline">Award #2118240</a> (Imageomics: A New Frontier of Biological
Information Powered by Knowledge-Guided Machine Learning).
Any opinions, findings, conclusions, or recommendations expressed in this material are those of the
author(s) and do not necessarily reflect the views of the National Science Foundation.
</p>
</footer>
</body>
</html>