JSFiddle - React, Tailwind, and code Playground
by Brett Miley
HTML
<div id="personality-test-wrap">
<h3>Click the cards in your perferred order:</h3>
<ul id="personality-test" class="flex-container">
<li id="R" class="flex-item" onclick="getCards('R')"><img src="http://www.andyedwards.biz/personality-styles/images/RedCard.jpg" alt="Personality Test Fiery Red - Andy Edwards"></li>
<li id="Y" class="flex-item" onclick="getCards('Y')"><img src="http://www.andyedwards.biz/personality-styles/images/YellowCard.jpg" alt="Personality Test Sunshine Yellow - Andy Edwards"></li>
<li id="G" class="flex-item" onclick="getCards('G')"><img src="http://www.andyedwards.biz/personality-styles/images/GreenCard.jpg" alt="Personality Test Earth Green - Andy Edwards"></li>
<li id="B" class="flex-item" onclick="getCards('B')"><img src="http://www.andyedwards.biz/personality-styles/images/BlueCard.jpg" alt="Personality Test Cool Blue - Andy Edwards"></li>
</ul>
<p class="copyright">© The Insights Group Ltd, 2012. All rights reserved.</p>
<p class="selection">Your selection:
<input id="cards" type="hidden" size="5" name="cards" />
</p>
<ul id="personality-order" class="flex-container">
<li id="card1" class="flex-item" onclick="getCards('R')">1</li>
<li id="card2" class="flex-item" onclick="getCards('Y')">2</li>
<li id="card3" class="flex-item" onclick="getCards('G')">3</li>
<li id="card4" class="flex-item" onclick="getCards('B')">4</li>
</ul>
<div class="button-wrap">
<button onClick="ShowAnswer()" name="answer">Reveal My Personality</button>
<button id="reset" onClick="resetCards()" name="reset">Reset</button>
</div>
</div>
<!-- id="personality-test-wrap" -->
CSS
.flex-container-wrap * {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.flex-container {
padding: 0;
margin: 0;
list-style: none;
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-flex-flow: row wrap;
justify-content: center;
}
.flex-item {
margin-top: 10px;
color: white;
font-weight: bold;
text-align: center;
}
h3 {
color: #ea7714;
text-transform: uppercase;
}
p.copyright {
text-align: right;
font-size: .5rem;
text-transform: uppercase;
color: #666666;
margin-top: 1.5rem;
}
ul#personality-test li {
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
overflow: hidden;
border-radius: 1rem;
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, .5);
transition: all 0.5s ease;
margin: 8px;
position: relative;
top: 0;
border: 1rem solid white;
font-size: 0;
}
@media all and ( max-width: 800px) {
ul#personality-test li:hover {
border-radius: 1rem;
box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, .7);
top: 1rem;
-ms-transform: rotate(0deg);
/* IE 9 */
-webkit-transform: rotate(0deg);
/* Safari */
transform: rotate(0deg);
}
}
#R,
#B {
-ms-transform: rotate(1deg);
/* IE 9 */
-webkit-transform: rotate(1deg);
/* Safari */
transform: rotate(1deg);
}
#Y {
-ms-transform: rotate(-1deg);
/* IE 9 */
-webkit-transform: rotate(-1deg);
/* Safari */
transform: rotate(-1deg);
}
#G {
-ms-transform: rotate(2deg);
/* IE 9 */
-webkit-transform: rotate(2deg);
/* Safari */
transform: rotate(2deg);
}
ul#personality-order li {
width: 2rem;
height: 3rem;
}
p.selection {
text-transform: uppercase;
}
#personality-test-wrap .button-wrap {
display: block;
text-align: center;
}
#personality-test-wrap .button-wrap button {
padding: 1rem 2rem;
text-transform: uppercase;
background-color:...