diff --git a/public/images/contact/banner-contact-light.png b/public/images/contact/banner-contact-light.png new file mode 100644 index 0000000..ed39a7b Binary files /dev/null and b/public/images/contact/banner-contact-light.png differ diff --git a/src/components/sections/contact/hero/hero.module.scss b/src/components/sections/contact/hero/hero.module.scss index 2a7745c..5643c79 100644 --- a/src/components/sections/contact/hero/hero.module.scss +++ b/src/components/sections/contact/hero/hero.module.scss @@ -188,4 +188,8 @@ filter: invert(100%); } } + + .hero__container { + mix-blend-mode: darken; + } } diff --git a/src/components/sections/contact/hero/index.tsx b/src/components/sections/contact/hero/index.tsx index b9a8767..3c53a36 100644 --- a/src/components/sections/contact/hero/index.tsx +++ b/src/components/sections/contact/hero/index.tsx @@ -1,3 +1,6 @@ +import { useTheme } from 'next-themes' +import { useEffect, useRef } from 'react' + import { Arrow } from '~/components/icons/arrow' import Line from '~/components/icons/line' import { Discord } from '~/components/icons/socials' @@ -19,21 +22,40 @@ interface Props { } const Hero = ({ data }: Props) => { + const { theme } = useTheme() + + const contactHeroRef = useRef(null) + const contactHeroMobileRef = useRef(null) + + useEffect(() => { + if (!contactHeroRef.current) return + if (!contactHeroMobileRef.current) return + + contactHeroRef.current.src = + theme === 'dark' + ? '/images/contact/banner-contact.png' + : '/images/contact/banner-contact-light.png' + contactHeroMobileRef.current.src = + theme === 'dark' + ? '/images/contact/banner-contact.png' + : '/images/contact/banner-contact-light.png' + }, [theme]) + return (
hero hero