-
You are required to provide the code for an application that simulates a set of traffic lights at an intersection.
-
The traffic lights are designated (N, S) and (E, W) like a compass.
-
When switching from green to red, the yellow light must be displayed for 30 seconds prior to it switching to red. The lights will change automatically every 5 minutes.
-
You're not required to optimize the solution, just focus on a functional approach to requirements.
-
Provide the output for the light changes which occur during a given thirty minute period.
- Set the time frame of animations shorter to see:
Are the traffic lights animations working correctly for both North South and East West? (Yes)
-
Review the code: index.html, style1.css and main.js (the animation run for 6 times as required)
-
Please visit the demo here: https://amandakitsam.github.io/traffic-lights/
-
@keyframes
for the animation: controls the intermediate steps in a CSS animation sequence -
Review the code: index2.html and style2.css
-
Using jQuery for this project - Set time efficiency
-
Using CSS @keyframes for this project - Create smooth animation effects
- The first set of the traffic lights (North & South) are green.
The second set of the traffic lights (East & West) are red.
-
The first set of the traffic lights (North & South) will stay green for 4 minutes & 30 seconds (270s).
(After 270s) Green -> Yellow. The yellow lights will stay for 30 seconds. -
The second set of the traffic lights (East & West) will stay red for 5 minutes (300s).
-
After 30 seconds, the first set of the traffic lights (North & South) will turn from yellow to red.
-
At the same time, the second set of the traffic lights (East & West) will turn from red to green.
-
The second set of the traffic lights (East & West) will stay green for the next 4 minutes & 30 seconds.
(After 270s) Green -> Yellow. The yellow lights will stay for 30 seconds. -
The first set (North & South) will stay red for 5 minutes.
-
After 30 seconds, the second set of the traffic lights (East & West) will turn from yellow to red.
-
At the same time, the first set of the traffic lights (North & South) will turn from red to green.
-
In thirty minute period (as the requirement), both sets of the traffic lights switch lights 6 times.
-
A message will appear on the page at the end of the animation.
"This is the end of the traffic lights animation."
Copyright (c) 2017 Amanda Sam