-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresources.html
More file actions
175 lines (154 loc) · 9.7 KB
/
Copy pathresources.html
File metadata and controls
175 lines (154 loc) · 9.7 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>History and Mathematics in Education Resources | HaMiEN</title>
<meta name="description" content="Explore HaMiEN's growing collaborative library of books, research papers, websites, blogs and professional organisations.">
<link rel="stylesheet" href="style.css">
<link rel="canonical" href="https://historyand.mathsy.space/resources">
<style>
/* Tag element styling rules */
.filter-section-wrapper { margin: 20px 0; }
.tag-container-label { font-size: 0.95rem; font-weight: bold; margin-bottom: 6px; }
.inline-tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.tag-bubble-btn { background: #272d4215; color: var(--text-muted); border: 1px solid #272d4233; padding: 4px 10px; font-size: 0.85rem; border-radius: 20px; cursor: pointer; }
.tag-bubble-btn:hover { background: var(--accent-link); color: #fff; }
.tag-bubble-btn.active-tag { background: var(--accent); color: #fff; border-color: var(--accent); }
.resource-card { background: #272d4211; border: 1px solid var(--border-color); padding: 20px; border-radius: 8px; margin-bottom: 15px; }
.resource-card-type { display: inline-block; padding: 3px 8px; font-size: 0.7rem; font-weight: bold; text-transform: uppercase; background: #272d4222; border-radius: 4px; color: var(--accent-link); }
.resource-card-title a { color: var(--accent-link); text-decoration: underline; font-size: 1.25rem; font-weight: 700; }
.resource-card-title a:hover { color: var(--accent); }
.resource-card-desc { color: var(--text-muted); margin-top: 8px; }
.card-tags-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.card-mini-tag { font-size: 0.75rem; color: var(--text-muted); background: #272d4208; padding: 1px 6px; border-radius: 4px; border: 1px dashed #272d4222; }
.all-tags-footer-block { margin-top: 40px; padding: 20px; background: #272d4205; border-top: 2px solid var(--border-color); border-radius: 6px; font-size: 0.95rem; line-height: 1.8; }
.footer-clickable-tag-link { color: var(--accent-link); text-decoration: none; font-weight: 500; cursor: pointer; }
.footer-clickable-tag-link:hover { text-decoration: underline; color: var(--accent); }
</style>
<link rel="icon" type="image/png" href="hamien-network-logo.png">
</head>
<body>
<header>
<a href="index.html" class="header-brand-link">
<div class="heading-group">
<img src="hamien-network-logo.png" alt="HaMiEN Emblem" class="site-logo">
<div class="brand-text-wrapper">
<h1 class="network-title">The <span>H</span>a<span>M</span>i<span>E</span><span>N</span></h1>
<span class="network-acronym">HISTORY & MATHEMATICS IN EDUCATION</span>
</div>
</div>
</a>
<nav>
<a href="index.html">About</a>
<a href="get-involved.html">Get Involved</a>
<a href="resources.html" class="active">Resources</a>
<a href="events.html">Events</a>
<a href="contact.html">Contact</a>
</nav>
</header>
<main>
<h2>Network Resources</h2>
<p>Explore HaMiEN's growing collaborative library of books, research papers, websites, blogs and professional organisations that explore connections between history and mathematics in education. Resources are recommended by members of the network or selected because of their value for teachers, museum educators and researchers.</p>
<h3>Browse by resource type</h3>
<p>Use the filters below to browse resources by category, or explore the full collection.</p>
<div class="filter-section-wrapper">
<div class="bulk-controls" style="margin-bottom: 20px; display: flex; gap: 8px; flex-wrap: wrap;">
<button class="filter-btn active" id="cat-all" onclick="filterByCategory('all')">All Resources</button>
<button class="filter-btn" id="cat-blogs" onclick="filterByCategory('blogs')">Blogs</button>
<button class="filter-btn" id="cat-books" onclick="filterByCategory('books')">Books</button>
<button class="filter-btn" id="cat-classroom" onclick="filterByCategory('classroom')">Classroom Resources</button>
<button class="filter-btn" id="cat-papers" onclick="filterByCategory('papers')">Research Papers & Articles</button>
<button class="filter-btn" id="cat-societies" onclick="filterByCategory('societies')">Societies & Professional orgs</button>
<button class="filter-btn" id="cat-websites" onclick="filterByCategory('websites')">Websites</button>
</div>
</div>
<!-- Popular Tags Row Placement -->
<div class="filter-section-wrapper">
<div class="tag-container-label">Popular tags:</div>
<div class="inline-tag-row" id="popular-tags-list">Calculating...</div>
</div>
<!-- Main Output Directory Grid Box -->
<div id="resources-list" class="card-grid">Loading directory data...</div>
<!-- All Tags Footnote Block Placement -->
<div class="all-tags-footer-block">
<div class="tag-container-label" style="margin-bottom: 8px;">All tags:</div>
<div id="all-tags-list">Compiling...</div>
</div>
<p style="margin-top: 40px; font-size: 0.85rem; color: var(--text-muted); line-height: 1.5;">
* Whilst we prefer to share resources that are free and open, inevitably some are not: many of the books shared fall into this category, for example. In the interests of transparency, where referral links are used, the resources are marked with an asterisk. We always recommend shopping around for the best deals, but should you choose to make a purchase via a referral link listed here, it may contribute to costs relating to running and maintaining this website, and we thank you for it!
</p>
<footer></footer>
<hr>
<p style="font-style: italic; text-align: center;"> A <a href="https://mathsy.space" target="_blank">MathsyDotSpace</a> project by <a href="https://mathsy.space">TeaKayB</a></p>
</main>
<!-- Connect Local Arrays Dataset Script Link -->
<script src="resources-data.js"></script>
<script>
let currentCat = 'all', currentTag = 'all';
const clean = s => s ? s.trim().toLowerCase() : '';
function renderDirectory() {
const el = document.getElementById('resources-list');
if (!el || typeof HAMIEN_RESOURCES === 'undefined') return;
const data = HAMIEN_RESOURCES.filter(item => {
const matchCat = currentCat === 'all' || item.type.toLowerCase() === currentCat;
const itemTags = (item.tags || []).map(clean);
return matchCat && (currentTag === 'all' || itemTags.includes(clean(currentTag)));
});
if (!data.length) {
el.innerHTML = `<p style="color:var(--text-muted);padding:15px 0;">No matching assets found.</p>`;
return;
}
let cardsHtml = '';
data.forEach(item => {
const typeLabel = item.type === 'papers' ? 'Research Papers & Articles' : item.type === 'societies' ? 'Societies / Orgs' : item.type === 'classroom' ? 'Classroom Resources' : item.type;
// Build card tags step-by-step cleanly to avoid syntax traps
let tagsHtml = '';
if (item.tags && item.tags.length > 0) {
item.tags.forEach(t => {
const cleanedTag = clean(t);
if (cleanedTag) {
tagsHtml += `<span class="card-mini-tag" role="button" tabindex="0" onclick="setTag('${cleanedTag}')" onkeydown="if(event.key==='Enter') setTag('${cleanedTag}')" style="cursor:pointer; margin-right:4px;">#${cleanedTag}</span>`;
}
});
}
cardsHtml += `
<article class="resource-card">
<span class="resource-card-type">${typeLabel}</span>
<h3 class="resource-card-title"><a href="${item.link}" target="_blank" rel="noopener noreferrer">${item.title || 'Untitled'} ↗</a></h3>
<p class="resource-card-desc">${item.description || ''}</p>
<div class="card-tags-list">${tagsHtml}</div>
</article>
`;
});
el.innerHTML = cardsHtml;
}
function buildTags() {
if (typeof HAMIEN_RESOURCES === 'undefined') return;
const counts = {};
HAMIEN_RESOURCES.forEach(item => (item.tags || []).forEach(t => { const c = clean(t); if (c) counts[c] = (counts[c] || 0) + 1; }));
const pop = Object.keys(counts).sort((a,b) => counts[b] - counts[a]).slice(0,5);
const popRow = document.getElementById('popular-tags-list');
if (popRow) popRow.innerHTML = pop.map(t => `<button class="tag-bubble-btn ${currentTag===t?'active-tag':''}" onclick="setTag('${t}')">${t} (${counts[t]})</button>`).join('');
const alpha = Object.keys(counts).sort((a,b) => a.localeCompare(b));
const foot = document.getElementById('all-tags-list');
if (foot) foot.innerHTML = alpha.map((t, i) => `<span class="footer-clickable-tag-link" role="button" tabindex="0" onclick="setTag('${t}')" onkeydown="if(event.key==='Enter') setTag('${t}')">${t}</span><span> (${counts[t]})</span>${i===alpha.length-1?'':', '}`).join('');
}
function filterByCategory(cat) {
currentCat = cat.toLowerCase(); currentTag = 'all';
document.querySelectorAll('.bulk-controls .filter-btn').forEach(b => b.classList.remove('active'));
const btn = document.getElementById(`cat-${currentCat}`);
if (btn) btn.classList.add('active');
buildTags(); renderDirectory();
}
function setTag(tag) {
currentTag = currentTag === tag ? 'all' : tag;
buildTags(); renderDirectory();
document.querySelectorAll('.tag-bubble-btn').forEach(b => b.classList.toggle('active-tag', b.innerText.startsWith(tag) && currentTag !== 'all'));
}
// Run structural setups immediately
buildTags();
renderDirectory();
</script>
</body>
</html>