var text=document.getElementById("quote-text");
var author=document.getElementById("author-text");
var newquote=document.getElementById("newquote");
var button1=document.getElementsByClassName("button1");
var colors=['#16a085', '#27ae60', '#2c3e50', '#f39c12', '#e74c3c', '#9b59b6', '#FB6964', '#342224', "#472E32", "#BDBB99", "#77B1A9", "#73A857"];
"text":"真理惟一可靠的标准就是永远自相符合。",
"text":"时间是一切财富中最宝贵的财富。",
"text":"这世界要是没有爱情,它在我们心中还会有什么意义!这就如一盏没有亮光的走马灯。",
window.onload=function(){
newquote.onclick=getnewquote;
var num=randomNum(0,colors.length);
var num1=randomNum(0,json1.length);
document.body.style.backgroundColor=color;
document.body.style.color=color;
document.getElementById("quote").style.color=color;
newquote.style.backgroundColor=color;
button1[0].style.backgroundColor=color;
text.innerHTML=json1[num1].text;
author.innerHTML=json1[num1].author;
author1=json1[num1].author;
button1[0].onclick=openUrl;
var url='https://twitter.com/intent/tweet?hashtags=quotes&related=freecodecamp&text=' + encodeURIComponent('"' + text1 + '" ' + author1);
window.open(url, 'Share', 'width=550, height=400, toolbar=0, scrollbars=1 ,location=0 ,statusbar=0,menubar=0, resizable=0');
function randomNum(min,max){
return min+Math.floor(Math.random()*(max-min));