init
4
.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
.local
|
||||
test
|
||||
member/*
|
||||
member.json
|
BIN
assets/sounds/barbecue.mp3
Normal file
BIN
assets/sounds/coffee.mp3
Normal file
BIN
assets/sounds/server-room.mp3
Normal file
BIN
assets/sounds/toilet.mp3
Normal file
BIN
assets/tiles/animations.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
assets/tiles/carpet.png
Normal file
After Width: | Height: | Size: 82 KiB |
BIN
assets/tiles/doors.png
Normal file
After Width: | Height: | Size: 85 KiB |
BIN
assets/tiles/floor.png
Normal file
After Width: | Height: | Size: 220 KiB |
BIN
assets/tiles/garden.png
Normal file
After Width: | Height: | Size: 654 KiB |
BIN
assets/tiles/on_floor.png
Normal file
After Width: | Height: | Size: 519 KiB |
BIN
assets/tiles/on_table.png
Normal file
After Width: | Height: | Size: 142 KiB |
BIN
assets/tiles/on_wall.png
Normal file
After Width: | Height: | Size: 196 KiB |
BIN
assets/tiles/roof.png
Normal file
After Width: | Height: | Size: 9.2 KiB |
BIN
assets/tiles/spotlights.png
Normal file
After Width: | Height: | Size: 44 KiB |
BIN
assets/tiles/tictactoe.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
assets/tiles/utilities.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
assets/tiles/wall.png
Normal file
After Width: | Height: | Size: 79 KiB |
6701
clubhaus.json
Normal file
1373
clubhaus_downstairs.json
Normal file
1478
clubhaus_roof.json
Normal file
2791
clubhaus_roof_place.json
Normal file
4217
clubhaus_upstairs.json
Normal file
11
pages/css/nes.min.css
vendored
Normal file
134
pages/elevator.html
Normal file
@ -0,0 +1,134 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<script src="/iframe_api.js"></script>
|
||||
<link href="./css/nes.min.css" type="text/css" rel="stylesheet" />
|
||||
<style>
|
||||
body {
|
||||
padding: 15px;
|
||||
background-color:#212529;
|
||||
}
|
||||
|
||||
#panel {
|
||||
margin: 15px auto;
|
||||
width: 100%;
|
||||
max-width: 300px;
|
||||
}
|
||||
|
||||
#panel p {
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
#buttons {
|
||||
margin: 15px auto;
|
||||
width: 100%;
|
||||
max-width: 400px;
|
||||
}
|
||||
|
||||
#buttons-rooms {
|
||||
display: flex;
|
||||
flex-direction: column-reverse;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
#buttons-rooms>a {
|
||||
flex-basis: 100%;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
#buttons-controls {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="buttons" class="nes-container">
|
||||
<div id="buttons-rooms">
|
||||
|
||||
</div>
|
||||
<div id="buttons-controls">
|
||||
<a class="nes-btn">↔️</a>
|
||||
<a class="nes-btn">↕️</a>
|
||||
<a class="nes-btn is-error">🔔</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="panel" class="nes-container is-dark with-title is-centered">
|
||||
<p class="title">Elevator</p>
|
||||
<p>In case of emergency please press and hold the alarm button for 5 seconds.</p>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
let rooms = [
|
||||
{
|
||||
'room': 'clubhaus_downstairs.json',
|
||||
'name': 'downstairs'
|
||||
}, {
|
||||
'room': 'clubhaus.json',
|
||||
'name': 'main floor'
|
||||
}, {
|
||||
'room': 'clubhaus_upstairs.json',
|
||||
'name': 'first floor'
|
||||
}, {
|
||||
'room': 'clubhaus_roof.json',
|
||||
'name': 'roof'
|
||||
}
|
||||
];
|
||||
|
||||
let firstIndex = -1;
|
||||
|
||||
let buttons = document.getElementById("buttons-rooms");
|
||||
|
||||
WA.onInit().then(() => {
|
||||
let roomId = WA.room.id;
|
||||
let currentIndex = -1;
|
||||
for (let i = 0; i < rooms.length; i++) {
|
||||
let room = rooms[i];
|
||||
let index = i + firstIndex;
|
||||
let button = document.createElement("a");
|
||||
button.id = i;
|
||||
button.classList.add("nes-btn");
|
||||
button.innerHTML = index + " " + room.name;
|
||||
buttons.appendChild(button);
|
||||
|
||||
if (roomId.endsWith(room.room)) {
|
||||
button.disabled = true;
|
||||
button.classList.add('is-disabled');
|
||||
currentIndex = i;
|
||||
}
|
||||
|
||||
button.addEventListener('click', function (event) {
|
||||
let button = event.target;
|
||||
if (!button.disabled) {
|
||||
let index = button.id;
|
||||
let room = rooms[index];
|
||||
let diff = index - currentIndex;
|
||||
if (currentIndex > index) {
|
||||
diff = currentIndex - index;
|
||||
}
|
||||
|
||||
|
||||
for (let i = 0; i < rooms.length; i++) {
|
||||
let b = document.getElementById(i);
|
||||
b.disabled = true;
|
||||
b.classList.add('is-disabled');
|
||||
}
|
||||
|
||||
setTimeout(function () {
|
||||
WA.nav.goToRoom(room.room + '#start_elevator');
|
||||
}, diff * 2000);
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|