Requested changes - pt. 1

This commit is contained in:
2021-09-06 10:50:11 +02:00
parent 25c5007a09
commit 5331b04248
16 changed files with 58 additions and 25 deletions

View File

@@ -22,4 +22,22 @@ export function slider(nextimage) {
}
header.setAttribute('style', 'background-image : url("' +images[nextimage++] + '");');
setTimeout(slider(nextimage), 2000);
}
/**
* @todo
* The canvas should be drawn into an overlay
* container (always fullscreen)
*/
export function interactiveMap() {
let canvas = document.createElement('canvas');
let ctx = canvas.getContext('2d');
const img = new Image;
img.src = 'img/mappa.png';
img.onload = () => {
ctx.drawImage(img, 0, 0);
}
}

View File

@@ -1,6 +1,7 @@
//use strict;
//import * as Farapp from './fara.js';
import * as Farapp from './fara.js';
let homeRE = new RegExp(/(https?:\S+\/$|index.html$)/);
if (homeRE.test(window.location.href)) {
@@ -152,4 +153,14 @@ window.addEventListener('load', () => {
modal.classList.remove('active');
})
}
});
});
/**
* Draw interactive map in canvas...
if (window.location.href.includes('itinerario')) {
let mapImg = document.getElementById('map');
mapImg.addEventListener('click', () => {
Farapp.interactiveMap();
});
}
*/