fix: improve dark mode background patterns

This commit is contained in:
Mythie
2023-09-25 00:18:15 +10:00
parent d4bc1eb0d1
commit 63cc57b035
10 changed files with 41 additions and 16 deletions

View File

@ -1,4 +1,8 @@
import React from 'react'; 'use client';
import React, { useEffect, useState } from 'react';
import { cn } from '@documenso/ui/lib/utils';
import { Footer } from '~/components/(marketing)/footer'; import { Footer } from '~/components/(marketing)/footer';
import { Header } from '~/components/(marketing)/header'; import { Header } from '~/components/(marketing)/header';
@ -8,15 +12,31 @@ export type MarketingLayoutProps = {
}; };
export default function MarketingLayout({ children }: MarketingLayoutProps) { export default function MarketingLayout({ children }: MarketingLayoutProps) {
const [scrollY, setScrollY] = useState(0);
useEffect(() => {
const onScroll = () => {
setScrollY(window.scrollY);
};
window.addEventListener('scroll', onScroll);
return () => window.removeEventListener('scroll', onScroll);
}, []);
return ( return (
<div className="relative max-w-[100vw] overflow-y-auto overflow-x-hidden pt-20 md:pt-28"> <div className="relative max-w-[100vw] overflow-y-auto overflow-x-hidden pt-20 md:pt-28">
<div className="bg-background/50 fixed left-0 top-0 z-50 w-full backdrop-blur-md"> <div
className={cn('fixed left-0 top-0 z-50 w-full bg-transparent', {
'bg-background/50 backdrop-blur-md': scrollY > 5,
})}
>
<Header className="mx-auto h-16 max-w-screen-xl px-4 md:h-20 lg:px-8" /> <Header className="mx-auto h-16 max-w-screen-xl px-4 md:h-20 lg:px-8" />
</div> </div>
<div className="relative mx-auto max-w-screen-xl px-4 lg:px-8">{children}</div> <div className="relative mx-auto max-w-screen-xl px-4 lg:px-8">{children}</div>
<Footer className="mt-24 bg-transparent backdrop-blur-[2px]" /> <Footer className="bg-background border-muted mt-24 border-t" />
</div> </div>
); );
} }

View File

@ -37,7 +37,7 @@ export default async function OSSFriendsPage() {
<Image <Image
src={backgroundPattern} src={backgroundPattern}
alt="background pattern" alt="background pattern"
className="-mr-[15vw] -mt-[15vh] h-full max-h-[150vh] scale-125 object-cover dark:invert dark:sepia md:-mr-[50vw] md:scale-150 lg:scale-[175%]" className="-mr-[15vw] -mt-[15vh] h-full max-h-[150vh] scale-125 object-cover dark:contrast-[70%] dark:invert dark:sepia md:-mr-[50vw] md:scale-150 lg:scale-[175%]"
/> />
</div> </div>
</div> </div>

View File

@ -26,7 +26,7 @@ export default function NotFound() {
<Image <Image
src={backgroundPattern} src={backgroundPattern}
alt="background pattern" alt="background pattern"
className="-mr-[50vw] -mt-[15vh] h-full scale-100 object-cover dark:invert dark:sepia md:scale-100 lg:scale-[100%]" className="-mr-[50vw] -mt-[15vh] h-full scale-100 object-cover dark:contrast-[70%] dark:invert dark:sepia md:scale-100 lg:scale-[100%]"
priority priority
/> />
</motion.div> </motion.div>

View File

@ -22,7 +22,7 @@ export const FasterSmarterBeautifulBento = ({
<Image <Image
src={backgroundPattern} src={backgroundPattern}
alt="background pattern" alt="background pattern"
className="h-full scale-125 object-cover dark:invert dark:sepia md:scale-150 lg:scale-[175%]" className="h-full scale-125 object-cover dark:contrast-[70%] dark:invert dark:sepia md:scale-150 lg:scale-[175%]"
/> />
</div> </div>
<h2 className="px-0 text-[22px] font-semibold md:px-12 md:text-4xl lg:px-24"> <h2 className="px-0 text-[22px] font-semibold md:px-12 md:text-4xl lg:px-24">

View File

@ -36,7 +36,7 @@ export const Header = ({ className, ...props }: HeaderProps) => {
{isSinglePlayerModeMarketingEnabled && ( {isSinglePlayerModeMarketingEnabled && (
<Link <Link
href="/single-player-mode" href="/single-player-mode"
className="bg-primary rounded-full px-2 py-1 text-xs font-semibold sm:px-3" className="bg-primary dark:text-background rounded-full px-2 py-1 text-xs font-semibold sm:px-3"
> >
Try now! Try now!
</Link> </Link>

View File

@ -86,7 +86,7 @@ export const Hero = ({ className, ...props }: HeroProps) => {
<Image <Image
src={backgroundPattern} src={backgroundPattern}
alt="background pattern" alt="background pattern"
className="-mr-[50vw] -mt-[15vh] h-full scale-125 object-cover dark:invert dark:sepia md:scale-150 lg:scale-[175%]" className="-mr-[50vw] -mt-[15vh] h-full scale-125 object-cover dark:contrast-[70%] dark:invert dark:sepia md:scale-150 lg:scale-[175%]"
/> />
</motion.div> </motion.div>
</div> </div>
@ -115,7 +115,7 @@ export const Hero = ({ className, ...props }: HeroProps) => {
onClick={onSignUpClick} onClick={onSignUpClick}
> >
Get the Community Plan Get the Community Plan
<span className="bg-primary dark:text-background -mr-2 ml-2.5 rounded-full px-2 py-1.5 text-xs"> <span className="bg-primary dark:text-background -mr-2.5 ml-2.5 rounded-full px-2 py-1.5 text-xs">
$30/mo. forever! $30/mo. forever!
</span> </span>
</Button> </Button>
@ -134,11 +134,16 @@ export const Hero = ({ className, ...props }: HeroProps) => {
variants={HeroTitleVariants} variants={HeroTitleVariants}
initial="initial" initial="initial"
animate="animate" animate="animate"
className="border-primary mx-auto mt-8 w-fit rounded-xl border-2 bg-white transition-colors hover:bg-slate-50/60" className="border-primary bg-background hover:bg-muted mx-auto mt-8 w-60 rounded-xl border transition duration-300"
> >
<Link href="/single-player-mode" className="block px-4 py-2 text-center"> <Link href="/single-player-mode" className="block px-4 py-2 text-center">
<h2 className="text-xs font-semibold text-[#727272]">Single Player Mode</h2> <h2 className="text-muted-foreground text-xs font-semibold">
<h1 className="font-semibold leading-5 text-[#606060]">Self sign documents here</h1> Introducing Single Player Mode
</h2>
<h1 className="text-foreground mt-1.5 font-medium leading-5">
Self sign for free!
</h1>
</Link> </Link>
</motion.div> </motion.div>
)) ))

View File

@ -19,7 +19,7 @@ export const OpenBuildTemplateBento = ({ className, ...props }: OpenBuildTemplat
<Image <Image
src={backgroundPattern} src={backgroundPattern}
alt="background pattern" alt="background pattern"
className="h-full scale-125 object-cover dark:invert dark:sepia md:scale-150 lg:scale-[175%]" className="h-full scale-125 object-cover dark:contrast-[70%] dark:invert dark:sepia md:scale-150 lg:scale-[175%]"
/> />
</div> </div>
<h2 className="px-0 text-[22px] font-semibold md:px-12 md:text-4xl lg:px-24"> <h2 className="px-0 text-[22px] font-semibold md:px-12 md:text-4xl lg:px-24">

View File

@ -23,7 +23,7 @@ export const ShareConnectPaidWidgetBento = ({
<Image <Image
src={backgroundPattern} src={backgroundPattern}
alt="background pattern" alt="background pattern"
className="h-full scale-125 object-cover dark:invert dark:sepia md:scale-150 lg:scale-[175%]" className="h-full scale-125 object-cover dark:contrast-[70%] dark:invert dark:sepia md:scale-150 lg:scale-[175%]"
/> />
</div> </div>
<h2 className="px-0 text-[22px] font-semibold md:px-12 md:text-4xl lg:px-24"> <h2 className="px-0 text-[22px] font-semibold md:px-12 md:text-4xl lg:px-24">

View File

@ -16,7 +16,7 @@ export default function UnauthenticatedLayout({ children }: UnauthenticatedLayou
<Image <Image
src={backgroundPattern} src={backgroundPattern}
alt="background pattern" alt="background pattern"
className="dark:brightness-95 dark:invert dark:sepia" className="dark:brightness-95 dark:contrast-[70%] dark:invert dark:sepia"
/> />
</div> </div>

View File

@ -29,7 +29,7 @@ export default function NotFoundPartial({ children }: NotFoundPartialProps) {
<Image <Image
src={backgroundPattern} src={backgroundPattern}
alt="background pattern" alt="background pattern"
className="-mr-[50vw] -mt-[15vh] h-full scale-100 object-cover md:scale-100 lg:scale-[100%]" className="-mr-[50vw] -mt-[15vh] h-full scale-100 object-cover dark:contrast-[70%] dark:invert dark:sepia md:scale-100 lg:scale-[100%]"
priority priority
/> />
</motion.div> </motion.div>