Rotate Zoom - 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>Rotate Zoom</title> <style> body { font-family: Arial, sans-serif; background-color: #ffe4e1; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; } .rotate-zoom-container { position: relative; display: inline-block; cursor: pointer; } .rotate-zoom-container img { width: 100%; height: auto; transition: transform 0.5s ease-in-out, box-shadow 0.5s ease-in-out; border-radius: 20px; box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2); } .rotate-zoom-container:hover img { transform: scale(1.1) rotate(15deg); box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4); } .rotate-zoom-icon { position: absolute; top: 10px; right: 10px; background-color: rgba(255, 255, 255, 0.9); border-radius: 50%; padding: 5px; font-size: 30px; transition: transform 0.5s ease-in-out; } .rotate-zoom-container:hover .rotate-zoom-icon { transform: rotate(360deg); } .rotate-zoom-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.8); display: none; justify-content: center; align-items: center; z-index: 1000; animation: fadeIn 0.5s ease-in-out; } .rotate-zoom-overlay img { max-width: 90%; max-height: 90%; border-radius: 20px; box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5); transform: scale(0.8); animation: zoomIn 0.5s ease-in-out forwards; } .rotate-zoom-overlay .close-icon { position: absolute; top: 20px; right: 20px; background-color: rgba(255, 255, 255, 0.9); border-radius: 50%; padding: 10px; font-size: 36px; cursor: pointer; transition: transform 0.5s ease-in-out; } .rotate-zoom-overlay .close-icon:hover { transform: scale(1.2); } @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } } @keyframes zoomIn { from { transform: scale(0.8); } to { transform: scale(1); } } </style> </head> <body> <div class="rotate-zoom-container"> <img src="https://via.placeholder.com/600x400" alt="Zoom Image"> <div class="rotate-zoom-icon">🔍</div> </div> <div class="rotate-zoom-overlay" id="rotate-zoom-overlay"> <img src="https://via.placeholder.com/600x400" alt="Zoom Image"> <div class="close-icon" id="rotate-close-icon">❌</div> </div> <script> const rotateZoomContainer = document.querySelector('.rotate-zoom-container'); const rotateZoomOverlay = document.getElementById('rotate-zoom-overlay'); const rotateCloseIcon = document.getElementById('rotate-close-icon'); const rotateZoomImage = rotateZoomContainer.querySelector('img'); const rotateOverlayImage = rotateZoomOverlay.querySelector('img'); rotateZoomContainer.addEventListener('click', () => { rotateOverlayImage.src = rotateZoomImage.src; rotateZoomOverlay.style.display = 'flex'; }); rotateCloseIcon.addEventListener('click',() => { rotateZoomOverlay.style.display = 'none'; }); rotateZoomOverlay.addEventListener('click', (e) => { if (e.target === rotateZoomOverlay) { rotateZoomOverlay.style.display = 'none'; } }); </script> </body> </html>