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

              
                <!------- add ons ------>
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">

<!------- add on ends ------>

<!------ Header -------->

<div class="quotes">
 <div id="section1">
  <h1>Random Music Quote</h1>
  <section>
  
    <div class="row">
    <div class="col-xs-6">
    </div>
        
      <blockquote>
        <p class="quote-text" id="quote"></p>
        <p id="quote-author" class="quote-author"></p>
      </blockquote>
    </div>
    </div>
      <div class="button-group">
       <span class="button-container">
                <button class="button button_quote" id="quote-button">Get a new quote</button>
        <br>   
        <a class="twitter-share-button" id="tweet" href="https://twitter.com/share" data-text="Random Music Quote" data-via="SpencerArias" data-size="large">Tweet</a>
            </span>
    </div>
  
  <!-------footer ----------->
 

  <div id="section4" class="copyright-container">
  <p id="copyright">©Copyright 2016 - <a href="https://codepen.io/slarias/full/YWBQdL/" target='_blank'>Spencer Arias</p>
  </div>

          
  
              
            
!

CSS

              
                /* Main site code */ 

body {
  background: black;
  font: 14px/20px Arial, san-serif;
  color: #000000;
  margin: 0;
}




ul {
  list-style: none;
  
}

h1 {
  text-align: center;
  color: black;
}

h2 {
  text-align: center;
}

p {
  color: black;
}





  
i {
  
  float: left;
  padding: 35px 20px 20px 0;
}





/* code for the quote generator */

.quote-box {
  background: white;
  min-height: 527px;
 
}

.quote-text {
  color: black;
  margin-bottom: 6.77966%;
  font-family: 'Neuton', serif;
  font-size: 30px;
  line-height: 1.3;
}

#quote-button {
  background: white;
  font-family: Arial;
  color: black;
  
}

.quote-author {
  font-size: 25px;
  font-family: 'Neuton', serif;
}

.button-container {
  
  position: static;
  float: right;
  
    
 
}

.button-group {
  position: fixed;
  top: 20px;
  right: 10px;
  width: 200px;
  height: 100px;
  
}

#section4 container-fluid { 
    position: fixed;
    bottom: 0;
    right: 0;
    width: 300px;
    border: 3px solid #73AD21;
}

a {
  color: white;
  text-decoration: underline;
}

#copyright {
  font-size: 1.4em;
  color: white;
}

.copyright-container {
  position: fixed;
  bottom: 0;
  width: 100%;
  text-align: right;

  
}

.quotes {
  background: white;
  opacity: 0.75;
}
 

              
            
!

JS

              
                    var quoteArray = [
      {
    content: "&quot;Time is a great teacher, but unfortunately she kills all her pupils.&quot;",
    author: "Hector Berlioz"
      },
      {
    content: "&quot;Music is enough for a lifetime, but lifetime isn\'t enough for music.&quot;",
    author: "Sergei Rachmaninoff"
      },
      {
    content: "&quot;Music expresses that which cannot be said and on which it is impossible to be silent.&quot;",
    author: "Victor Hugo"
      },
      {
    content: "&quot;Where words fail, music speaks.&quot;",
      author: "Hans Christian Andersen"
    },
      {
    content: "&quot;Without music, life would be a mistake.&quot;",
     author: "Friedrich Nietzche"
    },
      {
    content: "&quot;The only love affair I have ever had was with music.&quot;",
    author: "Maurice Ravel"
    },
      {
    content: "&quot;The barriers are not erected which can say to aspiring talents and industry, \'Thus far and no farther.&quot;",
    author: "Ludwig van Beethoven"
    },
      {
    content: "&quot;I was not meant to be an athlete. I was meant to be a composer and will be I\'m sure. Don\'t ask me to try to forget this unpleasant thing and go play football - please.&quot;",
   author: "Samuel Barber"
    },
      {
    content: "&quot;Music produces a kind of pleasure which human nature cannot do without.&quot;",
    author: "Confucius"
    },
      {
    content: "&quot;Music is the art which is most nigh to tears and memory.&quot;",
    author: "Oscar Wilde"
    },
      {
    content: "&quot;Music is the universal language of mankind.&quot;",
    author: 'Henry Wadsworth Longfellow'
    },
      {
    content: "&quot;Music heard so deeply that it is not heard at all, but you are the music while the music lasts.&quot;",
    author: "T.S. Elliot"
    },
      {
    content: "&quot;There is no truer truth obtainable by man than comes of music.&quot;",
      author: "Robert Browning"
    },
      {
    content: "&quot;I often think in music. I live my daydreams in music.&quot;",
      author: "Albert Einstein"
    },
      {
     content: "&quot;I call architechture frozen music.&quot;",
      author: "Johann Wolfgang von Goethe"
    }
    
	];


//grab html elements
var button = document.getElementById('quote-button'),
    quote = document.getElementById('quote'),
    author = document.getElementById('quote-author'),
    tweet = document.getElementById('tweet'),
    random;


window.onload = randomQuote;
button.addEventListener('click', randomQuote);


tweetQuote();


function randomQuote (){

    random = Math.floor(Math.random() * quoteArray.length);
 
    quote.innerHTML = quoteArray[random].content;
    
    author.innerHTML = '&mdash; ' + quoteArray[random].author;

    
    tweetQuote();
}


function tweetQuote (){
    var quoteShort = quote.innerHTML,
        quoteShortAuthor = author.innerHTML.substr(2).trim(),
        msg ='';

    
    var elem = document.getElementById('twitterbutton');
    if (elem !== null) {
        elem.parentNode.removeChild(elem);
    }

   
    if(quoteShort.length + quoteShortAuthor.length <= 90){
        msg = quoteShort + ' by ' + quoteShortAuthor;
    }else {
        msg = quoteShort.substr(0, 65) + '[...]" by ' + quoteShortAuthor;
    }

   
    var tweetDiv = document.querySelector('.twitter-share-button');

    
    var link = document.createElement('a');

    
    link.setAttribute('href', 'https://twitter.com/share');
    link.setAttribute('class', 'twitter-share-button');
    link.setAttribute('id', 'tweet');
    link.setAttribute('data-text', msg);
    link.setAttribute('data-via', 'SpencerArias');
    link.setAttribute('data-size', 'large');

  
    tweetDiv.parentNode.replaceChild(link, tweetDiv);


    twttr.widgets.load();
}

! function(d, s, id) {
    var js, fjs = d.getElementsByTagName(s)[0],
        p = /^http:/.test(d.location) ? 'http' : 'https';
    if (!d.getElementById(id)) {
        js = d.createElement(s);
        js.id = id;
        js.src = p + '://platform.twitter.com/widgets.js';
        fjs.parentNode.insertBefore(js, fjs);
    }
}(document, 'script', 'twitter-wjs');



var safeColors = ['00','33','66','99','cc'];
var rand = function() {
    return Math.floor(Math.random()*6);
};
var randomColor = function() {
    var r = safeColors[rand()];
    var g = safeColors[rand()];
    var b = safeColors[rand()];
    return "#"+r+g+b;
};

$('#quote-button').click(function() {
   var randomColorChange = '#'+(Math.random()*0xEEEEEE<<0).toString(16);
    $('body').css('background-color', randomColorChange);
    });



              
            
!
999px

Console