-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
220 lines (202 loc) · 6.3 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
---
layout: fullcol
title: Portfolio
description: From small centers and departments to large campus wide applications, we work with a wide range of clients. Check out the list below for a comprehensive view of our work.
brand: portfolio
idportfolio: true
permalink: /portfolio
---
<div class="d-flex table-filter">
<div
class="d-inline-flex table-filter-item justify-content-center flex-column"
style="min-width: 20rem; flex-grow: 1"
>
<input
id="search-bar"
class="form-control"
placeholder="Search Portfolio..."
type="text"
/>
</div>
<div
id="sort-updated"
class="d-md-inline-flex d-none table-filter-item align-items-center"
>
<span class="mx-1">Last Updated</span>
<i class="fa fa-arrow-up mx-1" aria-hidden="true"></i>
<i class="fa fa-arrow-down mx-1 active" aria-hidden="true"></i>
</div>
<!-- <div
class="d-md-inline-flex d-none table-filter-item justify-content-center flex-column dropdown p-0"
>
<div
class="dropdown-toggle"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false"
>
<span>Audience</span>
</div>
<div class="dropdown-menu"></div>
</div> -->
</div>
{% for portfolio in site.portfolio reversed %}
<div class="portfolio_item" data-title="{{portfolio.title}}">
<div class="row justify-content-between">
<div class="col-12 col-sm-8 col-md-5">
<div class="portfolio-title flexin">
<div>
{% if portfolio.status %}
<p class="port-status{{ portfolio.status}}">{{ portfolio.status }}</p>
{% endif %}
<h1>{{ portfolio.title }}</h1>
</div>
</div>
<p class="lead">
{{ portfolio.date | date: "%B %Y" }} • {{ portfolio.audience }}{% if
portfolio.current-url %} •
<a class="no-underline" href="{{ portfolio.current-url }}">
view site</a
>
{% endif %}
</p>
<p>{{ portfolio.description }}</p>
{% if portfolio.developers %}
<div class="profile-wrap">
{% for developer in portfolio.developers %} {% assign dev = site.team |
where: "name", developer | first %} {% include team_tooltip.html
text=dev.name image=dev.image %} {% endfor %}
</div>
{% endif %}
</div>
<div class="col-md-5 text-right">
<img
class="img-fluid"
src="/media/portfolio/{{ portfolio.image }}.png"
alt=""
/>
</div>
</div>
</div>
{% if portfolio.slideshow %} {% include modal-slide.html %} {% endif %} {%
endfor %}
<script>
window.addEventListener("DOMContentLoaded", () => {
$("#sort-updated").click((ev) => {
let items = $(".portfolio_item");
let tableFilter = $(".table-filter").first();
if (items) {
items.each((i, el) => {
$(el).remove();
$(el).insertAfter(tableFilter);
});
$(".fa.fa-arrow-up").first().toggleClass("active");
$(".fa.fa-arrow-down").first().toggleClass("active");
}
});
});
</script>
<script src="/js/searchBackend.js"></script>
<script>
let builder = function () {
this.setRef("title");
this.addField("description");
this.addField("author");
this.addField("title");
this.addField("developers");
};
function showResults(titles) {
$("[data-title]").each(function () {
$(this).hide();
});
for (let r of titles) {
$(`[data-title="${r}"`).show();
}
}
initSearch("/portfolio/search.json", [], builder).then(
({ searchData, index }) => {
let addFilter = new (function () {
this.dataset = searchData;
this.filterSets = [];
this.applyFilters = function () {
//calculate set intersection between this.dataset and this.filterSets...
let result = new Set(Object.keys(this.dataset));
for (let filter of this.filterSets) {
let f_set = new Set(filter);
result = new Set([...result].filter((x) => f_set.has(x)));
}
return [...result];
};
return () => {
this.filterSets.push(Object.keys(this.dataset));
let i = this.filterSets.length - 1;
return (array) => {
this.filterSets[i] = array;
showResults(this.applyFilters());
};
};
})();
let menu = $(".table-filter .dropdown-menu").first();
let categories = [
...new Set(
Object.values(searchData)
.map((el) => el.audience)
.filter((el) => typeof el !== "undefined")
),
];
let audienceFilter = addFilter();
let searchFilter = addFilter();
function clearDropdown() {
$(".table-filter .dropdown-item").each((_, e) =>
e.classList.remove("active")
);
}
function dropdownActiveWrapper(cb) {
return function (e) {
clearDropdown();
e.target.classList.add("active");
cb();
};
}
let audienceCallback = (audience) => {
let keys = Object.keys(searchData).filter(
(key) => searchData[key].audience == audience
);
audienceFilter(keys);
};
for (let category of categories.sort()) {
let el = document.createElement("button");
el.setAttribute("type", "button");
el.classList.add("dropdown-item");
el.innerText = category;
el.onclick = dropdownActiveWrapper(
audienceCallback.bind(audienceCallback, category)
);
menu.append(el);
}
let el = document.createElement("button");
el.setAttribute("type", "button");
el.classList.add("dropdown-item", "active");
el.innerText = "All";
el.onclick = dropdownActiveWrapper(
audienceFilter.bind(audienceFilter, Object.keys(searchData))
);
menu.prepend(el);
$("#search-bar").on("input", function () {
if ($(this).val() == "") {
searchFilter(Object.keys(searchData));
} else {
let results = index.search($(this).val(), {
fields: {
title: { boost: 5, expand: true },
description: { boost: 1 },
developers: { boost: 3, expand: true },
},
});
searchFilter(results.map((el) => el.ref));
}
});
}
);
</script>
<script defer src="/js/elasticlunr.min.js"></script>