JSFiddle - React, Tailwind, and code Playground

by Gwyn Milcote

HTML

ball gene list
<link rel="stylesheet"  href="https://fonts.googleapis.com/css?family=Cabin">

<h2>Colours</h2>
<p>Chicken colours are made from two kinds of pigment: eumelanin (black) and phaeomelanin (red/brown/yellow). Several gene mutations can change the amounts of each pigment being produced, or switch them off entirely. Check out the <a href=''>Colour Tutorial</a> to see how all these mutations can interact, creating chickens with a huge range of colour combos.</p>

<div class='section round' id='locus_mh'>
    <div class='title' data-locus='mh'>Mahogany (Mh locus)</div>
    <div class='content hidden'>
    <div class='images'>
	    
        <div class='image'>
		    <img src='https://www.omlet.ie/images/originals/rir2_7be05f24.jpg' loading='lazy' alt='description'>
			<br>Somewhat red
		</div>
        <div class='image'>
		    <img src='http://www.savvyhousekeeping.com/wp-content/uploads/2011/04/rosie.jpg' loading='lazy' alt='description'>
			<br>Medium red
		</div>
		<div class='image'>
		    <img src='https://static3.mypetchicken.com/images/ChickenPix/medium/Studio_RIRedBtmCkrl_7742_M.jpg' loading='lazy' alt='description'>
			<br>Very deep red
		</div>
		<div class='image'>
		    <img src='https://i.pinimg.com/736x/d2/f1/6f/d2f16f8f542facc2ce313ba648cefddd--mahogany-color-chicken-breeds.jpg' loading='lazy' alt='description'>
			<br>With spangling + mottling
		</div>
		<div class='image'>
		    <img src='https://s3.amazonaws.com/images.ecwid.com/images/13267639/893677854.jpg' loading='lazy' alt='description'>
			<br>With black lacing
		</div>
		
	</div>
    <p>The mahogany mutation causes much more red pigment (phaeomelanin) to be produced. This results in a deep red colour, compared to the normal brown. It affects the ground colour only - no effect on pattern colour (eumelanin).</p>
    <p>The Rhode Island Red chicken breed is a famous example of the mahogany colour.</p>
    <p>If the chicken also carries a dilution mutation, which fades the ground...

CSS

img, div, button {
    box-sizing: border-box;
}

html, body {
    color: rgba(0, 0, 0, 0.7);
    font-family: 'Cabin', sans-serif;
}

.hidden, .hoverbox {
	display: none;
}

.round {
    border-radius: 5px;
    background-clip: padding-box;
}

.flex {
    display: flex;
    flex-flow: row wrap;
}
.between {
    justify-content: space-between;
}


.section {
	margin: 10px auto;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5);
	background-color: #fff;
    overflow: hidden;
}

.section .title {
	font-size: 25px;
    padding: 15px;
    cursor: pointer;
}

.section .content {
    padding: 15px;
}

.section .alleles {
	padding: 10px;
    min-width: 30%; /* Up to 3 loci in a line */
	display: flex;
	justify-content: center;
    align-items: center;
	background-color: #fff;
	font-size: 20px;
}

.section .alleles .allele {
	padding: 10px;
    background-color: rgba(255, 255, 255, 0.2);
	margin: 0px 10px;
	cursor: pointer;
	transition: 0.3s;
}

.section .alleles .allele:hover {
	background-color: rgba(255, 255, 255, 0.4);
	transition: 0.3s;
}

.section .images {
	margin: 10px auto;
	display: flex;
    flex-flow: row wrap;
	justify-content: space-evenly;
}

.section .image {
	text-align: center;
    /*width: 150px;*/
    margin: 5px;
}

.section .image img {
	height: 150px;
    width: auto;
	max-width: 250px;
    border-radius: 5px;
}

#locus_choc .title, #locus_choc .alleles {
    background-color: #996759;
    background-image: linear-gradient(to right, #7A5136, #A87B5C);
}
#locus_di .title, #locus_di .alleles {
    background-color: #EBD19F;
    background-image: linear-gradient(to right, #E6C283, #FAE7C5);
}
#locus_bl .title, #locus_bl .alleles {
    background-color: #9EA5B8;
    background-image: linear-gradient(to right, #717282, #C5C6D4);
}
#locus_mh .title, #locus_mh .alleles {
    background-color: #CF614B;
    background-image: linear-gradient(to right, #963B1C, #E3744F);
}
#locus_lav .title, #locus_lav .alleles {
    background-color: #E0D8E8;
   ...

JavaScript

$(".section .title").click(function(){
    var locus = $(this).data("locus");
    $("#locus_" + locus + " .content").toggleClass("hidden");
});