diff --git a/112- Color Changer/img.png b/112- Color Changer/img.png new file mode 100644 index 00000000..3a3f5b14 Binary files /dev/null and b/112- Color Changer/img.png differ diff --git a/112- Color Changer/index.html b/112- Color Changer/index.html new file mode 100644 index 00000000..38dfb46c --- /dev/null +++ b/112- Color Changer/index.html @@ -0,0 +1,26 @@ + + + + + + + Document + + + +
+

+ Random Color Generator +

+
+
+ +
+

#fff

+ +
+
+ + + + \ No newline at end of file diff --git a/112- Color Changer/script.js b/112- Color Changer/script.js new file mode 100644 index 00000000..e7a0ac22 --- /dev/null +++ b/112- Color Changer/script.js @@ -0,0 +1,19 @@ +const getcolor=()=>{ + const randomNUM=Math.floor(Math.random()*16777215); + + //converting random number to hexadecimal + const randomCode="#"+randomNUM.toString(16); + + //accessing background color + document.body.style.backgroundColor=randomCode; + + //changing color hexadecimal name + document.getElementById('color-code').innerHTML=randomCode; + + //used to copy to the clipborad + navigator.clipboard.writeText(randomCode); + +} + +document.getElementById("btn").addEventListener("click", getcolor); +getcolor(); \ No newline at end of file diff --git a/112- Color Changer/style.css b/112- Color Changer/style.css new file mode 100644 index 00000000..f6ec5c21 --- /dev/null +++ b/112- Color Changer/style.css @@ -0,0 +1,55 @@ +*{ + padding: 0; + margin: 0; + box-sizing: border-box; + font-family: 'Roboto',sans-serif; +} + +body{ + background-color: black; + transition: 0.5s; +} +.main{ + width: 100%; + height: 80vh; + display: flex; + justify-content: center; + align-items: center; +} + +.container{ + width: 30rem; + /* height: 100vh; */ + padding: 10px; + border-radius: 10px; + background-color: white; + text-align: center; +} + +button{ +margin-top: 5px; +width: 100%; +background-color: black; +color: aliceblue; +border: none; +border-radius: 5px; +display: block; +font-size: 35px; +} +button:hover{ + cursor: pointer; +} + +.name{ + justify-content: center; + text-align: center; + display: flex; + padding-top: 100px; +} + +#str{ + font-size:xx-large; + font-weight: bolder; + font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif; + font-style:normal; +} \ No newline at end of file diff --git a/index.html b/index.html index 7e7479fd..2e26cf40 100644 --- a/index.html +++ b/index.html @@ -1090,7 +1090,7 @@

Maths addition

- Number Facts + Color Changer

Number Facts

@@ -1119,6 +1119,16 @@

Luminosity Particle Js

+
+ Dynamic Form Field +

Color Changer

+ + + + +
+