Skip to content

Pez CSS KeyFrames #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 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
2 changes: 2 additions & 0 deletions GradientChecker/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
47 changes: 47 additions & 0 deletions GradientChecker/css/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
@import url('https://fonts.googleapis.com/css2?family=Poppins&display=swap');

*{
margin: 0;
padding: 0;
box-sizing: border-box;
}

body{
font-family: 'Poppins';
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
}

.content {
background: rgb(22 22 22 / 30%);
padding: 2rem;
box-shadow: 5px 5px 10px 0px rgb(22 22 22 / 70%);
border-radius: 5px;
height: 80vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
font-weight: 400;
text-transform: uppercase;
letter-spacing: 2px;
}

#change_bg {
cursor: pointer;
outline: none;
border: 1px solid #161616;
padding: 10px 20px;
color: #161616;
background: transparent;
font-family: 'Poppins';
}
button#change_bg:hover {
background: #161616;
color: #fff;
transition: .7s;
}

39 changes: 39 additions & 0 deletions GradientChecker/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>BG Gradient Checker</title>
<link rel="stylesheet" href="css/main.css">
</head>
<body>

<div class="content">

<div class="title">
<h1>BG Gradient Checker</h1>
</div>

<table>
<tr><strong>Please Start Hexcode With "#"</strong></tr>
<tr>
<td><label for="gradient_direction">Direction : </label></td>
<td><input type="text" placeholder="for ex : (top, right, bottom, left)" id="gradient_direction"></td>
</tr>
<tr>
<td><label for="first_hex">First Hex Code : </label></td>
<td><input type="text" id="first_hex"></td>
</tr>
<tr>
<td><label for="second_hex">Second Hex Code : </label></td>
<td><input type="text" id="second_hex"></td>
</tr>
</table>
<button id="change_bg">Check Gradeint</button>

</div>


<script src="js/script.js"></script>
</body>
</html>
17 changes: 17 additions & 0 deletions GradientChecker/js/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
let body = document.getElementsByTagName("BODY")[0];
let gradientDirection = document.querySelector("#gradient_direction");
let firstHex = document.querySelector("#first_hex");
let secondHex = document.querySelector("#second_hex");
let changeBg = document.querySelector("#change_bg");
let content = document.querySelector(".content");

changeBg.addEventListener("click", colorChange)

function colorChange(){
// body.style.background = 'linear-gradient(to right, '
// + firstHex.value + ', ' + secondHex.value + ')';
body.style.background = `linear-gradient(to ${gradientDirection.value} , ${firstHex.value} , ${secondHex.value})`;
content.style.color = "#fff";
changeBg.style.border = "1px solid #fff";
changeBg.style.color = "#fff";
}