<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title></title>
</head>
<style>
    * {
        padding: 0;
        margin: 0;
    }

    .main-content, body {
        width: 1500px;
        font-size: 30px;
        font-family: "Microsoft YaHei", serif;
        font-weight: bold;
    }

    .page-box {
        width: 1500px;
        display: flex;
        flex-direction: column;
    }

    .masking-header {
        display: flex;
        justify-content: flex-start;
        height: 280px;
        width: auto;
        margin-top: 10px;
        margin-left: 10px;
        gap: 15px;
        border-radius: 36px;
        background: linear-gradient(to right, rgba(250, 250, 250, 0.75) 600px, rgba(250, 250, 250, 0));
    }

    .user-info {
        font-weight: bolder;
        line-height: 30px;
        font-size: 45px;
    }

    .user-sign-time {
        margin-top: 30px;
        font-family: "Microsoft YaHei UI Light", serif;
    }

    .user-server {
        margin-top: 5px;
        font-family: "Microsoft YaHei UI Light", serif;
    }

    .server-style {
        font-weight: bold;
    }

    .user-signature {
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        padding: 30px;
        gap: 10px;
        width: auto;
        background: rgba(0, 0, 0, 0.1);
        border-radius: 36px;
        margin-top: 30px;
    }
</style>
<style>
    {%if data['userInfo']['avatar']['colorName']['status']==2 %}
        .mirage-text {
            background: {{ data['userInfo']['avatar']['colorName']['data'] }};
            color: transparent;
            -webkit-background-clip: text;
            animation: ran-7e872de5 10s linear infinite;
        }
    {% endif %}

    .main-content, body {
        width: 1500px;
        font-size: 30px;
        font-family: "Microsoft YaHei", serif;
        font-weight: bold;
        background-size: contain;
        /*background: url("https://shinoaki.com/110554439_p0.jpg") no-repeat;*/
    }

    .page-header {
        border-radius: 36px;
        height: 300px;
        margin: 50px 50px 30px;
        display: flex;
        justify-content: flex-start;
    {%if data['userInfo']['avatar']['banner']['status']==2 %}
        background: url("{{data['userInfo']['avatar']['banner']['data']}}") no-repeat;
    {% endif %}
        background-position: center;
        background-size: 100%;
    }

    .avatar-header {
        filter: drop-shadow(9px 9px 12px rgba(0, 0, 0, 0.3));
        border-radius: 36px;
        height: 93%;
        width: 260px;
        margin-left: 10px;
        margin-top: 10px;
    {%if data['userInfo']['avatar']['avatar']['status']==2 %}
        background: url("{{data['userInfo']['avatar']['avatar']['data']}}") no-repeat;
    {% else %}
        background: url("{{data['userInfo']['dogTag']}}") no-repeat;
    {% endif %}
        background-position: center;
        background-size: 100%;
    }

    .clan-user-server {
        margin: 20px;
        text-align: left;
        font-size: 20px;
        display: flex;
        flex-direction: column;
        font-weight: bold;
        flex-grow: 1;
        justify-content: center;
    }

    .auth-status {
        color: #767171;
        margin: 0 50px;
        height: 60px;
        background-color: #F2F2F2;
        border-radius: 16px;
        line-height: 60px;
        font-weight: normal;
        text-align: center;
    }

    .box-info {
        color: #767171;
        margin: 30px 50px;
        height: 60px;
        background-color: #F2F2F2;
        border-radius: 16px;
        line-height: 60px;
        font-weight: normal;
        text-align: center;
    }
</style>
<style>
    .total-ship-row {
        margin: 0 40px;
        margin-top: 30px;
        display: flex;
        height: 300px;
    }

    .total-ship {
        margin: 0 10px;
        background-color: #F2F2F2;
        flex: 1;
        border-radius: 16px;
        display: flex;
        flex-direction: column;
    }

    .schedule {
        margin: 0 10px;
        background-color: #F2F2F2;
        flex: 1;
        border-radius: 16px;
    }

    .total-ship .up {
        font-size: 80px;
        font-weight: normal;
        color: #767171;
        flex: 1;
        line-height: 150px;
        text-align: center;
    }

    .total-ship .under {
        flex: 1;
        display: flex;
        text-align: center;
    }

    .inbox-col {
        flex: 2;
        display: flex;
        flex-direction: column;
    }

    .in-port-col {
        flex: 2;
        display: flex;
        flex-direction: column;
    }

    .mini-title {
        font-weight: normal;
        font-size: 40px;
        color: #767171;
    }

    .in-port {
        font-size: 60px;
        color: #92D050;
    }

    .inbox {
        font-size: 60px;
        color: #E60000;
    }

    .sch-box {
        margin: 30px;
    }

    .sch-box .text {
        font-weight: normal;
        color: #767171;
        font-size: 40px;
    }

    .pr {
        display: flex;
        height: 60px;
        font-weight: bold;
        line-height: 60px;
    }

    .pr-bar-bg {
        position: relative;
        flex: 1;
        line-height: 60px;
        background-color: #A6A6A6;
        height: 60px;
        border-radius: 30px;
        margin-top: 10px;
        text-align: center;
        color: #FFFFFF;
    }

    .pr-bar {
        position: absolute;
        top: 0;
        left: 0;
        height: 60px;
        z-index: 1;
        border-radius: 30px;
    }

    .pr-number {
        z-index: 99;
        position: absolute;
        left: 0px;
        right: 0px;
        font-size: 35px;
        font-weight: bold;
    }

    .footer {
        line-height: 30px;
        margin-top: 70px;
        text-align: center;
        font-weight: bold;
        font-size: 20px;
        color: #909399;
    }
</style>
<style>
    .rare-info {
        margin: 0 50px;
        background-color: #F2F2F2;
        border-radius: 16px;
        min-height: 300px;
        display: flex;
        justify-content: flex-start;
        gap: 5px;
        flex-direction: row;
        align-content: flex-start;
        flex-wrap: wrap;
        padding: 10px 20px;
    }

    .ship-item {
        min-width: 333px;
        max-width: 333px;
        height: 60px;
        line-height: 60px;
        font-weight: normal;

        width: calc(25% - 10px); /* 每行显示3个，减去间距 */
        box-sizing: border-box; /* 包括边框和内边距 */
        overflow: hidden; /* 隐藏溢出内容 */
        white-space: nowrap; /* 禁止换行 */
        text-overflow: ellipsis; /* 显示省略号 */
    }
</style>
<body>
<div class="main-content">
    <div class="page-box">
        <div class="page-header">
            <div class="masking-header">
                <div class="avatar-header"></div>
                <div class="clan-user-server">
                    <div class="user-info ">
                        {#                    是否有工会#}
                        {% if data['userInfo']['clanInfo']['tag'] %}
                            <span style="color: {{ data['userInfo']['clanInfo']['color'] }};">[{{ data['userInfo']['clanInfo']['tag'] }}]</span>
                        {% endif %}
                        <span class="mirage-text">{{ data['userInfo']['userName'] }}</span></div>
                    <div class="user-sign-time">注册时间: <span
                            class="server-style">{{ time.strftime('%Y-%m-%d %H:%M',time.localtime(int(abs(data['userInfo']['accountCreateTime'])))) }}</span>
                    </div>
                    <div class="user-server">服务器: <span class="server server-style">{{ data['userInfo']['serverCn'] }}</span></div>
                    {% if data['userInfo']['avatar']['sign']['status'] == 2 %}
                        <div class="user-signature">
                            {{ data['userInfo']['avatar']['sign']['data'] }}
                        </div>
                    {% endif %}
                </div>
            </div>
        </div>

        <div class="auth-status">
            {%if data['auth'] %}
                <span>授权状态：</span><span style="color: #47A123; font-weight: bold;">已授权</span>
            {% else %}
                <span>授权状态：</span><span style="color: #E60000; font-weight: bold;">未授权</span>
            {% endif %}
        </div>

        <div class="total-ship-row">
            <div class="total-ship">
                <div class="up">
                    总船只
                </div>
                <div class="under">
                    <div style="flex: 1;"></div>
                    <div class="inbox-col">
                        <span class="mini-title">圣诞箱中</span>
                        <span class="inbox">{{ data['count']}}</span>
                    </div>
                    <div class="in-port-col">
                        <span class="mini-title" style="color: #DF9B2D;">已拥有</span>
                        <span class="in-port">{{ data['have']}}</span>
                    </div>
                    <div style="flex: 1;"></div>
                </div>
            </div>
            <div class="schedule">
                <div class="sch-box">
                    <div class="text">收集进度</div>
                    <div class="pr">
                        <div class="pr-bar-bg">
                            <span class="pr-number"><span class="pr-text"></span></span>
                            <div class="pr-bar" style="background-color: #92D050;"></div>
                            <div class="footer">
                                <p>tips：未授权数据不准确，仅支持统计已战斗过的舰船</p>
                                <p>授权地址(点击右上角WG图标)：<span style="color: red">wows.mgaia.top</span></p>
                                <p>频道搜索”yuyuko”即可使用稳定的腾讯官方机器人~</p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!--        船只信息-->
        {% for dataMap in data['dataMap'] %}
            <div class="box-info">
                <span>概率：</span><span style="color: #E60000; font-weight: bold;">{{ dataMap['probability'] }}%</span>
                <span>&nbsp;总船只：</span><span style="color: black; font-weight: bold;">{{ dataMap['count'] }}</span>
                <span >&nbsp;已拥有：</span><span style="color: #92D050; font-weight: bold;">{{ dataMap['rare'] }}</span>
            </div>
            <div class="rare-info">
            {% for shipList in dataMap['data'] %}
                {% if shipList['status'] == 0 %}
                    <div class="ship-item" style="color: #DF9B2D;">
                {% endif %}
                {% if shipList['status'] == 1 %}
                    <div class="ship-item" style="color: black;">
                {% endif %}
                    <span class="level">{{ shipList['ship']['levelStr'] }}</span>&nbsp;
                    <span class="ship-name">{{ shipList['ship']['nameCn'] }}</span>
                </div>
            {% endfor %}
            </div>
        {% endfor %}
    </div>
</div>
<script>
    let ship_count = document.querySelector(".in-port").innerText;
    let bar_width = document.querySelector(".pr-bar-bg").clientWidth;
    let inbox_count = document.querySelector(".inbox").innerText;
    let sch = (ship_count / inbox_count) * 100;
    sch = sch.toFixed(2);
    // 防止收集进度过低导致进图条异常
    if (ship_count < 11) {
        document.querySelector('.pr-bar').style.width = (11 / inbox_count) * bar_width + "px";
    } else {
        document.querySelector('.pr-bar').style.width = (ship_count / inbox_count) * bar_width + "px";
    }
    document.querySelector(".pr-text").innerText = sch + "%";
</script>
</body>
</html>
