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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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 id="root"></div>

              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css2?family=Montserrat&family=Pacifico&display=swap');

body{
 /* background-color: #333;
  color: #333;*/
  background-image: linear-gradient(
    to right, #D60604, #EE9D00,#E3FF00,#05C000,#001A98,#76008A,#FFAFC9,#75D8ED,#5F3813,#000000
    );
  font-family: 'Montserrat', sans-serif;
  font-weight: 400;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}


* {
  margin: 0;
  padding: 0;
  list-style: none;
  vertical-align: baseline;
}

div {
  position: relative;
  z-index: 2;
}

#quote-box{
  border-radius: 3px;
  position: relative;
  width: 450px;
  padding: 40px 50px;
  display: table;
  background-color:#fff;
}
  .quoteText{
    text-align:center;
    width: 450px;
    height: auto;
    clear: both;
    font-weight: 500;
    font-size: 1.75em;
  }

  .quoteAuthor{
    width: 450px;
    height: auto;
    clear: both;
    padding-top: 20px;
    font-size: 1em;
    text-align: right;
  }

  .button{
    width: 450px;
    margin: auto;
    display: block;
    height: 38px;
    border: none;
    border-radius: 3px;
    color: #fff;
    background-image: linear-gradient(
    to right, #D60604,
    #EE9D00,#E3FF00,#05C000,#001A98,#76008A,#FFAFC9
    );
    outline: none;
    font-size: 0.85em;
    padding: 8px 18px 6px 18px;
    margin-top: 30px;
    opacity: 1;
    cursor: pointer;
  }

  .alignTweet{
    text-align: center;
    margin-top: 20px;
  }

#text {
  font-family: 'Pacifico', cursive;
}


              
            
!

JS

              
                class App extends React.Component {
  constructor(props){
    super(props);
    this.state = {
      quotes: [{"quote":"The only queer people are those who don't love anybody.", "author": "Rita Mae Brown"},
{"quote":"I am not here to entertain straight people.", "author": "Sarah Schulman"},
{"quote":"My queerness is not a vice, is not deliberate, and harms no one.", "author": "Natalie Clifford Barney"},
{"quote":"I hate that word. Straight. At the very least, those of us who are nonstraight should get called curvy. Or scenic. Actually, I like that: 'Do you think she's straight?' 'Oh no. She's scenic.", "author": "Nina LaCour"},
{"quote":"Laugh and cry and tell stories. Sad stories about bodies stolen, bodies no longer here. Enraging stories about the false images, devastating lies, untold violence. Bold, brash stories about reclaiming our bodies and changing the world.", "author": "Eli Clare"},
{"quote":"I beheld and still behold in anger and agony the eagerness of the world to throw piles of shit on those of us who want to savage or simply cannot help but savage the norms that so desperately need savaging.", "author": "Maggie Nelson"},
{"quote":"I see fashion as a proclamation or manifestation of identity, so, as long as identities are important, fashion will continue to be important. The link between fashion and identity begins to get real interesting, however, in the case of people who don't fall clearly into a culturally-recognized identity.", "author": "Kate Bornstein"},
{"quote":"If it weren't for the unconventionality of my desires, my mind might never have been forced to reckon with my body.", "author": "Alison Bechdel"},
{"quote":"The joy of discovery is one of the biggest pleasures you'll ever know.", "author": "Samra Habib"},
{"quote":"What happens when we say something out loud? Does it become more real? Is it any less really when we keep it to ourselves?", "author": "Aimee Herman"},
],
      selectedQuoteIndex: 0,

    }

    this.generateNewQuoteIndex = this.generateNewQuoteIndex.bind(this);
    this.assignNewQuoteIndex = this.assignNewQuoteIndex.bind(this);
  }

get selectedQuote() {
  return this.state.quotes[this.state.selectedQuoteIndex];
}

generateNewQuoteIndex(){
  return random(0, this.state.quotes.length - 1);
}

assignNewQuoteIndex(){
  this.setState({ selectedQuoteIndex: this.generateNewQuoteIndex()});

}

  render() {
    return (

      <div id="quote-box" >

          <div id="text" className="quoteText">
            {this.selectedQuote.quote}
          </div>
          <div id="author" className="quoteAuthor">
            {this.selectedQuote.author}
          </div>
          <button onClick={this.assignNewQuoteIndex} id="new-quote" className="button"> Next Quote </button>
          <div className="alignTweet">
            <a href='twitter.com/intent/tweet' target="_blank" id="tweet-quote">
            <FontAwesomeIcon icon={faTwitter} />
            </a>
          </div>

      </div>
    );
  }
}

ReactDOM.render(<App/>, document.getElementById('root'))

              
            
!
999px

Console