Text this: Single-shot on-chip spectral sensors based on photonic crystal slabs