JSFiddle - React, Tailwind, and code Playground
HTML
<body>
<div id="layer">
<h1></h1>
<div id="trans">
<p class="questions"><span class="q">Question goes here</span></p>
<ul id="center" class="innerBox">
<li><button class="buttons ans">A. <span class="a"></span></li>
<li><button class="buttons ans">B. <span class="b"></span></li>
<li><button class="buttons ans">C. <span class="c"></span></li>
<li><button class="buttons ans">D. <span class="d"></span></li>
</ul>
<div id="submit">
<button class="buttons prev">Prev</button>
<button class="buttons next">Next</button>
</div>
</div>
</div>
</body>
CSS
/* #999967 #666666 #cccccc #cccc9a */
html, body {
height: 100%;
margin: 0;
padding: 0;
background: black;
}
#layer {
width: 812px;
height: 100%;
padding: 5px;
margin: auto;
background: url(http://images.wikia.com/battlefield/images/0/0e/BFBC2V_Clean_Background_1080P.png);
}
#trans {
width: 80%;
height: 400px;
margin: auto;
background: rgba(37, 43, 48, 0.5);
border: 1px solid gray;
border-radius: 20px;
-moz-border-radius: 20px;
-webkit-border-radius: 20px;
box-shadow:2px 2px 4px 0 #666666;
-moz-box-shadow: 2px 2px 4px 0 #666666;
-webkit-box-shadow: 2px 2px 4px 0 #666666;
}
#center {
margin: auto;
}
h1 {
padding: 10px;
font-family: KlavikaWeb, Helvetica, sans-serif;
text-align: center;
color: #444444;
}
.questions {
padding: 5px;
text-align: center;
font-family: KlavikaWeb, Helvetica, sans-serif;
font-size: 24px;
font-weight: bold;
color: #0003366;
}
.innerBox {
position: relative;
vertical-align: baseline;
height: 250px;
width: 500px;
list-style-type: none;
font-size: 20px;
font-family: KlavikaWeb, Helvetica, sans-serif;
border: 1px solid #cccccc;
}
.ans {
width: 460px;
height: 54px;
padding: 5px;
font-size: 1em;
font-weight: bold;
margin-top: 7px;
text-align: left;
background: rgba(255, 255, 255, 0);
border: none
}
.buttons {
display: inline-block;
font-family: KlavikaWeb, Helvetica, sans-serif;
white-space: nowrap;
text-decoration: none;
}
#submit {
text-align: right;
padding-right: 52px;
padding-top: 17px;
}
.next {
width: 70px;
height: 30px;
font-size: 18px;
color: #cccccc;
text-align: center;
background-color: #666666;
}
.prev {
display: none;
width: 70px;
height: 30px;
font-size: 18px;
color: #cccccc;
text-align: center;
background-color: #666666;
border-radius: 1px;
...
JavaScript
var allQuestions = [{question: "How many championships have the Lakers won?",
choices: ["15", "16", "17", "18"],
correctAnswer: 1},
{question: "Which player's number did the Lakers not retire?",
choices: ["James Worthy", "Gail Goodrich", "Jerry West", "Vlade Divac"],
correctAnswer: 3},
{question: "Which player is known as \"Arisotle\"?",
choices: ["Kobe Bryant", "Magic Johnson", "Shaquille O'Neil", "Wilt Chamberlain"],
correctAnswer: 2},
{question: "How many Division Titles have the Lakers won?",
choices: ["28", "30", "32", "34"],
correctAnswer: 2},
{question: "How many Championships has Kobe Bryant won?",
choices: ["four", "five", "six", "seven"],
correctAnswer: 1},
{question: "What year was Magic Johnson born?",
choices: ["1952", "1956", "1958", "1959"],
correctAnswer: 3},
{question: "What NBA team also plays at the Staples Center?",
choices: ["The Kings", "Golden State Warriors", "The Clippers", "The Dodgers"],
correctAnswer: 2},
{question: "What are the team colors of the LA Lakers?",
choices: ["Black and Gold", "Purple and Gold", "Purple and Blue", "Blue and Gold"],
correctAnswer: 1},
{question: "Where did LA Laker Jerry West attend college?",
choices: ["UCLA", "West Virgnia", "North Carolina", "Stanford"],
correctAnswer: 1},
{question: "How many Championships did they win in the 80's?",
choices: ["Three", "Two", "Four", "Five"],
correctAnswer: 3}];
var answers = [];
var c = 0;
$(document).ready(function() {
// add a pointer to the cursor on all buttons
$(".next").on("mouseenter", function() {
$(this).css('cursor', 'pointer');
});
$(".prev").on("mouseenter", function() {
$(this).css('cursor', 'pointer');
});
// allows for highlighting a button similar to :hover
$(".ans").on("mouseenter", function() {
$(this).addClass("highlight");
$(this).css('cursor', 'pointer');
});
$(".ans").on("mouseleave",...