-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
113 lines (99 loc) · 3.46 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
---
layout: default
---
{% assign max_distance = 0 %}
{% assign max_distance_date = 0 %}
{% assign min_pace_5k = 1000000 %}
{% assign date_5k = 0 %}
{% assign total_miles = 0 %}
{% for post in site.posts %}
{% if post.distance > max_distance %}
{% assign max_distance = post.distance %}
{% assign max_distance_date = post.date %}
{% endif %}
{% if ((4.9 < post.distance < 5.3) or (post.tags contains '5K')) and post.avg_pace < min_pace_5k %}
{% assign min_pace_5k = post.avg_pace %}
{% assign date_5k = post.date %}
{% endif %}
{% assign total_kms = total_kms | plus: post.distance %}
{% endfor %}
<div class="home">
<div style="float: left; width: 450px: margin: 0">
<div style="display: table">
<ul class="box">
<li style="text-transform: uppercase">Total {{ site.units.distance }}</li>
<li class="value">{{ total_kms | distance }}</li>
</ul>
<ul class="box">
<li style="text-transform: uppercase">Total runs</li>
<li class="value">{{ site.posts.size }}</li>
</ul>
</div>
</div>
<div style="width: 300px; float: right; margin: 0">
<h4 style="display: inline; text-transform: uppercase">Personal Records</h4>
<ul style="list-style: none; margin-left: 0">
<li>
<div style="font-weight: 500">5K</div>
<div style="font-size: 80%; color: #888">{{ min_pace_5k | pace }}
<span class="right">{{ date_5k | date: "%b %-d, %Y" }}</span>
</div>
</li>
<li>
<div style="font-weight: 500">farthest</div>
<div style="font-size: 80%; color: #888">{{ max_distance }} {{ site.units.distance }}
<span class="right">{{ max_distance_date | date: "%b %-d, %Y" }}</span>
</div>
</li>
</ul>
</div>
<div style="clear: both">
</div>
<h3 style="text-transform: uppercase">Performance</h3>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
google.charts.load('current', {'packages': ['corechart', 'line']});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var pace = new google.visualization.DataTable();
pace.addColumn('date', 'Day');
pace.addColumn('number', 'pace');
pace.addRows([
{% for p in site.posts | limit: 30 %}[new Date({{ p.date | date: "%Y" }}, {{ p.date | date: "%m" | minus: 1 }}, {{ p.date | date: "%d"}}), {{ p.avg_pace }}],
{% endfor %}
]);
var pace_opts = {
hAxis: {
title: '',
text_position: 'out'
},
vAxis: {
title: 'pace'
},
legend: {
position: 'none'
},
chartArea: {
left: 0,
right: 0,
top: 10,
bottom: 30
}
};
var pace_chart = new google.visualization.AreaChart(document.getElementById('perf-chart'));
pace_chart.draw(pace, pace_opts);
}
</script>
<div id="perf-chart" style="border: 0; height: 150px; margin: 1em 0">
</div>
<h3 style="text-transform: uppercase">Recent Runs</h3>
<ul class="post-list">
{% for post in site.posts %}
<li>
<span class="post-meta" style="width: 150px; display: inline-block">{{ post.date | date: "%b %-d, %Y" }}</span>
<a href="{{ post.url | prepend: site.baseurl }}" style="text-transform: uppercase">{{ post.title }}</a>
<span class="right">{{ post.distance | distance }} {{ site.units.distance }} | {{ post.duration | timeDuration }}</span>
</li>
{% endfor %}
</ul>
</div>