Here’s a proof of concept to get you going. I think it covers most of the basics you’re looking for:
- Query Google Maps for traffic time of Route 1
- Currently hard coded, but you can easily change this.
- Query Google Maps for traffic time of Route 2
- Display whichever route is fastest
- If Route 2 is faster than Route 1, display it in RED
- If it’s not morning time, don’t display
- Instead, it redirects to a pretty mountain.
- You could make it display nothing, but the tiles have a fundamental shadow on them, so even if you make it render nothing, you’ll still see the slight shadow outline of the media tile. Hence, the recommendation of just displaying an image of your choice.
Here’s the project on Glitch which makes it easy for you to ‘Remix’ the project and edit it to fit your needs.