good
This commit is contained in:
@@ -138,18 +138,26 @@
|
||||
}
|
||||
}
|
||||
|
||||
let animationFrameId;
|
||||
|
||||
function animateConfetti() {
|
||||
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
||||
particles.forEach(p => {
|
||||
p.update();
|
||||
p.draw();
|
||||
});
|
||||
requestAnimationFrame(animateConfetti);
|
||||
animationFrameId = requestAnimationFrame(animateConfetti);
|
||||
}
|
||||
|
||||
initConfetti();
|
||||
animateConfetti();
|
||||
|
||||
setTimeout(() => {
|
||||
cancelAnimationFrame(animationFrameId);
|
||||
particles = [];
|
||||
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
||||
}, 10000);
|
||||
|
||||
// Copy Functionality
|
||||
function copyCode() {
|
||||
const code = document.getElementById('couponCode').innerText;
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
<h2 class="font-headline-xl text-headline-xl text-on-surface mb-sm">Belgiňizi tassyklaň</h2>
|
||||
|
||||
<p class="font-body-md text-body-md text-on-surface-variant max-w-[280px] mx-auto">
|
||||
Şu belgä iberilen 4 sanly kody giriziň: <span class="font-semibold text-on-surface">+933 {{ $phone }}</span>
|
||||
Şu belgä iberilen 4 sanly kody giriziň: <span class="font-semibold text-on-surface">{{ format_phone($phone) }}</span>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -53,7 +53,6 @@
|
||||
|
||||
<form action="{{ route('verification.verify') }}" method="POST" id="otp-form">
|
||||
@csrf
|
||||
<input type="hidden" name="phone" value="{{ $phone }}">
|
||||
<input type="hidden" name="otp" id="otp-hidden">
|
||||
|
||||
<!-- OTP Inputs -->
|
||||
@@ -121,20 +120,20 @@
|
||||
});
|
||||
});
|
||||
|
||||
verifyBtn.addEventListener('click', () => {
|
||||
form.addEventListener('submit', (e) => {
|
||||
let code = '';
|
||||
inputs.forEach(input => code += input.value);
|
||||
if (code.length === 4) {
|
||||
hiddenOtp.value = code;
|
||||
|
||||
verifyBtn.innerHTML = '<span class="flex items-center justify-center gap-sm"><svg class="animate-spin h-5 w-5 text-white" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg> Tassyklanýar...</span>';
|
||||
|
||||
setTimeout(() => {
|
||||
form.submit();
|
||||
}, 500); // small delay to show animation
|
||||
} else {
|
||||
|
||||
if (code.length !== 4) {
|
||||
e.preventDefault();
|
||||
alert('Haýyş, 4 sanly kody giriziň.');
|
||||
return;
|
||||
}
|
||||
|
||||
hiddenOtp.value = code;
|
||||
|
||||
verifyBtn.disabled = true;
|
||||
verifyBtn.innerHTML = '<span class="flex items-center justify-center gap-sm"><svg class="animate-spin h-5 w-5 text-white" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg> Tassyklanýar...</span>';
|
||||
});
|
||||
|
||||
// Resend OTP Countdown Logic
|
||||
|
||||
Reference in New Issue
Block a user