JSFiddle - React, Tailwind, and code Playground
HTML
<section class="main">
<div class="ia-container">
<figure>
<img src="http://tympanus.net/Tutorials/CSS3ImageAccordion/images/1.jpg" alt="image01" />
<input type="radio" name="radio-set" checked="checked" />
<figcaption><span>True Colors</span>
</figcaption>
<figure>
<img src="http://tympanus.net/Tutorials/CSS3ImageAccordion/images/2.jpg" alt="image02" />
<input type="radio" name="radio-set" />
<figcaption><span>APO-UCOZ.COM</span>
</figcaption>
<figure>
<img src="http://tympanus.net/Tutorials/CSS3ImageAccordion/images/3.jpg" alt="image03" />
<input type="radio" name="radio-set" />
<figcaption><span>Silent Serenity</span>
</figcaption>
<figure>
<img src="http://tympanus.net/Tutorials/CSS3ImageAccordion/images/4.jpg" alt="image04" />
<input type="radio" name="radio-set" />
<figcaption><span>Warm Welcome</span>
</figcaption>
<figure>
<img src="http://tympanus.net/Tutorials/CSS3ImageAccordion/images/5.jpg" alt="image05" />
<input type="radio" name="radio-set" />
<figcaption><span>Sensible Magic</span>
</figcaption>
<figure>
<img src="http://tympanus.net/Tutorials/CSS3ImageAccordion/images/6.jpg" alt="image06" />
<input type="radio" name="radio-set" />
<figcaption><span>Lovely Midnight</span>
</figcaption>
<figure>
<img...
CSS
figure {
margin: 0;
-webkit-margin-before: 0;
-webkit-margin-after: 0;
-webkit-margin-start: 0;
-webkit-margin-end: 0;
}
.ia-container {
width: 485px;
margin: 20px auto;
overflow: hidden;
box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.08);
border: 7px solid rgba(255, 255, 255, 0.6);
}
.ia-container figure {
position: absolute;
top: 0;
left: 50px;
/* width of visible piece */
width: 3035px;
box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6);
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
-ms-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
}
.ia-container > figure {
position: relative;
left: 0 !important;
}
.ia-container img {
display: block;
width: 100%;
}
.ia-container input {
position: absolute;
top: 0;
left: 0;
width: 50px;
/* just cover visible part */
height: 100%;
cursor: pointer;
border: 0;
padding: 0;
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
opacity: 0;
z-index: 100;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}
.ia-container input:checked {
width: 5px;
left: auto;
right: 0px;
}
.ia-container input:checked ~ figure {
-webkit-transition: all 0.7s ease-in-out;
-moz-transition: all 0.7s ease-in-out;
-o-transition: all 0.7s ease-in-out;
-ms-transition: all 0.7s ease-in-out;
transition: all 0.7s ease-in-out;
left: 335px;
}
.ia-container figcaption {
width: 100%;
height: 100%;
background: rgba(87, 73, 81, 0.1);
position: absolute;
top: 0px;
-webkit-transition: all 0.2s linear;
-moz-transition: all 0.2s linear;
-o-transition: all 0.2s linear;
-ms-transition: all 0.2s linear;
transition: all 0.2s linear;
}
.ia-container figcaption span {
position: absolute;
top: 40%;
...