So its been awhile since I made this, so my explanation might be a bit rusty.
The outer loop runs for each line. The inner loop runs for each segment of the line.
The "const c = .." expression is the scaling factor responsible for the taper at the top and bottom. If you plot the expression it look like this: https://www.desmos.com/calculator/tdsynrhv5i
You could use even power (2,4,6..) to get the same result, but 2 is what I looked
If you set c = 1, there will be no taper.
The Math.sin(....) term generates the wavy pattern. The t/50 term animates the waves over time. The j/10 causes each line to be slightly offset from each other.
Other than that, all the other numbers are just trial and error to find something that I though looked nice.