From e51ccf7af203f9e6f9b5a53d9b8a6dca5dcabfef Mon Sep 17 00:00:00 2001 From: Adir-html Date: Tue, 31 Mar 2026 23:35:32 +0300 Subject: [PATCH 1/2] Fix typos in hero subtitle and card title Fixed spelling. --- index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 126b54b..d1525fd 100644 --- a/index.html +++ b/index.html @@ -111,7 +111,7 @@
-

Wellcome to Our Agency

+

Welcome to Our Agency

Smart Ideas for your Brand are Here

@@ -412,7 +412,7 @@

Customer Strategy

04 -

Best Premimum Image

+

Best Premium Image

Nullam ullamcorper condimentum urna eu accumsan. @@ -833,4 +833,4 @@

- \ No newline at end of file + From f63662a344f1e00cea0852147fe8eebfb490ba20 Mon Sep 17 00:00:00 2001 From: Adir-html Date: Tue, 31 Mar 2026 23:39:41 +0300 Subject: [PATCH 2/2] Refactor addEventOnElem to handle NodeList and arrays --- assets/js/script.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/assets/js/script.js b/assets/js/script.js index 4b9f033..972f385 100644 --- a/assets/js/script.js +++ b/assets/js/script.js @@ -7,11 +7,13 @@ */ const addEventOnElem = function (elem, type, callback) { - if (elem.length > 1) { + // Check if elem is a NodeList or Array + if (elem instanceof NodeList || Array.isArray(elem)) { for (let i = 0; i < elem.length; i++) { elem[i].addEventListener(type, callback); } } else { + // This handles single elements AND the window object correctly elem.addEventListener(type, callback); } } @@ -73,4 +75,4 @@ const accordionAction = document.querySelectorAll("[data-accordion-action]"); const toggleAccordion = function () { this.classList.toggle("active"); } -addEventOnElem(accordionAction, "click", toggleAccordion); \ No newline at end of file +addEventOnElem(accordionAction, "click", toggleAccordion);