Add map Tuto v2 and scriptTuto.js

This commit is contained in:
DESKTOP-FMM8UI0\CLV 2021-03-23 16:00:24 +01:00
parent f437b6057c
commit 77e768e5f7
33 changed files with 2415 additions and 0 deletions

25
maps/Tuto/iframe.html Normal file
View file

@ -0,0 +1,25 @@
<!doctype html>
<html lang="en">
<head>
<script src="http://play.workadventure.localhost/iframe_api.js"></script>
<script>
</script>
</head>
<body>
<button id="sendchat">Send chat message</button>
<script>
document.getElementById('sendchat').onclick = () => {
WA.sendChatMessage('Hello world!', 'Mr Robot');
}
</script>
<div id="chatSent"></div>
<script>
WA.onChatMessage((message => {
const chatDiv = document.createElement('p');
chatDiv.innerText = message;
document.getElementById('chatSent').append(chatDiv);
}));
</script>
</body>
</html>