Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's 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 it's URL and the proper URL extention.

+ 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

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.

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

              
                <!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <div class="quiz-box-ziro" id="quiz"> <!--block-ziro-->
        <div class="quiz-header">
            <h2 id="question">Как вас зовут?</h2>
            <input class="input" type="name" >
        </div>
        <button  class="btn" id="submit-ziro">Далее</button>
    </div> <!--block-ziro==end-->

<div class="quiz-box" id="quiz"> <!--block-one-->
    <div class="quiz-header">
        <h2 id="question">Вы уже знаете свое предназначение в этой жизни?</h2>
        <ul>
            <li>
                <input class="answer" type="radio" name="answer" id="a">
                <label for="a" id="a_text">да</label>
            </li>
            <li>
                <input class="answer" type="radio" name="answer" id="b">
                <label for="b" id="b_text">нет</label>
            </li>
            <li>
                <input class="answer" type="radio" name="answer" id="c">
                <label for="c" id="c_text">догадываюсь</label>
            </li>
        </ul>

    </div>
    <button class="btn" id="submit-one">Далее</button>
</div> <!--block-one==end-->

<div class="quiz-box-two" id="quiz"> <!--block-two-->
    <div class="quiz-header">
        <h2 id="question">Вам известно, какая профессия или сфера бизнеса будет давать вам самые легкие деньги?</h2>
        <ul>
            <li>
                <input class="answer" type="radio" name="answer" id="a">
                <label for="a" id="a_text">да</label>
            </li>
            <li>
                <input class="answer" type="radio" name="answer" id="b">
                <label for="b" id="b_text">нет</label>
            </li>
            <li>
                <input class="answer" type="radio" name="answer" id="c">
                <label for="c" id="c_text">не могу сказать точно</label>
            </li>
        </ul>
    </div>
    <button class="btn" id="submit-two">Далее</button>
</div>  <!--block-two==END-->

<!--block-three-->
<div class="quiz-box-three" id="quiz">
<div class="quiz-header">
    <h2 id="question">Бывает чувство, что находитесь не на своем месте?</h2>
    <ul>
        <li>
            <input class="answer" type="radio" name="answer" id="a">
            <label for="a" id="a_text">регулярно</label>
        </li>
        <li>
            <input class="answer" type="radio" name="answer" id="b">
            <label for="b" id="b_text">иногда</label>
        </li>
        <li>
            <input class="answer" type="radio" name="answer" id="c">
            <label for="c" id="c_text">не бывает</label>
        </li>
    </ul>
</div>
<button class="btn" id="submit-three">Далее</button>
</div>  <!--block-three==END-->

<!--block-four-->
<div class="quiz-box-four" id="quiz">
<div class="quiz-header">
    <h2 id="question">Ваши отношения с партнером - гармоничные?</h2>
    <ul>
        <li>
            <input class="answer" type="radio" name="answer" id="a">
            <label for="a" id="a_text">вполне</label>
        </li>
        <li>
            <input class="answer" type="radio" name="answer" id="b">
            <label for="b" id="b_text">хотелось бы лучше</label>
        </li>
        <li>
            <input class="answer" type="radio" name="answer" id="c">
            <label for="c" id="c_text">у меня нет партнера</label>
        </li>
    </ul>
</div>
<button class="btn" id="submit-four">Далее</button>
</div>  <!--block-four==END-->

<!--block-five-->
<div class="quiz-box-five" id="quiz">
<div class="quiz-header">
    <h2 id="question">Уже пытались разобраться в астрологии?</h2>
    <ul>
        <li>
            <input class="answer" type="radio" name="answer" id="a">
            <label for="a" id="a_text">хорошо разбираюсь</label>
        </li>
        <li>
            <input class="answer" type="radio" name="answer" id="b">
            <label for="b" id="b_text">что-то знаю, но вся информация в кучу</label>
        </li>
        <li>
            <input class="answer" type="radio" name="answer" id="c">
            <label for="c" id="c_text">не разбираюсь в астрологии</label>
        </li>
    </ul>
</div>
<button class="btn" id="submit-five">Далее</button>
</div>  <!--block-five==END-->



<script src="app.js"></script>
</body>
</html>
              
            
!

CSS

              
                *{
    box-sizing: border-box;
}
body{
    font-family: 'Roboto', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    overflow: hidden;
    margin: 0;
    background: url('images/bg.jpg') no-repeat;
    background-position: center;
    background-size: cover;
}
h2{
    padding: 16px;
    text-align: center;
    margin: 0;
}

/* blocks */
.quiz-box-ziro{
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 0 10px 2px rgba(100, 100, 100, 0.1);
    width: 600px;
    overflow: hidden;
    display: block;
}

.quiz-box{
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 0 10px 2px rgba(100, 100, 100, 0.1);
    width: 600px;
    overflow: hidden;
    display: none;
}
.quiz-box-two{
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 0 10px 2px rgba(100, 100, 100, 0.1);
    width: 600px;
    overflow: hidden;
    display: none;
}
.quiz-box-three{
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 0 10px 2px rgba(100, 100, 100, 0.1);
    width: 600px;
    overflow: hidden;
    display: none;
}
.quiz-box-four{
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 0 10px 2px rgba(100, 100, 100, 0.1);
    width: 600px;
    overflow: hidden;
    display: none;
}
.quiz-box-five{
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 0 10px 2px rgba(100, 100, 100, 0.1);
    width: 600px;
    overflow: hidden;
    display: none;
}

/* blocks===END */
.quiz-header{
    padding: 64px;
}
ul{
    list-style: none;
    padding: 0;
}
ul li{
    font-size: 20px;
    margin: 15px 0;
}
ul li label{
    cursor: pointer;
}
button{
    background-color: #5ec6eb;
    border: none;
    display: block;
    width: 100%;
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    text-transform: uppercase;
    color: #000000;
    padding: 15px;
    transition: all 0.5s ease;
}
button:hover{
    background-color: #438faa;
}
button:focus{
    outline: none;
    background-color: #5ec6eb;
}
.hide{
    display: none;
}
.show{
    display: block;
}
.input{
    width: 100%;
    height: 50px;
    font-family: inherit;
    font-weight: bold;
    font-family: 'Roboto', sans-serif;
    font-size: inherit;
}
              
            
!

JS

              
                
const submitZiro = document.getElementById(`submit-ziro`);
const submitOne = document.getElementById(`submit-one`);
const submitTwo = document.getElementById(`submit-two`);
const submitThree = document.getElementById(`submit-three`);
const submitFour = document.getElementById(`submit-four`);
const submitFive = document.getElementById(`submit-five`);

const blockZiro = document.querySelector(`.quiz-box-ziro`);
const blockOne = document.querySelector(`.quiz-box`);
const blockTwo = document.querySelector(`.quiz-box-two`);
const blockThree = document.querySelector(`.quiz-box-three`);
const blockFour = document.querySelector(`.quiz-box-four`);
const blockFive = document.querySelector(`.quiz-box-five`);

submitZiro.addEventListener(`click`, function(){
    blockZiro.classList.add(`hide`);
    blockOne.classList.add(`show`);
});

submitOne.addEventListener(`click`, function(){
    blockOne.classList.remove(`show`);
    blockTwo.classList.add(`show`);
});

submitTwo.addEventListener(`click`, function(){
    blockTwo.classList.remove(`show`);
    blockThree.classList.add(`show`);
});
submitThree.addEventListener(`click`, function(){
    blockThree.classList.remove(`show`);
    blockFour.classList.add(`show`);
});

submitFour.addEventListener(`click`, function(){
    blockFour.classList.remove(`show`);
    blockFive.classList.add(`show`);
});


              
            
!
999px

Console