Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

Cleaner solution illustrations

Blue Mousef94b64168d4d
diff --git a/web/app/components/Header/index.tsx b/web/app/components/Header/index.tsx
index 77ec9dd5c..6b93b8f72 100644
--- a/web/app/components/Header/index.tsx
+++ b/web/app/components/Header/index.tsx
@@ -67,6 +67,7 @@ import { Text } from '~/ui/Text'
import routes from '~/utils/routes'
import { cn } from '~/utils/generic'
import { BannerManager } from './banners'
+import { SOLUTION_VISUALS } from './solutionIllustrations'
const CONTACT_US_URL = `https://swetrix.com${routes.contact}`
@@ -141,47 +142,112 @@ interface SolutionItem {
className: string
}
-const SolutionTile = ({ item }: { item: SolutionItem }) => (
- <div className='group relative flex gap-x-2 rounded-lg p-2 transition-colors hover:bg-gray-400/20 dark:hover:bg-slate-700/50'>
- <item.icon
- className={cn(
- 'mt-1 h-5 w-5 text-gray-600 dark:text-gray-300',
- item.className,
- )}
- aria-hidden='true'
- weight='duotone'
- />
- <div>
- {_startsWith(item.link, '/') ? (
- <Link
- to={item.link}
- className='text-sm font-semibold text-gray-900 dark:text-gray-50'
- >
- {item.name}
- <span className='absolute inset-0' />
- </Link>
- ) : (
- <a
- href={item.link}
- target='_blank'
- rel='noopener noreferrer'
- className='text-sm font-semibold text-gray-900 dark:text-gray-50'
- >
- {item.name}
- <span className='absolute inset-0' />
- </a>
- )}
+type FooterItem = Pick<SolutionItem, 'name' | 'link' | 'icon' | 'className'>
+const SolutionCard = ({ item }: { item: SolutionItem }) => {
+ const visual = SOLUTION_VISUALS[item.link]
+ const isInternal = _startsWith(item.link, '/')
+
+ const className =
+ 'group/card relative flex flex-col rounded-xl p-2 ring-1 ring-transparent transition-[box-shadow,background-color] duration-200 ease-out hover:bg-gray-50 hover:ring-gray-200/80 motion-reduce:transition-none dark:hover:bg-slate-800/40 dark:hover:ring-slate-700/60'
+
+ const inner = (
+ <>
+ <div
+ className={cn(
+ 'relative h-28 overflow-hidden rounded-lg bg-gray-100 ring-1 ring-gray-200/70 dark:bg-slate-800 dark:ring-slate-700/60',
+ 'grayscale transition-[filter] duration-500 ease-out group-hover/card:grayscale-0',
+ 'motion-reduce:transition-none',
+ )}
+ >
+ {visual ? (
+ <>
+ <img
+ src={visual.bg}
+ alt=''
+ loading='lazy'
+ className='absolute inset-0 size-full object-cover'
+ />
+ <visual.Mockup />
+ </>
+ ) : null}
+ </div>
+ <h3 className='flex items-start gap-1.5 px-1 pt-3 text-[13px] leading-5 font-semibold text-gray-900 dark:text-gray-50'>
+ <item.icon
+ className={cn(
+ 'mt-0.5 size-4 shrink-0 text-gray-400 transition-colors duration-300 dark:text-gray-500',
+ visual?.accentIcon,
+ )}
+ aria-hidden='true'
+ weight='duotone'
+ />
+ {item.name}
+ </h3>
<Text
as='p'
size='xs'
- className='mt-1 text-gray-600 dark:text-neutral-100'
+ className='px-1 pt-1 text-gray-600 dark:text-gray-400'
>
{item.description}
</Text>
- </div>
- </div>
-)
+ </>
+ )
+
+ return isInternal ? (
+ <Link to={item.link} className={className}>
+ {inner}
+ </Link>
+ ) : (
+ <a
+ href={item.link}
+ target='_blank'
+ rel='noopener noreferrer'
+ className={className}
+ >
+ {inner}
+ </a>
+ )
+}
+
+const FooterLink = ({
+ item,
+ emphasis,
+}: {
+ item: FooterItem
+ emphasis?: boolean
+}) => {
+ const content = (
+ <>
+ <item.icon
+ className={cn('size-4 shrink-0', item.className)}
+ aria-hidden='true'
+ weight='duotone'
+ />
+ <span>{item.name}</span>
+ </>
+ )
+ const className = cn(
+ 'inline-flex items-center gap-1.5 rounded-md px-1.5 py-1 text-[13px] font-medium transition-colors',
+ emphasis
+ ? 'text-gray-900 hover:bg-gray-100 dark:text-gray-50 dark:hover:bg-slate-800/60'
+ : 'text-gray-600 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-slate-800/60 dark:hover:text-gray-100',
+ )
+
+ return _startsWith(item.link, '/') ? (
+ <Link to={item.link} className={className}>
+ {content}
+ </Link>
+ ) : (
+ <a
+ href={item.link}
+ target='_blank'
+ rel='noopener noreferrer'
+ className={className}
+ >
+ {content}
+ </a>
+ )
+}
const SolutionsMenu = ({ inverted }: { inverted?: boolean }) => {
const { t } = useTranslation('common')
@@ -241,60 +307,24 @@ const SolutionsMenu = ({ inverted }: { inverted?: boolean }) => {
leaveFrom='opacity-100 translate-y-0'
leaveTo='opacity-0 translate-y-1'
>
- <div className='absolute z-40 mt-4 flex w-screen max-w-max backdrop-blur-md'>
- <div className='flex w-[650px] flex-col divide-y divide-gray-300/80 rounded-lg border border-gray-300/80 bg-gray-50/50 p-1.5 dark:divide-slate-700/60 dark:border-slate-700/60 dark:bg-slate-950/50'>
- <div className='grid w-full grid-cols-2 gap-1 p-4'>
+ <div className='absolute left-0 z-40 mt-3 w-[min(50rem,calc(100vw-1.5rem))] xl:w-[56rem]'>
+ <div className='overflow-hidden rounded-2xl bg-white/95 ring-1 ring-gray-200/80 backdrop-blur-md dark:bg-slate-950/95 dark:ring-slate-700/60'>
+ <div className='grid grid-cols-2 gap-2 p-3 lg:grid-cols-4'>
{_map(solutions, (item) => (
- <SolutionTile key={item.name} item={item} />
- ))}
- </div>
- <div className='grid w-full grid-cols-2 gap-1 p-4'>
- {_map(moreSolutions, (item) => (
- <SolutionTile key={item.name} item={item} />
+ <SolutionCard key={item.name} item={item} />
))}
</div>
- <div className='grid grid-cols-2 gap-1 px-4 py-2'>
- {_map(ctas, (item) => {
- if (_startsWith(item.link, '/')) {
- return (
- <Link
- key={item.name}
- to={item.link}
- className='flex items-center justify-center gap-x-2 rounded-lg p-3 text-gray-900 transition-colors hover:bg-gray-400/20 dark:text-gray-50 dark:hover:bg-slate-700/50'
- >
- <item.icon
- className={cn(
- 'h-5 w-5 flex-none text-gray-600 dark:text-gray-300',
- item.className,
- )}
- aria-hidden='true'
- weight='duotone'
- />
- {item.name}
- </Link>
- )
- }
-
- return (
- <a
- key={item.name}
- href={item.link}
- target='_blank'
- rel='noopener noreferrer'
- className='flex items-center justify-center gap-x-2 rounded-lg p-3 text-gray-900 transition-colors hover:bg-gray-400/20 dark:text-gray-50 dark:hover:bg-slate-700/50'
- >
- <item.icon
- className={cn(
- 'h-5 w-5 flex-none text-gray-600 dark:text-gray-300',
- item.className,
- )}
- aria-hidden='true'
- weight='duotone'
- />
- {item.name}
- </a>
- )
- })}
+ <div className='flex flex-col gap-3 border-t border-gray-200/80 bg-gray-50/70 px-3 py-2.5 sm:flex-row sm:items-center sm:justify-between dark:border-slate-700/60 dark:bg-slate-900/40'>
+ <div className='flex flex-wrap items-center gap-x-3 gap-y-1'>
+ {_map(moreSolutions, (item) => (
+ <FooterLink key={item.name} item={item} />
+ ))}
+ </div>
+ <div className='flex flex-wrap items-center gap-x-3 gap-y-1'>
+ {_map(ctas, (item) => (
+ <FooterLink key={item.name} item={item} emphasis />
+ ))}
+ </div>
</div>
</div>
</div>
diff --git a/web/app/components/Header/solutionIllustrations.tsx b/web/app/components/Header/solutionIllustrations.tsx
new file mode 100644
index 000000000..d2aa6e7cc
--- /dev/null
+++ b/web/app/components/Header/solutionIllustrations.tsx
@@ -0,0 +1,163 @@
+import type { ReactElement, ReactNode } from 'react'
+
+import { cn } from '~/utils/generic'
+import routes from '~/utils/routes'
+
+const Card = ({ children }: { children: ReactNode }) => (
+ <div className='absolute inset-x-4 top-4 -bottom-2 overflow-hidden rounded-t-lg bg-white p-2.5 ring-1 ring-black/[0.06] dark:bg-slate-900 dark:ring-white/[0.08]'>
+ {children}
+ </div>
+)
+
+const Skel = ({ className }: { className?: string }) => (
+ <div
+ className={cn('rounded-full bg-slate-200 dark:bg-slate-700', className)}
+ />
+)
+
+const Faint = ({ className }: { className?: string }) => (
+ <div
+ className={cn('rounded-full bg-slate-100 dark:bg-slate-800', className)}
+ />
+)
+
+const AnalyticsMockup = () => (
+ <Card>
+ <div className='flex items-center gap-1.5'>
+ <Faint className='size-3 rounded-[3px]' />
+ <Skel className='h-1.5 w-10' />
+ </div>
+ <svg
+ viewBox='0 0 130 32'
+ preserveAspectRatio='none'
+ className='mt-3 h-9 w-full'
+ aria-hidden='true'
+ >
+ <path
+ d='M0 27 L18 23 L36 25 L54 15 L72 18 L90 9 L108 12 L130 3'
+ fill='none'
+ className='stroke-indigo-500 dark:stroke-indigo-400'
+ strokeWidth='2'
+ strokeLinecap='round'
+ strokeLinejoin='round'
+ vectorEffect='non-scaling-stroke'
+ />
+ </svg>
+ <div className='mt-3 space-y-1.5'>
+ <Faint className='h-1 w-full' />
+ <Faint className='h-1 w-2/3' />
+ </div>
+ </Card>
+)
+
+const PerformanceMockup = () => (
+ <Card>
+ <div className='flex items-start justify-between'>
+ <svg viewBox='0 0 48 27' className='h-8 w-14' aria-hidden='true'>
+ <path
+ d='M4 24 A20 20 0 0 1 44 24'
+ fill='none'
+ className='stroke-slate-200 dark:stroke-slate-700'
+ strokeWidth='4'
+ strokeLinecap='round'
+ />
+ <path
+ d='M4 24 A20 20 0 0 1 34 6'
+ fill='none'
+ className='stroke-amber-500 dark:stroke-amber-400'
+ strokeWidth='4'
+ strokeLinecap='round'
+ />
+ </svg>
+ <Skel className='mt-1 h-1.5 w-8' />
+ </div>
+ <div className='mt-4 space-y-1.5'>
+ <Faint className='h-1 w-full' />
+ <Faint className='h-1 w-5/6' />
+ <Faint className='h-1 w-2/3' />
+ </div>
+ </Card>
+)
+
+const ErrorsMockup = () => {
+ const Row = ({ w }: { w: string }) => (
+ <div className='flex items-center gap-1.5'>
+ <Skel className='size-2 shrink-0' />
+ <Faint className={cn('h-1.5', w)} />
+ </div>
+ )
+ return (
+ <Card>
+ <div className='space-y-2.5'>
+ <Row w='w-full' />
+ <div className='flex items-center gap-1.5 rounded-md bg-red-500/10 px-1 py-1 dark:bg-red-400/10'>
+ <span className='size-2 shrink-0 rounded-full bg-red-500 dark:bg-red-400' />
+ <span className='h-1.5 w-2/3 rounded-full bg-red-500/40 dark:bg-red-400/40' />
+ </div>
+ <Row w='w-5/6' />
+ <Row w='w-3/4' />
+ </div>
+ </Card>
+ )
+}
+
+const CaptchaMockup = () => (
+ <Card>
+ <div className='flex items-center gap-2'>
+ <span className='grid size-4 shrink-0 place-items-center rounded-[4px] bg-emerald-500 dark:bg-emerald-400'>
+ <svg
+ viewBox='0 0 12 12'
+ className='size-2.5'
+ fill='none'
+ aria-hidden='true'
+ >
+ <path
+ d='M2.5 6.4 5 8.9 9.5 3.4'
+ className='stroke-white dark:stroke-slate-900'
+ strokeWidth='2'
+ strokeLinecap='round'
+ strokeLinejoin='round'
+ />
+ </svg>
+ </span>
+ <Skel className='h-1.5 w-12' />
+ </div>
+ <div className='mt-4 space-y-1.5'>
+ <Faint className='h-1 w-full' />
+ <Faint className='h-1 w-2/3' />
+ </div>
+ </Card>
+)
+
+export interface SolutionVisual {
+ bg: string
+ Mockup: () => ReactElement
+ accentIcon: string
+}
+
+export const SOLUTION_VISUALS: Record<string, SolutionVisual> = {
+ [routes.main]: {
+ bg: '/assets/solutions/analytics.webp',
+ Mockup: AnalyticsMockup,
+ accentIcon:
+ 'group-hover/card:text-indigo-500 dark:group-hover/card:text-indigo-400',
+ },
+ [routes.performance]: {
+ bg: '/assets/solutions/performance.webp',
+ Mockup: PerformanceMockup,
+ accentIcon:
+ 'group-hover/card:text-amber-500 dark:group-hover/card:text-amber-400',
+ },
+ [routes.errorTracking]: {
+ bg: '/assets/solutions/errors.webp',
+ Mockup: ErrorsMockup,
+ accentIcon:
+ 'group-hover/card:text-red-500 dark:group-hover/card:text-red-400',
+ },
+ [routes.captchaLanding]: {
+ bg: '/assets/solutions/captcha.webp',
+ Mockup: CaptchaMockup,
+ accentIcon:
+ 'group-hover/card:text-emerald-500 dark:group-hover/card:text-emerald-400',
+ },
+}
diff --git a/web/public/assets/solutions/analytics.webp b/web/public/assets/solutions/analytics.webp
new file mode 100644
index 000000000..283b96710
Binary files /dev/null and b/web/public/assets/solutions/analytics.webp differ
diff --git a/web/public/assets/solutions/captcha.webp b/web/public/assets/solutions/captcha.webp
new file mode 100644
index 000000000..652dbd844
Binary files /dev/null and b/web/public/assets/solutions/captcha.webp differ
diff --git a/web/public/assets/solutions/errors.webp b/web/public/assets/solutions/errors.webp
new file mode 100644
index 000000000..d3907af2a
Binary files /dev/null and b/web/public/assets/solutions/errors.webp differ
diff --git a/web/public/assets/solutions/performance.webp b/web/public/assets/solutions/performance.webp
new file mode 100644
index 000000000..43711154e
Binary files /dev/null and b/web/public/assets/solutions/performance.webp differ