2020-04-05 16:00:48 +02:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html >
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
<meta name="description" content="pyramid web application">
|
|
|
|
<meta name="author" content="Pylons Project">
|
|
|
|
|
2020-12-06 21:56:16 +01:00
|
|
|
<title>Free Online Gambling</title>
|
2020-04-05 16:00:48 +02:00
|
|
|
|
|
|
|
<!-- Bootstrap core CSS -->
|
|
|
|
<link href="//oss.maxcdn.com/libs/twitter-bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
|
|
|
|
|
|
|
|
<!-- Custom styles for this scaffold -->
|
|
|
|
<link href="/css/theme.css" rel="stylesheet">
|
|
|
|
<link href="/css/docs.css" rel="stylesheet">
|
|
|
|
|
|
|
|
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
|
|
|
<!--[if lt IE 9]>
|
|
|
|
<script src="//oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
|
|
|
<script src="//oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
|
|
|
|
<![endif]-->
|
2020-04-19 17:14:25 +02:00
|
|
|
<script>
|
2020-11-26 00:44:27 +01:00
|
|
|
// let socket = new WebSocket("wss://cowiz.struppi.name/ws");
|
|
|
|
let socket = new WebSocket("ws://127.0.0.1:8001/ws");
|
2020-05-21 19:54:39 +02:00
|
|
|
window.game_socket = socket
|
2020-04-19 17:14:25 +02:00
|
|
|
|
|
|
|
socket.onopen = function(e) {
|
|
|
|
//alert("[open] Connection established");
|
|
|
|
//alert("Sending to server");
|
|
|
|
//socket.send("My name is John");
|
2020-12-06 22:28:45 +01:00
|
|
|
var msg = {
|
|
|
|
type: "message",
|
|
|
|
fct: "requestInit",
|
|
|
|
};
|
|
|
|
let t = JSON.stringify(msg);
|
|
|
|
window.game_socket.send(t);
|
2020-04-19 17:14:25 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
socket.onmessage = function(event) {
|
2020-12-06 22:28:45 +01:00
|
|
|
let msg = JSON.parse(event.data);
|
|
|
|
let fct = msg.fct;
|
2020-12-06 21:49:17 +01:00
|
|
|
if (fct == "reload") {
|
2020-05-21 20:17:24 +02:00
|
|
|
location.reload(true);
|
|
|
|
}
|
2020-12-06 21:49:17 +01:00
|
|
|
else if (fct == "startGame") {
|
2020-12-06 22:28:45 +01:00
|
|
|
let names = msg.names
|
|
|
|
setupGame(names)
|
2020-12-06 21:21:51 +01:00
|
|
|
}
|
2020-05-21 20:17:24 +02:00
|
|
|
else {
|
|
|
|
alert('unknown command: '+event.data);
|
|
|
|
}
|
2020-04-19 17:14:25 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
socket.onclose = function(event) {
|
|
|
|
if (event.wasClean) {
|
|
|
|
//alert(`[close] Connection closed cleanly, code=${event.code} reason=${event.reason}`);
|
|
|
|
} else {
|
|
|
|
// e.g. server process killed or network down
|
|
|
|
// event.code is usually 1006 in this case
|
|
|
|
//alert('[close] Connection died');
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
socket.onerror = function(error) {
|
2020-05-22 15:09:45 +02:00
|
|
|
alert("[error]: "+error.message);
|
2020-04-19 17:14:25 +02:00
|
|
|
};
|
|
|
|
</script>
|
2020-11-29 22:31:03 +01:00
|
|
|
|
|
|
|
<style>
|
|
|
|
* {padding: 0; margin: 0}
|
|
|
|
@font-face {
|
|
|
|
font-family: "Wizzta";
|
2020-12-01 22:13:14 +01:00
|
|
|
src: url("/js-cardgame/font/wizzta-vada-webfont.woff2") format("woff2"),
|
|
|
|
url("/js-cardgame/font/wizzta-vada-webfont.woff") format("woff");
|
2020-11-29 22:31:03 +01:00
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|
|
|
|
|
2020-04-05 16:00:48 +02:00
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<div class="starter-template">
|
|
|
|
<div class="container">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-2">
|
|
|
|
</div>
|
|
|
|
<div class="col-md-10">
|
|
|
|
<div>{% block content %}{% endblock %}</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-04-19 00:38:57 +02:00
|
|
|
<!--
|
2020-04-05 16:00:48 +02:00
|
|
|
<div class="row">
|
|
|
|
<div class="links">
|
|
|
|
<ul>
|
|
|
|
<li><i class="glyphicon glyphicon-cog icon-muted"></i><a
|
|
|
|
href="https://github.com/mikeckennedy/python-jumpstart-course-demos"
|
|
|
|
target="_blank">Github Project</a></li>
|
|
|
|
<li><i class="glyphicon glyphicon-globe icon-muted"></i><a href="https://twitter.com/talkpython"
|
|
|
|
target="_blank">Twitter</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="copyright">
|
|
|
|
Copyright © Talk Python Training
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-04-19 00:38:57 +02:00
|
|
|
-->
|
2020-04-05 16:00:48 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Bootstrap core JavaScript
|
|
|
|
================================================== -->
|
|
|
|
<!-- Placed at the end of the document so the pages load faster -->
|
2020-11-29 22:31:03 +01:00
|
|
|
<!-- <script src="https://oss.maxcdn.com/libs/jquery/1.10.2/jquery.min.js"></script> -->
|
|
|
|
<script src="/js-cardgame/jquery-3.5.1.min.js"></script>
|
|
|
|
<script src="https://oss.maxcdn.com/libs/twitter-bootstrap/3.0.3/js/bootstrap.min.js"></script>
|
2020-04-05 16:00:48 +02:00
|
|
|
</body>
|