https://www.dejal.com/timeout/ does this with a lot of flexibility.
I make my screen fade when I’ve worked for 90 min, with a call to action to take a quick walk. Also, every 20 minutes to look 20 feet away for 20 seconds.