JavaScript preprocessors can help make authoring JavaScript easier and more convenient. For instance, CoffeeScript can help prevent easy-to-make mistakes and offer a cleaner syntax and Babel can bring ECMAScript 6 features to browsers that only support ECMAScript 5.
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.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
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="container">
<div class="tf"><br><br>TRUE OR FALSE</div>
<center><br><svg width="30" height="30">
<!--<circle cx="50" cy="50" r="50" />-->
<path d="M0,15 a1,1 0 0,0 30,0" fill="BLUE" />
</svg>
<p>Assisted reproductive technologies (like IVF) can help most women have a baby using their own eggs</p>
<div class="active-area">
<div class="question">
<div class="click-me"><br><br><br>Tap to <br>Reveal the<br> Answer</div>
</div>
<div class="answer">
<p>FALSE</p>
<div class="clearfix">
<section class="one">
<span class="dot" style=""></span>Incorrect
<center><div class="incorrect" style="width:90px;height:90px;"></div> 89.3%<br>
</section>
<section class="two">Correct
<center><div class="correct" style="width:10px;height:10px;"></div> 10.7%
<br> </section>
</div>
<small>Source: Glamour x Modern Fertility Survey</small>
</div>
</div>
</div>
@font-face {
font-family: chalet;
src: url(https://files.persona.co/31025/Chalet-NewYorkNineteenEighty.woff);
}
@font-face {
font-family: saol;
src: url(https://files.persona.co/31025/Saol_Text_Semibold.woff);
}
.clearfix {
overflow: hidden;
}
.correct{
background-color :#FF9F34;
border-radius: 50%;
display:block;
margin:10px;
}
.incorrect{
background-color :#eb0029;
border-radius: 50%;
display:block;
margin:10px;
}
section {
width: 40%;
font-weight: bold;
text-transform: uppercase;
font-family: 'chalet';
font-size: 15px;
letter-spacing:1px;
padding: 5%;
text-align: center;
float: left;
}
.one {
}
.two {
}
.hc{
margin: 0 auto;
background-color: #FF9F34;
height: 40px;
width: 40px;
border-radius: 50%;
animation: pulse 1s ease-in-out infinite alternate;
text-transform: uppercase;
letter-spacing: 1px;
font-size:10px;
text-align:center;
vertical-align:middle;
color:#fff;}
@keyframes pulse {
from {transform: scale(1);}
to {transform: scale(1.05);}
}
p{
font-family: saol;
font-size:30px;
}
.tf {
/* Background:#A7E9F2; */
margin-top:-15px;
text-align: center;
padding: 20px;
font-family: "chalet";
letter-spacing: 2px;
font-weight: 600;
color: #000;
padding-bottom: 5px;
background: url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/2315306/wave-01.svg");
background-repeat: repeat;
background-position-x: 0%;
background-position-y: 0%;
background-size: 10px auto;
background-repeat: repeat-x;
background-size: 17px 10px;
background-position: 40px 38px;
animation: move 15s linear infinite;
-webkit-animation: move 15s linear infinite;
animation-play-state: paused;
text-decoration: none;
background-color: transparent;
-webkit-text-decoration-skip: objects;
animation-play-state: running;
}
@-webkit-keyframes move {
from {
background-position: 2px 19px;
}
to {
background-position: 500px 19px;
}
}
@keyframe move {
from {
background-position: 2px 19px;
}
to {
background-position: 500px 19px;
}
}
.container {
max-width: 400px;
margin: 0 auto;
}
.click-me {
margin: 0 auto;
background-color: #FF9F34;
height: 100px;
width: 100px;
border-radius: 50%;
animation: pulse 1s ease-in-out infinite alternate;
text-transform: uppercase;
letter-spacing: 1px;
font-size:10px;
text-align:center;
vertical-align:middle;
color:#fff;
}
.active-area {
position: relative;
width: 100%;
}
.question {
opacity: 1;
cursor: pointer;
position: absolute;
z-index: 9;
width:100%;
transition: opacity 100ms cubic-bezier(.17,.67,.83,.67);
}
.answer {
margin-top:-20px;
user-select: none;
opacity: 0;
position: absolute;
z-index: 8;
width:100%;
text-align:center;
transition: opacity 500ms cubic-bezier(.17,.67,.83,.67);
}
small{
color:gray;
font-size:10px;
text-transform: uppercase;
letter-spacing:1px;
font-weight:400;
}
svg {
transform: rotate(180deg);
margin-bottom:-25px;
}
window.addEventListener("load", function() {
const showButton = document.querySelector(".question");
const answer = document.querySelector(".answer");
function showResults() {
showButton.style.opacity = 0;
answer.style.opacity = 1;
}
showButton.addEventListener("click", showResults);
})
Also see: Tab Triggers