cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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.

Quick-add: + add another resource

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.

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.

            
              <!--A Javascript/jQuery app using APIs-->

<body>
  <div class="container">
  <h3> WHAT SHOULD I WRITE ABOUT?</h3>
  
    <div id="quoteContainer">
      <div class="quote"> Right now. </div>
    </div> <!-- end quoteContainer -->
  
    <div id = "buttonContainer">
      <a id="getQuote">
     next
      </a>
      
  <!-- Twitter was a great documentation on it's tweet button:
https://dev.twitter.com/web/tweet-button
I didn't end up using their button, if I did, I would need to add the js documentation
  <script async src="//platform.twitter.com/widgets.js" charset="utf-8"> </script>
-->
  <!-- I would reconsider using 'onclick' and 'open.window' in the future to create a function that would open in a new window. -->
  <!-- target="_blank" to create a new page-->
  <a id= 'tweet' target="_blank"  href="" > write on!
</a>    
     <div>   <!-- end buttonContainer -->
</div> <!-- end container -->  
    </body>
            
          
!
            
              @import url('https://fonts.googleapis.com/css?family=Merriweather|Roboto');

body {
  font-family: 'Roboto', sans-serif;
  /* create a flex layout container */
  display: flex; /* block or inline */
  
  /* Then we define the flow direction and if we allow the items to wrap 
   * Remember this is the same as:
   * flex-direction: row;
   * flex-wrap: wrap;
   */
  flex-flow: row wrap;
  
  /* Then we define how is distributed the remaining space */
  justify-content: center; /*or space-around*/
  background-image: linear-gradient(to right, #ffecd2 0%, #fcb69f 100%);;
}


/* dimensions, borders, padding, margin */
.container{
  width: 40%;
  border: 1px gray;
  border-style: solid hidden;
  margin-top: 5%;
  float: center;
  padding: 10px 0px;
}

h3 {
  font-family: 'Roboto', sans-serif;
  font-size: 16px;
}

.quote {
  font-family: 'Merriweather', serif;
  font-size: 32px;
  color: #03f;
  text-align: left;
  margin: -10px 0px 1px 0px;
}

#buttonContainer {
  float: right;
}
/* add buttonContainer formatting */
a:link, a:visited {
    color: black;
    padding: 14px 25px;
    text-align: right;
    text-decoration: none;
    display: inline-block;
}

a:hover, a:active {
  color: white;
}


/* resources: https://css-tricks.com/snippets/css/a-guide-to-flexbox*/
            
          
!
            
              $(document).ready(function(){

  $('#getQuote').on('click', function() {
    
     var randomNumber = Math.floor(Math.random()* (124));

  $.getJSON("https://spreadsheets.google.com/feeds/list/17si0oqT6moFCHqTa8qgvhWC7r4744dEimo2sbRKWgd0/od6/public/values?alt=json", function(data) {
  
  var newQuote = data.feed.entry[randomNumber]['gsx$prompts']['$t'];
    
        $(".quote").html(newQuote);      
    
   $('#tweet').on('click', function() {
  $('#tweet').attr('href','https://twitter.com/intent/tweet?hashtags=WriteOn&original_referer=https%3A%2F%2Fs.codepen.io%2Fboomerang%2FiFrameKey-564e3a0b-9df7-e43d-e99d-1f6ae3104f8c%2Findex.html&ref_src=twsrc%5Etfw&related=twitterapi%2Ctwitter&text='+ newQuote + '&tw_p=tweetbutton&url=%20&via=acertz');
   });    
     });
  });
});
            
          
!
999px
Loading ..................

Console