JSFiddle - React, Tailwind, and code Playground
HTML
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" id="svg" version="1.1" style="width: auto; height: 50vh;">
<rect x="0" y="0" width="1" height="100" style="fill:#000; stroke-width:0;"></rect>
<rect x="2" y="0" width="1" height="100" style="fill:#000; stroke-width:0;"></rect>
<rect x="4" y="0" width="1" height="100" style="fill:#000; stroke-width:0;"></rect>
<rect x="6" y="0" width="1" height="100" style="fill:#000; stroke-width:0;"></rect>
<rect x="8" y="0" width="1" height="100" style="fill:#000; stroke-width:0;"></rect>
<rect x="10" y="0" width="1" height="100" style="fill:#000; stroke-width:0;"></rect>
<rect x="12" y="0" width="1" height="100" style="fill:#000; stroke-width:0;"></rect>
<rect x="14" y="0" width="1" height="100" style="fill:#000; stroke-width:0;"></rect>
<rect x="16" y="0" width="1" height="100" style="fill:#000; stroke-width:0;"></rect>
<rect x="18" y="0" width="1" height="100" style="fill:#000; stroke-width:0;"></rect>
<rect x="20" y="0" width="1" height="100" style="fill:#000; stroke-width:0;"></rect>
<rect x="22" y="0" width="1" height="100" style="fill:#000; stroke-width:0;"></rect>
<rect x="24" y="0" width="1" height="100" style="fill:#000; stroke-width:0;"></rect>
<rect x="26" y="0" width="1" height="100" style="fill:#000; stroke-width:0;"></rect>
<rect x="28" y="0" width="1" height="100" style="fill:#000; stroke-width:0;"></rect>
<rect x="30" y="0" width="1" height="100" style="fill:#000; stroke-width:0;"></rect>
<rect x="32" y="0" width="1" height="100" style="fill:#000; stroke-width:0;"></rect><rect x="34" y="0" width="1" height="100" style="fill:#000; stroke-width:0;"></rect><rect x="36" y="0" width="1" height="100" style="fill:#000; stroke-width:0;"></rect><rect x="38" y="0" width="1" height="100" style="fill:#000; stroke-width:0;"></rect><rect x="40" y="0" width="1" height="100" style="fill:#000; stroke-width:0;"></rect><rect x="42" y="0" width="1"...
JavaScript
$(function() {
var iwork = false;
$('#svg rect').each(function (i,el) {
$(this).attr('transform','scale(1,1)');
});
$('body').on('mousemove',function () {
if(iwork == false){
iwork = true;
$('#svg rect').each(function (i,el) {
var h = 100;
rand = Math.floor((Math.random() * 100) + 1);
h = rand;
var scale = rand/100;
var y = (100 - rand)/2;
$(this).css('y',50);//Should be half of viewbox height
$(this).animate({
height: rand,
y: y,
}, 2000,function () {
iwork = false;
});
});
}
})
});