-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
496 lines (431 loc) · 19.2 KB
/
Copy pathindex.html
File metadata and controls
496 lines (431 loc) · 19.2 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
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Alexandra A. de Sousa</title>
<meta name="description" content="Evolutionary Neuroscientist studying how brains develop, function, and evolve across species. This site links to research tools, featured projects, social profiles, and selected publications." />
<meta property="og:title" content="Alexandra A. de Sousa" />
<meta property="og:description" content="Evolutionary Neuroscientist studying how brains develop, function, and evolve across species. This site links to research tools, featured projects, social profiles, and selected publications." />
<meta property="og:type" content="website" />
<style>
:root {
--bg: #f9f9f9;
--text: #222;
--muted: #555;
--accent: #0a65c0;
--accent-dark: #084f96;
--card: #ffffff;
--border: #e6e6e6;
}
* { box-sizing: border-box; }
body {
margin: 0;
font-family: Arial, Helvetica, sans-serif;
background:
linear-gradient(rgba(249,249,249,0.75), rgba(249,249,249,0.75)),
url("images/cortex_ouy421V1.jpg");
background-size: cover;
background-attachment: fixed;
color: var(--text);
line-height: 1.6;
}
.container { max-width: 960px; margin: 48px auto; padding: 0 24px; }
header { text-align: center; margin-bottom: 24px; }
h1 { margin: 0 0 8px; font-size: 2rem; }
.profile-photo {
width: 160px;
height: 160px;
border-radius: 50%;
object-fit: cover;
margin: 0 auto 16px;
display: block;
border: 2px solid var(--border);
}
.subtitle { color: var(--muted); font-size: 1rem; }
.grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
gap: 16px;
}
.card {
background: var(--card);
border: 1px solid var(--border);
border-radius: 12px;
padding: 20px;
box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.btn {
display: inline-block;
padding: 10px 16px;
background: var(--accent);
color: #fff;
text-decoration: none;
border-radius: 8px;
font-weight: bold;
transition: background 0.15s ease-in-out;
}
.btn:hover { background: var(--accent-dark); }
.link-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.tag {
display: inline-block;
padding: 8px 12px;
border: 1px solid var(--border);
border-radius: 999px;
background: #fff;
color: var(--accent-dark);
text-decoration: none;
font-weight: 600;
}
.tag:hover { background: #f0f6ff; }
/* Publications UI */
.controls { display: flex; gap: 12px; align-items: center; flex-wrap: wrap }
.controls label { font-weight: 600 }
select, input[type="search"] { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px }
.links { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.link { color: var(--accent-dark); text-decoration: underline; cursor: pointer }
.link:hover { color: var(--accent) }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip { border: 1px solid var(--border); border-radius: 999px; background: #fff; color: var(--accent-dark); padding: 6px 10px; cursor: pointer; font-weight: 600 }
.chip.active { background: #eef4ff; color: #0a3d7a; border-color: #d6e6ff }
.pub { border-bottom: 1px solid var(--border); padding: 14px 0 }
.pub:last-child { border-bottom: 0 }
.pub .title { font-weight: 700 }
.pub .meta { color: var(--muted); font-size: .95rem }
.label-list { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px }
.label { font-size: .8rem; border: 1px solid var(--border); border-radius: 999px; padding: 3px 8px; color: var(--accent-dark); background: #fff }
.type-badge { margin-left: 6px; font-size: .75rem; background: #f3f6fb; border: 1px solid #d9e4f5; border-radius: 6px; padding: 2px 6px; color: #084f96 }
.empty { color: var(--muted); text-align: center; padding: 20px }
footer {
text-align: center;
color: var(--muted);
font-size: 0.9rem;
margin-top: 24px;
}
</style>
</head>
<body>
<div class="container">
<header>
<img src="images/me.jpg" alt="Portrait of Alexandra A. de Sousa" class="profile-photo" />
<h1>Alexandra A. de Sousa</h1>
<div class="subtitle">Evolutionary Neuroscientist</div>
</header>
<!-- Quick links -->
<section class="card">
<h2>About</h2>
<p>
I am an Evolutionary Neuroscientist focused on interdisciplinary, collaborative research.
Find here links to my profiles, tools, projects, and publications.
</p>
<div class="btns">
<a class="btn" href="https://sites.google.com/site/alexandraallisonsousa" target="_blank" rel="noopener">Google Site</a>
<a class="btn" href="https://github.com/AleAliSousa?tab=repositories" target="_blank" rel="noopener">GitHub Repositories</a>
</div>
<div class="link-row">
<a class="tag" href="https://x.com/AleAliSousa" target="_blank" rel="noopener">Twitter/X</a>
<a class="tag" href="https://www.linkedin.com/in/alexandra-allison-de-sousa-87784b2/" target="_blank" rel="noopener">LinkedIn</a>
<a class="tag" href="https://bsky.app/profile/alealisousa.bsky.social" target="_blank" rel="noopener">BlueSky</a>
</div>
</section>
<!-- Featured projects -->
<section class="card">
<h2>Featured Projects</h2>
<div class="grid">
<div class="card">
<h3>MiMe: Microscopy Metadata Index</h3>
<p>A centralized platform for researchers to discover, contribute, and manage histological metadata entries in MongoDB.</p>
<a class="btn" href="https://mime.connect-project.io/" target="_blank" rel="noopener">Open MIME</a>
</div>
<div class="card">
<h3>ShinierBrains</h3>
<p>Interactive web app to calculate encephalization and visualise data in Shiny.</p>
<a class="btn" href="https://alealisousa.shinyapps.io/ShinierBrains/" target="_blank" rel="noopener">Open ShinierBrains</a>
</div>
<div class="card">
<h3>The Integrative Biology of Brain Evolution (TIBBE)</h3>
<p>Special Topic Network on The Integrative Biology of Brain Evolution.</p>
<a class="btn" href="https://tibbe-network.github.io" target="_blank" rel="noopener">Visit TIBBE</a>
</div>
<div class="card">
<h3>OPEN — VIR</h3>
<p>Online Engagement Participation Network (OPEN) for Visual Impairment Research.</p>
<a class="btn" href="https://sites.google.com/view/open-vi-research" target="_blank" rel="noopener">Visit OPEN VIR</a>
</div>
<div class="card">
<h3>European Network for Brain Evolution Research (ENBER)</h3>
<p>International evolutionary neuroscience mailing list and resources.</p>
<a class="btn" href="http://sites.google.com/site/eurobrainevolnet/" target="_blank" rel="noopener">Visit ENBER</a>
</div>
<div class="card">
<h3>Brain Evolution in the News</h3>
<p>Public engagement blog and vodcast about brain evolution.</p>
<a class="btn" href="https://brainevolutionnews.blogspot.com" target="_blank" rel="noopener">Read the Blog</a>
</div>
</div>
</section>
<!-- Publications (embedded) -->
<section class="card" id="publications">
<h2>Selected Publications</h2>
<p style="margin-top:-10px; margin-bottom:16px; font-size:0.9rem; color:var(--muted);">
The default view shows a rotating selection of 6 randomized publications.
Use the filters below to view the full list.
</p>
<div id="pubFilters" class="card" style="margin-bottom:20px;">
<div class="controls" id="pub-filter-controls">
<label for="pubType">Type:</label>
<select id="pubType"><option value="">All types</option></select>
<label for="pubYear">Year:</label>
<select id="pubYear"><option value="">All years</option></select>
<label for="pubLogic">Label logic:</label>
<select id="pubLogic">
<option value="any">ANY</option>
<option value="all">ALL</option>
</select>
<label for="pubSearch">Search:</label>
<input type="search" id="pubSearch" placeholder="Title / authors / venue…" />
</div>
<div style="margin-top:12px; font-weight:600;">Labels:</div>
<div class="chips" id="pubLabelChips"></div>
<!-- Random preview controls (shown only in preview mode) -->
<div class="links" id="pubPreviewControls" style="display:none;">
<a id="pubShowAll" class="link" href="#">Show all</a>
</div>
<!-- Utility links -->
<div class="links">
<a id="pubClear" class="link" href="#">Clear</a>
<a id="pubShare" class="link" href="#">Copy link</a>
</div>
</div>
<div id="pubResults" class="card">
<div id="pubList"></div>
<div id="pubEmpty" class="empty" hidden>No publications match your filters.</div>
</div>
</section>
<footer>
© <span id="year"></span> Alexandra A. de Sousa
</footer>
</div>
<script>
// Footer year
document.getElementById('year').textContent = new Date().getFullYear();
// -------- Publications loader + UI --------
fetch('data/publications.json', { cache:'no-store' })
.then(r => {
if (!r.ok) throw new Error('Failed to load publications.json');
return r.json();
})
.then(initPublications)
.catch(err => {
console.error(err);
document.querySelector('#pubResults').innerHTML =
'<p style="color:#b00">Could not load publications.json</p>';
});
function initPublications(data){
const norm = s => (s||'').toString().trim().replace(/\s+/g,' ').toLowerCase();
const typeSel = document.getElementById('pubType');
const yearSel = document.getElementById('pubYear');
const logicSel = document.getElementById('pubLogic');
const searchEl = document.getElementById('pubSearch');
const chipBox = document.getElementById('pubLabelChips');
const listEl = document.getElementById('pubList');
const emptyEl = document.getElementById('pubEmpty');
const clearLink= document.getElementById('pubClear');
const shareLink= document.getElementById('pubShare');
const previewCtrls = document.getElementById('pubPreviewControls');
const showAllLink = document.getElementById('pubShowAll');
// Normalize labels & type, capture display casing
const labelDisplay = new Map();
const typeDisplay = new Map();
data.forEach(p => {
const labs = Array.isArray(p.labels) ? p.labels : [];
p.labels = labs.map(l => {
const n = norm(l);
if (n && !labelDisplay.has(n)) labelDisplay.set(n, l.toString().trim());
return n;
}).filter(Boolean);
const rawType = (p.type ?? '').toString().trim();
const t = norm(rawType) || 'other';
p.typeNorm = t;
if (!typeDisplay.has(t)) typeDisplay.set(t, rawType || 'Other');
});
// Facets
const labelKeys = Array.from(new Set(data.flatMap(p => p.labels))).sort((a,b)=>a.localeCompare(b));
const types = Array.from(new Set(data.map(p => p.typeNorm))).sort((a,b)=>a.localeCompare(b));
const years = Array.from(new Set(data.map(p => p.year))).sort((a,b)=>b-a);
// Populate selects
types.forEach(t => typeSel.insertAdjacentHTML('beforeend', `<option value="${t}">${typeDisplay.get(t) || t}</option>`));
years.forEach(y => yearSel.insertAdjacentHTML('beforeend', `<option value="${y}">${y}</option>`));
// ---- Random preview settings ----
const RANDOM_PREVIEW_COUNT = 6;
const RANDOM_ENABLED_BY_DEFAULT = true;
let seed = (Date.now() % 1e9);
function rand(){ seed = (seed * 1664525 + 1013904223) % 4294967296; return seed / 4294967296; }
function sampleRandom(arr, k){
if (k >= arr.length) return [...arr];
const a = arr.slice();
for (let i = a.length - 1; i > 0; i--) {
const j = Math.floor(rand() * (i + 1));
[a[i], a[j]] = [a[j], a[i]];
}
return a.slice(0, k);
}
// State & hash sync
const state = { type:'', labels:new Set(), mode:'any', year:'', q:'', preview:true };
function restoreFromHash(){
const h = new URLSearchParams(location.hash.replace(/^#/, ''));
state.type = (h.get('type') || '').toLowerCase();
state.mode = (h.get('mode')==='all') ? 'all' : 'any';
state.year = h.get('year') || '';
state.q = h.get('q') || '';
const tags = (h.get('tags') || '').split(',').map(t=>t.trim().toLowerCase()).filter(Boolean);
state.labels = new Set(tags);
if (!types.includes(state.type)) state.type = '';
typeSel.value = state.type;
logicSel.value = state.mode;
yearSel.value = state.year;
searchEl.value = state.q;
// Enable preview only if: randomness on, no hash or empty hash, and no filters
if (RANDOM_ENABLED_BY_DEFAULT) {
const noHash = !location.hash || location.hash === '#';
const noFilters = !state.type && !state.year && !state.q && state.labels.size === 0;
state.preview = noHash && noFilters;
} else {
state.preview = false;
}
}
function buildHash(){
const h = new URLSearchParams();
if (state.type) h.set('type', state.type);
if (state.labels.size) h.set('tags', Array.from(state.labels).join(','));
if (state.mode==='all') h.set('mode', 'all');
if (state.year) h.set('year', state.year);
if (state.q) h.set('q', state.q);
return h.toString() ? '#'+h.toString() : '';
}
function writeHash(){
history.replaceState(null, '', buildHash());
}
function renderChips(){
chipBox.innerHTML = labelKeys.map(k=>{
const active = state.labels.has(k) ? 'active' : '';
const text = labelDisplay.get(k) || k;
return `<button class="chip ${active}" data-key="${k}" aria-pressed="${active? 'true':'false'}">${text}</button>`;
}).join('') || '<span class="meta" style="color:#666">No labels found in data.</span>';
}
function matches(p){
const typeOK = state.type ? p.typeNorm === state.type : true;
const yearOK = state.year ? String(p.year) === String(state.year) : true;
const q = state.q.trim().toLowerCase();
const text = (p.title + ' ' + p.authors + ' ' + (p.venue||'')).toLowerCase();
const qOK = q ? text.includes(q) : true;
const sel = Array.from(state.labels);
const have = new Set(p.labels);
const labelsOK = sel.length === 0
? true
: (state.mode === 'any'
? sel.some(t => have.has(t))
: sel.every(t => have.has(t)));
return typeOK && yearOK && qOK && labelsOK;
}
function render(){
// Full matching set
const full = data
.filter(matches)
.sort((a,b)=> b.year - a.year || a.title.localeCompare(b.title));
// Random preview (if enabled & useful)
const items = (state.preview && full.length > RANDOM_PREVIEW_COUNT)
? sampleRandom(full, RANDOM_PREVIEW_COUNT)
: full;
// Toggle preview controls
if (state.preview && full.length > RANDOM_PREVIEW_COUNT) {
previewCtrls.style.display = '';
} else {
previewCtrls.style.display = 'none';
}
// Render list
listEl.innerHTML = items.map(p=>{
const titleHTML = p.url
? `<a href="${p.url}" target="_blank" rel="noopener">${p.title}</a>`
: p.title;
const doiHTML = p.doi
? ` — <a href="https://doi.org/${p.doi}" target="_blank" rel="noopener">DOI: ${p.doi}</a>`
: '';
const labels = (p.labels||[]).map(k=>`<span class="label">${labelDisplay.get(k) || k}</span>`).join('');
return `
<article class="pub">
<div class="title">
${titleHTML}
<span class="type-badge">${typeDisplay.get(p.typeNorm) || p.typeNorm}</span>
</div>
<div class="meta">
${p.authors} (${p.year})${p.venue ? ' — ' + p.venue : ''}${doiHTML}
</div>
<div class="label-list">${labels}</div>
</article>
`;
}).join('');
emptyEl.hidden = items.length > 0;
}
// Init
restoreFromHash();
renderChips();
render();
// ---- Events (turn preview off on interaction) ----
chipBox.addEventListener('click', e=>{
const b = e.target.closest('.chip'); if(!b) return;
const k = b.dataset.key;
state.labels.has(k) ? state.labels.delete(k) : state.labels.add(k);
state.preview = false; renderChips(); render(); writeHash();
});
typeSel.addEventListener('change', ()=>{ state.type = typeSel.value; state.preview = false; render(); writeHash(); });
yearSel.addEventListener('change', ()=>{ state.year = yearSel.value; state.preview = false; render(); writeHash(); });
logicSel.addEventListener('change',()=>{ state.mode = logicSel.value; state.preview = false; render(); writeHash(); });
searchEl.addEventListener('input',()=>{ state.q = searchEl.value; state.preview = false; render(); writeHash(); });
clearLink.addEventListener('click', (e)=>{
e.preventDefault();
state.type = '';
state.labels.clear();
state.mode = 'any';
state.year = '';
state.q = '';
state.preview = true; // empty state → preview again (no hash)
typeSel.value = '';
yearSel.value = '';
logicSel.value = 'any';
searchEl.value = '';
renderChips(); render();
history.replaceState(null, '', location.pathname);
});
showAllLink.addEventListener('click', (e)=>{
e.preventDefault();
state.preview = false; render(); // don’t change hash
});
shareLink.addEventListener('click', async (e)=>{
e.preventDefault();
const url = location.origin + location.pathname + buildHash();
try {
await navigator.clipboard.writeText(url);
const old = shareLink.textContent;
shareLink.textContent = 'Link copied!';
setTimeout(()=> shareLink.textContent = old, 1000);
} catch {
prompt('Copy this URL:', url);
}
});
// Back/forward
window.addEventListener('hashchange', ()=>{
restoreFromHash();
// Any hash means it’s an intentional filter state → disable preview
state.preview = false;
renderChips();
render();
});
}
</script>
<noscript>
<div class="container"><p><em>JavaScript is disabled — filtering requires JavaScript.</em></p></div>
</noscript>
</body>
</html>