diff --git a/src/app/pricing/page.tsx b/src/app/pricing/page.tsx index 560fe10b..370ef3c7 100644 --- a/src/app/pricing/page.tsx +++ b/src/app/pricing/page.tsx @@ -5,10 +5,9 @@ import { draftMode } from 'next/headers' import { pricingPageFragment } from '~/lib/basehub-queries' import { Footer } from '~/components/Footer' import { PricingFAQ } from '~/components/pricing/PricingFAQ' -import { CostCalculator } from '~/components/pricing/sections/CostCalculator' -import { featureFlags } from '~/lib/feature-flags' import { Metadata, Viewport } from 'next/types' import { Header } from '~/components/layout/header' +import { Calculator } from '~/components/pricing/sections/cost-calculator' export const metadata: Metadata = { title: 'Pricing' @@ -32,7 +31,7 @@ export default function Home() {
- {featureFlags.showCalculator && } +
diff --git a/src/components/icons/credit-card.tsx b/src/components/icons/credit-card.tsx new file mode 100644 index 00000000..86044eef --- /dev/null +++ b/src/components/icons/credit-card.tsx @@ -0,0 +1,14 @@ +import * as React from 'react' +import { SVGProps } from 'react' +const CreditCardIcon = (props: SVGProps) => ( + + + +) +export default CreditCardIcon diff --git a/src/components/icons/info.tsx b/src/components/icons/info.tsx new file mode 100644 index 00000000..59eb6edb --- /dev/null +++ b/src/components/icons/info.tsx @@ -0,0 +1,13 @@ +import * as React from 'react' +import { SVGProps } from 'react' +const InfoIcon = (props: SVGProps) => ( + + + +) +export default InfoIcon diff --git a/src/components/pricing/sections/cost-calculator/cost-calculator.module.scss b/src/components/pricing/sections/cost-calculator/cost-calculator.module.scss new file mode 100644 index 00000000..8d34be0b --- /dev/null +++ b/src/components/pricing/sections/cost-calculator/cost-calculator.module.scss @@ -0,0 +1,66 @@ +.tooltip-content { + animation-duration: 200ms; + animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1); + will-change: transform, opacity; + + &[data-state='delayed-open'][data-side='top'] { + animation-name: slideDownAndFade; + } + &[data-state='delayed-open'][data-side='right'] { + animation-name: slideLeftAndFade; + } + &[data-state='delayed-open'][data-side='bottom'] { + animation-name: slideUpAndFade; + } + &[data-state='delayed-open'][data-side='left'] { + animation-name: slideRightAndFade; + } +} + +.cypress-card-gr { + background: linear-gradient(148deg, #fff 2.94%, rgba(229, 231, 235, 0.86) 177.85%); +} + +@keyframes slideUpAndFade { + from { + opacity: 0; + transform: translateY(2px); + } + to { + opacity: 1; + transform: translateY(0); + } +} + +@keyframes slideRightAndFade { + from { + opacity: 0; + transform: translateX(-2px); + } + to { + opacity: 1; + transform: translateX(0); + } +} + +@keyframes slideDownAndFade { + from { + opacity: 0; + transform: translateY(-2px); + } + to { + opacity: 1; + transform: translateY(0); + } +} + +@keyframes slideLeftAndFade { + from { + opacity: 0; + transform: translateX(2px); + } + to { + opacity: 1; + transform: translateX(0); + } +} diff --git a/src/components/pricing/sections/cost-calculator/index.tsx b/src/components/pricing/sections/cost-calculator/index.tsx new file mode 100644 index 00000000..675d5895 --- /dev/null +++ b/src/components/pricing/sections/cost-calculator/index.tsx @@ -0,0 +1,288 @@ +'use client' +import React, { useState } from 'react' +import InfoIcon from '~/components/icons/info' +import * as Tooltip from '@radix-ui/react-tooltip' +import clsx from 'clsx' +import s from './cost-calculator.module.scss' +import CreditCardIcon from '~/components/icons/credit-card' +import { Button } from '~/components/Button' + +export const Calculator = () => { + const [mobileSwitch, setMobileSwitch] = useState(false) + + return ( +
+
+
+

Cost Model

+

+ See hoy Replay compares to other tools. +

+

+ Your dashboard should not be more expensive than your CI infrastructure +

+
+
+

+ Test results add up quickly +

+

+ The typical team generates millions of test results per month because each time a PR is + updated, the tests run, and each test spec has multiple test cases, and failures are + retried multiple times. +

+

+ View the cost model +

+
+ +
+ {inputs.map((input) => ( + + ))} +
+ + +
+
+ + +
+
+
+ +
+
+
+ ) +} + +type CalculatorInput = { + id: string + title: string + description: string + value: number + min: number + max: number + symbol?: string +} + +const inputs: CalculatorInput[] = [ + { + title: 'Test specs', + id: 'specs', + description: 'The number of test specs you have in your suite', + value: 10, + min: 1, + max: 100 + }, + { + title: 'Developers', + id: 'developers', + description: 'The number of test specs you have in your suite', + value: 10, + min: 1, + max: 100 + }, + { + title: 'Retry limit', + id: 'retry', + description: 'The number of test specs you have in your suite', + value: 10, + min: 1, + max: 100 + }, + { + title: 'Flake rate', + id: 'flake-rate', + description: 'The number of test specs you have in your suite', + value: 10, + min: 1, + max: 100, + symbol: '%' + }, + { + title: 'Failure rate', + id: 'failure-rate', + description: 'The number of test specs you have in your suite', + value: 10, + min: 1, + max: 100, + symbol: '%' + } +] + +export const Input = ({ input }: { input: CalculatorInput }) => { + return ( +
+
+ + + + +
+ +
+
+ + +

{input.title}

+

{input.description}

+ +
+
+
+
+
+
+ + {input.symbol && ( + + {input.symbol} + + )} +
+
+ ) +} + +export const Panel = ({ + theme = 'primary', + title, + description, + fields, + monthlyCost, + savedCost +}: { + theme?: 'primary' | 'secondary' + title: string + description: string + fields: { + title: string + value: string + }[] + monthlyCost: number + savedCost?: number +}) => { + return ( +
+
+
+

+ {title} +

+

{description}

+
+
+ {fields.map((field) => ( +
+
+ + + +

{field.title}

+
+

{field.value}

+
+ ))} +
+
+

+ Monthly Cost +

+

+ ${monthlyCost} +

+ {savedCost &&

Save ${savedCost}

} +
+
+
+ ) +} diff --git a/src/lib/feature-flags.ts b/src/lib/feature-flags.ts index 229f2769..fee73161 100644 --- a/src/lib/feature-flags.ts +++ b/src/lib/feature-flags.ts @@ -1,4 +1,4 @@ export const featureFlags = { - showCalculator: false, + showCalculator: true, showTestSuiteTestimonials: true }