logoAnimation.js 625 B

1234567891011121314151617181920212223242526
  1. const style = document.createElement('style');
  2. style.innerHTML = `
  3. @keyframes logoAnimation {
  4. from {
  5. transform: scale(1);
  6. }
  7. to {
  8. transform: scale(1.5);
  9. }
  10. }
  11. .logo-animate {
  12. animation: logoAnimation 2s infinite alternate;
  13. }
  14. `;
  15. document.head.appendChild(style);
  16. document.addEventListener("DOMContentLoaded", () => {
  17. const checkForElement = setInterval(() => {
  18. const logoImage = document.querySelector('img[alt="LogoWithText"]');
  19. if (logoImage) {
  20. logoImage.classList.add('logo-animate');
  21. clearInterval(checkForElement);
  22. }
  23. }, 100);
  24. });