Skip to content

Commit 24bdc89

Browse files
weltekialexellis
authored andcommitted
Update checkout links
Update the checkout links and add a modal the select a checkout quantity for the business tier. Add a link on the business checkout to update your subscription quantity. Signed-off-by: Han Verstraete (OpenFaaS Ltd) <[email protected]>
1 parent d9bbd91 commit 24bdc89

File tree

4 files changed

+156
-17
lines changed

4 files changed

+156
-17
lines changed

Diff for: _includes/pricing/checkout-modal.html

+138
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
<div
2+
id="modal"
3+
class="relative z-10 hidden"
4+
aria-labelledby="modal-title"
5+
role="dialog"
6+
aria-modal="true"
7+
>
8+
<div
9+
id="modal-backdrop"
10+
class="fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity opacity-100 hidden"
11+
aria-hidden="true"
12+
></div>
13+
14+
<div class="fixed inset-0 z-10 w-screen overflow-y-auto">
15+
<div
16+
class="flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0"
17+
>
18+
<div
19+
id="modal-panel"
20+
class="relative transform overflow-hidden rounded-lg bg-white px-4 pb-4 pt-5 text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-sm sm:p-6 opacity-100 translate-y-4 sm:translate-y-0 sm:scale-95"
21+
>
22+
<div class="absolute top-0 right-0 pt-4 pr-4 sm:block">
23+
<button
24+
id="close-modal-button"
25+
type="button"
26+
class="rounded-md bg-white text-gray-400 hover:text-gray-500 focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 focus:outline-hidden"
27+
>
28+
<span class="sr-only">Close</span>
29+
<svg
30+
class="h-6 w-6"
31+
fill="none"
32+
viewBox="0 0 24 24"
33+
stroke-width="1.5"
34+
stroke="currentColor"
35+
aria-hidden="true"
36+
data-slot="icon"
37+
>
38+
<path
39+
stroke-linecap="round"
40+
stroke-linejoin="round"
41+
d="M6 18 18 6M6 6l12 12"
42+
/>
43+
</svg>
44+
</button>
45+
</div>
46+
<div>
47+
<h3 class="text-lg font-semibold text-gray-900" id="modal-title">
48+
Inlets tunnel (commercial use)
49+
</h3>
50+
<div class="mt-2">
51+
<p class="text-sm text-gray-500">
52+
Deploy inlets tunnels for commercial and/or business use.
53+
</p>
54+
</div>
55+
</div>
56+
<form id="checkout-form" class="mt-3 space-y-4">
57+
<div class="flex items-center">
58+
<label for="quantity" class="text-sm font-medium text-gray-700"
59+
>Quantity</label
60+
>
61+
<input
62+
id="quantity"
63+
name="quantity"
64+
type="number"
65+
value="1"
66+
min="1"
67+
class="mt-1 ml-3 px-1 w-16 block border-gray-300 shadow-sm focus:border-indigo-500 focus:ring focus:ring-indigo-200 focus:ring-opacity-50"
68+
/>
69+
</div>
70+
71+
<div class="flex flex-col sm:flex-row">
72+
<a
73+
type="button"
74+
class="inline-flex items-center justify-center w-full rounded-md px-3 py-2 inline-flex text-sm font-semibold bg-white text-gray-900 ring-1 shadow-xs ring-gray-300 ring-inset hover:bg-gray-50"
75+
href="https://subscribe.openfaas.com/billing"
76+
>
77+
Update subscription
78+
</a>
79+
<button
80+
type="submit"
81+
class="w-full rounded-md mt-3 sm:mt-0 sm:ml-3 px-3 py-2 text-sm font-semibold text-white bg-indigo-600 shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"
82+
>
83+
Checkout
84+
</button>
85+
</div>
86+
</form>
87+
</div>
88+
</div>
89+
</div>
90+
</div>
91+
92+
<script>
93+
// Function to show the modal
94+
function showModal() {
95+
const modal = document.getElementById("modal");
96+
const backdrop = document.getElementById("modal-backdrop");
97+
98+
// Add classes for showing the modal
99+
modal.classList.remove("hidden");
100+
backdrop.classList.remove("hidden");
101+
}
102+
103+
function hideModal() {
104+
const modal = document.getElementById("modal");
105+
const backdrop = document.getElementById("modal-backdrop");
106+
107+
// Add classes for hiding the modal
108+
modal.classList.add("hidden");
109+
backdrop.classList.add("hidden");
110+
}
111+
112+
function handleSubmit(event) {
113+
event.preventDefault();
114+
115+
const form = event.target;
116+
const formData = new FormData(form);
117+
118+
const quantity = formData.get("quantity");
119+
const checkoutURL = `https://subscribe.openfaas.com/buy/ee8d2048-884f-4a9a-9186-048e8810a8f7?quantity=${quantity}`;
120+
121+
window.location.href = checkoutURL;
122+
}
123+
124+
// Attach event listeners
125+
const checkoutButtons = document.querySelectorAll(".checkout-button");
126+
127+
checkoutButtons.forEach((button) => {
128+
button.addEventListener("click", showModal);
129+
});
130+
131+
document
132+
.getElementById("close-modal-button")
133+
.addEventListener("click", hideModal);
134+
135+
document
136+
.getElementById("checkout-form")
137+
.addEventListener("submit", handleSubmit);
138+
</script>

Diff for: _includes/pricing/pricing-grid.html

+16-17
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<!-- This example requires Tailwind CSS v2.0+ -->
22

33
<div class="bg-white">
4-
54
<div class="max-w-7xl mx-auto bg-white sm:px-6 lg:px-8">
65
<!-- xs to lg -->
76
<div class="max-w-2xl mx-auto lg:hidden">
@@ -12,7 +11,7 @@ <h2 class="text-lg leading-6 font-medium text-gray-900">Personal</h2>
1211
<span class="text-base font-medium text-gray-500">/mo</span>
1312
</p>
1413
<p class="mt-4 text-sm text-gray-500">This license is just for you. Use it at home or at work.</p>
15-
<a href="https://openfaas.gumroad.com/l/inlets-subscription" class="mt-6 block border border-gray-800 rounded-md bg-gray-800 w-full py-2 text-sm font-semibold text-white text-center hover:bg-gray-900">Buy Personal</a>
14+
<a href="https://subscribe.openfaas.com/buy/fc4e1389-23f1-4f27-98c8-0c03068f0060?enabled=44473" class="mt-6 block border border-gray-800 rounded-md bg-gray-800 w-full py-2 text-sm font-semibold text-white text-center hover:bg-gray-900">Buy Personal</a>
1615
</div>
1716

1817
<table class="mt-8 w-full">
@@ -179,17 +178,17 @@ <h2 class="text-lg leading-6 font-medium text-gray-900">Personal</h2>
179178
</table>
180179

181180
<div class="border-t border-gray-200 px-4 pt-5">
182-
<a href="https://openfaas.gumroad.com/l/inlets-subscription" class="block w-full bg-gray-800 border border-gray-800 rounded-md py-2 text-sm font-semibold text-white text-center hover:bg-gray-900">Buy Personal</a>
181+
<a href="https://subscribe.openfaas.com/buy/fc4e1389-23f1-4f27-98c8-0c03068f0060" class="block w-full bg-gray-800 border border-gray-800 rounded-md py-2 text-sm font-semibold text-white text-center hover:bg-gray-900">Buy Personal</a>
183182
</div>
184183

185184
<div class="px-4 mt-16">
186185
<h2 class="text-lg leading-6 font-medium text-gray-900">Business</h2>
187186
<p class="mt-4">
188-
<span class="text-4xl font-extrabold text-gray-900">$50.00</span>
187+
<span class="text-4xl font-extrabold text-gray-900">$25.00</span>
189188
<span class="text-base font-medium text-gray-500">/mo</span>
190189
</p>
191190
<p class="mt-4 text-sm text-gray-500">Expose &amp; connect services for your business, with email support.</p>
192-
<a href="https://openfaas.gumroad.com/l/inlets-subscription" class="mt-6 block border border-gray-800 rounded-md bg-gray-800 w-full py-2 text-sm font-semibold text-white text-center hover:bg-gray-900">Buy Business</a>
191+
<button class="checkout-button mt-6 block border border-gray-800 rounded-md bg-gray-800 w-full py-2 text-sm font-semibold text-white text-center hover:bg-gray-900">Buy Business</a>
193192
</div>
194193

195194
<table class="mt-8 w-full">
@@ -214,7 +213,7 @@ <h2 class="text-lg leading-6 font-medium text-gray-900">Business</h2>
214213
<tr class="border-t border-gray-200">
215214
<th class="py-5 px-4 text-sm font-normal text-gray-500 text-left" scope="row">Cost per tunnel.</th>
216215
<td class="py-5 pr-4">
217-
<span class="block text-sm text-gray-700 text-right">50 USD / mo</span>
216+
<span class="block text-sm text-gray-700 text-right">25 USD / mo</span>
218217
</td>
219218
</tr>
220219

@@ -355,7 +354,7 @@ <h2 class="text-lg leading-6 font-medium text-gray-900">Business</h2>
355354
</table>
356355

357356
<div class="border-t border-gray-200 px-4 pt-5">
358-
<a href="https://openfaas.gumroad.com/l/inlets-subscription" class="block w-full bg-gray-800 border border-gray-800 rounded-md py-2 text-sm font-semibold text-white text-center hover:bg-gray-900">Buy Business</a>
357+
<button class="checkout-button block w-full bg-gray-800 border border-gray-800 rounded-md py-2 text-sm font-semibold text-white text-center hover:bg-gray-900">Buy Business</a>
359358
</div>
360359

361360
<div class="px-4 mt-16">
@@ -365,7 +364,7 @@ <h2 class="text-lg leading-6 font-medium text-gray-900">Uplink for SaaS</h2>
365364
<span class="text-base font-medium text-gray-500">/mo</span>
366365
</p>
367366
<p class="mt-4 text-sm text-gray-500">Tunnel customer services to your SaaS.</p>
368-
<a href="https://subscribe.openfaas.com" class="mt-6 block border border-gray-800 rounded-md bg-gray-800 w-full py-2 text-sm font-semibold text-white text-center hover:bg-gray-900">Buy Uplink</a>
367+
<a href="https://subscribe.openfaas.com/buy/a1087de1-3eb6-4bbc-8a3b-2f0955ec3ce1" class="mt-6 block border border-gray-800 rounded-md bg-gray-800 w-full py-2 text-sm font-semibold text-white text-center hover:bg-gray-900">Buy Uplink</a>
369368
</div>
370369

371370
<table class="mt-8 w-full">
@@ -537,7 +536,7 @@ <h2 class="text-lg leading-6 font-medium text-gray-900">Uplink for SaaS</h2>
537536
</table>
538537

539538
<div class="border-t border-gray-200 px-4 pt-5">
540-
<a href="https://subscribe.openfaas.com" class="block w-full bg-gray-800 border border-gray-800 rounded-md py-2 text-sm font-semibold text-white text-center hover:bg-gray-900">Buy Uplink</a>
539+
<a href="https://subscribe.openfaas.com/buy/a1087de1-3eb6-4bbc-8a3b-2f0955ec3ce1" class="block w-full bg-gray-800 border border-gray-800 rounded-md py-2 text-sm font-semibold text-white text-center hover:bg-gray-900">Buy Uplink</a>
541540
</div>
542541
</div>
543542

@@ -575,18 +574,18 @@ <h2 class="text-lg leading-6 font-medium text-gray-900">Uplink for SaaS</h2>
575574
<span class="text-base font-medium text-gray-500">/mo</span>
576575
</p>
577576
<p class="mt-4 mb-16 text-sm text-gray-500">This license is just for you. Use it at home or at work.</p>
578-
<a href="https://openfaas.gumroad.com/l/inlets-subscription" class="absolute bottom-0 flex-grow block w-full bg-gray-800 border border-gray-800 rounded-md 5 py-2 text-sm font-semibold text-white text-center hover:bg-gray-900">Buy Personal</a>
577+
<a href="https://subscribe.openfaas.com/buy/fc4e1389-23f1-4f27-98c8-0c03068f0060" class="absolute bottom-0 flex-grow block w-full bg-gray-800 border border-gray-800 rounded-md 5 py-2 text-sm font-semibold text-white text-center hover:bg-gray-900">Buy Personal</a>
579578
</div>
580579
</td>
581580

582581
<td class="h-full py-8 px-6 align-top">
583582
<div class="relative h-full table">
584583
<p>
585-
<span class="text-4xl font-extrabold text-gray-900">$50.00</span>
584+
<span class="text-4xl font-extrabold text-gray-900">$25</span>
586585
<span class="text-base font-medium text-gray-500">/mo</span>
587586
</p>
588587
<p class="mt-4 mb-16 text-sm text-gray-500">Connect services for your business, with email support.</p>
589-
<a href="https://openfaas.gumroad.com/l/inlets-subscription" class="absolute bottom-0 flex-grow block w-full bg-gray-800 border border-gray-800 rounded-md 5 py-2 text-sm font-semibold text-white text-center hover:bg-gray-900">Buy Business</a>
588+
<button class="checkout-button absolute bottom-0 flex-grow block w-full bg-gray-800 border border-gray-800 rounded-md 5 py-2 text-sm font-semibold text-white text-center hover:bg-gray-900">Buy Business</button>
590589
</div>
591590
</td>
592591

@@ -597,7 +596,7 @@ <h2 class="text-lg leading-6 font-medium text-gray-900">Uplink for SaaS</h2>
597596
<span class="text-base font-medium text-gray-500">/mo</span>
598597
</p>
599598
<p class="mt-4 mb-16 text-sm text-gray-500">Host tunnels for your customers to integrate with their private services.</p>
600-
<a href="https://subscribe.openfaas.com" class="absolute bottom-0 flex-grow block w-full bg-gray-800 border border-gray-800 rounded-md 5 py-2 text-sm font-semibold text-white text-center hover:bg-gray-900">Buy Uplink</a>
599+
<a href="https://subscribe.openfaas.com/buy/a1087de1-3eb6-4bbc-8a3b-2f0955ec3ce1" class="absolute bottom-0 flex-grow block w-full bg-gray-800 border border-gray-800 rounded-md 5 py-2 text-sm font-semibold text-white text-center hover:bg-gray-900">Buy Uplink</a>
601600
</div>
602601
</td>
603602
</tr>
@@ -624,7 +623,7 @@ <h2 class="text-lg leading-6 font-medium text-gray-900">Uplink for SaaS</h2>
624623
<span class="block text-sm text-gray-700">5 USD / mo</span>
625624
</td>
626625
<td class="py-5 px-6">
627-
<span class="block text-sm text-gray-700">50 USD / mo</span>
626+
<span class="block text-sm text-gray-700">25 USD / mo</span>
628627
</td>
629628
<td class="py-5 px-6">
630629
<span class="block text-sm text-gray-700">25 USD / mo</span>
@@ -944,15 +943,15 @@ <h2 class="text-lg leading-6 font-medium text-gray-900">Uplink for SaaS</h2>
944943
<th class="sr-only" scope="row">Choose your plan</th>
945944

946945
<td class="pt-5 px-6">
947-
<a href="https://openfaas.gumroad.com/l/inlets-subscription" class="block w-full bg-gray-800 border border-gray-800 rounded-md py-2 text-sm font-semibold text-white text-center hover:bg-gray-900">Buy Personal</a>
946+
<a href="https://subscribe.openfaas.com/buy/fc4e1389-23f1-4f27-98c8-0c03068f0060" class="block w-full bg-gray-800 border border-gray-800 rounded-md py-2 text-sm font-semibold text-white text-center hover:bg-gray-900">Buy Personal</a>
948947
</td>
949948

950949
<td class="pt-5 px-6">
951-
<a href="https://openfaas.gumroad.com/l/inlets-subscription" class="block w-full bg-gray-800 border border-gray-800 rounded-md py-2 text-sm font-semibold text-white text-center hover:bg-gray-900">Buy Business</a>
950+
<button class="checkout-button block w-full bg-gray-800 border border-gray-800 rounded-md py-2 text-sm font-semibold text-white text-center hover:bg-gray-900">Buy Business</button>
952951
</td>
953952

954953
<td class="pt-5 px-6">
955-
<a href="https://subscribe.openfaas.com" class="block w-full bg-gray-800 border border-gray-800 rounded-md py-2 text-sm font-semibold text-white text-center hover:bg-gray-900">Buy Uplink</a>
954+
<a href="https://subscribe.openfaas.com/buy/a1087de1-3eb6-4bbc-8a3b-2f0955ec3ce1" class="block w-full bg-gray-800 border border-gray-800 rounded-md py-2 text-sm font-semibold text-white text-center hover:bg-gray-900">Buy Uplink</a>
956955
</td>
957956
</tr>
958957
</tfoot>

Diff for: pricing/index.html

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
{% include pricing/pricing-calc.html %}
1414

1515
{% include pricing/pricing-personal.html %}
16+
{% include pricing/checkout-modal.html %}
1617
<!-- <div style="padding-bottom: 20px;"></div> -->
1718

1819
<!-- {% include start.html %} -->

Diff for: tailwind.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ module.exports = {
4242
variants: {},
4343
plugins: [
4444
require('@tailwindcss/ui'),
45+
require('@tailwindcss/forms'),
4546
require("postcss-import"),
4647
require("autoprefixer"),
4748
require("@tailwindcss/typography"),

0 commit comments

Comments
 (0)