For this, we need the following nodes in this order: Texture Coordinate, two Gradient Textures, two Math nodes set to Multiply, a Combine XYZ, Mapping and another Math node set to Fraction.