JSFiddle - React, Tailwind, and code Playground
HTML
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Gallery</title>
<link rel="stylesheet" type="text/css" media="screen" href="css/gallery4.css">
<link rel="stylesheet" type="text/css" media="screen" href="css/shadows.css">
<script type="text/javascript" src="javascript/jquery-164.js"></script>
</head>
<body>
<div class="slideshow bot-side">
<div class="container">
<div class="loader"></div>
<ul>
<li class="current">
<div class="group-anim" style="width: 100%; height: 100%; position: absolute; top: 0px; left: 0;">
<img src="images/slide-1.jpg" />
</div>
</li>
<li>
<div class="group-anim" style="width: 100%; height: 100%; position: absolute; top: 0; left: 0;">
<img src="images/slide-2.jpg" />
</div>
</li>
<li>
<div class="group-anim" style="width: 100%; height: 100%; position: absolute; top: 0; left: 0;">
<img src="images/slide-3.jpg" />
</div>
</li>
<li>
<div class="group-anim" style="width: 100%; height: 100%; position: absolute; top: 0; left: 0;">
<img src="images/slide-4.jpg" />
</div>
</li>
<li>
<div class="group-anim" style="width: 100%; height: 100%; position: absolute; top: 0; left: 0;">
<img src="images/slide-5.jpg" />
</div>
</li>
<li>
<div class="group-anim" style="width: 100%; height: 100%; position: absolute; top: 0; left: 0;">
<img src="images/slide-6.jpg" />
</div>
</li>
<li>
<div...
CSS
* { margin: 0; padding: 0; }
body { background: #efefef; padding-top: 100px; }
.slideshow { background: white; width: 700px; height: 300px; padding:10px; margin: 0 auto; position: relative; box-shadow: 0px 0px 5px grey, 0px 10px 20px rgba(0,0,0,.1) inset; }
.container { background: #efefef; width: 100%; height: 100%; overflow: hidden; }
.container ul { list-style: none; position: relative; opacity: 0; }
.container ul li { width: 700px; height: 300px; position: absolute; top: 0; left: 0; overflow: hidden; z-index: 0; }
.container ul li.current { z-index: 1; }
.container ul li img { position: absolute; width: 100%; height: 100%; }
.pause { width: 100px; height: 30px; line-height: 32px; text-align: center; background: #363636; color: white; border: 3px solid white; position: absolute; bottom: -100px; left: 50%; margin-left: -50px; cursor: pointer; font-family: 'Arial'; font-weight: bold; box-shadow: 0px 0px 5px grey; }
.pause:hover { background: #434343; }
.loader { background: url(../images/loader.gif); background-size: 50px 50px; width: 50px; height: 50px; position: relative; top: 50%; left: 50%; margin-top: -25px; margin-left: -25px; }
.group-el { box-shadow: 2px 2px 3px black; }
.slideshow:before, .slideshow:after { content: " "; background: green; width: 50%; height: 50%; position: absolute; z-index: -10; }
/** Sides Bottom **/
.bot-side:before, .bot-side:after {width: 30px; box-shadow: -10px 0px 10px grey; -webkit-transform: rotate(5deg); bottom: 5px; left: 0px; }
.bot-side:after{ box-shadow: 10px 0px 10px grey; left: auto; right: 0px; -webkit-transform: rotate(-5deg); }
/** Curve side **/
.top-bot-curve:before, .top-bot-curve:after { width: 90%; height: 20%; left: 5%; bottom: 0; border-radius: 125px / 12px; box-shadow: 0 0 8px #555 }
.top-bot-curve:before { bottom: auto; top: 0; box-shadow: 0 0 8px #565656; }
/** bot-curve **/
.bot-curve:before, .bot-curve:after { width: 90%; height: 10px; left: 5%; bottom: 0; border-radius: 20% / 50%; box-shadow:...
JavaScript
// Variables
var clear = false;
var timer;
var tmpTimer;
var image_width = 700;
var image_height = 300;
var nC = 10;
var nL = 1;
var animation = 0;
var random = 0;
var prevRandom;
var firstAnim = true;
var liSize = $('.container li').size();
var $liPrev;
var $liNext;
// Animation Speed
var imgTime = 3000;
var timeOut = 100;
var animSpeed = 700;
var fadingTime = animSpeed + 100;
var imgInterval = imgTime;
// Check focus
var window_focus = true;
var focus = false;
$(window).focus(function() {
window_focus = true;
}).blur(function() {
window_focus = false;
focus = true;
});
$(window).load(function() {
init();
});
function init() {
imageOpacity();
checkWindowFocus();
setLiIds();
hideLoader();
log();
nextAnimation(imgTime, true);
}
function setGroupAnim(id, type) {
var $li = $('.container li#'+id);
var $gr = $li.find('.group-anim');
var imageNb = parseInt($li.attr('id'))+1;
switch(type){
// Quadratini
case 1: setValues(5,2, 100, 700, 0);
for(var i = 0, n = 0, line = 0; i < nC*nL; i++, n++){
if(i > 1 && i%nC == 0) { n = 0; line = i/nC; }
$gr.append('<div class="group-el" style="width: 0px; height: 0px; opacity: 0; border-radius: 50%; position: absolute; top: '+((line*image_height/nL)+(image_height/(nL*2)))+'px; left: '+((n*image_width/nC)+(image_width/(nC*2)))+'px; z-index: '+i+'; background-image: url(images/slide-'+imageNb+'.jpg); background-position: '+n*(-image_width/nC)+'px '+line*(-image_height/nL)+'px;"></div>');
} break;
// Cascata da sinistra a destra
case 2: setValues(14,1, 100, 700, 0);
for(var i = 0; i < nC; i++){
...