Advertisement
Guest User

Untitled

a guest
Apr 27th, 2025
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 6.03 KB | None | 0 0
  1. <div class="chaty-container" id="chatyContainer"><div class="chaty-options"><div class="chaty-option wa" onclick="window.open('https://wa.me/message/PLACE WHATSAPP HERE','_blank')"><svg viewBox="0 0 32 32" width="24" height="24"><path d="M16 2C8.28 2 2 8.28 2 16c0 2.87.77 5.55 2.1 7.89L2 30l6.29-2.07C10.45 29.08 13.13 30 16 30c7.72 0 14-6.28 14-14S23.72 2 16 2zm7.3 19.25c-.31.88-1.8 1.62-2.48 1.73-.63.1-1.4.15-2.24-.14-3.9-1.28-6.46-5.08-6.7-5.3s-1.6-2.13-1.6-4.08 1-2.9 1.36-3.29c.33-.36.72-.45.96-.45h.74c.23 0 .55-.05.86.64.33.76 1.12 2.63 1.21 2.82s.18.41.05.65c-.13.23-.2.37-.38.58-.18.2-.37.45-.54.6-.18.18-.36.38-.16.73.2.36.89 1.46 1.9 2.36 1.3 1.15 2.4 1.52 2.76 1.7.35.17.55.14.76-.08.2-.22.87-1.02 1.1-1.38.22-.36.44-.3.75-.18.32.13 2.02.95 2.37 1.12.34.17.57.26.66.4.1.13.1.85-.2 1.73z"/></svg><span class="option-text">WhatsApp</span></div><div class="chaty-option chat" id="chatOption"><svg viewBox="0 0 24 24" width="24" height="24"><path d="M2 4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v13a2 2 0 0 1-2 2H6l-4 4V4z"/></svg><span class="option-text">Chat en línea</span></div><div class="chaty-option email" onclick="window.location.href='mailto:PLACE EMAIL HERE'"><svg viewBox="0 0 24 24" width="24" height="24"><path d="M20 4H4c-1.11 0-1.99.89-1.99 2L2 18a2 2 0 0 0 2 2h16c1.1 0 2-.9 2-2V6c0-1.11-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z"/></svg><span class="option-text">Correo</span></div></div><button class="chaty-toggle" id="chatyToggle"><svg viewBox="0 0 24 24" width="28" height="28"><path d="M2 4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v13a2 2 0 0 1-2 2H6l-4 4V4z"/></svg><div id="notificationBadge">1</div></button><div id="chatTooltip">👋 Hello!</div></div><script>document.addEventListener("DOMContentLoaded",function(){const e=document.getElementById("chatyContainer"),t=document.getElementById("chatyToggle"),a=document.getElementById("chatOption"),n=document.getElementById("notificationBadge"),o=document.getElementById("chatTooltip"),i={shown:!1,hasNewMessage:!1,messageCount:0};function s(){"undefined"!=typeof Tawk_API&&(Tawk_API.toggle(),i.shown=!0,i.hasNewMessage=!1,i.messageCount=0,n.style.display="none",o.style.display="none")}setTimeout(()=>{o.style.display="block",setTimeout(()=>{o.style.display="none"},5e3)},3e3),t.addEventListener("click",()=>{i.hasNewMessage?(s(),e.classList.remove("open")):(e.classList.toggle("open"),o.style.display="none")}),a.addEventListener("click",t=>{t.preventDefault(),s(),e.classList.remove("open")});var d=function(){if("undefined"==typeof Tawk_API)setTimeout(d,100);else{Tawk_API.onChatHidden=function(){i.shown=!1},Tawk_API.onChatMinimized=function(){i.shown=!1},Tawk_API.onChatMaximized=function(){i.shown=!0,i.hasNewMessage=!1,i.messageCount=0,n.style.display="none",o.style.display="none"};var e=Tawk_API.onChatMessageAgent;Tawk_API.onChatMessageAgent=function(t){if(i.shown||(i.hasNewMessage=!0,i.messageCount++,n.innerText=i.messageCount,n.style.display="flex",o.style.display="none",s()),"function"==typeof e&&e(t),!i.shown){var a=Tawk_API.isChatMaximized();a||Tawk_API.maximize()}}}};d()});var Tawk_API=Tawk_API||{},Tawk_LoadStart=new Date;!function(){var e=document.createElement("script"),t=document.getElementsByTagName("script")[0];e.async=!0,e.src="https://embed.tawk.to/PLACE YOUR ID HERE ",e.charset="UTF-8",e.setAttribute("crossorigin","*"),t.parentNode.insertBefore(e,t)}();</script>
  2.  
  3.  
  4. CSS
  5.  
  6. .chaty-container {
  7.   position: fixed;
  8.   bottom: 20px;
  9.   right: 20px;
  10.   z-index: 9999;
  11.   display: flex;
  12.   flex-direction: column;
  13.   align-items: flex-end;
  14. }
  15.  
  16. .chaty-options {
  17.   display: flex;
  18.   flex-direction: column-reverse;
  19.   align-items: flex-end;
  20.   margin-bottom: 10px;
  21.   opacity: 0;
  22.   visibility: hidden;
  23.   transform: translateY(20px);
  24.   transition: all 0.3s ease;
  25. }
  26.  
  27. .chaty-container.open .chaty-options {
  28.   opacity: 1;
  29.   visibility: visible;
  30.   transform: translateY(0);
  31. }
  32.  
  33. .chaty-option {
  34.   display: flex;
  35.   align-items: center;
  36.   width: auto;
  37.   height: 50px;
  38.   border-radius: 25px;
  39.   margin-bottom: 10px;
  40.   color: white;
  41.   font-size: 16px;
  42.   cursor: pointer;
  43.   box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  44.   transition: transform 0.3s, background 0.3s;
  45.   padding: 0 20px 0 0;
  46. }
  47.  
  48. .chaty-option svg {
  49.   margin: 0 10px;
  50.   fill: white;
  51. }
  52.  
  53. .chaty-option.wa {
  54.   background-color: #25D366;
  55. }
  56.  
  57. .chaty-option.chat {
  58.   background-color: #1e88e5;
  59. }
  60.  
  61. .chaty-option.email {
  62.   background-color: #ff5e5e;
  63. }
  64.  
  65. .chaty-option:hover {
  66.   transform: scale(1.05);
  67. }
  68.  
  69. .option-text {
  70.   font-family: Arial, sans-serif;
  71.   font-weight: 500;
  72.   white-space: nowrap;
  73. }
  74.  
  75. .chaty-toggle {
  76.   background-color: #09716f; /* Cambiamos el color de fondo a blanco */
  77.   width: 60px;
  78.   height: 60px;
  79.   border-radius: 50%;
  80.   border: none;
  81.   color: #075e54; /* Icono verde o el color que prefieras para el SVG interno */
  82.   font-size: 28px;
  83.   display: flex;
  84.   align-items: center;
  85.   justify-content: center;
  86.   cursor: pointer;
  87.   box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  88.   transition: background 0.3s ease, transform 0.3s ease;
  89.   position: relative;
  90. }
  91.  
  92. .chaty-toggle svg {
  93.   fill: #FFFFFF; /* Color del icono dentro del botón */
  94. }
  95.  
  96. .chaty-toggle:hover {
  97.   transform: scale(1.1);
  98. }
  99.  
  100.  
  101. .chaty-toggle:hover {
  102.   transform: scale(1.1);
  103. }
  104.  
  105. #notificationBadge {
  106.   position: absolute;
  107.   top: -5px;
  108.   right: -5px;
  109.   background-color: #ff4141;
  110.   color: white;
  111.   width: 22px;
  112.   height: 22px;
  113.   border-radius: 50%;
  114.   display: none;
  115.   justify-content: center;
  116.   align-items: center;
  117.   font-size: 12px;
  118.   font-family: Arial, sans-serif;
  119.   font-weight: bold;
  120.   box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  121. }
  122.  
  123. #chatTooltip {
  124.   position: absolute;
  125.   right: 70px;
  126.   bottom: 10px;
  127.   background-color: white;
  128.   color: #333;
  129.   padding: 10px 15px;
  130.   border-radius: 8px;
  131.   box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  132.   font-family: Arial, sans-serif;
  133.   font-size: 14px;
  134.   display: none;
  135.   max-width: 200px;
  136.   white-space: nowrap;
  137. }
  138.  
  139. #chatTooltip:after {
  140.   content: '';
  141.   position: absolute;
  142.   right: -8px;
  143.   bottom: 15px;
  144.   border-top: 8px solid transparent;
  145.   border-bottom: 8px solid transparent;
  146.   border-left: 8px solid white;
  147. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement