@Meeesta I was looking create an effect similar to the mathisfun example you shared. I was successful by separating frequency from amplitude to generate the wave. So rather than:
const y = Math.sin(t + frequency) * amplitude); // Don't do this for this scenario
Instead I do this (pseudo code):
// calculate Y value
const frequencySpeed = frequency * deltaTime;
phase -= frequencySpeed; // cumulative phase shifts left
const y = Math.sin(phase + deltaTime) * amplitude;
// calculate X value
const waveSpeed = frequency * wavelength * deltaTime;
const x -= waveSpeed; // do this for each x value in your wave line
Here is a working example.
I am not sure the math is 100% accurate but it's close enough for my purposes.