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.


                <html lang="en">
    <link rel="stylesheet" type="text/css" href="QuoteMachine.css"/>
    <link rel="stylesheet" href="" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous"> 
    <link href="|Nanum+Pen+Script|Raleway|Montserrat|Give+You+Glory|Indie+Flower|Open+Sans|Caveat|Gloria+Hallelujah|Mrs+Sheppards|Nanum+Brush+Script|Pacifico|Sacramento|Satisfy|Shadows+Into+Light" rel="stylesheet">    

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

    <!-- <link rel="stylesheet" href="//">-->
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
    <meta http-equiv="X-UA-Compatible" content="ie=edge"> 

    <title>Radek's Quote Machine</title>

  <body class=class="randomColor" id='bdy'>

    <div class="container">
  <p id="quote">- </p>
  <p id="author"></p>

  <button type="button" class="btn btn-primary fa fa-twitter shadow" id="btnTweet"></button>
<!-- <button type="button" class="btn btn-primary fa fa-facebook shadow" id="btnFcb"></button> -->
<button type="button" class="btn btn-primary pull-right shadow" id="nextQuote">Next Quote</button>


  <p id="impressum">coded by <a target="_blank" href="">Radek</a></p>

<script src="" type="text/javascript"></script>
      <!-- <script src="" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script> -->
    <!--<script src="" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
    <script src="" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>

    <script type="text/javascript" src="QuoteMAchine.js"> </script>


                body {
  display: none;

.container {
  /* border: 1px black solid; */
  border-radius: 10px;
  margin-top: 10em;
  background-color: white;
  padding-top: 10px;
  box-shadow: 20px 20px 8px grey;
  max-width: 35em !important;

#quote, #author {
  font-family: 'Indie Flower', cursive;

.btn {
  margin-bottom: 20px;
  border-color: white;
  font-size: 20em;
  min-width: 50px; 
  min-height: 50px;
  box-shadow: 5px 5px 5px grey;

#quote {
  font-size: 1.5em;
  font-style: italic;
  font-weight: 200;

#author {
  text-align: right;
  font-weight: bold;

#nextQuote {
  font-family: 'Indie Flower', cursive;
  float: right;
  color: black;
  background-color: white !important;
  border-width: 3px !important;
  /* box-shadow: grey !important; */
  /* box-shadow: none; */
  box-shadow: 5px 5px 5px grey;

.randomColor {
  color: g

.fa-twitter {
  color: white;

.pull-right {
  float: right !important;

#impressum {
  color: white !important; 
  font-weight: 300;
  text-align: center;
  margin-top: 2.5em;
  text-decoration: none;



                  var arrayOfFonts = [
      "'Pacifico', cursive",
      "'Dancing Script', cursive",
      "'Indie Flower', cursive",
      "'Give You Glory', cursive",
      "'Shadows Into Light', cursive",
      "'Gloria Hallelujah', cursive",
      "'Nanum Pen Script', cursive",
      "'Satisfy', cursive",
      "'Nanum Brush Script', cursive",
      "'Sacramento', cursive",
      "'Caveat', cursive",
function setQuote(d){
  var q = document.querySelector("#quote");
  q.innerHTML = d.quote;
  var a = document.querySelector("#author");
  a.innerHTML = '- ' +;

function getRandom() {

// random color
  var letters = '0123456789ABCDEF';
  var color = '#';
  for (var i = 0; i < 6; i++) {
    color += letters[Math.floor(Math.random() * 16)];

  // random font
  var randomFontNumber = Math.floor(Math.random() *arrayOfFonts.length); // (Math.random() *2 gives number between 0 and 1,99999..., thus we multiply it by 2 so we get 1,9 nd then Math.floor
  randomFont= arrayOfFonts[randomFontNumber];

  function setRandomView() {

  // changing colors & family fonts
  // background color

  // // font color of quote & author
    // document.querySelector("#quote").style.color=randomColor;
    // document.querySelector("#author").style.color=randomColor;

  // // color of button
    // document.querySelector("#btnFcb").style.backgroundColor=randomColor;
    // document.querySelector("#nextQuote").style.backgroundColor=randomColor;

  // color of borders container
    document.querySelector("body").style.display ='block';
  // color of buttons
    // document.querySelector("#btnFcb").style.borderColor=randomColor;

  // changing fonts
    document.querySelector("#quote").style.fontFamily = randomFont;
    document.querySelector("#author").style.fontFamily = randomFont;
    document.querySelector("#nextQuote").style.fontFamily = randomFont;
    document.querySelector("#impressum").style.fontFamily = randomFont;

var randomColor;
var randomFont;
var lastRandomFund;
var QuoteAndAuthor;

// setQuote(data);

document.getElementById("nextQuote").addEventListener("click", getQuoteFromServer);

function getQuoteFromServer() {
  $.ajax( {
    url: "[orderby]=rand&filter[posts_per_page]=1",
    success: function(arrayOfQuote) {
          console.log('success: ' + JSON.stringify(arrayOfQuote));
          newObject = {
           author: arrayOfQuote[0].title,
           quote: arrayOfQuote[0].content

         QuoteAndAuthor = newObject.quote.substring(3, newObject.quote.length - 6) + ' - ' +;        

     error: function() {
      console.log('did not get data');
      alert("Sorry, the data cannot be triggered due to a server's issue. It's not my fault ;) Please try again later.")

    cache: false

// DRY dont repeat yourself

  function() {
  $(this).animate({ width:180, height:65}, 1000);
  function() {
  $(this).animate({ width:170, height:60}, 1000);

function outgoing(){
  var urlTweet= "" + $("#quote").text().trim() +  "%0D%0A" + $("#author").text().trim();

document.getElementById("btnTweet").addEventListener("click", outgoing);