let quotes = [{
author: "Abdullah ibn Masud",
quote: ["A silent dua is seventy times better than a loud one.",
"Be people who are constantly reviving their hearts, wearing shabby garments, lights that illuminate the darkness, be unknown to those on earth yet known to the inhabitants of the heavens.",
"The believer will not attain comfort until he meets Allah",
"You are living in a time in which desires are controlled by the truth. However, there will come a time in which the truth will be molded by desires. We seek refuge with Allah from that time.",
"Do not scatter the Quran like inferior dates and do not chant it quickly as with poetry. Stop at its wonders, move the hearts with it, and let not your concern be the end of the surah.",
],
},
{
author: "Abdullah ibn Mubarak",
quote: ["You are in greater need of a little manners than a great deal of knowledge.",
"The stain of ink on clothes is the trademark of scholars.",
"Those of you who have the most knowledge, should also be those who have the most fear.",
"Sins slowly kill the heart, and abandoning sins brings life to the heart.",
"If I were to backbite anyone it would be my parents, for they are most deserving of my good deeds.",
],
},
{
author: "Abu Bakr Siddique",
quote: ["Allah bless him who helps his brother.",
"Death is the easiest of all things after it, and the hardest of all things before it.",
"Be good to others, that will protect you against evil.",
"The greatest truth is honesty, and the greatest falsehood is dishonesty.",
"Muslims should live like brothers.",
],
},
{
author: "Fakhr al-Din al-Razi",
quote: ["No greater grace can be granted by human beings to one another than that which parents grant to their offspring.",
"The greatest blessing after the bounties of the Creator is the blessing of parents.",
],
},
{
author: "Fudayl ibn Iyad",
quote: ["What Allah wants from you is your intention and will.",
"The action, if it is sincere and not correct then it is not accepted. It is only accepted when it is both sincere and correct.",
"The believer overlooks the faults of others, admonishes others, and gives good advice.",
"Admiration is part of imaan and envy is part of hypocrisy.",
"If you mix with people, then mix with good character for it only invites to good. Do not mix with bad character, for it only invites to evil.",
],
},
{
author: "Ibn Al-Jawzi",
quote: ["Whoever lacks patience and allows his desires (hawa) to lead his mind has then made the follower be followed and the led a leader.",
"This world is a bridge and a bridge should not be taken as a home",
"Know that if people are impressed with you, in reality they are impressed with the beauty of Allah's covering of your sins.",
"If you find a darkness in your heart after you sinned, know that in your heart there is a light, because of this light you felt the darkness.",
"We seek refuge with Allah from starting any action without basing it on knowledge and reason.",
],
},
];
const grabQuote = function(){
for(let authorQuotes of quotes){
getRandomAuthorQuote = Math.floor(Math.random() * quotes.length);
selectRandomAuthor = quotes[getRandomAuthorQuote].author;
selectRandomQuote = quotes[getRandomAuthorQuote].quote;
for (let quote of selectRandomQuote){
return `${quote} ...${selectRandomAuthor}`
}
}
}
let showQuote = document.querySelector(".quote");
showQuote.textContent = grabQuote();
let quoteButton = document.querySelector("button")
quoteButton.addEventListener("click", function(){
showQuote.innerHTML = grabQuote();
})