Spaces:
Running
Running
undefined - Initial Deployment
Browse files- README.md +7 -5
- index.html +822 -19
README.md
CHANGED
@@ -1,10 +1,12 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
sdk: static
|
7 |
pinned: false
|
|
|
|
|
8 |
---
|
9 |
|
10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
---
|
2 |
+
title: portfolio-analyser
|
3 |
+
emoji: 🐳
|
4 |
+
colorFrom: green
|
5 |
+
colorTo: gray
|
6 |
sdk: static
|
7 |
pinned: false
|
8 |
+
tags:
|
9 |
+
- deepsite
|
10 |
---
|
11 |
|
12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
@@ -1,19 +1,822 @@
|
|
1 |
-
<!
|
2 |
-
<html>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>GitHub Portfolio Analyzer</title>
|
7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
8 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
9 |
+
<style>
|
10 |
+
.gradient-bg {
|
11 |
+
background: linear-gradient(135deg, #6e8efb, #a777e3);
|
12 |
+
}
|
13 |
+
.card-hover:hover {
|
14 |
+
transform: translateY(-5px);
|
15 |
+
box-shadow: 0 10px 20px rgba(0,0,0,0.1);
|
16 |
+
}
|
17 |
+
.language-bar {
|
18 |
+
height: 10px;
|
19 |
+
border-radius: 5px;
|
20 |
+
display: inline-block;
|
21 |
+
vertical-align: middle;
|
22 |
+
margin-right: 5px;
|
23 |
+
}
|
24 |
+
.radar-chart {
|
25 |
+
width: 100%;
|
26 |
+
height: 300px;
|
27 |
+
}
|
28 |
+
.heatmap {
|
29 |
+
display: grid;
|
30 |
+
grid-template-columns: repeat(52, 1fr);
|
31 |
+
gap: 2px;
|
32 |
+
}
|
33 |
+
.heatmap-cell {
|
34 |
+
width: 10px;
|
35 |
+
height: 10px;
|
36 |
+
border-radius: 2px;
|
37 |
+
}
|
38 |
+
.repo-card:hover .repo-stats {
|
39 |
+
opacity: 1;
|
40 |
+
transform: translateY(0);
|
41 |
+
}
|
42 |
+
.repo-stats {
|
43 |
+
opacity: 0;
|
44 |
+
transform: translateY(10px);
|
45 |
+
transition: all 0.3s ease;
|
46 |
+
}
|
47 |
+
.animate-pulse {
|
48 |
+
animation: pulse 2s infinite;
|
49 |
+
}
|
50 |
+
@keyframes pulse {
|
51 |
+
0%, 100% {
|
52 |
+
opacity: 1;
|
53 |
+
}
|
54 |
+
50% {
|
55 |
+
opacity: 0.5;
|
56 |
+
}
|
57 |
+
}
|
58 |
+
</style>
|
59 |
+
</head>
|
60 |
+
<body class="bg-gray-50 font-sans">
|
61 |
+
<!-- Navigation -->
|
62 |
+
<nav class="bg-white shadow-sm">
|
63 |
+
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
64 |
+
<div class="flex justify-between h-16">
|
65 |
+
<div class="flex items-center">
|
66 |
+
<div class="flex-shrink-0 flex items-center">
|
67 |
+
<i class="fab fa-github text-2xl text-gray-800 mr-2"></i>
|
68 |
+
<span class="text-xl font-bold text-gray-800">Portfolio Analyzer</span>
|
69 |
+
</div>
|
70 |
+
</div>
|
71 |
+
<div class="hidden sm:ml-6 sm:flex sm:items-center">
|
72 |
+
<button id="loginBtn" class="inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
|
73 |
+
<i class="fab fa-github mr-2"></i> Login with GitHub
|
74 |
+
</button>
|
75 |
+
</div>
|
76 |
+
</div>
|
77 |
+
</div>
|
78 |
+
</nav>
|
79 |
+
|
80 |
+
<!-- Hero Section -->
|
81 |
+
<div class="gradient-bg text-white">
|
82 |
+
<div class="max-w-7xl mx-auto py-12 px-4 sm:px-6 lg:px-8 text-center">
|
83 |
+
<h1 class="text-4xl font-extrabold tracking-tight sm:text-5xl lg:text-6xl mb-6">
|
84 |
+
Analyze Your GitHub Portfolio
|
85 |
+
</h1>
|
86 |
+
<p class="text-xl max-w-3xl mx-auto">
|
87 |
+
Get detailed insights about your coding skills, project quality, and areas for improvement based on your GitHub repositories.
|
88 |
+
</p>
|
89 |
+
<div class="mt-8">
|
90 |
+
<button id="heroLoginBtn" class="inline-flex items-center px-6 py-3 border border-transparent text-base font-medium rounded-md shadow-sm text-indigo-600 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-white">
|
91 |
+
<i class="fab fa-github mr-2"></i> Connect Your GitHub Account
|
92 |
+
</button>
|
93 |
+
</div>
|
94 |
+
</div>
|
95 |
+
</div>
|
96 |
+
|
97 |
+
<!-- Features Section -->
|
98 |
+
<div class="py-12 bg-white">
|
99 |
+
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
100 |
+
<div class="lg:text-center">
|
101 |
+
<h2 class="text-base text-indigo-600 font-semibold tracking-wide uppercase">Features</h2>
|
102 |
+
<p class="mt-2 text-3xl leading-8 font-extrabold tracking-tight text-gray-900 sm:text-4xl">
|
103 |
+
Comprehensive Code Analysis
|
104 |
+
</p>
|
105 |
+
</div>
|
106 |
+
|
107 |
+
<div class="mt-10">
|
108 |
+
<div class="grid grid-cols-1 gap-10 sm:grid-cols-2 lg:grid-cols-3">
|
109 |
+
<div class="bg-gray-50 p-6 rounded-lg shadow-sm card-hover">
|
110 |
+
<div class="flex items-center justify-center h-12 w-12 rounded-md bg-indigo-500 text-white">
|
111 |
+
<i class="fas fa-code text-xl"></i>
|
112 |
+
</div>
|
113 |
+
<div class="mt-5">
|
114 |
+
<h3 class="text-lg font-medium text-gray-900">Language Analysis</h3>
|
115 |
+
<p class="mt-2 text-base text-gray-500">
|
116 |
+
Detailed breakdown of programming languages used across all your repositories with proficiency metrics.
|
117 |
+
</p>
|
118 |
+
</div>
|
119 |
+
</div>
|
120 |
+
|
121 |
+
<div class="bg-gray-50 p-6 rounded-lg shadow-sm card-hover">
|
122 |
+
<div class="flex items-center justify-center h-12 w-12 rounded-md bg-indigo-500 text-white">
|
123 |
+
<i class="fas fa-check-circle text-xl"></i>
|
124 |
+
</div>
|
125 |
+
<div class="mt-5">
|
126 |
+
<h3 class="text-lg font-medium text-gray-900">Code Quality</h3>
|
127 |
+
<p class="mt-2 text-base text-gray-500">
|
128 |
+
Automated assessment of code quality including complexity, maintainability, and best practices.
|
129 |
+
</p>
|
130 |
+
</div>
|
131 |
+
</div>
|
132 |
+
|
133 |
+
<div class="bg-gray-50 p-6 rounded-lg shadow-sm card-hover">
|
134 |
+
<div class="flex items-center justify-center h-12 w-12 rounded-md bg-indigo-500 text-white">
|
135 |
+
<i class="fas fa-vial text-xl"></i>
|
136 |
+
</div>
|
137 |
+
<div class="mt-5">
|
138 |
+
<h3 class="text-lg font-medium text-gray-900">Test Coverage</h3>
|
139 |
+
<p class="mt-2 text-base text-gray-500">
|
140 |
+
Evaluation of test coverage and testing practices across your projects.
|
141 |
+
</p>
|
142 |
+
</div>
|
143 |
+
</div>
|
144 |
+
|
145 |
+
<div class="bg-gray-50 p-6 rounded-lg shadow-sm card-hover">
|
146 |
+
<div class="flex items-center justify-center h-12 w-12 rounded-md bg-indigo-500 text-white">
|
147 |
+
<i class="fas fa-project-diagram text-xl"></i>
|
148 |
+
</div>
|
149 |
+
<div class="mt-5">
|
150 |
+
<h3 class="text-lg font-medium text-gray-900">Project Structure</h3>
|
151 |
+
<p class="mt-2 text-base text-gray-500">
|
152 |
+
Analysis of project architecture and organization patterns.
|
153 |
+
</p>
|
154 |
+
</div>
|
155 |
+
</div>
|
156 |
+
|
157 |
+
<div class="bg-gray-50 p-6 rounded-lg shadow-sm card-hover">
|
158 |
+
<div class="flex items-center justify-center h-12 w-12 rounded-md bg-indigo-500 text-white">
|
159 |
+
<i class="fas fa-chart-line text-xl"></i>
|
160 |
+
</div>
|
161 |
+
<div class="mt-5">
|
162 |
+
<h3 class="text-lg font-medium text-gray-900">Activity Metrics</h3>
|
163 |
+
<p class="mt-2 text-base text-gray-500">
|
164 |
+
Tracking of your coding activity, commit frequency, and contribution patterns.
|
165 |
+
</p>
|
166 |
+
</div>
|
167 |
+
</div>
|
168 |
+
|
169 |
+
<div class="bg-gray-50 p-6 rounded-lg shadow-sm card-hover">
|
170 |
+
<div class="flex items-center justify-center h-12 w-12 rounded-md bg-indigo-500 text-white">
|
171 |
+
<i class="fas fa-bullseye text-xl"></i>
|
172 |
+
</div>
|
173 |
+
<div class="mt-5">
|
174 |
+
<h3 class="text-lg font-medium text-gray-900">Milestone Planning</h3>
|
175 |
+
<p class="mt-2 text-base text-gray-500">
|
176 |
+
Personalized recommendations for skill development and project milestones.
|
177 |
+
</p>
|
178 |
+
</div>
|
179 |
+
</div>
|
180 |
+
</div>
|
181 |
+
</div>
|
182 |
+
</div>
|
183 |
+
</div>
|
184 |
+
|
185 |
+
<!-- Dashboard Section (Visible after login) -->
|
186 |
+
<div id="dashboard" class="hidden py-12 bg-gray-50">
|
187 |
+
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
188 |
+
<div class="flex justify-between items-center mb-8">
|
189 |
+
<div>
|
190 |
+
<h2 class="text-2xl font-bold text-gray-900">Your GitHub Portfolio Analysis</h2>
|
191 |
+
<p class="text-gray-600">Based on your public repositories</p>
|
192 |
+
</div>
|
193 |
+
<div class="flex items-center">
|
194 |
+
<img id="userAvatar" class="h-10 w-10 rounded-full mr-3" src="" alt="">
|
195 |
+
<span id="username" class="font-medium text-gray-900"></span>
|
196 |
+
</div>
|
197 |
+
</div>
|
198 |
+
|
199 |
+
<!-- Summary Cards -->
|
200 |
+
<div class="grid grid-cols-1 gap-5 sm:grid-cols-2 lg:grid-cols-4 mb-8">
|
201 |
+
<div class="bg-white overflow-hidden shadow rounded-lg">
|
202 |
+
<div class="px-4 py-5 sm:p-6">
|
203 |
+
<div class="flex items-center">
|
204 |
+
<div class="flex-shrink-0 bg-indigo-500 rounded-md p-3">
|
205 |
+
<i class="fas fa-code text-white"></i>
|
206 |
+
</div>
|
207 |
+
<div class="ml-5 w-0 flex-1">
|
208 |
+
<dl>
|
209 |
+
<dt class="text-sm font-medium text-gray-500 truncate">Total Repositories</dt>
|
210 |
+
<dd id="totalRepos" class="flex items-baseline">
|
211 |
+
<div class="text-2xl font-semibold text-gray-900">0</div>
|
212 |
+
</dd>
|
213 |
+
</dl>
|
214 |
+
</div>
|
215 |
+
</div>
|
216 |
+
</div>
|
217 |
+
</div>
|
218 |
+
|
219 |
+
<div class="bg-white overflow-hidden shadow rounded-lg">
|
220 |
+
<div class="px-4 py-5 sm:p-6">
|
221 |
+
<div class="flex items-center">
|
222 |
+
<div class="flex-shrink-0 bg-green-500 rounded-md p-3">
|
223 |
+
<i class="fas fa-star text-white"></i>
|
224 |
+
</div>
|
225 |
+
<div class="ml-5 w-0 flex-1">
|
226 |
+
<dl>
|
227 |
+
<dt class="text-sm font-medium text-gray-500 truncate">Total Stars</dt>
|
228 |
+
<dd id="totalStars" class="flex items-baseline">
|
229 |
+
<div class="text-2xl font-semibold text-gray-900">0</div>
|
230 |
+
</dd>
|
231 |
+
</dl>
|
232 |
+
</div>
|
233 |
+
</div>
|
234 |
+
</div>
|
235 |
+
</div>
|
236 |
+
|
237 |
+
<div class="bg-white overflow-hidden shadow rounded-lg">
|
238 |
+
<div class="px-4 py-5 sm:p-6">
|
239 |
+
<div class="flex items-center">
|
240 |
+
<div class="flex-shrink-0 bg-blue-500 rounded-md p-3">
|
241 |
+
<i class="fas fa-code-branch text-white"></i>
|
242 |
+
</div>
|
243 |
+
<div class="ml-5 w-0 flex-1">
|
244 |
+
<dl>
|
245 |
+
<dt class="text-sm font-medium text-gray-500 truncate">Primary Language</dt>
|
246 |
+
<dd id="primaryLanguage" class="flex items-baseline">
|
247 |
+
<div class="text-2xl font-semibold text-gray-900">-</div>
|
248 |
+
</dd>
|
249 |
+
</dl>
|
250 |
+
</div>
|
251 |
+
</div>
|
252 |
+
</div>
|
253 |
+
</div>
|
254 |
+
|
255 |
+
<div class="bg-white overflow-hidden shadow rounded-lg">
|
256 |
+
<div class="px-4 py-5 sm:p-6">
|
257 |
+
<div class="flex items-center">
|
258 |
+
<div class="flex-shrink-0 bg-purple-500 rounded-md p-3">
|
259 |
+
<i class="fas fa-chart-pie text-white"></i>
|
260 |
+
</div>
|
261 |
+
<div class="ml-5 w-0 flex-1">
|
262 |
+
<dl>
|
263 |
+
<dt class="text-sm font-medium text-gray-500 truncate">Code Quality Score</dt>
|
264 |
+
<dd id="qualityScore" class="flex items-baseline">
|
265 |
+
<div class="text-2xl font-semibold text-gray-900">0/100</div>
|
266 |
+
</dd>
|
267 |
+
</dl>
|
268 |
+
</div>
|
269 |
+
</div>
|
270 |
+
</div>
|
271 |
+
</div>
|
272 |
+
</div>
|
273 |
+
|
274 |
+
<!-- Language Distribution -->
|
275 |
+
<div class="mb-8">
|
276 |
+
<div class="bg-white shadow rounded-lg p-6">
|
277 |
+
<h3 class="text-lg font-medium text-gray-900 mb-4">Language Distribution</h3>
|
278 |
+
<div id="languageChart" class="h-64"></div>
|
279 |
+
<div id="languageList" class="mt-4 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4"></div>
|
280 |
+
</div>
|
281 |
+
</div>
|
282 |
+
|
283 |
+
<!-- Repository List -->
|
284 |
+
<div class="mb-8">
|
285 |
+
<div class="bg-white shadow rounded-lg p-6">
|
286 |
+
<h3 class="text-lg font-medium text-gray-900 mb-4">Your Repositories</h3>
|
287 |
+
<div id="repoList" class="space-y-4"></div>
|
288 |
+
</div>
|
289 |
+
</div>
|
290 |
+
|
291 |
+
<!-- Code Quality Metrics -->
|
292 |
+
<div class="mb-8">
|
293 |
+
<div class="bg-white shadow rounded-lg p-6">
|
294 |
+
<h3 class="text-lg font-medium text-gray-900 mb-4">Code Quality Metrics</h3>
|
295 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
296 |
+
<div>
|
297 |
+
<h4 class="font-medium text-gray-700 mb-2">Maintainability</h4>
|
298 |
+
<div class="w-full bg-gray-200 rounded-full h-4">
|
299 |
+
<div id="maintainabilityBar" class="bg-green-500 h-4 rounded-full" style="width: 0%"></div>
|
300 |
+
</div>
|
301 |
+
<p class="text-sm text-gray-500 mt-1" id="maintainabilityText">Calculating...</p>
|
302 |
+
</div>
|
303 |
+
<div>
|
304 |
+
<h4 class="font-medium text-gray-700 mb-2">Test Coverage</h4>
|
305 |
+
<div class="w-full bg-gray-200 rounded-full h-4">
|
306 |
+
<div id="coverageBar" class="bg-blue-500 h-4 rounded-full" style="width: 0%"></div>
|
307 |
+
</div>
|
308 |
+
<p class="text-sm text-gray-500 mt-1" id="coverageText">Calculating...</p>
|
309 |
+
</div>
|
310 |
+
<div>
|
311 |
+
<h4 class="font-medium text-gray-700 mb-2">Documentation</h4>
|
312 |
+
<div class="w-full bg-gray-200 rounded-full h-4">
|
313 |
+
<div id="docsBar" class="bg-purple-500 h-4 rounded-full" style="width: 0%"></div>
|
314 |
+
</div>
|
315 |
+
<p class="text-sm text-gray-500 mt-1" id="docsText">Calculating...</p>
|
316 |
+
</div>
|
317 |
+
<div>
|
318 |
+
<h4 class="font-medium text-gray-700 mb-2">Code Complexity</h4>
|
319 |
+
<div class="w-full bg-gray-200 rounded-full h-4">
|
320 |
+
<div id="complexityBar" class="bg-yellow-500 h-4 rounded-full" style="width: 0%"></div>
|
321 |
+
</div>
|
322 |
+
<p class="text-sm text-gray-500 mt-1" id="complexityText">Calculating...</p>
|
323 |
+
</div>
|
324 |
+
</div>
|
325 |
+
</div>
|
326 |
+
</div>
|
327 |
+
|
328 |
+
<!-- Activity Heatmap -->
|
329 |
+
<div class="mb-8">
|
330 |
+
<div class="bg-white shadow rounded-lg p-6">
|
331 |
+
<h3 class="text-lg font-medium text-gray-900 mb-4">Coding Activity</h3>
|
332 |
+
<div class="overflow-x-auto">
|
333 |
+
<div id="heatmap" class="heatmap mb-2"></div>
|
334 |
+
</div>
|
335 |
+
<div class="flex justify-between text-xs text-gray-500 mt-2">
|
336 |
+
<span>Less</span>
|
337 |
+
<span>More</span>
|
338 |
+
</div>
|
339 |
+
</div>
|
340 |
+
</div>
|
341 |
+
|
342 |
+
<!-- Tech Stack Analysis -->
|
343 |
+
<div class="mb-8">
|
344 |
+
<div class="bg-white shadow rounded-lg p-6">
|
345 |
+
<h3 class="text-lg font-medium text-gray-900 mb-4">Your Tech Stack</h3>
|
346 |
+
<div id="techStack" class="flex flex-wrap gap-2">
|
347 |
+
<!-- Tech stack items will be added here -->
|
348 |
+
</div>
|
349 |
+
</div>
|
350 |
+
</div>
|
351 |
+
|
352 |
+
<!-- Milestones -->
|
353 |
+
<div class="mb-8">
|
354 |
+
<div class="bg-white shadow rounded-lg p-6">
|
355 |
+
<h3 class="text-lg font-medium text-gray-900 mb-4">Recommended Milestones</h3>
|
356 |
+
<div id="milestones" class="space-y-4">
|
357 |
+
<div class="border-l-4 border-indigo-500 pl-4 py-2">
|
358 |
+
<h4 class="font-medium">Improve Test Coverage</h4>
|
359 |
+
<p class="text-sm text-gray-600">Aim for at least 80% test coverage in your main projects</p>
|
360 |
+
<div class="mt-2 flex items-center text-sm">
|
361 |
+
<span class="text-indigo-600">0/3 projects improved</span>
|
362 |
+
<span class="mx-2">·</span>
|
363 |
+
<span class="text-gray-500">Due in 2 months</span>
|
364 |
+
</div>
|
365 |
+
</div>
|
366 |
+
<div class="border-l-4 border-green-500 pl-4 py-2">
|
367 |
+
<h4 class="font-medium">Learn a New Language</h4>
|
368 |
+
<p class="text-sm text-gray-600">Expand your skills by learning Rust or Go</p>
|
369 |
+
<div class="mt-2 flex items-center text-sm">
|
370 |
+
<span class="text-green-600">Not started</span>
|
371 |
+
<span class="mx-2">·</span>
|
372 |
+
<span class="text-gray-500">Due in 3 months</span>
|
373 |
+
</div>
|
374 |
+
</div>
|
375 |
+
<div class="border-l-4 border-yellow-500 pl-4 py-2">
|
376 |
+
<h4 class="font-medium">Improve Documentation</h4>
|
377 |
+
<p class="text-sm text-gray-600">Add comprehensive READMEs to all your main projects</p>
|
378 |
+
<div class="mt-2 flex items-center text-sm">
|
379 |
+
<span class="text-yellow-600">1/5 projects documented</span>
|
380 |
+
<span class="mx-2">·</span>
|
381 |
+
<span class="text-gray-500">Due in 1 month</span>
|
382 |
+
</div>
|
383 |
+
</div>
|
384 |
+
</div>
|
385 |
+
<button class="mt-4 inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
|
386 |
+
Add Custom Milestone
|
387 |
+
</button>
|
388 |
+
</div>
|
389 |
+
</div>
|
390 |
+
</div>
|
391 |
+
</div>
|
392 |
+
|
393 |
+
<!-- Loading State -->
|
394 |
+
<div id="loading" class="hidden fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50">
|
395 |
+
<div class="bg-white rounded-lg p-8 max-w-md w-full text-center">
|
396 |
+
<div class="animate-spin rounded-full h-16 w-16 border-b-2 border-indigo-600 mx-auto mb-4"></div>
|
397 |
+
<h3 class="text-lg font-medium text-gray-900 mb-2">Analyzing Your GitHub Portfolio</h3>
|
398 |
+
<p class="text-gray-600">This may take a few moments while we analyze your repositories...</p>
|
399 |
+
</div>
|
400 |
+
</div>
|
401 |
+
|
402 |
+
<script>
|
403 |
+
// GitHub OAuth configuration
|
404 |
+
const clientId = 'YOUR_GITHUB_CLIENT_ID'; // Replace with your GitHub OAuth app client ID
|
405 |
+
const clientSecret = 'YOUR_GITHUB_CLIENT_SECRET'; // Replace with your GitHub OAuth app client secret
|
406 |
+
const redirectUri = window.location.href.split('?')[0]; // Current page URL
|
407 |
+
|
408 |
+
// DOM elements
|
409 |
+
const loginBtn = document.getElementById('loginBtn');
|
410 |
+
const heroLoginBtn = document.getElementById('heroLoginBtn');
|
411 |
+
const dashboard = document.getElementById('dashboard');
|
412 |
+
const loading = document.getElementById('loading');
|
413 |
+
|
414 |
+
// Check for OAuth callback
|
415 |
+
const urlParams = new URLSearchParams(window.location.search);
|
416 |
+
const code = urlParams.get('code');
|
417 |
+
|
418 |
+
if (code) {
|
419 |
+
// We have an OAuth code, exchange it for an access token
|
420 |
+
exchangeCodeForToken(code);
|
421 |
+
}
|
422 |
+
|
423 |
+
// Set up login buttons
|
424 |
+
loginBtn.addEventListener('click', initiateGitHubLogin);
|
425 |
+
heroLoginBtn.addEventListener('click', initiateGitHubLogin);
|
426 |
+
|
427 |
+
function initiateGitHubLogin() {
|
428 |
+
// Redirect to GitHub OAuth
|
429 |
+
const githubOAuthUrl = `https://github.com/login/oauth/authorize?client_id=${clientId}&redirect_uri=${redirectUri}&scope=user,repo`;
|
430 |
+
window.location.href = githubOAuthUrl;
|
431 |
+
}
|
432 |
+
|
433 |
+
async function exchangeCodeForToken(code) {
|
434 |
+
showLoading();
|
435 |
+
|
436 |
+
try {
|
437 |
+
// In a real app, you would do this server-side for security
|
438 |
+
// This is just for demonstration
|
439 |
+
const response = await fetch('https://github.com/login/oauth/access_token', {
|
440 |
+
method: 'POST',
|
441 |
+
headers: {
|
442 |
+
'Content-Type': 'application/json',
|
443 |
+
'Accept': 'application/json'
|
444 |
+
},
|
445 |
+
body: JSON.stringify({
|
446 |
+
client_id: clientId,
|
447 |
+
client_secret: clientSecret,
|
448 |
+
code: code,
|
449 |
+
redirect_uri: redirectUri
|
450 |
+
})
|
451 |
+
});
|
452 |
+
|
453 |
+
const data = await response.json();
|
454 |
+
const accessToken = data.access_token;
|
455 |
+
|
456 |
+
if (accessToken) {
|
457 |
+
// Store token (in a real app, use secure storage)
|
458 |
+
localStorage.setItem('github_token', accessToken);
|
459 |
+
|
460 |
+
// Remove code from URL
|
461 |
+
window.history.replaceState({}, document.title, window.location.pathname);
|
462 |
+
|
463 |
+
// Load user data
|
464 |
+
await loadUserData(accessToken);
|
465 |
+
} else {
|
466 |
+
hideLoading();
|
467 |
+
alert('Failed to authenticate with GitHub');
|
468 |
+
}
|
469 |
+
} catch (error) {
|
470 |
+
hideLoading();
|
471 |
+
console.error('Error exchanging code for token:', error);
|
472 |
+
alert('An error occurred during authentication');
|
473 |
+
}
|
474 |
+
}
|
475 |
+
|
476 |
+
async function loadUserData(token) {
|
477 |
+
try {
|
478 |
+
// Get user info
|
479 |
+
const userResponse = await fetch('https://api.github.com/user', {
|
480 |
+
headers: {
|
481 |
+
'Authorization': `token ${token}`
|
482 |
+
}
|
483 |
+
});
|
484 |
+
|
485 |
+
const user = await userResponse.json();
|
486 |
+
|
487 |
+
// Get user repos
|
488 |
+
const reposResponse = await fetch('https://api.github.com/user/repos?per_page=100', {
|
489 |
+
headers: {
|
490 |
+
'Authorization': `token ${token}`
|
491 |
+
}
|
492 |
+
});
|
493 |
+
|
494 |
+
const repos = await reposResponse.json();
|
495 |
+
|
496 |
+
// Process and display data
|
497 |
+
displayUserData(user, repos);
|
498 |
+
analyzeRepositories(repos);
|
499 |
+
|
500 |
+
hideLoading();
|
501 |
+
dashboard.classList.remove('hidden');
|
502 |
+
} catch (error) {
|
503 |
+
hideLoading();
|
504 |
+
console.error('Error loading user data:', error);
|
505 |
+
alert('Failed to load GitHub data');
|
506 |
+
}
|
507 |
+
}
|
508 |
+
|
509 |
+
function displayUserData(user, repos) {
|
510 |
+
// Display basic user info
|
511 |
+
document.getElementById('username').textContent = user.login;
|
512 |
+
document.getElementById('userAvatar').src = user.avatar_url;
|
513 |
+
|
514 |
+
// Display repo count
|
515 |
+
document.getElementById('totalRepos').textContent = repos.length;
|
516 |
+
|
517 |
+
// Calculate total stars
|
518 |
+
const totalStars = repos.reduce((sum, repo) => sum + repo.stargazers_count, 0);
|
519 |
+
document.getElementById('totalStars').textContent = totalStars;
|
520 |
+
}
|
521 |
+
|
522 |
+
function analyzeRepositories(repos) {
|
523 |
+
// Analyze languages
|
524 |
+
const languageStats = analyzeLanguages(repos);
|
525 |
+
displayLanguageStats(languageStats);
|
526 |
+
|
527 |
+
// Display repositories
|
528 |
+
displayRepositories(repos);
|
529 |
+
|
530 |
+
// Generate mock quality metrics (in a real app, this would be more sophisticated)
|
531 |
+
generateQualityMetrics();
|
532 |
+
|
533 |
+
// Generate mock activity heatmap
|
534 |
+
generateActivityHeatmap();
|
535 |
+
|
536 |
+
// Generate mock tech stack
|
537 |
+
generateTechStack(languageStats);
|
538 |
+
}
|
539 |
+
|
540 |
+
function analyzeLanguages(repos) {
|
541 |
+
const languageStats = {};
|
542 |
+
let totalBytes = 0;
|
543 |
+
|
544 |
+
// Filter out repos without language data
|
545 |
+
const reposWithLanguages = repos.filter(repo => repo.language);
|
546 |
+
|
547 |
+
// Count language occurrences
|
548 |
+
reposWithLanguages.forEach(repo => {
|
549 |
+
if (!languageStats[repo.language]) {
|
550 |
+
languageStats[repo.language] = {
|
551 |
+
count: 0,
|
552 |
+
bytes: 0,
|
553 |
+
color: getLanguageColor(repo.language),
|
554 |
+
stars: 0
|
555 |
+
};
|
556 |
+
}
|
557 |
+
languageStats[repo.language].count++;
|
558 |
+
languageStats[repo.language].stars += repo.stargazers_count;
|
559 |
+
});
|
560 |
+
|
561 |
+
// Set primary language
|
562 |
+
let primaryLanguage = '';
|
563 |
+
let maxCount = 0;
|
564 |
+
|
565 |
+
for (const lang in languageStats) {
|
566 |
+
if (languageStats[lang].count > maxCount) {
|
567 |
+
maxCount = languageStats[lang].count;
|
568 |
+
primaryLanguage = lang;
|
569 |
+
}
|
570 |
+
}
|
571 |
+
|
572 |
+
document.getElementById('primaryLanguage').textContent = primaryLanguage;
|
573 |
+
|
574 |
+
return languageStats;
|
575 |
+
}
|
576 |
+
|
577 |
+
function displayLanguageStats(languageStats) {
|
578 |
+
const languageList = document.getElementById('languageList');
|
579 |
+
languageList.innerHTML = '';
|
580 |
+
|
581 |
+
// Sort languages by count
|
582 |
+
const sortedLanguages = Object.keys(languageStats).sort((a, b) => {
|
583 |
+
return languageStats[b].count - languageStats[a].count;
|
584 |
+
});
|
585 |
+
|
586 |
+
// Display top languages
|
587 |
+
sortedLanguages.slice(0, 6).forEach(lang => {
|
588 |
+
const stat = languageStats[lang];
|
589 |
+
const percentage = Math.round((stat.count / Object.keys(languageStats).length) * 100);
|
590 |
+
|
591 |
+
const langElement = document.createElement('div');
|
592 |
+
langElement.className = 'bg-gray-50 p-4 rounded-lg';
|
593 |
+
langElement.innerHTML = `
|
594 |
+
<div class="flex items-center justify-between">
|
595 |
+
<div class="flex items-center">
|
596 |
+
<span class="language-bar" style="width: 10px; height: 10px; background-color: ${stat.color || '#3182ce'};"></span>
|
597 |
+
<span class="font-medium">${lang}</span>
|
598 |
+
</div>
|
599 |
+
<span class="text-gray-600">${stat.count} repos</span>
|
600 |
+
</div>
|
601 |
+
<div class="mt-2">
|
602 |
+
<div class="w-full bg-gray-200 rounded-full h-2">
|
603 |
+
<div class="bg-blue-500 h-2 rounded-full" style="width: ${percentage}%"></div>
|
604 |
+
</div>
|
605 |
+
</div>
|
606 |
+
<div class="mt-2 flex justify-between text-sm text-gray-500">
|
607 |
+
<span>${percentage}% of repos</span>
|
608 |
+
<span>${stat.stars} <i class="fas fa-star text-yellow-400"></i></span>
|
609 |
+
</div>
|
610 |
+
`;
|
611 |
+
|
612 |
+
languageList.appendChild(langElement);
|
613 |
+
});
|
614 |
+
|
615 |
+
// Simple chart visualization
|
616 |
+
const chartContainer = document.getElementById('languageChart');
|
617 |
+
chartContainer.innerHTML = `
|
618 |
+
<div class="flex items-end h-48 mt-6 space-x-1">
|
619 |
+
${sortedLanguages.slice(0, 5).map(lang => {
|
620 |
+
const stat = languageStats[lang];
|
621 |
+
const height = Math.round((stat.count / languageStats[sortedLanguages[0]].count) * 100);
|
622 |
+
return `
|
623 |
+
<div class="flex flex-col items-center flex-1">
|
624 |
+
<div class="w-full bg-blue-500 rounded-t hover:bg-blue-600 transition-all" style="height: ${height}%"></div>
|
625 |
+
<div class="text-xs text-gray-500 mt-1">${lang}</div>
|
626 |
+
</div>
|
627 |
+
`;
|
628 |
+
}).join('')}
|
629 |
+
</div>
|
630 |
+
`;
|
631 |
+
}
|
632 |
+
|
633 |
+
function displayRepositories(repos) {
|
634 |
+
const repoList = document.getElementById('repoList');
|
635 |
+
repoList.innerHTML = '';
|
636 |
+
|
637 |
+
// Sort by stars
|
638 |
+
const sortedRepos = [...repos].sort((a, b) => b.stargazers_count - a.stargazers_count);
|
639 |
+
|
640 |
+
// Display top 10 repos
|
641 |
+
sortedRepos.slice(0, 10).forEach(repo => {
|
642 |
+
const repoElement = document.createElement('div');
|
643 |
+
repoElement.className = 'repo-card border border-gray-200 rounded-lg p-4 hover:shadow-md transition-all';
|
644 |
+
repoElement.innerHTML = `
|
645 |
+
<div class="flex justify-between items-start">
|
646 |
+
<div>
|
647 |
+
<h4 class="font-medium text-lg">
|
648 |
+
<a href="${repo.html_url}" target="_blank" class="text-indigo-600 hover:text-indigo-800">${repo.name}</a>
|
649 |
+
</h4>
|
650 |
+
<p class="text-gray-600 text-sm mt-1">${repo.description || 'No description provided'}</p>
|
651 |
+
</div>
|
652 |
+
<div class="flex items-center">
|
653 |
+
<span class="text-gray-500 mr-2">${repo.stargazers_count}</span>
|
654 |
+
<i class="fas fa-star text-yellow-400"></i>
|
655 |
+
</div>
|
656 |
+
</div>
|
657 |
+
<div class="repo-stats mt-3 pt-3 border-t border-gray-100">
|
658 |
+
<div class="flex flex-wrap gap-4 text-sm">
|
659 |
+
<div class="flex items-center">
|
660 |
+
<span class="language-bar" style="width: 10px; height: 10px; background-color: ${getLanguageColor(repo.language) || '#3182ce'};"></span>
|
661 |
+
<span class="ml-1 text-gray-600">${repo.language || 'Unknown'}</span>
|
662 |
+
</div>
|
663 |
+
<div class="flex items-center">
|
664 |
+
<i class="fas fa-code-branch text-gray-400 mr-1"></i>
|
665 |
+
<span class="text-gray-600">${repo.forks_count} forks</span>
|
666 |
+
</div>
|
667 |
+
<div class="flex items-center">
|
668 |
+
<i class="fas fa-eye text-gray-400 mr-1"></i>
|
669 |
+
<span class="text-gray-600">${repo.watchers_count} watchers</span>
|
670 |
+
</div>
|
671 |
+
<div class="flex items-center">
|
672 |
+
<i class="fas fa-calendar-alt text-gray-400 mr-1"></i>
|
673 |
+
<span class="text-gray-600">Updated ${formatDate(repo.updated_at)}</span>
|
674 |
+
</div>
|
675 |
+
</div>
|
676 |
+
</div>
|
677 |
+
`;
|
678 |
+
|
679 |
+
repoList.appendChild(repoElement);
|
680 |
+
});
|
681 |
+
}
|
682 |
+
|
683 |
+
function generateQualityMetrics() {
|
684 |
+
// Mock quality metrics (in a real app, this would come from analysis)
|
685 |
+
const maintainability = Math.floor(Math.random() * 40) + 60; // 60-100
|
686 |
+
const coverage = Math.floor(Math.random() * 50) + 30; // 30-80
|
687 |
+
const docs = Math.floor(Math.random() * 60) + 20; // 20-80
|
688 |
+
const complexity = Math.floor(Math.random() * 40) + 40; // 40-80
|
689 |
+
|
690 |
+
document.getElementById('maintainabilityBar').style.width = `${maintainability}%`;
|
691 |
+
document.getElementById('coverageBar').style.width = `${coverage}%`;
|
692 |
+
document.getElementById('docsBar').style.width = `${docs}%`;
|
693 |
+
document.getElementById('complexityBar').style.width = `${100 - complexity}%`;
|
694 |
+
|
695 |
+
document.getElementById('maintainabilityText').textContent =
|
696 |
+
maintainability >= 80 ? 'Excellent maintainability' :
|
697 |
+
maintainability >= 60 ? 'Good maintainability' : 'Needs improvement';
|
698 |
+
|
699 |
+
document.getElementById('coverageText').textContent =
|
700 |
+
coverage >= 70 ? 'Great test coverage' :
|
701 |
+
coverage >= 50 ? 'Moderate test coverage' : 'Low test coverage';
|
702 |
+
|
703 |
+
document.getElementById('docsText').textContent =
|
704 |
+
docs >= 70 ? 'Well documented' :
|
705 |
+
docs >= 50 ? 'Moderate documentation' : 'Needs more documentation';
|
706 |
+
|
707 |
+
document.getElementById('complexityText').textContent =
|
708 |
+
complexity <= 40 ? 'Simple and clean' :
|
709 |
+
complexity <= 60 ? 'Moderate complexity' : 'High complexity - consider refactoring';
|
710 |
+
|
711 |
+
document.getElementById('qualityScore').textContent = `${Math.round((maintainability + coverage + (100 - complexity) + docs) / 4)}/100`;
|
712 |
+
}
|
713 |
+
|
714 |
+
function generateActivityHeatmap() {
|
715 |
+
const heatmap = document.getElementById('heatmap');
|
716 |
+
heatmap.innerHTML = '';
|
717 |
+
|
718 |
+
// Generate mock activity data (52 weeks)
|
719 |
+
for (let i = 0; i < 52 * 7; i++) {
|
720 |
+
const cell = document.createElement('div');
|
721 |
+
cell.className = 'heatmap-cell';
|
722 |
+
|
723 |
+
// Random activity level (0-4)
|
724 |
+
const activity = Math.floor(Math.random() * 5);
|
725 |
+
|
726 |
+
// Set color based on activity level
|
727 |
+
const colors = ['#ebedf0', '#9be9a8', '#40c463', '#30a14e', '#216e39'];
|
728 |
+
cell.style.backgroundColor = colors[activity];
|
729 |
+
|
730 |
+
heatmap.appendChild(cell);
|
731 |
+
}
|
732 |
+
}
|
733 |
+
|
734 |
+
function generateTechStack(languageStats) {
|
735 |
+
const techStack = document.getElementById('techStack');
|
736 |
+
techStack.innerHTML = '';
|
737 |
+
|
738 |
+
// Sort languages by count
|
739 |
+
const sortedLanguages = Object.keys(languageStats).sort((a, b) => {
|
740 |
+
return languageStats[b].count - languageStats[a].count;
|
741 |
+
});
|
742 |
+
|
743 |
+
// Display top 8 languages as tech stack
|
744 |
+
sortedLanguages.slice(0, 8).forEach(lang => {
|
745 |
+
const stat = languageStats[lang];
|
746 |
+
|
747 |
+
const techItem = document.createElement('div');
|
748 |
+
techItem.className = 'flex items-center px-3 py-1 rounded-full text-sm font-medium bg-indigo-100 text-indigo-800';
|
749 |
+
techItem.innerHTML = `
|
750 |
+
<span class="language-bar" style="width: 8px; height: 8px; background-color: ${stat.color || '#3182ce'};"></span>
|
751 |
+
<span class="ml-2">${lang}</span>
|
752 |
+
`;
|
753 |
+
|
754 |
+
techStack.appendChild(techItem);
|
755 |
+
});
|
756 |
+
|
757 |
+
// Add some common technologies (mock data)
|
758 |
+
const commonTechs = ['React', 'Node.js', 'Express', 'MongoDB', 'Docker', 'Git'];
|
759 |
+
|
760 |
+
commonTechs.forEach(tech => {
|
761 |
+
const techItem = document.createElement('div');
|
762 |
+
techItem.className = 'flex items-center px-3 py-1 rounded-full text-sm font-medium bg-green-100 text-green-800';
|
763 |
+
techItem.innerHTML = `
|
764 |
+
<i class="fas fa-check-circle mr-2"></i>
|
765 |
+
<span>${tech}</span>
|
766 |
+
`;
|
767 |
+
|
768 |
+
techStack.appendChild(techItem);
|
769 |
+
});
|
770 |
+
}
|
771 |
+
|
772 |
+
function getLanguageColor(language) {
|
773 |
+
// Simple color mapping for common languages
|
774 |
+
const colors = {
|
775 |
+
'JavaScript': '#f1e05a',
|
776 |
+
'TypeScript': '#3178c6',
|
777 |
+
'Python': '#3572A5',
|
778 |
+
'Java': '#b07219',
|
779 |
+
'C++': '#f34b7d',
|
780 |
+
'C': '#555555',
|
781 |
+
'C#': '#178600',
|
782 |
+
'Ruby': '#701516',
|
783 |
+
'PHP': '#4F5D95',
|
784 |
+
'Go': '#00ADD8',
|
785 |
+
'Rust': '#dea584',
|
786 |
+
'Swift': '#ffac45',
|
787 |
+
'Kotlin': '#A97BFF',
|
788 |
+
'HTML': '#e34c26',
|
789 |
+
'CSS': '#563d7c',
|
790 |
+
'Shell': '#89e051',
|
791 |
+
'Dart': '#00B4AB',
|
792 |
+
'Scala': '#c22d40',
|
793 |
+
'R': '#198CE7'
|
794 |
+
};
|
795 |
+
|
796 |
+
return colors[language] || '#3182ce'; // Default to blue if unknown
|
797 |
+
}
|
798 |
+
|
799 |
+
function formatDate(dateString) {
|
800 |
+
const date = new Date(dateString);
|
801 |
+
return date.toLocaleDateString('en-US', { year: 'numeric', month: 'short', day: 'numeric' });
|
802 |
+
}
|
803 |
+
|
804 |
+
function showLoading() {
|
805 |
+
loading.classList.remove('hidden');
|
806 |
+
}
|
807 |
+
|
808 |
+
function hideLoading() {
|
809 |
+
loading.classList.add('hidden');
|
810 |
+
}
|
811 |
+
|
812 |
+
// Check for existing token on page load
|
813 |
+
document.addEventListener('DOMContentLoaded', () => {
|
814 |
+
const token = localStorage.getItem('github_token');
|
815 |
+
if (token) {
|
816 |
+
showLoading();
|
817 |
+
loadUserData(token);
|
818 |
+
}
|
819 |
+
});
|
820 |
+
</script>
|
821 |
+
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=blackrajeev/portfolio-analyser" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
822 |
+
</html>
|