a689756d85
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.
19 lines
492 B
JavaScript
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;
|
|
}
|
|
}
|