<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<style>
			* {
			margin: 0;
			padding: 0;
		}
		
		.main-content {
			width: 1000px;
			font-size: 30px;
			font-family: 'Microsoft YaHei';
			font-family: "Microsoft YaHei";
			font-weight: bold;
		}
		
		.page-box {
			width: 1000px;
			display: flex;
			flex-direction: column;
		}
		
		.page-header {
			display: flex;
			flex-direction: column;
		}
		
		.clan-user-server {
			height: 120px;
			text-align: center;
			font-size: 45px;
			line-height: 120px;
		}
		
		.clan {
			display: inline-block;
			padding-right: 10px;
			height: 120px;
		}
		
		.user {
			display: inline-block;
			height: 120px;
		}
		
		.server {
			display: inline-block;
			padding-left: 10px;
		}
		
		.server-border {
			width: 200px;
			height: 50px;
			line-height: 50px;
			background-color: #F2F2F2;
			border-radius: 25px;
			font-size: 35px;
		}
		
		.xi-row {
			margin: 0 50px;
			height: 300px;
			display: flex;
			text-align: center;
		}
		
		.ship-count {
			flex: 1;
			background-color: #F2F2F2;
			border-radius: 16px;
		}
		
		.xi {
			flex: 2;
			background-color: #F2F2F2;
			margin-left: 20px;
			border-radius: 16px;
			display: flex;
		}
		
		.type {
			font-size: 50px;
			color: #767171;
			font-weight: normal;
			text-align: left;
			margin-left: 75px;
			margin-top: 70px;
		}
		
		.in-port {
			font-size: 20px;
			color: #767171;
			font-weight: normal;
			text-align: left;
			margin-left: 75px;
		}
		
		.number {
			font-size: 50px;
			color: rgb(1,129,118);
			text-align: left;
			margin-left: 75px;
		}
		
		.xi-left {
			flex: 1;
		}
		
		.xi-mid {
			flex: 1;
			margin-top: 70px;
		}
		
		.xi-right {
			flex: 1;
		}
		
		.unup {
			font-size: 50px;
			color: #767171;
		}
		
		.up-1 {
			color: #DF9D21;
			font-size: 22px;
		}
		
		.up-2 {
			color: #12C8AE;
			font-size: 22px;
		}
		
		.up-3 {
			color: #B400B4;
			font-size: 22px;
		}
		
		.xi-right {
			margin: 20px;
		}
		
		.xi-right img {
			width: 100%;
			margin: 44px 0;
		}
		
		.x-row {
			margin: 0 50px;
			margin-top: 30px;
			height: 300px;
			background-color: #F2F2F2;
			border-radius: 16px;
			display: flex;
		}
		
		.x-left {
			flex: 2;
		}
		
		.x-right {
			flex: 5;
		}
		
		.x-right {
			margin-bottom: 25px;
			margin-right: 30px;
			display: flex;
		}

		.total-item {
			display: flex;
			flex-direction: column;
			flex: 1;
			text-align: center;
		}

		.total-item img {
			min-height: 150px;
		}

		.total-up {
			height: 150px;
		}

		

		.mini-count {
			font-size: 20px;
			display: flex;
			flex-direction: column;
		}
		
		.ix-row {
			margin: 0 50px;
			margin-top: 30px;
			background-color: #F2F2F2;
			border-radius: 16px;
			display: flex;
		}

		.tier-item {
			text-align: center;
			flex: 1;
			margin: 10px 10px;
		}

		.coin {
			
			margin: 0 50px;
			margin-top: 30px;
			background-color: #F2F2F2;
			text-align: center;
			height: 120px;
			line-height: 120px;
			display: flex;
			justify-content: center;
			font-weight: normal;
			color: #767171;
			font-size: 45px;
			border-radius: 16px;
			
		}

		.coin img {
			height: 80px;
			margin: 20px 0;
		}


		.shop-item	{
			margin: 20px 0;
			flex: 1;
			text-align: center;
		}


		
		.ix-left {
			flex: 3;
			text-align: right;
		}
		
		.ix-mid {
			flex: 2;
			text-align: center;
			margin-top: 70px;
		}
		
		.ix-right {
			flex: 3;
			text-align: right;
		}
		
		.ix-right img {
			width: 200px;
			margin: 50px;
		}
		
		.footer {
			margin-top: 30px;
			text-align: center;
			font-weight: bold;
			font-size: 24px;
			color: #909399;
			margin-bottom: 20px;
		}
		
		.auth-status {
			color: #767171;
			margin: 0 50px;
			height: 60px;
			background-color: #F2F2F2;
			border-radius: 16px;
			line-height: 60px;
			font-weight: normal;
			text-align: center;
			font-weight: normal;
		}
		
		.status {
			font-weight: bold;
		}

		.chart-bar {
			flex: 6;
		}
	</style>
	<body>
		<div class="main-content">
			<div class="page-box">
				<div class="page-header">
					<div class="clan-user-server">
						{% if data['userInfo']['clanInfo']['tag'] %}
							<div class="clan" style="color: {{ data['userInfo']['clanInfo']['color'] }};">[{{ data['userInfo']['clanInfo']['tag'] }}]</div>
						{% endif %}
						<div class="user">{{ data['userInfo']['userName'] }}</div>
						<div class="server">
							<div class="server-border">
								{{ data['userInfo']['serverCn'] }}
							</div>
						</div>
					</div>
				</div>
				
				
				<div class="xi-row">
					<div class="ship-count">
						<div class="type">
							总船只
						</div>
						
						<div class="in-port">
							港口中
						</div>
						
						<div class="number">
							{{ data['shipCount'] }}
						</div>
					</div>
					<div class="xi">
						<!-- 等级柱形图 -->
						<div class="chart-bar"></div>
					</div>
				</div>
				
				<div class="x-row">
					<!-- <div class="x-left">
						<div style="height: 100%; font-size: 60px; font-weight: normal; line-height: 300px; text-align: center;">总获得</div>
					</div> -->
					
					<div class="x-right">
						<div class="total-item">
							<div class="total-top">
								<img src="https://hikari-resource.oss-cn-shanghai.aliyuncs.com/resource_Icon/steel.svg"/>
							</div>
							<div class="total-bottom" style="color: rgb(0,131,216);">
								<div><span id="steel">{{ data['resourceView']['sumResource'][1]['bonusMap']['0'] }}</span>钢铁</div>
								<div class="mini-count">
									<div id="steel-1"></div>
									<div id="steel-2"></div>
									<div id="steel-3"></div>
								</div>
							</div>
						</div>
						<div class="total-item">
							<div class="total-top">
								<img src="https://hikari-resource.oss-cn-shanghai.aliyuncs.com/resource_Icon/coal.svg"/>
							</div>
							<div class="total-bottom" style="color: rgb(144,206,87);">
								<div><span id="coal">{{ data['resourceView']['sumResource'][2]['bonusMap']['0'] }}</span>煤炭</div>
								<div class="mini-count">
									<div id="coal-1"></div>
									<div id="coal-2"></div>
									<div id="coal-3"></div>
								</div>
							</div>
						</div>
						<div class="total-item">
							<div class="total-top">
								<img src="https://hikari-resource.oss-cn-shanghai.aliyuncs.com/resource_Icon/research.svg"/>
							</div>
							<div class="total-bottom" style="color: rgb(6,130,105);">
								<div><span id="research">{{ data['resourceView']['sumResource'][0]['bonusMap']['0'] }}</span>研发点</div>
								<div class="mini-count">
									<div id="research-1"></div>
									<div id="research-2"></div>
									<div id="research-3"></div>
								</div>
							</div>
						</div>
					</div>
				</div>
				
				<div class="ix-row">

					{% for each in data['resourceView']['infos'] %}
						<div class="tier-item">
							<div style="font-weight: normal; color: rgb(118,113,113); font-size: 45px;">{{ ['0','I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX', 'X', 'XI'][each['level']] }}</div>
							{% if each['bonusType'] == 'RESEARCH' %}
								<div style="color: rgb(2,123,106);">{{ each['shipCount'] }}</div>
								<div style="height: 10px; background-color: rgb(6,130,105); border-radius: 3px;"></div>
								<div style="color: rgb(121, 93, 20);">{{ each['bonusMap']['0'] }}</div>
								<div style="color: rgb(6,130,105);">研发</div>
							{% elif each['bonusType'] == 'COAL' %}
								<div style="color: rgb(144,206,87);">{{ each['shipCount'] }}</div>
								<div style="height: 10px; background-color: rgb(144,206,87); border-radius: 3px;"></div>
								<div style="color: rgb(121, 93, 20);">{{ each['bonusMap']['0'] }}</div>
								<div style="color: rgb(144,206,87);">煤炭</div>
							{% elif each['bonusType'] == 'STEEL' %}
								<div style="color: rgb(2,123,106);">{{ each['shipCount'] }}</div>
								<div style="height: 10px; background-color: rgb(0,131,216); border-radius: 3px;"></div>
								<div style="color: rgb(121, 93, 20);">{{ each['bonusMap']['0'] }}</div>
								<div style="color: rgb(0,131,216);">钢铁</div>
							{% elif each['bonusType'] == 'TOKEN' %}
								<div style="color: rgb(226, 0, 0);">{{ each['shipCount'] }}</div>
								<div style="height: 10px; background-color: rgb(226, 0, 0); border-radius: 3px;"></div>
								<div style="color: rgb(121, 93, 20);">{{ each['bonusMap']['0'] }}</div>
								<div style="color: rgb(226, 0, 0);">代币</div>
							{% endif %}
						</div>
					{% endfor %}


					
				</div>

				<div class="coin">
					<img src="{{ data['exchangeView']['iconUrl'] }}">
					<div style="width: 30px;"></div>
					<div>{{ data['exchangeView']['name'] }}&nbsp;&nbsp;</div>
					<div style="font-weight: bold;">{{ data['exchangeView']['sumToken'] }}</div>
					<div>个</div>
				</div>
				
				<div class="ix-row">
					{% for each in data['exchangeView']['exchangeList'] %}
					<div class="shop-item">
						<div style="height: 150px;">
							<img src="{{ each['iconUrl'] }}" style="width: 150px; display: inline-block">
						</div>
						<div style="font-size: 18px; font-weight: normal;">{{ each['name'] }}</div>
						{% if each['maxNumber'] == 0 %}
						<div style="font-size: 18px; font-weight: normal;">可无限兑换</div>
						{% else %}
						<div style="font-size: 18px; font-weight: normal;">最多可兑换&nbsp;&nbsp;<span>{{ each['maxNumber'] }}</span></div>
						{% endif %}
						<div style="font-weight: normal; display: flex; justify-content: center;">
							<img src="{{ data['exchangeView']['iconUrl'] }}" style="max-width: 100px; display: inline-block;">
							<div style="width: 20px;"></div>
							<div style="display: flex; justify-content: center; align-items: center; font-size: 24px;">{{ each['price'] }}</div>
						</div>
					</div>
					{% endfor %}
					

				</div>
				
				<div class="footer">
					<p>©西行寺雨季&nbsp;&nbsp;©本心</p>
					<p>https://github.com/benx1n/HikariBot</p>
					<p>QQ频道搜索”yuyuko”即可使用稳定的腾讯官方机器人~</p>
					<p>Design By 冷眠 H5 Converted By C1ystal</p>
				</div>
			</div>
		</div>
	</body>
{% if template_path and template_path/"echarts.js" %}
<script src="file:\\{{template_path}}/echarts.js"></script>
{% else %}
<script src="https://cdn.jsdelivr.net/npm/echarts@5.3.3/dist/echarts.js"></script>
{% endif %}
	<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>

	<script>
		let steel_count = document.getElementById("steel").innerText;
		document.getElementById("steel-1").innerText = parseInt(steel_count * 1.05) + " +5%";
		document.getElementById("steel-2").innerText = parseInt(steel_count * 1.07) + " +7%";
		document.getElementById("steel-3").innerText = parseInt(steel_count * 1.10) + " +10%";

		let coal_count = document.getElementById("coal").innerText;
		document.getElementById("coal-1").innerText = parseInt(coal_count * 1.05) + " +5%";
		document.getElementById("coal-2").innerText = parseInt(coal_count * 1.07) + " +7%";
		document.getElementById("coal-3").innerText = parseInt(coal_count * 1.10) + " +10%";

		let research_count = document.getElementById("research").innerText;
		document.getElementById("research-1").innerText = parseInt(research_count * 1.01) + " +1%";
		document.getElementById("research-2").innerText = parseInt(research_count * 1.03) + " +3%";
		document.getElementById("research-3").innerText = parseInt(research_count * 1.05) + " +5%";
	</script>

	<script>
	window.onload = function () {
		drawBarChart();
	};

	function drawBarChart() {
		var barChart = echarts.init(document.querySelector('.chart-bar'));
		var barOption = {
			animation: false,
			tooltip: {},
			label: {
				position: 'top',
				show: true,
				fontSize: '15',
				color: '#303133',
			},
			xAxis: {
				data: ['V', 'VI', 'VII', 'VIII', 'IX', 'X', '★'],
				axisLabel: {
					align: 'center',
					fontSize: '20',
				}
			},
			yAxis: {
				axisLabel: {
					align: 'center',
					fontSize: '20',
				}
			},
			series: [{
				name: '持有数',
				type: 'bar',
				data: [
					{% for each in data['levelCount'] %}
						{{ each['value'] }},
					{% endfor %}
				],
				itemStyle: {
					color: '#D6ECFB40',
					borderWidth: 1,
					borderType: 'solid',
					borderColor: '#9FB8FF',
					shadowColor: '#9FB8FF',
						shadowBlur: 3
				},
			}]
		};
		barChart.setOption(barOption);
	}
	</script>
</html>