Skip to content

Commit 079af35

Browse files
committed
Add basic supporter list
This adds a basic supporter list. It might need to be right aligned and the CTA left aligned. This supports: - Skeleton templates, for showing content when data is not loaded. This could need some animations for even more awesomeness. - Transparent logos - Strange format logos, that are not a square Issues: - Provided avatars are too big.. we only need them in a 112px format however they are not limited and some of them are above 1000px. - ES6 Features used, we need to transpile this, or downgrade the code.
1 parent 66dfac8 commit 079af35

File tree

3 files changed

+50
-1
lines changed

3 files changed

+50
-1
lines changed

css/main.css

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,3 +511,22 @@ p.paragraph {
511511
margin-top: 30px;
512512
}
513513
}
514+
515+
.supporters {
516+
padding: 10px 0;
517+
}
518+
.supporter {
519+
display: flex;
520+
align-items: center;
521+
justify-content: center;
522+
border-radius: 3px;
523+
margin: 10px;
524+
float: left;
525+
width: 112px;
526+
height: 112px;
527+
box-sizing: content-box;
528+
background: #fff;
529+
}
530+
.supporter img {
531+
border-radius: 3px;
532+
}

index.html

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,20 @@ <h4 class="subheading">
139139
<div class="container-sml">
140140
<div class="col-12 text-center">
141141
<div class="contribute-copy center vertical text-center">
142-
<h3 class="subheading">Become a backer</h1>
142+
<h3 class="subheading">Backers &amp; Sponsors</h3>
143+
<div class="supporters" id="supporters">
144+
<div class="supporter supporter--skeleton"></div>
145+
<div class="supporter supporter--skeleton"></div>
146+
<div class="supporter supporter--skeleton"></div>
147+
<div class="supporter supporter--skeleton"></div>
148+
<div class="supporter supporter--skeleton"></div>
149+
<div class="supporter supporter--skeleton"></div>
150+
<div class="supporter supporter--skeleton"></div>
151+
<div class="supporter supporter--skeleton"></div>
152+
<div class="supporter supporter--skeleton"></div>
153+
<div class="supporter supporter--skeleton"></div>
154+
</div>
155+
<h3 class="subheading">Become a backer</h3>
143156
<p class="paragraph">
144157
Support the community and keep development going strong.
145158
</p>
@@ -148,5 +161,7 @@ <h3 class="subheading">Become a backer</h1>
148161
</div>
149162
</div>
150163
</div>
164+
165+
<script async src="/js/script.js"></script>
151166
</body>
152167
</html>

js/script.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Promise.all(['https://opencollective.com/gulpjs/sponsor.json','https://opencollective.com/gulpjs/backer.json'].map(url =>
2+
fetch(url).then(resp => resp.json())
3+
)).then(entries => {
4+
let html = '';
5+
const supporters = [].concat.apply([], entries);
6+
const supportersToDisplay = supporters
7+
.sort( (first, second) => {return (second.totalDonations - first.totalDonations)} )
8+
.slice(0, 10);
9+
10+
supportersToDisplay.forEach((supporter) => {
11+
html += `<a class="supporter" href="${supporter.website}"><img alt="${supporter.name}" src="${supporter.avatar}" width="112"></a>`
12+
});
13+
14+
document.getElementById('supporters').innerHTML = html;
15+
});

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy