Electric-field, strain, and bandgap gradient in van der Waals semiconductors for advanced devices