11document . addEventListener ( 'DOMContentLoaded' , ( ) => {
22 loadDescription ( ) ;
33 loadRepos ( ) ;
4- loadFollowers ( ) ;
54} ) ;
65
76async function loadDescription ( ) {
@@ -25,7 +24,11 @@ async function loadRepos() {
2524 const configsWeb = await loadConfigs ( ) ;
2625 try {
2726 const res = await fetch ( 'https://api.github.com/orgs/dev2forge/repos' ) ;
28- const repos = await res . json ( ) ;
27+ /**
28+ * @type {Array<String> }
29+ */
30+ let repos = await res . json ( ) ;
31+ repos = repos . sort ( ( a , b ) => a ?. name ?. toLowerCase ( ) . charCodeAt ( 0 ) - b ?. name ?. toLowerCase ( ) . charCodeAt ( 0 ) ) ;
2932 repos . forEach ( ( repo ) => {
3033 // Skip repositories that are not in the configsWeb list
3134 if ( ! configsWeb . ignoreRepos . includes ( repo . name ) ) {
@@ -53,25 +56,6 @@ async function loadRepos() {
5356 }
5457}
5558
56- /**
57- * Load followers from GitHub API and display them as a horizontal avatar carousel.
58- * Only the profile pictures are shown, as per the new design.
59- */
60- async function loadFollowers ( ) {
61- const req = await fetch ( 'https://api.github.com/users/Dev2Forge/followers' ) ;
62- const response = await req . json ( ) ;
63- const container = document . querySelector ( '#followers-container' ) ;
64- response . forEach ( ( follower ) => {
65- const img = document . createElement ( 'img' ) ;
66- img . src = follower . avatar_url ;
67- img . alt = follower . login ;
68- img . title = follower . login ;
69- img . className = 'w-20 h-20 rounded-full object-cover snap-center border-2 border-gray-300 dark:border-gray-700 cursor-pointer transition hover:scale-110' ;
70- img . onclick = ( ) => window . open ( follower . html_url , '_blank' ) ;
71- container . appendChild ( img ) ;
72- } ) ;
73- }
74-
7559async function loadConfigs ( ) {
7660 const req = await fetch ( './assets/json/configs.json' ) ;
7761 const data = await req . json ( ) ;
0 commit comments