Skip to content

Commit c2c03cb

Browse files
authored
Merge pull request nostalgic-css#313 from nostalgic-css/contributors
docs: fix github api
2 parents d2dd485 + 498435d commit c2c03cb

File tree

1 file changed

+42
-19
lines changed

1 file changed

+42
-19
lines changed

docs/script.js

+42-19
Original file line numberDiff line numberDiff line change
@@ -530,14 +530,54 @@ const emeriti = [
530530
},
531531
];
532532

533+
// https://api.github.com/repos/nostalgic-css/NES.css/contributors?per_page=100 | jq . '.[].login'
534+
const contributors = [
535+
'4k1k0',
536+
'sombreroEnPuntas',
537+
'Divoolej',
538+
'soph-iest',
539+
'KeevanDance',
540+
'montezume',
541+
'sazzadsazib',
542+
'jjspace',
543+
'ohlookitsderpy',
544+
'jdvivar',
545+
'Ilyeo',
546+
'youngkaneda',
547+
'kenshinji',
548+
'Kartones',
549+
'IngwiePhoenix',
550+
'Takumi0901',
551+
'Baldomo',
552+
'ernestomancebo',
553+
'stewartrule',
554+
'DanSnow',
555+
'rrj-dev',
556+
'vicainelli',
557+
'sinofp',
558+
'tnantoka',
559+
'LukBukkit',
560+
'd0p1s4m4',
561+
'musavvirahmed',
562+
'KOREAN139',
563+
'loo41',
564+
'otaviopace',
565+
'alexgleason',
566+
'fleeting',
567+
'scottaohara',
568+
'JamesIves',
569+
'agarzola',
570+
'jsoref',
571+
];
572+
533573
new Vue({
534574
el: '#nescss',
535575
data() {
536576
return {
537577
collection: sampleCollection,
538578
coreteam,
539579
emeriti,
540-
contributors: [],
580+
contributors,
541581
animateOctocat: false,
542582
copiedBalloon: {
543583
display: 'none',
@@ -554,9 +594,6 @@ new Vue({
554594
return val.charAt(0).toUpperCase() + val.slice(1);
555595
},
556596
},
557-
created() {
558-
this.fetchContributors();
559-
},
560597
mounted() {
561598
document.addEventListener('scroll', () => {
562599
this.scrollPos = document.documentElement.scrollTop || document.body.scrollTop;
@@ -565,6 +602,7 @@ new Vue({
565602
[].forEach.call(document.querySelectorAll('dialog'), (a) => {
566603
dialogPolyfill.registerDialog(a);
567604
});
605+
this.replaceImages();
568606
},
569607
methods: {
570608
share(media) {
@@ -614,21 +652,6 @@ new Vue({
614652
this.copiedBalloon.display = 'none';
615653
}, 1000);
616654
},
617-
async fetchContributors() {
618-
try {
619-
const res = await fetch('https://api.github.com/repos/nostalgic-css/NES.css/contributors');
620-
const json = await res.json();
621-
622-
const coreMembers = [...this.coreteam, ...this.emeriti].map(a => a.github);
623-
this.contributors = json.filter(a => !coreMembers.includes(a.login)).map(a => a.login);
624-
} catch (e) {
625-
console.error(e);
626-
return;
627-
}
628-
629-
await this.$nextTick();
630-
this.replaceImages();
631-
},
632655
replaceImages() {
633656
Array.from(document.querySelectorAll('img.lazy')).forEach((img) => {
634657
img.onload = () => img.classList.remove('lazy');

0 commit comments

Comments
 (0)