forked from hacktoberfest17/programming
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
125 lines (106 loc) · 4.21 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>programming | A repo for first time contributors</title>
<!--Import Google Icon Font-->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!--Import materialize.css-->
<link type="text/css" rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/css/materialize.min.css" media="screen,projection" />
<!--Let browser know website is optimized for mobile-->
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<style>
.header {
font-weight: 300;
}
.page_header {
height: 20rem;
}
@media only screen and (max-width: 400px) {
h1 {
font-size: 1.2rem;
}
h5 {
font-size: 1rem;
}
.page_header {
height: 15rem;
}
}
@media only screen and (min-width: 400px) and (max-width: 600px) {
.page_header {
height: 25rem;
}
}
.margin-top-20 {
margin-top: 20px
}
/*footer*/
body {
display: flex;
min-height: 100vh;
flex-direction: column;
}
main {
flex: 1 0 auto;
}
</style>
</head>
<body>
<div class="had-container page_header purple darken-2 white-text valign-wrapper">
<div class="row ">
<div class="col s12 m12 l12 center-align">
<h1 class="project-name header">programming</h1>
<h5 class="project-tagline light purple-text text-lighten-4">Celebrate HacktoberFest with your first contribution</h5>
<a href="https://github.com/hacktoberfest17/programming" target="_blank" class="waves-effect waves-light btn white purple-text margin-top-20">Start Coding</a>
</div>
</div>
</div>
<div class="container">
<div class="row">
<h1 class="purple-text header">Contributors</h1>
</div>
<div class="row" id="contributor_list">
</div>
</div>
<footer class="page-footer purple darken-3">
<div class="footer-copyright">
<div class="container">
<!--© 2014 Copyright Text
<a class=" grey-text text-lighten-4 right" href="#!">More Links</a>-->
</div>
</div>
</footer>
<!--Import jQuery before materialize.js-->
<script type="text/javascript" src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/js/materialize.min.js"></script>
<script>
function getContribList(current_page, final_page) {
$.getJSON("https://api.github.com/repos/hacktoberfest17/programming/contributors?page=" + current_page, function(data, textStatus, xhr) {
//console.log(data);
populateList(data);
if (current_page == 1) {
const regex = /(page=)([0-9]*)/gi;
var str = xhr.getResponseHeader("Link").split(",")[1]
m = regex.exec(str)
final_page = m[2];
}
current_page += 1;
if (current_page > final_page)
return true;
else
return getContribList(current_page, final_page);
});
}
getContribList(1, 2);
function populateList(data) {
var elems = "";
data.forEach(function(item) {
//console.log(item);
elems+='<div class="col s12 m4"><div class="card small"><div class="card-image"><img src=\"'+item['avatar_url']+'\"><span class="card-title">'+item["login"]+'</span></div><div class="card-content"><p>#'+item["contributions"]+' contributions</p></div><div class="card-action"><a target="_blank" class="purple-text" href="'+item["html_url"]+'">My Profile</a></div></div></div>';
});
$("#contributor_list").append(elems);
}
</script>
</body>
</html>