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


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


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.


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.


                <link href="" rel="stylesheet">
<script src=""></script>

<div class = "container-fluid">
  <div class = "quotebox ">
    <div class = "row">
      <div class = "col-md-3"></div>
      <div id = "quotetext" class = "col-md-6"></div>
      <div class = "col-md-3"></div>
    <div class = "row">
      <div class = "col-md-3"></div>
      <div id = "author" class = "text-right col-md-5"></div>
      <div class = "col-md-4"></div>
    <div class = "row">
    <div id = "buttons">
    <button type = "button" class = "btn btn-primary" id = "newquote">New Quote</button>
    <a href = "" class = "twitter"><button type = "button" class = "btn btn-primary" id = "tweet"><i class = "fa fa-twitter"></i> Tweet</button></a>


  background-color: #297A4A;

  background-color: #297A4A;
  border: none;
  width: 150px;
  height: 50px;
  margin-top: 30px;
  font-size: 14pt;

  opacity: 0.7;

  padding: 0px;

  border-color: black;
  border-width: 6px;
  border-style: solid none solid none;
  margin: 23vw auto 0 auto;
  padding: 30px 0px;
  background-color: #FFFFFF;
  width: 100%;
  font-family: "Montserrat", sans-serif;
  font-size: 2em;

  margin: 0px auto;

#quotetext, #author{
  color: white;
  transition: color .3s;


                //todo: make the author fade in after the quote
//get rid of blue border after clicking button. .btn:active or .btn:focus don't seem to work

  $("#newquote").on("click", getQuote);

//Get quote from API, perform fadeLetters on text and author. Going to have to make a second fade function for author because of interval conflict.

function getQuote(){
    success: function(json){
      var post = json[0].content;
      var author = json[0].title;
    fadeLetters("#quotetext", $(post).text());
    //$("#author").html("-" + json[0].title);
    fadeAuthor("#author","-" + json[0].title);
    $(".twitter").attr("href", "" +$(post).text() + " -" + author);
    cache: false

//Declare the interval globally so fadeLetters can clear it before it reassigns it. Allows spamming the New Quote button.
var interval;
var authorInterval;

function fadeLetters(id, str){
  var counter = 0;
  for(var i = 0; i < str.length; i++){
    $(id).append("<span id = " + i + ">" + str[i] + "</span>");
  interval = setInterval(function(){
      $("#" + counter).animate({color: "black"}, 1000);
      if (counter > str.length){clearInterval(interval);}
    }, 15);

function fadeAuthor(id, str){
  var acounter = 0;
  for(var i = 0; i < str.length; i++){
    $(id).append("<span id = a" + i + ">" + str[i] + "</span>");
  authorInterval = setInterval(function(){
      $("#a" + acounter).animate({color: "black"}, 1000);
      if (acounter > str.length){clearInterval(authorInterval);}
    }, 15);

//set possible background colors. can be any length, function will rotate left to right then back to beginning.
var bgcolors = ["#AA4E39", "#AA7539", "#27576B", "#297A4A"]
var bgcounter = 0;
//loop through bgcolors array, transitioning background between each color
function backgroundColors(){
  var bginterval = setInterval(function(){
    $("body").animate({"background-color": bgcolors[bgcounter]}, 14000);
    $(".btn").animate({"background-color": bgcolors[bgcounter]}, 14000);
    if (bgcounter > bgcolors.length){bgcounter = 0;}