Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
thejessewinton committed Jan 22, 2025
1 parent c4b0689 commit 53b5f4d
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 56 deletions.
3 changes: 2 additions & 1 deletion src/lib/experiments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ export const posthogServerClient = PUBLIC_POSTHOG_API_KEY
: null;

export const experiments = {
'sticky-navigation_ab-test': ['control', 'sticky-nav']
'sticky-navigation_ab-test': ['control', 'sticky-nav'],
'cta-copy_ab-test': ['control', 'start-for-free_variant', 'start-building_variant']
} as const;

type Key = keyof typeof experiments;
Expand Down
70 changes: 18 additions & 52 deletions src/lib/layouts/Main.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -97,54 +97,22 @@
return setupThemeObserver();
});
$: navLinks = $page.data.isStickyNav
? [
{
label: 'Products',
submenu: ProductsSubmenu,
mobileSubmenu: ProductsMobileSubmenu
},
{
label: 'Docs',
href: '/docs'
},
{
label: 'Pricing',
href: '/pricing'
}
]
: [
{
label: 'Products',
submenu: ProductsSubmenu,
mobileSubmenu: ProductsMobileSubmenu
},
{
label: 'Docs',
href: '/docs'
},
{
label: 'Community',
href: '/community'
},
{
label: 'Blog',
href: '/blog'
},
{
label: 'Integrations',
href: '/integrations'
},
{
label: 'Changelog',
href: '/changelog',
showBadge: hasNewChangelog?.() && !$page.url.pathname.includes('/changelog')
},
{
label: 'Pricing',
href: '/pricing'
}
];
$: navLinks = [
{
label: 'Products',
submenu: ProductsSubmenu,
mobileSubmenu: ProductsMobileSubmenu
},
{
label: 'Docs',
href: '/docs'
},
{ label: 'Blog', href: '/blog' },
{
label: 'Pricing',
href: '/pricing'
}
];
$: resolvedTheme = $isMobileNavOpen ? 'dark' : theme;
Expand Down Expand Up @@ -179,7 +147,6 @@
<section
class="web-mobile-header {resolvedTheme}"
class:is-transparent={browser && !$isMobileNavOpen}
class:is-hidden={$isHeaderHidden && !$page.data.isStickyNav}
>
<div class="web-mobile-header-start">
<a href="/">
Expand Down Expand Up @@ -220,11 +187,10 @@
</section>
<header
class="web-main-header is-special-padding {resolvedTheme} is-transparent"
class:is-hidden={$isHeaderHidden && !$page.data.isStickyNav}
class:is-special-padding={!BANNER_KEY.startsWith('init-banner-')}
style={BANNER_KEY === 'init-banner-02' ? 'padding-inline: 0' : ''}
>
{#if !$page.data.isStickyNav}
<!-- {#if !$page.data.isStickyNav}
{#if BANNER_KEY.startsWith('init-banner-')}
<InitBanner />
{:else}
Expand All @@ -236,7 +202,7 @@
</a>
</AnnouncementBanner>
{/if}
{/if}
{/if} -->

<div
class="web-main-header-wrapper"
Expand Down
20 changes: 17 additions & 3 deletions src/routes/+layout.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,29 @@ export const load = async ({ request, getClientAddress }) => {

const distinctId = generateDistinctId(fingerprintData);

const isStickyNav = await getFeatureFlag<'sticky-navigation_ab-test'>(
const isStartBuilding = await getFeatureFlag<'cta-copy_ab-test'>(
'sticky-navigation_ab-test',
'sticky-nav',
'start-building_variant',
distinctId
);

console.log(isStartBuilding);

const isStartForFree = await getFeatureFlag<'cta-copy_ab-test'>(
'sticky-navigation_ab-test',
'start-for-free_variant',
distinctId
);

const ctaCopy = isStartBuilding
? 'Start building'
: isStartForFree
? 'Start for free'
: 'Get started';

return {
ctaCopy,
distinctId,
isStickyNav,
changelogEntries: (await getAllChangelogEntries()).length
};
};

0 comments on commit 53b5f4d

Please sign in to comment.