Repository navigation
Expand file tree
/
Copy pathlife-in-weeks.html
More file actions
100 lines (88 loc) · 3.58 KB
/
Copy pathlife-in-weeks.html
File metadata and controls
100 lines (88 loc) · 3.58 KB
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
---
title: Life in Weeks
layout: fullscreen
max_width: false
---
{% assign data = site.data[page.datafile] %}
{% assign start_date = page.start_date %}
{% assign split_start = start_date | split: "-" %}
{% assign start_year = split_start[0] %}
{% assign start_month = split_start[1] %}
{% assign start_day = split_start[2] %}
{% assign end_year = page.end_year %}
{% assign year_border_class = "border-secondary" %}
<section class="life-in-weeks">
<div class="row justify-content-center">
<div class="col-12">
{% include header_fullscreen.html %}
{{content}}
</div>
</div>
<div class="row justify-content-center">
<div class="col-12">
{% for year in (start_year..end_year) %}
{% capture this_year = year %}{{ year }}-{{ start_month }}-{{ start_day }}{% endcapture %}
{% capture next_year = year %}{{ year | plus: 1 }}-{{ start_month }}-{{ start_day }}{% endcapture %}
{% assign age = year | minus: start_year %}
{% assign age_modulo = age | modulo: 10 %}
{% if age_modulo == 0 %}
<br clear="all" />
<a name="decade-{{ age }}"></a>
<div class="row text-left display-block w-100 mt-4">
<div class="col sticky-top mt-1" style="top: 60px; background-color: #fff;"><h2 class="mt-0">
{% if page.suppress_decades %}
{% elsif age == 0 %}
My first ten years
{% elsif age == 10 %}
My teens
{% elsif age == 100 %}
Endgame
{% else %}
My {{ age }}s
{% endif %}
</h2></div>
</div>
{% endif %}
<div class="border border-gray {{ year_border_class }} float-left text-truncate"
style="height: 2em; max-height: 2em; padding: 2px 5px; margin: 2px;"
data-toggle="popover"
data-placement="right"
data-content="">
{% unless page.suppress_age %}{{ age }} in {% endunless %}{{ year }}
</div>
{% for week in (0..53) %}
{% assign week_border_class = "border-tertiary" %}
{% assign week_modifier = 604800 | times: week %}
{% assign this_week_date = this_year | date: "%s" | plus: week_modifier | date: "%Y-%m-%d" %}
{% assign end_year_date = this_week_date | date: "%s" | plus: week_modifier | date: "%Y-%m-%d" %}
<div data-date="{{ this_week_date }}" class="week border {{ week_border_class }} float-left text-center text-truncate"
style="height: 2em; max-height: 2em; padding: 2px 5px; margin: 2px;">
{% for day in (0..6) %}
{% assign day_modifier = 86400 | times: day %}
{% assign specific_date = this_week_date | date: "%s" | plus: day_modifier | date: "%Y-%m-%d" %}
{% if specific_date < next_year %}
{% for event in data[specific_date] %}
<a {% if event.link %}href="{{ event.link }}"{% endif %} title="{{ specific_date | date: "%b %-d, %Y" }}" target="_new" {% if event.desc or event.image %}data-toggle="popover" data-placement="auto" data-html="true"{% endif %} {% if event.image %}data-has-image="true"{% endif %} data-content="{% if event.image %}<img src='{{ event.image }}' style='max-width:200px;margin-bottom:8px;display:block;'>{% endif %}{{ event.desc }}">{{ event.name }}</a>
{% endfor %}
{% endif %}
{% endfor %}
</div>
{% endfor %}
{% endfor %}
</div>
</div>
<br clear="all" />
</p>
</section>
<script>
$(document).ready(function () {
$(function () {
var today = new Date();
$( ".week" ).each(function( index ) {
if (today < Date.parse($( this ).attr('data-date'))) {
$( this ).addClass('future-date');
}
});
})
});
</script>