Scientific background
Sodium does not react with petrol but easily combines with water producing sodium hydroxide and hydrogen:
2Na + 2H2O → 2NaOH + H2
The hydrogen gas bubbles are formed when sodium touches the water, making the metal jump. Sodium hydroxide changes the pH of water to alkaline. This leads to consequent change of indicator color. It varies depending on the type of indicator: thymolphtalein becomes blue, phenolphthalein – pink, universal indicator turns color from red to violet.