Shake Tooltip - MeggiTools
Run
Toggle Theme
Share Link
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Shake Tooltip</title> <style> body { font-family: Arial, sans-serif; display: flex; justify-content: center; align-items: center; height: 100vh; background: linear-gradient(to right, #f12711, #f5af19); } .tooltip-container { position: relative; display: inline-block; } .tooltip-icon { font-size: 2rem; cursor: pointer; } .tooltip-text { visibility: hidden; width: 220px; background: #fff; color: #333; text-align: center; border-radius: 10px; padding: 15px; position: absolute; z-index: 1; bottom: 125%; left: 50%; transform: translateX(-50%); opacity: 0; transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out; box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3); } .tooltip-container:hover .tooltip-text { visibility: visible; opacity: 1; animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both; } @keyframes shake { 10%, 90% { transform: translateX(-50%) rotate(-3deg); } 20%, 80% { transform: translateX(-50%) rotate(3deg); } 30%, 50%, 70% { transform: translateX(-50%) rotate(-3deg); } 40%, 60% { transform: translateX(-50%) rotate(3deg); } } .tooltip-arrow { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border-width: 10px; border-style: solid; border-color: #fff transparent transparent transparent; } </style> </head> <body> <div class="tooltip-container"> <span class="tooltip-icon">🔔</span> <div class="tooltip-text"> <p>Shake Animation Tooltip!</p> <div class="tooltip-arrow"></div> </div> </div> </body> </html>