Interactive POIs - to n. 9
This commit is contained in:
26
js/ui-map.js
26
js/ui-map.js
@@ -18,8 +18,18 @@ function openModal(id) {
|
||||
'piazza' : 'Itinerario - #3',
|
||||
'nobili' : 'Itinerario - #4',
|
||||
'rocco' : 'Itinerario - #5',
|
||||
'disputa' : 'Itinerario - #6',
|
||||
'duomo' : 'Itinerario - #7',
|
||||
'castello' : 'Itinerario - #8',
|
||||
'sabini' : 'Itinerario - #9',
|
||||
}
|
||||
|
||||
const multiVid = {
|
||||
'piazza' : 3,
|
||||
'rocco' : 2,
|
||||
'duomo' : 3,
|
||||
};
|
||||
|
||||
document.querySelector('.modal-title').innerHTML = modTitles[id];
|
||||
|
||||
let modal = document.querySelector('#mod-vid');
|
||||
@@ -29,7 +39,7 @@ function openModal(id) {
|
||||
modChildren.forEach(c => {
|
||||
if (c.classList.contains('columns')) {
|
||||
if (c.id === 'col-'+id ||
|
||||
(c.id.includes('piazza') && id.includes('piazza'))) {
|
||||
(c.id.includes(id) && Object.keys(multiVid).includes(id))) {
|
||||
c.classList.remove('hide');
|
||||
}
|
||||
else {
|
||||
@@ -40,7 +50,7 @@ function openModal(id) {
|
||||
|
||||
modal.classList.add('active');
|
||||
|
||||
if (id !== 'piazza' /* && ... */) {
|
||||
if (!Object.keys(multiVid).includes(id)) {
|
||||
let thumb = document.querySelector('#t-'+id);
|
||||
|
||||
thumb.addEventListener('click', () => {
|
||||
@@ -48,7 +58,7 @@ function openModal(id) {
|
||||
});
|
||||
} else {
|
||||
let thumbs = [];
|
||||
for (let i = 1; i <= 3; i++) {
|
||||
for (let i = 1; i <= multiVid[id]; i++) {
|
||||
thumbs.push(document.querySelector(`#t-${id}${i}`));
|
||||
}
|
||||
thumbs.forEach(t => {
|
||||
@@ -60,9 +70,6 @@ function openModal(id) {
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//modal.style = 'opacity: 1';
|
||||
}
|
||||
|
||||
const openVid = (id) => {
|
||||
@@ -76,6 +83,13 @@ const openVid = (id) => {
|
||||
'francesco' : 'Francesco #3b',
|
||||
'nobili' : 'I Nobili di Fara #4',
|
||||
'rocco' : 'Rocco si è svegliato #5',
|
||||
'alberto' : 'Alberto #5b',
|
||||
'disputa' : 'Disputa sui dialetti e sui saperi #6',
|
||||
'duomo' : 'Piazza Duomo #7',
|
||||
'loredana' : 'Loredana #7a',
|
||||
'pietro' : 'Pietro #7b',
|
||||
'castello' : 'Il castello #8',
|
||||
'sabini' : 'I Sabini ieri e oggi #9',
|
||||
}
|
||||
const vimeoVids = {
|
||||
'prologo' : '478632535',
|
||||
|
||||
Reference in New Issue
Block a user