@@ -105,7 +105,7 @@ export function Header() {
function HashLink({ path, text }: { path: string; text: string }) {
return (
{text}
diff --git a/src/components/Promotion.tsx b/src/components/Promotion.tsx
index f005162..8f39d8c 100644
--- a/src/components/Promotion.tsx
+++ b/src/components/Promotion.tsx
@@ -1,7 +1,7 @@
import { AnimatePresence, motion } from 'framer-motion';
import { Title } from './ui/Title';
import { promotionFeatures } from '../consts/promotionFeatures';
-import { useEffect, useRef, useState } from 'react';
+import { useRef, useState } from 'react';
import { useHover } from 'usehooks-ts';
import { useLocation } from 'react-router-dom';
import { hashes } from '../consts/motivationHashes';
@@ -27,7 +27,7 @@ export function Promotion() {
{promotionFeatures.map((feature, index) =>
- width >= 1024 ? (
+ width >= 1280 ? (
(null);
+ const width = useWindowWidth();
+
const hovered = useHover(ref);
return (
@@ -70,49 +72,38 @@ function DesktopFeature({
transition={{ duration: 0.7 }}
animate={
hovered || hash.slice(1) === hashes.get(number)
- ? { height: 424 }
- : { height: 140 }
+ ? { height: 0.265 * width }
+ : { height: 0.0875 * width }
}
>
-
-
-
[0{number}]
-
+
+
[0{number}]
+
+
{title}
+ {(hovered || hash.slice(1) === hashes.get(number)) && (
+
+ {description}
+
+ )}
-
- {description}
-
@@ -123,13 +114,13 @@ function DesktopFeature({
src={image}
alt=""
transition={{ duration: 0.5 }}
- className="transition-[height] h-full"
+ className="h-full "
animate={{
maxHeight:
(hovered || hash.slice(1) === hashes.get(number)) &&
index === 0
- ? 424
- : 140,
+ ? 0.265 * width
+ : 0.0875 * width,
}}
/>
@@ -153,25 +144,9 @@ function Feature({
}) {
const [expanded, setExpanded] = useState(false);
- const [descriptionHeight, setDescriptionHeight] = useState(0);
-
- const root = useRef(null);
- const descriptionRef = useRef(null);
- // const imgRef = useRef(null);
-
- useEffect(() => {
- setDescriptionHeight(descriptionRef.current?.clientHeight ?? 0);
- }, [expanded, descriptionRef]);
-
return (
setExpanded(prev => !prev)}
>
@@ -185,8 +160,7 @@ function Feature({
{expanded && (
setOpen(false));
return (
-
+
{open && (
-
+
{getCountries()
.map(country => [`+${getCountryCallingCode(country)}`, country])
.filter(
@@ -63,9 +63,9 @@ export function SelectPhoneCode({

c.iso === country)?.flag}
alt=""
- className="sm:w-6 w-4"
+ className="w-4 sm:w-6"
/>
-
{phoneCode}
+
{phoneCode}
))}