diff --git a/css/style.css b/css/style.css index 2d8d793..dea8723 100644 --- a/css/style.css +++ b/css/style.css @@ -39,3 +39,4 @@ h1 { margin: 25px auto; transition: background 500ms; } + diff --git a/index.html b/index.html index 0180c07..0406321 100644 --- a/index.html +++ b/index.html @@ -23,5 +23,8 @@

Go

+ + + diff --git a/js/index.js b/js/index.js new file mode 100644 index 0000000..61721ba --- /dev/null +++ b/js/index.js @@ -0,0 +1,28 @@ +$(document).ready(function(){ + + $('#stopButton').click(illuminateRed); + $('#slowButton').click(illuminateYellow); + $('#goButton').click(illuminateGreen); + + function illuminateRed() { + clearLights(); + $('#stopLight').css('backgroundColor', 'red'); + } + + function illuminateYellow() { + clearLights(); + $('#slowLight').css('backgroundColor', 'yellow'); + } + + function illuminateGreen() { + clearLights(); + $('#goLight').css('backgroundColor', 'green'); + } + + function clearLights() { + $('#stopLight').css('backgroundColor', 'black'); + $('#slowLight').css('backgroundColor', 'black'); + $('#goLight').css('backgroundColor', 'black'); + } + +}); \ No newline at end of file