-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
225 lines (212 loc) · 7.76 KB
/
index.html
File metadata and controls
225 lines (212 loc) · 7.76 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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
<!DOCTYPE html>
<html lang="en" class="light">
<head>
<!-- Specifies the character encoding for the document -->
<meta charset="UTF-8" />
<!-- Ensures the website is responsive and adapts to different screen sizes -->
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>GitHub User Search</title>
<!-- Links an external CSS file for styling -->
<link rel="stylesheet" href="./dist/styles/style.css" />
<!-- Adds JavaScript functionality for theme and search; 'defer' ensures scripts run after the DOM is fully loaded -->
<script src="./js/theme.js" defer></script>
<script src="./js/script.js" defer></script>
<!-- Sets a favicon for the browser tab -->
<link
rel="icon"
href="./dist/assets/favicon-32x32.png"
sizes="32x32"
type="image/png"
/>
<!-- Preconnects to Google Fonts servers to improve font loading performance -->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<!-- Imports the "Space Mono" font from Google Fonts -->
<link
href="https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap"
rel="stylesheet"
/>
</head>
<body
class="m-0 p-0 min-h-screen min-w-screen font-spacemono flex items-center justify-center bg-gray-50 dark:bg-background"
>
<!-- Container for the entire card -->
<div
class="flex flex-col items-center gap-4 w-11/12 md:w-5/6 lg:w-2/3 xl:w-1/2"
>
<!-- Header section with website title and theme toggle button -->
<div class="header w-full flex justify-between items-center">
<!-- Website title -->
<h1 class="websiteName font-700 text-xl dark:text-softwhite">
devfinder
</h1>
<!-- Button to toggle between light and dark themes -->
<button
id="toggler"
class="flex items-center gap-3"
onclick="toggleTheme()"
>
<!-- Visible in light mode -->
<span class="dark:hidden uppercase text-xs text-gray-500 font-700">
dark
</span>
<img
class="dark:hidden"
src="./dist/assets/icon-moon.svg"
alt="Moon logo for dark mode"
loading="lazy"
/>
<!-- Visible in dark mode -->
<p
id="lightText"
class="hidden uppercase text-xs dark:text-softwhite font-700"
>
light
</p>
<img
id="lightImage"
class="hidden"
src="./dist/assets/icon-sun.svg"
alt="Sun logo for light mode"
loading="lazy"
/>
</button>
</div>
<!-- Search bar for GitHub usernames -->
<div
class="w-full flex flex-col sm:flex-row gap-4 p-2 rounded-xl bg-dark-font-1 bg-white shadow-2xl sm:justify-between dark:bg-cardBackground items-center"
>
<!-- Search input field -->
<div class="flex relative flex-grow w-full">
<img
class="pl-2 absolute top-1 sm:top-2"
src="./dist/assets/icon-search.svg"
alt="Magnifying glass logo for search"
loading="lazy"
/>
<input
class="searchUser w-full p-2 pl-12 dark:bg-cardBackground text-xs sm:text-base dark:text-white"
type="text"
placeholder="Search GitHub username..."
/>
<!-- Error message displayed when username is not found -->
<span
class="notFound text-red-600 text-xs sm:text-base w-fit absolute right-0 top-2 hidden"
>Not Found!</span
>
</div>
<!-- Search button -->
<button
onclick="searchUser()"
class="searchBtn text-white bg-blue-500 px-4 py-2 rounded-lg w-full sm:w-fit"
>
Search
</button>
</div>
<!-- Main card containing user information -->
<div
class="cardContainer w-full flex items-start bg-white shadow-2xl rounded-xl p-8 dark:bg-cardBackground/75"
>
<!-- User profile image -->
<img
class="userProfile w-24 overflow-hidden mr-8 hidden p-1 border-black border md:block rounded-full dark:border-white"
src="./dist/assets/octocatProfile.png"
alt="Octocat profile image for demo"
loading="lazy"
/>
<!-- User details section -->
<div class="userDetails w-full flex flex-col gap-6">
<!-- Username, full name, and join date -->
<div class="userName relative flex items-center">
<img
class="userProfile w-24 h-fit object-cover p-1 border-black dark:border-white border rounded-full mr-4 md:hidden"
src="./dist/assets/octocatProfile.png"
alt="Octocat profile image for demo"
loading="lazy"
/>
<div>
<h1 class="userFullName font-700 text-2xl dark:text-softwhite">
The Octocat
</h1>
<h2 class="username text-blue-500">@octocat</h2>
<p
class="joinedDate sm:absolute sm:top-0 sm:right-0 text-gray-500"
>
Joined 25 January 2011
</p>
<!-- Short bio -->
<p class="bio text-gray-400 md:hidden text-sm sm:text-base">
Not Available
</p>
</div>
</div>
<p class="bio text-gray-400 hidden md:block text-sm sm:text-base">
Not Available
</p>
<!-- User stats (repositories, followers, following) -->
<div
class="flex justify-between bg-font-3 py-4 px-4 sm:px-8 rounded-xl bg-gray-200 dark:bg-black/35 dark:text-softwhite"
>
<div>
<p class="">Repos</p>
<h1 class="repos font-700">8</h1>
</div>
<div>
<p class="">Followers</p>
<h1 class="followers font-700">6097</h1>
</div>
<div>
<p class="">Following</p>
<h1 class="following font-700">9</h1>
</div>
</div>
<!-- User contact details -->
<div
class="contact grid sm:grid-cols-2 gap-4 text-blue-950 dark:text-softwhite overflow-hidden"
>
<div class="flex items-center gap-4">
<img
class="w-5 h-5"
src="./dist/assets/icon-location.svg"
alt="Location icon"
loading="lazy"
/>
<p class="location break-words">San Francisco</p>
</div>
<div class="flex items-center gap-4">
<img
class="w-5 h-5"
src="./dist/assets/icon-twitter.svg"
alt="Twitter icon"
loading="lazy"
/>
<p class="twitter truncate">Not Available</p>
</div>
<div class="flex items-center gap-3">
<img
class="w-5 h-5"
src="./dist/assets/icon-website.svg"
alt="Website icon"
loading="lazy"
/>
<a
href="https://github.blog"
class="website truncate hover:underline"
>https://github.blog</a
>
</div>
<div class="flex items-center gap-4">
<img
class="w-5 h-5"
src="./dist/assets/icon-company.svg"
alt="Company icon"
loading="lazy"
/>
<p class="company truncate">@github</p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>