1212 header p { margin : 0 ; opacity : .8 }
1313 .container { max-width : var (--max ); margin : 0 auto; padding : 16px 24px 48px ; }
1414 .toolbar { display : flex; gap : 12px ; align-items : center; margin-bottom : 16px ; flex-wrap : wrap; }
15- input [type = "search" ] { flex : 1 ; padding : 10px 12px ; border-radius : 10px ; border : 1px solid # d0d7de ; background : # ffffff ; color : # 0d1117 ; }
16- select { padding : 10px 12px ; border-radius : 10px ; border : 1px solid # d0d7de ; background : # ffffff ; color : # 0d1117 ; }
15+ input [type = "search" ] { flex : 1 ; padding : 10px 12px ; border-radius : 10px ; border : 1px solid # 30363d ; background : # 0d1117 ; color : # e6edf3 ; }
16+ select { padding : 10px 12px ; border-radius : 10px ; border : 1px solid # 30363d ; background : # 0d1117 ; color : # e6edf3 ; }
1717 .grid { display : grid; grid-template-columns : repeat (auto-fill, minmax (260px , 1fr )); gap : 16px ; }
18- .card { background : # ffffff ; border : 1px solid # d0d7de ; border-radius : 14px ; padding : 16px ; display : flex; flex-direction : column; gap : 8px ; }
18+ .card { background : # ffffff ; border : 1px solid # 30363d ; border-radius : 14px ; padding : 16px ; display : flex; flex-direction : column; gap : 8px ; }
1919 .card h3 { margin : 0 ; font-size : 18px ; }
2020 .meta { font-size : 12px ; opacity : .8 }
21- .links a { text-decoration : none; color : # 0969da ; margin-right : 10px ; }
21+ .links a { text-decoration : none; color : # 67b7ff ; margin-right : 10px ; }
2222 footer { text-align : center; padding : 24px ; opacity : .7 ; }
2323 .empty { text-align : center; padding : 40px ; opacity : .8 }
2424 </ style >
@@ -54,20 +54,20 @@ <h1>Democracy Lab — Project Sites</h1>
5454 const AUTO_REFRESH_MS = 120000 ;
5555
5656 function pagesUrl ( name ) {
57- return name . toLowerCase ( ) === \`\ ${ ORG . toLowerCase ( ) } . github . io \ `
58- ? \`\ ${ORG_PAGES_BASE}/\ `
59- : \`\ ${ORG_PAGES_BASE}/\ ${encodeURIComponent(name)}/\ `;
57+ return name . toLowerCase ( ) === ` ${ ORG . toLowerCase ( ) } .github.io`
58+ ? ` ${ ORG_PAGES_BASE } /`
59+ : ` ${ ORG_PAGES_BASE } /${ encodeURIComponent ( name ) } /`;
6060 }
6161
62- async function fetchAllRepos(url=\ `https://api.github.com/orgs/\ ${ORG}/repos?per_page=100&type=public&ts=\ ${Date.now()}\ `){
62+ async function fetchAllRepos ( url = `https://api.github.com/orgs/${ ORG } /repos?per_page=100&type=public&ts=${ Date . now ( ) } ` ) {
6363 const all = [ ] ;
6464 while ( url ) {
6565 const res = await fetch ( url , { cache :'no-store' , headers :{ Accept :'application/vnd.github+json' } } ) ;
66- if(!res.ok) throw new Error(\ `GitHub API: \ ${res.status} \ ${res.statusText}\ `);
66+ if ( ! res . ok ) throw new Error ( `GitHub API: ${ res . status } ${ res . statusText } ` ) ;
6767 all . push ( ...await res . json ( ) ) ;
6868 const link = res . headers . get ( 'Link' ) ;
6969 const next = link && link . split ( ',' ) . find ( s => s . includes ( 'rel="next"' ) ) ;
70- url=next? next.split(';')[0].trim().slice(1,-1)+\ `&ts=\ ${Date.now()}\ ` : null;
70+ url = next ? next . split ( ';' ) [ 0 ] . trim ( ) . slice ( 1 , - 1 ) + `&ts=${ Date . now ( ) } ` : null ;
7171 }
7272 return all ;
7373 }
@@ -83,19 +83,19 @@ <h1>Democracy Lab — Project Sites</h1>
8383 if ( empty ) empty . style . display = 'none' ;
8484
8585 list . forEach ( r => {
86- const live=!!r.has_pages || r.name.toLowerCase()===\`\ ${ORG.toLowerCase()}.github.io\ `;
86+ const live = ! ! r . has_pages || r . name . toLowerCase ( ) === ` ${ ORG . toLowerCase ( ) } .github.io`;
8787 const site = pagesUrl ( r . name ) ;
8888 const card = document . createElement ( 'div' ) ;
8989 card . className = 'card' ;
9090 if ( ! live ) card . style . opacity = 0.6 ;
91- card.innerHTML=\ `
92- <h3><a href="\ ${live?site:r.html_url}" target="_blank" rel="noopener" style="color:#0969da ;text-decoration:none;">\ ${r.name}</a></h3>
93- <div class="meta">\ ${r.description??''}</div>
94- <div class="meta">Updated: \ ${fmt(r.updated_at)}</div>
91+ card . innerHTML = `
92+ <h3><a href="${ live ?site :r . html_url } " target="_blank" rel="noopener" style="color:#67b7ff ;text-decoration:none;">${ r . name } </a></h3>
93+ <div class="meta">${ r . description ?? '' } </div>
94+ <div class="meta">Updated: ${ fmt ( r . updated_at ) } </div>
9595 <div class="links">
96- \ ${live?\ `<a href="\ ${site}" target="_blank" rel="noopener">View site</a>\`:\ `<span class="meta">Not deployed yet</span>\ `}
97- <a href="\ ${r.html_url}" target="_blank" rel="noopener">Repo</a>
98- </div>\ `;
96+ ${ live ?`<a href="${ site } " target="_blank" rel="noopener">View site</a>` : `<span class="meta">Not deployed yet</span>` }
97+ <a href="${ r . html_url } " target="_blank" rel="noopener">Repo</a>
98+ </div>` ;
9999 card . style . cursor = 'pointer' ;
100100 card . addEventListener ( 'click' , e => {
101101 if ( ! ( e . target instanceof HTMLAnchorElement ) ) {
@@ -109,7 +109,7 @@ <h3><a href="\${live?site:r.html_url}" target="_blank" rel="noopener" style="col
109109 function filterSort ( repos ) {
110110 const qEl = el ( 'q' ) , sortEl = el ( 'sort' ) ;
111111 let list = repos . slice ( ) ;
112- if(!SHOW_ALL) list=list.filter(r=>r.has_pages||r.name.toLowerCase()===\`\ ${ORG.toLowerCase()}.github.io\ `);
112+ if ( ! SHOW_ALL ) list = list . filter ( r => r . has_pages || r . name . toLowerCase ( ) === ` ${ ORG . toLowerCase ( ) } .github.io`) ;
113113 const q = ( qEl ?. value || '' ) . toLowerCase ( ) . trim ( ) ;
114114 if ( q ) {
115115 list = list . filter ( r =>
@@ -132,7 +132,7 @@ <h3><a href="\${live?site:r.html_url}" target="_blank" rel="noopener" style="col
132132 } catch ( err ) {
133133 console . error ( err ) ;
134134 const grid = el ( 'grid' ) ;
135- if(grid) grid.innerHTML=\ `<div class="empty">Error loading list: \ ${err.message}</div>\ `;
135+ if ( grid ) grid . innerHTML = `<div class="empty">Error loading list: ${ err . message } </div>` ;
136136 } finally {
137137 if ( btn ) btn . disabled = false ;
138138 }
@@ -145,7 +145,7 @@ <h3><a href="\${live?site:r.html_url}" target="_blank" rel="noopener" style="col
145145 const btn = document . createElement ( 'button' ) ;
146146 btn . id = 'refreshBtn' ;
147147 btn . textContent = 'Refresh' ;
148- btn . style . cssText = 'padding :10 px 12 px ; border - radius :10 px ; border :1 px solid #d0d7de ; background :#ffffff ; color :#0 d1117 ; cursor :pointer ; ';
148+ btn . style . cssText = 'padding:10px 12px;border-radius:10px;border:1px solid #30363d ;background:#0d1117 ;color:#e6edf3 ;cursor:pointer;' ;
149149 btn . addEventListener ( 'click' , loadAndRender ) ;
150150 toolbar . appendChild ( btn ) ;
151151 }
@@ -161,4 +161,3 @@ <h3><a href="\${live?site:r.html_url}" target="_blank" rel="noopener" style="col
161161 </ script >
162162</ body >
163163</ html >
164-
0 commit comments