Construction of spiropyrans via [4+2] photocycloaddition reactions and its computational investigation