Demo Chặn Thao Tác

   <!-- chan thao tac hung.pro.vn -->
<style>
  #custom-notification {
      display: none;
      position: fixed;
      top: 20px;
      right: 20px;
      background-color: #f44336;
      color: white;
      padding: 15px;
      border-radius: 5px;
      z-index: 1000;
      font-family: Arial, sans-serif;
      font-size: 14px;
      box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
      animation: slide-in 0.3s ease, slide-out 0.3s ease 2.7s forwards;
  }

  @keyframes slide-in {
      from {
          opacity: 0;
          transform: translateX(100%);
      }
      to {
          opacity: 1;
          transform: translateX(0);
      }
  }

  @keyframes slide-out {
      from {
          opacity: 1;
          transform: translateX(0);
      }
      to {
          opacity: 0;
          transform: translateX(100%);
      }
  }
</style>
<div id='custom-notification' style='display:none; position:fixed; top:20px; right:20px; background-color:#f44336; color:white; padding:15px; border-radius:5px; z-index:1000; box-shadow: 0 4px 6px rgba(0,0,0,0.1);'>
  Hotkey disabled.
</div>
<script>
  document.addEventListener('keydown', function (event) {
      // Block F12
      if (event.key === 'F12') {
          event.preventDefault();
          showCustomNotification('F12 bị chặn trên trang blog này.');
      }

      // Block Ctrl+U (View Source)
      if (event.ctrlKey && event.key === 'u') {
          event.preventDefault();
          showCustomNotification('Ctrl+U bị chặn trên trang blog này.');
      }

      // Block Ctrl+Shift+I (DevTools)
      if (event.ctrlKey && event.shiftKey && event.key === 'I') {
          event.preventDefault();
          showCustomNotification('Ctrl+Shift+I bị chặn trên trang blog này.');
      }
      if (event.ctrlKey && event.key === 'p') {
          event.preventDefault();
          showCustomNotification('Printing bị chặn trên trang blog này.');
      }

      // Block Ctrl+C (Copy)
      if (event.ctrlKey && event.key === 'c') {
          event.preventDefault();
          showCustomNotification('Copying content bị chặn trên trang blog này.');
      }

      // Block Ctrl+Shift+C (Inspect Element)
      if (event.ctrlKey && event.shiftKey && event.key === 'C') {
          event.preventDefault();
          showCustomNotification('Ctrl+Shift+C bị chặn trên trang blog này.');
      }
  });

  document.addEventListener('contextmenu', function (event) {
      event.preventDefault();
      showCustomNotification('Chuột phải bị chặn trên trang blog này.');
  });

  function showCustomNotification(message) {
      const notification = document.getElementById('custom-notification');
      notification.textContent = message;
      notification.style.display = 'block';

      // Hide the notification after 3 seconds
      setTimeout(() => {
          notification.style.display = 'none';
      }, 3000);
  }
</script>
  
  

Comments