Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions BackgroundGenerator/Shivam250702/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
This is a simple Background Generator Made using HTML,CSS and JS which allow user to input the color of its choice and change color from left to right.


![Alt text](image.png)
![Alt text](image-1.png)
![Alt text](image-2.png)
Binary file added BackgroundGenerator/Shivam250702/image-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BackgroundGenerator/Shivam250702/image-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BackgroundGenerator/Shivam250702/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions BackgroundGenerator/Shivam250702/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<title>Gradient Background</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body id="gradient">
<h1>Background Generator</h1>
<input class="color1" type="color" name="color1" value="#00ff00">
<input class="color2" type="color" name="color2" value="#ff0000">
<h2>Current CSS Background</h2>
<h3></h3>
<script type="text/javascript" src="script.js"></script>
</body>
</html>
21 changes: 21 additions & 0 deletions BackgroundGenerator/Shivam250702/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
var css = document.querySelector("h3");
var color1 = document.querySelector(".color1");
var color2 = document.querySelector(".color2");
var body = document.getElementById("gradient");
var n=prompt("1st value want");
var m=prompt("2nd,value want");
body.style.background="linear-gradient(to right, "+n+","+m+")";
function setGradient() {
body.style.background =
"linear-gradient(to right, "
+ color1.value
+ ", "
+ color2.value
+ ")";

css.textContent = body.style.background + ";";
}

color1.addEventListener("input", setGradient);

color2.addEventListener("input", setGradient);
27 changes: 27 additions & 0 deletions BackgroundGenerator/Shivam250702/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
body {
font: 'Raleway', sans-serif;
color: rgba(0,0,0,.5);
text-align: center;
text-transform: uppercase;
letter-spacing: .5em;
top: 15%;
background: linear-gradient(to right, red , yellow); /* Standard syntax */
}

h1 {
font: 600 3.5em 'Raleway', sans-serif;
color: rgba(0,0,0,.5);
text-align: center;
text-transform: uppercase;
letter-spacing: .5em;
width: 100%;
}

h3 {
font: 900 1em 'Raleway', sans-serif;
color: rgba(0,0,0,.5);
text-align: center;
text-transform: none;
letter-spacing: 0.01em;

}