diff --git a/app/what-to-expect/page.js b/app/what-to-expect/page.js
index cc16901..c575ce1 100644
--- a/app/what-to-expect/page.js
+++ b/app/what-to-expect/page.js
@@ -19,7 +19,7 @@ export default function About() {
-
+
diff --git a/app/works/page.js b/app/works/page.js
index 400e1e6..94031c7 100644
--- a/app/works/page.js
+++ b/app/works/page.js
@@ -22,7 +22,7 @@ export default function Home() {
How it Helps You to Keep Healthy
-
+
{/* Processing Blocks */}
{[1, 2, 3].map((count) => (
diff --git a/components/elements/Counter.js b/components/elements/Counter.js
index 35ea3ac..0100587 100644
--- a/components/elements/Counter.js
+++ b/components/elements/Counter.js
@@ -1,56 +1,25 @@
-import { useEffect, useRef, useState } from 'react'
+'use client'
+import { useEffect, useState } from 'react'
-
-export default function Counter({ end, duration }) {
+export default function Counter({ end, duration = 2 }) {
const [count, setCount] = useState(0)
- const countRef = useRef(null)
- const increment = end / duration
useEffect(() => {
- const observer = new IntersectionObserver(
- ([entry]) => {
- if (entry.isIntersecting) {
- startCount()
- observer.disconnect()
- }
- },
- { threshold: 0 }
- )
+ let start = 0
+ const totalFrames = duration * 60 // 60 FPS
+ const increment = end / totalFrames
- if (countRef.current) {
- observer.observe(countRef.current)
- }
+ const counter = setInterval(() => {
+ start += increment
+ if (start >= end) {
+ start = end
+ clearInterval(counter)
+ }
+ setCount(Math.floor(start))
+ }, 1000 / 60)
- return () => {
- observer.disconnect()
- }
- }, [])
+ return () => clearInterval(counter)
+ }, [end, duration])
- useEffect(() => {
- const interval = setInterval(() => {
- setCount((prevCount) => {
- const newCount = prevCount + increment
- if (newCount >= end) {
- clearInterval(interval)
- return end
- } else {
- return newCount
- }
- })
- }, 1000 / duration)
-
- return () => {
- clearInterval(interval)
- }
- }, [end, increment])
-
- const startCount = () => {
- setCount(0)
- }
-
- return (
-
- {Math.round(count)}
-
- )
-}
\ No newline at end of file
+ return <>{count}>
+}
diff --git a/components/elements/CounterUp.js b/components/elements/CounterUp.js
index 1676587..8d72338 100644
--- a/components/elements/CounterUp.js
+++ b/components/elements/CounterUp.js
@@ -1,31 +1,30 @@
'use client'
-import { useEffect, useState } from 'react'
+import { useEffect, useState, useRef } from 'react'
import Counter from './Counter'
-export default function CounterUp({ end }) {
+export default function CounterUp({ end, duration = 2 }) {
const [inViewport, setInViewport] = useState(false)
+ const ref = useRef(null)
- const handleScroll = () => {
- const elements = document.getElementsByClassName('count-text')
- if (elements.length > 0) {
- const element = elements[0]
- const rect = element.getBoundingClientRect()
- const isInViewport = rect.top >= 0 && rect.bottom <= window.innerHeight
- if (isInViewport && !inViewport) {
+ const checkInView = () => {
+ if (ref.current) {
+ const rect = ref.current.getBoundingClientRect()
+ const isVisible = rect.top < window.innerHeight && rect.bottom >= 0
+ if (isVisible && !inViewport) {
setInViewport(true)
}
}
}
useEffect(() => {
- window.addEventListener('scroll', handleScroll)
- return () => {
- window.removeEventListener('scroll', handleScroll)
- }
+ checkInView() // Trigger immediately if already visible
+ window.addEventListener('scroll', checkInView)
+ return () => window.removeEventListener('scroll', checkInView)
}, [])
+
return (
- <>
-
{inViewport && }
- >
+
+ {inViewport && }
+
)
}
diff --git a/components/sections/home/AboutSection.js b/components/sections/home/AboutSection.js
index a865319..1337c15 100644
--- a/components/sections/home/AboutSection.js
+++ b/components/sections/home/AboutSection.js
@@ -7,7 +7,7 @@ export default function AboutSection() {
diff --git a/components/sections/home/FaqSection.js b/components/sections/home/FaqSection.js
index a2d5d4d..56c8dc3 100644
--- a/components/sections/home/FaqSection.js
+++ b/components/sections/home/FaqSection.js
@@ -37,7 +37,7 @@ export default function FaqSection() {
-
+
diff --git a/components/sections/home/ProcessSection.js b/components/sections/home/ProcessSection.js
index ca46954..254898e 100644
--- a/components/sections/home/ProcessSection.js
+++ b/components/sections/home/ProcessSection.js
@@ -15,7 +15,7 @@ export default function ProcessSection() {
How Physiotherapy Helps You Heal and Stay Strong
-
+
{/* Step 01 */}
diff --git a/components/sections/home1/About.js b/components/sections/home1/About.js
index 1ff88e1..f79818d 100644
--- a/components/sections/home1/About.js
+++ b/components/sections/home1/About.js
@@ -9,7 +9,7 @@ export default function about() {
-
+
diff --git a/components/sections/home1/Process.js b/components/sections/home1/Process.js
index 76d9e98..8b2ca61 100644
--- a/components/sections/home1/Process.js
+++ b/components/sections/home1/Process.js
@@ -15,7 +15,7 @@ export default function Process() {
How it Helps You to Keep Healthy
-
+
01
diff --git a/components/sections/home2/About.js b/components/sections/home2/About.js
index 17b4103..e1f26d8 100644
--- a/components/sections/home2/About.js
+++ b/components/sections/home2/About.js
@@ -6,7 +6,7 @@ export default function About() {
diff --git a/components/sections/home3/About.js b/components/sections/home3/About.js
index e2eecb1..ed6a66c 100644
--- a/components/sections/home3/About.js
+++ b/components/sections/home3/About.js
@@ -16,7 +16,7 @@ export default function About() {
-
+
diff --git a/components/sections/home3/Process.js b/components/sections/home3/Process.js
index f36bde3..c2784b5 100644
--- a/components/sections/home3/Process.js
+++ b/components/sections/home3/Process.js
@@ -15,7 +15,7 @@ export default function Process() {
How it Helps You to Keep Healthy
-
+
01
diff --git a/components/sections/onepage/About.js b/components/sections/onepage/About.js
index 76dc40e..c2f78d8 100644
--- a/components/sections/onepage/About.js
+++ b/components/sections/onepage/About.js
@@ -9,7 +9,7 @@ export default function about() {
-
+
diff --git a/components/sections/onepage/Process.js b/components/sections/onepage/Process.js
index 9a63bad..d3a748f 100644
--- a/components/sections/onepage/Process.js
+++ b/components/sections/onepage/Process.js
@@ -15,7 +15,7 @@ export default function Process() {
How it Helps You to Keep Healthy
-
+
01
diff --git a/public/assets/images/BrandPartners/1.png b/public/assets/images/BrandPartners/1.png
new file mode 100644
index 0000000..a193a55
Binary files /dev/null and b/public/assets/images/BrandPartners/1.png differ
diff --git a/public/assets/images/BrandPartners/2.png b/public/assets/images/BrandPartners/2.png
new file mode 100644
index 0000000..f61ee3f
Binary files /dev/null and b/public/assets/images/BrandPartners/2.png differ
diff --git a/public/assets/images/BrandPartners/3.png b/public/assets/images/BrandPartners/3.png
new file mode 100644
index 0000000..93e7fa2
Binary files /dev/null and b/public/assets/images/BrandPartners/3.png differ
diff --git a/public/assets/images/BrandPartners/4.png b/public/assets/images/BrandPartners/4.png
new file mode 100644
index 0000000..57d980f
Binary files /dev/null and b/public/assets/images/BrandPartners/4.png differ
diff --git a/public/assets/images/BrandPartners/5.png b/public/assets/images/BrandPartners/5.png
new file mode 100644
index 0000000..1c2e4d1
Binary files /dev/null and b/public/assets/images/BrandPartners/5.png differ
diff --git a/public/assets/images/BrandPartners/6.png b/public/assets/images/BrandPartners/6.png
new file mode 100644
index 0000000..ac47ffd
Binary files /dev/null and b/public/assets/images/BrandPartners/6.png differ