Light-triggered β-hairpin folding and unfolding