Before Width: | Height: | Size: 85 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 29 KiB |
After Width: | Height: | Size: 31 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 23 KiB |
@ -1,7 +1,18 @@ |
||||
/// <reference path="../node_modules/@workadventure/iframe-api-typings/iframe_api.d.ts" />
|
||||
|
||||
// You can write your WorkAdventure script here, if any.
|
||||
// The "WA" global object is available from anywhere.
|
||||
let currentPopup: any = undefined; |
||||
const today = new Date(); |
||||
const time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds(); |
||||
|
||||
console.log('Script started successfully'); |
||||
WA.openCoWebSite('https://workadventu.re'); |
||||
WA.onEnterZone('clock', () => { |
||||
currentPopup = WA.openPopup("clockPopup","It's " + time,[]); |
||||
}) |
||||
|
||||
WA.onLeaveZone('clock', closePopUp) |
||||
|
||||
function closePopUp(){ |
||||
if (currentPopup !== undefined) { |
||||
currentPopup.close(); |
||||
currentPopup = undefined; |
||||
} |
||||
} |
||||
|
Before Width: | Height: | Size: 33 KiB |