feat: Add dynamic list of contributors

master
Ryan Carbotte 4 years ago
parent c4c2ff7cd1
commit c2559fedbf

@ -284,23 +284,15 @@
href="https://github.com/mikebryant/ac-nh-turnip-prices/issues">Github</a>
</p>
<p>Oh! And let's not forget to thank those who have contributed so far!</p>
<p>Contributors:
<a href="https://github.com/mikebryant">Mike Bryant</a>,
<a href="https://github.com/Trevor-Welch">Trevor Welch</a>,
<a href="https://github.com/louh">Lou Huang</a>,
<a href="https://github.com/tylermatchett">Tyler Matchett</a>,
<a href="https://github.com/Lotti">Valerio Riva</a>,
<a href="https://github.com/na-ji">Naji Astier</a>,
<a href="https://github.com/phoenix-meadowlark">Pheonix Meadowlark</a>,
<a href="https://github.com/peter50216">Peter Shih</a>,
<a href="https://github.com/kantenkugel">Michael Ritter</a>,
<a href="https://github.com/jtplatt99">jtplatt99</a>
<p id="contributors">
Contributors:
</p>
</div>
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script src="js/predictions.js"></script>
<script src="js/scripts.js"></script>
<script src="js/contributors.js"></script>
</body>
</html>

@ -0,0 +1,17 @@
function getContributors() {
if (window.jQuery) {
const container = $('#contributors');
jQuery.ajax('https://api.github.com/repos/mikebryant/ac-nh-turnip-prices/contributors', {})
.done(function (data) {
data.forEach((contributor, idx) => {
console.debug('DEBUG:', contributor);
container.append(`<a href="${contributor.url}">${contributor.login}</a>`);
if (idx < data.length - 1) {
container.append(', ');
}
});
});
}
}
$(document).ready(getContributors);
Loading…
Cancel
Save