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="main">
  <h1 class="title text-center">
  Click the button below for a random quote.
  </h1>
  <div class="outline">
    <div class="quote-container">
      <div class="quote-helper">
        <div class="quote well text-center">

        </div>
      </div>
      <p class="author text-right">

      </p>
      <div class="row lower">
        <div class="col-xs left text-left">
          <a href="https://twitter.com" target="_blank">
            <div class="twitter-container"><img id="tweeter" src="http://patrickaltair.com/images/nostalgia/twitter01.png" class="twitter-icon">
            </div>
          </a>
        </div>
        <div class="col-xs middle text-center">
        </div>
        <div class="col-xs right text-center">
          <button id="newQuote" class="btn text-center">
          New Quote
        </button>
        </div>
      </div>
    </div>
  </div>
  <div class="outsideTheBox text-center">
    <p class="forBorder text-center">
      coded by Derek McIntire
    </p>
  </div>

</div>
            
          
!
            
              * {
  margin: 0 auto;
  font-family: 'Oswald', sans-serif;
}

.main {
  /*background-color: #D9853B;*/
  height: 100vh;
  min-width: 650px;
  min-height: 650px;
  padding-top: 5%;
}

.title {
  width: 50%;
  color: #ECECEA;
  font-size: 40px;
  margin: 0 auto;
  padding-bottom: 20px;
}

.outline {
  width: 50%;
  /*background-color: #D9853B;*/
  min-width: 600px;
  border: 2px solid #ECECEA;
  border-radius: 8px;
  padding: 5px;
}

.quote-container {
  padding: 15px;
  width: 100%;
  background-color: #ECECEA;
  border-radius: 6px;
}

.quote-helper {
  min-height: 150px;
}

.quote {
  padding: 20px;
  /*color: #D9853B;*/
  font-size: 25px;
  width: 80%;
  height: 55%;
}

.author {
  color: #696969;
  width: 80%;
  margin-top: -25px;
  font-size: 17px;
  border-bottom: 1px solid #696969;
  padding-bottom: 10px;
}

.lower {
  margin: 0 auto;
  width: 90%;
  height: 60px;
}

.twitter-container {
  height: 60px;
}

.twitter-icon {
  width: 60px;
}

.right {
  padding: 7px;
}

.btn {
  height: 100%;
  color: #ECECEA;
  /*background-color: #D9853B;*/
  cursor: pointer;
}

.outsideTheBox {
  width: 600px;
  padding: 15px;
}

.forBorder {
  color: #696969;
  background-color: #ECECEA;
  border: 1px solid #696969;
  display: inline-block;
  border-radius: 75px;
  padding-left: 8px;
  padding-right: 8px;
  padding-bottom: 3px;
}
            
          
!
            
              $(document).ready(function() {

  var words = [
    "\"The classroom's the last room to get the truth.\"", "\"What treaty have the Sioux made with the white man that we have broken? Not one. What treaty have the white man ever made with us that they have kept? Not one.\"", "\"The world we want to transform has already been worked on by history and is largely hollow.  We must nevertheless be inventive enough to change it and build a new world.  Take care and do not forget ideas are also weapons.\"", "\"The assumption that what currently exists must necessarily exist is the acid that corrodes all visionary thinking.\"", "\"My object in life is to dethrone God and destroy capitalism.\"", "\"Poverty is not just a lack of money. It is not having the capability to realize one's full potential as a human being.\"", "\"We are not myths of the past, ruins in the jungles, or zoos.  We are people and we want to be respected, not be victims of intolerance and racism.\"", "\"In this frightening, anxious time to be alive it can be liberating to remember that nothing lasts forever. That can focus and invigorate our hopes.\"", "\"Catch a man a fish and  you can sell it to him. Teach a man to fish and you ruin a wonderful business opportunity.\"", "\"Socialism never took root in America because the poor see themselves not as an exploited proletariat, but as temporarily embarrassed millionaires.\"", "\"Historically speaking, we went from being Indians to pagans to savages to hostiles to militants to activists to Native Americans. Its five hundred years later and they still can't see us. We are still invisible.\"", "\"Justice is not a flexible tool. Unless we all do our part to ensure that justice is applied equally to all human beings, we are a party to it's abuse. We must stand together to protect the rights of others.\"", "\"But true equality won't come until boys learn to embrace girl stuff as well.\"", "\"Of all parties, I now see only one party - The Anarchist - which respects life, and loudly insists upon the abolition of capital punishment, prison torture and the punishment of man by man altogether.\"", "\"You have to act as if it were possible to radically transform the world.  And you have to do it all the time.\"", "\"If America does not use her vast resources of wealth to end poverty and make it possible for all of God's children to have the basic necessities of life, she too will go to hell.\"", "\"We have made enormous progress in teaching everyone that racism is bad.  Where we seem to have dropped the ball is in teaching people what racism actually is.\"", "\"All definitions of wilderness that exclude people seem to me to be false.  African \'wilderness\' areas are racist because indigenous people are being cleared out of them so white people can go on holiday there.\""
  ];

  var authors = ["-Zack de la Rocha", "-Sitting Bull", "-Subcomandante Marcos", "-Murray Bookchin", "-Karl Marx", "-Amartya Sen", "-Rigoberta Menchu", "-John K. Samson", "-Karl Marx", "-John Steinbeck", "-John Trudell", "-Leonard Peltier", "-Julia Serano", "-Peter Kropotkin", "-Angela Davis", "-Martin Luther King Jr.", "-John Stewart", "-Jay Griffiths"];

  var colors = ["black", "#DF3D82", "#D9853B", "#118C4E", "#A2AB58", "#7D1935", "#74AFAD", "#005A31", "#CD3278", "#CDCD00"];

  function random() {
    $(".quote").fadeIn(1000);
    $(".author").fadeIn(1000);
    var i = Math.floor(Math.random() * words.length);
    var j = Math.floor(Math.random() * colors.length);
    $(".quote").html(words[i]);
    $(".author").html(authors[i]);
    $(".main").css("background-color", colors[j]);
    $(".twitter-container").css("background-color", colors[j]);
    $(".outline").css("background-color", colors[j]);
    $(".quote").css("color", colors[j]);
    $(".btn").css("background-color", colors[j]);
    $("a").prop("href", "https://twitter.com/intent/tweet?text=" + words[i] + authors[i]);
  }

  random();

  $("#newQuote").on("click", function() {
    $(".quote").fadeOut(300);
    $(".author").fadeOut(300);

    setTimeout(function() {
      random();
    }, 350);
  });
});
            
          
!
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