Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div class="container">
	<header>
		<img class="icon" src="http://simpleicon.com/wp-content/uploads/roll-film.svg"/>
	<h1>Random Quote Machine! :D</h1>
	</header>
	
	<div class="quote">
		<p id="tweet">Click the 'New Quote' button below to see a random quote from a movie</p>
	
		<div class="border"></div>
		
		<div class="btncontainer">
		<button class="btn">New Quote ></button>
		</div>
		
		<a class="twitter-share-button" href="https://twitter.com/share" target="_blank">
      <button type="button" class="twitter-btn">Tweet this!</button>
    </a>
		
		
		</div>
	
		<footer>
		Designed and Developed by Aimee Tacchi
	</footer>
</div>
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css?family=Anton|Kalam:400,700');

html,body {
	color: #FC85AE;
	font-size: 16px;
	line-height: 1.5;
	background: black url('https://i.ytimg.com/vi/2LoaD6tTB08/maxresdefault.jpg') no-repeat center;
	background-size: cover;
	height: 100%;
}

h1 {
	color: #000;
	margin: .3em;
	text-align: center;
	font-family: 'Anton', sans-serif;
}

p {
	margin: 0.5em 0;
}

.container {
	margin: 25vh auto;
	width: 95%;
	
	@media screen and (min-width: 760px) {
		width: 60%;	
	}
}

header {
	display: flex;
	justify-content: center;
	align-items: center;
	background-color: #eee;
	margin-bottom: 20px;
}
.icon {
	width: 50px;
	height: 50px;
	padding: 0 .5em;
}

.quote {
	border:10px dashed white;
	background-color: #303A52;
	padding: 1em .8em ;
	text-align: center;
	font-size: 2em;
	font-family: 'Kalam', cursive;
}

.border {
	width: 30%;
	height: 15px;
	background-color: white;
	margin: 0 auto;
}

.opacityOff {
	opacity: 0;
	transition: all .2s ease-in;
}

.opacity {
	opacity: 1;
}

.btncontainer {
	width: 70%;
	margin: 0 auto;
}
.btn {
	margin: 1em 0 0;
	font-size: 18px;
	border-radius: 10px;
	transition: all 0.2s ease-in;
	padding: .4em 0;
	color: white;
	background-color: #574B90;
	border: 3px solid #574B90;
	font-weight: 700;
	font-family: 'Kalam', cursive;
	width: 200px;
	cursor:pointer;
	focus: none;
	
	&:hover {
		background-color: #303A52;
		border: 3px solid #574B90;
	}
	&:focus {
		outline: none;
	}
}

.twitter-btn {
	background-color: #1da1f3;
	color: white;
	border: none;
	width: 200px;
	border-radius: 10px;
	font-size: 14px;
	padding: .8em;
	margin: 1em 0;
	outline: none;
	cursor: pointer;
}

footer {
	text-align: center;
	padding: 3em 0;
}
              
            
!

JS

              
                var quotes = ["'May the Force be with you' - Star Wars",
				  "'E.T. phone home.' - E.T. The Extra-Terrestrial",
				  "'I'\ll be back.' - The Terminator",
				  "'My precious.' - The Lord of the Rings: Two Towers",
				  "'Hasta la vista, baby.' -Terminator 2: Judgment Day",
				  "'Houston, we have a problem.' - Apollo 13",
				  "'I'm king of the world!' - Titanic, 1997",
				  "'Frankly, my dear, I don't give a damn.' - Gone with the Wind, 1939",
				  "'I'm gonna make him an offer he can't refuse.' - The Godfather, 1972",
				  "'Go ahead, make my day.' - Sudden Impact, 1983",
				  "'There's no place like home.' - The Wizard of Oz, 1939",
				  "'You're gonna need a bigger boat.' - Jaws, 1975"];

// When you click new quote button run this function
$(".btn").on('click', function(){
		//select a random element from the quotes array and store in RandomQuote.
		var randomQuote = Math.floor(Math.random() * quotes.length);
		
		$('p').addClass('opacityOff');
		setTimeout(function(){
			// add the quote to the quote class div.
				$('p').addClass('opacity').text(quotes[randomQuote]);
				}, 200);
		$('p').removeClass('opacity')
});

//Tweet your quote.
 $(".twitter-share-button").click(function(){
	 var quote = $(".quote #tweet").text();
    $(this).attr("href", 'https://twitter.com/intent/tweet?text=' + quote);
  });
              
            
!
999px

Console