Spaces:
Running
Running
Deploy pactsprig to the hub
Browse files- pactsprig/index.html +2 -2
- pactsprig/pro.js +25 -1
pactsprig/index.html
CHANGED
|
@@ -35,7 +35,7 @@
|
|
| 35 |
</head>
|
| 36 |
<body>
|
| 37 |
<header class="top"><div class="wrap top-in">
|
| 38 |
-
<a class="brand" href=".
|
| 39 |
<nav class="top-nav">
|
| 40 |
<button class="btn ghost sm" id="btn-install" type="button" hidden>Install app</button>
|
| 41 |
<a href="#cmx-pro" class="top-link">Pricing</a>
|
|
@@ -208,5 +208,5 @@
|
|
| 208 |
<script src="lib/pdf.js"></script>
|
| 209 |
<script src="lib/docx.js"></script>
|
| 210 |
<script src="app.js"></script>
|
| 211 |
-
<
|
| 212 |
</html>
|
|
|
|
| 35 |
</head>
|
| 36 |
<body>
|
| 37 |
<header class="top"><div class="wrap top-in">
|
| 38 |
+
<a class="brand" href="index.html" aria-label="Pactsprig home"><img src="icon.svg" alt="" width="30" height="30"><span><b>Pactsprig</b> <small>by CyberMax</small></span></a>
|
| 39 |
<nav class="top-nav">
|
| 40 |
<button class="btn ghost sm" id="btn-install" type="button" hidden>Install app</button>
|
| 41 |
<a href="#cmx-pro" class="top-link">Pricing</a>
|
|
|
|
| 208 |
<script src="lib/pdf.js"></script>
|
| 209 |
<script src="lib/docx.js"></script>
|
| 210 |
<script src="app.js"></script>
|
| 211 |
+
</body>
|
| 212 |
</html>
|
pactsprig/pro.js
CHANGED
|
@@ -58,6 +58,18 @@
|
|
| 58 |
function esc(s) { return String(s).replace(/[&<>"]/g, function (c) { return { "&": "&", "<": "<", ">": ">", '"': """ }[c]; }); }
|
| 59 |
function buyUrl(offer, from) { return DATA + "/buy/" + offer + "?s=app-" + C.id + (from ? "-" + from : ""); }
|
| 60 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
function box() {
|
| 62 |
var el = document.getElementById("cmx-pro");
|
| 63 |
if (!el) {
|
|
@@ -86,8 +98,14 @@
|
|
| 86 |
}).join("");
|
| 87 |
el.innerHTML = '<h2>' + esc(C.name) + ' Pro</h2>' + (C.free ? '<p class="cmx-pro-small">Free: ' + esc(C.free) + "</p>" : "") +
|
| 88 |
"<ul>" + C.perks.map(function (p) { return "<li>" + esc(p) + "</li>"; }).join("") + '</ul><div class="cmx-plans">' + plans +
|
| 89 |
-
'</div><p class="cmx-pro-small">Secure Stripe checkout. Pro turns on the moment you pay; no account needed.' + (subs ? " Subscriptions cancel any time." : " One payment, no subscription.") +
|
|
|
|
| 90 |
'<details><summary>Already bought Pro?</summary><form id="cmx-pro-form"><label>Unlock code <input id="cmx-pro-code" autocomplete="off" placeholder="cs_live_…"></label> <button class="btn ghost" type="submit">Unlock</button></form></details><p id="cmx-pro-msg" class="cmx-pro-small" aria-live="polite"></p>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
var f = document.getElementById("cmx-pro-form");
|
| 92 |
if (f) f.onsubmit = function (e) { e.preventDefault(); var c = (document.getElementById("cmx-pro-code").value || "").trim(); if (SID.test(c)) unlock(c); else toast("Paste the code from your receipt page (it starts with cs_live_)."); };
|
| 93 |
}
|
|
@@ -103,6 +121,12 @@
|
|
| 103 |
var el = box();
|
| 104 |
if (from) Array.prototype.forEach.call(el.querySelectorAll("a.cmx-plan"), function (a) { a.href = buyUrl(a.getAttribute("data-offer"), from); });
|
| 105 |
if (reason) toast(reason);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 106 |
el.scrollIntoView({ behavior: "smooth", block: "start" });
|
| 107 |
el.classList.add("cmx-pro-flash"); setTimeout(function () { el.classList.remove("cmx-pro-flash"); }, 1600);
|
| 108 |
}
|
|
|
|
| 58 |
function esc(s) { return String(s).replace(/[&<>"]/g, function (c) { return { "&": "&", "<": "<", ">": ">", '"': """ }[c]; }); }
|
| 59 |
function buyUrl(offer, from) { return DATA + "/buy/" + offer + "?s=app-" + C.id + (from ? "-" + from : ""); }
|
| 60 |
|
| 61 |
+
// Convert kit (funnel beacons, real proof, email capture, phone buy bar), loaded from the CyberMax Store; optional:
|
| 62 |
+
// if it can't load (offline), the app and the Pro box work exactly the same.
|
| 63 |
+
var KIT = "https://cybermax.cybermax-tools.workers.dev/store/convert.js", kitQ = [];
|
| 64 |
+
function conv(fn) {
|
| 65 |
+
if (window.CMXConvert) return fn(window.CMXConvert);
|
| 66 |
+
kitQ.push(fn);
|
| 67 |
+
if (kitQ.length > 1 || !navigator.onLine) return;
|
| 68 |
+
var sc = document.createElement("script"); sc.src = KIT; sc.async = true;
|
| 69 |
+
sc.onload = function () { var q = kitQ.splice(0); q.forEach(function (f) { try { f(window.CMXConvert); } catch (e) { /* */ } }); };
|
| 70 |
+
document.head.appendChild(sc);
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
function box() {
|
| 74 |
var el = document.getElementById("cmx-pro");
|
| 75 |
if (!el) {
|
|
|
|
| 98 |
}).join("");
|
| 99 |
el.innerHTML = '<h2>' + esc(C.name) + ' Pro</h2>' + (C.free ? '<p class="cmx-pro-small">Free: ' + esc(C.free) + "</p>" : "") +
|
| 100 |
"<ul>" + C.perks.map(function (p) { return "<li>" + esc(p) + "</li>"; }).join("") + '</ul><div class="cmx-plans">' + plans +
|
| 101 |
+
'</div><p class="cmx-pro-small">Secure Stripe checkout. Pro turns on the moment you pay; no account needed.' + (subs ? " Subscriptions cancel any time from your receipt email." : " One payment, no subscription.") +
|
| 102 |
+
' 14-day promise: if it doesn\'t work as described, we fix it or refund you in full (<a href="https://cybermax.cybermax-tools.workers.dev/terms#payments" target="_blank" rel="noopener">terms</a>). Questions: <a href="mailto:cybermax.tools@gmail.com">cybermax.tools@gmail.com</a></p><div class="cmx-pro-proof"></div><div class="cmx-pro-cap"></div>' +
|
| 103 |
'<details><summary>Already bought Pro?</summary><form id="cmx-pro-form"><label>Unlock code <input id="cmx-pro-code" autocomplete="off" placeholder="cs_live_…"></label> <button class="btn ghost" type="submit">Unlock</button></form></details><p id="cmx-pro-msg" class="cmx-pro-small" aria-live="polite"></p>';
|
| 104 |
+
Array.prototype.forEach.call(el.querySelectorAll("a.cmx-plan"), function (a) { a.addEventListener("click", function () { conv(function (K) { K.event("upgrade-click", C.id); }); }); });
|
| 105 |
+
conv(function (K) {
|
| 106 |
+
K.proof(el.querySelector(".cmx-pro-proof"), C.id);
|
| 107 |
+
K.capture(el.querySelector(".cmx-pro-cap"), { list: "weekly-" + C.id, src: "app-" + C.id, label: "Not ready for Pro? Email me " + C.name + " tips and new features (about once a week)" });
|
| 108 |
+
});
|
| 109 |
var f = document.getElementById("cmx-pro-form");
|
| 110 |
if (f) f.onsubmit = function (e) { e.preventDefault(); var c = (document.getElementById("cmx-pro-code").value || "").trim(); if (SID.test(c)) unlock(c); else toast("Paste the code from your receipt page (it starts with cs_live_)."); };
|
| 111 |
}
|
|
|
|
| 121 |
var el = box();
|
| 122 |
if (from) Array.prototype.forEach.call(el.querySelectorAll("a.cmx-plan"), function (a) { a.href = buyUrl(a.getAttribute("data-offer"), from); });
|
| 123 |
if (reason) toast(reason);
|
| 124 |
+
// A real limit: count it, and on phones keep one buy button in reach (no timer; closes with one tap).
|
| 125 |
+
conv(function (K) {
|
| 126 |
+
K.event("limit", C.id); K.event("upgrade-view", C.id);
|
| 127 |
+
var best = (C.plans || []).filter(function (p) { return p.best; })[0] || (C.plans || [])[0];
|
| 128 |
+
if (best && !isPro()) K.sticky({ text: C.name + " Pro: " + best.price + (best.per || ""), cta: "Go Pro", href: buyUrl(best.offer, (from || "limit") + "-bar"), product: C.id });
|
| 129 |
+
});
|
| 130 |
el.scrollIntoView({ behavior: "smooth", block: "start" });
|
| 131 |
el.classList.add("cmx-pro-flash"); setTimeout(function () { el.classList.remove("cmx-pro-flash"); }, 1600);
|
| 132 |
}
|