forked from BeehiveCommunity/Frontend_Mentor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
98 lines (92 loc) · 1.63 KB
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
"use strict";
const projects = [
{
name: "01-Community-Card",
},
{
name: "02-qr-code-component",
},
{
name: "03-social-proof",
},
{
name: "04-nft-project",
},
{
name: "05-intractive-rating",
},
{
name: "06-product-preview",
},
{
name: "07-fylo-two-column-layout",
},
{
name: "08-profile-card",
},
{
name: "09-clipboard-landing-page",
},
{
name: "10-three-column-card",
},
{
name: "11-Order-summery-component",
},
{
name: "12-Huddle-comm-page",
},
{
name: "13-stat-preview-card",
},
{
name: "14-Huddle-landing-page",
},
{
name: "15-Article-Preview",
},
{
name: "16-base-apparel-coming-soon",
},
{
name: "17-advice-generator-app",
},
{
name: "18-chat-app-css-illustration",
},
{
name: "19-news-homepage",
},
{
name: "20-testimonials-grid-section",
},
{
name: "21-ecommerce-product-page",
},
{
name: "23-Weather-App",
},
];
const list = document.getElementById("list");
projects.forEach(({ name }, i) => {
const listItem = document.createElement("li");
listItem.innerHTML = `
<a href="./${name}/index.html" target="_blank">
<img src="./${name}/design/desktop-design.jpg" alt="${name}" />
<p>${i + 1}. ${formatProjectName(name)}</p>
</a>
<div class="links-container" target="_blank">
<a href="./${name}/index.html" class="blue">
<i class="fas fa-eye"></i>
</a>
</div>
`;
list.appendChild(listItem);
});
function formatProjectName(name) {
return name
.split("-")
.splice(1)
.map((word) => word[0].toUpperCase() + word.slice(1))
.join(" ");
}