-
Notifications
You must be signed in to change notification settings - Fork 1
/
gigs.html
117 lines (105 loc) · 1.98 KB
/
gigs.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
114
115
116
117
---
title: Gigs
subtitle: |
<a
class='cal-subscribe'
data-target='#calendar-subscribe-modal'
data-toggle='modal'
href='#'
>
<i
class='fas fa-calendar-alt'
></i>
</a>
---
<div
class='gig-lists'
>
<ul
id='future-gigs'
></ul>
<hr>
<h2>
Archive
<a
class='collapsed'
data-toggle='collapse'
href='#gig-archive'
aria-expanded='false'
aria-controls='gig-archive'
>
<span
class='show-ctrl'
>
Show
<i
class='fa fa-arrow-circle-down'
></i>
</span>
<span
class='hide-ctrl'
>
Hide
<i
class='fa fa-arrow-circle-up'
></i>
</span>
</a>
</h2>
<ul
class='gig-archive collapse'
id='gig-archive'
></ul>
</div>
<hr>
{% include modals/calendar-subscribe-modal.html %}
{% include fragments/book-the-band.html %}
<script>
nothingPlanned = true
height = window.innerHeight
$.getJSON('/gigs.json', function(data) {
$.each(data.gigs, function(index, gig) {
date = fancyDate(gig.date)
item = `
<li
id='${ gig.date }'
>
<span
class='gig-date'
>${ date }:</span>
<a
href='${ gig.url.split('{{ site.url }}')[1] }'
title='${ gig.title }, ${ date }'
>
${ gig.title }
</a>
</li>`
if (isFuture(gig.date)) {
nothingPlanned = false
target = '#future-gigs'
$(target).prepend(item)
} else {
target = '#gig-archive'
$(target).append(item)
initialTop = $('#gig-archive > li')[0].getBoundingClientRect().bottom
opacify($(`#${ gig.date }`))
}
})
if (nothingPlanned) {
$('#future-gigs').append(`
<li>
Nothing in the calendar. Why not
<a
href='/book-the-band/'
>book us?</a>
</li>
`)
}
})
element = '#gig-archive > li'
$(window).on({
'scroll': function(e) {
fadeOut(element)
}
})
</script>