JSFiddle - React, Tailwind, and code Playground
by Juan Muñoz
HTML
<div class="slider">
<input type="radio" name="slide_switch" id="id1" checked="checked"/>
<label for="id1">
<img src="http://www.gouganebarrahotel.com/uploads/images/headerimages/Around%20here/Ring%20Of%20Kerry/Slea-headDingle-CoKerry.jpg" width="100"/>
</label>
<img src="http://www.gouganebarrahotel.com/uploads/images/headerimages/Around%20here/Ring%20Of%20Kerry/Slea-headDingle-CoKerry.jpg"/>
<div id="d-slide1">
<div class="description">
<div class="description-text">
<h2>Slideshow Title 1</h2>
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut</p>
</div>
</div>
</div>
<!--input type="radio" name="slide_switch" id="id1" checked="checked"/>
<div class="description">
<div class="description-text">
</div>
</div-->
<input type="radio" name="slide_switch" id="id2"/>
<label for="id2">
<img src="http://www.gouganebarrahotel.com/uploads/images/headerimages/Around%20here/Ring%20Of%20Kerry/Clogher-Head.jpg" width="100"/>
</label>
<img src="http://www.gouganebarrahotel.com/uploads/images/headerimages/Around%20here/Ring%20Of%20Kerry/Clogher-Head.jpg"/>
<div id="d-slide2">
<div class="description">
<div class="description-text">
<h2>Slideshow Title 1</h2>
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut</p>
</div>
</div>
...
CSS
.slider{
width: 1080px; /*Same as width of the large image*/
position: relative;
/*Instead of height we will use padding*/
padding-top: 470px; /*That helps bring the labels down*/
text-align:center;
margin: 18px auto;
height:0;
/*Lets add a shadow*/
box-shadow: 0 10px 15px -5px rgba(0, 0, 0, 0.75);
}
/*Last thing remaining is to add transitions*/
.slider>img{
position: absolute;
left: 0; top: 0;
transition: all 0.5s;
}
.slider input[name='slide_switch'] {
display: none;
}
.slider label {
/*Lets add some spacing for the thumbnails*/
margin: 18px 0 0 16px;
border: 3px solid #999;
display:inline-block;
cursor: pointer;
transition: all 0.5s;
/*Default style = low opacity*/
opacity: 0.6;
}
.slider label:hover {
opacity: 1;
}
.slider label img{
display: block;
}
/*Time to add the click effects*/
.slider input[name='slide_switch']:checked+label {
border-color: #666;
opacity: 1;
}
/*Clicking any thumbnail now should change its opacity(style)*/
/*Time to work on the main images*/
.slider input[name='slide_switch'] ~ img {
opacity: 0;
transform: scale(1.1);
}
/*That hides all main images at a 110% size
On click the images will be displayed at normal size to complete the effect
*/
.slider input[name='slide_switch']:checked+label+img {
opacity: 1;
transform: scale(1);
}
/*Clicking on any thumbnail now should activate the image related to it*/
#d-slide1{visibility:hidden; display:inline-block;}
#d-slide2{visibility:hidden; display:inline-block;}
#d-slide3{visibility:hidden; display:inline-block;}
#d-slide4{visibility:hidden; display:inline-block;}
#d-slide5{visibility:hidden; display:inline-block;}
#d-slide6{visibility:hidden; display:inline-block;}
#d-slide7{visibility:hidden; display:inline-block;}
.description {
text-align:left;
position: absolute;
bottom: 0;
left: 0;
width: 100%;
font-family: 'PT Sans', sans-serif;
z-index: 1000;
}
.description-text {
background-color: rgba(0,0,0,.8);
...