Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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

Auto Save

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="transcriptWrapper">
  <ul id="transcript">
    <li class="speaker1"><strong class="speakerName">Justin</strong>: What I am trying to say is that the appeal and the settlement are separate.</li>
    <li class="speaker2"><strong class="speakerName">Alistair</strong>: You mean that communications and announcements internal and external would be brought into the appeal process.</li>
    <li class="speaker1"><strong class="speakerName">Justin</strong>: Right, because they connect to the appeal.</li>
    <li class="speaker2"><strong class="speakerName">Alistair</strong>: I hope you understand there are issues of reputation, and I have to deal with those in the appeal process rather than the commercial issues around settlement.</li>
    <li class="speaker1"><strong class="speakerName">Justin</strong>: And then, there is this legal claim for defamation. I believe that the implication would be to perceive in for defamation.</li>
    <li class="speaker2"><strong class="speakerName">Alistair</strong>: Yes. I will investigate to what we have as written evidence and what we do not have.</li>
    <li class="speaker1"><strong class="speakerName">Justin</strong>: Okay. Great! I am thankful for you to do that.</li>
    <li class="speaker2"><strong class="speakerName">Alistair</strong>: Absolutely. Evidences are important in order to understand whether the party in question has acted appropriately through this process, and there is greater possibility of defamation to everybody in circumstance like this.</li>
    <li class="speaker1"><strong class="speakerName">Justin</strong>: Exactly.</li>
    <li class="speaker2"><strong class="speakerName">Alistair</strong>: I hope you feel that you have been listened to.</li>
    <li class="speaker1"><strong class="speakerName">Justin</strong>: Yes, absolutely. Thank you.</li>
  </ul>
</div>
<div id="transcriptWrapper">
  <ul id="transcript">
    <li class="speaker1"><strong class="speakerName">Justin</strong>: What I am trying to say is that the appeal and the settlement are separate.</li>
    <li class="speaker2"><strong class="speakerName">Alistair</strong>: You mean that communications and announcements internal and external would be brought into the appeal process.</li>
    <li class="speaker1"><strong class="speakerName">Justin</strong>: Right, because they connect to the appeal.</li>
    <li class="speaker2"><strong class="speakerName">Alistair</strong>: I hope you understand there are issues of reputation, and I have to deal with those in the appeal process rather than the commercial issues around settlement.</li>
    <li class="speaker1"><strong class="speakerName">Justin</strong>: And then, there is this legal claim for defamation. I believe that the implication would be to perceive in for defamation.</li>
    <li class="speaker2"><strong class="speakerName">Alistair</strong>: Yes. I will investigate to what we have as written evidence and what we do not have.</li>
    <li class="speaker1"><strong class="speakerName">Justin</strong>: Okay. Great! I am thankful for you to do that.</li>
    <li class="speaker2"><strong class="speakerName">Alistair</strong>: Absolutely. Evidences are important in order to understand whether the party in question has acted appropriately through this process, and there is greater possibility of defamation to everybody in circumstance like this.</li>
    <li class="speaker1"><strong class="speakerName">Justin</strong>: Exactly.</li>
    <li class="speaker2"><strong class="speakerName">Alistair</strong>: I hope you feel that you have been listened to.</li>
    <li class="speaker1"><strong class="speakerName">Justin</strong>: Yes, absolutely. Thank you.</li>
  </ul>
</div>
<audio id="audio" ontimeupdate="playTranscript()" controls>
  <source src="http://media02.hongkiat.com/display-audio-transcript/sample.mp3" type="audio/mpeg">
  Your browser does not support the audio element.
  </source>
</audio>
              
            
!

CSS

              
                body {
	font-family: Arial, sans-serif;
}
#transcriptWrapper {
	width: 500px;
	height: 250px;
	overflow: hidden;
}
#transcript {
	font-family: garamond;
	font-size: 14pt;
	list-style: none;
	border-left: 1px solid;
	padding-left: 13px;
	position: relative;
}
#transcript > li {
	margin: 5px 0;
	padding: 5px;
	-webkit-filter: blur(3px);
	filter: blur(3px);
	transition: all .8s ease;
	list-style-type: disc;
}
.speaker1 {
	background: #F5E566;
}
.speaker2 {
	background: #F57E66;
}
.speakerName {
	text-transform: uppercase;
}
.speaking {
	-webkit-filter: blur(0px) !important;
	filter: blur(0px) !important;
}
              
            
!

JS

              
                    var dialogueTimings = [0,4,9,11,18,24,29,31,44,45,47],
        dialogues = document.querySelectorAll('#transcript>li'),
        transcriptWrapper = document.querySelector('#transcriptWrapper'),
        audio = document.querySelector('#audio'),
        previousDialogueTime = -1;   

     function playTranscript() {

        var currentDialogueTime = Math.max.apply(Math, dialogueTimings.filter(function(v){return v <= audio.currentTime}));

        if(previousDialogueTime !== currentDialogueTime) {
            previousDialogueTime = currentDialogueTime;
            var currentDialogue = dialogues[dialogueTimings.indexOf(currentDialogueTime)];
            transcriptWrapper.scrollTop  = currentDialogue.offsetTop - 50;  
            var previousDialogue = document.getElementsByClassName('speaking')[0];
            if(previousDialogue !== undefined)
                previousDialogue.className = previousDialogue.className.replace('speaking','');
            currentDialogue.className +=' speaking';
        }
    }
;
              
            
!
999px

Console