<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
  <style>
    *{
    padding: 0;
    margin: 0;
  }
  body{
    color: #4e4e4e;
  }
  .clan-main{
    width: 1200px;
    padding: 20px;
    box-sizing: border-box;
  }


  /* 顶部信息 */
  .clan-name{
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
  }

  .clan-name>div:nth-child(1),.clan-name>div:nth-child(3){
    text-align: center;
    width: 120px;
  }

  .clan-name>div:nth-child(3)>div:nth-child(1){
    background-color: rgb(233, 233, 233);
    border-radius: 50px;
    font-weight: bold;
  }

  .clan-name>div:nth-child(3)>div:nth-child(2){
    font-size: 12px;
    padding-top: 8px;
    color: rgb(129, 129, 129);
  }

  .clan-name>div:nth-child(2){
    text-align: center;
  }

  .clan-name>div:nth-child(2)>div:nth-child(1){
    font-size:larger;
    font-weight: bold;
    font-size: 25px;
  }
  .clan-name>div:nth-child(2)>div:nth-child(2){
    font-size:large;
    font-size: 25px;
  }




  /* 进度条 */
  .progress-bar{
    background-color: rgb(218, 218, 218);
    border-radius: 50px;
    position: relative;
    margin-bottom: 10px;
  }
  .progress-bar>div:nth-child(2){
    font-weight: bold;
    color: white;
    text-align: center;
    padding: 5px;
    position: relative;
  }

  .progress-bar>div:nth-child(1){
    height: 100%;
    width: 50%;
    border-radius: 50px;
    position: absolute;
    background: aquamarine;
  }

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

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

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

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


  /* 时间信息 */
  .date{
    margin-bottom: 10px;
    text-align: center;
    font-size: 14px;
    color: rgb(129, 129, 129);
  }

  /* 总体信息 */
  .overall-info{
    display: flex;
    margin-bottom: 10px;
  }
  .overall-info>div:nth-child(1){
    flex-grow: 3;
  }
  .overall-info>div:nth-child(2),.overall-info>div:nth-child(3){
    flex-grow: 2;
  }

  .data-group{
    width: 0;
    text-align: center;
  }
  .data-group>div:nth-child(2){
    display: flex;
  }
  .data-group>div:nth-child(2)>div{
    flex-grow: 1;
    width: 0;
    background-color: #f1f1f1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 80px;
    border-radius: 10px;
    margin-right: 10px;
  }
  .data-group>div:nth-child(1){
    height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: #f1f1f1;
    border-radius: 10px;
    margin-bottom: 10px;
  }
  .data-group>div:nth-child(2)>div>div:nth-child(1){
    color: rgb(129, 129, 129);
    padding-bottom: 3px;
  }
  .data-group>div:nth-child(2)>div>div:nth-child(2){
    font-weight: bold;
  }

  .clan-rank{
    font-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgb(129, 129, 129);
  }
  .clan-rank>span{
    font-size: 32px;
    font-weight: bold;
    padding-left: 20px;
  }

  .clan-info{
    font-size: 24px;
    color: rgb(129, 129, 129);
  }
  .clan-info>div:nth-child(2){
    padding-top: 10px;
    font-weight: bold;
  }

  /* 分组名 */
  .group-name{
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
  }
  .group-name>div{
    width: 70%;
    background-color: #d4d4d4;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    padding: 5px;
    border-radius: 50px;
  }

  /* 赛季信息 */
  .clan-rank-table{
    background-color: #f1f1f1;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 10px;
  }
  .clan-rank-table>div:nth-child(1){
    display: flex;
    justify-content: space-between;
    padding: 0 40px 5px 40px;
    font-size: 18px;
  }
  .rank-num{
    font-size: 14px;
    color: rgb(129, 129, 129);
  }
  .rank-num>span{
    font-size: 18px;
    font-weight: bold;
    padding-left: 20px;
  }

  .color-line>div{
    background-color: red;
    height: 2px;
  }
  .tr-flex{
    display: flex;
    justify-content: space-between;
    padding-left: 40px;
  }
  .tr-flex>div{
    flex-grow: 1;
    width: 0;
    padding-top: 5px;
    padding-bottom: 5px;
    /* text-align: center; */
  }
  .table-title{
    background-color: #d4d4d4;
    border-radius: 4px;
    color: #4e4e4e;
  }
  .table-data{
    font-weight: bold;
  }
  .group-lev{
    padding-right: 100px;
    display: flex;
    justify-content: space-between;
  }
  .group-lev>div:nth-child(1){
    display: flex;
  }
  .group-lev>div:nth-child(1)>div{
    width:5px;
    background-color: red;
    margin-right: 5px;
    border-radius: 10px;
  }

  /* 军团设施 */
  .clan-facilities{
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
  }
  .clan-facilities>div{
    flex-grow: 1;
    width: 0;
  }
  .facilities-item{
    background-color: #f1f1f1;
    border-radius: 10px;
    padding: 20px 50px;
    display: flex;
    align-items: center;
    height: 100%;
    box-sizing: border-box;
  }
  .facilities-item>div:nth-child(1){
    font-weight: bold;
    font-size: 20px;
    padding-right: 40px;
  }

  .facilities-item-info{
    display: flex;
  }
  .facilities-item-info>div:nth-child(1){
    width: 140px;
  }
  </style>
	<body>
		<div class="clan-main">
      <!-- 顶部名称信息 -->
      <div class="clan-name">
        <div></div>
        <div>
          <div style="color:{{ data['colorRgb'] }};">[{{ data['tag'] }}]</div>
          <div>{{ data['name'] }}</div>
        </div>
        <div>
          <div class="server">{{ data['server'] }}</div>
          <div>Clan ID: {{ data['clanId'] }}</div>
        </div>
      </div>
      <!-- 进度条信息 -->
      <div class="pr">
					<!-- 动态设置长度及颜色，填写PR即可 -->
					<div class="pr-bar-bg">
						<span class="pr-number">0&nbsp;&nbsp;&nbsp;&nbsp;<span
								class="pr-text"></span></span>
						<div class="pr-bar"></div>
					</div>
				</div>
      <!-- 时间信息 -->
      <div class="date">
        <div>创建时间：{{ time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(abs(data['createdAt']/1000)))}}</div>
        <div>数据更新：{{ time.strftime('%Y-%m-%d %H:%M',time.localtime(time.time())) }}</div>
      </div>
      <!-- 总体信息 -->
      <div class="overall-info">
        <!-- 第一列 -->
        <div class="data-group">
          <div >
            <div class="clan-rank">军团排名 <span>暂无数据</span></div>
          </div>
          <div>
            <div>
              <div>军团活跃度</div>
              <div>暂无数据</div>
            </div>
            <div>
              <div>军团成员</div>
              <div>{{ data['membersCount'] }}/{{ data['maxMembersCount'] }}</div>
            </div>
          </div>
        </div>
        <!-- 第二列 -->
        <div class="data-group">
          <div class="clan-info" style="margin-left:10px;margin-right:10px;">
            <div>总体胜率</div>
            <div>暂无数据%</div>
          </div>
          <div>
            <div>
              <div>场次</div>
              <div>暂无数据</div>
            </div>
            <div>
              <div>经验</div>
              <div>暂无数据</div>
            </div>
          </div>
        </div>
        <!-- 第三列 -->
        <div class="data-group">
          <div class="clan-info">
            <div>场均</div>
            <div>暂无数据</div>
          </div>
          <div>
            <div>
              <div>击杀</div>
              <div>暂无数据</div>
            </div>
            <div style="margin-right: 0px;">
              <div>日均</div>
              <div>暂无数据</div>
            </div>
          </div>
        </div>
      </div>
      <!-- 分组名称 -->
      <div class="group-name">
        <div>军团战斗</div>
      </div>
      <!-- 赛季信息 -->
      <div class="clan-rank-table">
        <div>
          <div>S{{ data['clanLeagueInfo']['lastSeason'] }}赛季摘要</div>
          <div class="rank-num">服务器排名<span>28</span></div>
        </div>
        <div class="color-line"><div></div></div>
        <div class="tr-flex table-title">
          <div>队伍</div><div>场次</div><div>胜率</div><div>连胜</div><div>组别</div>
        </div>
        {% if data['clanLeagueInfo']['dataMap'][data['latest_season']]['alpha'] and data['clanLeagueInfo']['dataMap'][data['latest_season']]['alpha']['battlesCount'] != 0 %}
        <div class="tr-flex table-data">
          <div>Alpha</div>
          <div>{{ data['clanLeagueInfo']['dataMap'][data['latest_season']]['alpha']['battlesCount'] }}</div>
          <div>{{ '%.1f' | format(data['clanLeagueInfo']['dataMap'][data['latest_season']]['alpha']['winsCount']/data['clanLeagueInfo']['dataMap'][data['latest_season']]['alpha']['battlesCount']*100) }}%<span></span></div>
          <div>{{ data['clanLeagueInfo']['dataMap'][data['latest_season']]['alpha']['currentWinningStreak'] }}</div>
          <div><div class="group-lev"><div><div></div><span>{{ data['clanLeagueInfo']['dataMap'][data['latest_season']]['alpha']['leagueName']['buff'] }}{{ data['clanLeagueInfo']['dataMap'][data['latest_season']]['alpha']['divisionName'] }}</span></div><span>{{ data['clanLeagueInfo']['dataMap'][data['latest_season']]['alpha']['divisionRating'] }}</span></div></div>
        </div>
        {% endif %}
        {% if data['clanLeagueInfo']['dataMap'][data['latest_season']]['bravo'] and data['clanLeagueInfo']['dataMap'][data['latest_season']]['bravo']['battlesCount'] != 0 %}
        <div class="tr-flex table-data">
          <div>Bravo</div>
          <div>{{ data['clanLeagueInfo']['dataMap'][data['latest_season']]['bravo']['battlesCount'] }}</div>
          <div>{{ '%.1f' | format(data['clanLeagueInfo']['dataMap'][data['latest_season']]['bravo']['winsCount']/data['clanLeagueInfo']['dataMap'][data['latest_season']]['bravo']['battlesCount']*100) }}%<span></span></div>
          <div>{{ data['clanLeagueInfo']['dataMap'][data['latest_season']]['bravo']['currentWinningStreak'] }}</div>
          <div><div class="group-lev"><div><div></div><span>{{ data['clanLeagueInfo']['dataMap'][data['latest_season']]['bravo']['leagueName']['buff'] }}{{ data['clanLeagueInfo']['dataMap'][data['latest_season']]['bravo']['divisionName'] }}</span></div><span>{{ data['clanLeagueInfo']['dataMap'][data['latest_season']]['bravo']['divisionRating'] }}</span></div></div>
        </div>
        {% endif %}
      </div>


      <div class="clan-rank-table">
        <div>
          <div>S{{ data['clanLeagueInfo']['lastSeason'] }}赛季摘要最高记录</div>
          <div class="rank-num">
            <!-- 服务器排名<span>28</span> -->
          </div>
        </div>
        <div class="color-line"><div></div></div>
        <div class="tr-flex table-title">
          <div>队伍</div><div>场次</div><div>胜场</div><div>最高连胜</div><div>组别</div>
        </div>
        <div class="tr-flex table-data">
          <div>Alpha</div><div>72</div><div>44 (<span>61%</span>)</div><div>4场</div><div><div class="group-lev"><div><div></div><span>黄金I</span></div><span>39</span></div></div>
        </div>
        <div class="tr-flex table-data">
          <div>Alpha</div><div>72</div><div>44 (<span>61%</span>)</div><div>4场</div><div><div class="group-lev"><div><div></div><span>黄金I</span></div><span>39</span></div></div>
        </div>
      </div>

      <!-- 分组名称 -->
      <div class="group-name">
        <div>军团设施</div>
      </div>
      <!-- 设施信息 -->
      <div class="clan-facilities">
        <div>
          <div class="facilities-item" style="margin-right: 5px;">
            <div>折扣</div>
            <div>
              <div class="facilities-item-info">
                <div><span style="color:{{ data['buildingsInfos'][1]['fullLevelColor'] }};">{{ data['buildingsInfos'][1]['level'] }}/{{ data['buildingsInfos'][1]['maxLevel'] }}</span>级干船坞</div>
                <div>I-X整备费用<span style="color:{{ data['buildingsInfos'][1]['fullLevelColor'] }};">{{ data['buildingsInfos'][1]['buff']['buff'] }}</span></div>
              </div>
              <div class="facilities-item-info">
                <div><span style="color:{{ data['buildingsInfos'][2]['fullLevelColor'] }};">{{ data['buildingsInfos'][2]['level'] }}/{{ data['buildingsInfos'][2]['maxLevel'] }}</span>级造船厂</div>
                <div>I-X研发费用<span style="color:{{ data['buildingsInfos'][2]['fullLevelColor'] }};">{{ data['buildingsInfos'][2]['buff']['buff'] }}</span></div>
              </div>
            </div>
          </div>
        </div>
        <div>
          <div class="facilities-item" style="margin-left: 5px;">
            <div>加成</div>
            <div>
              <div class="facilities-item-info">
                <div><span style="color:{{ data['buildingsInfos'][0]['fullLevelColor'] }};">{{ data['buildingsInfos'][0]['level'] }}/{{ data['buildingsInfos'][0]['maxLevel'] }}</span>级煤炭港</div>
                <div>煤炭<span style="color:{{ data['buildingsInfos'][0]['fullLevelColor'] }};">{{ data['buildingsInfos'][0]['buff']['buff'] }}</span></div>
              </div>
              <div class="facilities-item-info">
                <div><span style="color:{{ data['buildingsInfos'][11]['fullLevelColor'] }};">{{ data['buildingsInfos'][11]['level'] }}/{{ data['buildingsInfos'][11]['maxLevel'] }}</span>级钢铁港</div>
                <div>钢铁<span style="color:{{ data['buildingsInfos'][11]['fullLevelColor'] }};">{{ data['buildingsInfos'][11]['buff']['buff'] }}</span></div>
              </div>
              <div class="facilities-item-info">
                <div><span style="color:{{ data['buildingsInfos'][4]['fullLevelColor'] }};">{{ data['buildingsInfos'][4]['level'] }}/{{ data['buildingsInfos'][4]['maxLevel'] }}</span>级研究所</div>
                <div>研究点<span style="color:{{ data['buildingsInfos'][4]['fullLevelColor'] }};">{{ data['buildingsInfos'][4]['buff']['buff'] }}</span></div>
              </div>
            </div>
          </div>
        </div>
      </div>

      <div class="clan-facilities">
        <div>
          <div class="facilities-item" style="margin-right: 5px;">
            <div>收入</div>
            <div>
              <div class="facilities-item-info">
                <div><span style="color:{{ data['buildingsInfos'][7]['fullLevelColor'] }};">{{ data['buildingsInfos'][7]['level'] }}/{{ data['buildingsInfos'][7]['maxLevel'] }}</span>级学院</div>
                <div>每场指挥官经验<span style="color:{{ data['buildingsInfos'][7]['fullLevelColor'] }};">{{ data['buildingsInfos'][7]['buff']['buff'] }}</span></div>
              </div>
              <div class="facilities-item-info">
                <div><span style="color:{{ data['buildingsInfos'][13]['fullLevelColor'] }};">{{ data['buildingsInfos'][13]['level'] }}/{{ data['buildingsInfos'][13]['maxLevel'] }}</span>级军事学院</div>
                <div>I-X 每场战斗经验<span style="color:{{ data['buildingsInfos'][13]['fullLevelColor'] }};">{{ data['buildingsInfos'][13]['buff']['buff'] }}</span></div>
              </div>
              <div class="facilities-item-info">
                <div><span style="color:{{ data['buildingsInfos'][3]['fullLevelColor'] }};">{{ data['buildingsInfos'][3]['level'] }}/{{ data['buildingsInfos'][3]['maxLevel'] }}</span>级设计局</div>
                <div>I-X 每场战斗全局经验<span style="color:{{ data['buildingsInfos'][3]['fullLevelColor'] }};">{{ data['buildingsInfos'][3]['buff']['buff'] }}</span></div>
              </div>
            </div>
          </div>
        </div>
        <div>
          <div class="facilities-item" style="margin-left: 5px;">
            <div>设施</div>
            <div>
              <div class="facilities-item-info">
                <div><span style="color:{{ data['buildingsInfos'][8]['fullLevelColor'] }};">{{ data['buildingsInfos'][8]['level'] }}/{{ data['buildingsInfos'][8]['maxLevel'] }}</span>级金库</div>
                <div>提供每个礼包<span>"超级补给箱"</span>的机会</div>
              </div>
              <div class="facilities-item-info">
                <div><span style="color:{{ data['buildingsInfos'][12]['fullLevelColor'] }};">{{ data['buildingsInfos'][12]['level'] }}/{{ data['buildingsInfos'][12]['maxLevel'] }}</span>级军官俱乐部</div>
                <div>容纳人数：<span style="color:{{ data['buildingsInfos'][4]['fullLevelColor'] }};">{{ data['buildingsInfos'][12]['buff']['buff'] }}</span></div>
              </div>
            </div>
          </div>
        </div>
      </div>


      <div class="facilities-item">
        <div>描述信息</div>
        <div style="white-space: pre-wrap; ">{{ data['description'] }}</div>
      </div>
    </div>
  </div>
	</body>
	<script>
	// PR条颜色动态变化
	let bar_bg_width = document.querySelector('.pr-bar-bg').clientWidth;
	let pr_number = document.querySelector('.pr-number').innerText;
	pr_number = parseInt(pr_number);
	if (pr_number == 0) {
		document.querySelector(".pr-bar").style.backgroundColor = "#828282";
		document.querySelector(".pr-text").innerText = "暂无数据";
	} else if (pr_number < 750) {
		document.querySelector(".pr-bar").style.backgroundColor = "#F44336";
		document.querySelector(".pr-text").innerText = "还需努力";
	} else if (pr_number < 1100) {
		document.querySelector(".pr-bar").style.backgroundColor = "#FF9800";
		document.querySelector(".pr-text").innerText = "低于平均";
	} else if (pr_number < 1350) {
		document.querySelector(".pr-bar").style.backgroundColor = "#FFC107";
		document.querySelector(".pr-text").innerText = "平均水平";
		document.querySelector(".pr-number").style.color = "#303133";
	} else if (pr_number < 1550) {
		document.querySelector(".pr-bar").style.backgroundColor = "#8BC34A";
		document.querySelector(".pr-text").innerText = "好";
	} else if (pr_number < 1750) {
		document.querySelector(".pr-bar").style.backgroundColor = "#4CAF50";
		document.querySelector(".pr-text").innerText = "很好";
	} else if (pr_number < 2100) {
		document.querySelector(".pr-bar").style.backgroundColor = "#00BCD4";
		document.querySelector(".pr-text").innerText = "非常好";
	} else if (pr_number < 2450) {
		document.querySelector(".pr-bar").style.backgroundColor = "#9C27B0";
		document.querySelector(".pr-text").innerText = "大佬水平";
	} else {
		document.querySelector(".pr-bar").style.backgroundColor = "#673AB7";
		document.querySelector(".pr-text").innerText = "神佬水平";
		pr_number = 2450; //防止pr条溢出
	}

	if (pr_number < 220 && pr_number > 0) {
		pr_number = 220; //防止pr过低导致圆角异常
	}
	// PR条动态长度
	let width = bar_bg_width * (pr_number / 2450);
	document.querySelector('.pr-bar').style.width = width + "px";
</script>

<script>
	// 服务器字体颜色自动填充
	let server_name = document.querySelector(".server").innerText;
	if (server_name == "亚服") {
		document.querySelector(".server").style.color = "#92D050";
	} else if (server_name == "国服") {
		document.querySelector(".server").style.color = "#BF9000";
	} else if (server_name == "欧服") {
		document.querySelector(".server").style.color = "#009664";
	} else if (server_name == "美服") {
		document.querySelector(".server").style.color = "#6872C4";
	} else if (server_name == "俄服") {
		document.querySelector(".server").style.color = "#FF0000";
	}
</script>
</html>