game/static/game/table.js
/** WINNER Change player cards to css **/
WINNER Change player cards to css
WINNER Change player cards to css
function changePlayerCards(cards_id) {
    var player_cards_id = "player_cards_" + cards_id
    var player_cards = document.getElementById(player_cards_id).innerHTML;
    if (player_cards.length < 10) {
        player_arr = player_cards.match(/.{1,2}/g);
        var new_player = '';
        for (var i = 0; i < player_arr.length; i++) {
            if (player_arr[i][1] == '♥' || player_arr[i][1] == '♦') {
                new_player += ('<div class="card container-fluid m-1 text-danger">' + player_arr[i] + '</div>');
            } else {
                new_player += ('<div class="card container-fluid m-1">' + player_arr[i] + '</div>');
            }
        }
        document.getElementById(player_cards_id).innerHTML = new_player;
    }
}
function changePlayerCards ( cards_id ) { var player_cards_id = "player_cards_" + cards_id var player_cards = document . getElementById ( player_cards_id ) . innerHTML ; if ( player_cards . length < 10 ) { player_arr = player_cards . match ( / .{1,2} / g ) ; var new_player = '' ; for ( var i = 0 ; i < player_arr . length ; i ++ ) { if ( player_arr [ i ] [ 1 ] == '♥' |  p ayer_arr[i ] [ 1 ] =  ' ') { new_player += ( '<div class="card container-fluid m-1 text-danger">' + player_arr [ i ] + '</div>' ) ; } else { new_player += ( '<div class="card container-fluid m-1">' + player_arr [ i ] + '</div>' ) ; } } document . getElementById ( player_cards_id ) . innerHTML = new_player ; } }
WINNER Change player cards to css
WINNER Change player cards to css
// 1. Get player cards // 2. Change string to 2chars array // 3. Put cards decorated by cards div's