Skip to content

Commit 845299d

Browse files
Bgreen23Pat Mellon
authored andcommitted
Add sort to Ecosystem (#37)
This commit adds sort to Ecosystem
1 parent ac3f3f8 commit 845299d

File tree

3 files changed

+97
-26
lines changed

3 files changed

+97
-26
lines changed

_includes/ecosystem_sort.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<a id="dropdownSortLeft" data-toggle="dropdown" data-target="#dropdownSortMenuLeft" >
2+
Sort <img src="{{ site.baseurl }}/assets/images/filter-arrow.svg">
3+
</a>
4+
5+
<div class="dropdown-menu sort-menu" id="#dropdownSortMenuLeft">
6+
<div class="ecosystem-filter-menu">
7+
<ul>
8+
<li>
9+
<a class="ecosystem-filter" id="sortLowLeft">GitHub Stars - Lowest</a>
10+
</li>
11+
12+
<li>
13+
<a class="ecosystem-filter" id="sortHighLeft">GitHub Stars - Highest</a>
14+
</li>
15+
</ul>
16+
</div>
17+
</div>

_sass/ecosystem.scss

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,3 +404,48 @@
404404
}
405405
}
406406
}
407+
408+
.ecosystem-divider {
409+
position: relative;
410+
margin-bottom: 4rem;
411+
margin-top: 1.5rem;
412+
top: 3rem;
413+
}
414+
415+
.ecosystem{
416+
#dropdownSort, #dropdownSortLeft {
417+
margin-left: 0;
418+
}
419+
}
420+
421+
.ecosystem-filter-menu {
422+
ul {
423+
list-style-type: none;
424+
padding-left: rem(20px);
425+
li {
426+
padding-right: rem(20px);
427+
word-break: break-all;
428+
429+
a {
430+
color: $mid_gray;
431+
&:hover {
432+
color: $orange;
433+
}
434+
}
435+
}
436+
}
437+
}
438+
439+
.ecosystem .ecosystem-filter {
440+
cursor: pointer;
441+
ul {
442+
list-style-type: none;
443+
}
444+
}
445+
446+
.ecosystem #dropdownFilter, #dropdownSort, #dropdownSortLeft {
447+
color: $mid_gray;
448+
cursor: pointer;
449+
z-index: 1;
450+
position: absolute;
451+
}

ecosystem/ecosystem.html

Lines changed: 35 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -62,34 +62,40 @@ <h1>
6262

6363
<!-- START CONTENT -->
6464

65-
<div class="row ecosystem-cards-wrapper">
66-
{% assign ecosystem = site.ecosystem | sort_natural: "title" %}
67-
68-
{% for item in ecosystem %}
69-
<div class="col-md-6 ecosystem-card-wrapper" data-categories="{{ item.category | join: "," }}">
70-
<div class="card ecosystem-card">
71-
<a href="{{ item.link }}" target="_blank">
72-
<div class="card-body {{ item.logo-class }} {% if item.experimental %}experimental{% endif %}">
73-
<div class="ecosystem-card-title-container">
74-
<ul class="star-list">
75-
<li class="card-title">{{ item.title }}</li>
76-
<div class="icon-count-container">
77-
<li><img class="github-logo" src="/assets/images/logo-github.svg"></li>
78-
<li class="github-stars-count">27</li>
79-
</div>
80-
</ul>
81-
{% if item.experimental %}
82-
<div class="experimental-badge">
83-
Experimental
84-
</div>
85-
{% endif %}
65+
{% include ecosystem_sort.html %}
66+
67+
<hr class="ecosystem-divider">
68+
69+
<div id="ecosystem-index-cards">
70+
<div class="list row ecosystem-cards-wrapper cards-right">
71+
{% assign ecosystem = site.ecosystem | sort_natural: "title" %}
72+
73+
{% for item in ecosystem %}
74+
<div class="col-md-6 ecosystem-card-wrapper" id="ecosystemCards" data-categories="{{ item.category | join: "," }}">
75+
<div class="card ecosystem-card">
76+
<a href="{{ item.link }}" target="_blank">
77+
<div class="card-body {{ item.logo-class }} {% if item.experimental %}experimental{% endif %}">
78+
<div class="ecosystem-card-title-container">
79+
<ul class="star-list">
80+
<li class="card-title">{{ item.title }}</li>
81+
<div class="icon-count-container">
82+
<li><img class="github-logo" src="/assets/images/logo-github.svg"></li>
83+
<li class="github-stars-count">27</li>
84+
</div>
85+
</ul>
86+
{% if item.experimental %}
87+
<div class="experimental-badge">
88+
Experimental
89+
</div>
90+
{% endif %}
91+
</div>
92+
<p class="card-summary">{{ item.summary }}</p>
8693
</div>
87-
<p class="card-summary">{{ item.summary }}</p>
88-
</div>
89-
</a>
94+
</a>
95+
</div>
9096
</div>
91-
</div>
92-
{% endfor %}
97+
{% endfor %}
98+
</div>
9399
</div>
94100

95101
<div class="join-notice">
@@ -146,4 +152,7 @@ <h1>
146152
$(".nav-link[data-category=" + category + "]").addClass('selected');
147153
}
148154
</script>
155+
149156
<script star-count-call-date="ecosystemStarCountCallDate" star-count-data="ecosystemStarCountData" src="{{ site.baseurl }}/assets/github-stars.js"></script>
157+
<script src="//cdnjs.cloudflare.com/ajax/libs/list.js/1.5.0/list.min.js"></script>
158+
<script list-id="ecosystem-index-cards" display-count="100" pagination="false" src="{{ site.baseurl }}/assets/filter-hub-tags.js"></script>

0 commit comments

Comments
 (0)