Skip to content

Commit a47d001

Browse files
Merge pull request #1 from mayankxjha/main
Gradient background
2 parents 16226c8 + b459872 commit a47d001

File tree

8 files changed

+51
-5
lines changed

8 files changed

+51
-5
lines changed

.idea/.gitignore

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/css-grad.iml

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/discord.xml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

script.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ let copyBtn = document.getElementById("copy-btn");
33
let outputColor = document.getElementById("output-color");
44
let outputCode = document.getElementById("output-code");
55
let hexString = "0123456789abcdef";
6+
let contMax = document.querySelector('.container-max')
67

78
let randomColor = () => {
89
let hexCode = "#";
@@ -18,6 +19,7 @@ let generateGrad = () => {
1819
let angle = Math.floor(Math.random() * 360);
1920
outputColor.style.background = `linear-gradient(${angle}deg, ${colorOne}, ${colorTwo})`;
2021
outputCode.value = `background: linear-gradient(${angle}deg, ${colorOne}, ${colorTwo});`;
22+
document.body.style.background = outputColor.style.background;
2123
}
2224

2325
copyBtn.addEventListener("click", () => {

style.css

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ body {
1414

1515
.wrapper {
1616
width: 410px;
17-
background-color: #ffffff;
17+
background-color: #000000;
1818
padding: 30px 30px;
1919
border-radius: 8px;
2020
position: absolute;
@@ -30,7 +30,7 @@ body {
3030
letter-spacing: 1px;
3131
font-family:'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
3232
font-size: 30px;
33-
color: #0558b7;
33+
color: #ffffff;
3434
}
3535

3636
#output-color {
@@ -40,14 +40,14 @@ body {
4040
}
4141

4242
#output-code {
43-
background-color: rgb(209, 203, 203);
43+
background-color: rgb(66, 66, 66);
4444
font-size: 2.7vmin;
4545
font-weight: 500;
46-
color: #044db4;
46+
color: #ffffff;
4747
width: 100%;
4848
padding: 15px 10px;
4949
border-radius: 5px;
50-
border: 1px solid #cfd5d5;
50+
/*border: 1px solid #cfd5d5;*/
5151
margin: 20px 0 40px 0;
5252
}
5353

0 commit comments

Comments
 (0)