Requested changes - pt. 1
This commit is contained in:
18
js/fara.js
18
js/fara.js
@@ -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);
|
||||
}
|
||||
}
|
||||
15
js/ui.js
15
js/ui.js
@@ -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();
|
||||
});
|
||||
}
|
||||
*/
|
||||
Reference in New Issue
Block a user