partey_workadventure/maps/starter/script.js
David Négrier a689756d85 Removing Typescript on maps container
Typescript is almost not used on this container (and causing a bunch of startup errors that are not important but worrying first time users). Removing it completely.
2022-04-11 22:47:31 +02:00

19 lines
492 B
JavaScript

/// <reference path="../node_modules/@workadventure/iframe-api-typings/iframe_api.d.ts" />
let currentPopup = undefined;
const today = new Date();
const time = today.getHours() + ":" + today.getMinutes();
WA.room.onEnterZone('clock', () => {
currentPopup = WA.ui.openPopup("clockPopup","It's " + time,[]);
})
WA.room.onLeaveZone('clock', closePopUp)
function closePopUp(){
if (currentPopup !== undefined) {
currentPopup.close();
currentPopup = undefined;
}
}