Skip to content

Commit 3f8c057

Browse files
committed
Update home, filter repos section
1 parent 6156448 commit 3f8c057

File tree

4 files changed

+45
-18
lines changed

4 files changed

+45
-18
lines changed

index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
<!-- Header -->
5656
<header class="w-full flex justify-between items-center p-6 flex-shrink-0">
5757
<div class="w-full text-center">
58-
<h1 class="text-3xl font-bold inline">Dev2Forge</h1>
58+
<h1 class="text-3xl font-bold inline"><a href="https://github.com/dev2forge" target="_blank" class="no-decoration underline">Dev2Forge</a></h1>
5959
<sub class="text-sm inline"><small>org</small></sub>
6060
</div>
6161
<!-- Feature: Add "Toggle Theme" -->
@@ -64,6 +64,7 @@ <h1 class="text-3xl font-bold inline">Dev2Forge</h1>
6464
<!-- Main Content -->
6565
<main class="flex-1 flex flex-col items-center w-full px-6 pb-12">
6666
<!-- Description page -->
67+
<!-- Feature: Load README.md from repo -->
6768
<section id="description" class="my-4"></section>
6869

6970
<!-- Repos -->

src/assets/css/index.css

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,28 @@
1515
.btn-repo-link {
1616
width: 100%;
1717
max-width: 100%;
18-
background-color: #00081f98;
19-
border-radius: 20px;
18+
background-color: #e0e7ff;
19+
border-radius: 9999px;
2020
padding: 5px 10px;
21-
color: #003cff;
21+
color: #2563eb;
2222
text-decoration: none;
23-
box-shadow: 10px 4px 8px rgba(0, 0, 0, 0.733);
24-
transition: all 0.3s linear;
25-
display: inline-block;
26-
text-align: center;
23+
box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
24+
border: 1.5px solid #93c5fd;
25+
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
26+
display: flex;
27+
align-items: center;
28+
justify-content: center;
2729
}
2830
.btn-repo-link:hover {
29-
background-color: #00081f;
31+
background-color: #2563eb;
3032
color: #fff;
31-
padding: 5px 40px;
32-
transition: all 0.3s linear;
33-
box-shadow: 20px 4px 8px rgba(0, 0, 0, 0.2);
33+
box-shadow: 0 4px 16px rgba(37, 99, 235, 0.18);
34+
transform: scale(1.12);
35+
}
36+
.btn-repo-link img {
37+
filter: none;
38+
transition: filter 0.2s;
39+
}
40+
.btn-repo-link:hover img {
41+
filter: brightness(0) invert(1);
3442
}

src/assets/js/main.js

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,31 @@ async function loadDescription() {
1717
*/
1818
async function loadRepos() {
1919
const container = document.querySelector('#carrusel-repos');
20+
const configsWeb = await loadConfigs();
2021
try {
2122
const res = await fetch('https://api.github.com/orgs/dev2forge/repos');
2223
const repos = await res.json();
2324
repos.forEach((repo) => {
24-
const card = document.createElement('div');
25-
card.className = 'flex flex-col justify-between items-center w-64 h-64 bg-gray-100 dark:bg-gray-800 p-4 rounded shadow hover:shadow-lg transition snap-start row-span-1';
26-
card.innerHTML = `
25+
// Skip repositories that are not in the configsWeb list
26+
if (!configsWeb.ignoreRepos.includes(repo.name)) {
27+
const card = document.createElement('div');
28+
card.className = 'flex flex-col justify-between items-center w-64 h-64 bg-gray-100 dark:bg-gray-800 p-4 rounded shadow hover:shadow-lg transition snap-start row-span-1';
29+
card.innerHTML = `
2730
<h2 class="text-xl font-semibold text-center w-full mb-2">${repo.name}</h2>
2831
<div class="flex-1 w-full overflow-y-auto mb-2 no-scrollbar">
2932
<p class="text-sm text-gray-600 dark:text-gray-300 text-center break-words">${repo.description || 'No description'}</p>
3033
</div>
31-
<div class="w-full flex justify-center mt-auto">
32-
<a href="${repo.html_url}" target="_blank" class="btn-repo-link inline-block text-center w-full">View Repo</a>
34+
<div class="w-full flex justify-center mt-auto gap-3">
35+
<a href="${repo.html_url}" target="_blank" class="btn-repo-link flex items-center justify-center w-12 h-12 rounded-full bg-blue-100 dark:bg-blue-900 shadow hover:scale-110 hover:bg-blue-500 hover:text-white transition border border-blue-300 dark:border-blue-700 mr-0.5">
36+
<img width="24" height="24" src="https://cdn.jsdelivr.net/gh/tutosrive/images-projects-srm-trg@refs/heads/main/svg-icons-flags-cursor/icon/github-logo.svg" alt="GitHub">
37+
</a>
38+
<a href="${repo.homepage}" target="_blank" class="btn-repo-link flex items-center justify-center w-12 h-12 rounded-full bg-blue-100 dark:bg-blue-900 shadow hover:scale-110 hover:bg-blue-500 hover:text-white transition border border-blue-300 dark:border-blue-700 ml-0.5">
39+
<img width="16" height="16" src="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/icons/box-arrow-up-right.svg" alt="Icon redirect">
40+
</a>
3341
</div>
3442
`;
35-
container.appendChild(card);
43+
container.appendChild(card);
44+
}
3645
});
3746
} catch (e) {
3847
container.innerHTML = '<p class="text-red-500">Failed to load repositories.</p>';
@@ -57,3 +66,9 @@ async function loadFollowers() {
5766
container.appendChild(img);
5867
});
5968
}
69+
70+
async function loadConfigs() {
71+
const req = await fetch('src/assets/json/configs.json');
72+
const data = await req.json();
73+
return data;
74+
}

src/assets/json/configs.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"ignoreRepos": ["discussions-about", "dev2forge.github.io", ".github", "docs"]
3+
}

0 commit comments

Comments
 (0)