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
9 changes: 9 additions & 0 deletions config/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@
'key' => env('ANYSTACK_API_KEY'),
],

'kit' => [
/*
* The Bifrost waitlist form on Kit. The waitlist modal posts here with fetch and
* reads Kit's JSON reply; the hosted page is the fallback if that request fails.
*/
'waitlist_subscribe_url' => env('KIT_WAITLIST_SUBSCRIBE_URL', 'https://app.kit.com/forms/10242151/subscriptions'),
'waitlist_hosted_url' => env('KIT_WAITLIST_HOSTED_URL', 'https://bifrost-technologies.kit.com/03a1490f56'),
],

'mailcoach' => [
/*
* The public subscribe endpoint for the NativePHP newsletter list. Forms post
Expand Down
40 changes: 40 additions & 0 deletions resources/views/components/bifrost-waitlist-banner.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<button
type="button"
x-on:click="
$dispatch('open-bifrost-waitlist-modal')
window.fathom?.trackEvent('bifrost_waitlist_banner_click')
"
data-site-banner
class="group relative z-30 flex w-full flex-col flex-wrap items-center justify-center gap-x-3 gap-y-2.5 overflow-hidden bg-gradient-to-r from-sky-50 via-indigo-50 to-violet-100 px-5 py-3 select-none 3xs:flex-row dark:from-sky-950/50 dark:via-indigo-950/50 dark:to-violet-950/50"
>
{{-- Label --}}
<div
class="flex items-center justify-center gap-3 transition duration-200 ease-in-out will-change-transform group-hover:-translate-x-0.5"
>
{{-- Icon --}}
<x-icons.rocket
class="size-5 shrink-0 text-indigo-600 dark:text-indigo-300"
aria-hidden="true"
/>

{{-- Text --}}
<div class="tracking-tight text-pretty sm:text-center">
<b>Ship your PHP app to the App Store without the usual pain.</b>
<span class="text-gray-600 dark:text-gray-300">Free guides from the Bifrost team.</span>
</div>
</div>

{{-- Call to action --}}
<span
class="shrink-0 rounded-md bg-white/70 px-2 py-0.5 text-sm font-semibold text-indigo-900 ring-1 ring-indigo-200 dark:bg-white/10 dark:text-indigo-100 dark:ring-white/10"
>
Get the free guides
</span>

{{-- Arrow --}}
<div
class="transition duration-200 ease-in-out will-change-transform group-hover:translate-x-0.5"
>
<x-icons.right-arrow class="size-3 shrink-0" />
</div>
</button>
210 changes: 210 additions & 0 deletions resources/views/components/bifrost-waitlist-modal.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
@props(['user' => null])

{{--
Bifrost waitlist modal. Opened from anywhere on the site by dispatching an
`open-bifrost-waitlist-modal` window event, and on load when the URL has
`?waitlist`. The form posts to Kit with fetch and shows Kit's reply in place,
so people never leave the page. If the request itself fails, it points to
the hosted Kit form instead. Pass a signed-in `user` to prefill their first
name and email, so signing up is one click.
--}}
<div
x-data="{
open: false,
status: 'idle',
error: '',
show() {
this.open = true
this.$nextTick(() => (this.$refs.email.value ? this.$refs.submit : this.$refs.name)?.focus())
},
async submit() {
this.status = 'sending'
this.error = ''
window.fathom?.trackEvent('bifrost_waitlist_modal_submit')

try {
const response = await fetch(this.$refs.form.action, {
method: 'POST',
body: new FormData(this.$refs.form),
headers: { Accept: 'application/json' },
})
const reply = await response.json()

if (reply.status === 'success') {
this.status = 'done'
window.fathom?.trackEvent('bifrost_waitlist_signup')

return
}

this.error = reply.errors?.messages?.join(' ') || 'Something went wrong. Please try again.'
this.status = 'error'
} catch (e) {
this.error = 'We couldn\'t reach our email provider.'
this.status = 'failed'
}
},
}"
@if (request()->has('waitlist'))
x-init="show()"
@endif
@open-bifrost-waitlist-modal.window="show()"
@keydown.escape.window="open = false"
>
{{-- Backdrop --}}
<div
x-show="open"
x-transition:enter="transition duration-300 ease-out"
x-transition:enter-start="opacity-0"
x-transition:enter-end="opacity-100"
x-transition:leave="transition duration-200 ease-in"
x-transition:leave-start="opacity-100"
x-transition:leave-end="opacity-0"
class="fixed inset-0 z-50 bg-black/50 backdrop-blur-xs"
x-cloak
></div>

<div
x-show="open"
x-transition:enter="transition duration-300 ease-out"
x-transition:enter-start="scale-95 opacity-0"
x-transition:enter-end="scale-100 opacity-100"
x-transition:leave="transition duration-200 ease-in"
x-transition:leave-start="scale-100 opacity-100"
x-transition:leave-end="scale-95 opacity-0"
class="fixed inset-0 z-50 flex items-center justify-center p-4"
role="dialog"
aria-modal="true"
aria-labelledby="bifrost-waitlist-modal-heading"
x-cloak
>
<div
@click.away="open = false"
class="relative w-full max-w-md overflow-hidden rounded-2xl bg-white p-8 shadow-xl ring-1 ring-black/5 dark:bg-mirage dark:ring-white/10"
>
{{-- Decorative glow --}}
<div
class="pointer-events-none absolute -top-24 left-1/2 size-48 -translate-x-1/2 rounded-full bg-gradient-to-r from-sky-400/40 via-indigo-500/40 to-violet-500/40 blur-3xl"
aria-hidden="true"
></div>

{{-- Close --}}
<button
type="button"
@click="open = false"
class="absolute top-4 right-4 rounded-lg p-2 text-gray-400 transition duration-200 hover:bg-gray-100 hover:text-gray-600 dark:hover:bg-white/5 dark:hover:text-gray-200"
>
<x-icons.xmark class="size-3" />
<span class="sr-only">Close</span>
</button>

{{-- Signup --}}
<div x-show="status !== 'done'">
<div class="relative text-center">
<x-icons.rocket
class="mx-auto size-8 text-indigo-600 dark:text-indigo-300"
aria-hidden="true"
/>

<h2
id="bifrost-waitlist-modal-heading"
class="mt-4 text-xl font-semibold text-balance"
>
Ship your PHP app to the App Store
</h2>

<p class="mt-2 text-sm text-gray-500 dark:text-gray-400">
Free, practical guides from the Bifrost team on native
builds, signing and getting through store review.
</p>
</div>

<form
x-ref="form"
method="post"
action="{{ config('services.kit.waitlist_subscribe_url') }}"
@submit.prevent="submit()"
class="relative mt-6 flex flex-col gap-3"
>
<label for="bifrost-waitlist-name" class="sr-only">First name</label>
<input
x-ref="name"
type="text"
id="bifrost-waitlist-name"
name="fields[first_name]"
placeholder="First name"
autocomplete="given-name"
value="{{ $user?->first_name }}"
class="w-full rounded-xl border border-gray-300 bg-white px-4 py-3 text-sm text-gray-900 placeholder-gray-400 focus:border-indigo-500 focus:ring-indigo-500 dark:border-gray-700 dark:bg-gray-800 dark:text-white dark:placeholder-gray-500"
/>

<label for="bifrost-waitlist-email" class="sr-only">Email address</label>
<input
x-ref="email"
type="email"
id="bifrost-waitlist-email"
name="email_address"
placeholder="you@example.com"
autocomplete="email"
value="{{ $user?->email }}"
required
class="w-full rounded-xl border border-gray-300 bg-white px-4 py-3 text-sm text-gray-900 placeholder-gray-400 focus:border-indigo-500 focus:ring-indigo-500 dark:border-gray-700 dark:bg-gray-800 dark:text-white dark:placeholder-gray-500"
/>

<p
x-show="status === 'error' || status === 'failed'"
x-cloak
role="alert"
class="text-sm text-red-600 dark:text-red-400"
>
<span x-text="error"></span>
<a
x-show="status === 'failed'"
href="{{ config('services.kit.waitlist_hosted_url') }}"
target="_blank"
rel="noopener"
class="underline"
>Sign up here instead.</a>
</p>

<button
x-ref="submit"
type="submit"
:disabled="status === 'sending'"
class="rounded-xl bg-gray-900 px-6 py-3 text-sm font-semibold text-white transition duration-200 hover:bg-gray-800 disabled:opacity-60 dark:bg-white dark:text-gray-900 dark:hover:bg-gray-100"
>
<span x-show="status !== 'sending'">Get the free guides</span>
<span x-show="status === 'sending'" x-cloak>Signing you up…</span>
</button>

<p class="text-center text-xs text-gray-400 dark:text-gray-500">
We'll send a confirmation email first. Unsubscribe any time.
</p>
</form>
</div>

{{-- Done --}}
<div x-show="status === 'done'" x-cloak class="relative text-center">
<x-icons.checkmark
class="mx-auto size-8 text-emerald-600 dark:text-emerald-400"
aria-hidden="true"
/>

<h2 class="mt-4 text-xl font-semibold">Check your inbox</h2>

<p class="mt-2 text-sm text-gray-500 dark:text-gray-400">
We've sent you a confirmation email. Click the link in it and
the first guide is on its way.
</p>

<button
type="button"
@click="open = false"
class="mt-6 rounded-xl bg-gray-900 px-6 py-3 text-sm font-semibold text-white transition duration-200 hover:bg-gray-800 dark:bg-white dark:text-gray-900 dark:hover:bg-gray-100"
>
Done
</button>
</div>
</div>
</div>
</div>
3 changes: 2 additions & 1 deletion resources/views/components/layout.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class="min-h-screen overflow-x-clip bg-white font-poppins antialiased selection:
@if (now()->isBefore('2026-12-01T08:00:00Z'))
<x-black-friday-banner />
@elseif (now()->isBefore('2027-01-01T00:00:00Z'))
<x-bifrost-birthday-banner />
<x-bifrost-waitlist-banner />
@else
<x-newsletter-banner />
@endif
Expand All @@ -140,6 +140,7 @@ class="mx-auto w-full max-w-5xl px-5 lg:px-3 xl:max-w-7xl 2xl:max-w-360"
<x-footer />

<x-newsletter-modal />
<x-bifrost-waitlist-modal :user="auth()->user()" />

<x-impersonate::banner />

Expand Down
2 changes: 2 additions & 0 deletions resources/views/components/layouts/dashboard.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,8 @@ class="min-h-screen bg-white font-poppins antialiased dark:bg-zinc-900 dark:text

<flux:toast />

<x-bifrost-waitlist-modal :user="auth()->user()" />

<x-impersonate::banner/>

@livewireScriptConfig
Expand Down
44 changes: 44 additions & 0 deletions resources/views/livewire/customer/dashboard.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,50 @@ class="w-full shrink-0 rounded-xl bg-white/70 p-4 ring-1 ring-violet-200 sm:w-au
</div>
@endif

{{-- Bifrost Waitlist Banner --}}
@unless(now()->isBefore('2026-12-01T08:00:00Z'))
<div
x-data="{ visible: $persist(true).as('bifrost-waitlist-dashboard-visible') }"
x-show="visible"
x-cloak
class="relative mb-6 rounded-lg border border-indigo-200 bg-gradient-to-r from-sky-50 via-indigo-50 to-violet-100 p-6 dark:border-indigo-700/50 dark:from-sky-950/40 dark:via-indigo-950/40 dark:to-violet-950/40"
>
<button
type="button"
x-on:click="visible = false"
class="absolute top-3 right-3 rounded-lg p-2 text-indigo-400 transition hover:bg-white/60 hover:text-indigo-600 dark:hover:bg-white/5 dark:hover:text-indigo-200"
>
<x-icons.xmark class="size-3" />
<span class="sr-only">Dismiss</span>
</button>
<div class="flex items-start">
<div class="shrink-0 text-indigo-600 dark:text-indigo-300">
<x-icons.rocket class="size-6" />
</div>
<div class="ml-4 flex-1 pr-6">
<h3 class="font-medium text-zinc-900 dark:text-zinc-100">
Ship your PHP app to the App Store without the usual pain
</h3>
<p class="mt-1 text-sm text-zinc-600 dark:text-zinc-400">
Free, practical guides from the Bifrost team on native builds, signing and getting through store review.
</p>
<div class="mt-4">
<button
type="button"
x-on:click="
$dispatch('open-bifrost-waitlist-modal')
window.fathom?.trackEvent('bifrost_waitlist_dashboard_click')
"
class="inline-flex items-center rounded-md border border-transparent bg-black px-4 py-2 text-sm font-medium text-white transition hover:bg-zinc-800 focus:outline-none focus:ring-2 focus:ring-zinc-500 focus:ring-offset-2 dark:bg-white dark:text-black dark:hover:bg-zinc-200"
>
Get the free guides
</button>
</div>
</div>
</div>
</div>
@endunless

{{-- Banners --}}
<div class="mb-6 grid grid-cols-1 gap-6 lg:grid-cols-2">
@feature(App\Features\ShowPlugins::class)
Expand Down
5 changes: 3 additions & 2 deletions tests/Feature/BifrostBirthdayBannerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@ public function the_banner_offers_the_birthday_discount_on_annual_bifrost_plans(
}

#[Test]
public function the_homepage_carries_the_birthday_banner_instead_of_the_newsletter_offer_during_the_sale(): void
public function the_homepage_carries_the_waitlist_banner_instead_of_the_birthday_or_newsletter_banner_in_december(): void
{
$this->travelTo(Carbon::parse('2026-12-31T23:59:59Z'));

$this->get('/')
->assertOk()
->assertSee('HAPPYBIRTHDAY')
->assertSee('bifrost_waitlist_banner_click', escape: false)
->assertDontSee('HAPPYBIRTHDAY')
->assertDontSee('newsletter_banner_click', escape: false);
}

Expand Down
Loading