-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
51 lines (45 loc) · 1.7 KB
/
index.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
let home = (function () {
pub = {};
makeHTML = (name, title, bio, img) => {
let css_class = img.split("\\").pop().split("/").pop().split(".")[0];
console.log(css_class)
return `
<div role="listitem" class="blog-thumbnail w-dyn-item w-col w-col-4">
<a href="#" data-w-id="46150442-4efa-9d36-3a4c-20d527e7a6bc" class="thumbnail-wrapper w-inline-block">
<div class="image-wrapper">
<div style="-webkit-transform:translate3d(0, 0, 0) scale3d(1, 1, 1) rotateX(0) rotateY(0) rotateZ(0) skew(0, 0);-moz-transform:translate3d(0, 0, 0) scale3d(1, 1, 1) rotateX(0) rotateY(0) rotateZ(0) skew(0, 0);-ms-transform:translate3d(0, 0, 0) scale3d(1, 1, 1) rotateX(0) rotateY(0) rotateZ(0) skew(0, 0);transform:translate3d(0, 0, 0) scale3d(1, 1, 1) rotateX(0) rotateY(0) rotateZ(0) skew(0, 0)" class="thumbnail-image ${css_class}"></div>
</div>
<div class="thumbnail-text">
<div class="blog-title"></div>
<div class="preview-text" style="overflow-y: auto">${bio}</div>
</div>
<div class="thumb-details w-clearfix">
<div class="author-title">${name}</div>
</div>
</a>
</div>
`;
};
pub.setup = () => {
$.ajax({
type: "GET",
url: "leaders.json",
data: {
get_param: "value",
},
dataType: "json",
async: false,
success: function (data) {
let leaderSection = $("#leader-section");
data.forEach((lead) => {
// console.log(lead);
leaderSection.append(
makeHTML(lead.name, lead.title, lead.bio, lead.img)
);
});
},
});
};
return pub;
})();
$(document).ready(home.setup);