From 545299c6454bdb0415c064b2a93cfd1ec14890be Mon Sep 17 00:00:00 2001 From: Grace Jemeli Date: Sun, 6 Jul 2025 08:35:12 +0300 Subject: [PATCH 1/2] update css file --- Change_Color_Background/css/style.css | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Change_Color_Background/css/style.css b/Change_Color_Background/css/style.css index 463dc06..3845613 100644 --- a/Change_Color_Background/css/style.css +++ b/Change_Color_Background/css/style.css @@ -1,3 +1,7 @@ button { - margin-top: 50vh + margin-top: 50vh margin-left: 80px; + color: yellow; + + + } \ No newline at end of file From 72b76a58071e3bbc3c2162f02ad30e733e3fdf14 Mon Sep 17 00:00:00 2001 From: Grace Jemeli Date: Sun, 6 Jul 2025 12:01:43 +0300 Subject: [PATCH 2/2] update script.js file --- Change_Color_Background/js/script.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Change_Color_Background/js/script.js b/Change_Color_Background/js/script.js index ea46b78..a5832f2 100644 --- a/Change_Color_Background/js/script.js +++ b/Change_Color_Background/js/script.js @@ -3,10 +3,10 @@ const button = document.querySelector('button') const body = document.querySelector('body') const colors = ['red', 'green', 'blue', 'yellow', 'pink', 'purple'] -body.style.backgroundColor = 'violet' +body.style.backgroundColor = 'Yellow' button.addEventListener('click', changeBackground) -function changeBackground(){ -const colorIndex= parseInt(Math.random()*colors.length+1) -body.style.backgroundColor = colors[colorIndex] +function changeBackground() { + const colorIndex = parseInt(Math.random() * colors.length + 1) + body.style.backgroundColor = colors[colorIndex] }