Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 30 additions & 5 deletions jsx-version.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,18 @@

// Same card UI, written as a JSX component (HTML-like syntax inside JavaScript)
// This component is reusable - we can create multiple cards by passing different data
function PricingCard({ title, price, includesText, features, buttonText, buttonVariant }) {
function PricingCard({ title, price, pricePeriod, includesText, features, buttonText, buttonVariant }) {
return (
// JSX uses "className" instead of "class" because "class" is a reserved word in JavaScript
<div className="card">
{/* Curly braces { } let you insert JavaScript expressions into JSX */}
<h1 className="card-title">{title}</h1>
<p className="card-price">{price}</p>
<p className="card-price">
<span className="card-price-amount">{price}</span>
{pricePeriod != null && (
<span className="card-price-period">{pricePeriod}</span>
)}
</p>
<div className="card-content">
<p className="includes-text">{includesText}</p>
<ul className="features-list">
Expand All @@ -56,22 +61,41 @@ <h1 className="card-title">{title}</h1>
const hobbyPlan = {
title: 'Hobby',
price: 'Free',
pricePeriod: null,
includesText: 'Includes:',
features: ['No credit card required', 'Limited Agent requests', 'Limited Tab completions'],
features: [
'No credit card required',
'Limited Agent requests',
'Limited Tab completions',
'Agent Awesomeness',
],
buttonText: 'Download',
buttonVariant: 'secondary',
};
const proPlan = {
title: 'Pro',
price: '$20/mo.',
price: '$20',
pricePeriod: '/mo.',
includesText: 'Everything in Hobby, plus:',
features: [
'Extended limits on Agent',
'Unlimited Tab completions',
'Background Agents',
'Maximum context windows',
],
buttonText: 'Get Pro',
buttonVariant: 'secondary',
};

const enterprisePlan = {
title: 'Enterprise',
price: 'Let\'s talk',
pricePeriod: null,
includesText: 'Everything in Pro, plus:',
features: [
'Custom usage limits and controls',
'Priority support and onboarding',
],
buttonText: 'Contact sales',
buttonVariant: 'primary',
};

Expand All @@ -84,6 +108,7 @@ <h1 className="card-title">{title}</h1>
{/* This is the same as writing: title="Hobby" price="Free" includesText="Includes:" etc. */}
<PricingCard {...hobbyPlan} />
<PricingCard {...proPlan} />
<PricingCard {...enterprisePlan} />
</div>
</>
);
Expand Down
18 changes: 18 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,24 @@ body {
background-color: #333;
}

.download-button.tertiary {
background-color: transparent;
color: #333;
border: 1px solid #a1a19d;
}

.download-button.tertiary:hover {
background-color: #e6e5e0;
color: #333;
border: 1px solid #a1a19d;
}

.download-button.tertiary:active {
background-color: #a1a19d;
color: #333;
border: 1px solid #a1a19d;
}

/* Fixed pill label that sits at the top center of the viewport */
.page-label {
position: fixed;
Expand Down