Skip to content

Commit f777f48

Browse files
committed
docs: Update website docs to include star graph
1 parent ab801d4 commit f777f48

File tree

3 files changed

+63
-0
lines changed

3 files changed

+63
-0
lines changed

docs/css/styles.css

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,36 @@ body {
286286
color: #333333;
287287
}
288288

289+
.light-mode .star-history-container {
290+
background-color: #f3f4f6;
291+
}
292+
293+
.light-mode .star-history-container h3 {
294+
color: #333333;
295+
}
296+
297+
.star-history-chart {
298+
overflow: hidden;
299+
border-radius: 8px;
300+
transition: transform 0.3s ease;
301+
max-width: 100%;
302+
}
303+
304+
.star-history-chart:hover {
305+
transform: scale(1.02);
306+
}
307+
308+
.star-history-chart img {
309+
max-width: 100%;
310+
display: block;
311+
}
312+
313+
@media (max-width: 768px) {
314+
.star-history-chart img {
315+
width: 100%;
316+
}
317+
}
318+
289319
@media (max-width: 1280px) {
290320
.main-content {
291321
padding: 1.5rem;
@@ -543,6 +573,10 @@ body {
543573
width: 40px;
544574
height: 40px;
545575
}
576+
577+
.star-history-chart img {
578+
width: 100%;
579+
}
546580
}
547581

548582
.mobile-menu-button {

docs/index.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,6 +1005,20 @@ <h3 class="text-xl font-bold mb-2 text-white">License</h3>
10051005
💛
10061006
</p>
10071007
</div>
1008+
1009+
<div class="star-history-container mb-8 p-8 bg-dark-light rounded-lg text-center transform hover:scale-[1.01] transition-transform duration-300">
1010+
<h3 class="text-xl font-bold mb-4 text-white">Star History</h3>
1011+
<div class="star-history-chart flex justify-center">
1012+
<a href="https://www.star-history.com/#Kkkermit/Testify&Date" target="_blank">
1013+
<picture>
1014+
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=Kkkermit/Testify&type=Date&theme=dark" />
1015+
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=Kkkermit/Testify&type=Date" />
1016+
<img alt="Star History Chart" class="max-w-full h-auto rounded-md" src="https://api.star-history.com/svg?repos=Kkkermit/Testify&type=Date" />
1017+
</picture>
1018+
</a>
1019+
</div>
1020+
</div>
1021+
10081022
<div
10091023
class="star-reminder p-8 bg-gradient-to-r from-primary-dark to-primary rounded-lg text-center shadow-lg transform hover:scale-[1.01] transition-transform duration-300"
10101024
>

docs/js/main.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,18 +263,33 @@ document.addEventListener("DOMContentLoaded", function () {
263263
document.documentElement.classList.add("light-mode");
264264
themeToggle.innerHTML = '<i class="fas fa-moon"></i>';
265265
localStorage.setItem("theme", "light");
266+
updateStarHistoryChart('light');
266267
} else {
267268
document.documentElement.classList.remove("light-mode");
268269
document.documentElement.classList.add("dark-mode");
269270
themeToggle.innerHTML = '<i class="fas fa-sun"></i>';
270271
localStorage.setItem("theme", "dark");
272+
updateStarHistoryChart('dark');
271273
}
272274

273275
setTimeout(() => {
274276
document.documentElement.style.transition = "";
275277
}, 500);
276278
});
277279

280+
function updateStarHistoryChart(theme) {
281+
const starHistoryImg = document.querySelector('.star-history-chart img');
282+
if (starHistoryImg) {
283+
const baseUrl = 'https://api.star-history.com/svg?repos=Kkkermit/Testify&type=Date';
284+
starHistoryImg.src = theme === 'light' ?
285+
`${baseUrl}` :
286+
`${baseUrl}&theme=dark`;
287+
}
288+
}
289+
290+
const currentTheme = localStorage.getItem('theme') || 'dark';
291+
updateStarHistoryChart(currentTheme === 'light' ? 'light' : 'dark');
292+
278293
function fetchGitHubStats() {
279294
const repoPath = "Kkkermit/Testify";
280295
const statsContainer = document.querySelector(".stats-badges");

0 commit comments

Comments
 (0)