Eco-friendly visible-wavelength photodetectors based on bandgap engineerable nanomaterials