1
0

quotes work

This commit is contained in:
devenblake 2020-12-20 22:27:26 -05:00
parent 22b6100fce
commit c177ff6cd9

View File

@ -15,7 +15,7 @@ window.initializequotes = function() {
[ "Special thanks to Ками for their help adding quotes to this page.",
"Deven Blake" ]
];
window.quote = ["", ""]
window.quote = 0;
}
window.setStyling = function(sheet) {
@ -24,12 +24,13 @@ window.setStyling = function(sheet) {
};
window.genQuote = function() {
if(window.quote != ["",""]) window.quotes.push(window.quote);
if(window.quote) window.quotes.push(window.quote);
quoteindex = Math.floor(Math.random() * window.quotes.length);
window.quote = window.quotes.splice(quoteindex, 1);
console.log("Quote set to:");
console.log(window.quote);
console.log(window.quotes);
document.getElementById('quote').textContent = '\"' + window.quote[0] + '\"';
document.getElementById('quoteauthor').textContent = '~ ' + window.quote[1];
document.getElementById('getaquote').setAttribute('value', 'Get another free quote today!');
}
};