Repository navigation
Expand file tree
/
Copy pathscript.js
More file actions
88 lines (80 loc) · 2.7 KB
/
Copy pathscript.js
File metadata and controls
88 lines (80 loc) · 2.7 KB
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
const projects = [
{
title: "Guess the Number Game",
description:
"Guess the Number Game is a web-based project where players try to guess a random number.",
link: "./Guess the number game/index.html",
image: "./images/Number-Guessing-Game-01.png",
},
{
title: "Model_Boxs",
description:
"Model_Boxs is a web project focused on modeling boxes in a 3D space.",
link: "./Model_Boxs/index.html",
image: "./images/2459100_87b1_6.png",
},
{
title: "Pig-Game",
description:
"Pig-Game is a web-based game where players roll dice to score points and avoid rolling a '1'.",
link: "./Pig-Game/index.html",
image: "./images/261966753-14ee9bbd-716e-49a8-bb85-b52b82dd685e.png",
},
{
title: "Weather Application",
description:
"Weather Application is a web app that provides users with real-time weather information for a specified location.",
link: "./weather application/index.html",
image: "./images/maxresdefault.png",
},
{
title: "BMI Calculation",
description:
"BMI Calculation is another web-based project that helps users calculate their Body Mass Index.",
link: "./BMI calculation/index.html",
image: "./images/bmi-calc-01.png",
},
{
title: "Password Generator",
description:
"password generator with customizable length and character options, password strength indicator, and copy-to-clipboard functionality.",
link: "./Password Generator Project/index.html",
image: "./images/password_generator.jpg",
},
];
// You can access the projects array to display the project details on your website.
const cards = document.getElementsByClassName("cards");
function createCard(title, description, link, image) {
const li = document.createElement("li");
li.classList.add("cards__item");
const div1 = document.createElement("div");
div1.classList.add("card");
img = document.createElement("img");
img.classList.add("card__image");
img.src = image;
const div0 = document.createElement("div");
div0.classList.add("card__content");
const div = document.createElement("div");
div.classList.add("card__title");
div.innerHTML = title;
div0.appendChild(div);
const p = document.createElement("p");
p.classList.add("card__text");
p.innerHTML = description;
div0.appendChild(p);
const a = document.createElement("a");
a.classList.add("card__btn");
a.classList.add("btn--block");
a.classList.add("btn");
a.href = link;
a.target = "_blank";
a.innerHTML = "DEMO";
div0.appendChild(a);
div1.appendChild(img);
div1.appendChild(div0);
li.appendChild(div1);
cards[0].appendChild(li);
}
projects.map((e) => {
createCard(e.title, e.description, e.link, e.image);
});