Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div id="pin">
- <div class="dots">
- <div class="dot"></div>
- <div class="dot"></div>
- <div class="dot"></div>
- <div class="dot"></div>
- <div class="dot"></div>
- <div class="dot"></div>
- </div>
- <p>Enter PIN Number</p>
- <div class="numbers">
- <div class="number">1</div>
- <div class="number">2</div>
- <div class="number">3</div>
- <div class="number">4</div>
- <div class="number">5</div>
- <div class="number">6</div>
- <div class="number">7</div>
- <div class="number">8</div>
- <div class="number">9</div>
- </div>
- </div>
- <style>
- body {
- background: #ffffff80;
- display: -webkit-box;
- display: -webkit-flex;
- display: -ms-flexbox;
- display: flex;
- -webkit-box-align: center;
- -webkit-align-items: center;
- -ms-flex-align: center;
- align-items: center;
- -webkit-box-pack: center;
- -webkit-justify-content: center;
- -ms-flex-pack: center;
- justify-content: center;
- font-family: Open Sans;
- }
- body.wrong {
- -webkit-animation: bg-red 1s ease-in;
- animation: bg-red 1s ease-in;
- }
- body.correct {
- -webkit-animation: bg-green 1s ease-in;
- animation: bg-green 1s ease-in;
- }
- #pin {
- background: #212121;
- width: 18em;
- display: -webkit-box;
- display: -webkit-flex;
- display: -ms-flexbox;
- display: flex;
- -webkit-box-pack: center;
- -webkit-justify-content: center;
- -ms-flex-pack: center;
- justify-content: center;
- -webkit-box-align: center;
- -webkit-align-items: center;
- -ms-flex-align: center;
- align-items: center;
- -webkit-box-orient: vertical;
- -webkit-box-direction: normal;
- -webkit-flex-direction: column;
- -ms-flex-direction: column;
- flex-direction: column;
- padding: 0.5em;
- border-radius: .3em;
- box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.3);
- margin: auto;
- color: rgba(255, 255, 255, 0.4);
- }
- .dots {
- width: 50%;
- display: -webkit-box;
- display: -webkit-flex;
- display: -ms-flexbox;
- display: flex;
- -webkit-justify-content: space-around;
- -ms-flex-pack: distribute;
- justify-content: space-around;
- padding: 1em;
- padding-top: 2em;
- }
- .dot {
- position: relative;
- background: rgba(255, 255, 255, 0.3);
- border-radius: 0.8em;
- width: 0.8em;
- height: 0.8em;
- -webkit-transform: scale3d(0.7, 0.7, 0.7);
- transform: scale3d(0.7, 0.7, 0.7);
- }
- .dot.active {
- -webkit-animation: growDot .5s ease;
- animation: growDot .5s ease;
- -webkit-animation-fill-mode: forwards;
- animation-fill-mode: forwards;
- }
- .dot.wrong {
- -webkit-animation: wrong .9s ease;
- animation: wrong .9s ease;
- }
- .dot.correct {
- -webkit-animation: correct .9s ease;
- animation: correct .9s ease;
- }
- #pin p { font-size: 1.2em; }
- .numbers {
- display: -webkit-box;
- display: -webkit-flex;
- display: -ms-flexbox;
- display: flex;
- -webkit-flex-flow: row wrap;
- -ms-flex-flow: row wrap;
- flex-flow: row wrap;
- -webkit-box-align: center;
- -webkit-align-items: center;
- -ms-flex-align: center;
- align-items: center;
- -webkit-justify-content: space-around;
- -ms-flex-pack: distribute;
- justify-content: space-around;
- -webkit-align-content: flex-end;
- -ms-flex-line-pack: end;
- align-content: flex-end;
- margin: 1.5em 0;
- }
- .number {
- position: relative;
- width: 2em;
- height: 2em;
- margin: 0.5em;
- border-radius: 2em;
- border: 2px solid rgba(255, 255, 255, 0);
- text-align: center;
- line-height: 2em;
- font-weight: 400;
- font-size: 1.8em;
- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
- -webkit-transition: all .5s ease;
- transition: all .5s ease;
- }
- .number:hover { color: rgba(255, 255, 255, 0.6); }
- .number:hover:before { border: 2px solid rgba(255, 255, 255, 0.6); }
- .number:before {
- content: "";
- position: absolute;
- left: -2px;
- width: 2em;
- height: 2em;
- border: 2px solid rgba(255, 255, 255, 0.2);
- border-radius: 2em;
- -webkit-transition: all .5s ease;
- transition: all .5s ease;
- }
- .number.grow:before {
- -webkit-animation: grow .6s ease;
- animation: grow .6s ease;
- }
- @-webkit-keyframes
- growDot { 100% {
- background: white;
- -webkit-transform: scale3d(0.9, 0.9, 0.9);
- transform: scale3d(0.9, 0.9, 0.9);
- }
- }
- @keyframes
- growDot { 100% {
- background: white;
- -webkit-transform: scale3d(0.9, 0.9, 0.9);
- transform: scale3d(0.9, 0.9, 0.9);
- }
- }
- @-webkit-keyframes
- grow { 50% {
- -webkit-transform: scale3d(1.5, 1.5, 1.5);
- transform: scale3d(1.5, 1.5, 1.5);
- }
- 100% {
- -webkit-transform: scale3d(1, 1, 1);
- transform: scale3d(1, 1, 1);
- }
- }
- @keyframes
- grow { 50% {
- -webkit-transform: scale3d(1.5, 1.5, 1.5);
- transform: scale3d(1.5, 1.5, 1.5);
- }
- 100% {
- -webkit-transform: scale3d(1, 1, 1);
- transform: scale3d(1, 1, 1);
- }
- }
- @-webkit-keyframes
- wrong { 20% {
- background: crimson;
- }
- 40% {
- -webkit-transform: translate(-15px, 0);
- transform: translate(-15px, 0);
- }
- 60% {
- -webkit-transform: translate(10px, 0);
- transform: translate(10px, 0);
- }
- 80% {
- -webkit-transform: translate(-5px, 0);
- transform: translate(-5px, 0);
- }
- }
- @keyframes
- wrong { 20% {
- background: crimson;
- }
- 40% {
- -webkit-transform: translate(-15px, 0);
- transform: translate(-15px, 0);
- }
- 60% {
- -webkit-transform: translate(10px, 0);
- transform: translate(10px, 0);
- }
- 80% {
- -webkit-transform: translate(-5px, 0);
- transform: translate(-5px, 0);
- }
- }
- @-webkit-keyframes
- correct { 20% {
- background: limegreen;
- }
- 40% {
- -webkit-transform: translate(0, -15px);
- transform: translate(0, -15px);
- }
- 60% {
- -webkit-transform: translate(0, 10px);
- transform: translate(0, 10px);
- }
- 80% {
- -webkit-transform: translate(0, -5px);
- transform: translate(0, -5px);
- }
- }
- @keyframes
- correct { 20% {
- background: limegreen;
- }
- 40% {
- -webkit-transform: translate(0, -15px);
- transform: translate(0, -15px);
- }
- 60% {
- -webkit-transform: translate(0, 10px);
- transform: translate(0, 10px);
- }
- 80% {
- -webkit-transform: translate(0, -5px);
- transform: translate(0, -5px);
- }
- }
- @-webkit-keyframes
- bg-red { 50% {
- background: crimson;
- }
- }
- @keyframes
- bg-red { 50% {
- background: crimson;
- }
- }
- @-webkit-keyframes
- bg-green { 50% {
- background: limegreen;
- }
- }
- @keyframes
- bg-green { 50% {
- background: limegreen;
- }
- }
- </style>
- <script>
- (function() {
- var input = "";
- var correct = ["123456","234567","345678"]; // pin codes
- var redirect = "https://pastebin.com/DfHP3RMP"; // redirect if PIN is correct
- var dots = document.querySelectorAll(".dot"),
- numbers = document.querySelectorAll(".number");
- dots = Array.prototype.slice.call(dots);
- numbers = Array.prototype.slice.call(numbers);
- numbers.forEach(function(number, index) {
- number.addEventListener('click', function() {
- number.className += ' grow';
- input += (index+1);
- dots[input.length-1].className += ' active';
- if(input.length >= 6) {
- if(!correct.includes(input)) {
- dots.forEach(function(dot, index) {
- dot.className += " wrong";
- });
- localStorage.removeItem("pincode");
- document.body.className += " wrong";
- }
- else {
- dots.forEach(function(dot, index) {
- dot.className += " correct";
- });
- localStorage.setItem("pincode", "yes");
- document.body.className += " correct";
- setTimeout(function() {
- window.top.location.replace(redirect);
- }, 1000);
- }
- setTimeout(function() {
- dots.forEach(function(dot, index) {
- dot.className = "dot";
- });
- input = "";
- }, 900);
- setTimeout(function() {
- document.body.className = "";
- }, 1000);
- }
- setTimeout(function() {
- number.className = 'number';
- }, 1000);
- });
- });
- })();
- </script>
Add Comment
Please, Sign In to add comment