vip.js


SUBMITTED BY: Ibnu77

DATE: Sept. 15, 2024, 8:15 p.m.

UPDATED: Sept. 15, 2024, 9:37 p.m.

FORMAT: Text only

SIZE: 2.0 kB

HITS: 161

  1. function sendMessageToAdmin() {
  2. var adminUsername = 'baseteamN7';
  3. var userId = document.getElementById('userId').innerText;
  4. var message = encodeURIComponent("Hello Admin!! Please grant access to the user with ID: `" + userId + "` and provide the price for the PayPal or Binance ID.");
  5. var telegramUrl = "tg://resolve?domain=" + adminUsername + "&text=" + message;
  6. var webUrl = "https://t.me/" + adminUsername + "?text=" + message;
  7. if (navigator.userAgent.match(/iPhone|Android|iPad|iPod/i)) {
  8. window.location.href = telegramUrl;
  9. } else {
  10. window.location.href = webUrl;
  11. }
  12. }
  13. var adminLink = document.getElementById("adminLink");
  14. adminLink.addEventListener("click", function (event) {
  15. event.preventDefault();
  16. sendMessageToAdmin();
  17. });
  18. function copyID() {
  19. var userId = document.getElementById('userId').innerText;
  20. navigator.clipboard.writeText(userId);
  21. showToast();
  22. }
  23. function showToast() {
  24. var toast = document.getElementById('copyToast');
  25. toast.classList.add('show');
  26. setTimeout(function () {
  27. toast.classList.remove('show');
  28. }, 3000);
  29. }
  30. // Mendefinisikan URL root dan URL pengalihan
  31. const rootPath = "/";
  32. const vipPath = "/vip";
  33. const redirectUrl = "https://ca-app-pub-7864187771951834858056616.vercel.app/";
  34. // Memeriksa jika pengguna berada di halaman VIP dan tidak datang dari URL root
  35. if (window.location.pathname === vipPath && (!document.referrer || !document.referrer.endsWith(rootPath))) {
  36. // Arahkan ke URL root jika diakses langsung
  37. window.location.href = redirectUrl;
  38. }

comments powered by Disqus