diff --git a/htdocs/assets/js/core-animation.js b/htdocs/assets/js/core-animation.js index e69de29..52a0585 100644 --- a/htdocs/assets/js/core-animation.js +++ b/htdocs/assets/js/core-animation.js @@ -0,0 +1,37 @@ +//---hello textbox on pome page (hero-section) config +function animate_hello() { + const texts = ["Namaste! ๐Ÿ™", "Hello! ๐Ÿ‘‹", "Konnichiwa! ๐Ÿ˜„", "Anyeonghaseyo! ๐Ÿ˜Š", "Hola! ๐Ÿ˜ƒ", "Bonjour! ๐Ÿ˜„", "Zdravstvuyte! ๐Ÿ™‚", "Marhabaan! ๐Ÿ˜Š", "Olรก! ๐Ÿ˜ƒ", "Salve! ๐Ÿค "]; + const textContainer = document.getElementById("helloContainer"); + + let currentIndex = 0; + function animateText() { + textContainer.textContent = texts[currentIndex]; + currentIndex = (currentIndex + 1) % texts.length; + + setTimeout(() => { + animateText(); + }, 3000); + } + animateText(); +} + +if(document.getElementById("helloContainer")) { + animate_hello(); +} + +//---hoverAnimatedContainer animation config +const animate_card_mouseover_effect = e => { + const { currentTarget: target } = e; + const rect = target.getBoundingClientRect(), + x = e.clientX - rect.left, + y = e.clientY - rect.top; + + target.style.setProperty("--mouse-x",`${x}px`); + target.style.setProperty("--mouse-y",`${y}px`); +} + +if(document.querySelectorAll(".hoverAnimatedContainer")){ + for(const card of document.querySelectorAll(".hoverAnimatedContainer")){ + card.onmousemove = e => animate_card_mouseover_effect(e); + } +} \ No newline at end of file diff --git a/htdocs/contact.php b/htdocs/contact.php index 9f323b6..2856916 100644 --- a/htdocs/contact.php +++ b/htdocs/contact.php @@ -110,21 +110,7 @@ require 'core/query_functions.php'; + - \ No newline at end of file diff --git a/htdocs/home.php b/htdocs/home.php index 3cc18d3..95037ec 100644 --- a/htdocs/home.php +++ b/htdocs/home.php @@ -221,36 +221,6 @@ require 'core/query_functions.php'; - + \ No newline at end of file