cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

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

Looking for quick-add? Try the external resource search, it's quicker and gives you access to the most recent version of thousands of libraries. ☝️

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Looking for quick-add? Try the external resource search, it's quicker and gives you access to the most recent version of thousands of libraries. ☝️

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

            
              header.page-header
	h1.site-title FCC Random Quote Generator
	h3.page-title Click the arrows below to cycle through random quotes
	
div.arrows
	i.fa.fa-arrow-left.fa-3x#left-arrow
	p#quote
	i.fa.fa-arrow-right.fa-3x#right-arrow

div#tweet
	i.fa.fa-twitter.fa-3x#twitter
	
            
          
!
            
              body { font-family: 'Open Sans', sans-serif; }

.page-header { 
	text-align: center; 
	padding-top: 40px;
}

.site-title {
	font-family: "Playfair Display", serif;
	color: #515151;
	letter-spacing: 1px;
	border-bottom: 5px solid #ffe399;
	display: inline;
}

.page-title {
	color: #606060;
	font-weight: 100;
	font-size: 18px;
}

.arrows {
	display: flex;
	justify-content: space-between;
	cursor: pointer;
	padding-top: 55px;
}

#left-arrow { padding-left: 41px; }
#right-arrow { padding-right: 41px; }

#left-arrow:hover, #right-arrow:hover {
	color: #ffe399;
	transition: .6s ease;
}

#quote {
	font-size: 21px;
	max-width: 65%;
	margin-left: auto;
	margin-right: auto;
	font-family: "Playfair Display", serif;
	color: #515151;
	text-align: center;
}

#author {
	font-size: 18px;
	display: block;
	margin-top: 15px;
	text-align: right;
}

#twitter {
	position: absolute;
	bottom: 0;
  right: 0;
	padding-right: 10px;
}

#twitter:hover {
	color: #4099FF;
	transition: ease .8s;
	cursor: pointer;
}

#right-arrow:active, #left-arrow:active {
	transform: translate(0, 7px);
	transition: ease .3s;
} 

a { color: inherit; }
            
          
!
            
              $(document).ready(function() {
	var quote;
	quote = function() {
		$.ajax({
			url: "https://andruxnet-random-famous-quotes.p.mashape.com/cat=famous",
			type: "PUT",
			dataType: "json",
			beforeSend: function(xhr) {
				xhr.setRequestHeader(
					"X-Mashape-Authorization",
					"rKe9bcSlCkmsh9dP9IEHFngUsFoEp1zUSmFjsnFnWHbutgM5hF"
				);
			},
			success: function(data) {
				document.getElementById("quote").innerHTML =
					data.quote + '<em id="author"> ' + "-  " + data.author + "</em>";
				$("#twitter").wrap(
					$("<a>", {
						href:
							"https://twitter.com/intent/tweet?text=" +
							data.quote +
							"-  " +
							data.author
					})
				);
				$("a").attr("target", "_blank");
			}
		});
	};
	quote();
	$("#right-arrow, #left-arrow").on("click", function() {
		quote();
	});
});


            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console