<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<style>
    body {
        font-size: 26px;
        font-family: "Microsoft YaHei UI";
    }

    .font-size {
        font-weight: bold;
        font-size: 28px;
    }

    .font-data {
        font-weight: bold;
    }

    .greyColor {
        color: #696969;
    }

    .greyColor2 {
        color: #404040;
    }

    .blueColor {
        font-weight: bold;
        color: #000080;
    }

    .blackColor {
        font-weight: bold;
        color: black;
    }

    .bold-data {
        font-weight: bold;
    }


    table {
        border-spacing: 20px 15px;
        text-align: center;
    }

</style>
<body>
   <div>
    <table id="ship-data" width="920" style="table-layout: fixed;">
        <tr>
            <td colspan="6" class="font-data" style="text-align: center;">
                {% if data['clanInfo']['tag'] %}
                <span style="color:{{ data['clanInfo']['colorRgb'] }}">[{{ data['clanInfo']['tag'] }}]</span>&nbsp;
                {% endif %}
                <span>{{ data['userName'] }}</span><sup style="color:green">+{{ data['karma'] }}</sup>&nbsp;&nbsp;&nbsp;<span>{{ data['serverName'] }}</span>
            </td>
        </tr>
        <tr>
            <td colspan="2" class="font-data greyColor">场均</td>
            <td colspan="2" class="font-data greyColor">胜率</td>
            <td colspan="2" class="font-data greyColor">PR</td>
        </tr>
        <tr>
            <td colspan="2" style="color: {{ set_upinfo_color(data['dwpDataVO']['damage']) }}">{{ '%+d' | format(data['dwpDataVO']['damage']) }}</td>
            <td colspan="2" style="color: {{ set_upinfo_color(data['dwpDataVO']['wins']) }}">{{ '%.2f' | format(data['dwpDataVO']['wins']) }}%</td>
            <td colspan="2" style="color: {{ set_upinfo_color(data['dwpDataVO']['pr']) }}">{{ '%+d' | format(data['dwpDataVO']['pr']) }}</td>
        </tr>
        <tr>
            <td colspan="6" style="text-align: center;background-color: {{ data['pr']['color'] }}">{{ data['pr']['value'] }} {{ data['pr']['name'] }}</td>
        </tr>
        <tr>
            <td colspan="6" style="text-align: center;">最后战斗时间</td>
        </tr>
        <tr>
            <td colspan="6" class="greyColor" style="text-align: center;">{{ time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(abs(data['lastDateTime']))) }}</td>
        </tr>
        <tr>
            <td colspan="2" class="greyColor2 font-size">场次</td>
            <td colspan="2" class="greyColor2 font-size">胜率</td>
            <td colspan="2" class="greyColor2 font-size">场均</td>
        </tr>
        <tr>
            <td colspan="2" class="blueColor font-size">{{ data['pvp']['battles'] }}</td>
            <td colspan="2" class="blueColor font-size" style="color: {{ set_winColor(data['pvp']['wins']) }}">{{ data['pvp']['wins'] }}%</td>
            <td colspan="2" class="blueColor font-size" style="color: {{ set_damageColor(None,data['pvp']['damage']) }}">{{ data['pvp']['damage'] }}</td>
        </tr>
        <tr>
            <td colspan="2" class="greyColor2 font-size">经验</td>
            <td colspan="2" class="greyColor2 font-size">击杀</td>
            <td colspan="2" class="greyColor2 font-size">命中</td>
        </tr>
        <tr>
            <td colspan="2" class="blueColor font-size">{{ data['pvp']['xp'] }}</td>
            <td colspan="2" class="blueColor font-size">{{ '%.2f' | format(data['pvp']['frags']) }}</td>
            <td colspan="2" class="blueColor font-size">{{ data['pvp']['hit'] }}%</td>
        </tr>
        <tr>
            <td colspan="6" class="blackColor" style="text-align: center;"></td>
        </tr>
        <tr>
            <td colspan="6" class="bold-data greyColor2" style="text-align: center;">Warships stats by type</td>
        </tr>
        <tr>
            <td class="greyColor">类型</td>
            <td class="greyColor">场次</td>
            <td class="greyColor">PR</td>
            <td class="greyColor">胜率</td>
            <td class="greyColor">场均</td>
            <td class="greyColor">命中</td>
        </tr>
        {% if  data['type']['Battleship']['battles']  %}
        <tr>
            <td class="bold-data greyColor">战列舰</td>
            <td class="blueColor">{{ data['type']['Battleship']['battles'] }}</td>
            <td class="blueColor" style="color: {{ data['type']['Battleship']['pr']['color'] }}">{{ data['type']['Battleship']['pr']['value'] }}</td>
            <td class="blueColor" style="color: {{ set_winColor(data['type']['Battleship']['wins']) }}">{{ data['type']['Battleship']['wins'] }}%</td>
            <td class="blueColor" style="color: {{ set_damageColor(None,data['type']['Battleship']['damage']) }}">{{ data['type']['Battleship']['damage'] }}</td>
            <td class="blueColor">{{ data['type']['Battleship']['hit'] }}%</td>
        </tr>
        {% endif %}
        {% if data['type']['Cruiser']['battles'] %}
        <tr>
            <td class="bold-data greyColor">巡洋舰</td>
            <td class="blueColor">{{ data['type']['Cruiser']['battles'] }}</td>
            <td class="blueColor" style="color: {{ data['type']['Cruiser']['pr']['color'] }}">{{ data['type']['Cruiser']['pr']['value'] }}</td>
            <td class="blueColor" style="color: {{ set_winColor(data['type']['Cruiser']['wins']) }}">{{ data['type']['Cruiser']['wins'] }}%</td>
            <td class="blueColor" style="color: {{ set_damageColor('Cruiser',data['type']['Cruiser']['damage']) }}">{{ data['type']['Cruiser']['damage'] }}</td>
            <td class="blueColor">{{ data['type']['Cruiser']['hit'] }}%</td>
        </tr>
        {% endif %}
        {% if data['type']['Destroyer']['battles'] %}
        <tr>
            <td class="bold-data greyColor">驱逐舰</td>
            <td class="blueColor">{{ data['type']['Destroyer']['battles'] }}</td>
            <td class="blueColor" style="color: {{ data['type']['Destroyer']['pr']['color'] }}">{{ data['type']['Destroyer']['pr']['value'] }}</td>
            <td class="blueColor" style="color: {{ set_winColor(data['type']['Destroyer']['wins']) }}">{{ data['type']['Destroyer']['wins'] }}%</td>
            <td class="blueColor" style="color: {{ set_damageColor('Destroyer',data['type']['Destroyer']['damage']) }}">{{ data['type']['Destroyer']['damage'] }}</td>
            <td class="blueColor">{{ data['type']['Destroyer']['hit'] }}%</td>
        </tr>
        {% endif %}
        {% if data['type']['AirCarrier']['battles'] %}
        <tr>
            <td class="bold-data greyColor">航空母舰</td>
            <td class="blueColor">{{ data['type']['AirCarrier']['battles'] }}</td>
            <td class="blueColor" style="color: {{ data['type']['AirCarrier']['pr']['color'] }}">{{ data['type']['AirCarrier']['pr']['value'] }}</td>
            <td class="blueColor" style="color: {{ set_winColor(data['type']['AirCarrier']['wins']) }}">{{ data['type']['AirCarrier']['wins'] }}%</td>
            <td class="blueColor" style="color: {{ set_damageColor('AirCarrier',data['type']['AirCarrier']['damage']) }}">{{ data['type']['AirCarrier']['damage'] }}</td>
            <td class="blueColor">N/A</td>
        </tr>
        {% endif %}
        <!--        单野、两个人、三人数据-->
        {% if data['pvpSolo']['battles'] %}
        <tr>
            <td colspan="6" class="bold-data greyColor" style="text-align: center;">单野</td>
        </tr>
        <!--        <tr>-->
        <!--            <td colspan="6" style="text-align: center;background-color: ${solo_prValueColor}">${solo_prValue}</td>-->
        <!--        </tr>-->
        <tr>
            <td class="greyColor">场次</td>
            <td class="greyColor">胜率</td>
            <td class="greyColor">PR</td>
            <td class="greyColor">经验</td>
            <td class="greyColor">场均</td>
            <td class="greyColor">击杀</td>
        </tr>
        <tr>
            <td class="blueColor">{{ data['pvpSolo']['battles'] }}</td>
            <td class="blueColor" style="color: {{ set_winColor(data['pvpSolo']['wins']) }}">{{ data['pvpSolo']['wins'] }}%</td>
            <td class="blueColor" style="color: {{ data['pvpSolo']['pr']['color'] }}">{{ data['pvpSolo']['pr']['value'] }}</td>
            <td class="blueColor">{{ data['pvpSolo']['xp'] }}</td>
            <td class="blueColor" style="color: {{ set_damageColor(None,data['pvpSolo']['damage']) }}">{{ data['pvpSolo']['damage'] }}</td>
            <td class="blueColor">{{ '%.2f' | format(data['pvpSolo']['frags']) }}</td>
        </tr>
        {% endif %}
        {% if data['pvpTwo']['battles'], %}
        <tr>
            <td colspan="6" class="bold-data greyColor" style="text-align: center;">自行车</td>
        </tr>
        <!--        <tr>-->
        <!--            <td colspan="6" style="text-align: center;background-color: {{div2_prValueColor}}">{{div2_prValue}}</td>-->
        <!--        </tr>-->
        <tr>
            <td class="greyColor">场次</td>
            <td class="greyColor">胜率</td>
            <td class="greyColor">PR</td>
            <td class="greyColor">经验</td>
            <td class="greyColor">场均</td>
            <td class="greyColor">击杀</td>
        </tr>
        <tr>
            <td class="blueColor">{{ data['pvpTwo']['battles'] }}</td>
            <td class="blueColor" style="color: {{ set_winColor(data['pvpTwo']['wins']) }}">{{ data['pvpTwo']['wins'] }}%</td>
            <td class="blueColor" style="color: {{ data['pvpTwo']['pr']['color'] }}">{{ data['pvpTwo']['pr']['value'] }}</td>
            <td class="blueColor">{{ data['pvpTwo']['xp'] }}</td>
            <td class="blueColor" style="color: {{ set_damageColor(None,data['pvpTwo']['damage']) }}">{{ data['pvpTwo']['damage'] }}</td>
            <td class="blueColor">{{ '%.2f' | format(data['pvpTwo']['frags']) }}</td>
        </tr>
        {% endif %}
        {% if data['pvpThree']['battles'] %}
        <tr>
            <td colspan="6" class="bold-data greyColor" style="text-align: center;">三轮车</td>
        </tr>
        <!--        <tr>-->
        <!--            <td colspan="6" style="text-align: center;background-color: {{div3_prValueColor}}">{{div3_prValue}}</td>-->
        <!--        </tr>-->
        <tr>
            <td class="greyColor">场次</td>
            <td class="greyColor">胜率</td>
            <td class="greyColor">PR</td>
            <td class="greyColor">经验</td>
            <td class="greyColor">场均</td>
            <td class="greyColor">击杀</td>
        </tr>
        <tr>
            <td class="blueColor">{{ data['pvpThree']['battles'] }}</td>
            <td class="blueColor" style="color: {{ set_winColor(data['pvpThree']['wins']) }}">{{ data['pvpThree']['wins'] }}%</td>
            <td class="blueColor" style="color: {{ data['pvpThree']['pr']['color'] }}">{{ data['pvpThree']['pr']['value'] }}</td>
            <td class="blueColor">{{ data['pvpThree']['xp'] }}</td>
            <td class="blueColor" style="color: {{ set_damageColor(None,data['pvpThree']['damage']) }}">{{ data['pvpThree']['damage'] }}</td>
            <td class="blueColor">{{ '%.2f' | format(data['pvpThree']['frags']) }}</td>
        </tr>
        {% endif %}
        {% if data['rankSolo']['battles'] %}
        <tr>
            <td colspan="6" class="bold-data greyColor" style="text-align: center;">排位</td>
        <tr>
            <td class="greyColor">场次</td>
            <td class="greyColor">胜率</td>
            <td class="greyColor">PR</td>
            <td class="greyColor">经验</td>
            <td class="greyColor">场均</td>
            <td class="greyColor">击杀</td>
        </tr>
        <tr>
            <td class="blueColor">{{ data['rankSolo']['battles'] }}</td>
            <td class="blueColor" style="color: {{ set_winColor(data['rankSolo']['wins']) }}">{{ data['rankSolo']['wins'] }}%</td>
            <td class="blueColor" style="color: {{ data['rankSolo']['pr']['color'] }}">{{ data['rankSolo']['pr']['value'] }}</td>
            <td class="blueColor">{{ data['rankSolo']['xp'] }}</td>
            <td class="blueColor" style="color: {{ set_damageColor(None,data['rankSolo']['damage']) }}">{{ data['rankSolo']['damage'] }}</td>
            <td class="blueColor">{{ '%.2f' | format(data['rankSolo']['frags']) }}</td>
        </tr>
        {% endif %}
        <tr>
            <td colspan="6">
                <div>
                    <canvas id="myChart" width="800"
                            height="331"></canvas>
                </div>
            </td>
        </tr>
        <tr>
            <td colspan="6" class="font-data greyColor" style="text-align: center;">
                <span>© 西行寺雨季</span>&nbsp;&nbsp;<span>© 本心</span></td>
        </tr>
        <tr>
            <td colspan="6" class="font-data greyColor" style="text-align: center;">
                <span>https://github.com/benx1n/HikariBot</span></td>
        </tr>
        <tr>
            <td colspan="6" class="font-data greyColor" style="text-align: center;">
                <span>QQ频道搜索“yuyuko”即可使用稳定的腾讯官方机器人~</span></td>
        </tr>
    </table>
</div>
{% if template_path and template_path/"Chart.min.js" and template_path/"chartjs-plugin-datalabels@1.0.0.js" %}
<script src= "{{template_path}}\Chart.min.js"></script>
<script src= "{{template_path}}\chartjs-plugin-datalabels@1.0.0.js"></script>
{% else %}
<script src="https://benx1n.oss-cn-beijing.aliyuncs.com/template_Hikari_Latest/Chart.min.js"></script>
<script src="https://benx1n.oss-cn-beijing.aliyuncs.com/template_Hikari_Latest/chartjs-plugin-datalabels@1.0.0.js"></script>
{% endif %}
<script>
    window.onload = function () {
        drawGraphs();
    };

    function drawGraphs() {
        var ctx = document.getElementById('myChart').getContext('2d');
        Chart.plugins.register(ChartDataLabels);
        const labels = ["Ⅰ", "Ⅱ", "Ⅲ", "Ⅳ", "Ⅴ", "Ⅵ", "Ⅶ", "Ⅷ", "Ⅸ", "Ⅹ", "Ⅺ"];
        const data = {
            labels: labels,
            datasets: [{
                label: '场次',
                data: [
                    {{ data['battleCountAll']['1'] }},
                    {{ data['battleCountAll']['2'] }},
                    {{ data['battleCountAll']['3'] }},
                    {{ data['battleCountAll']['4'] }},
                    {{ data['battleCountAll']['5'] }},
                    {{ data['battleCountAll']['6'] }},
                    {{ data['battleCountAll']['7'] }},
                    {{ data['battleCountAll']['8'] }},
                    {{ data['battleCountAll']['9'] }},
                    {{ data['battleCountAll']['10'] }},
                    {{ data['battleCountAll']['11'] }},
                    ],
                backgroundColor: [
                    'rgba(54, 162, 235, 0.2)',
                    'rgba(54, 162, 235, 0.2)',
                    'rgba(54, 162, 235, 0.2)',
                    'rgba(54, 162, 235, 0.2)',
                    'rgba(54, 162, 235, 0.2)',
                    'rgba(54, 162, 235, 0.2)',
                    'rgba(54, 162, 235, 0.2)',
                    'rgba(54, 162, 235, 0.2)',
                    'rgba(54, 162, 235, 0.2)',
                    'rgba(54, 162, 235, 0.2)',
                    'rgba(54, 162, 235, 0.2)'
                ],
                borderColor: [
                    'rgba(54, 162, 235, 0.2)',
                    'rgba(54, 162, 235, 0.2)',
                    'rgba(54, 162, 235, 0.2)',
                    'rgba(54, 162, 235, 0.2)',
                    'rgba(54, 162, 235, 0.2)',
                    'rgba(54, 162, 235, 0.2)',
                    'rgba(54, 162, 235, 0.2)',
                    'rgba(54, 162, 235, 0.2)',
                    'rgba(54, 162, 235, 0.2)',
                    'rgba(54, 162, 235, 0.2)',
                    'rgba(54, 162, 235, 0.2)'
                ],
                borderWidth: 1
            }]
        };
        const config = {
            type: 'bar',
            data: data,
            options: {
                animation: {
                    duration: 0
                },
                responsive: false,
                maintainAspectRatio: false,
                scales: {
                    yAxes: [{
                        ticks: {
                            beginAtZero: true
                        }
                    }]
                }
            },
        };
        var myChart = new Chart(
            ctx,
            config
        );
    }
</script>
</body>
</html>
