-
Notifications
You must be signed in to change notification settings - Fork 1
/
medium.js
26 lines (23 loc) · 991 Bytes
/
medium.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
var cards=document.querySelector(".cards");
var tops=document.querySelector(".top");
fetch("./ribbon.json")
.then(function(response){
return response.json();
})
.then(function(data2){
console.log('ji');
tops.classList.add("anirudh");
tops.innerHTML=tops.innerHTML+'<a href='+data2[0].href+' class="link">'+data2[0].para+'</a>';
})
fetch("./mediumdata.json")
.then(function(resp){
return resp.json()
})
.then(function(data){
console.log(data);
for(var i=0;i<data.length;i++)
{
var item=data[i];
cards.innerHTML=cards.innerHTML+'<div class="card"><a class="main_a" href='+item.href+'><div class="one"><img src='+item.src+' alt="base_img"><div class="image_overlay image_overlay_blur"><div class="overlay_title"><p class="image_description">'+item.img_desc+'</p></div></div></div></a><div class="two"><p class="main_para">'+item.main_para+'</p></div></div>';
}
})