@media(max-width:600px){
.wa-widget-container {
bottom: 10px;
}
.wa-text {
display:none;
}
.wa-chat-button {
padding: 16px 5px 15px 15px !important;
}
}
/* Scoped container to prevent messing up other Avada styles */
.wa-widget-container {
display: flex;
justify-content: center;
align-items: center;
padding: 20px;
font-family: auto;
position: fixed;
right: 0;
top: auto;
bottom: 40px;
z-index:99999 !important;
}
/* Main Button Styles */
.wa-chat-button {
display: inline-flex;
align-items: center;
justify-content: center;
background-color: #25D366; /* WhatsApp Green */
color: white;
text-decoration: none;
padding: 16px 15px 15px 15px;
border-radius: 50px; /* Pill shape */
font-size: 16px;
font-weight: 500;
transition: transform 0.3s ease, box-shadow 0.3s ease;
position: relative;
overflow: hidden; /* For the ripple effect */
/* The Glowing Shadow Effect */
box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
animation: glowingPulse 2s infinite;
}
/* Hover State - slightly grows */
.wa-chat-button:hover {
transform: scale(1.05);
background-color: #20bd5a;
text-decoration: none; /* Ensures no underline in WP */
color: white; /* Forces white text even if theme overrides */
}
/* SVG Icon Styling */
.wa-icon {
display: flex;
align-items: center;
justify-content: center;
margin-right: 10px;
width: 24px;
height: 24px;
}
.wa-icon svg {
width: 100%;
height: 100%;
fill: white;
}
/* Text Styling */
.wa-text {
line-height: 1.2;
}
/* Keyframes for the Glowing Pulse Animation */
@keyframes glowingPulse {
0% {
transform: scale(1);
box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
}
70% {
transform: scale(1);
box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
}
100% {
transform: scale(1);
box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
}
}
/* Ripple Effect Styles (Added by JS) */
.wa-ripple {
position: absolute;
border-radius: 50%;
background: rgba(255, 255, 255, 0.4);
transform: scale(0);
animation: rippleAnim 0.6s linear;
pointer-events: none;
}
@keyframes rippleAnim {
to {
transform: scale(4);
opacity: 0;
}
}
// JavaScript to add a "Ripple" effect when clicked
document.addEventListener("DOMContentLoaded", function() {
const btn = document.getElementById("waButton");
if (btn) {
btn.addEventListener("click", function(e) {
// Create ripple element
const circle = document.createElement("span");
const diameter = Math.max(btn.clientWidth, btn.clientHeight);
const radius = diameter / 2;
// Set position relative to click
const rect = btn.getBoundingClientRect();
circle.style.width = circle.style.height = `${diameter}px`;
circle.style.left = `${e.clientX - rect.left - radius}px`;
circle.style.top = `${e.clientY - rect.top - radius}px`;
// Add class for animation
circle.classList.add("wa-ripple");
// Remove existing ripples to keep DOM clean
const ripple = btn.getElementsByClassName("wa-ripple")[0];
if (ripple) {
ripple.remove();
}
// Add new ripple
btn.appendChild(circle);
// Note: The link will still open normally due to the href attribute
});
}
});