File tree Expand file tree Collapse file tree 1 file changed +46
-0
lines changed
Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change 1+ const starSVG = `
2+ <svg class="icon-inline" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="white" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
3+ <path d="M12 .587l3.668 7.431L24 9.748l-6 5.848 1.42 8.284L12 19.771 4.58 23.88 6 15.596 0 9.748l8.332-1.73z"/>
4+ </svg>
5+ ` ;
6+
7+ const forkSVG = `
8+ <svg class="icon-inline" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
9+ <path stroke="none" d="M0 0h24v24H0z" fill="none"/>
10+ <path d="M12 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" />
11+ <path d="M7 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" />
12+ <path d="M17 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" />
13+ <path d="M7 8v2a2 2 0 0 0 2 2h6a2 2 0 0 0 2 -2v-2" />
14+ <path d="M12 12l0 4" />
15+ </svg>
16+ ` ;
17+
18+ async function loadProjects ( ) {
19+ const res = await fetch (
20+ "https://gh-pinned-repos-tsj7ta5xfhep.deno.dev/?username=the-oblyv"
21+ ) ;
22+ const repos = await res . json ( ) ;
23+
24+ const container = document . getElementById ( "projects" ) ;
25+ repos . forEach ( ( repo ) => {
26+ const repoName = repo . repo . trim ( ) ; // Trim extra spaces
27+ const card = document . createElement ( "div" ) ;
28+
29+ card . innerHTML = `
30+ <h3><a href="https://github.com/${ repo . owner } /${ repoName } " target="_blank" rel="noopener noreferrer">${ repoName } </a></h3>
31+ <p>${ repo . description || "No description" } </p>
32+ <p>
33+ ${ starSVG } ${ repo . stars } ${ forkSVG } ${ repo . forks }
34+ </p>
35+ <p>
36+ <span style="color:${ repo . languageColor } ">●</span>
37+ ${ repo . language || "Unknown" }
38+ </p>
39+ ` ;
40+
41+ container . appendChild ( card ) ;
42+ } ) ;
43+ }
44+
45+ loadProjects ( ) ;
46+
You can’t perform that action at this time.
0 commit comments