-
Notifications
You must be signed in to change notification settings - Fork 4
/
app.js
62 lines (57 loc) · 2.21 KB
/
app.js
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
/*
* Copyright (c) 2020 | Mathana Kumar S (https://capturemathan.github.io)
*/
const getPortfolio = require("./utils.js");
async function fetchFolio(token, username) {
const result = await getPortfolio(token, username);
const markup = `
<div class="columns">
<div class="column is-one-quarter">
<div class="card" id="cardfolio">
<div class="card-image" id="profilepic">
<figure class="image container is-128x128">
<img class="is-rounded" src="${result["avatar_url"]}" />
</figure>
</div>
<div class="has-text-centered" id="name">
<a href="https://github.com/${username}" target="_blank">${
result["name"]
}</a>
</div>
<div class="has-text-centered" id="languages">
${result["languages"]
.map(
(lan) => `<span class="is-info tag" id="item">${lan}</span>`
)
.join(" ")}
</div>
<div class="has-text-centered" id="repos">
<img style="vertical-align:middle" src="https://raw.githubusercontent.com/capturemathan/Gitcard/master/assets/images/cloud.png" height="40" width="40" />
<span id="repotext">${
result["public_repos"]
} Repositories</span>
</div>
<div class="has-text-centered" id="contributions">
<img style="vertical-align:middle" src="https://raw.githubusercontent.com/capturemathan/Gitcard/master/assets/images/graph.png" height="40" width="40">
<span id="contribtext">${
result["contributions"]
} Contributions</span>
</div>
<footer class="card-footer" id="follow">
<div class="card-footer-item">${
result["followers"]
} Followers</div>
<div class="card-footer-item">${
result["following"]
} Following</div>
</footer>
</div>
</div>
</div>
`;
return markup;
}
async function Gitcard(token, username) {
return await fetchFolio(token, username);
}
module.exports = Gitcard;