cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

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.

            
              <div class="articulate-area">
	<div>
		<label for="rate">Rate</label>
		<input type="range" min="0.1" max="10" step="0.1" name="rate" id="rate" value="1.1" oninput="update(this,value)">
    <span class="val">1.1</span>
	</div>
	<div>
		<label for="pitch">Pitch</label>
		<input type="range" min="0.1" max="2" step="0.1" name="pitch" id="pitch" value="1" oninput="update(this,value)">
    <span class="val">1.0</span>
	</div>
  <div>
		<label for="volume">Volume</label>
		<input type="range" min="0" max="1" step="0.1" name="volume" id="volume" value="1" oninput="update(this,value)">
    <span class="val">1.0</span>
	</div>

  <button onclick="speak('article')">Speak</button>
  <button onclick="pause()">Pause</button>
  <button onclick="resume()">Resume</button>
  <button onclick="stop()">Stop</button>
</div>

<article>
  <div class="intro">
    <h1>The Gettysburg Address</h1>
    <h2>Delivered by Abraham Lincoln on November 19, 1863</h2>
    <h3>Beginning with the iconic phrase <q>Four score and seven years ago,</q> this speech is generally regarded as the most famous in American history.</h3>
  </div>
  
  <div class="speech">
    <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/915932/lincoln.jpg" alt="A Portrait of the Sixteenth President">
    <p>Four score and seven years ago our fathers brought forth on this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal.</p>
    <p>Now we are engaged in a great civil war, testing whether that nation, or any nation so conceived and so dedicated, can long endure. We are met on a great battle-field of that war. We have come to dedicate a portion of that field, as a final resting place for those who here gave their lives that that nation might live. It is altogether fitting and proper that we should do this.</p>
    <p>But, in a larger sense, we can not dedicate &mdash; we can not consecrate &mdash; we can not hallow &mdash; this ground. The brave men, living and dead, who struggled here, have consecrated it, far above our poor power to add or detract. The world will little note, nor long remember what we say here, but it can never forget what they did here. It is for us the living, rather, to be dedicated here to the unfinished work which they who fought here have thus far so nobly advanced. It is rather for us to be here dedicated to the great task remaining before us &mdash; that from these honored dead we take increased devotion to that cause for which they gave the last full measure of devotion &mdash; that we here highly resolve that these dead shall not have died in vain &mdash; that this nation, under God, shall have a new birth of freedom &mdash; and that government of the people, by the people, for the people, shall not perish from the earth.</p>
  </div>
</article>
            
          
!
            
              body {
  width: 95%;
  max-width: 800px;
  font-family: tahoma;
  background-color: #eee;
  padding: 20px 0 20px 0;
  margin: 0 auto 0 auto;
}

div.speech img {
  float: left;
  width: 20%;
  margin: 5px 10px 5px 0;
}

h1 {
  font-size: 22px;
  text-align: center;
  margin: 0 0 10px 0;
}

h2 {
  font-size: 16px;
  text-align: center;
  margin: 0 0 10px 0;
}

h3 {
  font-size: 16px;
  font-weight: normal;
  text-align: center;
  margin: 0 0 10px 0;
}

p {
  font-size: 14px;
  line-height: 1.4;
}

button {
  margin: 8px 5px 5px 0;
}

div.articulate-area {
  font-family: monospace;
  font-size: 14px;
  text-align: center;
  padding: 0 0 15px 0;
  border-bottom: 1px dotted #666;
  margin: 0 0 20px 0;
}

div.articulate-area div {
  margin: 0 0 10px 0;
}

div.articulate-area input {
  width: 250px;
}
            
          
!
            
              function speak(obj) {
  // Get the parameter values from the input sliders
  
  var r = parseFloat(document.getElementById('rate').value);
  var p = parseFloat(document.getElementById('pitch').value);
  var v = parseFloat(document.getElementById('volume').value);
  
  // Note: Function calls can be perfromed individually or chained together as demonstrated below
  
  $(obj).articulate('rate',r).articulate('pitch',p).articulate('volume',v).articulate('speak');
};

function pause() {
  $().articulate('pause');
};

function resume() {
  $().articulate('resume');
};

function stop() {
  $().articulate('stop');
};

// update the value to the right of the input sliders
  
function update(obj,value) {
  var n = parseFloat(value).toFixed(1)
  $(obj).parent().find('span').text(n);
};

            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console