diff --git a/app/(pages)/(index-page)/_components/FAQ/AccordionFAQ.module.scss b/app/(pages)/(index-page)/_components/FAQ/AccordionFAQ.module.scss index f03f941..9bb3deb 100644 --- a/app/(pages)/(index-page)/_components/FAQ/AccordionFAQ.module.scss +++ b/app/(pages)/(index-page)/_components/FAQ/AccordionFAQ.module.scss @@ -1,6 +1,7 @@ //screen sizes >=1840px @import '@globals/styles/mixins.scss'; .container { + position: relative; display: flex; flex-direction: column; z-index: 10; @@ -85,6 +86,14 @@ } } +@include tablet { + .container{ + .questions { + font-size: 1rem; + } + } +} + @include phone { .container{ .FAQText { diff --git a/app/(pages)/(index-page)/_components/FAQ/AccordionFAQ.tsx b/app/(pages)/(index-page)/_components/FAQ/AccordionFAQ.tsx index 4f39df1..e6d9f38 100644 --- a/app/(pages)/(index-page)/_components/FAQ/AccordionFAQ.tsx +++ b/app/(pages)/(index-page)/_components/FAQ/AccordionFAQ.tsx @@ -1,5 +1,6 @@ 'use client'; import React from 'react'; +import { useState, useEffect, useRef } from 'react'; import styles from './AccordionFAQ.module.scss'; import Link from 'next/link'; import { Accordion, AccordionItem as Item } from '@szhsin/react-accordion'; @@ -116,9 +117,42 @@ const AccordionFAQ = () => { */ } + const [fixedHeight, setFixedHeight] = useState(0); + const containerRef = useRef(null); + const longestAnswerRef = useRef(null); + + useEffect(() => { + if (containerRef.current && longestAnswerRef.current) { + const collapsedHeight = containerRef.current.scrollHeight; + const longestAnswerHeight = longestAnswerRef.current.scrollHeight; + + setFixedHeight(collapsedHeight + longestAnswerHeight); + } + }, []); + return ( -
+

FAQ

+ + {/* + Hidden element to measure the longest answer (first question) for calculating fixed height of the container + */} +
+

+ {faqs[0].answer} +

+
+ {faqs.map(({ question, answer }, index) => ( diff --git a/app/(pages)/(index-page)/_components/FAQ/FAQ.module.scss b/app/(pages)/(index-page)/_components/FAQ/FAQ.module.scss index 2be15c3..7ff1df0 100644 --- a/app/(pages)/(index-page)/_components/FAQ/FAQ.module.scss +++ b/app/(pages)/(index-page)/_components/FAQ/FAQ.module.scss @@ -12,10 +12,11 @@ width: 68%; position: relative; background-color: #549645; - padding-top: 35%; + padding-top: 30%; } .faq{ padding: 20%; + padding-top: 8%; position: relative; } .donation{ @@ -89,67 +90,72 @@ top: -60px; z-index: 30; } +.grass_2{ + position: absolute; + width: 7%; + top: 42%; + right: 0; +} +//assets in donate section .grass_single{ position: absolute; width: 15%; - top: -115px; + top: -35%; right: 15%; } .grass_1{ position: absolute; width: 12%; - top: -200px; -} -.grass_2{ - position: absolute; - width: 7%; - top: 42%; - right: 0; + top: -40%; } .grass_3{ position: absolute; width: 20%; - bottom: -225px; + bottom: -25%; right: 8%; } + +//assets in faq section + .grass_4{ position: absolute; - width: 7%; - bottom: 20%; + width: 10.5%; + top: 600px; + left:0; } .grass_5{ position: absolute; - width: 16%; + width: 23.1%; bottom: 2%; - left: 40% + right: 10% } .firefly_sm1{ position: absolute; width: 1%; - top: 30%; - right: 5%; + top: 320px; + right: 4%; animation: jump 6s infinite ease-in-out; } .firefly_lg1{ position: absolute; width: 1.5%; - top: 31%; + top: 300px; right: 6%; animation: jump 5s infinite ease-in-out; } .firefly_sm2{ position: absolute; width: 1%; - bottom: 14%; - right: 6%; - animation: jump 9s infinite ease-in-out; + top: 500px; + right: -40%; + animation: jump 6.5s infinite ease-in-out; } .firefly_lg2{ position: absolute; - width: 1%; - bottom: 6%; - left: 60%; - animation: jump 4s infinite ease-in-out; + width: 1.5%; + bottom: 100px; + right: 6%; + animation: jump 5.5s infinite ease-in-out; } @keyframes jump { 0%, 100% { transform: translateY(0); } @@ -200,9 +206,6 @@ .grass_1{ top: -160px; } - .grass_3{ - bottom: -130px; - } } @include sm-desktop { //1164 // for size 1048 to 1280 @@ -257,6 +260,12 @@ .grass_light{ top: -30px; } + .grass_single{ + top: -40%; + } + .grass_1{ + top: -45%; + } } @include phone { //phone 560 diff --git a/app/(pages)/(index-page)/_components/FAQ/FAQ.tsx b/app/(pages)/(index-page)/_components/FAQ/FAQ.tsx index d1bcbb5..458f6c7 100644 --- a/app/(pages)/(index-page)/_components/FAQ/FAQ.tsx +++ b/app/(pages)/(index-page)/_components/FAQ/FAQ.tsx @@ -96,34 +96,6 @@ export default function FAQ() { height={10} className={style.grass_2} /> - grass texture - grass texture - firefly - firefly
@@ -152,18 +124,46 @@ export default function FAQ() { />
+ grass texture + grass texture firefly firefly + firefly + firefly diff --git a/app/(pages)/(index-page)/_components/hero/heroMainSection.tsx b/app/(pages)/(index-page)/_components/hero/heroMainSection.tsx index 25622ba..ad82c31 100644 --- a/app/(pages)/(index-page)/_components/hero/heroMainSection.tsx +++ b/app/(pages)/(index-page)/_components/hero/heroMainSection.tsx @@ -75,7 +75,7 @@ export default function HeroSection() { className="h-[306px] w-[132px] md:h-[472px] md:w-[216px] lg:h-[472px] lg:w-[216px] xl:h-[561px] xl:w-[264px]" />
-
+