diff --git a/apps/www/components/Features/FeaturesOld.tsx b/apps/www/components/Features/FeaturesOld.tsx deleted file mode 100644 index 812df2ce624..00000000000 --- a/apps/www/components/Features/FeaturesOld.tsx +++ /dev/null @@ -1,42 +0,0 @@ -import { Button, Badge, IconArrowRight } from 'ui' -import SectionHeader from 'components/UI/SectionHeader' -import Solutions from 'data/Solutions.json' -import Link from 'next/link' -import SectionContainer from '../Layouts/SectionContainer' -import ProductIcon from '../ProductIcon' -import TextLink from '../TextLink' - -const FeaturesOld = () => { - const IconSections = Object.values(Solutions).map((solution: any) => { - const { name, description, icon, label, url } = solution - if (solution.name === 'Realtime') return null - return ( -
-
- -
{name}
-
- -

{description}

- - {label && ( -
- {label} -
- )} - {url && } -
- ) - }) - - return ( - -

Build faster and focus on your products

-
- {IconSections} -
-
- ) -} - -export default FeaturesOld diff --git a/apps/www/components/Features/index.tsx b/apps/www/components/Features/index.tsx index 20897c3ad26..11603dd32d7 100644 --- a/apps/www/components/Features/index.tsx +++ b/apps/www/components/Features/index.tsx @@ -8,6 +8,7 @@ import Image from 'next/image' import SectionContainer from '../Layouts/SectionContainer' import { motion } from 'framer-motion' import BackedBy from '../BackedBy' +import { useBreakpoint } from 'common' const Card = ({ classname, @@ -27,7 +28,7 @@ const Card = ({ { ) } } + const isSm = useBreakpoint(640) return (
sendTelemetryEvent(name)} image={ @@ -111,8 +113,8 @@ const Features = () => { src="/images/index/database-dark-hover.jpg" alt="Supabase Postgres Database, hover image with glow" layout="fill" - objectPosition="50% 50%" - objectFit="cover" + objectPosition={isSm ? 'bottom' : '50% 50%'} + objectFit={isSm ? 'contain' : 'cover'} quality={100} /> @@ -120,8 +122,8 @@ const Features = () => { src="/images/index/database-dark.jpg" alt="Supabase Postgres Database" layout="fill" - objectPosition="50% 50%" - objectFit="cover" + objectPosition={isSm ? 'bottom' : '50% 50%'} + objectFit={isSm ? 'contain' : 'cover'} quality={100} /> @@ -196,8 +198,8 @@ const Features = () => { src="/images/index/edge-dark-hover.jpg" alt="Supabase Edge Functions feature, hover image with glow" layout="fill" - objectPosition="50% 50%" - objectFit="cover" + objectPosition={isSm ? 'bottom' : '50% 50%'} + objectFit={isSm ? 'contain' : 'cover'} quality={100} /> @@ -205,8 +207,8 @@ const Features = () => { src="/images/index/edge-dark.jpg" alt="Supabase Edge Functions feature" layout="fill" - objectPosition="50% 50%" - objectFit="cover" + objectPosition={isSm ? 'bottom' : '50% 50%'} + objectFit={isSm ? 'contain' : 'cover'} quality={100} /> diff --git a/apps/www/components/Hero/Hero.tsx b/apps/www/components/Hero/Hero.tsx index f265bdf4143..5c863e2cf2c 100644 --- a/apps/www/components/Hero/Hero.tsx +++ b/apps/www/components/Hero/Hero.tsx @@ -1,139 +1,62 @@ -import { useEffect, useRef } from 'react' import Link from 'next/link' import { Button, IconBookOpen } from 'ui' import SectionContainer from '../Layouts/SectionContainer' -import styles from './hero.module.css' -import { useWindowSize } from 'react-use' import BackedBy from '../BackedBy' -import { useTheme } from 'common' import { motion } from 'framer-motion' +import HeroBackground from './HeroBackground' -const Hero = () => { - const divRef = useRef(null) - const { isDarkMode } = useTheme() - const { width } = useWindowSize() - - useEffect(() => { - const newHeight = - width < 768 ? 100000 / width : width > 1800 ? 30000 / width : (70000 / width) * 2 - - if (divRef?.current) { - ;(divRef.current as HTMLDivElement).style.height = `${Math.round(newHeight)}px` - console.log(width, newHeight) - } - }, [width]) - - return ( -
- -
-
-
-
-
- + + - -
-
-
-
-
- - - -
-
-
-
-
-
-
-
-
-
-
-
-
- ) -} + + +
+) export default Hero diff --git a/apps/www/components/Hero/HeroBackground.tsx b/apps/www/components/Hero/HeroBackground.tsx new file mode 100644 index 00000000000..8d697e08084 --- /dev/null +++ b/apps/www/components/Hero/HeroBackground.tsx @@ -0,0 +1,166 @@ +import React, { useEffect, useRef } from 'react' +import styles from './hero.module.css' +import { useWindowSize } from 'react-use' +import { useTheme } from 'common' +import { motion } from 'framer-motion' + +const HeroBackground = () => { + const divRef = useRef(null) + const { isDarkMode } = useTheme() + const { width } = useWindowSize() + + useEffect(() => { + const newHeight = + width < 768 ? 100000 / width : width > 1800 ? 30000 / width : (70000 / width) * 2 + + if (divRef?.current) { + ;(divRef.current as HTMLDivElement).style.height = `${Math.round(newHeight)}px` + console.log(width, newHeight) + } + }, [width]) + + const svgTraceWidth = 1680 + const svgTraceHeight = 915 + const svgPath = + // 'M2.16005e-05 -0.000998163L1680 0.129286V234L834.197 1068.2L-0.000248139 234.001L2.16005e-05 -0.000998163Z' + 'M2.16005e-05 -0.000998163L1680 0.129286V234L834.197 1068.2L-0.000248139 234.001L2.16005e-05 -0.000998163Z' + + return ( + <> +
+
+
+
+
+ + + + + + {/* + // Animated trace + + + + + */} + + + + + + + + + + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+ + ) +} + +export default HeroBackground diff --git a/apps/www/public/images/index/storage-dark-hover.jpg b/apps/www/public/images/index/storage-dark-hover.jpg index a65a76ed0f2..922218bf781 100644 Binary files a/apps/www/public/images/index/storage-dark-hover.jpg and b/apps/www/public/images/index/storage-dark-hover.jpg differ diff --git a/apps/www/public/images/index/storage-dark.jpg b/apps/www/public/images/index/storage-dark.jpg index 049cfd12d5a..c0efe2097a1 100644 Binary files a/apps/www/public/images/index/storage-dark.jpg and b/apps/www/public/images/index/storage-dark.jpg differ