partey_workadventure/maps/starter/script.js

19 lines
492 B
JavaScript
Raw Normal View History

/// <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;
}
}