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

              
                ce
<div class="body">
	<div class="background-image toggle-image first-img show"></div>
	<div class="background-image toggle-image second-img"></div>
	<div class="background-image toggle-image third-img"></div>
	<div class="quote-block">
		<div class = "quoteMark"> "</div>
		<div class="quote">Eat raw potatoes.</div></br>
		<div class="author">-Thea</div></br>
		<button id ="getQuote" class="button">New Quote</button>
<button id="tweet-btn" class="button">Tweet It</button>
	</div>
</div>
<div class="footer">
	<h4>@Thea </h4>
</div>
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Comfortaa:400,300,700);

/*body general styling*/
body{
	font-family: Comfortaa, Helvetica, Times New Roman;
	color: #F7CAC9;
}

/*background image styling*/
.background-image {
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
}

/*transition effect styling*/
.toggle-image{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 800px;
	transition: opacity 5s ease-in-out;
}

/*Background images*/
/* Background image URLs and "stack" order. */
.first-img {
    background-image: url('http://www.walldevil.com/wallpapers/a92/hipster-wallpaper-galaxy-wallpapers.jpg');
    z-index: -3;
	opacity: 0;
}

.second-img {
    background-image: url('https://mrgreensimaginarium.files.wordpress.com/2012/01/1305887750-stars-galaxy-universe-nebula-space-dust-blue-galaxy-wallpaper1.jpg');
    z-index: -2;
	opacity: 0;
}

.third-img {
    background-image: url('https://2.bp.blogspot.com/-6r4dLqdotHk/UHXzZ_I__uI/AAAAAAAAFPo/t4ZbFvb9JsY/s1600/M16-Eagle-Nebula.jpg');
    z-index: -1;
	opacity: 0;
}


.first-img.show {
    opacity: 1;
}

.second-img.show {
    opacity: 1;
}

.third-img.show {
    opacity: 1;
}
/*Quote block styling*/
.quote-block{
	background-color: rgba(255,255,255,0.5);
	margin: 5em 5em 0em 5em;
	padding: 30px 20px 30px 20px;
	border-radius: 20px;
	position: relative;
}
/*fancy quotation mark*/
.quoteMark{
	font-size: 100px;
	font-family:  Times New Roman;
	text-align: center;
	margin-bottom: -80px;
	text-shadow: 1px 1px 5px #000000;
}
/*Quote's style*/
.quote{
	font-size: 40px;
	text-shadow: 1px 1px 5px #000000;
	text-align: center;
	position: relative;
}

/*author name's styling*/
.author{
	text-align: right;
	text-shadow: 1px 1px 1px #000000;
	font-size: 20px;
	padding-right: 30px;
	positon: relative;
}

/*buttons' styling*/
.button{
    background-color: #89ABE3; /* Green */
    border: none;
	color: white;
	padding: 5px 10px;
    text-align: right;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
	border-radius: 5px;
	position: inherit;	
}
/*about-me styling*/
.footer{
	text-align: center;
}
              
            
!

JS

              
                /*function for changing background*/
function changeBackgrounds() {
	var index = 0;

	$image = $('.toggle-image'); // Get the images to be cycled.

	setInterval(function() {
		// Get the next index.  If at end, restart to the beginning.
		index = index + 1 < $image.length ? index + 1 : 0;
		// Show the next image.
		$image.eq(index).addClass('show');
		// Hide the previous image.
		$image.eq(index - 1).removeClass('show');

	}, 5000);
};
var quoteAPI = 'https://api.forismatic.com/api/1.0/?method=getQuote&lang=en&format=jsonp&jsonp=?';

/*function to get random quotes*/
function getQuote(){
	
	$("#getQuote").on("click", function(){
		$.getJSON(quoteAPI, function(json) {
			//$(".quote").html(JSON.stringify(json));
		  	$(".quote").html(json.quoteText);
			$(".author").html("-"+json.quoteAuthor);
		}); 
    });
};

$(document).ready(function() {
	/*call function change back*/
	changeBackgrounds();
	getQuote();
	$('#tweet-btn').click(function() {
    window.open('https://twitter.com/intent/tweet?text=' + $('.quote').text() + " " + $('.author').text());
  });
});
              
            
!
999px

Console