Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 46 additions & 5 deletions src/_data/institutions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,24 @@
# is omitted.
# short_name: string, optional. Shorter display name shown on the site
# (e.g. "Mass General"). Falls back to long_name if omitted.
# domain: string, required. Short identifier for the institution.
# abbr: string, optional acronym (e.g. "MGH"). Not currently
# displayed on the site.
# logo: string, optional URL/path to a logo image.
# accent_color: string, optional hex color used as the institution's accent.
# coords: object, required. Approximate location in decimal degrees.
# latitude: number. Latitude; positive values are north.
# longitude: number. Longitude; negative values are west.
# website: string, optional URL. If given, the entry links out to it.

- long_name: Harvard University
short_name: Harvard
domain: harvard
logo: https://upload.wikimedia.org/wikipedia/commons/0/0c/Harvard_University_shield.svg?utm_source=commons.wikimedia.org&utm_campaign=index&utm_content=original
accent_color: "#a51c30"
coords:
latitude: 42.37444
longitude: -71.11694
website: https://www.harvard.edu
open_ambassador_applications: true
ambassadors:
Expand All @@ -29,6 +37,9 @@
domain: mit
logo: https://upload.wikimedia.org/wikipedia/commons/b/b8/MIT_2023_red_logo.svg?utm_source=commons.wikimedia.org&utm_campaign=index&utm_content=original
accent_color: "#750014"
coords:
latitude: 42.360001
longitude: -71.092003
website: https://www.mit.edu
open_ambassador_applications: false
ambassadors:
Expand All @@ -43,8 +54,11 @@
- long_name: Massachusetts General Hospital
short_name: Mass General
domain: mgh
logo: images/institutions/mass-general-brigham_icon.svg
logo: https://upload.wikimedia.org/wikipedia/en/8/83/Mass_General_Brigham_logo.svg?utm_source=en.wikipedia.org&utm_campaign=index&utm_content=original
accent_color: "#009ca6"
coords:
latitude: 42.36278
longitude: -71.06889
# logo: https://upload.wikimedia.org/wikipedia/commons/1/1f/Massachusetts_General_Hospital_logo.svg?utm_source=commons.wikimedia.org&utm_campaign=index&utm_content=original
website: https://www.massgeneral.org
open_ambassador_applications: true
Expand All @@ -54,6 +68,9 @@
domain: bu
logo: https://upload.wikimedia.org/wikipedia/commons/3/31/Boston_University_wordmark.svg?utm_source=commons.wikimedia.org&utm_campaign=index&utm_content=original
accent_color: "#cc0000"
coords:
latitude: 42.350876
longitude: -71.106918
website: https://www.bu.edu
open_ambassador_applications: true

Expand All @@ -62,6 +79,9 @@
domain: tufts
logo: https://upload.wikimedia.org/wikipedia/commons/1/12/Tufts_University_wordmark.svg?utm_source=commons.wikimedia.org&utm_campaign=index&utm_content=original
accent_color: "#3e8ede"
coords:
latitude: 42.406
longitude: -71.120
website: https://www.tufts.edu
open_ambassador_applications: true

Expand All @@ -70,14 +90,20 @@
domain: northeastern
logo: https://upload.wikimedia.org/wikipedia/commons/0/02/Northeastern_Wordmark.svg?utm_source=commons.wikimedia.org&utm_campaign=index&utm_content=original
accent_color: "#c8102e"
coords:
latitude: 42.34000
longitude: -71.08833
website: https://www.northeastern.edu
open_ambassador_applications: true

- long_name: University of Massachusetts Boston
short_name: UMass Boston
doamin: umb
domain: umb
logo: https://www.umb.edu/media/umassboston/site-assets/images/new-umb-logo-blue.svg
accent_color: "#005a8b"
coords:
latitude: 42.313432
longitude: -71.038445
website: https://www.umb.edu
open_ambassador_applications: true

Expand All @@ -86,6 +112,9 @@
domain: dfci
logo: https://upload.wikimedia.org/wikipedia/en/5/52/Dana-Farber_Cancer_Institute_logo.svg?utm_source=en.wikipedia.org&utm_campaign=index&utm_content=original
accent_color: "#00629b"
coords:
latitude: 42.33778
longitude: -71.10750
website: https://www.dana-farber.org
open_ambassador_applications: true

Expand All @@ -94,15 +123,21 @@
domain: bch
logo: https://upload.wikimedia.org/wikipedia/en/8/89/Boston_Children%27s_Hospital_logo.svg?utm_source=en.wikipedia.org&utm_campaign=index&utm_content=original
accent_color: "#164989"
coords:
latitude: 42.3372
longitude: -71.1064
website: https://www.childrenshospital.org
open_ambassador_applications: true

- long_name: Brigham and Women's Hospital
short_name: Brigham
domain: bwh
# logo: https://assets.weforum.org/organization/image/responsive_small_webp_onQ4JruE3lum0Xgf2g9ddEqgI0KIj1Fuuuwdfgopv98.webp
logo: images/institutions/mass-general-brigham_icon.svg
logo: https://upload.wikimedia.org/wikipedia/en/8/83/Mass_General_Brigham_logo.svg?utm_source=en.wikipedia.org&utm_campaign=index&utm_content=original
accent_color: "#009ca6"
coords:
latitude: 42.336152
longitude: -71.106834
website: https://www.brighamandwomens.org
open_ambassador_applications: true

Expand All @@ -111,13 +146,19 @@
domain: bc
logo: https://upload.wikimedia.org/wikipedia/commons/2/21/Boston_College_Logotype.svg?utm_source=commons.wikimedia.org&utm_campaign=index&utm_content=original
accent_color: "#98002e"
coords:
latitude: 42.33500
longitude: -71.17028
website: https://bc.edu/
open_ambassador_applications: true

- long_name: McLean Hospital
short_name: McLean
domain: mclean
logo: images/institutions/mass-general-brigham_icon.svg
logo: https://upload.wikimedia.org/wikipedia/en/8/83/Mass_General_Brigham_logo.svg?utm_source=en.wikipedia.org&utm_campaign=index&utm_content=original
accent_color: "#009ca6"
coords:
latitude: 42.393658
longitude: -71.191075
website: https://www.massgeneralbrigham.org/en/about/mclean-hospital
open_ambassador_applications: true
open_ambassador_applications: true
23 changes: 14 additions & 9 deletions src/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@

<body>
<!-- Begin Scroll Up Button -->
<form action="#home">
<button id="toTop" title="Go to top">
<i class="fas fa-angle-up"></i>
</button>
</form>
<button id="toTop" title="Go to top" onclick="window.scrollTo({ top: 0, behavior: 'smooth' })">
<i class="fas fa-angle-up"></i>
</button>
<!-- End Scroll Up Button -->

<!-- Begin Header -->
Expand Down Expand Up @@ -66,7 +64,7 @@
</a>
</div>
<div class="navbar-item">
<a class="navbar-item js-modal-trigger" data-target="contact-modal" href="#contact-modal">
<a class="js-modal-trigger" data-target="contact-form-modal" href="#contact-form-modal">
Contact Us
</a>
</div>
Expand Down Expand Up @@ -369,11 +367,16 @@
</div>
<div>
<p>
Our community already includes postdoctoral researchers from {{ (institutions | length) }} research institutions in the area!
Our community already includes postdoctoral researchers from {{ (institutions | length) }} different institutions in the area!
</p>
<div class="mx-5 mt-3" id="institutions-visual">
<div class="is-hidden" id="institutions-data">
{% for institution_item in institutions %}
<a class="institutions-data__item" href="{{ institution_item.website }}" data-color="{{ institution_item.accent_color }}" data-coords="{{ institution_item.coords.latitude }},{{ institution_item.coords.longitude }}">{{ institution_item.long_name }}</a>
{% endfor %}
</div>
<div class="buttons is-justify-content-center mt-2">
<div class="mx-5 mt-3 mb-2 box" id="institutions-visual" style="min-height: 400px; z-index: 1;">
</div>
<div class="buttons is-justify-content-center mt-3">
<button class="button is-primary js-modal-trigger" data-target="institutions-list-modal">
<span class="icon">
<i class="fas fa-building-flag"></i>
Expand Down Expand Up @@ -439,6 +442,8 @@

<!-- Scripts -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link href=" https://cdn.jsdelivr.net/npm/leaflet@1.9.4/dist/leaflet.min.css " rel="stylesheet">
<script src=" https://cdn.jsdelivr.net/npm/leaflet@1.9.4/dist/leaflet.min.js "></script>
<script src="js/showcase.js"></script>
<link href="https://cdn.jsdelivr.net/npm/aos@2.3.4/dist/aos.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/aos@2.3.4/dist/aos.js"></script>
Expand Down
83 changes: 66 additions & 17 deletions src/js/showcase.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,76 @@ document.addEventListener("DOMContentLoaded", function() {

// Smooth Anchor Scrolling
$(document).on("click", 'a[href^="#"]:not(.js-modal-trigger)', function(event) {
const targetId = this.getAttribute("href");

// Ignore href="#" and links with no matching target
if (!targetId || targetId === "#") return;

const $target = $(targetId);
if (!$target.length) return;

event.preventDefault();
$("html, body").animate(
{
scrollTop: $($.attr(this, "href")).offset().top
},
500
);

$("html, body").animate({
scrollTop: $target.offset().top
}, 500);
});

// When the user scrolls down 20px from the top of the document, show the scroll up button
window.onscroll = function() {
scrollFunction();
};

function scrollFunction() {
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
document.getElementById("toTop").style.display = "block";
} else {
document.getElementById("toTop").style.display = "none";
}
}
const toTop = document.getElementById("toTop");

window.addEventListener("scroll", () => {
toTop.style.display = window.scrollY > 20 ? "block" : "none";
});

const links = [...document.querySelectorAll("#institutions-data a")];

const items = links.map((a) => ({
text: a.textContent.trim(),
coords: a.dataset.coords.split(',').map(Number),
href: a.href,
color: a.dataset.color
}));

var map = L.map('institutions-visual', {alt: "A map of the different institutions in the Greater Boston"}).setView([42.35447,-71.06813], 11);

L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 16,
minZoom: 7,
attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
}).addTo(map);

items.forEach(element => {

const color = CSS.supports('color', element.color) ? element.color : '#001c41';

/* const customIcon = L.divIcon({
className: '',
html: `
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="42"
viewBox="0 0 32 42" aria-hidden="true">
<path fill="${color}"
stroke="#000000" stroke-width="1"
d="M16 1C7.7 1 1 7.7 1 16c0 11 15 25 15 25s15-14 15-25C31 7.7 24.3 1 16 1z"/>
<circle cx="16" cy="16" r="5" fill="#000000"/>
</svg>`,
iconSize: [32, 42],
iconAnchor: [16, 12]
}); */
const customIcon = L.divIcon({
className: '',
html: `
<span class="icon is-medium" style="border: 2px solid white; background-color: ${color};">
<i class="fas fa-building-flag fa-lg has-text-white" aria-hidden="true"></i>
</span>`,
iconSize: [32, 32],
popupAnchor: [0, -8]
});

L.marker(element.coords,
{alt: element.text, icon: customIcon}).addTo(map)
.bindPopup('<a href="'+ element.href +'" title="Website of '+ element.text +'" target="_blank">'+ element.text + '</a>');
});

// Modals (from https://bulma.io/documentation/components/modal/)
document.addEventListener('DOMContentLoaded', () => {
Expand Down
Loading