Friday, 18 October 2019

CSS Locker_working

CSS LOCKER_WORKING

image of output
Image of Output
HTML:
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<p>Input password and then click on the wheel to open or close the Locker.
<br>pwd:"78901"{to open}
<br>pwd:"78902"{to close}
</p>
<div id="all">
<div class="outer">
<div class="logo"></div>
<input type="number" id="result">
<div class="handel"></div>
<button id="wheel" onclick="solve()"></button>
</div>
</div>
<div id="mall">
<div class="ball"></div>
<div class="stand"></div>
</div>
</body>
</html>
view raw Locker.html hosted with ❤ by GitHub

CSS:
body {
background-color: #1abc9c;
}
p {
text-align: center;
color: #bb1261;
font-size: 1.5em;
font-weight: bolder;
}
#all {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 2;
}
.outer {
background-color: #34495e;
width: 175px;
height: 136px;
border-radius: 10px;
border-bottom: 6px solid #2c3e50;
}
.logo {
margin-left: 5px;
margin-top: 5px;
float: left;
width: 40px;
height: 20px;
background-image: url("https://i.ibb.co/TMPw4Qy/796px-Godrej-Logo-svg.png");
background-size: 105%;
}
#result {
width: 40px;
height: 10px;
float: right;
margin-right: 5px;
margin-top: 5px;
border: 1px solid #2c3e50;
box-shadow: inset 3px 3px lightgray;
}
.handel {
width: 15px;
height: 15px;
border-radius: 15px;
background-color: #2c3e50;
position: relative;
top: 30px;
left: 20px;
}
.handel:before {
width: 15px;
height: 15px;
border-radius: 15px;
background-color: #2c3e50;
position: absolute;
content: " ";
top: 80px;
left: 0px;
}
.handel:after {
content: " ";
width: 8px;
height: 85px;
background: linear-gradient(
#cfd8dc 0px 15px,
#95a5a6 15px 70px,
#7f8c8d 70px 85px
);
position: absolute;
top: 5px;
left: 3.5px;
}
#wheel {
width: 9px;
height: 85px;
background: -webkit-linear-gradient(
left,
#95a5a6 0px 4.5px,
#cfd8dc 4.5px 9px
);
position: relative;
left: 65px;
top: 20px;
outline: none;
}
#wheel:before {
content: " ";
width: 9px;
height: 85px;
transform: rotate(90deg);
background: -webkit-linear-gradient(
right,
#95a5a6 0px 4.5px,
#cfd8dc 4.5px 9px
);
position: absolute;
top: 0px;
}
#wheel:after {
width: 75px;
height: 75px;
border-radius: 75px;
background-color: transparent;
position: absolute;
content: " ";
border: 10px solid #bdc3c7;
left: -43px;
bottom: -3px;
box-shadow: inset 2px 6px black, 2px 6px black;
}
.stand {
position: relative;
left: 20px;
width: 25px;
height: 7px;
background-color: #2c3e50;
}
.stand:before {
position: absolute;
content: " ";
width: 25px;
height: 7px;
background-color: #2c3e50;
left: 100px;
}
.ball {
background-color: silver;
width: 170px;
height: 138px;
border-radius: 10px;
border: 2px solid black;
}
.ball:before {
width: 96px;
height: 65px;
background-color: #34495e;
position: absolute;
content: " ";
top: 3px;
left: px;
border-top: 36px solid #7f8c8d;
border-bottom: 36px solid #b0bec5;
border-left: 37px solid #95a5a6;
border-right: 37px solid #95a5a6;
border-radius: 10px;
}
#mall {
position: absolute;
top: 50.4%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 1;
}
view raw Locker.css hosted with ❤ by GitHub

JAVA-SCRIPT:
function solve() {
let x = document.getElementById("result").value;
if (x == "78901") {
h = document.getElementById("all");
h.style.left = "10%";
document.getElementById("result").value = " ";
} else if (x == "78902") {
document.getElementById("all").style.left = "50%";
document.getElementById("result").value = " ";
} else {
alert("Incorrect-Password");
document.getElementById("result").value = " ";
}
}
view raw Locker.js hosted with ❤ by GitHub

OUTPUT:
Share:

Related Posts:

No comments:

Post a Comment