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

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

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

              <link href="|Lato:300|Open+Sans:300i|PT+Serif|Vollkorn:400i" rel="stylesheet">

<link href="|Open+Sans+Condensed:300" rel="stylesheet">

<link href="" rel="stylesheet">

<title>Random Twitter Generator</title>
  <div class="container container-table bg-1">
  <div class="row">
    <div class="col">
      <div class="author-text"><p><span id="author"></span></p></div>   
  <div class="row">
    <div class="col">
      <!--pull in json twitter random quote and display-->
      <div class="quote-text" id="quote"></div>
<div class="row">
    <div class="col">
      <div class="buttons">
       <!--button to tweet it -->  
          <a id="twitter" href="#" target="_blank" alt="Tweet this!" title="Tweet this!" <span class="fa fa-twitter"></span></a>
      <!--button to refresh it-->
        <button class="btn button" id="newQuote">New Quote</button>

<footer class"">--made by will waymel--</footer>


  --font1: 'Cardo', serif; 
  --font2: 'Vollkorn', serif; 
  --font3: 'Cardo', serif;
  --font4: 'Cardo', serif;

  color: var(--whiteColor);
  font-size: 1.6rem;
  padding-top: 4px;
  font-family: var(--font4);

  font-family: var(--font1);
  padding: 0px 0px 0px 0px;
  margin: 0px 0px 25px 0px;
  font-size: 2.2rem;
  font-weight: bold;

  margin:0px 0px 5px 0px;
  padding: 0px 20px;
  font-family: var(--font2);
  font-size: 3.5rem;

.click {

.button:hover {
    background: var(--mainColor);
    opacity: 0.6;
    color: var(--whiteColor);

.button {
  height: 50px;
  background: var(--mainColor);
  transition:all .3s ease-in-out;
  color: var(--whiteColor);
  font-weight: bold;

.fa {
  color: var(--mainColor);
  border:solid 2px var(--mainColor);
.fa:hover {
    color: var(--mainColor);



  color: var(--whiteColor) !Important;

body {
  background-color: var(--mainColor);
  color: var(--mainColor);
  transition: background-color 2s ease;
  transition: color 2s ease;

.container-table {

  margin:10% auto auto auto;
  padding:30px 50px 30px 50px;
  background-color: var(--whiteColor);
  text-align: center;
  max-width: 550px;  
  height: auto;
transition:  color 500ms ease-out 1s;
  transition:  background-color 500ms ease-out 1s;

.div {
//twitter button depressed unless click somewher  reset

//mobile - not working first load 

var fonts = [
    "'Cardo', serif",
    "'Vollkorn', serif",
    "'PT Serif', serif; text-transform: uppercase",
    "'Lato', sans-serif",
    "'Open Sans', sans-serif"
// array with colors
var colors = [

function readyfn() {
    var html="";
    var htmlAuthor="";
    var json="";
  $.getJSON("[orderby]=rand&filter[posts_per_page]=1&callback=", function(json) {
      //create html var
    html = (json[0].content);
    htmlAuthor = (json[0].title);
            //"<p>— " + json[0].title + "</p>"
      //set the link for the twitter share
    var twitterquote =""
    twitterquote += '"' + $(".quote-text").text().trim() + '"' + " - " + $("#author").text().trim() + " #awesomequote";
      //var twitterquote = (json[0].content.concat(" - ", json[0].title));
    //twitterquote = twitterquote.text();
      $('.fa-twitter').attr('href', ('' + encodeURIComponent(twitterquote)));
    // Set the color from array'--mainColor', getColor());'--whiteColor', "#fff");'--font1', getFont());'--font2', getFont());
        /*'--font3', getFont());*/'--font4', getFont());
     // $(window).alert(html);
 $.ajaxSetup({ cache: false });


$(document).ready(function() {
  //get quote and store in json variable
  $("#newQuote").on("click", readyfn);

// get random color from array
function getColor() {
   return colors[
     Math.floor(Math.random() * colors.length)
function getFont() {
  return fonts[
    Math.floor(Math.random() * fonts.length)

🕑 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.