Repository navigation
Expand file tree
/
Copy pathprojects.html
More file actions
165 lines (140 loc) · 4.33 KB
/
Copy pathprojects.html
File metadata and controls
165 lines (140 loc) · 4.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<title>Odar Army Status</title>
<link rel="icon" href="./Images/logo.png">
<link crossorigin="anonymous" rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:300,400,400italic,700">
<style>
body {
max-width: 60em;
margin: 0 auto;
padding: 2em 1em;
color: #17252A;
background: #3aafa9;
font: normal 17px 'Lato', Helvetica, Arial, sans-serif;
}
.logo {
text-align: center;
}
.repos {
margin-top: 1em;
display: flex;
flex-wrap: wrap;
}
.project {
background-color: #2b7a78;
border: 1px solid #2b7a78;
border-radius: 6px;
padding: 1em;
margin: 1em;
width: 15em;
display: flex;
flex-direction: column;
flex-grow: 1;
}
.project .name {
display: block;
font-weight: 700;
}
.project .desc {
flex: 1 1 auto;
padding-bottom: 1em;
}
.project .info {
margin: 0;
}
.project .lang {
color: #00ff00;
}
.project .homepage[href=""] {
display: none;
}
.project .count {
margin: 0 1em;
color: #def2f1;
}
.githubemoji {
display: inline-block;
vertical-align: text-top;
fill: currentColor;
}
a {
color: #def2f1;
text-decoration: none;
}
a:hover, a:focus {
color: #def2f1;
outline: none;
text-decoration: none;
}
</style>
</head>
<body>
<div class="logo">
<a href="index.html"><img src="./Images/logo.png" width="100" height="100" alt="Odar Army"></a>
</div>
<div class="repos" id="js-gh">Loading Projects Status</div>
<template id="js-tpl-project">
<div class="project">
<a class="name"></a>
<p class="desc"></p>
<p class="info">
<span class="lang"></span>
<span class="count">
<svg class="githubemoji githubemoji-flame" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"></path></svg>
<span class="count-num"></span>
</span>
<a class="homepage" title="Homepage" target="_blank"><svg class="githubemoji githubemoji-home" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M16 9l-3-3V2h-2v2L8 1 0 9h2l1 5c0 .55.45 1 1 1h8c.55 0 1-.45 1-1l1-5h2zm-4 5H9v-4H7v4H4L2.81 7.69 8 2.5l5.19 5.19L12 14z"></path></svg></a>
</p>
</div>
</template>
<script>
(function()
{
fetch( 'https://api.github.com/users/OdarArmy/repos' ).then( function( response )
{
if( response.status !== 200 )
{
document.getElementById( 'js-gh' ).textContent = 'Failed to load repositories [' + response.status + ']';
return;
}
response.json().then( function( data )
{
data = data.map( function( a )
{
a.combined_counts = a.stargazers_count + a.watchers_count + a.forks_count;
return a;
} ).sort( function( a, b )
{
return b.combined_counts - a.combined_counts;
} );
var frag = document.createDocumentFragment();
var tpl = document.getElementById( 'js-tpl-project' );
data.forEach( function( repo )
{
if( repo.fork )
{
return;
}
var a = tpl.content.querySelector( '.name' );
a.textContent = repo.name;
a.href = repo.html_url;
tpl.content.querySelector( '.count-num' ).textContent = repo.combined_counts;
tpl.content.querySelector( '.desc' ).textContent = repo.description;
tpl.content.querySelector( '.lang' ).textContent = repo.language;
tpl.content.querySelector( '.homepage' ).href = repo.homepage || '';
var clone = document.importNode( tpl.content, true );
frag.appendChild( clone );
});
var a = document.getElementById( 'js-gh' );
a.textContent = '';
a.appendChild( frag );
} );
} );
}());
</script>
</body>
</html>