From 46efa091d093a7a11231ead83b3a1dd298e5ff00 Mon Sep 17 00:00:00 2001 From: Katie Kiselova Date: Mon, 10 Jun 2024 11:25:35 +0100 Subject: [PATCH 1/2] Added ColorChanger project --- ColorChanger/index.html | 39 +++++++++++++++ ColorChanger/script.js | 19 ++++++++ ColorChanger/style.css | 105 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 163 insertions(+) create mode 100644 ColorChanger/index.html create mode 100644 ColorChanger/script.js create mode 100644 ColorChanger/style.css diff --git a/ColorChanger/index.html b/ColorChanger/index.html new file mode 100644 index 000000000..05a013c33 --- /dev/null +++ b/ColorChanger/index.html @@ -0,0 +1,39 @@ + + + + + + + Color Generator + + + + +
+

Color Changer

+

CLICK ANY ONE OF THESE ELEMENTS

+
+
+
+
+
+
+
+ +
+
+ R +
+
+ G +
+
+ B +
+ rgb(0, 0, 0) + + + + + + \ No newline at end of file diff --git a/ColorChanger/script.js b/ColorChanger/script.js new file mode 100644 index 000000000..be580488e --- /dev/null +++ b/ColorChanger/script.js @@ -0,0 +1,19 @@ +function colors() { + var red = document.getElementById("red").value; + var green = document.getElementById("green").value; + var blue = document.getElementById("blue").value; + document.body.style.backgroundColor = + "rgb(" + red + "," + green + "," + blue + ")"; + document.getElementById("output").innerHTML = + "rgb(" + red + "," + green + "," + blue + ")"; +} + +function myFunction() { + document.getElementById("myDIV").style.backgroundColor = "lightblue"; +} + +document.querySelectorAll(".pallet").forEach((pallet) => { + pallet.addEventListener("click", () => { + document.body.style.backgroundColor = pallet.getAttribute("data-color"); + }); +}); diff --git a/ColorChanger/style.css b/ColorChanger/style.css new file mode 100644 index 000000000..1564bc399 --- /dev/null +++ b/ColorChanger/style.css @@ -0,0 +1,105 @@ +*, +*::after, +*::before { + box-sizing: border-box; + margin: 0; + padding: 0; +} + +body { + background-color: #142b37; +} + +.random-element { + width: 60%; + border: 4px solid black; + margin: 2em auto; + padding: 1em; + border-radius: 10px; + background-color: white; +} + +h1 { + font-size: 100px; + margin-bottom: 0.2em; +} + +h1, +h2 { + text-align: center; +} + +h2 { + font-weight: 500; +} + +.color-pallets-div { + display: flex; + align-items: center; + gap: 1em; + justify-content: center; + margin-top: 1.5em; +} + +.pallet { + cursor: pointer; + width: 55px; + height: 55px; + border-radius: 7px; + background-color: blue; +} + +[data-color="red"] { + background-color: red; +} + +[data-color="green"] { + background-color: green; +} + +[data-color="purple"] { + background-color: purple; +} + +.container { + background-color: #ffffff; + position: absolute; + transform: translate(-50%, -50%); + top: 50%; + left: 50%; + width: 60%; + padding: 20px 0; + box-shadow: 20px 20px 30px rgba(0, 0, 0, 0.2); + font-family: "Work Sans", sans-serif; + font-size: 20px; + font-weight: 500; + color: #142b37; + border-radius: 5px; + display: grid; + justify-items: center; + margin-top: 6em; +} + +.wrapper { + width: 100%; + text-align: center; +} + +input[type="range"] { + display: inline-block; + width: 80%; + margin-left: 10px; + margin-top: 25px; +} + +span { + display: inline-block; + text-align: center; + margin: 20px 0; + background-color: #0075ff; + color: #ffffff; + padding: 10px 30px; + font-size: 18px; + letter-spacing: 0.5px; + border-radius: 2px; +} From 05f64a4e282fe9accc3f1a9c46834889552b036d Mon Sep 17 00:00:00 2001 From: kiselova Date: Mon, 10 Jun 2024 18:56:30 +0100 Subject: [PATCH 2/2] colochanger updated --- {ColorChanger => ColorChanger-MiniApp/kiselova}/index.html | 0 {ColorChanger => ColorChanger-MiniApp/kiselova}/script.js | 0 {ColorChanger => ColorChanger-MiniApp/kiselova}/style.css | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename {ColorChanger => ColorChanger-MiniApp/kiselova}/index.html (100%) rename {ColorChanger => ColorChanger-MiniApp/kiselova}/script.js (100%) rename {ColorChanger => ColorChanger-MiniApp/kiselova}/style.css (100%) diff --git a/ColorChanger/index.html b/ColorChanger-MiniApp/kiselova/index.html similarity index 100% rename from ColorChanger/index.html rename to ColorChanger-MiniApp/kiselova/index.html diff --git a/ColorChanger/script.js b/ColorChanger-MiniApp/kiselova/script.js similarity index 100% rename from ColorChanger/script.js rename to ColorChanger-MiniApp/kiselova/script.js diff --git a/ColorChanger/style.css b/ColorChanger-MiniApp/kiselova/style.css similarity index 100% rename from ColorChanger/style.css rename to ColorChanger-MiniApp/kiselova/style.css