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 includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

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

              
                <head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Yellowtail" />

	<script src="https://use.fontawesome.com/350b307c17.js"></script>

</head>
<div class="container-fluid">
	<div id="mainWin" class="jumbotron">
		<div class="row">
			<div id="result" class="well well-lg text-center">
				<p>Quotes here</p>
			</div>
			<div class="row">
				<div class="col-xs-4"> </div>
				<div class="col-xs-4">

				</div>
				<div id="author" class="col-xs-4 text-center">
					<p>Author</p>
				</div>
			</div><br>
			<hr><br>
			<div class="row">
				<div class="col-xs-3"></div>
				<div class="col-xs-3">
					<button id="button" class="btn btn-block btn-danger" type="button"><i class="fa fa-refresh fa-2x"></i></button>
				</div>
				<div class="col-xs-3">
					<button id="tbutton" class="btn btn-block btn-danger" type="button"> <i class="fa fa-twitter fa-2x"></i></button>

				</div>
				<div class="col-xs-3"></div>
			</div>
		</div>
	</div>
</div>
<div class="footer text-center" style="color: #ffffff;">
	Coded by <a href="https://codepen.io/Perp/full/zNBpeg" target="_blank">Srđan Međo,</a> Quotes by <a href="https://forismatic.com/en/api" target="_blank">Forismatic API</a>
</div>
              
            
!

CSS

              
                /*@import url('https://fonts.googleapis.com/css?family=Yellowtail'); */

body {
	margin: 40px 0px 0px 0px;
	background-color: #ec6057;
}

#mainWin {
	background-color: #ec6057;
}

#result {
	font-family: Verdana, Tahoma, sans-serif;
	font-size: x-large;
	color: #ffffff;
	background-color: #ec6057;
	min-height: 190px;
	vertical-align: bottom;
	display: flex;
	justify-content: center;
	/* align horizontal */
	align-items: center;
	/* align vertical */
}

#author {
	font-family: Yellowtail, Verdana, Tahoma, sans-serif;
	font-size: x-large;
	color: #ffffff;
}

#button,
#tbutton {
	background-color: #ec6057;
	outline-color: #ffffff;
	font-family: Verdana, Tahoma, sans-serif;
	font-size: x-large;
}

#button.hover,
#tbutton.hover {
	outline-color: #ffffff;
}

.btn-danger,
.btn-danger:hover,
.btn-danger:focus,
.btn-danger:active,
btn-danger.active {
	border-color: #ffffff;
}

.footer {
	font-family: Verdana, Tahoma, sans-serif;
	font-size: 12px;
}

a:hover,
a:link {
	color: #ffffff;
	text-decoration: none;
}
              
            
!

JS

              
                /* Must be accessed over http, NOT https, cause of the insecure dependencies */

$(document).ready(function() {
	//auto refresh quote on load
	$(window).on("load", function() {
		$("#button").click();
	});
	// logic for getting quotes by means of Forismatic API
	$("#button").on("click", function() {
		$.getJSON("https://api.forismatic.com/api/1.0/?method=getQuote&lang=en&format=jsonp&jsonp=?", function(json) {
			// if no author , shows "Unknown Author"
			var getAuthor = json.quoteAuthor ? json.quoteAuthor : "Unknown Author";
			// writing on screen
			$("#result").html(json.quoteText);
			$("#author").html(getAuthor);
		});

	});
	// twitter button logic
	$("#tbutton").on("click", function() {
		window.open("https://twitter.com/intent/tweet?text=" +
			$("#result").text() + " Author: " + $("#author").text());
	});

});
              
            
!
999px

Console