Anons79 Mini Shell

Directory : /home/aplikasiposinfo/www/reswara.samarinda.app/resources/views/auth/
Upload File :
Current File : /home/aplikasiposinfo/www/reswara.samarinda.app/resources/views/auth/verifikasi-otp.blade.php

<!doctype html>
<html lang="en">

<head>

    <meta charset="utf-8" />
    <title>Login | RESWARA</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta content="Premium Multipurpose Admin & Dashboard Template" name="description" />
    <meta content="Themesbrand" name="author" />
    <!-- App favicon -->
    <link rel="shortcut icon" href=" {{ asset('assets/images/favicon.ico') }} ">
    <meta name="csrf-token" content="{{ csrf_token() }}">

    <!-- Bootstrap Css -->
    <link href=" {{ asset('assets/css/bootstrap.min.css') }} " id="bootstrap-style" rel="stylesheet" type="text/css" />
    <!-- Icons Css -->
    <link href=" {{ asset('assets/css/icons.min.css') }} " rel="stylesheet" type="text/css" />
    <!-- App Css-->
    <link href=" {{ asset('assets/css/app.min.css') }} " id="app-style" rel="stylesheet" type="text/css" />

    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Righteous&display=swap" rel="stylesheet">
    <style>
        /* Container for the OTP inputs */
        .otp-container {
            display: flex;
            justify-content: space-between;
            width: 250px;
            /* Adjust as necessary */
            gap: 10px;
            /* Space between each input */
        }

        /* Styling individual OTP input boxes */
        .otp-input {
            width: 75px;
            /* Adjust width of each input */
            height: 75px;
            /* Adjust height */
            text-align: center;
            font-size: 32px;
            /* Adjust font size */
            border: 1px solid #ccc;
            border-radius: 5px;
            outline: none;
        }

        .otp-input:focus {
            border-color: #4d90fe;
            /* Color when focused */
            box-shadow: 0 0 5px rgba(77, 144, 254, 0.5);
            /* Optional, gives a soft glow on focus */
        }

        .otp-input[type="text"] {
            -moz-appearance: textfield;
            /* Remove spinner arrows in Firefox */
        }

        .otp-input::placeholder {
            color: transparent;
            /* Optional, to hide placeholder text */
        }
    </style>
</head>

<body data-topbar="colored">

    <!-- <body data-layout="horizontal" data-topbar="colored"> -->

    <!-- Background -->
    <div class="account-pages"></div>
    <!-- Begin page -->
    <div class="wrapper-page">

        <div class="card">
            <div class="card-body">

                {{-- <h3 class="text-center text-primary" style='font-family: "Righteous", sans-serif;'>
                        MAX YOUR LEVEL
                    </h3> --}}
                <center>
                    <img src="{{ asset('assets/images/logo.jpg') }}" width="100" alt="">
                </center>
                <h3 class="text-center text-primary" style='font-family: "Righteous", sans-serif;'>
                    RESWARA
                </h3>
                <div class="p-3">
                    <form action="{{ route('verifikasi-otp.check', $identifier) }}" id="form-register-action"
                        class="form-horizontal" method="POST">
                        @csrf
                        <input type="hidden" name="email" value="{{ $email }}">
                        <h4 class="font-size-18 text-center" style="color: #5A6684;"> Verifikasi OTP </h4>
                        <p class="text-muted text-center">Kami telah mengirimkan kode OTP 4 digit ke <span
                                class="text-success">{{ $email }}</span>. Silahkan masukkan dibawah ini untuk
                            memverifikasi akun anda.</p>
                        <p class="text-muted text-center"></p>
                        <div class="mb-3 d-flex justify-content-center">
                            <div class="p-1">
                                {{-- <h6 class="text-muted">Verifikasi Nomor OTP :  </h6> --}}
                                <div class="d-flex">
                                    <div class="p-1">
                                        <input type="text" maxlength="1" size="1" name="otp1"
                                            class="otp-input form-control"
                                            oninput="this.value = this.value.replace(/[^0-9]/g, '');" id="otp1" />
                                    </div>
                                    <div class="p-1">
                                        <input type="text" maxlength="1" size="1" name="otp2"
                                            class="otp-input form-control"
                                            oninput="this.value = this.value.replace(/[^0-9]/g, '');" id="otp2" />
                                    </div>
                                    <div class="p-1">
                                        <input type="text" maxlength="1" size="1" name="otp3"
                                            class="otp-input form-control"
                                            oninput="this.value = this.value.replace(/[^0-9]/g, '');" id="otp3" />
                                    </div>
                                    <div class="p-1">
                                        <input type="text" maxlength="1" size="1" name="otp4"
                                            class="otp-input form-control"
                                            oninput="this.value = this.value.replace(/[^0-9]/g, '');" id="otp4" />
                                    </div>
                                </div>
                            </div>

                        </div>

                        <div class="mb-3 row">
                            <div class="col-12">
                                <button id="checkOTP" class="btn btn-primary w-100 waves-effect waves-light"
                                    type="submit">Konfirmasi</button>
                            </div>
                        </div>
                        <div class="mb-3 row">
                            <div class="d-flex justify-content-center">
                                <div class="p-1">
                                    <span id="timer_change">Anda dapat mengirim nomor OTP lagi setelah <span
                                            id="timer" style="font-weight: bolder"></span> detik</span>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>

            </div>
        </div>

        <div class="text-center">
            @if(!isset($_GET['pelatih']))
            <p class="text-white-50">Tidak Punya Akun ? <a href="{{ route('register') }}" class="text-white"> Daftar
                    Sekarang
                </a> </p>
            @endif
            <p class="text-muted">
                ©
                <script>
                    document.write(new Date().getFullYear())
                </script> by GreenNusa Computindo
            </p>
        </div>

    </div>

    <!-- JAVASCRIPT -->
    <script src=" {{ asset('assets/libs/jquery/jquery.min.js') }} "></script>
    <script src=" {{ asset('assets/libs/bootstrap/js/bootstrap.bundle.min.js') }} "></script>
    <script src=" {{ asset('assets/libs/metismenu/metisMenu.min.js') }} "></script>
    <script src=" {{ asset('assets/libs/simplebar/simplebar.min.js') }} "></script>
    <script src=" {{ asset('assets/libs/node-waves/waves.min.js') }} "></script>
    <script src=" {{ asset('assets/libs/jquery-sparkline/jquery.sparkline.min.js') }} "></script>

    <!-- App js -->
    <script src=" {{ asset('assets/js/app.js') }} "></script>

    {{-- Sweet Alert --}}
    <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>

    @if (session('success'))
        <script>
            Swal.fire({
                title: "Success!",
                text: "{!! session('success') !!}",
                icon: "success"
            });
        </script>
    @endif

    @if (session('error'))
        <script>
            Swal.fire({
                title: "Error!",
                text: "{!! session('error') !!}",
                icon: "error"
            });
        </script>
    @endif

    @if (session('warning'))
        <script>
            Swal.fire({
                title: "Warning!",
                text: "{!! session('warning') !!}",
                icon: "warning"
            });
        </script>
    @endif
    <script>
        $(document).ready(function() {
            let timeLeft = 60; // 60 seconds
            let timeStart = true;
            const timerElement = document.getElementById('timer');
            let token = $("meta[name='csrf-token']").attr("content");
            let countdown;


            function startTimer() {
                countdown = setInterval(() => {
                    if (timeLeft <= 0) {
                        clearInterval(countdown); // Stop the timer

                        document.getElementById('timer_change').innerHTML =
                            'Nomor OTP bisa dikirim lagi : <a href="#" id="sendOTP">kirim OTP!</a>';
                        // timerElement.innerText = 'Time is up!';
                    } else {
                        $('#timer').text(timeLeft);
                        // timerElement.innerText = timeLeft; // Display the remaining time
                        timeLeft--; // Decrease the time by 1 second
                    }
                }, 1000);
            }

            startTimer();

            $(document).on('click', '#sendOTP', function() {
                $('#timer_change').text("Mohon Menunggu!");

                $.ajax({
                    url: `{{ route('resend-otp', $identifier) }}`,
                    type: "POST",
                    cache: false,
                    data: {
                        "_token": token,
                        'email': $('input[name="email"]').val(),
                    },
                    success: function(response) {
                        document.getElementById('timer_change').innerHTML =
                            'Anda dapat mengirim nomor OTP lagi setelah <span id="timer" style="font-weight: bolder"></span> detik';
                        clearInterval(countdown); // Hentikan countdown yang sedang berjalan
                        timeLeft = 60; // Reset waktu ke 60 detik
                        timerElement.innerText = timeLeft; // Tampilkan ulang waktu 60 detik
                        startTimer();
                    },
                    error: function(xhr) {
                        alert("Gagal mengirim kode OTP");
                        document.getElementById('timer_change').innerHTML =
                            'Anda dapat mengirim nomor OTP lagi setelah <span id="timer" style="font-weight: bolder"></span> detik';
                        clearInterval(countdown); // Hentikan countdown yang sedang berjalan
                        timeLeft = 60; // Reset waktu ke 60 detik
                        timerElement.innerText = timeLeft; // Tampilkan ulang waktu 60 detik
                        startTimer();
                    }

                });

            });

            const inputs = document.querySelectorAll('.otp-input');
            inputs.forEach((input, index) => {
                input.addEventListener('input', () => {
                    if (input.value.length >= 1) {
                        if (index < inputs.length - 1) {
                            inputs[index + 1].focus();
                        }
                    } else if (index > 0) {
                        inputs[index - 1].focus();
                    }
                });
            });

        });
    </script>
</body>

</html>

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]