You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
961 B
30 lines
961 B
5 months ago
|
// Example location data
|
||
|
const locationData = {
|
||
|
'digital-hub': {
|
||
|
text: '10-13 Thomas Street',
|
||
|
imageUrl: '/public/images/locations/digital-hub.png'
|
||
|
},
|
||
|
'pallas-projects': {
|
||
|
text: '115-117, The Coombe, The Liberties, Dublin, D08 A970',
|
||
|
imageUrl: 'public/images/locations/pallas.png'
|
||
|
}
|
||
|
// Add more locations as needed
|
||
|
};
|
||
|
|
||
|
// Function to update the content
|
||
|
function updateLocationContent(locationKey) {
|
||
|
const location = locationData[locationKey];
|
||
|
if (location) {
|
||
|
document.getElementById('location-text').innerText = location.text;
|
||
|
document.getElementById('location-img').src = location.imageUrl;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// Add event listeners to buttons
|
||
|
document.querySelectorAll('.location-button').forEach(button => {
|
||
|
button.addEventListener('click', (event) => {
|
||
|
const locationKey = event.currentTarget.getAttribute('data-location');
|
||
|
updateLocationContent(locationKey);
|
||
|
});
|
||
|
});
|