Skip to content
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

uploaded the code,opensource-Contribution #74

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
25 changes: 25 additions & 0 deletions increment&decrement-js-project/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Increment and Decrement</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="btnbox">
<button onclick="off()" class="offbtn">Off Glow</button>
<button onclick="onglow()" class="onbtn">On Glow</button>
</div>
<div class="output">
</div>
<div class="box">
<button onclick="decrement()" class="decrementbtn">-</button>
<button onclick="increment()" class="incrementbtn">+</button>
</div>



<script src="main.js"></script>
</body>
</html>
54 changes: 54 additions & 0 deletions increment&decrement-js-project/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
let num = 0;
function increment(){
let value = ++num;
console.log(value);

document.querySelector(".output").innerHTML = value;
}
increment()


function decrement(){
let value2 = --num;
console.log(num);
document.querySelector(".output").innerHTML = value2;
}
decrement()

function onglow(){
let glow = document.querySelector(".output");

if (glow) { // Check if the element exists
if (glow.style.webkitBoxShadow === "" || glow.style.webkitBoxShadow === "none") {
// Apply styles if the box shadow is not applied or is set to "none"
glow.style.backgroundColor = "rgba(46,241,255,0.9)";
glow.style.webkitBoxShadow = "0px 0px 105px 45px rgba(46,241,255,0.9)";

glow.style.transition = "ease-in-out .5s";
} else {
glow.style.webkitBoxShadow = "none";
console.log("Stop");
}

console.log("clicked");
}
}

onglow()
function off(){
let glow = document.querySelector(".output");

if (glow) { // Check if the element exists
if (!glow.style.webkitBoxShadow === "" || glow.style.webkitBoxShadow === "none") {
// Apply styles if the box shadow is not applied or is set to "none"
glow.style.webkitBoxShadow = "none";
} else {
glow.style.webkitBoxShadow = "none";

}

console.log("clicked2");
}
}

off()
95 changes: 95 additions & 0 deletions increment&decrement-js-project/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
body{
margin: 0;
padding: 0;
background-color: #1D2B53;
font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
}

.box{
text-align: center;
margin: 0 auto;
margin-top: 100px;

}

.output{
font-size: 50px;
line-height: 200px;
text-align: center;
margin: 0 auto;
width: 200px;
height: 200px;
/* background-color: rgba(46,241,255,0.9); */
margin-top: 100px;
border-radius: 100%;
/* -webkit-box-shadow:0px 0px 105px 45px rgba(46,241,255,0.9);
-moz-box-shadow: 0px 0px 105px 45px rgba(46,241,255,0.9);
box-shadow: 0px 0px 105px 45px rgba(46,241,255,0.9); */
}

.btnbox{
text-align: center;
margin: 0 auto;
margin-top: 50px;
}

.onbtn{
font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
background-color: #ffee00;
border: none;
width: 150px;
height: 55px;
font-size: 20px;
border-radius: 10px;
cursor: pointer;
}

.offbtn{
font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
background-color: #ffffff;
border: none;
width: 150px;
height: 55px;
font-size: 20px;
border-radius: 10px;
margin-right: 100px;
cursor: pointer;
}


.decrementbtn{
font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
background-color: #fe0000;
border: none;
width: 150px;
height: 55px;
font-size: 40px;
border-radius: 10px;
margin-right: 100px;
cursor: pointer;
}

.decrementbtn:hover{
-webkit-box-shadow:0px 0px 105px 45px rgba(254,0,0,0.9);
-moz-box-shadow: 0px 0px 105px 45px rgba(254,0,0,0.9);
box-shadow: 0px 0px 105px 45px rgba(254,0,0,0.9);
transition: 1s ease-in-out;
}

.incrementbtn{
font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
background-color: #15ff00;
border: none;
width: 150px;
height: 55px;
font-size: 40px;
border-radius: 10px;
cursor: pointer;
}

.incrementbtn:hover{
-webkit-box-shadow:0px 0px 105px 45px rgba(21,255,0,0.9);
-moz-box-shadow: 0px 0px 105px 45px rgba(21,255,0,0.9);
box-shadow: 0px 0px 105px 45px rgba(21,255,0,0.9);
transition: 1s ease-in-out;
}