-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
72 lines (63 loc) · 2.84 KB
/
Copy pathscript.js
File metadata and controls
72 lines (63 loc) · 2.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
var colors = [
'#490A3D',
'#BD1550',
'#E97F02',
'#F8CA00',
'#8A9B0F',
'#69D2E7',
'#FA6900',
'#16a085',
'#27ae60',
'#2c3e50',
'#f39c12',
'#e74c3c',
'#9b59b6',
'#FB6964',
'#342224',
'#472E32',
'#77B1A9',
'#73A857'
];
var quotes = [
["You only live once, but if you do it right, once is enough.","Mae West"],
["I am so clever that sometimes I don't understand a single word of what I am saying.","Oscar Wilde"],
["Two things are infinite: the universe and human stupidity; and I'm not sure about the universe.","Albert Einstein"],
["The most beautiful experience we can have is the mysterious. It is the fundamental emotion that stands at the cradle of true art and true science.","Albert Einstein"]
["It is our choices, Harry, that show what we truly are, far more than our abilities.","J.K. Rowling, Harry Potter and the Chamber of Secrets"],
["All men who have turned out worth anything have had the chief hand in their own education.","Walter Scott"],
["Trust yourself. You know more than you think you do.","Benjamin Spock"],
["No one can make you feel inferior without your consent.","Eleanor Roosevelt, This is My Story"],
["To be yourself in a world that is constantly trying to make you something else is the greatest accomplishment.","Ralph Waldo Emerson"],
["Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did do. So throw off the bowlines. Sail away from the safe harbor. Catch the trade winds in your sails. Explore. Dream. Discover.","H. Jackson Brown Jr., P.S. I Love You"]
];
var currentQuote = "";
var currentAuthor = "";
var randomquote = "";
var randomcolor = "";
function getQuote(){
randomquote =Math.floor(Math.random() * quotes.length);
randomcolor =Math.floor(Math.random() * colors.length);
currentQuote = quotes[randomquote][0];
currentAuthor =quotes[randomquote][1];
$(document).ready(function () {
$('html body').animate({
backgroundColor: colors[randomcolor],
color: colors[randomcolor]
}, 500);
$('#newquote, .social-icons .fa-twitter').animate({ backgroundColor: colors[randomcolor] }, 500);
$('blockquote footer').animate({ color: colors[randomcolor] }, 500);
$('blockquote').animate({ borderLeftColor: colors[randomcolor] }, 500);
$('#quotetext').animate({ opacity: 0 }, 500, function () {
$(this).animate({ opacity: 1 }, 500);
$(this).text(currentQuote);
});
$('#quotesource').animate({ opacity: 0 }, 500, function () {
$(this).animate({ opacity: 1 }, 500);
$(this).text(currentAuthor);
});
});
}
getQuote();
$(document).ready(function(){
$('#newquote').on('click', getQuote);
})