Last active
August 29, 2015 14:27
-
-
Save akgold/d9ea2c8d853f8ee4ef0c to your computer and use it in GitHub Desktop.
Star Wars Quote Generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<head> | |
<title> Alex's Star Wars Quote Generator</title> | |
</head> | |
<body> | |
<div> | |
<h1 class = text-center>Star Wars Quotes </h1> | |
<button class = "center-block" id = "change-quote">This quote has disappointed me for the last time.</button> | |
</div> | |
<div class = "row" > | |
<div class = "center-block quote" > | |
<p class = "toShow"></p> | |
</div> | |
</div> | |
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getRandQuote() { | |
var quotes = ["Never tell me the odds!", | |
"Well, you said you wanted to be around when I made a mistake." , | |
"You do have your moments. Not many, but you have them.", | |
"I know.", | |
"Ben! I can be a Jedi. Ben, tell him I’m ready! I’m not afraid! You will be.", | |
"Now, witness the power of this fully operational battle station.", | |
"…Scoundrel. I like that.", | |
"I have a bad feeling about this.", | |
"Hmm! Adventure. Hmmpf! Excitement. A Jedi craves not these things.", | |
"Who’s the more foolish; the fool, or the fool who follows him?", | |
"That… is why you fail.", | |
"It’s worse.", | |
"That’s no moon.", | |
"Sorry about the mess.", | |
"Ready are you? What know you of ready? For eight hundred years have I trained Jedi. My own counsel will I keep on who is to be trained. A Jedi must have the deepest commitment, the most serious mind. This one, a long time have I watched. All his life has he looked away… to the future, to the horizon. Never his mind on where he was. …Hmm? On what he was doing.", | |
"If they follow standard Imperial procedure, they’ll dump their garbage before they go to light-speed. Then we just… float away…With the rest of the garbage.", | |
"Laugh it up, fuzzball!", | |
"I never doubted you! Wonderful!", | |
"You will never find a more wretched hive of scum and villainy…We must be cautious.", | |
"Would somebody get this big walking carpet out of my way?!", | |
"So what I told you was true… from a certain point of view.…A certain point of view?!", | |
"Your weapon… you will not need it.", | |
"Luke! We’re gonna have company!","…I think I just blasted it.", | |
"That’s impossible.", | |
"Search your feelings.", | |
"I’ll never join you.", | |
"He certainly has courage. Yeah, but what good is that if he gets himself killed?", | |
"…You’ve failed, your highness.I am a Jedi, as my father was before me…So be it, Jedi.", | |
"Only at the end do you realize the power of the Dark Side.", | |
"It’s not impossible. I used to bullseye womp rats in my T-16 back home, they’re not much bigger than two meters.", | |
"Awww! But I was going into Tosche Station to pick up some power converters!!!", | |
"IT’S A TRAP.", | |
"But how could they be jamming us if they don’t know… that we’re… coming?", | |
"Strike me down, and I will become more powerful than you could possibly imagine.", | |
"STAY ON TARGET."]; | |
return "“"+quotes[Math.floor(Math.random() * (quotes.length))]+"”"; | |
} | |
//jQuery to show a quote on open | |
$(document).ready($('.toShow').html(getRandQuote())); | |
//Jquery to change quote on click | |
$('#change-quote').click(function getQuote() { | |
var $toShow = $('.toShow'); | |
var newQ = getRandQuote() | |
//make sure we're not putting the same quote back up again | |
if ($toShow.html() != newQ) { | |
$toShow.html(newQ); | |
} else { | |
getQuote(); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import url(http://fonts.googleapis.com/css?family=News+Cycle:400,700); | |
h1{ | |
color: rgb(75, 213, 238); | |
font-size: 300%; | |
} | |
body{ | |
width: 100%; | |
height: 100%; | |
background: #000; | |
margin: 0; | |
font: 700 1.25em "News Cycle", sans-serif; | |
} | |
#change-quote{ | |
color: #ff6; | |
background-color: rgb(0,0,0); | |
vertical-align: center; | |
margin-top: 50px; | |
font-size: 1.5em; | |
curson: pointer; | |
} | |
.quote{ | |
margin: 50px ; | |
background: rgb(155,155,155); | |
font-size: 400% | |
} | |
p{ | |
text-align: center; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment