From 930985302a4c77b507823ec43856b48ba8d94803 Mon Sep 17 00:00:00 2001 From: BenjaminToby <52448020+BenjaminToby@users.noreply.github.com> Date: Tue, 25 May 2021 07:11:47 +0100 Subject: [PATCH] update js code and interactions --- scripts/main.js | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/scripts/main.js b/scripts/main.js index 12494a2..579ddc4 100644 --- a/scripts/main.js +++ b/scripts/main.js @@ -1,7 +1,3 @@ -var uiUXLink = document.getElementById("ui-ux-design"); -var webDesignLink = document.getElementById("web-design"); -var frontentDevLink = document.getElementById("frontend-dev"); -var graphicDesignLink = document.getElementById("graphic-design"); var faceWrapper = document.getElementById("my-face-wrapper"); lottie.setQuality("low"); @@ -38,7 +34,36 @@ window.addEventListener("load", () => { +//--------------------------------------------------------------------------- Services mouseover +document.querySelectorAll(".hero-content-link").forEach(item => { + item.addEventListener("mouseover", () => { + + clearTimeout(startSteadyState); + myFace.loop = false; + myFace.playSegments([210, 249], true); + faceWrapper.style.transform = "rotate3d(20,-20,0,20deg) translateZ(-50px)"; + + }); +}); + +//--------------------------------------------------------------------------- Services mouseout +document.querySelectorAll(".hero-content-link").forEach(item => { + item.addEventListener("mouseout", () => { + + startSteadyState = setTimeout(() => { + + steadyState(); + faceWrapper.style.transform = "none"; + + }, 500); + + + }); +}); + + +/* //--------------------------------------------------------------------------- UI UX uiUXLink.addEventListener("mouseover", () => { clearTimeout(startSteadyState); @@ -91,7 +116,7 @@ graphicDesignLink.addEventListener("mouseout", () => { faceWrapper.style.transform = "none"; }); - +*/