Skip to content

Commit 85938fc

Browse files
fetch project data and display in index.html[DOM] file.
1 parent f3a5a68 commit 85938fc

File tree

3 files changed

+26
-22
lines changed

3 files changed

+26
-22
lines changed

assets/css/index.css

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,30 +131,33 @@ h2.cat-title {
131131
/* project item */
132132
.project-item {
133133
width: 285px;
134-
height: 500px;
134+
height: 400px;
135135
overflow: hidden;
136136
border: 1px solid #efefef;
137+
background: #faf9f9;
138+
border-radius: 5px;
137139
}
138140
.project-item img {
139141
width: 100%;
140142
object-fit: cover;
141143
}
142144
.project-info {
143-
padding: 10px;
145+
padding: 14px;
144146
}
145147
.project-info .lang {
146-
font-weight: 300;
147-
font-size: 0.8rem;
148+
font-weight: 400;
149+
font-size: 0.7rem;
150+
word-spacing: 8px;
148151
color: #2200ff;
149152
}
150153
.project-info h3.project-name {
151154
font-weight: 500;
152-
font-size: 1.7rem;
155+
font-size: 1.4rem;
153156
padding: 5px 0;
154157
}
155158
.project-info p.description {
156159
font-weight: 300;
157-
font-size: 1rem;
160+
font-size: 0.9rem;
158161
color: #131212;
159162
line-height: 22px;
160163
margin-bottom: 10px;
@@ -185,7 +188,7 @@ footer {
185188
width: 100%;
186189
text-align: center;
187190
color: #000;
188-
padding: 0.8rem;
191+
padding: 7rem 0 3rem;
189192
display: flex;
190193
justify-content: center;
191194
align-items: center;

assets/js/index.js

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,27 +34,19 @@ fetch("./api.json")
3434
// };
3535

3636
const updateUI = (projects) => {
37-
projects.map((project) => {
37+
projects.map(({ id, name, description, language }) => {
3838
const projectItem = document.createElement("div");
3939
projectItem.className = "project-item";
4040
console.log(projectItem);
4141
projectItem.innerHTML = `
4242
<img src="./assets/screen/thumbnail.png" alt="" />
4343
<div class="project-info">
44-
<div class="lang">html, css, JavaScript</div>
45-
<h3 class="project-name">Personal Blog</h3>
44+
<div class="lang">${language}</div>
45+
<h3 class="project-name">${name}</h3>
4646
<p class="description">
47-
Create a personal blog platform where users
48-
can share their thoughts and experiences.
47+
${description}
4948
</p>
50-
<div class="project-features">
51-
<h4 class="features-title">Features:</h4>
52-
<ul>
53-
<li>Blog post creation</li>
54-
<li>User authentication</li>
55-
<li>Comment section</li>
56-
</ul>
57-
</div>
49+
5850
</div>
5951
`;
6052
projectsItems.appendChild(projectItem);
@@ -78,10 +70,10 @@ function Circle(t, e, i, n, s) {
7870
(this.draw = function () {
7971
context.beginPath(),
8072
context.arc(this.x, this.y, this.radius, 2 * Math.PI, !1),
81-
(context.strokeStyle = "rgba(255,251,0, 0.1)"),
73+
(context.strokeStyle = "rgba(255,255,255, 0.1)"),
8274
context.stroke(),
8375
context.fill(),
84-
(context.fillStyle = "rgba(201, 170, 28, .600)");
76+
(context.fillStyle = "rgba(0,0,0,0.05)");
8577
}),
8678
(this.update = function () {
8779
(this.x + this.radius > innerWidth || this.x - this.radius < 0) &&

index.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,12 @@ <h2 class="cat-title">Web Development</h2>
5757
<script src="./assets/js/index.js"></script>
5858
</body>
5959
</html>
60+
61+
<!-- <div class="project-features">
62+
<h4 class="features-title">Features:</h4>
63+
<ul>
64+
<li>Blog post creation</li>
65+
<li>User authentication</li>
66+
<li>Comment section</li>
67+
</ul>
68+
</div> -->

0 commit comments

Comments
 (0)