Here is the full running demo and source code for the JavaScript Tetris implementation found here.
See the Pen Tetris Skeleton by Walter Guevara (@ThatSoftwareDude) on CodePen.