Skip to content

Commit b3f95b2

Browse files
authored
Merge pull request #3972 from typelevel/open-collective
Render sponsors from Open Collective REST API
2 parents 62801f9 + c8dfb77 commit b3f95b2

File tree

4 files changed

+152
-45
lines changed

4 files changed

+152
-45
lines changed

README.md

Lines changed: 33 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -36,51 +36,39 @@ information about how you can get involved as a developer. If you are looking fo
3636

3737
### Financial Contributors
3838

39-
[Become a financial contributor](https://opencollective.com/typelevel) and help us sustain our community. Donations directly support office hour for maintainers, better documentation and strategic initiatives.
40-
41-
42-
43-
### Gold Sponsors
44-
45-
Gold Sponsors are those who have pledged $5,000 to $10,000.
46-
47-
<a href="http://47deg.com"><img src="https://typelevel.org/img/media/sponsors/47_degrees.png" style="margin-left: 10px; margin-right: 10px" /></a>
48-
<a href="https://www.iteratorshq.com"><img src="https://typelevel.org/img/media/sponsors/iterators.png" style="margin-bottom:8px;margin-left: 10px; margin-right: 10px"/></a>
49-
<a href="https://triplequote.com/"><img src="https://typelevel.org/img/media/sponsors/triplequote.png" style="margin-bottom:9px; margin-right: 10px" /></a>
50-
<a href="http://underscore.io"><img src="https://typelevel.org/img/media/sponsors/underscore.png" style="margin-bottom:5px;margin-left: 10px; margin-right: 10px"/></a>
51-
52-
53-
54-
### Silver Sponsors
55-
56-
Silver Sponsors are those who have pledged $2,000 to $5,000.
57-
58-
<a href="https://www.ebiznext.com/"><img src="https://typelevel.org/img/media/sponsors/ebiznext.png" style="margin-bottom:15px; margin-right: 10px" /></a>
59-
<a href="https://www.inner-product.com/"><img src="https://typelevel.org/img/media/sponsors/inner-product.png" style="margin-bottom:10px; margin-right: 10px"/></a>
60-
<a href="https://evolutiongaming.com/"><img src="https://typelevel.org/img/media/sponsors/evolution_gaming_engineering.png" style="margin-bottom:10px; margin-right: 10px"/></a>
61-
62-
63-
#### Other Organizations
64-
65-
Support this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/typelevel/contribute)]
66-
67-
<a href="https://opencollective.com/typelevel/organization/0/website"><img src="https://opencollective.com/typelevel/organization/0/avatar.svg"></a>
68-
<a href="https://opencollective.com/typelevel/organization/1/website"><img src="https://opencollective.com/typelevel/organization/1/avatar.svg"></a>
69-
<a href="https://opencollective.com/typelevel/organization/2/website"><img src="https://opencollective.com/typelevel/organization/2/avatar.svg"></a>
70-
<a href="https://opencollective.com/typelevel/organization/3/website"><img src="https://opencollective.com/typelevel/organization/3/avatar.svg"></a>
71-
<a href="https://opencollective.com/typelevel/organization/4/website"><img src="https://opencollective.com/typelevel/organization/4/avatar.svg"></a>
72-
<a href="https://opencollective.com/typelevel/organization/5/website"><img src="https://opencollective.com/typelevel/organization/5/avatar.svg"></a>
73-
<a href="https://opencollective.com/typelevel/organization/6/website"><img src="https://opencollective.com/typelevel/organization/6/avatar.svg"></a>
74-
<a href="https://opencollective.com/typelevel/organization/7/website"><img src="https://opencollective.com/typelevel/organization/7/avatar.svg"></a>
75-
<a href="https://opencollective.com/typelevel/organization/8/website"><img src="https://opencollective.com/typelevel/organization/8/avatar.svg"></a>
76-
<a href="https://opencollective.com/typelevel/organization/9/website"><img src="https://opencollective.com/typelevel/organization/9/avatar.svg"></a>
77-
78-
79-
#### Individuals
80-
81-
<a href="https://opencollective.com/typelevel"><img src="https://opencollective.com/typelevel/individuals.svg?width=890"></a>
82-
83-
39+
[Become a financial contributor](https://opencollective.com/typelevel) and help us sustain our community. Donations directly support office hours for maintainers, better documentation and strategic initiatives.
40+
41+
<h4>Platinum Sponsors</h4>
42+
<a href="https://opencollective.com/typelevel/contribute/platinum-sposor-12420/checkout">Platinum sponsorship</a> starts at $950 USD/month.
43+
<div id="platinum-sponsors">
44+
<noscript>Platinum Sponsors appear here at <a href="https://typelevel.org/cats/">https://typelevel.org/cats</a></noscript>
45+
</div>
46+
47+
<h4>Gold Sponsors</h4>
48+
<a href="https://opencollective.com/typelevel/contribute/gold-sponsor-12419/checkout">Gold Sponsorship</a> starts at $420 USD/month.
49+
<div id="gold-sponsors">
50+
<noscript>Gold Sponsors appear here at <a href="https://typelevel.org/cats/">https://typelevel.org/cats</a></noscript>
51+
</div>
52+
53+
<h4>Silver Sponsors</h4>
54+
<a href="https://opencollective.com/typelevel/contribute/silver-sponsor-11780/checkout">Silver Sponsorship</a> starts at $180 USD/month.
55+
<div id="silver-sponsors">
56+
<noscript>Silver Sponsors appear here at <a href="https://typelevel.org/cats/">https://typelevel.org/cats</a></noscript>
57+
</div>
58+
59+
<h4>Backers</h4>
60+
Become a <a href="https://opencollective.com/typelevel/contribute/backer-11779/checkout">Backer</a> with a recurring donation of just $5 USD/month.
61+
<div id="backers">
62+
<noscript>Backers appear here at <a href="https://typelevel.org/cats/">https://typelevel.org/cats</a></noscript>
63+
</div>
64+
65+
<h4>Other contributors</h4>
66+
We thankfully accept <a href="https://opencollective.com/typelevel/donate">one-time and recurring</a> contributions as well.
67+
<div id="other-contributors">
68+
<noscript>Other contributors appear here at <a href="https://typelevel.org/cats/">https://typelevel.org/cats</a></noscript>
69+
</div>
70+
71+
<script src="/cats/js/sponsors.js"></script>
8472

8573
### Getting Started
8674

build.sbt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ lazy val docSettings = Seq(
274274
),
275275
micrositeGithubRepo := "cats",
276276
micrositeImgDirectory := (LocalRootProject / baseDirectory).value / "docs" / "src" / "main" / "resources" / "microsite" / "img",
277+
micrositeJsDirectory := (LocalRootProject / baseDirectory).value / "docs" / "src" / "main" / "resources" / "microsite" / "js",
277278
micrositeTheme := "pattern",
278279
micrositePalette := Map(
279280
"brand-primary" -> "#5B5988",
Lines changed: 22 additions & 0 deletions
Loading
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
function addSponsor(divId, member, size) {
2+
div = document.getElementById(divId);
3+
var a = document.createElement('a');
4+
a.setAttribute('href', member.website || member.profile || '#');
5+
var img = document.createElement('img');
6+
img.setAttribute('src', member.image || 'img/missing-avatar.svg');
7+
if (size) {
8+
img.setAttribute('height', size);
9+
img.setAttribute('width', size);
10+
}
11+
img.setAttribute('alt', member.name);
12+
img.setAttribute('style', 'margin:6px;');
13+
if (member.marginBottom)
14+
img.setAttribute('style', img.getAttribute('style') + 'margin-bottom:' + member.marginBottom + 'px;')
15+
a.appendChild(img);
16+
div.appendChild(a);
17+
};
18+
19+
const PlatinumSize = 98;
20+
const GoldSize = 76;
21+
const SilverSize = 60;
22+
const BackerSize = 45;
23+
const ContributorSize = 36;
24+
25+
var sponsors = function() {
26+
var xhr = new XMLHttpRequest();
27+
xhr.open('GET', 'https://opencollective.com/typelevel/members/all.json', true);
28+
xhr.responseType = 'json';
29+
xhr.onload = function() {
30+
var status = xhr.status;
31+
if (status === 200) {
32+
for(i = 0; i < xhr.response.length; i++) {
33+
var member = xhr.response[i];
34+
if (member.isActive) {
35+
switch (member.tier) {
36+
case 'Platinum Sponsor':
37+
addSponsor('platinum-sponsors', member, PlatinumSize);
38+
case 'Gold Sponsor':
39+
addSponsor('gold-sponsors', member, GoldSize);
40+
case 'Silver Sponsor':
41+
addSponsor('silver-sponsors', member, SilverSize);
42+
case 'backer':
43+
addSponsor('backers', member, BackerSize);
44+
break;
45+
default:
46+
if (member.totalAmountDonated > 0) {
47+
addSponsor('other-contributors', member, ContributorSize);
48+
}
49+
}
50+
};
51+
}
52+
}
53+
};
54+
xhr.send();
55+
};
56+
sponsors();
57+
// Add sponsors who predate open collective
58+
addSponsor('gold-sponsors', {
59+
name: "47 Degrees",
60+
website: "https://47deg.com",
61+
image: "https://typelevel.org/cats/img/sponsors/47_degree.png"
62+
});
63+
addSponsor('gold-sponsors', {
64+
name: "Iterators",
65+
website: "https://iteratorshq.com",
66+
image: "https://typelevel.org/cats/img/sponsors/iterators.png",
67+
marginBottom: 20
68+
});
69+
addSponsor('gold-sponsors', {
70+
name: "Triplequote",
71+
website: "https://triplequote.com",
72+
image: "https://typelevel.org/cats/img/sponsors/triplequote.png",
73+
marginBottom: 20
74+
});
75+
addSponsor('gold-sponsors', {
76+
name: "Underscore",
77+
website: "https://underscore.com",
78+
image: "https://typelevel.org/cats/img/sponsors/underscore.png",
79+
marginBottom: 10
80+
});
81+
addSponsor('silver-sponsors', {
82+
name: "Ebiznext",
83+
website: "https://ebiznext.com",
84+
image: "https://typelevel.org/cats/img/sponsors/ebiznext.png",
85+
marginBottom: 10
86+
});
87+
addSponsor('silver-sponsors', {
88+
name: "Inner Product",
89+
website: "https://inner-product.com",
90+
image: "https://typelevel.org/cats/img/sponsors/inner-product.png"
91+
});
92+
addSponsor('silver-sponsors', {
93+
name: "Evolution Gaming Engineering",
94+
website: "https://evolutiongaming.com",
95+
image: "https://typelevel.org/cats/img/sponsors/evolution_gaming_engineering.png"
96+
});

0 commit comments

Comments
 (0)