From b013b338396fc81487ca48c54417efc8d7121f38 Mon Sep 17 00:00:00 2001 From: Matt Batchelder Date: Tue, 12 May 2026 13:56:51 -0400 Subject: [PATCH] new pricing --- pages/features.php | 2 +- pages/pricing.php | 6 ++--- theme/assets/css/main.css | 50 +++++++++++++++++++++++++++++++++++++++ theme/assets/js/main.js | 21 ++++++++++++++++ theme/blocks/index.php | 29 +++++++++++++++++++---- 5 files changed, 100 insertions(+), 8 deletions(-) diff --git a/pages/features.php b/pages/features.php index a66ef1f..b231449 100644 --- a/pages/features.php +++ b/pages/features.php @@ -56,7 +56,7 @@ return <<<'ORIBI_SYNC_CONTENT' - + diff --git a/pages/pricing.php b/pages/pricing.php index 3dfef82..46c4f4c 100644 --- a/pages/pricing.php +++ b/pages/pricing.php @@ -9,11 +9,11 @@ return <<<'ORIBI_SYNC_CONTENT' - + - + - + diff --git a/theme/assets/css/main.css b/theme/assets/css/main.css index c4ddb54..6ce3dcb 100644 --- a/theme/assets/css/main.css +++ b/theme/assets/css/main.css @@ -2501,6 +2501,56 @@ p:last-child { margin-bottom: 0; } .pricing-features li:last-child { border-bottom: none; } .pricing-check { color: var(--color-primary); font-size: 1rem; flex-shrink: 0; margin-top: 1px; } +/* ── Billing period toggle ─────────────────────────────────── */ +.pricing-billing-toggle { + display: flex; + align-items: center; + justify-content: center; + gap: .375rem; + margin-bottom: 2.5rem; + background: var(--color-border); + border-radius: 100px; + padding: .3rem; + width: fit-content; + margin-inline: auto; +} +.pbt-option { + background: transparent; + border: none; + border-radius: 100px; + cursor: pointer; + font-size: .9rem; + font-weight: 600; + color: var(--color-text-muted); + padding: .45rem 1.25rem; + transition: background var(--transition), color var(--transition), box-shadow var(--transition); + display: flex; + align-items: center; + gap: .5rem; + white-space: nowrap; +} +.pbt-option.active { + background: var(--card-bg); + color: var(--color-heading); + box-shadow: 0 1px 4px rgba(0,0,0,.12); +} +.pbt-save-pill { + background: var(--color-primary); + color: #fff; + font-size: .68rem; + font-weight: 700; + letter-spacing: .04em; + padding: .2rem .55rem; + border-radius: 100px; + text-transform: uppercase; +} +.pricing-savings { + font-size: .82rem; + font-weight: 600; + color: var(--color-primary); + margin-top: .35rem; +} + @media (max-width: 900px) { .pricing-grid-3 { grid-template-columns: 1fr; max-width: 400px; } } diff --git a/theme/assets/js/main.js b/theme/assets/js/main.js index ad07b99..9be33b6 100644 --- a/theme/assets/js/main.js +++ b/theme/assets/js/main.js @@ -744,6 +744,27 @@ document.addEventListener('DOMContentLoaded', () => { stages.forEach(function (stage) { io.observe(stage); }); } + /* ── Pricing billing toggle ─────────────────────────────── */ + document.querySelectorAll('.pricing-billing-toggle').forEach(function(toggle) { + toggle.addEventListener('click', function(e) { + var btn = e.target.closest('.pbt-option'); + if (!btn) return; + var billing = btn.dataset.billing; + toggle.querySelectorAll('.pbt-option').forEach(function(b) { + b.classList.toggle('active', b === btn); + b.setAttribute('aria-pressed', b === btn ? 'true' : 'false'); + }); + var section = toggle.closest('section'); + if (!section) return; + section.querySelectorAll('.pbt-show-monthly').forEach(function(el) { + el.hidden = (billing === 'annual'); + }); + section.querySelectorAll('.pbt-show-annual').forEach(function(el) { + el.hidden = (billing === 'monthly'); + }); + }); + }); + function startTsSlides(stage) { var slides = stage.querySelectorAll('.ts-slide'); if (!slides.length) return; diff --git a/theme/blocks/index.php b/theme/blocks/index.php index 89d2de5..562f7f3 100644 --- a/theme/blocks/index.php +++ b/theme/blocks/index.php @@ -539,6 +539,9 @@ add_action('init', function () { 'tagline' => ['type' => 'string', 'default' => ''], 'price' => ['type' => 'string', 'default' => ''], 'pricePer' => ['type' => 'string', 'default' => ''], + 'annualPrice' => ['type' => 'string', 'default' => ''], + 'annualPer' => ['type' => 'string', 'default' => ''], + 'annualSavings' => ['type' => 'string', 'default' => ''], 'features' => ['type' => 'array', 'default' => []], 'btnText' => ['type' => 'string', 'default' => 'Get Started'], 'btnUrl' => ['type' => 'string', 'default' => '/contact'], @@ -1793,6 +1796,11 @@ function oribi_render_pricing_section($a, $content, $block) $cls = $a['variant'] === 'alt' ? 'section section-alt' : 'section'; $count = count($block->inner_blocks); $has_label = !empty($a['label']); + $toggle = ' +
+ + +
'; ob_start(); if ($has_label): ?>
@@ -1803,6 +1811,7 @@ function oribi_render_pricing_section($a, $content, $block)

+
@@ -1816,6 +1825,7 @@ function oribi_render_pricing_section($a, $content, $block)

+
@@ -1849,6 +1859,13 @@ function oribi_render_pricing_card($a) } } + $has_annual = !empty($a['annualPrice']); + $monthly_price = $a['price'] ?? ''; + $monthly_per = $a['pricePer'] ?? ''; + $annual_price = $a['annualPrice'] ?? ''; + $annual_per = $a['annualPer'] ?? ''; + $annual_savings = $a['annualSavings'] ?? ''; + ob_start(); ?>
@@ -1863,11 +1880,15 @@ function oribi_render_pricing_card($a) endif; ?>

- +
-
-
+
+
+ + + + +