Full-service independent laboratory serving a variety of related polymer-centric industries around the world
.map-container {
width: 100%;
max-width: 990px;
margin: auto;
}
.map-container svg {
width: 100%;
height: auto;
}
path {
fill: #c0c0c0 !important; /* Default fill color for paths */
}
.country.active path:hover {
fill: #a9223e !important;
/* Change color to highlight active countries */
}
.state.active path:hover {
fill: #a9223e !important;
/* Change color to highlight active states */
}
.country.active path {
fill: #3a5371 !important;
/* Change color to highlight active countries */
}
.state.active path {
fill: #3a5371 !important;
/* Change color to highlight active states */
}
.back-button {
display: none;
margin: 10px auto;
padding: 10px 20px;
background-color: #a9223e !important;
color: white !important;
border: none !important;
cursor: pointer !important;
}
.back-button:hover {
display: none;
margin: 10px auto;
padding: 10px 20px;
background-color: #3a5371!important;
color: white;
border: none;
cursor: pointer;
}
.circlexx { opacity: 0; fill: #c0c0c0; stroke: #000000; stroke-width: 0.5; }
.subxx { opacity: 0; fill: #c0c0c0; stroke: #000000; stroke-width: 0.3; }
.landxx { fill: #c0c0c0; stroke: #ffffff; stroke-width: 0.5; fill-rule: evenodd; }
.coastxx { stroke-width: 0.2; }
.antxx { opacity: 1; fill: #c0c0c0; }
.noxx { opacity: 0; fill: #c0c0c0; stroke: #000000; stroke-width: 0.5; }
.limitxx { opacity: 0; fill: #c0c0c0; stroke: #ffffff; stroke-width: 0.2; fill-rule: evenodd; }
.unxx { opacity: 0; fill: #c0c0c0; stroke: #000000; stroke-width: 0.3; }
.oceanxx { opacity: 1; fill: #ffffff; stroke: #000000; stroke-width: 0.5; }
.map-border { stroke: #000; fill: none; stroke-width: 2; }
/* Tooltip styling */
.tooltip {
position: absolute !important;
display: none !important;
background-color: #333 !important;
color: #fff !important;
padding: 5px !important;
border-radius: 3px !important;
font-size: 12px !important;
z-index: 10 !important;
}
path { fill-rule: evenodd; }
image/svg+xml
<!-- 🔧 CSS (Put in tag or main CSS file) -->
#info-modal {
display: none !important;
position: fixed;
z-index: 1000;
left: 0;
top: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.6);
align-items: center;
justify-content: center;
}
#info-modal.show {
display: flex !important;
margin-top: -6em;
}
#modal-box {
background: white;
padding: 20px;
max-width: 500px;
width: 90%;
border-radius: 8px;
position: relative;
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}
#close-modal {
position: absolute;
top: 8px;
right: 12px;
font-size: 18px;
font-weight: bold;
cursor: pointer;
}
#modal-content {
white-space: pre-line;
font-family: sans-serif;
}
jQuery(document).ready(function ($) {
const worldMapContainer = $('#world-map-container');
const backButton = $('#back-button');
const tooltip = $('#tooltip');
const modal = $('#info-modal');
const modalContent = $('#modal-content');
const closeModal = $('#close-modal');
// Hide modal on load (double tap to be sure)
modal.removeClass('show');
const countries = ['usa', 'australia', 'brazil', 'poland', 'safrica'];
const usStates = ['texas', 'california', 'pennsylvania', 'scarolina'];
const countryTexts = {
'usa': 'United States of America',
'australia': 'Gold Coast - Australia',
'brazil': 'São Paulo - Brazil',
'poland': 'Warsaw - Europe',
'safrica': 'Johannesburg - South Africa'
};
const modalMessages = {
// International Offices
'brazil': `TRI Ambiental
Avenida Marques de Sao Vicente, 230, Conjunto 1218, Sala 07 – Barra Funda
Sao Paulo, SP 01139-000, Brazil`,
'safrica': `TRI Africa
28 Oaklane Office Park, Grippen Road, Bartlett, Boksburg, 1459, South Africa`,
'australia': `TRI Australasia
28 Taree St, Burleigh Heads QLD 4220, Australia`,
'poland': `TRI Europe
Ul. Zarzewie 12, Nadarzyn, Mazowieckie, 05-830 Poland`,
// 🇺🇸 USA State Offices
'california': `1970 South Santa Cruz St.
Anaheim, CA 92805
+1 714-520-9631
csebastian@tri-env.com`,
'scarolina': `112 Martin Road
Greenville, SC 29607
+1 864-569-6888
jesprague@tri-env.com`,
'pennsylvania': `103 Coraopolis Road
Coraopolis, PA 15108
+1 412-771-5340
concrete@gts-labs.com`,
'texas': `9063 Bee Cave Rd
Austin, TX 78733
+1 800-880-8378
info@tri-env.com`
};
function handleCountryClick(countryId) {
return function () {
if (countryId === 'usa') {
worldMapContainer.hide();
$('#' + countryId + '-map-container').show();
backButton.show();
} else if (modalMessages[countryId]) {
modalContent.text(modalMessages[countryId]);
modal.addClass('show');
}
};
}
function handleCountryHover(event, countryId) {
tooltip.text(countryTexts[countryId]);
tooltip.css({ display: 'block', left: event.pageX + 'px', top: event.pageY + 'px' });
}
function handleCountryMouseOut() {
tooltip.hide();
}
// Attach countries
countries.forEach(countryId => {
const el = $('#' + countryId);
if (el.length) {
el.addClass('active');
el.on('click', handleCountryClick(countryId));
el.on('mouseover', (event) => handleCountryHover(event, countryId));
el.on('mouseout', handleCountryMouseOut);
}
});
// Back button logic
if (backButton.length) {
backButton.on('click', function () {
countries.forEach(id => {
$('#' + id + '-map-container').hide();
});
worldMapContainer.show();
backButton.hide();
});
}
// US State modal popups
usStates.forEach(stateId => {
const el = $('#' + stateId);
if (el.length) {
el.addClass('active');
const path = el.find('path');
if (path.length) {
path.addClass('active');
el.on('click', function () {
if (modalMessages[stateId]) {
modalContent.text(modalMessages[stateId]);
modal.addClass('show');
}
});
}
}
});
// Close modal handlers
closeModal.on('click', function () {
modal.removeClass('show');
});
modal.on('click', function (e) {
if (!$(e.target).closest('#modal-box').length) {
modal.removeClass('show');
}
});
});