2020-11-08 16:00:33 +00:00
|
|
|
{{define "header"}}
|
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<link rel="stylesheet" type="text/css" href="../css/main.css">
|
|
|
|
<!-- below line adds jQuery to the page -->
|
|
|
|
<!-- <script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js'></script> -->
|
|
|
|
<script type='text/javascript' src="https://go-echarts.github.io/go-echarts-assets/assets/echarts.min.js"></script>
|
|
|
|
<title>goCake - {{.Title}}</title>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
{{template "nav" .}}
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
{{define "nav"}}
|
|
|
|
<!-- iOS fix -->
|
|
|
|
<meta name='viewport' content='initial-scale=1, viewport-fit=cover, width=device-width'>
|
|
|
|
<nav>
|
|
|
|
<ul>
|
|
|
|
{{ if .Title}}
|
|
|
|
<!-- set current tab active, according to title -->
|
2020-11-15 19:46:32 +00:00
|
|
|
<li><a {{ if (eq .Title "Home") }}class="active"{{end}} href="/">Home</a></li>
|
2020-11-08 16:00:33 +00:00
|
|
|
<!-- <li><a {{ if (eq .Title "Rewards") }}class="active"{{end}} href="rewards">Monthly Rewards</a></li> -->
|
|
|
|
<!-- <li><a {{ if (eq .Title "Graphs") }}class="active"{{end}} href="graphs">Graphs</a></li> -->
|
2020-11-21 14:06:58 +00:00
|
|
|
<li><a {{ if (eq .Title "Pool by Cake Rewards") }}class="active"{{end}} href="rewards">Pool by Cake Rewards</a></li>
|
2020-11-08 16:00:33 +00:00
|
|
|
{{ end }}
|
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
{{define "footer"}}
|
2020-11-15 19:46:32 +00:00
|
|
|
<div class="footer">
|
|
|
|
♥ <a href="https://github.com/thunderstorm99/goCoinAnalyzer">Source Code</a> ♥
|
2020-11-08 16:00:33 +00:00
|
|
|
</div>
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
{{define "barGraph"}}
|
|
|
|
<div class="container">
|
|
|
|
<div class="item" id="chart"></div>
|
|
|
|
</div>
|
|
|
|
<script type="text/javascript">
|
|
|
|
"use strict";
|
|
|
|
var rewardChart = echarts.init(document.getElementById('chart'), "white");
|
|
|
|
var rewardOptions = {
|
|
|
|
title: {"text":"Monthly Rewards","subtext":"{{.Currency}}"},
|
|
|
|
tooltip: {"show":true},
|
2020-11-15 19:46:32 +00:00
|
|
|
legend: {"show":true},
|
2020-11-08 16:00:33 +00:00
|
|
|
dataZoom:[{"type":"inside"}],
|
|
|
|
xAxis: {{ template "xAxis" . }}
|
|
|
|
yAxis: [{}],
|
|
|
|
series: [{{template "series" . }}],
|
2020-11-21 14:06:58 +00:00
|
|
|
color: [{{ range $color := .Colors }}"{{ $color }}",{{ end }}"gray"],
|
2020-11-08 16:00:33 +00:00
|
|
|
};
|
|
|
|
rewardChart.setOption(rewardOptions);
|
|
|
|
</script>
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{define "xAxis"}}
|
2020-11-15 19:46:32 +00:00
|
|
|
[{"data":[ {{ range $month, $amount := .Rewards.Staking}}"{{ $month }}",{{ end }}]}],
|
2020-11-08 16:00:33 +00:00
|
|
|
{{end}}
|
|
|
|
|
|
|
|
{{define "series"}}
|
2020-11-15 19:46:32 +00:00
|
|
|
{{if .Lending}}
|
|
|
|
// Lending coins
|
|
|
|
{"name":"Lapis reward","type":"bar","stack":"stackA","waveAnimation":false,"data":[
|
|
|
|
{{ range $month, $amount := .Rewards.Lapis}}{"value": "{{ $amount }}" },{{ end }}
|
2020-11-08 16:00:33 +00:00
|
|
|
]},
|
2020-11-15 19:46:32 +00:00
|
|
|
{"name":"Referral reward","type":"bar","stack":"stackA","waveAnimation":false,"data":[
|
|
|
|
{{ range $month, $amount := .Rewards.Referral}}{"value": "{{ $amount }}" },{{ end }}
|
|
|
|
]},
|
2020-11-21 14:06:58 +00:00
|
|
|
{"name":"Cumulative","type":"bar","stack":"stackB","waveAnimation":false,"data":[
|
|
|
|
{{ range $month, $amount := .CumulativeRewards}}{"value": "{{ $amount }}" },{{ end }}
|
|
|
|
]},
|
2020-11-15 19:46:32 +00:00
|
|
|
{{else}}
|
|
|
|
// Stakeable coins
|
|
|
|
{"name":"Staking Rewards","type":"bar","stack":"stackA","waveAnimation":false,"data":[
|
|
|
|
{{ range $month, $amount := .Rewards.Staking}}{"value": "{{ $amount }}" },{{ end }}
|
|
|
|
]},
|
|
|
|
{"name":"Lapis DFI Bonus","type":"bar","stack":"stackA","waveAnimation":false,"data":[
|
|
|
|
{{ range $month, $amount := .Rewards.LapisDFI}}{"value": "{{ $amount }}" },{{ end }}
|
|
|
|
]},
|
|
|
|
{"name":"Confectionery Lapis DFI Bonus","type":"bar","stack":"stackA","waveAnimation":false,"data":[
|
|
|
|
{{ range $month, $amount := .Rewards.Confectionery}}{"value": "{{ $amount }}" },{{ end }}
|
|
|
|
]},
|
2020-11-21 14:06:58 +00:00
|
|
|
{"name":"Airdrop","type":"bar","stack":"stackA","waveAnimation":false,"data":[
|
|
|
|
{{ range $month, $amount := .Rewards.Airdrop}}{"value": "{{ $amount }}" },{{ end }}
|
|
|
|
]},
|
|
|
|
{"name":"Cumulative","type":"bar","stack":"stackB","waveAnimation":false,"data":[
|
|
|
|
{{ range $month, $amount := .CumulativeRewards}}{"value": "{{ $amount }}" },{{ end }}
|
|
|
|
]},
|
2020-11-15 19:46:32 +00:00
|
|
|
{{end}}
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
{{define "table"}}
|
|
|
|
<table class="table">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Month</th>
|
|
|
|
<th>{{.Currency}}</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{{ range $month, $amount := .Rewards.Staking}}
|
|
|
|
<tr>
|
|
|
|
<td class="left">{{ $month }}</td>
|
|
|
|
<td class="right">{{ $amount }}</td>
|
|
|
|
</tr>
|
|
|
|
{{ end }}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2020-11-08 16:00:33 +00:00
|
|
|
{{end}}
|