Skip to content

Commit 424c551

Browse files
authored
Merge pull request #256 from shubhagarwal1/git
Add git contributors to the page
2 parents 4f1916e + 9dcc7c4 commit 424c551

File tree

1 file changed

+98
-0
lines changed

1 file changed

+98
-0
lines changed

Web_app/pages/GitContributors.py

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
import streamlit as st
2+
import requests
3+
4+
st.title("🤝 GitHub Contributors")
5+
st.markdown(
6+
"<div style='height: 5px; background: linear-gradient(to right, #FF5733, #FFC300, #DAF7A6, #33FF57, #3380FF);'></div>",
7+
unsafe_allow_html=True,
8+
)
9+
10+
# Instructions
11+
st.write(
12+
"Thanks to our amazing contributors who help build and improve this project! 🎉"
13+
)
14+
15+
# Load contributors data
16+
contributors_url = "https://api.github.com/repos/Recode-Hive/Scrape-ML/contributors"
17+
contributors_data = requests.get(contributors_url).json()
18+
19+
# Custom CSS styling
20+
st.markdown(
21+
"""
22+
<style>
23+
.contributor-container {
24+
display: flex;
25+
align-items: center;
26+
background-color: #f9f9f9;
27+
border: 1px solid #ddd;
28+
border-radius: 8px;
29+
padding: 8px;
30+
margin-bottom: 8px;
31+
font-size: 14px;
32+
}
33+
.contributor-img {
34+
border-radius: 50%;
35+
width: 30px;
36+
height: 30px;
37+
margin-right: 10px;
38+
}
39+
.contributor-name {
40+
font-weight: bold;
41+
color: #333;
42+
flex: 1;
43+
}
44+
.contribution-count {
45+
color: green;
46+
font-weight: bold;
47+
}
48+
.github-icon {
49+
display: block;
50+
margin: 20px auto;
51+
width: 40px;
52+
}
53+
.github-text {
54+
text-align: center;
55+
font-weight: bold;
56+
color: #555;
57+
margin-top: 15px;
58+
}
59+
</style>
60+
""",
61+
unsafe_allow_html=True,
62+
)
63+
64+
# Display each contributor in a compact, styled row
65+
for contributor in contributors_data:
66+
avatar_url = contributor["avatar_url"]
67+
username = contributor["login"]
68+
contributions = contributor["contributions"]
69+
profile_url = contributor["html_url"]
70+
71+
# HTML structure for each contributor row
72+
st.markdown(
73+
f"""
74+
<div class="contributor-container">
75+
<img src="{avatar_url}" class="contributor-img" />
76+
<a href="{profile_url}" target="_blank" class="contributor-name">{username}</a>
77+
<span class="contribution-count">{contributions} contributions</span>
78+
</div>
79+
""",
80+
unsafe_allow_html=True,
81+
)
82+
83+
# GitHub repository text and icon in white
84+
st.markdown("---")
85+
st.markdown(
86+
"<div class='github-text'>Explore more on our GitHub repository:</div>",
87+
unsafe_allow_html=True,
88+
)
89+
st.markdown(
90+
"""
91+
<center>
92+
<a href="https://github.com/Recode-Hive/Scrape-ML" target="_blank">
93+
<img src="https://img.icons8.com/ios-glyphs/30/ffffff/github.png" alt="GitHub" class="github-icon" />
94+
</a>
95+
</center>
96+
""",
97+
unsafe_allow_html=True,
98+
)

0 commit comments

Comments
 (0)