The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
few website improvements (#19353)
Thomas des Francs4aa1d71b1267
diff --git a/packages/twenty-website-new/src/sections/Hero/components/HomeVisual/HomeVisual.tsx b/packages/twenty-website-new/src/sections/Hero/components/HomeVisual/HomeVisual.tsxindex 2776ac47cb2..aa585e97ad8 100644--- a/packages/twenty-website-new/src/sections/Hero/components/HomeVisual/HomeVisual.tsx+++ b/packages/twenty-website-new/src/sections/Hero/components/HomeVisual/HomeVisual.tsx@@ -1898,13 +1898,22 @@ export function HomeVisual({ visual }: { visual: HeroVisualType }) {}if (- node.scrollWidth <= node.clientWidth ||Math.abs(event.deltaY) <= Math.abs(event.deltaX)) {return;}- node.scrollLeft += event.deltaY;+ const maxScrollLeft = Math.max(node.scrollWidth - node.clientWidth, 0);+ const nextScrollLeft = Math.min(+ Math.max(node.scrollLeft + event.deltaY, 0),+ maxScrollLeft,+ );++ if (Math.abs(nextScrollLeft - node.scrollLeft) < 0.5) {+ return;+ }++ node.scrollLeft = nextScrollLeft;event.preventDefault();};diff --git a/packages/twenty-website-new/src/sections/Plans/components/BillingToggle/BillingToggle.tsx b/packages/twenty-website-new/src/sections/Plans/components/BillingToggle/BillingToggle.tsxindex 39856b131d3..ed069e43baf 100644--- a/packages/twenty-website-new/src/sections/Plans/components/BillingToggle/BillingToggle.tsx+++ b/packages/twenty-website-new/src/sections/Plans/components/BillingToggle/BillingToggle.tsx@@ -7,34 +7,37 @@ import { styled } from '@linaria/react';const ToggleTrack = styled.div`align-items: center;background-color: ${theme.colors.primary.border[10]};- border-radius: ${theme.radius(10)};+ border-radius: ${theme.radius(20)};display: flex;- padding-bottom: ${theme.spacing(1)};- padding-left: ${theme.spacing(1.5)};- padding-right: ${theme.spacing(1.5)};- padding-top: ${theme.spacing(1)};+ padding: ${theme.spacing(1)};`;const ToggleOption = styled.button`align-items: center;background: none;border: none;- border-radius: ${theme.radius(9)};+ border-radius: ${theme.radius(8)};cursor: pointer;display: flex;font-family: ${theme.font.family.mono};font-size: ${theme.font.size(3)};font-weight: ${theme.font.weight.medium};column-gap: ${theme.spacing(2)};+ height: ${theme.spacing(6)};justify-content: center;line-height: ${theme.lineHeight(4)};- padding-bottom: ${theme.spacing(1)};padding-left: ${theme.spacing(3)};- padding-right: ${theme.spacing(3)};- padding-top: ${theme.spacing(1)};text-transform: uppercase;white-space: nowrap;+ &[data-period='monthly'] {+ padding-right: ${theme.spacing(3)};+ }++ &[data-period='yearly'] {+ padding-right: ${theme.spacing(0.5)};+ }+&[data-active='true'] {background-color: ${theme.colors.primary.background[100]};color: ${theme.colors.primary.text[100]};@@ -45,18 +48,25 @@ const ToggleOption = styled.button`}`;+const ToggleLabel = styled.span`+ display: inline-flex;+ justify-content: center;+`;+const DiscountBadge = styled.span`background-color: ${theme.colors.highlight[100]};- border-radius: ${theme.radius(6)};+ border-radius: ${theme.radius(12)};color: ${theme.colors.secondary.text[100]};+ display: inline-flex;font-family: ${theme.font.family.sans};font-size: ${theme.font.size(3)};font-weight: ${theme.font.weight.regular};+ height: ${theme.spacing(5)};+ align-items: center;+ justify-content: center;line-height: ${theme.lineHeight(3.5)};- padding-bottom: ${theme.spacing(1)};padding-left: ${theme.spacing(1)};padding-right: ${theme.spacing(1)};- padding-top: ${theme.spacing(1)};`;type BillingToggleProps = {@@ -73,20 +83,22 @@ export function BillingToggle({<ToggleOptionaria-checked={billing === 'monthly'}data-active={billing === 'monthly'}+ data-period="monthly"onClick={() => onBillingChange('monthly')}role="radio"type="button">- Monthly+ <ToggleLabel>Monthly</ToggleLabel></ToggleOption><ToggleOptionaria-checked={billing === 'yearly'}data-active={billing === 'yearly'}+ data-period="yearly"onClick={() => onBillingChange('yearly')}role="radio"type="button">- Yearly+ <ToggleLabel>Yearly</ToggleLabel><DiscountBadge>-20%</DiscountBadge></ToggleOption></ToggleTrack>diff --git a/packages/twenty-website-new/src/sections/Plans/components/Card/Card.tsx b/packages/twenty-website-new/src/sections/Plans/components/Card/Card.tsxindex 2c062abbad5..5470a71d725 100644--- a/packages/twenty-website-new/src/sections/Plans/components/Card/Card.tsx+++ b/packages/twenty-website-new/src/sections/Plans/components/Card/Card.tsx@@ -8,6 +8,7 @@ const FIXED_ROWS = 4;const StyledCard = styled.div`background-color: ${theme.colors.primary.background[100]};+ border: 1px solid transparent;border-radius: ${theme.radius(1)};display: grid;grid-template-columns: 1fr;@@ -18,19 +19,19 @@ const StyledCard = styled.div`padding-right: ${theme.spacing(4)};padding-top: ${theme.spacing(4)};row-gap: ${theme.spacing(4)};- transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.6s cubic-bezier(0.16, 1, 0.3, 1);+ transition:+ transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),+ box-shadow 0.6s cubic-bezier(0.16, 1, 0.3, 1),+ border-color 0.6s cubic-bezier(0.16, 1, 0.3, 1);position: relative;z-index: 1;&:hover {+ border-color: ${theme.colors.highlight[100]};transform: translateY(-12px) scale(1.02);box-shadow: 0 24px 48px rgba(0, 0, 0, 0.12);z-index: 10;}-- &[data-highlighted='true'] {- border: 1px solid ${theme.colors.highlight[100]};- }`;const CardHeader = styled.div`@@ -107,10 +108,7 @@ export function Card({ card, highlighted = false, maxBullets }: CardProps) {const totalRows = FIXED_ROWS + maxBullets;return (- <StyledCard- data-highlighted={highlighted}- style={{ gridRow: `span ${totalRows}` }}- >+ <StyledCard style={{ gridRow: `span ${totalRows}` }}><CardHeader><CardHeaderInfo><Heading@@ -146,7 +144,7 @@ export function Card({ card, highlighted = false, maxBullets }: CardProps) {href="https://app.twenty.com/welcome"label="Start for free"type="anchor"- variant="contained"+ variant={highlighted ? 'contained' : 'outlined'}/><CardRule />diff --git a/packages/twenty-website-new/src/sections/Plans/components/PlansContent/PlansContent.tsx b/packages/twenty-website-new/src/sections/Plans/components/PlansContent/PlansContent.tsxindex 866f1728cf5..56e7c3bd68e 100644--- a/packages/twenty-website-new/src/sections/Plans/components/PlansContent/PlansContent.tsx+++ b/packages/twenty-website-new/src/sections/Plans/components/PlansContent/PlansContent.tsx@@ -6,11 +6,40 @@ import type {PlansHostingMode,} from '@/sections/Plans/types';import { getPlanCard } from '@/sections/Plans/utils';+import { theme } from '@/theme';+import { styled } from '@linaria/react';import { useState } from 'react';import { BillingToggle } from '../BillingToggle/BillingToggle';import { Cards } from '../Cards/Cards';import { SelfHostToggle } from '../SelfHostToggle/SelfHostToggle';+const ControlsRow = styled.div`+ display: grid;+ row-gap: ${theme.spacing(4)};+ width: 100%;++ @media (min-width: ${theme.breakpoints.md}px) {+ align-items: center;+ grid-template-columns: 1fr auto 1fr;+ }+`;++const BillingToggleSlot = styled.div`+ justify-self: center;++ @media (min-width: ${theme.breakpoints.md}px) {+ grid-column: 2;+ }+`;++const SelfHostToggleSlot = styled.div`+ justify-self: end;++ @media (min-width: ${theme.breakpoints.md}px) {+ grid-column: 3;+ }+`;+export function PlansContent() {const [billing, setBilling] = useState<PlansBillingPeriod>('yearly');const [hosting, setHosting] = useState<PlansHostingMode>('cloud');@@ -25,9 +54,18 @@ export function PlansContent() {return (<>- <BillingToggle billing={billing} onBillingChange={setBilling} />- <SelfHostToggle hosting={hosting} onHostingChange={setHosting} />- <Cards organization={organizationCard} pro={proCard} />+ <ControlsRow>+ <BillingToggleSlot>+ <BillingToggle billing={billing} onBillingChange={setBilling} />+ </BillingToggleSlot>+ <SelfHostToggleSlot>+ <SelfHostToggle hosting={hosting} onHostingChange={setHosting} />+ </SelfHostToggleSlot>+ </ControlsRow>+ <Cards+ organization={organizationCard}+ pro={proCard}+ /></>);}diff --git a/packages/twenty-website-new/src/sections/Plans/components/SelfHostToggle/SelfHostToggle.tsx b/packages/twenty-website-new/src/sections/Plans/components/SelfHostToggle/SelfHostToggle.tsxindex bbe6b5c0f87..dee01f7bb98 100644--- a/packages/twenty-website-new/src/sections/Plans/components/SelfHostToggle/SelfHostToggle.tsx+++ b/packages/twenty-website-new/src/sections/Plans/components/SelfHostToggle/SelfHostToggle.tsx@@ -8,9 +8,11 @@ const ToggleRow = styled.label`align-items: center;column-gap: ${theme.spacing(2)};cursor: pointer;- display: grid;- grid-template-columns: auto 1fr;- width: 100%;+ display: inline-grid;+ grid-template-columns: auto auto;+ justify-self: end;+ position: relative;+ white-space: nowrap;`;const Checkbox = styled.span`@@ -62,9 +64,9 @@ const HiddenInput = styled.input`const LabelText = styled.span`color: ${theme.colors.primary.text[80]};font-family: ${theme.font.family.sans};- font-size: ${theme.font.size(4)};+ font-size: ${theme.font.size(3.5)};font-weight: ${theme.font.weight.regular};- line-height: ${theme.lineHeight(5.5)};+ line-height: ${theme.lineHeight(3.5)};`;type SelfHostToggleProps = {@@ -87,10 +89,10 @@ export function SelfHostToggle({}type="checkbox"/>+ <LabelText>Selfhosting</LabelText><Checkbox data-checked={isSelfHost}>{isSelfHost && <CheckmarkIcon />}</Checkbox>- <LabelText>Selfhosting</LabelText></ToggleRow>);}