File tree Expand file tree Collapse file tree 5 files changed +51
-31
lines changed
Expand file tree Collapse file tree 5 files changed +51
-31
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,8 @@ if (!force && fs.existsSync(outputFile)) {
2020const base = `https://api.github.com/repos/sveltejs/svelte/contributors` ;
2121const { GITHUB_CLIENT_ID , GITHUB_CLIENT_SECRET } = process . env ;
2222
23- const SIZE = 64 ;
23+ const MAX = 20 ;
24+ const SIZE = 128 ;
2425
2526async function main ( ) {
2627 const contributors = [ ] ;
@@ -37,7 +38,8 @@ async function main() {
3738
3839 const authors = contributors
3940 . filter ( ( { login } ) => ! login . includes ( '[bot]' ) )
40- . sort ( ( a , b ) => b . contributions - a . contributions ) ;
41+ . sort ( ( a , b ) => b . contributions - a . contributions )
42+ . slice ( 0 , MAX ) ;
4143
4244 const sprite = new Jimp ( SIZE * authors . length , SIZE ) ;
4345
Original file line number Diff line number Diff line change @@ -17,7 +17,8 @@ if (!force && fs.existsSync(outputFile)) {
1717 process . exit ( 0 ) ;
1818}
1919
20- const SIZE = 64 ;
20+ const MAX = 20 ;
21+ const SIZE = 128 ;
2122
2223async function main ( ) {
2324 const res = await fetch ( 'https://opencollective.com/svelte/members/all.json' ) ;
@@ -28,12 +29,13 @@ async function main() {
2829
2930 let backers = [ ...unique . values ( ) ]
3031 . filter ( ( { role } ) => role === 'BACKER' )
31- . sort ( ( a , b ) => b . totalAmountDonated - a . totalAmountDonated ) ;
32+ . sort ( ( a , b ) => b . totalAmountDonated - a . totalAmountDonated )
33+ . slice ( 0 , 3 * MAX ) ;
3234
3335 const included = [ ] ;
34- for ( let i = 0 ; i < backers . length ; i += 1 ) {
36+ for ( let i = 0 ; included . length < MAX ; i += 1 ) {
3537 const backer = backers [ i ] ;
36- console . log ( `${ i } / ${ backers . length } : ${ backer . name } ` ) ;
38+ console . log ( `${ included . length + 1 } / ${ MAX } : ${ backer . name } ` ) ;
3739
3840 try {
3941 const image_data = await fetch ( backer . image ) ;
Original file line number Diff line number Diff line change 33 </script >
44
55<style >
6+ #contributors {
7+ margin : 0.4em 0 ;
8+ }
9+
610 .contributor {
7- width : 2.4 em ;
8- height : 2.4 em ;
11+ width : 4.2 em ;
12+ height : 4.2 em ;
913 border-radius : 50% ;
1014 text-indent : -9999px ;
1115 display : inline-block ;
1216 background : no-repeat url (/contributors.jpg );
1317 background-size : auto 102% ;
14- margin : 0 0 .5em 0 .5em 0 ;
18+ margin : 0 1 .5em 1 .5em 0 ;
1519 border : 2px solid var (--second );
1620 }
1721 </style >
1822
19- {#each contributors as contributor , i }
20- <a
21- class =" contributor"
22- style ="background-position: {(100 * i ) / (contributors .length - 1 )}% 0"
23- href ="https://github.com/ {contributor }" >
24- {contributor }
25- </a >
26- {/each }
23+ <div id =" contributors" >
24+ {#each contributors as contributor , i }
25+ <a
26+ class =" contributor"
27+ style ="background-position: {(100 * i ) / (contributors .length - 1 )}% 0"
28+ href ="https://github.com/ {contributor }" >
29+ {contributor }
30+ </a >
31+ {/each }
32+ </div >
33+
34+ <p >And so <a href =" https://github.com/sveltejs/svelte/graphs/contributors" >many more →</a ></p >
Original file line number Diff line number Diff line change 33 </script >
44
55<style >
6+ #donors {
7+ margin : 0.4em 0 ;
8+ }
9+
610 .donor {
7- width : 2.4 em ;
8- height : 2.4 em ;
11+ width : 4.2 em ;
12+ height : 4.2 em ;
913 border-radius : 50% ;
1014 text-indent : -9999px ;
1115 display : inline-block ;
1216 background : no-repeat url (/donors.jpg );
1317 background-size : auto 102% ;
14- margin : 0 0 .5em 0 .5em 0 ;
18+ margin : 0 1 .5em 1 .5em 0 ;
1519 border : 2px solid var (--second );
1620 }
1721 </style >
1822
19- {#each donors as donor , i }
20- <a
21- class =" donor"
22- style ="background-position: {(100 * i ) / (donors .length - 1 )}% 0"
23- alt =" {donor }"
24- href =" https://opencollective.com/svelte" >
25- {donor }
26- </a >
27- {/each }
23+ <div id =" donors" >
24+ {#each donors as donor , i }
25+ <a
26+ class =" donor"
27+ style ="background-position: {(100 * i ) / (donors .length - 1 )}% 0"
28+ alt =" {donor }"
29+ href =" https://opencollective.com/svelte" >
30+ {donor }
31+ </a >
32+ {/each }
33+ </div >
34+
35+ <p >And so <a href =" https://opencollective.com/svelte" >many more →</a ></p >
Original file line number Diff line number Diff line change @@ -120,13 +120,13 @@ npm run dev
120120
121121 <p >Svelte is free and open source software, made possible by the work of hundreds of volunteers and donors. <a href =" https://github.com/sveltejs/svelte" >Join us</a > or <a href =" https://opencollective.com/svelte" >give</a >!</p >
122122
123- <h3 >Contributors</h3 >
123+ <h4 >Contributors</h4 >
124124
125125 <Contributors />
126126
127127 <p ></p >
128128
129- <h3 >Donors</h3 >
129+ <h4 >Donors</h4 >
130130
131131 <Donors />
132132</Section >
You can’t perform that action at this time.
0 commit comments