Skip to content

Commit

Permalink
cats
Browse files Browse the repository at this point in the history
  • Loading branch information
loop-index committed Oct 17, 2023
1 parent a468930 commit 9d2ecaa
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -206,16 +206,18 @@ <h3>Long-term Interests</h3>
.then(response => response.json())
.then(data => {
for (let i = 0; i < data.length; i++){
$('.ad').eq(i).html(`
<div class="card p-0 m-0" style="width: 100%; aspect-ratio: 1/1; overflow: hidden">
<img src="https://cataas.com/cat" class="card-img-top" alt="..." style="width: 100%; height: 100%; object-fit: cover;">
<div class="overlay">
<div class="card-img-overlay d-flex flex-column justify-content-end text-light">
<h1 class="card-title">${data[i].advertiser}</h1>
<p class="card-text">${data[i].adText}</p>
fetch('https://cataas.com/cat?json=true').then(response => response.json()).then(cat => {
$('.ad').eq(i).html(`
<div class="card p-0 m-0" style="width: 100%; aspect-ratio: 1/1; overflow: hidden">
<img src="https://cataas.com/cat/${cat._id}" class="card-img-top" alt="..." style="width: 100%; height: 100%; object-fit: cover;">
<div class="overlay">
<div class="card-img-overlay d-flex flex-column justify-content-end text-light">
<h1 class="card-title">${data[i].advertiser}</h1>
<p class="card-text">${data[i].adText}</p>
</div>
</div>
</div>
</div>`);
</div>`);
});
}
});
}
Expand Down

0 comments on commit 9d2ecaa

Please sign in to comment.