diff --git a/src/app/verify-otp/page.tsx b/src/app/verify-otp/page.tsx index e333cb0..f27abea 100644 --- a/src/app/verify-otp/page.tsx +++ b/src/app/verify-otp/page.tsx @@ -1,14 +1,65 @@ "use client"; +import { useState } from "react"; import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider"; import NavbarStyleApple from "@/components/navbar/NavbarStyleApple/NavbarStyleApple"; -import HeroBillboardGallery from "@/components/sections/hero/HeroBillboardGallery"; -import FeatureCardNine from "@/components/sections/feature/FeatureCardNine"; -import MetricCardThree from "@/components/sections/metrics/MetricCardThree"; -import { Lock, Shield, Zap, Users } from "lucide-react"; +import { Lock, Shield, Zap, Users, CheckCircle } from "lucide-react"; import Link from "next/link"; export default function VerifyOtpPage() { + const [otp, setOtp] = useState(["", "", "", "", "", ""]); + const [isLoading, setIsLoading] = useState(false); + const [isVerified, setIsVerified] = useState(false); + + const navItems = [ + { name: "Home", id: "/" }, + { name: "Features", id: "#features" }, + { name: "Security", id: "#security" }, + { name: "Sign In", id: "https://example.com/login" }, + { name: "Sign Up", id: "https://example.com/signup" }, + ]; + + const handleOtpChange = (index: number, value: string) => { + if (value.length > 1) return; + if (!/^[0-9]*$/.test(value)) return; + + const newOtp = [...otp]; + newOtp[index] = value; + setOtp(newOtp); + + if (value && index < 5) { + const nextInput = document.getElementById(`otp-${index + 1}`); + if (nextInput) nextInput.focus(); + } + }; + + const handleKeyDown = ( + e: React.KeyboardEvent, + index: number + ) => { + if (e.key === "Backspace" && !otp[index] && index > 0) { + const prevInput = document.getElementById(`otp-${index - 1}`); + if (prevInput) prevInput.focus(); + } + }; + + const handleVerify = async () => { + const otpString = otp.join(""); + if (otpString.length !== 6) return; + + setIsLoading(true); + try { + // Simulate API call + await new Promise((resolve) => setTimeout(resolve, 2000)); + setIsVerified(true); + setTimeout(() => { + window.location.href = "/profile"; + }, 2000); + } finally { + setIsLoading(false); + } + }; + return ( -
- -
- -
- -
- -
- -
- -
-
-
-
-

Product

-
    -
  • Features
  • -
  • Security
  • -
  • Pricing
  • -
  • Documentation
  • -
-
-
-

Company

-
    -
  • About Us
  • -
  • Blog
  • -
  • Careers
  • -
  • Contact
  • -
-
-
-

Resources

-
    -
  • API Docs
  • -
  • Security Guide
  • -
  • FAQ
  • -
  • Status
  • -
-
-
-

Legal

-
    -
  • Privacy Policy
  • -
  • Terms of Service
  • -
  • Cookie Policy
  • -
  • Compliance
  • -
-
-
-
-

© 2025 AuthVault. All rights reserved. Enterprise-grade security solutions.

-

Made with security in mind

+
+ {/* Animated background */} +
+
+
+
+
-
+ +
+ {/* Header */} +
+
+ {isVerified ? ( +
+
+
+
+ +
+
+
+ ) : ( +
+
+
+ +
+
+ )} +
+

+ {isVerified ? "Verified!" : "Enter OTP"} +

+

+ {isVerified + ? "Your identity has been confirmed. Redirecting to dashboard..." + : "We've sent a 6-digit code to your registered email address"} +

+
+ + {/* OTP Card */} +
+ {!isVerified ? ( + <> + {/* OTP Input Fields */} +
+ +
+ {otp.map((digit, index) => ( + handleOtpChange(index, e.target.value)} + onKeyDown={(e) => handleKeyDown(e, index)} + className={`w-14 h-14 text-center text-2xl font-bold border-2 rounded-lg transition-all duration-300 focus:outline-none ${ + digit + ? "bg-accent/10 border-primary-cta text-foreground" + : "bg-transparent border-accent/30 text-foreground/50" + } focus:border-primary-cta focus:ring-2 focus:ring-primary-cta/20`} + /> + ))} +
+
+ + {/* Verify Button */} + + + {/* Resend Link */} +

+ Didn't receive the code?{" "} + +

+ + ) : ( +
+
+
+
+
+ +
+
+
+

Authentication Successful

+

Your account is now secured with two-factor authentication.

+
+ )} +
+ + {/* Info Box */} +
+

+ + Your OTP code is valid for 5 minutes and can only be used once. +

+
+
+
); -} \ No newline at end of file +}