-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSCRIPT
28 lines (22 loc) · 1.06 KB
/
SCRIPT
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
$(document).ready(function(){
var randomQuote;
var randomNum;
var author;
getQuote();
function getQuote(){
//
var quotes = ["Thank You Mario, but our princess is in another castle!", "May the way of the hero lead to the Triforce", "It's dangerous to go alone! Take this", "I used to be an adventurer like you, but then I took an arrow in the knee", "Nothing is true, everything is permitted", "The cake is a lie", "Your are not prepared!"];
var author = ["-Super Mario Bros", "-The Legend Of Zelda: Link to the Past", "-The Legend Of Zelda", "-The Elder Scrolls V: Skyrim", "-Assassin's Creed", "-Portal", "-World Of Warcraft"];
randomNum = Math.floor((Math.random()*quotes.length));
randomQuote = quotes[randomNum];
author = author[randomNum];
$(".quote").text(randomQuote);
$(".author").text(author);
}
$('#tweet').on("click", function(){
window.open("https://twitter.com/intent/tweet?text="+randomQuote + " " + author );
});
$("#newQuote").on("click", function(){
getQuote();
});
});