15
15
16
16
/* Style for each contributor item */
17
17
.contributor {
18
- width : calc (
19
- 30% - 10px
20
- ); /* Adjust the width for three contributors in a row */
18
+ width : calc (30% - 10px );
19
+ /* Adjust the width for three contributors in a row */
21
20
margin-bottom : 20px ;
22
21
padding : 20px ;
23
22
border : 1px solid # ccc ;
37
36
color : # 666 ;
38
37
width : 100% ;
39
38
overflow : auto;
39
+ background-color : # f9f9f9 ;
40
+ box-shadow : 0 0 5px # ccc ;
41
+ padding : 6px ;
42
+ border-radius : 5px ;
40
43
}
41
44
42
45
/* Style for contributor image */
50
53
51
54
@media (max-width : 750px ) {
52
55
.contributor {
53
- width : calc (
54
- 50% - 10px
55
- ); /* Adjust the width for two contributors in a row */
56
+ width : calc (50% - 10px );
57
+ /* Adjust the width for two contributors in a row */
56
58
}
57
59
}
58
60
59
61
@media (max-width : 400px ) {
60
62
.contributor {
61
- width : 100% ; /* Full width for one contributor in a row */
63
+ width : 100% ;
64
+ /* Full width for one contributor in a row */
62
65
}
63
66
}
64
67
</ style >
65
68
</ head >
69
+
66
70
< body >
71
+ < div >
67
72
< h1 > Contributors</ h1 >
68
73
< ul id ="contributors-list ">
69
74
<!-- Contributors will be dynamically added here -->
@@ -90,6 +95,12 @@ <h1>Contributors</h1>
90
95
const name = filteredLines [ 0 ] ;
91
96
const details = filteredLines
92
97
. slice ( 1 )
98
+ . filter (
99
+ ( line ) =>
100
+ ! line . includes ( "LinkedIn:" ) &&
101
+ ! line . includes ( "GitHub:" ) &&
102
+ ! line . includes ( "Twitter:" )
103
+ )
93
104
. map ( ( line ) => `<li>${ line } </li>` )
94
105
. join ( "" ) ;
95
106
@@ -99,14 +110,35 @@ <h1>Contributors</h1>
99
110
) ;
100
111
const imageURL = imageURLMatch ? imageURLMatch [ 1 ] : "" ; // Extracting the URL from the matched group
101
112
113
+ const linkedInMatch = contributor . match (
114
+ / L i n k e d I n : \[ L i n k e d I n \] \( ( .* ?) \) /
115
+ ) ;
116
+ const linkedInLink = linkedInMatch ? linkedInMatch [ 1 ] : "" ;
117
+ const gitHubMatch = contributor . match (
118
+ / G i t H u b : \[ G i t H u b \] \( ( .* ?) \) /
119
+ ) ;
120
+ const gitHubLink = gitHubMatch ? gitHubMatch [ 1 ] : "" ;
121
+ const twitterMatch = contributor . match (
122
+ / T w i t t e r : \[ T w i t t e r \] \( ( .* ?) \) /
123
+ ) ;
124
+ const twitterLink = twitterMatch ? twitterMatch [ 1 ] : "" ;
125
+
102
126
// Create list item for the contributor with image
103
127
const li = document . createElement ( "li" ) ;
104
128
li . classList . add ( "contributor" ) ;
105
129
li . innerHTML = `
106
130
<div class="contributor-name">
131
+ <div>
107
132
<img src="${ imageURL } " alt="${ name } 's Profile Image" class="contributor-image">
108
133
${ name }
134
+ </div>
135
+ <div class="social-icons">
136
+ <a href="${ linkedInLink } " target="_blank"><img height="24" src="../public/images/linkedin.png" alt="LinkedIn Icon"></a>
137
+ <a href="${ gitHubLink } " target="_blank"><img height="24" src="../public/images/github.png" alt="Twitter Icon"></a
138
+ <a href="${ twitterLink } " target="_blank"><img height="24" src="../public/images/twiiter.png" alt="GitHub Icon"></a>
139
+ </div>
109
140
</div>
141
+
110
142
<div class="contributor-details">
111
143
<ul>${ details } </ul>
112
144
</div>
@@ -120,6 +152,6 @@ <h1>Contributors</h1>
120
152
121
153
fetchContributors ( ) ;
122
154
</ script >
155
+ </ div >
123
156
</ body >
124
157
</ html >
125
-
0 commit comments