123

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 class="wrapper">
     <h1>Random Quote Generator</h1>
     <ul>
         <li>Feeling down?</li>
         <li>Need some motivation?</li>
         <li>Want some guidance?</li>
     </ul>
     <div id="quoteBox">
         <p id="quoteText"></p>
     </div>
     <div class="wrapper">
       <button id="quoteBtn"><i class="fas fa-quote-left"></i> Quote</button>
       <button id="tweetBtn"><i class="fab fa-twitter"></i> Tweet</button>
     </div>
 </div>

            
          
!
            
              @import url('https://fonts.googleapis.com/css?family=Noto+Sans');

$mainBG: #C6A700;
$headerBG:#FDD835;
$wrapperBG: #FFFF6B;
$textColor: #000000;
$borderStyle: 2px dashed fff176; 

body {
  background-color: $mainBG;
  margin: 20px;
  font-family: 'Noto Sans', sans-serif;
}

h1 {
  border: $borderStyle;
  text-align: center;
  background-color: $headerBG;
  padding: 5px;
}

ul {
 list-style-type: square;
 list-style-position: inside;
}

#quoteBox {
   display: none;
}

#quoteText {
  border: $borderStyle;
}

.wrapper {
   text-align: center;
   margin: 50px;
   background-color: $wrapperBG;
}

#tweetBtn {
  text-transform: uppercase;
  padding: 20px;
  margin-bottom: 20px;
  background-color: $mainBG
}

#quoteBtn {
   text-transform: uppercase;
   padding: 20px;
   margin-bottom: 20px;
   background-color: $headerBG;
}
            
          
!
            
              // try animations
// figure out an appropriate way to change colors
// implement sass fully to minimize css reworks
var quotes = ["Power isn't determined by your size, but the size of your heart and dreams! ~ Monkey D. Luffy (One Piece)",
              "Time to get serious ~ Megaman X (Megaman X4)",
              "Jack in, MegaMan.EXE, Transmit! ~ Lan (Megaman Battle Network)",
              "Deceive your other self. Deceive the world. That is what you must do to reach the Steins Gate. Good Luck. El Psy Congroo. ~ Okabe Rintarou (Steins: Gate)",
              "You want to kill me? You couldn't even kill my boredom! ~ Roronoa Zorro (One Piece)",
              "Let's fly..you don't have to worry anymore we'll find the answer, we'll do it together...let's fly, you and me. ~ Yuki (Grandia III)",
              "I... It's just... they really need me. I have to go. I am who I am... because of them. ~ Sora (Kingdom Hearts)",
              "It's over Wily! ~ Megaman (Megaman 8)",
              "It is true that you have more experience than me, but I am good. That's all you will have to explain to your lapdogs how I made you look like an idiot in front of them. Ha ha. Oh another thing, you've got no style. You can throw that in too. ~ Baki (Baki The Grappler)",
              "Power comes in response to a need, not a desire. You have to create that need. ~ Goku (Dragon Ball Z)",
              "People who perish in other's battles are worms... If one can't live their life the way they want, they might as well die. ~ Guts (Berserk)",
              "Why do I desire the touch of something that no longer exists? ~ 9S (Nier: Automata)",
              "The unsuppressed soul lets flow oceans of blood The Watchers drink and raise high the basin of fire  Mighty generals hesitate beneath a crimson sky  As the tears of a goddess flow, four lost temples forebode the coming of the queen The dragon plummets from the tower of red thunder, and where it falls no one has seen ~ Opening (Drakenguard)"
             ];

$('#quoteBtn').click(function(){
    var randNum = Math.floor(Math.random() * quotes.length);
  $('#quoteBox').css("display","block");
  $('#quoteText').html(quotes[randNum]);
});

$('#tweetBtn').click(function(){
  var quoteMMS = $('#quoteText').html();
  var link = `https://twitter.com/intent/tweet?text=${quoteMMS}&hashtags=freecodecamp,randomquoteproject`;
  console.log("Links is: " + link);
  window.open(link, "_blank")
});
            
          
!
999px
🕑 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.

Console