-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOCHA-Humanitarian-Icons-gallery.html
423 lines (354 loc) · 20.4 KB
/
OCHA-Humanitarian-Icons-gallery.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>United Nations OCHA Humanitarian Icons</title>
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet">
<style>
:root {
--ocha-blue: #009edb;
--ocha-dark-blue: #0074b7;
--ocha-light-blue: #c5dfef;
--ocha-shadow: #e3edf6;
}
body {
font-family: 'Roboto', sans-serif;
background-color: #f9f9f9;
margin: 0;
padding: 20px;
}
/* Header Container */
.header {
display: flex;
justify-content: flex-end;
/* Align to the right */
background-color: #f9f9f9;
/* Light background */
/* Removed sticky behavior */
}
/* Navigation Bar */
.nav-bar {
display: flex;
gap: 15px;
/* Space between links */
align-items: center;
}
/* Navigation Links */
.nav-link {
padding: 12px 18px;
/* Updated padding */
text-decoration: none;
font-weight: 500;
font-size: 16px;
color: #004987;
border-radius: 999px;
transition: background 0.3s ease, color 0.3s ease;
}
/* Active Tab Style */
.nav-link.active {
background-color: #009edb;
/* OCHA Blue */
color: white;
font-weight: 600;
}
/* Hover Effect */
.nav-link:hover {
background-color: #c5dfef;
/* Light blue on hover */
color: #004987;
}
h1 {
font-size: 3em;
}
/* Mobile Adjustment */
@media (max-width: 600px) {
h1 {
font-size: 2em;
/* Adjusted size for mobile screens */
}
}
h1,
p {
text-align: center;
max-width: 800px;
margin-left: auto;
margin-right: auto;
}
.search-box {
position: relative;
display: flex;
/* Flexbox for easy centering */
justify-content: center;
/* Center horizontally */
align-items: center;
/* Center vertically if needed */
margin: 0 auto 20px;
/* Center using auto margins */
width: 100%;
/* Full width container */
max-width: 680px;
/* Limit the max width for balance */
}
.search-box input {
padding: 12px 40px 12px 20px;
width: 100%;
/* Responsive width inside the container */
font-size: 16px;
border: 2px solid #009edb;
border-radius: 25px;
outline: none;
transition: all 0.3s ease;
box-sizing: border-box;
}
.search-box input:focus {
border-color: #004987;
box-shadow: 0 0 8px rgba(0, 158, 219, 0.6);
}
.search-icon {
position: absolute;
right: 15px;
top: 50%;
transform: translateY(-50%);
width: 20px;
height: 20px;
cursor: pointer;
opacity: 0.7;
transition: opacity 0.3s ease;
}
.search-icon:hover {
opacity: 1;
}
.icon-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
gap: 20px;
padding: 20px;
}
.icon-item {
background: white;
border: 1px solid #ddd;
/* border-radius: 12px;*/
padding: 20px;
text-align: center;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
display: flex;
flex-direction: column;
justify-content: space-between;
height: 190px;
}
.icon-item.white {
background: #262626;
}
.icon-item img {
width: 60px;
height: 60px;
object-fit: contain;
cursor: pointer;
}
.icon-name {
font-weight: bold;
margin: 10px 0;
}
.icon-item.white .icon-name {
color: white;
}
.copy-btn {
position: relative;
display: inline-block;
margin: 0 auto;
padding: 10px 20px;
background: var(--ocha-light-blue);
color: black;
margin-bottom: 8px;
border: 2px solid var(--ocha-dark-blue);
border-radius: 1.25em;
font-weight: 600;
text-transform: uppercase;
cursor: pointer;
outline: none;
transform-style: preserve-3d;
transition: transform 150ms cubic-bezier(0, 0, 0.58, 1), background 150ms cubic-bezier(0, 0, 0.58, 1);
}
.icon-item.white .copy-btn {
background: white;
color: black;
border: 2px solid black;
}
.copy-btn::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: var(--ocha-dark-blue);
border-radius: inherit;
box-shadow: 0 0 0 2px var(--ocha-dark-blue), 0 0.625em 0 0 var(--ocha-shadow);
transform: translate3d(0, 0.75em, -1em);
transition: transform 150ms cubic-bezier(0, 0, 0.58, 1), box-shadow 150ms cubic-bezier(0, 0, 0.58, 1);
z-index: -1;
}
.icon-item.white .copy-btn::before {
background: black;
box-shadow: 0 0 0 2px black, 0 0.625em 0 0 #4d4d4d;
}
.copy-btn:hover {
background: var(--ocha-shadow);
transform: translate(0, 0.25em);
}
.copy-btn:hover::before {
box-shadow: 0 0 0 2px var(--ocha-dark-blue), 0 0.5em 0 0 var(--ocha-shadow);
transform: translate3d(0, 0.5em, -1em);
}
.icon-item.white .copy-btn:hover::before {
box-shadow: 0 0 0 2px black, 0 0.5em 0 0 #4d4d4d;
}
.copy-btn:active {
background: var(--ocha-shadow);
transform: translate(0, 0.75em);
}
.copy-btn:active::before {
box-shadow: 0 0 0 2px var(--ocha-dark-blue), 0 0 var(--ocha-shadow);
transform: translate3d(0, 0, -1em);
}
.icon-item.white .copy-btn:active::before {
box-shadow: 0 0 0 2px black, 0 0 #4d4d4d;
}
footer {
text-align: center;
margin-top: 20px;
font-size: 14px;
color: #666;
margin-top: 2em;
border-top: solid 1px #e6e6e6;
padding-top: 1em;
}
footer a {
color: var(--ocha-blue);
text-decoration: none;
}
#copy-toast {
position: fixed;
text-align: center;
top: 20px;
left: 50%;
transform: translateX(-50%);
background-color: #262626;
color: white;
padding: 20px 44px;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
font-weight: bold;
font-size: 1em display: flex;
align-items: center;
gap: 26px;
/* Space between icon and text */
opacity: 0;
visibility: hidden;
transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s ease;
z-index: 9999;
}
.copy-icon {
width: 20px;
height: 20px;
vertical-align: middle;
margin-right: 12px;
}
</style>
</head>
<body>
<header class="header">
<nav class="nav-bar">
<a href="#" class="nav-link active" onclick="loadIcons('UN-blue', this)">UN blue</a>
<a href="#" class="nav-link" onclick="loadIcons('black', this)">Black</a>
<a href="#" class="nav-link" onclick="loadIcons('white', this)">White</a>
</nav>
</header>
<h1>United Nations OCHA<br> Humanitarian Icons</h1>
<p>Browse and download OCHA Humanitarian Icons in SVG format. <br>Click an icon to download, or copy its URL to embed in dashboards or websites.</p>
<div class="search-box">
<input type="text" id="searchInput" placeholder="Search icons..." onkeyup="filterIcons()">
<img src="https://raw.githubusercontent.com/UN-OCHA/humanitarian-icons/main/SVG/UN-blue/Search.svg" alt="Search Icon" class="search-icon">
</div>
<div class="icon-grid" id="iconGrid"></div>
<footer>
<p>The United Nations Officer for Humanitarian Affairs (OCHA) does not intend to establish an official meaning or endorsement for each Humanitarian Icon. Their meaning and representation do not imply acceptance or endorsement by the United Nations. These icons are provided solely as indicative resources, open to interpretation and flexible labeling, to support reporting and advocacy efforts around humanitarian crises.</p>
<p>The Humanitarian Icons are Public Domain. You can copy, modify, and distribute without asking permission. However, credit to OCHA would be appreciated and a notification to <a href="mailto:[email protected]">[email protected]</a> with a link to your webpage or publication for our records.</p>
<p>For more information, visit <a href="https://brand.unocha.org" target="_blank">brand.unocha.org</a>.</p>
</footer>
<div id="copy-toast">
<img src="https://raw.githubusercontent.com/UN-OCHA/humanitarian-icons/main/SVG/white/Copy.svg" alt="Copy Icon" class="copy-icon">
URL copied to clipboard!
</div>
<script>
const icons = ["Abduction-kidnapping.svg", "About.svg", "Add-document.svg", "Add.svg", "Advocacy.svg", "Affected-population.svg", "Agile.svg", "Agriculture.svg", "AI-chat.svg", "Airport-affected.svg", "Airport-closed.svg", "Airport-destroyed.svg", "Airport-military.svg", "Airport-not-affected.svg", "Airport.svg", "Alert.svg", "Analysis.svg", "Anticipatory-action.svg", "API.svg", "Apps.svg", "Arrest-detention.svg", "Assault.svg", "Assembly-point.svg", "Assessment.svg", "Attack.svg", "Bacteria.svg", "Blanket.svg", "Blog.svg", "Boat.svg", "Bookmark.svg", "Border-closed.svg", "Border-crossing.svg", "Borehole.svg", "Bottled-water.svg", "Bridge-affected.svg", "Bridge-closed.svg", "Bridge-destroyed.svg", "Bridge-not-affected.svg", "Bridge.svg", "Bucket.svg", "Buddhist-temple.svg", "Building-closed.svg", "Building-facility-affected.svg", "Building-facility-destroyed.svg", "Building-facility-not-affected.svg", "Building.svg", "Bus.svg", "Calendar.svg", "Camp-Coordination-and-Camp-Management.svg", "Car.svg", "Carjacking.svg", "Case-management.svg", "Cash-transfer.svg", "Cell-tower.svg", "Chart.svg", "Chat.svg", "Checked-mail.svg", "Checkpoint.svg", "Child-care-child-friendly.svg", "Child-combatant.svg", "Child-protection.svg", "Children.svg", "Church.svg", "Civil-military-coordination.svg", "Clinic.svg", "Clothing.svg", "Cold-wave.svg", "Communal-latrine.svg", "Community-building.svg", "Community-engagement.svg", "Computer.svg", "Confined.svg", "Conflict.svg", "Coordinated-assessement.svg", "Coordination.svg", "Copy.svg", "Country.svg", "COVID-19.svg", "CSV-file.svg", "Cyclone.svg", "Damaged-Affected.svg", "Dangerous-area.svg", "Data.svg", "Dead.svg", "Debris-management.svg", "Delete-account.svg", "Deployment.svg", "Destroyed.svg", "Detergent.svg", "Diplomatic-mission.svg", "Distribution-site.svg", "Doctor.svg", "Document.svg", "DOCX-file.svg", "Down.svg", "Download.svg", "Drought.svg", "Drowned.svg", "E-mail.svg", "Early-Recovery.svg", "Earthmound.svg", "Earthquake.svg", "Edit.svg", "Education.svg", "Elderly.svg", "Emergency-Telecommunications.svg", "Environment.svg", "Epidemic.svg", "Exit-Cancel.svg", "Expand-down.svg", "Expand-left.svg", "Expand-right.svg", "Expand-up.svg", "Famine.svg", "Favourite.svg", "Fax.svg", "Ferry.svg", "Film.svg", "Filter.svg", "Financing.svg", "Fire.svg", "Fishery.svg", "Flash-flood.svg", "Flood.svg", "Flour.svg", "Folder.svg", "Food-Security.svg", "Food-warehouse.svg", "Food.svg", "Forced-entry.svg", "Forced-recruitment.svg", "Fund.svg", "Gap-analysis.svg", "Gas-station.svg", "Gender-based-violence.svg", "Gender.svg", "Go.svg", "Government-office.svg", "Group.svg", "Handwashing.svg", "Harassment-intimidation.svg", "Health-facility-affected.svg", "Health-facility-destroyed.svg", "Health-facility-not-affected.svg", "Health-facility.svg", "Health-post.svg", "Health-worker.svg", "Health.svg", "Heatwave.svg", "Heavy-rain.svg", "Helicopter.svg", "Helipad.svg", "Help.svg", "Hidden.svg", "Hindu-temple.svg", "Hospital-bed.svg", "Hospital.svg", "Hotel.svg", "House-affected.svg", "House-burned.svg", "House-destroyed.svg", "House-lockdown.svg", "House-not-affected.svg", "House.svg", "Humanitarian-access.svg", "Humanitarian-programme-cycle.svg", "IDP-refugee-camp.svg", "Indigenous people.svg", "Infant.svg", "Infected.svg", "Infection-control.svg", "Information-management.svg", "Information-technology.svg", "Infrastructure.svg", "Injured.svg", "Innovation.svg", "Insect-infestation.svg", "Internally-displaced.svg", "Internet.svg", "Kitchen-set.svg", "Laboratory.svg", "Landslide-mudslide.svg", "Laptop.svg", "Latrine-cabin.svg", "Leadership.svg", "Learning.svg", "Life-saving.svg", "Link.svg", "Live-geoservices.svg", "Livelihood.svg", "Livestock.svg", "Location-lockdown.svg", "Location.svg", "Locust-infestation.svg", "Logistics.svg", "Map.svg", "Market-closed.svg", "Market.svg", "Mask.svg", "Mattress.svg", "Medical-supply.svg", "Medicine.svg", "Meeting.svg", "Menu.svg", "Military-gate.svg", "Mine.svg", "Missing.svg", "Mobile-clinic.svg", "Mobile-phone.svg", "Monitor.svg", "Monitoring.svg", "More-options.svg", "Mosque.svg", "Mosquito-net.svg", "Multi-cluster-sector.svg", "Murder.svg", "National-army.svg", "Needs-assessment.svg", "Next-item.svg", "NGO-office.svg", "Non-food-items-2.svg", "Non-food-items.svg", "Not-affected.svg", "Not-infected.svg", "Not-secured.svg", "Notification.svg", "Nutrition.svg", "Observation-tower.svg", "Oil-facility.svg", "Oil.svg", "Out-of-platform.svg", "P-code.svg", "Partnership.svg", "Password.svg", "Pause.svg", "PDF-file.svg", "Peacekeeping-force.svg", "People-affected.svg", "People-covered.svg", "People-in-need-2.svg", "People-in-need.svg", "People-reached.svg", "People-targeted-2.svg", "People-targeted.svg", "People-with-physical-impairments.svg", "Permanent-camp.svg", "Person-1.svg", "Person-2.svg", "Photo.svg", "Physical-closure.svg", "Physical-distancing.svg", "Plastic-sheeting.svg", "Police-station.svg", "Policy.svg", "Population-growth.svg", "Population-return.svg", "Port-affected.svg", "Port-closed.svg", "Port-destroyed.svg", "Port-not-affected.svg", "Port.svg", "Potable-water-source.svg", "Potable-water.svg", "Poverty.svg", "Power-electricity-affected.svg", "Power-electricity-not-affected.svg", "Power-electricity.svg", "Power-outage.svg", "Pregnant.svg", "Preparedness.svg", "Previous-item.svg", "Print.svg", "Protection.svg", "Public-information.svg", "Radio.svg", "Rebel.svg", "Reconstruction.svg", "Refugee.svg", "Registration.svg", "Relief-goods.svg", "Remote-support.svg", "Remove-document.svg", "Remove.svg", "Report.svg", "Reporting.svg", "Resettlement.svg", "Resilience.svg", "Respiratory.svg", "Response.svg", "Return.svg", "Rice.svg", "Road-affected.svg", "Road-barrier.svg", "Road-closed.svg", "Road-destroyed.svg", "Road-not-affected.svg", "Road.svg", "Roadblock.svg", "Robbery.svg", "Rule-of-law-and-justice.svg", "Rural-exodus.svg", "Rural.svg", "Safety-and-security.svg", "Salt.svg", "Sanitation.svg", "Sanitizer.svg", "Satellite-dish.svg", "Save.svg", "Scale-down-operation.svg", "Scale-up-operation.svg", "School-affected.svg", "School-closed.svg", "School-destroyed.svg", "School-not-affected.svg", "School.svg", "Search-and-rescue.svg", "Search.svg", "Secured.svg", "Security.svg", "See.svg", "Selected.svg", "Services-and-tools.svg", "Settings.svg", "Sex.svg", "Sexual-and-reproductive health.svg", "Sexual-violence.svg", "Share.svg", "Shelter.svg", "Ship.svg", "Shower.svg", "Smartphone.svg", "Snow-avalanche.svg", "Snowfall.svg", "Soap.svg", "Solid-waste.svg", "Spontaneous-site.svg", "Spring-water.svg", "Staff-management.svg", "Stop.svg", "Storm-surge.svg", "Storm.svg", "Stove.svg", "Submersible-pump.svg", "Sugar.svg", "Table.svg", "Tarpaulin.svg", "Technological-disaster.svg", "Temporary-camp.svg", "Tent.svg", "Testing.svg", "Time.svg", "Toilet.svg", "Top-ranking.svg", "Tornado.svg", "Trade-and-market.svg", "Train.svg", "Training.svg", "Transition-site.svg", "Trending.svg", "Truck.svg", "Tsunami.svg", "Tunnel.svg", "UN-compound-office.svg", "UN-vehicle.svg", "University.svg", "Up.svg", "Upload.svg", "Urban-rural.svg", "Urban.svg", "User.svg", "Users.svg", "Vaccine.svg", "Validate-account.svg", "Ventilator.svg", "Video.svg", "Violent-wind.svg", "Virus.svg", "Volcano.svg", "Walkie-talkie.svg", "Warning-Error.svg", "Water-Sanitation-and-Hygiene.svg", "Water-source.svg", "Water-trucking.svg", "Work-from-home.svg", "Worm-infestation.svg", "XLSX-file.svg", "ZIP-compressed.svg"];
function loadIcons(folder, link) {
// Remove 'active' class from all links and add it to the clicked one
document.querySelectorAll('.nav-link').forEach(nav => nav.classList.remove('active'));
link.classList.add('active');
const iconGrid = document.getElementById('iconGrid');
iconGrid.innerHTML = '';
icons.forEach(icon => {
const iconUrl = `https://raw.githubusercontent.com/UN-OCHA/humanitarian-icons/main/SVG/${folder}/${icon}`;
const iconItem = document.createElement('div');
iconItem.classList.add('icon-item');
// Apply special styling for the white icons
if (folder === 'white') iconItem.classList.add('white');
iconItem.innerHTML = `
<a href="${iconUrl}" download>
<img src="${iconUrl}" alt="${icon}">
</a>
<div class="icon-name">${icon.replace(/-/g, ' ').replace('.svg', '')}</div>
<button class="copy-btn" onclick="copyLink('${iconUrl}')">Copy URL</button>
`;
iconGrid.appendChild(iconItem);
});
}
//Copy URL//
function copyLink(url) {
navigator.clipboard.writeText(url).then(() => {
alert('URL copied to clipboard!');
});
}
//Filter icons//
function filterIcons() {
const searchInput = document.getElementById('searchInput').value.toLowerCase();
const iconItems = document.querySelectorAll('.icon-item');
iconItems.forEach(item => {
const iconName = item.querySelector('.icon-name').textContent.toLowerCase();
if (iconName.includes(searchInput)) {
item.style.display = 'flex'; // Ensure flex layout is maintained
} else {
item.style.display = 'none';
}
});
}
// Load UN Blue icons by default on page load
document.addEventListener('DOMContentLoaded', () => {
const defaultNavLink = document.querySelector('.nav-link'); // Select the first nav link (UN Blue)
loadIcons('UN-blue', defaultNavLink);
});
//Copy url pop up message//
function copyLink(url) {
navigator.clipboard.writeText(url).then(() => {
const toast = document.getElementById('copy-toast');
toast.style.opacity = '1';
toast.style.visibility = 'visible';
toast.style.transform = 'translate(-50%, 0)';
setTimeout(() => {
toast.style.opacity = '0';
toast.style.visibility = 'hidden';
toast.style.transform = 'translate(-50%, -20px)'; // Slide back up
}, 2000); // Hides after 2 seconds
}).catch(err => {
console.error('Failed to copy link: ', err);
});
}
//Search box icon interactive//
document.querySelector('.search-icon').addEventListener('click', () => {
filterIcons();
});
</script>
</body>
</html>