Skip to content

Commit 008655f

Browse files
update...
1 parent b9da63d commit 008655f

File tree

3 files changed

+26
-95
lines changed

3 files changed

+26
-95
lines changed

assets/css/index.css

Lines changed: 6 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -137,43 +137,13 @@ h2.cat-title {
137137
background: #faf9f9;
138138
border-radius: 5px;
139139
}
140-
.project-item img {
141-
width: 100%;
142-
object-fit: cover;
143-
}
144-
.project-info {
145-
padding: 14px;
146-
}
147-
.project-info .lang {
148-
font-weight: 400;
149-
font-size: 0.7rem;
150-
word-spacing: 8px;
151-
color: #2200ff;
152-
}
153-
.project-info h3.project-name {
154-
font-weight: 500;
155-
font-size: 1.4rem;
156-
padding: 5px 0;
157-
}
158-
.project-info p.description {
159-
font-weight: 300;
160-
font-size: 0.9rem;
161-
color: #131212;
162-
line-height: 22px;
163-
margin-bottom: 10px;
164-
}
165-
.project-info .project-features {
166-
margin-top: 10px;
167-
}
168-
.project-info .project-features .features-title {
169-
margin-bottom: 5px;
170-
font-weight: 400;
140+
.projects-list {
141+
list-style: none;
171142
}
172-
.project-info .project-features ul li {
173-
font-weight: 300;
174-
font-size: 0.9rem;
175-
line-height: 22px;
176-
margin-left: 20px;
143+
.projects-list li {
144+
padding: 5px;
145+
display: flex;
146+
gap: 40px;
177147
}
178148
/* hover */
179149
ul.list li .project-name:hover,

assets/js/index.js

Lines changed: 19 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use strict";
2-
// const projectsItems = document.querySelector(".projects-items");
3-
const projectsItems = document.getElementById("projects-items");
2+
const list = document.querySelector(".projects-list");
3+
// const projectsItems = document.getElementById("projects-items");
44
const canvas = document.getElementById("pradip-canvas"),
55
context = canvas.getContext("2d");
66
const ancherEl = document.querySelectorAll("a");
@@ -10,63 +10,29 @@ window.onload = function () {
1010
console.log("Loaded");
1111
};
1212

13-
fetch("./api.json")
13+
fetch("./projects.json")
1414
.then((res) => res.json())
1515
.then((data) => updateUI(data));
1616

1717
// UpdateUI
18-
// const updateUI = (projects) => {
19-
// projects.map(({ name, code, index }) => {
20-
// const itemList = document.createElement("li");
21-
// itemList.innerHTML = `
22-
// <span class="project-number">${index}</span>
23-
// <span class="project-name">
24-
// <a href="/${index}-${name}/index.html" target="_blank" >
25-
// ${projectNameFormatter(name)}
26-
// </a>
27-
// </span>
28-
// <a href="${code}" target="_blank" class="code-link">
29-
// ${"{"} code ${"}"}
30-
// </a>
31-
// `;
32-
// list.appendChild(itemList);
33-
// });
34-
// };
35-
3618
const updateUI = (projects) => {
37-
projects.map(
38-
({
39-
id,
40-
name,
41-
category,
42-
features,
43-
problem_solve,
44-
description,
45-
tag,
46-
language,
47-
cover_img,
48-
code_link,
49-
}) => {
50-
const projectItem = document.createElement("div");
51-
projectItem.className = "project-item";
52-
console.log(projectItem);
53-
projectItem.innerHTML = `
54-
<img src="./assets/screen/thumbnail.png" alt="" />
55-
<div class="project-info">
56-
<div class="lang">${language}</div>
57-
<a href=${code_link} >
58-
<h3 class="project-name">${name}</h3>
59-
</a>
60-
<p class="description">
61-
${description}
62-
</p>
63-
64-
</div>
65-
`;
66-
projectsItems.appendChild(projectItem);
67-
}
68-
);
19+
projects.map(({ name, code, index }) => {
20+
const itemList = document.createElement("li");
21+
itemList.innerHTML = `
22+
<span class="project-number">${index}</span>
23+
<span class="project-name">
24+
<a href="/${index}-${name}/index.html" target="_blank" >
25+
${projectNameFormatter(name)}
26+
</a>
27+
</span>
28+
<a href="${code}" target="_blank" class="code-link">
29+
${"{"} code ${"}"}
30+
</a>
31+
`;
32+
list.appendChild(itemList);
33+
});
6934
};
35+
7036
// Project Name Formatter
7137
const projectNameFormatter = (name) => {
7238
return name

index.html

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,7 @@
3030
</nav>
3131
</header>
3232
<!-- Project Lists -->
33-
<main id="container">
34-
<section class="webdev">
35-
<h2 class="cat-title">Web Development</h2>
36-
<div class="projects-items" id="projects-items"></div>
37-
</section>
38-
</main>
33+
<main id="container" class="projects-list"></main>
3934
<!-- Footer -->
4035
<footer>
4136
<object

0 commit comments

Comments
 (0)