-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
148 lines (126 loc) · 4.88 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
---
layout: default
---
<header class="masthead">
<div class="container h-100">
<div class="row h-100">
<div class="col-lg-7 d-flex flex-column my-auto">
<div class="header-content mx-auto">
<h1 class="mb-5">The Percentage Project</h1>
<a href="#about" class="btn btn-outline btn-xl js-scroll-trigger learn-btn">Learn More</a>
</div>
</div>
</div>
</div>
</header>
<section class="about" id="about">
<div class="container text-white">
<h2>%</h2>
<p class="text-white">The Percentage Project is an artistic, visual outlet for data collected from an
anonymous survey of Computer Science students each year. The goal is
to showcase data along with advocates to put a face to a number; we aim to encourage reflection upon
the situations of minorities affected by microaggression, discrimination, and for what could be done to
alleviate these instances.</p>
<a alt="Click here to see the gallery of participating students." href="#gallery"
class="mr-2 btn btn-outline btn-xl js-scroll-trigger ">Gallery</a>
<a alt="Click here to find out how to contact us." href="#contact"
class="ml-2 btn btn-outline btn-xl js-scroll-trigger">Contact</a>
</div>
<div class="overlay"></div>
</section>
<section class="contact" id="contact">
<div class="container text-white">
<h2>Contact</h2>
<p class="text-white">
If you are interested in participating or bringing The % Project to your campus, shoot us an email.<br />
<a href="mailto:[email protected]">[email protected]</a>
</p>
</div>
</section>
<section class="gallery features mb-5" id="gallery">
<div class="dropdown year-selection">
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="true">
Latest gallery
<span class="caret"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
{% for year in site.years %}
<a href="#" class="dropdown-item js-gallery-trigger" data-value="{{ year.year }}">{{ year.title }}</a>
{% endfor %}
</ul>
</div>
<img class="loading" src="{{ '/assets/img/dribbble.gif' | prepend: site.baseurl }}" />
{% for year in site.years %}
{% if year.published %}
<div class="container">
{{ year.content }}
</div>
{% endif %}
{% endfor %}
</section>
<script>
$(".dropdown-menu .dropdown-item").click(function () {
event.preventDefault();
$(this).parents(".dropdown").find('.btn').html($(this).text() + ' gallery <span class="caret"></span>');
$(this).parents(".dropdown").find('.btn').val($(this).data('value'));
});
var $current = $('.latest-photos');
if ($.browser.mobile) { // only need this to be called once and not dynamically because its unlikely that one would suddenly change their user agent
$('body').addClass('mobile');
}
// init Masonry
var $grid = $current.masonry({
itemSelector: '.masonry-item-loaded'
});
var setUpLazy = function() {
$current.find('.card-img-top').Lazy({
afterLoad: function (element) {
$newItem = $(element)
.closest('.card-outer')
.addClass('.masonry-item-loaded');
$grid.masonry('appended', $newItem);
},
onFinishedAll: function () {
$('.loading').fadeOut();
$current
.addClass("already-loaded")
.fadeIn();
$grid.masonry('layout');
},
onError: function (element) {
console.log('error loading ' + element.data('src'));
}
});
}
$(function () {
setUpLazy();
});
// when we resize re-layout masonry
$(window).on("resize", function () {
$grid.masonry('layout');
});
$('.js-gallery-trigger').click(function () {
// we are "Loading" again
$('.loading').fadeIn();
// hide from user
$current.fadeOut();
// get set of photos
var year = $(this).data('value');
$current = $('.' + year + '-photos');
// destroy rid of old masonry
$grid.masonry('destroy');
// set up new masonry
$grid = $current.masonry({
itemSelector: '.masonry-item-loaded'
})
// load photos
if ($current.hasClass("already-loaded")) {
$('.loading').fadeOut();
$current.fadeIn();
$grid.masonry('layout');
} else {
setUpLazy();
}
})
</script>