Skip to content

Commit 4ba3282

Browse files
authored
Merge pull request #11 from Dev2Forge/develop
Update layout, better repos card
2 parents 6ae41bc + c9d7694 commit 4ba3282

3 files changed

Lines changed: 28 additions & 4 deletions

File tree

docs/assets/js/index.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ async function loadRepos() {
3333
// Skip repositories that are not in the configsWeb list
3434
if (!configsWeb.ignoreRepos.includes(repo.name)) {
3535
const card = document.createElement('div');
36-
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';
36+
card.className = 'flex flex-col justify-between items-center w-64 h-95 bg-gray-100 dark:bg-gray-800 p-4 rounded shadow hover:shadow-lg transition snap-start row-span-1';
3737
card.innerHTML = `
3838
<h2 class="text-xl font-semibold text-center w-full mb-2">${repo.name}</h2>
3939
<div class="flex-1 w-full overflow-y-auto mb-2 no-scrollbar">
@@ -47,15 +47,31 @@ async function loadRepos() {
4747
<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">
4848
</a>
4949
</div>
50+
<div class="w-full flex justify-center pt-4">
51+
<img alt="Pepy Total Downloads" src="https://img.shields.io/pepy/dt/${fix_name(repo.name)}?color=blue&style=flat-square" class="h-5 object-contain me-1">
52+
<img alt="PyPI - Version" src="https://img.shields.io/pypi/v/${fix_name(repo.name)}?color=orange" class="h-5 object-contain">
53+
</div>
54+
<div class="w-full flex justify-center">
55+
<img width="100" src="${configsWeb.logos[repo.name.toLowerCase()]}" alt="${repo.name} logo" class="object-cover rounded mt-2">
56+
</div>
57+
<div class="w-full flex justify-center mt-2">
58+
<code class="text-sm">pip install ${fix_name(repo.name)}</code>
59+
</div>
5060
`;
61+
5162
container.appendChild(card);
5263
}
5364
});
5465
} catch (e) {
66+
console.log(e);
5567
container.innerHTML = '<p class="text-red-500">Failed to load repositories.</p>';
5668
}
5769
}
5870

71+
function fix_name(name) {
72+
return name === 'E-SRM' ? 'effect-srm' : name;
73+
}
74+
5975
async function loadConfigs() {
6076
const req = await fetch('./assets/json/configs.json');
6177
const data = await req.json();

docs/assets/json/configs.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
{
2-
"ignoreRepos": ["discussions-about", "dev2forge.github.io", ".github", "docs"],
3-
"thumbnail1": "https://cdn.jsdelivr.net/gh/tutosrive/images-projects-srm-trg@main/dev2forge/thumbanil-dev2forge1.webp"
2+
"ignoreRepos": ["discussions-about", "dev2forge.github.io", ".github", "docs"],
3+
"thumbnail1": "https://cdn.jsdelivr.net/gh/tutosrive/images-projects-srm-trg@main/dev2forge/thumbanil-dev2forge1.webp",
4+
"logos": {
5+
"bridgex": "https://cdn.jsdelivr.net/gh/tutosrive/images-projects-srm-trg@main/dev2forge/logos/bridgex-v0.1.0.webp",
6+
"sqlazo": "https://cdn.jsdelivr.net/gh/tutosrive/images-projects-srm-trg@main/dev2forge/logos/sqlazo-v0.2.0.webp",
7+
"pdf2wordx": "https://cdn.jsdelivr.net/gh/tutosrive/images-projects-srm-trg@main/dev2forge/logos/pdf2wordx-v2.1.2.svg",
8+
"e-srm": "https://cdn.jsdelivr.net/gh/tutosrive/images-projects-srm-trg@main/dev2forge/logos/e-srm-v0.1.0.webp",
9+
"chromologger": "https://cdn.jsdelivr.net/gh/tutosrive/images-projects-srm-trg@main/dev2forge/logos/chromologger-v0.1.9.webp",
10+
"chromolog": "https://cdn.jsdelivr.net/gh/tutosrive/images-projects-srm-trg@main/dev2forge/logos/chromolog-v0.2.5.webp"
11+
}
412
}

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ <h1 class="text-3xl font-bold inline" id="title-head"></h1>
7777
<!-- Main Content -->
7878
<main class="flex-1 flex flex-col items-center w-full px-6 pb-12">
7979
<!-- Repos -->
80-
<section id="carrusel-repos" class="h-full grid grid-rows-1 auto-cols-max grid-flow-col gap-4 overflow-x-auto overflow-y-hidden snap-x snap-mandatory w-full py-4">
80+
<section id="carrusel-repos" class="h-100 grid grid-rows-1 grid-flow-col gap-4 overflow-x-auto snap-x snap-mandatory w-full py-4">
8181
<!-- Repos will be injected here -->
8282
</section>
8383

0 commit comments

Comments
 (0)