Hi,
I am currently using the impact theme. The number counting animation goes from 0-100 but I want to change it so it can go from 100 - 0. Is this possible? Attached is a photo of the number (100) I want to change so it ends at 0.
Thank you
Hi,
I am currently using the impact theme. The number counting animation goes from 0-100 but I want to change it so it can go from 100 - 0. Is this possible? Attached is a photo of the number (100) I want to change so it ends at 0.
Thank you
Hi @bigjimmy15 ,
May I suggest to update code these steps:
import { animate as animate14, inView as inView9 } from "vendor";
var ImpactText = class extends HTMLElement {
connectedCallback() {
if (!window.matchMedia("(prefers-reduced-motion: no-preference)").matches) {
return;
}
inView9(this, ({ target }) => this._onBecameVisible(target), { margin: "-100px" });
}
async _onBecameVisible(target) {
animate14(target, { opacity: 1, transform: ["translateY(10px)", "translateY(0)"] }, { duration: 0.3 });
if (this.hasAttribute("count-up")) {
const itemToSearch = this.childElementCount === 0 ? this : this.firstElementChild, matches = itemToSearch.textContent.trim().match(/\d+(?:[,. ]\d+)*/);
if (!matches) {
return;
}
itemToSearch.innerHTML = itemToSearch.textContent.replace(/\d+(?:[,. ]\d+)*/, `${matches[0]}`);
const numberSpan = itemToSearch.querySelector("span");
numberSpan.style.textAlign = matches[0] === matches["input"] ? null : "end";
if (!itemToSearch.classList.contains("text-gradient")) {
numberSpan.style.display = "inline-block";
numberSpan.style.minWidth = `${numberSpan.clientWidth}px`;
}
const toReplace = matches[0].replace(/[,\. ]+/, ""), charactersMatches = [...matches[0].matchAll(/[,\. ]+/g)];
await animate14((progress) => {
let formattedString = parseInt(toReplace) - Math.round(progress * parseInt(toReplace)).toString();
charactersMatches.forEach((character) => {
if (formattedString.length >= matches[0].length - character.index) {
formattedString = formattedString.slice(0, character.index) + character[0] + formattedString.slice(character.index);
}
});
numberSpan.textContent = progress === 1 ? 0 : formattedString;
}, { duration: parseFloat(this.getAttribute("count-up")), easing: [0.16, 1, 0.3, 1] }).finished;
numberSpan.style.minWidth = null;
}
}
};
if (!window.customElements.get("impact-text")) {
window.customElements.define("impact-text", ImpactText);
}
Thank you for your help! It worked great! Can you help me out with another change I want to make? Attached is a photo of my mega menu but I want to make the tabs go vertical rather than horizontal and have more than one of the collection pictures and links on it as well. The second photo is of what I want it to look like. Can you help me out?
Thank you
Hi,
Could you share your URL store? I can refer this theme here https://support.maestrooo.com/article/709-mega-menu
/* important Notes*/
/* important Notes*/
Submenu is Bold - text only
Layout: Horizontal