From 7166e234058b17a87f31d646c997c7c76a738ec1 Mon Sep 17 00:00:00 2001 From: "Ross A. Baker" Date: Tue, 24 Aug 2021 15:01:34 -0400 Subject: [PATCH 1/2] Render sponsors from Open Collective REST API --- README.md | 78 +++++++-------- build.sbt | 1 + .../microsite/img/missing-avatar.svg | 22 +++++ .../main/resources/microsite/js/sponsors.js | 96 +++++++++++++++++++ 4 files changed, 152 insertions(+), 45 deletions(-) create mode 100644 docs/src/main/resources/microsite/img/missing-avatar.svg create mode 100644 docs/src/main/resources/microsite/js/sponsors.js diff --git a/README.md b/README.md index a83604a6d9..13afdbca82 100644 --- a/README.md +++ b/README.md @@ -36,51 +36,39 @@ information about how you can get involved as a developer. If you are looking fo ### Financial Contributors -[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. - - - -### Gold Sponsors - -Gold Sponsors are those who have pledged $5,000 to $10,000. - - - - - - - - -### Silver Sponsors - -Silver Sponsors are those who have pledged $2,000 to $5,000. - - - - - - -#### Other Organizations - -Support this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/typelevel/contribute)] - - - - - - - - - - - - - -#### Individuals - - - - +[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. + +

Platinum Sponsors

+Platinum sponsorship starts at $950 USD/month. +
+ +
+ +

Gold Sponsors

+Gold Sponsorship starts at $420 USD/month. +
+ +
+ +

Silver Sponsors

+Silver Sponsorship starts at $180 USD/month. +
+ +
+ +

Backers

+Become a Backer with a recurring donation of just $5 USD/month. +
+ +
+ +

Other contributors

+We thankfully accept one-time and recurring contributions as well. +
+ +
+ + ### Getting Started diff --git a/build.sbt b/build.sbt index 20f7c5aa6c..d3475db516 100644 --- a/build.sbt +++ b/build.sbt @@ -274,6 +274,7 @@ lazy val docSettings = Seq( ), micrositeGithubRepo := "cats", micrositeImgDirectory := (LocalRootProject / baseDirectory).value / "docs" / "src" / "main" / "resources" / "microsite" / "img", + micrositeJsDirectory := (LocalRootProject / baseDirectory).value / "docs" / "src" / "main" / "resources" / "microsite" / "js", micrositeTheme := "pattern", micrositePalette := Map( "brand-primary" -> "#5B5988", diff --git a/docs/src/main/resources/microsite/img/missing-avatar.svg b/docs/src/main/resources/microsite/img/missing-avatar.svg new file mode 100644 index 0000000000..4e82880a1f --- /dev/null +++ b/docs/src/main/resources/microsite/img/missing-avatar.svg @@ -0,0 +1,22 @@ + + + + + + + + + image/svg+xml + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/src/main/resources/microsite/js/sponsors.js b/docs/src/main/resources/microsite/js/sponsors.js new file mode 100644 index 0000000000..1428b3b2f2 --- /dev/null +++ b/docs/src/main/resources/microsite/js/sponsors.js @@ -0,0 +1,96 @@ +function addSponsor(divId, member, size) { + div = document.getElementById(divId); + var a = document.createElement('a'); + a.setAttribute('href', member.website || member.profile || '#'); + var img = document.createElement('img'); + img.setAttribute('src', member.image || 'img/missing-avatar.svg'); + if (size) { + img.setAttribute('height', size); + img.setAttribute('width', size); + } + img.setAttribute('alt', member.name); + img.setAttribute('style', 'margin:6px;'); + if (member.marginBottom) + img.setAttribute('style', img.getAttribute('style') + 'margin-bottom:' + member.marginBottom + 'px;') + a.appendChild(img); + div.appendChild(a); +}; + +const PlatinumSize = 98; +const GoldSize = 76; +const SilverSize = 60; +const BackerSize = 45; +const ContributorSize = 36; + +var sponsors = function() { + var xhr = new XMLHttpRequest(); + xhr.open('GET', 'https://opencollective.com/typelevel/members/all.json', true); + xhr.responseType = 'json'; + xhr.onload = function() { + var status = xhr.status; + if (status === 200) { + for(i = 0; i < xhr.response.length; i++) { + var member = xhr.response[i]; + if (member.isActive) { + switch (member.tier) { + case 'Platinum Sponsor': + addSponsor('platinum-sponsors', member, PlatinumSize); + case 'Gold Sponsor': + addSponsor('gold-sponsors', member, GoldSize); + case 'Silver Sponsor': + addSponsor('silver-sponsors', member, SilverSize); + case 'backer': + addSponsor('backers', member, BackerSize); + break; + default: + if (member.totalAmountDonated > 0) { + addSponsor('other-contributors', member, ContributorSize); + } + } + }; + } + } + }; + xhr.send(); +}; +sponsors(); +// Add sponsors who predate open collective +addSponsor('gold-sponsors', { + name: "47 Degrees", + website: "https://47deg.com", + image: "https://typelevel.org/cats/img/sponsors/47_degree.png" +}); +addSponsor('gold-sponsors', { + name: "Iterators", + website: "https://iteratorshq.com", + image: "https://typelevel.org/cats/img/sponsors/iterators.png", + marginBottom: 20 +}); +addSponsor('gold-sponsors', { + name: "Triplequote", + website: "https://triplequote.com", + image: "https://typelevel.org/cats/img/sponsors/triplequote.png", + marginBottom: 20 +}); +addSponsor('gold-sponsors', { + name: "Underscore", + website: "https://underscore.com", + image: "https://typelevel.org/cats/img/sponsors/underscore.png", + marginBottom: 10 +}); +addSponsor('silver-sponsors', { + name: "Ebiznext", + website: "https://ebiznext.com", + image: "https://typelevel.org/cats/img/sponsors/ebiznext.png", + marginBottom: 10 +}); +addSponsor('silver-sponsors', { + name: "Inner Product", + website: "https://inner-product.com", + image: "https://typelevel.org/cats/img/sponsors/inner-product.png" +}); +addSponsor('silver-sponsors', { + name: "Evolution Gaming Engineering", + website: "https://evolutiongaming.com", + image: "https://typelevel.org/cats/img/sponsors/evolution_gaming_engineering.png" +}); From c8dfb77b380c8c71879388e834db292fbeeff77a Mon Sep 17 00:00:00 2001 From: "Ross A. Baker" Date: Tue, 24 Aug 2021 16:23:54 -0400 Subject: [PATCH 2/2] Update README.md Co-authored-by: Arman Bilge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 13afdbca82..65c762fe4b 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ information about how you can get involved as a developer. If you are looking fo

Backers

Become a Backer with a recurring donation of just $5 USD/month.
- +

Other contributors