-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMasai-Investors-Using-DOM.html
137 lines (133 loc) · 4.01 KB
/
Masai-Investors-Using-DOM.html
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Masai Investors</title>
<style>
#container {
border: 1px solid black;
width: 100%;
margin: auto;
text-align: center;
font-family: Arial, sans-serif;
}
#investors {
width: 90%;
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 1rem;
row-gap: 2rem;
margin: 34px auto 5rem auto;
justify-items: center;
align-items: stretch;
min-width: 1280px;
}
h1 {
font-size: 34px;
font-weight: 700;
margin: 30px 0;
}
.investor {
max-width: 100%;
box-shadow: 0px 4px 6px -1px rgba(0, 0, 0, 0.1),
0px 2px 4px -1px rgba(0, 0, 0, 0.06);
text-align: center;
border-radius: 8px;
overflow: hidden;
margin: auto;
width: 252.25px;
height: 372.25px;
}
.investor > img:first-child {
border-top: 8px solid rgb(192, 192, 192);
max-width: 100%;
display: block;
margin-bottom: -60px;
}
.investor > p:nth-child(2) {
color: rgb(10, 1, 3);
font-weight: 700;
padding-top: 5rem;
padding-left: 5px;
padding-right: 5px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin: 0;
}
.investor > p:nth-child(3) {
color: rgb(84, 77, 79);
font-weight: 400;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
padding-left: 5px;
padding-right: 5px;
margin: 0;
}
.investor > img:last-child {
max-height: 48px;
margin: auto;
max-width: 100%;
display: block;
}
</style>
</head>
<body></body>
<script>
let data = [
{
investorImg:
"https://masai-website-images.s3.ap-south-1.amazonaws.com/Vijay_Shekhar_Sharma_Paytm_96f52579b8.jpg",
investorName: "Vijay Shekhar Sharma",
investorRole: "Founder & CEO",
investorCompanyImg:
"https://masai-website-images.s3.ap-south-1.amazonaws.com/paytm_rect_06df45a24f.svg",
},
{
investorImg:
"https://masai-website-images.s3.ap-south-1.amazonaws.com/Rectangle_427_637d69bb57.png",
investorName: "Kunal Shah",
investorRole: "Founder",
investorCompanyImg:
"https://masai-website-images.s3.ap-south-1.amazonaws.com/cred_0a47d7b4f8.png",
},
{
investorImg:
"https://masai-website-images.s3.ap-south-1.amazonaws.com/amrish_rau_pine_labs_144e5e587c.jpg",
investorName: "Amrish Rau",
investorRole: "CEO",
investorCompanyImg:
"https://masai-website-images.s3.ap-south-1.amazonaws.com/pine_labs_0aa2407434.png",
},
{
investorImg:
"https://masai-website-images.s3.ap-south-1.amazonaws.com/Sampad_swain_Instamojo_f12bf6341e.jpg",
investorName: "Sampad Swain",
investorRole: "Co-Founder & CEO",
investorCompanyImg:
"https://masai-website-images.s3.ap-south-1.amazonaws.com/instamojo_8763e704f7.png",
},
];
let body = document.querySelector("body");
let container = document.createElement("div");
container.setAttribute("id", "container");
let heading = document.createElement("h1");
heading.innerHTML = "Masai Investors";
let investors = document.createElement("div");
investors.setAttribute("id", "investors");
data.map((el) => {
return (investors.innerHTML += `
<div class="investor">
<img src=${el.investorImg} alt=${el.investorName} />
<p>${el.investorName}</p>
<p>${el.investorRole}</p>
<img src=${el.investorCompanyImg} alt="company" />
</div>
`);
});
container.append(heading, investors);
body.append(container);
</script>
</html>