From dc22b51548f0d6830fcee79eebd75650f3f19dc1 Mon Sep 17 00:00:00 2001 From: MAZE Date: Wed, 7 Feb 2024 15:08:08 +0330 Subject: [PATCH] style: add polka dot pattern --- src/components/container/container.tsx | 7 +- src/components/hero.astro | 131 ------------------------- src/components/hero/hero.module.css | 115 ++++++++++++++++++++++ src/components/hero/hero.tsx | 45 +++++++++ src/components/hero/index.ts | 1 + src/pages/index.astro | 2 +- 6 files changed, 167 insertions(+), 134 deletions(-) delete mode 100644 src/components/hero.astro create mode 100644 src/components/hero/hero.module.css create mode 100644 src/components/hero/hero.tsx create mode 100644 src/components/hero/index.ts diff --git a/src/components/container/container.tsx b/src/components/container/container.tsx index 836b1f8..597823a 100644 --- a/src/components/container/container.tsx +++ b/src/components/container/container.tsx @@ -1,9 +1,12 @@ +import { cn } from '@/helpers/styles'; + import styles from './container.module.css'; interface ContainerProps { children: React.ReactNode; + className?: string; } -export function Container({ children }: ContainerProps) { - return
{children}
; +export function Container({ children, className }: ContainerProps) { + return
{children}
; } diff --git a/src/components/hero.astro b/src/components/hero.astro deleted file mode 100644 index 6921eb9..0000000 --- a/src/components/hero.astro +++ /dev/null @@ -1,131 +0,0 @@ ---- -import { Balancer } from 'react-wrap-balancer'; -import { BsSoundwave } from 'react-icons/bs/index'; - -import { Container } from '@/components/container'; -import { count as soundCount } from '@/lib/sounds'; - -const count = soundCount(); ---- - -
- - - -
-
-

Moodist

-
-
- -

- Ambient sounds for focus and calm. -

- -

- - {count} Sounds -

-
-
- - diff --git a/src/components/hero/hero.module.css b/src/components/hero/hero.module.css new file mode 100644 index 0000000..1d9d8e6 --- /dev/null +++ b/src/components/hero/hero.module.css @@ -0,0 +1,115 @@ +.hero { + text-align: center; + + .container { + position: relative; + padding: 100px 0 60px; + + & .pattern { + position: absolute; + top: 0; + left: 0; + z-index: -1; + width: 100%; + height: 100%; + background-image: radial-gradient( + var(--color-neutral-200) 10%, + transparent 11% + ), + radial-gradient(var(--color-neutral-200) 10%, transparent 11%); + background-position: + 0 0, + 20px 20px; + background-size: 20px 20px; + mask-image: linear-gradient(#fff, transparent); + } + } + + & .logo { + display: block; + width: 45px; + margin: 0 auto 12px; + } + + & .title { + display: flex; + column-gap: 15px; + align-items: center; + + & div { + flex-grow: 1; + height: 1px; + + &.left { + background: linear-gradient( + 90deg, + transparent, + var(--color-neutral-300) + ); + } + + &.right { + background: linear-gradient( + 90deg, + var(--color-neutral-300), + transparent + ); + } + } + + & h1 { + font-family: var(--font-display); + font-size: var(--font-2xlg); + font-weight: 600; + } + } + + & .desc { + margin-top: 5px; + line-height: 1.6; + color: var(--color-foreground-subtle); + } + + & .sounds { + position: relative; + display: flex; + column-gap: 8px; + align-items: center; + justify-content: center; + width: max-content; + height: 28px; + padding-right: 12px; + margin: 20px auto 0; + font-size: var(--font-xsm); + color: var(--color-foreground-subtle); + background-color: var(--color-neutral-100); + border: 1px solid var(--color-neutral-200); + border-radius: 100px; + + & .icon { + display: flex; + align-items: center; + justify-content: center; + height: 100%; + padding: 0 8px 0 12px; + color: var(--color-foreground); + border-right: 1px solid var(--color-neutral-200); + } + + &::before { + position: absolute; + top: -1px; + left: 50%; + width: 70%; + height: 1px; + content: ''; + background: linear-gradient( + 90deg, + transparent, + var(--color-neutral-400), + transparent + ); + transform: translateX(-50%); + } + } +} diff --git a/src/components/hero/hero.tsx b/src/components/hero/hero.tsx new file mode 100644 index 0000000..61b46b9 --- /dev/null +++ b/src/components/hero/hero.tsx @@ -0,0 +1,45 @@ +import { useMemo } from 'react'; +import { Balancer } from 'react-wrap-balancer'; +import { BsSoundwave } from 'react-icons/bs/index'; + +import { Container } from '@/components/container'; +import { count as soundCount } from '@/lib/sounds'; + +import styles from './hero.module.css'; + +export function Hero() { + const count = useMemo(soundCount, []); + + return ( +
+ +
+ + Faded Moodist Logo + +
+
+

Moodist

+
+
+ +

+ Ambient sounds for focus and calm. +

+ +

+ + + + {count} Sounds +

+ +
+ ); +} diff --git a/src/components/hero/index.ts b/src/components/hero/index.ts new file mode 100644 index 0000000..1e9ccae --- /dev/null +++ b/src/components/hero/index.ts @@ -0,0 +1 @@ +export { Hero } from './hero'; diff --git a/src/pages/index.astro b/src/pages/index.astro index 4bfce54..c116051 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1,12 +1,12 @@ --- import Layout from '@/layouts/layout.astro'; import Donate from '@/components/donate.astro'; -import Hero from '@/components/hero.astro'; import Footer from '@/components/footer.astro'; import AboutSection from '@/components/sections/about.astro'; import WhySection from '@/components/sections/why.astro'; import ReadySection from '@/components/sections/ready.astro'; +import { Hero } from '@/components/hero'; import { App } from '@/components/app'; ---