JSFiddle - React, Tailwind, and code Playground

by BramVanroy

HTML

<div id="red">
    <div class="one">1</div>
    <div class="two">2</div>
    <div class="three">3</div>
</div>
<div id="blue" class="sub">
    <div class="one">1</div>
    <div class="two">2</div>
    <div class="three">3</div>
</div>

CSS

#red, #blue {
    width: 90%;
    margin: 0 auto;
    height: 150px;
}

#red div, #blue div { 
    text-align: center;
    box-shadow: inset 0 0 22px rgba(0,0,0,0.8);
    border: 2px solid rgba(0,0,0,0.2);
    width: 33.33%;
    box-sizing: border-box;
    float: left;
    padding-top: 45px;
    height: 100%;
    font-size: 50px;
    font-family: sans-serif;
    color: white;
    font-weight: bold;
    background: #E01B1B;
    cursor: pointer;
    opacity: 0.65;
}

#red div:hover {
    text-shadow: 3px 3px 0 rgba(0,0,0,0.3);
    box-shadow: none;
    opacity: 1;
}

#blue div {
    background: #1BA8E0;
    text-shadow: 3px 3px 0 rgba(0,0,0,0.3);
    box-shadow: none;
    opacity: 1;
    cursor: auto;
}

JavaScript

$(document).ready(function() {
    $("#blue div").hide();
    $("#red div").click(function() {
        var redClass = $(this).attr("class");
        $("#blue ." + redClass).toggle();
    });
});