cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

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.

            
              <div class="container-fluid">
			<div class="vertical-align">
				<div class="quote-box">
					<div class="quote-box--quote">
						<p class="change__color"><i class="fa fa-quote-left" aria-hidden="true"></i><span id="quote">The API used is in HTTP, your browser is blocking this API, please refresh the page from https to http.</span><i class="fa fa-quote-right" aria-hidden="true"></i></p>
						<p class="quote-box--quote-author"></p>
					</div>
					<div class="quote-box--btn">
						<a id="tweet" class="btn btn-default change__bg-color change__btn" href="#" target="_blank"><i class="fa fa-twitter" aria-hidden="true"></i></a>
						<button onclick="getQuote()" class="btn btn-default change__bg-color change__btn"><i class="fa fa-random" aria-hidden="true"></i></button>
					</div>
				</div>
				<div class="color-box">
					<button id="btn-blue" class="btn btn-default"></button>
					<button id="btn-green" class="btn btn-default"></button>
					<button id="btn-yellow" class="btn btn-default"></button>
					<button id="btn-red" class="btn btn-default"></button>
				</div>
				<div class="info-box">
					<ul class="list-inline text-center">
						<li><a href="https://www.vincent-humeau.com" target="_blank">By Vincent Humeau</a></li>
						<li><a href="https://github.com/vinceumo/fcc_random_quote_machine" target="_blank">See this project on Github</a></li>
						<li><a href="http://forismatic.com/en/" target="_blank">Quote from forismatic.com</a></li>
					</ul>
				</div>
			</div>
		</div>
            
          
!
            
              //color palette Homebay https://color.adobe.com/Homebay-color-theme-9138366/?showPublished=true
$blue: #2E7DBD;
$green: #55BD86;
$yellow: #FED155;
$red: #EC6E61;
$gray: #F4F4F4;
$gray-darken: darken( $gray, 20% );
$gray-lighten: lighten( $gray, 20% );
$gray-darkenx7: darken( $gray, 70% );
$gray-darkenx5: darken( $gray, 50% );

$active: $blue;

//Mixin
@mixin transform {
	-webkit-transition: all 0.5s; /* Safari */
	transition: all 0.5s;
	transition-timing-function: ease-in-out;
}


body {
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	background-color: $active;
	@include transform;
}
.container-fluid{
	padding: 0 10%;
}
/*.vertical-align{
		margin-top: 50vh;
		transform: translateY(-50%);
}*/
.quote-box{

	background-color: rgba( $gray-lighten, 1 );
	max-width: 700px;
	margin: 0 auto;
	margin-top: 100px;
	padding: 50px;
	border: solid 1px $gray-darken;
	border-radius: 2px ;
	text-align: center;
	.quote-box--quote{
		p{
			color: $active;
			font-size: 2em;
			@include transform;
			span{
				font-size: 0.8em;
				color: $gray-darkenx7;
				margin: 0 20px;
			}
		}
		.quote-box--quote-author{
			text-align: right;
			margin-top: 10px;
			font-style: italic;
			color: $gray-darkenx5;
			font-size: 1.2em;
		}
	}
}
.quote-box--btn{
	margin-top: 50px;
	.btn-default{
		background-color: $active;
		color: $gray-lighten;
		border: solid 1px $gray-lighten;
		border-radius: 3px;
		@include transform;
		font-size: 1.3em;
		&:focus , &:hover{
			background-color: $gray-lighten;
			color: $active;
			border: solid 1px $active;
		}
	}
}
.color-box{
	margin-top: 50px;
	text-align: center;
	.btn-default{
		padding: 10px;
		color: $gray-lighten;
		border: solid 1px $gray-lighten;
		border-radius: 3px;
		font-size: 1.3em;
	}
	#btn-blue{
		background-color: $blue;
		@include transform;
		&:focus , &:hover{
			background-color: $gray-lighten;
		}
	}
	#btn-green{
		background-color: $green;
		@include transform;
		&:focus , &:hover{
			background-color: $gray-lighten;
		}
	}
	#btn-yellow{
		background-color: $yellow;
		@include transform;
		&:focus , &:hover{
			background-color: $gray-lighten;
		}
	}
	#btn-red{
		background-color: $red;
		@include transform;
		&:focus , &:hover{
			background-color: $gray-lighten;
		}
	}
}
.info-box{
	margin-top: 50px;
	a{
		color: rgba($gray-lighten, 1);
		text-decoration: none;
		@include transform;
		&:hover, &:focus{
			color: rgba($gray-lighten, 0.6);
		}
	}
}

            
          
!
            
              var linkQuoteApi = "http://api.forismatic.com/api/1.0/?method=getQuote&format=jsonp&lang=en&jsonp=?";
var linkTwitter = "https://twitter.com/intent/tweet?&text=";

function getQuote() {
	$.getJSON(linkQuoteApi, function(data) {
		$("#quote").html(data.quoteText);
		if (data.quoteAuthor === '') {
			data.quoteAuthor = 'Unknown';
		}
		$(".quote-box--quote-author").text(data.quoteAuthor);
		$("#tweet").attr("href",
		linkTwitter + data.quoteText + " ― " + data.quoteAuthor);
	});
}
getQuote();



var colorBlue="#2E7DBD";
var colorGreen="#55BD86";
var colorYellow="#FED155";
var colorRed="#EC6E61";
var colorWhite="#ffffff";


function colorChange(idBtn, color) {
	$(document).ready(function(){
		$(idBtn).click(function() {
			$('body').css('background-color', color);
			$('.change__bg-color').css('background-color', color);
			$('.change__color').css('color', color);
			$(".change__btn").hover(function(){
				$(this).css({"background-color": colorWhite, "color": color, "border":"solid 1px", "border-color": color});
				},
				function(){
					$(this).css({"background-color": color, "color": colorWhite, "border":"solid 1px", "border-color": colorWhite});
			});
		});
	});
}
colorChange('#btn-green', colorGreen);
colorChange('#btn-blue', colorBlue);
colorChange('#btn-yellow', colorYellow);
colorChange('#btn-red', colorRed);
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console