JSFiddle - React, Tailwind, and code Playground
by LuckyCat
HTML
<!-- wrap start-->
<div class="wrap">
<div class="steps">
<ul>
<!-- Step 1 ====================== -->
<li class="step">
<div class="steps-title">
<h2>
This is fuck site!
</h2>
</div>
<div class="steps-content">
<div class="warning">
<img src="./images/main.gif" class="logo" alt=""/>
<p>
<span>
WARNING!
</span>
You will see nude photos. Please be discreet.
</p>
<div class="btn-block">
<a href="javascript:void(0);" class="btn btn-block">
Ok
</a>
</div>
</div>
</div>
</li>
<!-- Step 2 ====================== -->
<li class="step">
<div class="steps-title">
<h2>
IMPORTANT!
</h2>
</div>
<div class="steps-content">
<p>
Before we can show you a list and photos of women who live near you and are ready to ...
CSS
@import 'https://fonts.googleapis.com/css?family=Open+Sans:400, 700';
/*reset*/
* {
margin: 0;
padding: 0;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
/*main*/
a {
text-decoration: none;
cursor: pointer !important;
}
ul li {
list-style: none;
}
html {
font-size: 62.5%;
-webkit-text-size-adjust: 100%;
}
img {
border: none;
vertical-align: middle;
width: 100%;
}
body {
background: #000;
font-family: 'Open Sans', Arial, sans-serif;
font-size: 1.8rem;
color: #fff;
min-width: 320px;
}
ol, ul {
list-style: none;
}
a {
color: #fff;
text-decoration: none;
}
/* main
-------------------- */
.wrap {
padding: 3rem 1rem;
position: relative;
}
/* step title
-------------------- */
.steps-title {
padding: .5rem 0;
text-align: center;
}
.steps-title h2 {
font-size: 3.5rem;
color: #ec567c;
}
/* block visible settings
-------------------- */
.step {
display: none;
}
.step:first-child {
display: block;
}
/* warning step
-------------------- */
.warning {
text-align: center;
}
.warning p {
margin: 20px 0 0;
}
.warning p span {
color: #ec567c;
font-weight: 700;
}
/* steps content
-------------------- */
.steps-content {
padding: 2rem 0;
text-align: center;
}
.steps-content strong {
text-decoration: underline;
}
.steps-content .question{
font-size: 2.2rem;
font-weight: 700;
}
.pagination li {
line-height: 4.4rem;
display: inline-block;
font-size: 2.3rem;
font-weight: 700;
color: #ec567c;
padding: .5rem 0;
}
.pagination li span {
width: 4.4rem;
height: 4.4rem;
line-height: 4.4rem;
display: block;
text-align: center;
background: #ec567c;
color: #fff;
border-radius: 3px;
}
.pagination li.active span {
background: #fff;
color: #ec567c;
}
/* btn block
-------------------- */
.btn-block {
padding-top: 3rem;
text-align: center;
}
.btn {
display: inline-block;
width: 38%;
margin-bottom: 2rem;
padding: 1.5rem 2rem;
font-size: 2.6rem;
font-weight: 700;
...
JavaScript
// original
/*$(document).ready(function() {
// steps
$('.btn').not('.btn-start').on('click', function (){
$('.step:visible').hide().next().show();
});
}); */
// Get a reference to the first <button> element in the document
var b = document.querySelector(".btn");
// Add a click event handler to the element
b.addEventListener("click", handleClick);
// Function that will be called when anchor is clicked
function handleClick(){
var step = document.querySelector('.step');
var stepNext = document.querySelector('.step > div');
step.style.display = (step.style.display == 'none') ? 'block' : 'none';
// stepNext.style.display = (stepNext.style.display == 'none') ? 'block' : 'none';
if (stepNext.style.display === 'none')
alert("Yo");
//document.querySelector('.step:visible > div').style.display = 'block';
/*document.querySelector('.step:visible').style.display = 'none';
document.querySelector('.step:visible > div').style.display = 'block';*/
}