JSFiddle - React, Tailwind, and code Playground
HTML
<meta name="viewport" content="user-scalable=0, initial-scale=1.0, maxiumum-scale=1.0, width=device-width" />
<div class="wrapper">
<h1>HOW TO OPERATE A MIG WELDER</h1>
<section>
<h2>turn on the oxygen knob</h2>
<div class="content">
<p>this is a critical step</p>
<blockquote>
The oxygen makes the weld penentrate and illuminates spatter
</blockquote>
<img src=http://pubx.annexmedia.ca/metalworking/wp-content/uploads/sites/30/2013/04/LeakTest.jpg/>
</div>
</section>
<section>
<h2>Connect the ground clamp to your work</h2>
<div class="content">
<img src=http://www.gowelding.org/wp-content/uploads/Ground_Clamp.jpg />
</div>
</section>
<section>
<h2>turn on welder</h2>
<div class="content">
<p>
you should then hear a humming noise
</p>
</div>
</section>
<section>
<h2>start welding</h2>
<div class="content">
<iframe width="640" height="360" src="https://www.youtube.com/embed/nPxqErIVQ9I" frameborder="0" allowfullscreen></iframe>
<section>
<section>
<h2>take it slow</h2>
<div class="content">
<p>
go super slow
</p>
</div>
</section>
<section>
<h2>be careful</h2>
<div class="content">
</div>
</section>
<section>
<h2>have fun</h2>
<div class="content">
<img src="http://public.harmonicnw.com/tft_2013-02-20/binocs.gif" />
</div>
</section>
<footer>Coded by Gage Choat on Dec 10, 2015</footer>
<script src="http://public.harmonicnw.com/tft_2013-02-20/jquery.fitvids.js"></script>
CSS
body {
background: #ddd;
font-family: "lucida grande", tahoma, sans-serif;
font-size: 20px;
height: 100%;
}
html {
height: 100%;
}
footer {
color: gray;
font-size: 0.8em;
font-style: italic;
margin: 1em 0;
text-align: center;
}
blockquote {
font-style: italic;
padding: 0 20px;
font-size: 16px;
}
h1 {
border-top: 2px dashed rgb(200,200,200);
border-bottom: 2px dashed rgb(200,200,200);
font-family: "georgia", serif;
font-size: 1.6em;
margin: 1em 0;
padding: 0.5em;
text-align: center;
}
h2 {
background-position: left center;
background-repeat: no-repeat;
cursor: pointer;
font-family: "georgia", serif;
font-size: 1.2em;
margin: 0.5em 0;
opacity: 0.5;
padding-left: 20px;
transition: all 500ms ease;
}
h2:hover {
/*color: rgb(100,100,100);*/
opacity: 1;
margin-left: 20px;
}
h2.open {
background-image: url('http://public.harmonicnw.com/tft_2013-02-20/ddarrow-down.png');
opacity: 1;
}
h2.closed {
background-image: url('http://public.harmonicnw.com/tft_2013-02-20/ddarrow-right.png');
}
img {
height: auto;
margin-bottom: 1em;
width: 100%;
}
p {
margin: 1em 0;
}
section {
background: rgb(240,240,240);
border-left: 3px solid rgb(150,50,50);
margin: 5px 0;
padding: 5px 3%;
width: 94%;
}
ul {
list-style: circle;
margin: 1em 2em;
}
.wrapper {
background: white;
height: 100%;
margin: 0 auto;
overflow-y: auto;
padding: 0 3%;
width: 90%;
}
JavaScript
$(document).ready( function() {
$(".wrapper").fitVids();
$("section").each( function(i) {
var content = $(this).children(".content");
var hdr = $(this).children("h2");
hdr.text(i+1 + ". " + hdr.text());
hdr.click( function(e) {
if (content.is(":visible")) {
content.slideUp();
hdr.removeClass("open").addClass("closed");
} else {
$("section").children(".content:visible").slideUp();
$("section").children("h2").removeClass("open").addClass("closed");
content.slideDown();
hdr.removeClass("closed").addClass("open");
}
e.preventDefault();
$(this).blur();
});
content.hide();
hdr.addClass("closed");
});
});