A new law urges parents to allow children time for rest and exercise, and restrict time spent online.