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

Packages

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.

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

              
                <div class="container-fluid">
  <div class="row">
    <div class="col-md-4 well col-centered quotes message">
      <h1 id="cytat">Press the button to get a quote.</h1>
      <h4 id="autor"></h4>
      <div class="row">
        <div class="col-md-4 lefter">
          <button target="_blank"  href ="#" id="tweet" class="btn btn-info btn-block ">Tweet it!</button>
        </div>
        <div class="col-md-4 righter">
          <button  onclick="myFunction()"  class="btn btn-info btn-block">Another quote</button>
          </div>
      </div>
     </div>
   </div>
</div>
              
            
!

CSS

              
                .col-centered{
    float: none;
    margin: 0 auto;
  top: 200px;
  }

.buttons {
  margin: 0 auto;
  float: none;
  top: 200px;
  
}

.quotes {
      border: 1px solid black;
      opacity: 0.6;
}

.quotes h1 {
   font-weight: bold;
   color: black;
}

.quotes h4 {
  text-align: right;
}

body {
  background-image: url("http://kingofwallpapers.com/ocean/ocean-005.jpg");  
}

.lefter {
  float: left;
  margin: 0 auto;
 }

.righter {
  float: right;
  margin: 0 auto;
}

.img-size {
    width: 40px;

}












              
            
!

JS

              
                
// BAZA CYTATÓW I AUTORÓW //
var quot = [
  {cycat: "( ͡° ͜ʖ ͡°)",
   autor: "( ͡° ͜ʖ ͡°)"
  },
  {cytat: "Don't cry because it's over, smile because it happened.",
   autor: " Dr. Seuss"
  },
  {cytat: "Be yourself: everyone else is already taken.",
   autor: "Oscar Wilde"
  },
  {cytat: "You only live once, but if you do it right, once is enough.",
   autor: "Mae West"
  },
  {cytat: "Be the change that you wish to see in the world.",
   autor: "Mahatma Gandhi"
  },
  {cytat: "Friendship ... is born at the moment when one man says to another: What! You too? I thought that no one but myself . . .",
   autor: " C.S. Lewis"
  },
  {cytat: "If you tell the truth, you don't have to remember anything.",
   autor: " Mark Twain"
  },
  {cytat: "Without music, life would be a mistake.",
   autor: "Friedrich Nietzsche"
  },
  {cytat: "Just play. Have fun. Enjoy the game.",
   autor: "Michael Jordan"
  },
  
];

// funkcja podmiany
var temporaryQuote;
var randomNumber;

function myFunction() {
  
  randomNumber = Math.random(); 
  randomNumber = Math.floor(randomNumber*7)+2;
  
    document.getElementById("cytat").innerHTML = quot[randomNumber].cytat
  document.getElementById("autor").innerHTML = quot[randomNumber].autor;
  
  temporaryQuote = quot[randomNumber];
}
  
// tweeter
$("#tweet").on("click", function(){ 
  
window.open("https://twitter.com/intent/tweet?text="+document.getElementById("cytat").innerHTML)+document.getElementById("autor").innerHTML;
  });






              
            
!
999px

Console