on the spur of the moment思いつきで、計画なしに、その場の勢いで
"I didn't know what I was doing. I did it on the spur of the moment"?