html
html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!DOCTYPE html>
<html>
<head>
<title>personality test</title>
</head>
<body>
<div id='frst-cont' class='cont'>
<div id='frst-qstn-cont' class='hide'>
<div id='frst-qstn'>
first Question
</div>
<div class='ans-btns'>
<button onclick='setFrstScndQstn();' id='frst-yes-btn' class='btn'>
Yes
</button>
<button onclick='setScndScndQstn();' id='frst-no-btn' class='btn'>
No
</button>
</div>
</div>
<div class='controls'>
<button onclick='StartGame();' id='start-btn'>
Start
</button>
</div>
</div>
Enter to Rename, Shift+Enter to Preview
css
css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
body {
padding: 0;
margin: 0;
display: flex;
width: 100vw;
height: 100vh;
justify-content: center;
align-items: center;
background-color: hsl(360,100%,20%);
}
.cont {
width: 800px;
max-width: 80%;
background-color: white;
border-radius: 5px;
padding: 10px;
box-shadow: 0 0 10px 2px;
}
.btn-grid {
display: grid;
grid-template-columns: repeat(2, auto);
gap: 10px;
margin: 20px 0;
}
.btn {
border: 1px solid hsl(200,100%,30%);
Enter to Rename, Shift+Enter to Preview
js
js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
const startBtn = document.getElementById('start-btn')
const frstCont = document.getElementById('frst-cont')
const frstQstnCont = document.getElementById('frst-qstn-cont')
const frstYesBtn = document.getElementById('frst-yes-btn')
const frstNoBtn = document.getElementById('frst-no-btn')
const frstScndCont = document.getElementById('scnd-cont')
const scndScndCont = document.getElementById('also-scnd-cont')
function StartGame() {
startBtn.classList.add('hide')
frstQstnCont.classList.remove('hide')
}
function setFrstScndQstn() {
frstCont.classList.add('hide')
frstScndCont.classList.remove('hide')
}
function setScndScndQstn() {
frstCont.classList.add('hide')
scndScndCont.classList.remove('hide')
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run