playing cards per websocket now :)
This commit is contained in:
		@@ -2,6 +2,13 @@
 | 
			
		||||
 | 
			
		||||
{% block content %}
 | 
			
		||||
 | 
			
		||||
        <script>
 | 
			
		||||
        function playCard(card) {
 | 
			
		||||
            let player = {{player}}
 | 
			
		||||
            window.game_socket.send("playcard "+player+":"+card)
 | 
			
		||||
        }
 | 
			
		||||
        </script>
 | 
			
		||||
 | 
			
		||||
        <div class="content">
 | 
			
		||||
            <h1><span class="font-semi-bold">Gambling Foo</span> <span class="smaller">A RESTful gaming service</span></h1>
 | 
			
		||||
            <p class="lead">
 | 
			
		||||
@@ -42,7 +49,11 @@
 | 
			
		||||
                    <li>
 | 
			
		||||
                        <strong>>card {{loop.index}} is: {{card}} </strong><br>
 | 
			
		||||
                         {% if playerActive and not choose_trump_color %}
 | 
			
		||||
                            <!--
 | 
			
		||||
                            <a href="/player/{{player}}/play/{{loop.index0}}">play card {{loop.index}}<{{card}}></a>
 | 
			
		||||
                            <div style="background-color:#D94A38;width:170px;height:80px;margin:20px;padding-top:20px;color:#ffffff;font-weight:bold;font-size:18px;float:left;text-align:center;" onclick="playCard({{loop.index0}})">Play Me</div>
 | 
			
		||||
                            -->
 | 
			
		||||
                        <button onclick="playCard({{loop.index0}})">Play {{card}}</button>
 | 
			
		||||
                        {% endif %}
 | 
			
		||||
                    </li>
 | 
			
		||||
                {% endfor %}
 | 
			
		||||
 
 | 
			
		||||
@@ -23,6 +23,7 @@
 | 
			
		||||
    <![endif]-->
 | 
			
		||||
    <script>
 | 
			
		||||
        let socket = new WebSocket("wss://cowiz.struppi.name/ws");
 | 
			
		||||
        window.game_socket = socket
 | 
			
		||||
 | 
			
		||||
        socket.onopen = function(e) {
 | 
			
		||||
            //alert("[open] Connection established");
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user