-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
199 lines (153 loc) · 7.77 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
<!DOCTYPE html>
<html>
<head>
<link rel="shortcut icon" href="/static/images/logo/logo.ico" />
<meta name="viewport" content ="width=device-width,initial-scale=1,user-scalable=yes" />
<style>
body{color:white; background-color:black;}
a{text-decoration: none; color:#bc8f8f;
}
u{color:rgb(255,255,0);}
</style>
</head>
<body>
<img src="/static/images/logo/logo_boardgamemulation_refined_trans.png" alt="logo" style="float:right;width:8%;">
<h3>Boardgamemulation - Portal</h3>
<p>Design or join | Ontwerp of toetreden </p>
<a href="" onclick="handleClient()">Are you a player | Ben jij een speler?</a><br>
<a href="/adminpage" target='_blank'>Are you a game master | Ben jij een spelleider?</a>
<br> <br>
<div id="dom_container" style=" opacity:0.5; position: absolute; right: 0; margin-top:8%; margin-left:1.5%; ">
<textarea id="chatboxdata" class='controltheme' onclick='allowItemMobileFocus = true;' style=" height: 150px; width:180px;display:absolute;color:black;background:#ac9687;" disabled> </textarea> <br>
<input onclick="allowItemMobileFocus = true;" id="chatboxrespons" autocomplete="off" style="height: 20px; color:black; width:120px; background: #ac9687;" class="" />
<button style="width:60px;padding:0%;" id='btnconfirmchatmessage' class='buttonDesign' onclick="SendchatMessage()"><abbr title="Send message">OK</abbr></button><br>
</div>
<span style="float:left;">Add your project to the fan-made games:<input accept=".bgem" type="file" id="btnLoadCustomProject" onchange="uploadCustomProject()"></span>
<br>
<br>
<hr>
<p><u>Play game | speel spel </u> </p>
<a target='_blank' href="/adminpage?static/examples/Backgammon.bgem">Backgammon </a><br>
<a target='_blank' href="/adminpage?static/examples/JohnYianni_Hive.bgem">John Yianni - Hive </a><br>
<a target='_blank' href="/adminpage?static/examples/European_Chess.bgem">European Chess </a><br>
<a target='_blank' href="/adminpage?static/examples/Go_Gomoku_2D.bgem">Go - Gomoku </a><br>
<a target='_blank' href="/adminpage?static/examples/Chinese_Checkers.bgem">Chinese Checkers </a><br>
<a target='_blank' href="/adminpage?static/examples/Modern_PaiSho/PaiJo_TwoPlayers.bgem">PaiJo (Modern Pai Sho) </a> - <a target='_blank' href="/adminpage?static/examples/Modern_PaiSho/PaiJo_TwoPlayers_SkudBoard.bgem">PaiJo (SkudPaisho board) </a><br>
<a target='_blank' href="/adminpage?static/examples/D&D_Totemic.bgem">D&D - Totemic </a><br>
<a target='_blank' href="/adminpage?static/examples/ScrumbleStones/Bronnen/Boardgameemulator/ScrumbleStones.bgem">Scrumble Stones </a><br>
<a target='_blank' href="/adminpage?static/examples/Tice_Tobbel/CircleTice_Shamans.bgem">Shamans (Tice roll) </a><br>
<br>
<p><u>Experimental games | Experimentele spelen </u> </p>
<a target='_blank' href="/static/examples/ViceChess/index.html">ViceChess </a><br>
<a target='_blank' href="/static/examples/HoloGraph_Chess/startgame.html">HoloVice </a><br>
<a target='_blank' href="/static/examples/LO/index_LO.html">LO </a><br>
<br>
<p><u>Play 2D games | speel 2D spellen </u> </p>
<a target='_blank' href="/2DPaijo">PaiJo </a><br>
<a target='_blank' href="/2DGabbac"> Gabbac </a><br>
<a target='_blank' href="/2DMimir">Mimir </a><br>
<a target='_blank' href="/2DV"> Vantum </a><br>
<a target='_blank' href="/2dShamans"> Shamans </a> <br>
<a target='_blank' href="/2dvicequest"> ViceQuest </a> <br>
<a target='_blank' href="/static/examples/Squark/Squark.html"> Squark </a> <br>
<a target='_blank' href="/static/examples/Vemory/index.html"> Vemory </a> <br>
<a target='_blank' href="/static/examples/VBattle/VBattle.html"> VBattle </a> <br>
<br>
<p id="pFanGames"><u>Play fan-made game | speel fangemaakt spel</u> </p><br>
<p id="pLobby"><u>Join public games | Bezoek publieke spelen</u></p><br>
<hr>
<footer style="text-align:center">
<p>Jonathan F.M. Neels - Fumetsujo Studio <br>
Contact information: <a href="mailto:[email protected]">
[email protected]</a>. <br>
Site: <a href="https://fumetsujo.pythonanywhere.com/">
https://fumetsujo.pythonanywhere.com/</a>.</p>
</footer>
<script src="static/lib/jquery-3.5.0.min.js"> </script>
<script src="static/js/serveraction.js"> </script>
<script src="static/js/helpers.js"> </script>
</body>
<script>
var admincode= "general";
var pname="visitor_"+uuidv4().toString().substring(0,4);
var lastScrollHeightchat=0;
setInterval(lobbyList, 20000);
setInterval(chatData, 5000);
function chatData()
{
jQuery.get( "/chat"+admincode+"? ", function( data ) {
var convData = decodeURIComponent(data);
$( "#chatboxdata" ).html( convData );
if(lastScrollHeightchat != $('#chatboxdata')[0].scrollHeight){
$('#chatboxdata').scrollTop($('#chatboxdata')[0].scrollHeight);
lastScrollHeightchat= $('#chatboxdata')[0].scrollHeight;
}
});}
function lobbyList()
{
$("#pLobby").html("<u>Join public games | Bezoek publieke spelen</u><br>");
$.get("/PublicGamesList", function( data ) {// get to server required, no respons, is offine nevertheless.
var gameNameList= data.split("\n");
if(gameNameList.length >0) {
$.get("/PublicGamesListByAdmincode", function( dataB ) {
var ProjectList= dataB.split("\n");
for (i = 0; i < ProjectList.length; i++) {
$("#pLobby").append("<a target='_blank' href='/project"+ProjectList[i] +"'>"+gameNameList[i]+ "</a><br>");
}
});} });
}
function handleClient()
{
var playfield = prompt("Please give in the Connection-code.", "bl@-123fourfive-six");
if (playfield == null || playfield == "") {
console.log("User cancelled the prompt.");
} else {
window.open(window.location.href+"project"+playfield, '_blank');
}
}
function loadCustomProjects()
{
$("#pFanGames").html("<u>Play fan-made game | speel fangemaakt spel</u><br>");
$.get("/directoryitems/custom_fan_examples", function( data ) {
var projects = data.split("<br>");
for (i = 0; i < projects.length; i++) {
$("#pFanGames").append( '<br><a target="_blank" href="/adminpage?static/custom_fan_examples/'+projects[i]+'">'+projects[i]+' </a>');
}
});
}
function sendCustomProjectToServer(projname, yourproj)
{
var xhttp = new XMLHttpRequest(); //REF:https://www.w3schools.com/xml/tryit.asp?filename=tryajax_post & https://stackoverflow.com/questions/39519246/make-xmlhttprequest-post-using-json
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
alert(this.responseText);
loadCustomProjects();
}
};
xhttp.open("POST", "getCustomProjectForShare", true);
xhttp.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
xhttp.send( projname+"?"+yourproj);
}
function uploadCustomProject() {//REF:https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_fileupload_files
var x = document.getElementById("btnLoadCustomProject");
if ('files' in x) {
if (x.files.length == 0) {
txt = "Select one or more files.";
} else {
x.files[0].text().then(t => sendCustomProjectToServer(x.files[0].name,t))//https://stackoverflow.com/questions/14446447/how-to-read-a-local-text-file
}
}
else {
if (x.value == "") {
txt += "Select a file.";
} else {
txt += "The files property is not supported by your browser!";
txt += "<br>The path of the selected file: " + x.value; // If the browser does not support the files property, it will return the path of the selected file instead.
}
}
}
$( document ).ready(function() {
loadCustomProjects();
});
</script>
</html>