Continue home and features pages

This commit is contained in:
Matthew Holt 2023-10-10 12:03:33 -06:00 committed by Francis Lavoie
parent 08076c325b
commit 5819cf9e5a
No known key found for this signature in database
GPG key ID: 0F66EE1687682239
6 changed files with 186 additions and 63 deletions

View file

@ -1,5 +1,16 @@
ready(async function() {
const resp = await fetch("/resources/testimonials.json");
const testimonials = await resp.json();
const resp = fetch("/resources/testimonials.json").then(async resp => {
const testimonials = await resp.json();
console.log(testimonials);
});
ready(function() {
for (let i = 0; i < testimonials.length; i++) {
const testimonial = testimonials[i];
const tpl = cloneTemplate('#tpl-testimonial');
$('.testimonial-picture', tpl).src = testimonial.picture || "";
$('.testimonial-quote', tpl).innerText = `"${testimonial.quote}"`;
$('.testimonial-name', tpl).innerText = testimonial.name || "";
$('.testimonial-role', tpl).innerText = testimonial.role || "";
$(`.testimonial-col:nth-child(${i%3 + 1})`).append(tpl);
}
});
});