Create DynamicMask in JS