In principle, you do not have much to do with CSS in this case, and an embedded video or animation would probably be better.
In order not to be completely without solution, I set up an example of image manipulation with JS and Canvas:
function distorce(idOriginal, idDistorcido, porcentagem) {
var original = document.getElementById(idOriginal);
var ctx = original.getContext('2d');
var pxO= ctx.getImageData(0, 0, canvas.width, canvas.height);
var distorcido = document.getElementById(idDistorcido);
var ctx = distorcido.getContext('2d');
var pxD = ctx.getImageData(0, 0, canvas.width, canvas.height);
for(var y = 0; y < original.height; y++) {
for(var x = 0; x < original.width; x++) {
var cx = x-original.width/2;
var cy = y-original.height/2;
var r = Math.sqrt(cx*cx+cy*cy);
var maxr = Math.min(original.width,original.height)/2;
if (r>maxr) {
var dx = x;
var dy = y;
} else {
var a = Math.atan2(cx,cy);
var k = (r/maxr)*(r/maxr)*porcentagem/200+(200-porcentagem)/200;
var dx = Math.floor(Math.cos(a)*r*k+maxr);
var dy = Math.floor(Math.sin(a)*r*k+maxr);
}
pxD.data[(x+y*original.width)*4 ] = pxO.data[(dx+dy*original.width)*4 ];
pxD.data[(x+y*original.width)*4+1] = pxO.data[(dx+dy*original.width)*4+1];
pxD.data[(x+y*original.width)*4+2] = pxO.data[(dx+dy*original.width)*4+2];
pxD.data[(x+y*original.width)*4+3] = pxO.data[(dx+dy*original.width)*4+3];
}
}
ctx.putImageData(pxD, 0, 0);
}
I took some of the formula from this address , but practically remake the rest so that the function is "adjustable" by a parameter.
Worth noting is a proof of concept, and that for animation, this kind of distortion is a bit costly to justify its use.
Live test CODEPEN .