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.

              <div id="back" class="container">
  <div id="content-back" class="row align-items-center">
    <div class="col-3"></div>
    <div id="quote-box" class="col-6"></div>
    <div class="col-3"></div>
  <div class="row">
    <div class="col text-right">by Fredy</div>
              #back {
  background-image: linear-gradient(to bottom right, dodgerblue, gray);
  height: 100vh;
  max-width: 100vw;
#content-back {
  height: 97vh;
  max-width: 100vw
#quote-box {
  text-align: center;
  background-color: lightgray;
  max-width: 100vw;
  height: 300px;
  padding: 50px;
#text {
  font-style: italic;
#author {
  text-align: right;
  padding: 50px;
              class SelectQuote extends React.Component {
  constructor(props) {
    this.state = {
      quote: "Always learning, always improving, always moving forward.",
      author: "-Fredy",
      randomIndex: ""

    this.handleClick = this.handleClick.bind(this);

  handleClick() {
      randomIndex: Math.floor(Math.random() * 7)
    const possibleQuote = [
      "Only a life lived for others is a life worthwhile.",
      "Everything has beauty, but not everyone sees it",
      "Where there is love there is life.",
      "My best friend is the one who brings out the best in me.",
      "The antidote for fifty enemies is one friend.",
      "Don't cry because it's over, smile because it happened.",
      "I've learned that people will forget what you said, people will forget what you did, but people will never forget how you made them feel."
    const possibleAuthor = [
      "-Albert Einstein",
      "-Mahatma Gandhi",
      "-Henry Ford",
      "-Dr. Seuss",
      "-Maya Anjelou"
    if (this.state.randomIndex != 0){
      quote: possibleQuote[this.state.randomIndex],
      author: possibleAuthor[this.state.randomIndex]

  render() {
    return (
        <div id="text">{this.state.quote}</div>
        <div id="author">{this.state.author}</div>
        <div id="button-row" class="row justify-content-around">
        <a id="tweet-quote" class="btn btn-primary" 
          href="twitter.com/intent/tweet?" role="button">
          <i class="fa fa-twitter"></i>
          <button id="new-quote" class="btn btn-primary" onClick={this.handleClick}>New Quote</button>

  <SelectQuote />,
🕑 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.