jsquotes/public/js/layout.js

24 lines
686 B
JavaScript
Raw Normal View History

2023-01-22 09:37:03 -06:00
'use strict';
// Full year for footer
const todayDate = new Date();
jsyear.innerText = todayDate.getFullYear();
const quoteDisplay = document.querySelector(".quotes");
const debugDisplay = document.querySelector(".debug");
let i = 0;
let quote_section = "";
2023-04-09 19:04:24 -05:00
fetch("https://cdn.fyrfli.link/FavouriteQuotes.json")
2023-01-22 09:37:03 -06:00
.then((response) => {
return response.json();
})
.then((data) => {
while (i < Object.entries(data).length) {
quote_section = document.createElement("section")
quote_section.className = "quote";
quote_section.innerText = "\"" + data[i].quote + "\"\n\n" + data[i].author;
quoteDisplay.appendChild(quote_section);
i++;
}
});