Initial commit of BlackDice ROI toolkit
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
+49
@@ -0,0 +1,49 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
import Nav from './components/Nav.jsx';
|
||||
import Footer from './components/Footer.jsx';
|
||||
import Landing from './components/Landing.jsx';
|
||||
import Toolkit from './components/Toolkit.jsx';
|
||||
import { captureUtm, submitLead } from './lib/crm.js';
|
||||
|
||||
const REG_KEY = 'bd_toolkit_registrant';
|
||||
|
||||
function loadRegistrant() {
|
||||
try {
|
||||
return JSON.parse(localStorage.getItem(REG_KEY) || 'null');
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
export default function App() {
|
||||
const [registrant, setRegistrant] = useState(loadRegistrant);
|
||||
|
||||
useEffect(() => {
|
||||
captureUtm(); // store campaign params on first landing
|
||||
}, []);
|
||||
|
||||
async function handleRegister(reg, { skipCrm } = {}) {
|
||||
if (!skipCrm) await submitLead(reg); // waits max SUBMIT_TIMEOUT_MS, never throws
|
||||
try { localStorage.setItem(REG_KEY, JSON.stringify(reg)); } catch { /* storage unavailable */ }
|
||||
setRegistrant(reg);
|
||||
window.dataLayer?.push({ event: 'toolkit_registration' }); // GTM hook, if present
|
||||
window.scrollTo({ top: 0, behavior: 'smooth' });
|
||||
}
|
||||
|
||||
function handleReset() {
|
||||
try {
|
||||
localStorage.removeItem(REG_KEY);
|
||||
localStorage.removeItem('bd_toolkit_calc_inputs');
|
||||
} catch { /* ignore */ }
|
||||
setRegistrant(null);
|
||||
window.scrollTo({ top: 0 });
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Nav />
|
||||
{registrant ? <Toolkit registrant={registrant} onReset={handleReset} /> : <Landing onRegister={handleRegister} />}
|
||||
<Footer />
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,337 @@
|
||||
import { useEffect, useMemo, useState } from 'react';
|
||||
import { asset } from '../lib/asset.js';
|
||||
import { calculate, ddosCostFromSlider, fmt, fmtRange, formatForDeck, INPUTS_KEY, loadInputs, regionLabel, REGIONS } from '../lib/calc.js';
|
||||
import { buildPersonalisedDeck, prefetchTemplate, triggerDownload } from '../lib/pptxReport.js';
|
||||
import { submitRoi } from '../lib/crm.js';
|
||||
|
||||
const Icon = {
|
||||
globe: <svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="10" /><path d="M2 12h20M12 2a15.3 15.3 0 010 20M12 2a15.3 15.3 0 000 20" /></svg>,
|
||||
phone: <svg viewBox="0 0 24 24"><path d="M22 16.92v3a2 2 0 01-2.18 2 19.79 19.79 0 01-8.63-3.07A19.5 19.5 0 013.09 10.8a19.79 19.79 0 01-3.07-8.63A2 2 0 012 0h3a2 2 0 012 1.72c.127.96.361 1.903.7 2.81a2 2 0 01-.45 2.11L6.09 7.91a16 16 0 006 6l1.27-1.27a2 2 0 012.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0122 14.92z" /></svg>,
|
||||
users: <svg viewBox="0 0 24 24"><path d="M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2" /><circle cx="9" cy="7" r="4" /><path d="M23 21v-2a4 4 0 00-3-3.87M16 3.13a4 4 0 010 7.75" /></svg>,
|
||||
server: <svg viewBox="0 0 24 24"><rect x="2" y="2" width="20" height="8" rx="2" ry="2" /><rect x="2" y="14" width="20" height="8" rx="2" ry="2" /><line x1="6" y1="6" x2="6.01" y2="6" /><line x1="6" y1="18" x2="6.01" y2="18" /></svg>,
|
||||
shield: <svg viewBox="0 0 24 24"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" /></svg>,
|
||||
download: <svg viewBox="0 0 24 24"><path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4" /><polyline points="7 10 12 15 17 10" /><line x1="12" y1="15" x2="12" y2="3" /></svg>,
|
||||
};
|
||||
|
||||
function CardHeader({ icon, green, num, title, subtitle }) {
|
||||
return (
|
||||
<div className="card-header">
|
||||
<div className={`card-icon${green ? ' green' : ''}`}>{icon}</div>
|
||||
<div>
|
||||
<div className="card-num">{num}</div>
|
||||
<div className="card-title">{title}</div>
|
||||
<div className="card-subtitle">{subtitle}</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
const rangePct = (val, min, max) => `${(((val - min) / (max - min)) * 100).toFixed(1)}%`;
|
||||
|
||||
export default function Calculator({ registrant, active }) {
|
||||
const [i, setI] = useState(() => loadInputs(registrant));
|
||||
const [showAssump, setShowAssump] = useState(false);
|
||||
const [report, setReport] = useState({ state: 'idle', msg: '' }); // idle | busy | done | error
|
||||
const update = (patch) => {
|
||||
setI((s) => ({ ...s, ...patch, touched: true }));
|
||||
setReport((s) => (s.state === 'busy' ? s : { state: 'idle', msg: '' })); // clear stale "downloaded" note
|
||||
};
|
||||
const set = (k) => (e) => update({ [k]: e.target.value });
|
||||
|
||||
const r = useMemo(() => calculate(i), [i]);
|
||||
|
||||
// Remember inputs for this visitor (survives refresh)
|
||||
useEffect(() => {
|
||||
try { localStorage.setItem(INPUTS_KEY, JSON.stringify(i)); } catch { /* storage unavailable */ }
|
||||
}, [i]);
|
||||
|
||||
// Warm the template cache while the user fills in the calculator
|
||||
useEffect(() => {
|
||||
if (active) prefetchTemplate().catch(() => {});
|
||||
}, [active]);
|
||||
|
||||
const rows = [
|
||||
['bw', 'dot-grey', '① Bandwidth savings', 'Enter subscriber count and region'],
|
||||
['calls', 'dot-green', '② Support call reduction', 'Enter subscriber count and call volume'],
|
||||
['churn', 'dot-teal', '③ Churn reduction', 'Enter ARPU and churn rate'],
|
||||
['equip', 'dot-blue', '④ Network equipment', 'Enter infrastructure OpEx (optional)'],
|
||||
['ddos', 'dot-orange', '⑤ DDoS avoided costs', 'No incidents entered'],
|
||||
];
|
||||
|
||||
async function downloadReport() {
|
||||
if (!r.complete || report.state === 'busy') return;
|
||||
setReport({ state: 'busy', msg: 'Building your personalised deck…' });
|
||||
|
||||
const formatted = formatForDeck(i, r, registrant);
|
||||
const company = registrant?.company || 'Your Company';
|
||||
|
||||
// Send ROI figures to CRM in parallel (never blocks the download)
|
||||
submitRoi(registrant, {
|
||||
inputs: {
|
||||
subs: i.subs, arpu: i.arpu, churn: i.churn, netOpex: i.netOpex, ddosIncidents: i.ddos,
|
||||
callsPer1000: i.callsPer1000, callCost: i.callCost, securityPct: i.securityPct,
|
||||
bandwidthPricePerGb: i.region === 'custom' ? i.customPrice : i.region,
|
||||
regionLabel: regionLabel(i.region), scenario: i.scenario,
|
||||
},
|
||||
results: r,
|
||||
formatted,
|
||||
}).catch(() => {});
|
||||
|
||||
try {
|
||||
const blob = await buildPersonalisedDeck(formatted, { company, date: registrant?.date });
|
||||
triggerDownload(blob, `BlackDice_ROI_Report_${company.replace(/[^a-z0-9]+/gi, '_')}.pptx`);
|
||||
setReport({ state: 'done', msg: 'Your personalised report has downloaded. Your figures are on slide 12.' });
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
setReport({ state: 'error', msg: 'Sorry, we couldn’t build your report. Please try again in a moment.' });
|
||||
}
|
||||
}
|
||||
|
||||
const reportNote =
|
||||
report.msg || (r.complete ? 'Your personalised report is ready to download.' : 'Complete the calculator above to unlock your personalised report.');
|
||||
|
||||
return (
|
||||
<div className="calc-tab-wrap">
|
||||
<div className="calc-tab-header">
|
||||
<h2>Network Protection ROI Calculator</h2>
|
||||
<p>Enter your operator data below. Results update in real time. Once complete, download your personalised report.</p>
|
||||
</div>
|
||||
|
||||
<div className="rank-bar">
|
||||
<div className="rank-bar-inner">
|
||||
<span className="rank-label">Savings by section</span>
|
||||
{['Bandwidth', 'Support calls', 'Churn reduction', 'Network equipment', 'DDoS (optional)'].map((t, n) => (
|
||||
<span key={t} style={{ display: 'contents' }}>
|
||||
{n > 0 && <span className="rank-sep">›</span>}
|
||||
<span className="rank-item"><span className="num">{n + 1}</span> {t}</span>
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<main className="main">
|
||||
<div className="input-col">
|
||||
{/* CARD 1 */}
|
||||
<div className="card">
|
||||
<CardHeader icon={Icon.globe} num="Section 1" title="Your network" subtitle="Subscriber base and regional bandwidth pricing" />
|
||||
<div className="field-row">
|
||||
<div className="field-group">
|
||||
<label htmlFor="subs">Active subscribers</label>
|
||||
<input type="number" id="subs" placeholder="e.g. 5000000" min="0" value={i.subs} onChange={set('subs')} />
|
||||
<div className="field-hint">Total active mobile and broadband subscribers</div>
|
||||
</div>
|
||||
<div className="field-group">
|
||||
<label htmlFor="region">Country / region</label>
|
||||
<select id="region" value={i.region} onChange={set('region')}>
|
||||
{REGIONS.map((g) => (
|
||||
<optgroup key={g.group} label={g.group}>
|
||||
{g.options.map((o) => <option key={o.value} value={o.value}>{o.label}</option>)}
|
||||
</optgroup>
|
||||
))}
|
||||
<option value="custom">Other: enter price below</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{i.region === 'custom' && (
|
||||
<div className="field-group">
|
||||
<label htmlFor="custom-price">Custom bandwidth price ($ per GB)</label>
|
||||
<div className="input-wrap has-prefix">
|
||||
<span className="input-prefix">$</span>
|
||||
<input type="number" id="custom-price" placeholder="0.0050" step="0.0001" min="0" value={i.customPrice} onChange={set('customPrice')} />
|
||||
</div>
|
||||
<div className="field-hint">Source: TeleGeography IP transit pricing. Use your actual wholesale price for the most accurate result.</div>
|
||||
</div>
|
||||
)}
|
||||
<div className="field-group">
|
||||
<label>Bandwidth saving scenario</label>
|
||||
<div className="scenario-tabs">
|
||||
{[['cautious', 'Cautious', 15], ['expected', 'Expected', 37], ['optimistic', 'Optimistic', 80]].map(([k, t, kb]) => (
|
||||
<button key={k} type="button" className={`scenario-tab${i.scenario === k ? ' active' : ''}`} onClick={() => update({ scenario: k })}>
|
||||
{t}<br /><small style={{ fontWeight: 400, fontSize: 10 }}>{kb} KB / block</small>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
<div className="field-hint">
|
||||
Based on BlackDice customer data: 8,000 blocks/subscriber/month across adverts, trackers, malware and phishing. Traffic per block varies by mix. Lead with Expected, show Cautious as the proven floor. Source: BlackDice internal methodology, September 2026.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* CARD 2 */}
|
||||
<div className="card highlight">
|
||||
<CardHeader icon={Icon.phone} green num="Section 2" title="Support call reduction" subtitle="Infected and advert-hammered devices drive helpdesk volume" />
|
||||
<div className="field-row">
|
||||
<div className="field-group">
|
||||
<label htmlFor="calls-per-1000">Monthly support calls per 1,000 subs</label>
|
||||
<input type="number" id="calls-per-1000" placeholder="18" min="0" value={i.callsPer1000} onChange={set('callsPer1000')} />
|
||||
<div className="field-hint">Industry average: 15–25 calls per 1,000 subs/month</div>
|
||||
</div>
|
||||
<div className="field-group">
|
||||
<label htmlFor="call-cost">Average cost per call ($)</label>
|
||||
<div className="input-wrap has-prefix">
|
||||
<span className="input-prefix">$</span>
|
||||
<input type="number" id="call-cost" placeholder="8" min="0" value={i.callCost} onChange={set('callCost')} />
|
||||
</div>
|
||||
<div className="field-hint">Telecoms average: $5–$15 per call</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="field-group">
|
||||
<label htmlFor="security-pct">% of calls related to security, malware or connectivity issues</label>
|
||||
<div className="slider-val">{i.securityPct}%</div>
|
||||
<input type="range" id="security-pct" min="5" max="60" step="5" value={i.securityPct} onChange={set('securityPct')} style={{ '--pct': rangePct(i.securityPct, 5, 60) }} />
|
||||
<div className="slider-labels"><span>5%</span><span>60%</span></div>
|
||||
<div className="field-hint">
|
||||
BlackDice blocks malware, phishing and advert-hammering: the main sources of unexplained slow device complaints and failed connection calls. Adjust to reflect your own support call categorisation.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* CARD 3 */}
|
||||
<div className="card">
|
||||
<CardHeader icon={Icon.users} num="Section 3" title="Subscriber value and churn" subtitle="Quantify the revenue impact of retaining more customers" />
|
||||
<div className="field-row">
|
||||
<div className="field-group">
|
||||
<label htmlFor="arpu">Monthly ARPU ($)</label>
|
||||
<div className="input-wrap has-prefix">
|
||||
<span className="input-prefix">$</span>
|
||||
<input type="number" id="arpu" placeholder="e.g. 12" min="0" value={i.arpu} onChange={set('arpu')} />
|
||||
</div>
|
||||
<div className="field-hint">Average revenue per user per month</div>
|
||||
</div>
|
||||
<div className="field-group">
|
||||
<label htmlFor="churn">Current annual churn rate (%)</label>
|
||||
<div className="input-wrap has-suffix">
|
||||
<input type="number" id="churn" placeholder="e.g. 18" min="0" max="100" value={i.churn} onChange={set('churn')} />
|
||||
<span className="input-suffix">%</span>
|
||||
</div>
|
||||
<div className="field-hint">Annual subscriber churn as a percentage</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="field-hint" style={{ marginTop: -8, padding: '10px 12px', background: '#f0f8f4', borderRadius: 8, border: '1px solid rgba(53,184,136,0.2)' }}>
|
||||
<strong style={{ color: 'var(--teal)' }}>How this is calculated:</strong> Network protection is associated with a 0.3–0.6% reduction in annual churn (customers are less likely to blame their operator for bad experiences caused by malware, fraud calls and ad-hammered devices). Each retained subscriber is worth ARPU × 12 months.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* CARD 4 */}
|
||||
<div className="card">
|
||||
<CardHeader icon={Icon.server} num="Section 4" title="Network infrastructure" subtitle="Optional: junk traffic elimination reduces equipment load" />
|
||||
<div className="opt-note">
|
||||
Malware and tracker traffic consists of millions of tiny connections rather than large downloads. The stateful connection-tracking equipment that handles this is expensive to run and scale. Reducing junk connections typically lowers utilisation by 2–4%, deferring capacity upgrades.
|
||||
</div>
|
||||
<div className="field-group">
|
||||
<label htmlFor="net-opex">Annual network infrastructure / equipment OpEx ($)</label>
|
||||
<div className="input-wrap has-prefix">
|
||||
<span className="input-prefix">$</span>
|
||||
<input type="number" id="net-opex" placeholder="Optional" min="0" value={i.netOpex} onChange={set('netOpex')} />
|
||||
</div>
|
||||
<div className="field-hint">Leave blank to exclude this category from your total</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* CARD 5 */}
|
||||
<div className="card">
|
||||
<CardHeader icon={Icon.shield} num="Section 5" title="DDoS avoided costs" subtitle="Optional: enter 0 if unknown" />
|
||||
<div className="field-row">
|
||||
<div className="field-group">
|
||||
<label htmlFor="ddos">DDoS incidents per year</label>
|
||||
<input type="number" id="ddos" placeholder="0" min="0" value={i.ddos} onChange={set('ddos')} />
|
||||
</div>
|
||||
<div className="field-group">
|
||||
<label htmlFor="ddos-slider">Cost assumption</label>
|
||||
<div className="slider-val">${Math.round(ddosCostFromSlider(i.ddosSlider) / 1000)}K per incident</div>
|
||||
<input type="range" id="ddos-slider" min="0" max="100" step="1" value={i.ddosSlider} onChange={set('ddosSlider')} style={{ marginTop: 8, '--pct': `${i.ddosSlider}%` }} />
|
||||
<div className="slider-labels"><span>$408K</span><span>$1.2M</span></div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="field-hint">Industry range $408K–$1.2M per incident (Forrester / Ponemon Institute). Results show the full low–high range regardless of this setting.</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* RESULTS */}
|
||||
<div className="results-col">
|
||||
<div className="results-card">
|
||||
<div className="results-header">
|
||||
<div className="results-header-hex" style={{ backgroundImage: `url(${asset('img/results-hex.png')})` }} />
|
||||
<h2>Estimated annual savings</h2>
|
||||
<p>Updates in real time as you enter your figures</p>
|
||||
</div>
|
||||
<div className="results-body">
|
||||
<div className="total-block">
|
||||
<div className="total-label">Total potential savings</div>
|
||||
<div className="total-amount" aria-live="polite">
|
||||
{r.complete ? (
|
||||
<>
|
||||
<span>{fmt(r.total.lo)}</span>
|
||||
<span className="total-sep"> to </span>
|
||||
<span>{fmt(r.total.hi)}</span>
|
||||
</>
|
||||
) : (
|
||||
<span>—</span>
|
||||
)}
|
||||
</div>
|
||||
<div className="total-sub">{r.complete ? 'estimated annual savings range' : 'Enter your network details above'}</div>
|
||||
</div>
|
||||
|
||||
<div className="breakdown">
|
||||
{rows.map(([k, dot, name, empty]) => {
|
||||
const txt = fmtRange(r[k].lo, r[k].hi);
|
||||
return (
|
||||
<div className="brow" key={k}>
|
||||
<span className={`brow-dot ${dot}`} />
|
||||
<div className="brow-info">
|
||||
<div className="brow-name">{name}</div>
|
||||
<div className="brow-val">{txt ? <span>{txt}</span> : <span className="muted">{empty}</span>}</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
|
||||
<div className="assump-section">
|
||||
<button type="button" className={`assump-toggle${showAssump ? ' open' : ''}`} onClick={() => setShowAssump((v) => !v)}>
|
||||
<svg viewBox="0 0 24 24" strokeWidth="2"><polyline points="6 9 12 15 18 9" /></svg>
|
||||
View sources and methodology
|
||||
</button>
|
||||
<div className={`assump-list${showAssump ? ' vis' : ''}`}>
|
||||
<strong style={{ color: 'var(--lgrey)' }}>Bandwidth</strong><br />
|
||||
8,000 blocks/subscriber/month (BlackDice customer data)<br />
|
||||
Traffic per block: 15 KB (cautious) / 37 KB (expected) / 80 KB (optimistic)<br />
|
||||
Regional pricing: TeleGeography IP transit pricing, Q2 2026<br />
|
||||
Busy-hour factor: 2.5× daily average (standard mobile)<br /><br />
|
||||
<strong style={{ color: 'var(--lgrey)' }}>Support calls</strong><br />
|
||||
Reduction rate: 60–70% of security-related calls eliminated<br />
|
||||
Industry call volume: 15–25 calls per 1,000 subs/month<br />
|
||||
Average call cost: $5–$15 (telecoms industry)<br /><br />
|
||||
<strong style={{ color: 'var(--lgrey)' }}>Churn</strong><br />
|
||||
Protection-linked churn reduction: 0.3–0.6% annually<br />
|
||||
McKinsey B2B Telco Survey 2025; GSMA Intelligence 2024<br /><br />
|
||||
<strong style={{ color: 'var(--lgrey)' }}>Network equipment</strong><br />
|
||||
Junk traffic reduction lowers equipment utilisation by 2–4%<br /><br />
|
||||
<strong style={{ color: 'var(--lgrey)' }}>DDoS</strong><br />
|
||||
$408K–$1.2M per incident (Forrester / Ponemon Institute)<br /><br />
|
||||
<em>All figures are indicative. Actual savings will vary by network architecture, traffic mix, and existing controls.</em>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<div className="disclaimer" style={{ marginTop: 24 }}>
|
||||
<strong>Important:</strong> This calculator provides indicative estimates based on BlackDice internal customer data, TeleGeography IP transit pricing (Q2 2026), the Communications Fraud Control Association, Forrester Research, Ponemon Institute, McKinsey B2B Telco Survey 2025, and GSMA Intelligence. Bandwidth savings represent capacity the operator never has to carry, not a guaranteed reduction in existing contracted wholesale costs. Figures should be used as a starting point for commercial conversations, not as a guarantee of savings. Operator-specific results will depend on network architecture, traffic mix, subscriber behaviour, and existing security controls.
|
||||
</div>
|
||||
|
||||
<div className="lp-report-bar">
|
||||
<div className="lp-report-bar-text">
|
||||
<h4>Download your personalised ROI report</h4>
|
||||
<p>A branded PowerPoint deck with your operator's estimated annual saving across all five categories, ready to share with your finance or commercial team.</p>
|
||||
<p className={`report-note${report.state === 'error' ? ' report-error' : ''}`} aria-live="polite">{reportNote}</p>
|
||||
</div>
|
||||
<button className={`report-dl-btn${report.state === 'busy' ? ' busy' : ''}`} onClick={downloadReport} disabled={!r.complete || report.state === 'busy'}>
|
||||
{Icon.download}
|
||||
{report.state === 'busy' ? 'Preparing…' : 'Download My ROI Report'}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
import { asset } from '../lib/asset.js';
|
||||
import { calculate, formatForDeck, loadInputs } from '../lib/calc.js';
|
||||
import { buildPersonalisedDeck, getExampleDeck, prefetchTemplate, triggerDownload } from '../lib/pptxReport.js';
|
||||
|
||||
const SLIDE_COUNT = 15;
|
||||
const slides = Array.from({ length: SLIDE_COUNT }, (_, i) => asset(`img/slides/slide-${String(i + 1).padStart(2, '0')}.jpg`));
|
||||
|
||||
export default function DeckViewer({ active, registrant }) {
|
||||
const [cur, setCur] = useState(0);
|
||||
const [busy, setBusy] = useState(false);
|
||||
const thumbsRef = useRef(null);
|
||||
const go = (n) => setCur(Math.max(0, Math.min(SLIDE_COUNT - 1, n)));
|
||||
|
||||
async function downloadDeck() {
|
||||
if (busy) return;
|
||||
setBusy(true);
|
||||
try {
|
||||
const i = loadInputs(registrant);
|
||||
const r = calculate(i);
|
||||
const values = formatForDeck(i, r, registrant);
|
||||
const meta = { company: registrant?.company || 'Your Company', date: registrant?.date };
|
||||
// Slide 3 shows their device count (from the form) straight away. Slide 12 keeps the
|
||||
// example figures until they've entered their own numbers in the calculator.
|
||||
const blob =
|
||||
i.touched && r.complete
|
||||
? await buildPersonalisedDeck(values, meta)
|
||||
: values.subs
|
||||
? await buildPersonalisedDeck(values, meta, { roi: false })
|
||||
: await getExampleDeck();
|
||||
triggerDownload(blob, 'BlackDice_Turn_Network_Protection_Strategy_Deck.pptx');
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
} finally {
|
||||
setBusy(false);
|
||||
}
|
||||
}
|
||||
|
||||
// Warm the template cache while the deck is being viewed
|
||||
useEffect(() => {
|
||||
if (active) prefetchTemplate().catch(() => {});
|
||||
}, [active]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!active) return;
|
||||
const onKey = (e) => {
|
||||
if (['INPUT', 'SELECT', 'TEXTAREA'].includes(e.target.tagName)) return;
|
||||
if (e.key === 'ArrowRight' || e.key === 'ArrowDown') { e.preventDefault(); setCur((c) => Math.min(SLIDE_COUNT - 1, c + 1)); }
|
||||
if (e.key === 'ArrowLeft' || e.key === 'ArrowUp') { e.preventDefault(); setCur((c) => Math.max(0, c - 1)); }
|
||||
};
|
||||
document.addEventListener('keydown', onKey);
|
||||
return () => document.removeEventListener('keydown', onKey);
|
||||
}, [active]);
|
||||
|
||||
useEffect(() => {
|
||||
const thumb = thumbsRef.current?.children[cur];
|
||||
thumb?.scrollIntoView({ block: 'nearest', inline: 'center', behavior: 'smooth' });
|
||||
}, [cur]);
|
||||
|
||||
// Preload the next slide for snappy navigation
|
||||
useEffect(() => {
|
||||
if (cur + 1 < SLIDE_COUNT) new Image().src = slides[cur + 1];
|
||||
}, [cur]);
|
||||
|
||||
return (
|
||||
<div className="deck-viewer-wrap">
|
||||
<div className="deck-viewer-top">
|
||||
<div>
|
||||
<div className="deck-viewer-title">Turn Network Protection into Competitive Advantage</div>
|
||||
<div className="deck-viewer-sub">15 slides · Use arrow keys or click to navigate · Click thumbnails to jump to any slide</div>
|
||||
</div>
|
||||
<button type="button" className="deck-dl-btn" onClick={downloadDeck} disabled={busy}>
|
||||
<svg viewBox="0 0 24 24"><path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4" /><polyline points="7 10 12 15 17 10" /><line x1="12" y1="15" x2="12" y2="3" /></svg>
|
||||
{busy ? 'Preparing…' : 'Download Deck (PPTX)'}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div className="slide-viewer">
|
||||
<div className="slide-display">
|
||||
<button className="slide-nav-btn prev" onClick={() => go(cur - 1)} disabled={cur === 0} aria-label="Previous slide">‹</button>
|
||||
<img src={slides[cur]} alt={`Slide ${cur + 1}`} />
|
||||
<button className="slide-nav-btn next" onClick={() => go(cur + 1)} disabled={cur === SLIDE_COUNT - 1} aria-label="Next slide">›</button>
|
||||
</div>
|
||||
<div className="slide-controls">
|
||||
<div className="slide-counter">{cur + 1} / {SLIDE_COUNT}</div>
|
||||
<div className="slide-thumbs" ref={thumbsRef}>
|
||||
{slides.map((src, i) => (
|
||||
<button key={src} className={`slide-thumb-btn${i === cur ? ' active' : ''}`} onClick={() => go(i)} title={`Slide ${i + 1}`}>
|
||||
<img src={src} alt={`Slide ${i + 1}`} loading="lazy" />
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
export default function Footer() {
|
||||
return (
|
||||
<footer className="lp-footer">
|
||||
<p>
|
||||
© 2026 Cyber Intelligence Group Limited. All rights reserved. | {' '}
|
||||
<a href="https://www.blackdice.ai/privacy" target="_blank" rel="noreferrer">Privacy Policy</a> | {' '}
|
||||
<a href="https://www.blackdice.ai" target="_blank" rel="noreferrer">blackdice.ai</a>
|
||||
</p>
|
||||
</footer>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,265 @@
|
||||
import { useState } from 'react';
|
||||
import { asset } from '../lib/asset.js';
|
||||
import { fmtCount } from '../lib/calc.js';
|
||||
|
||||
const REGIONS = ['United Kingdom', 'Western Europe', 'North America', 'Latin America', 'Sub-Saharan Africa', 'Asia Pacific', 'Middle East', 'Other'];
|
||||
// "The device on your network" dropdown. `deck` is how the choice appears as the big
|
||||
// number on slide 3; the label is what's sent to the CRM's "subscriber base" field.
|
||||
const DEVICE_OPTIONS = [
|
||||
{ value: 'Under 500k', deck: '<500k' },
|
||||
{ value: '500k to 2M', deck: '500k–2m' },
|
||||
{ value: '2M to 10M', deck: '2m–10m' },
|
||||
{ value: '10M to 50M', deck: '10m–50m' },
|
||||
{ value: '50M+', deck: '50m+' },
|
||||
];
|
||||
const EXACT = 'exact';
|
||||
|
||||
// Band for an exact count, so the CRM's "subscriber base" field is always filled the same way.
|
||||
function subscriberBand(n) {
|
||||
if (!n) return '';
|
||||
if (n < 500e3) return 'Under 500k';
|
||||
if (n < 2e6) return '500k to 2M';
|
||||
if (n < 10e6) return '2M to 10M';
|
||||
if (n < 50e6) return '10M to 50M';
|
||||
return '50M+';
|
||||
}
|
||||
|
||||
// Common free-mail domains — the form asks for a *business* email.
|
||||
// Set VITE_BLOCK_FREE_EMAIL=false in .env to allow them.
|
||||
const BLOCK_FREE_MAIL = import.meta.env.VITE_BLOCK_FREE_EMAIL !== 'false';
|
||||
const FREE_MAIL = /@(gmail|googlemail|yahoo|hotmail|outlook|live|aol|icloud|me|proton|protonmail|gmx|mail|yandex)\./i;
|
||||
|
||||
function Hero() {
|
||||
return (
|
||||
<div className="lp-hero">
|
||||
<img className="lp-hero-hex" src={asset('img/hero-hex.png')} alt="" />
|
||||
<div className="lp-hero-inner">
|
||||
<div className="lp-hero-badge">Operator ROI Toolkit</div>
|
||||
<h1>
|
||||
Turn network protection
|
||||
<br />
|
||||
<span>into competitive advantage</span>
|
||||
</h1>
|
||||
<p className="lp-hero-sub">
|
||||
Access the complete operator toolkit: a 15-slide strategy deck and interactive ROI calculator to quantify and
|
||||
communicate the commercial value of blocking malicious traffic on your network.
|
||||
</p>
|
||||
<div className="lp-hero-proof">
|
||||
{[
|
||||
['$10.5tr', 'Global cybercrime economy'],
|
||||
['$41B+', 'Annual network fraud'],
|
||||
['5', 'ROI savings categories'],
|
||||
].map(([n, l]) => (
|
||||
<div className="lp-proof-item" key={l}>
|
||||
<div className="lp-proof-num">{n}</div>
|
||||
<div className="lp-proof-label">{l}</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function WhatYouGet() {
|
||||
return (
|
||||
<div className="lp-what">
|
||||
<div className="lp-what-inner">
|
||||
<div className="lp-section-label">Inside the toolkit</div>
|
||||
<div className="lp-section-title">Two tools. One clear commercial case.</div>
|
||||
<p className="lp-section-sub">
|
||||
Built for operators evaluating network-level malicious traffic blocking, from initial business case to
|
||||
personalised ROI.
|
||||
</p>
|
||||
<div className="lp-assets">
|
||||
<div className="lp-asset-card">
|
||||
<div className="lp-asset-preview">
|
||||
<img className="lp-slide-thumb" src={asset('img/slides/slide-01.jpg')} alt="Strategy Deck" />
|
||||
</div>
|
||||
<div className="lp-asset-info">
|
||||
<div className="lp-asset-tag">Strategy Deck · 15 Slides</div>
|
||||
<h3>Turn network protection into competitive advantage</h3>
|
||||
<p>
|
||||
A concise, evidence-led deck that frames the commercial cost of malicious traffic and makes the case
|
||||
for operator-level blocking, ready to share internally or use in a board presentation.
|
||||
</p>
|
||||
<ul className="lp-asset-bullets">
|
||||
<li>Global fraud context with GSMA and McKinsey data</li>
|
||||
<li>Five commercial savings categories explained</li>
|
||||
<li>Discover three BlackDice protection deployment paths</li>
|
||||
<li>ROI model and commercial summary</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="lp-asset-card">
|
||||
<div className="lp-asset-preview-calc">
|
||||
<div className="calc-mock">
|
||||
<div className="calc-mock-header">① Your network</div>
|
||||
<div className="calc-mock-row">
|
||||
<div className="calc-mock-field">Active subscribers</div>
|
||||
<div className="calc-mock-field">Region / pricing</div>
|
||||
</div>
|
||||
<div className="calc-mock-header" style={{ marginTop: 8 }}>② Support calls</div>
|
||||
<div className="calc-mock-row">
|
||||
<div className="calc-mock-field">Calls per 1,000/mo</div>
|
||||
<div className="calc-mock-field">Cost per call</div>
|
||||
</div>
|
||||
<div className="calc-mock-result">
|
||||
<div className="calc-mock-result-label">Estimated annual saving</div>
|
||||
<div className="calc-mock-result-val">Calculate your numbers</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="lp-asset-info">
|
||||
<div className="lp-asset-tag">Interactive Calculator</div>
|
||||
<h3>Network protection ROI calculator</h3>
|
||||
<p>
|
||||
Enter your operator data: subscriber base, support call volume, ARPU and churn rate, and get a
|
||||
personalised annual saving across five categories with a downloadable results report.
|
||||
</p>
|
||||
<ul className="lp-asset-bullets">
|
||||
<li>Bandwidth savings by region (TeleGeography data)</li>
|
||||
<li>Support call reduction based on your actual call cost</li>
|
||||
<li>Churn reduction and ARPU protection</li>
|
||||
<li>DDoS avoided costs and equipment savings</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
const EMPTY = { first: '', last: '', company: '', title: '', email: '', region: '', devices: '', subscribers: '', website: '' };
|
||||
|
||||
function RegistrationForm({ onRegister }) {
|
||||
const [f, setF] = useState(EMPTY);
|
||||
const [error, setError] = useState('');
|
||||
const [busy, setBusy] = useState(false);
|
||||
const set = (k) => (e) => setF((s) => ({ ...s, [k]: e.target.value }));
|
||||
|
||||
async function handleSubmit(e) {
|
||||
e.preventDefault();
|
||||
const t = Object.fromEntries(Object.entries(f).map(([k, v]) => [k, v.trim()]));
|
||||
|
||||
if (!t.first || !t.last || !t.company || !t.title || !t.email) {
|
||||
return setError('Please complete all required fields before continuing.');
|
||||
}
|
||||
if (!/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(t.email)) {
|
||||
return setError('Please enter a valid business email address.');
|
||||
}
|
||||
if (BLOCK_FREE_MAIL && FREE_MAIL.test(t.email)) {
|
||||
return setError('Please use your business email address rather than a personal one.');
|
||||
}
|
||||
// Device count: a band from the dropdown, or an exact number
|
||||
let exact = 0;
|
||||
if (t.devices === EXACT) {
|
||||
exact = Math.round(parseFloat(t.subscribers.replace(/[,\s]/g, '')) || 0);
|
||||
if (exact <= 0) return setError('Please enter the number of devices on your network, e.g. 5,000,000.');
|
||||
}
|
||||
const band = DEVICE_OPTIONS.find((o) => o.value === t.devices);
|
||||
setError('');
|
||||
|
||||
// Honeypot: bots fill the hidden "website" field. Let them "through" without sending to the CRM.
|
||||
const isBot = !!t.website;
|
||||
const { website: _hp, devices: _d, ...lead } = t;
|
||||
setBusy(true);
|
||||
await onRegister(
|
||||
{
|
||||
...lead,
|
||||
subscribers: exact ? String(exact) : '', // exact count (pre-fills the calculator)
|
||||
subs: band ? band.value : subscriberBand(exact), // band, for the CRM
|
||||
deviceLabel: band ? band.deck : fmtCount(exact), // big number on slide 3
|
||||
date: new Date().toLocaleDateString('en-GB', { day: 'numeric', month: 'long', year: 'numeric' }),
|
||||
},
|
||||
{ skipCrm: isBot }
|
||||
);
|
||||
setBusy(false);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="lp-reg" id="register">
|
||||
<div className="lp-reg-inner">
|
||||
<div className="lp-reg-box">
|
||||
<div className="lp-reg-title">Get free access to the toolkit</div>
|
||||
<p className="lp-reg-sub">
|
||||
Complete the form below to view and download the strategy deck and unlock the personalised ROI calculator.
|
||||
</p>
|
||||
{error && (
|
||||
<div id="form-error" role="alert" style={{ display: 'block' }}>
|
||||
{error}
|
||||
</div>
|
||||
)}
|
||||
<form onSubmit={handleSubmit} noValidate>
|
||||
<div className="lp-form-grid">
|
||||
<div className="lp-field">
|
||||
<label htmlFor="f-first">First name *</label>
|
||||
<input type="text" id="f-first" autoComplete="given-name" placeholder="Jane" value={f.first} onChange={set('first')} required />
|
||||
</div>
|
||||
<div className="lp-field">
|
||||
<label htmlFor="f-last">Last name *</label>
|
||||
<input type="text" id="f-last" autoComplete="family-name" placeholder="Smith" value={f.last} onChange={set('last')} required />
|
||||
</div>
|
||||
<div className="lp-field">
|
||||
<label htmlFor="f-company">Company *</label>
|
||||
<input type="text" id="f-company" autoComplete="organization" placeholder="Your operator name" value={f.company} onChange={set('company')} required />
|
||||
</div>
|
||||
<div className="lp-field">
|
||||
<label htmlFor="f-title">Job title *</label>
|
||||
<input type="text" id="f-title" autoComplete="organization-title" placeholder="e.g. CTO, Director Network" value={f.title} onChange={set('title')} required />
|
||||
</div>
|
||||
<div className="lp-field">
|
||||
<label htmlFor="f-email">Business email *</label>
|
||||
<input type="email" id="f-email" autoComplete="email" placeholder="jane@operator.com" value={f.email} onChange={set('email')} required />
|
||||
</div>
|
||||
<div className="lp-field">
|
||||
<label htmlFor="f-region">Region</label>
|
||||
<select id="f-region" value={f.region} onChange={set('region')}>
|
||||
<option value="">Select region</option>
|
||||
{REGIONS.map((r) => <option key={r}>{r}</option>)}
|
||||
</select>
|
||||
</div>
|
||||
<div className="lp-field lp-form-full">
|
||||
<label htmlFor="f-devices">The devices on your network</label>
|
||||
<select id="f-devices" value={f.devices} onChange={set('devices')}>
|
||||
<option value="">Active subscribers (optional)</option>
|
||||
{DEVICE_OPTIONS.map((o) => <option key={o.value} value={o.value}>{o.value}</option>)}
|
||||
<option value={EXACT}>Enter exact number…</option>
|
||||
</select>
|
||||
{f.devices === EXACT && (
|
||||
<input type="text" inputMode="numeric" id="f-subscribers" aria-label="Exact number of active subscribers" placeholder="e.g. 5,000,000" value={f.subscribers} onChange={set('subscribers')} autoFocus />
|
||||
)}
|
||||
<span className="lp-field-hint">Shown on slide 3 of your strategy deck. An exact number is also pre-filled in the ROI calculator.</span>
|
||||
</div>
|
||||
{/* honeypot — hidden from humans */}
|
||||
<div className="lp-hp" aria-hidden="true">
|
||||
<label htmlFor="f-website">Website</label>
|
||||
<input type="text" id="f-website" tabIndex={-1} autoComplete="off" value={f.website} onChange={set('website')} />
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" className="lp-submit" disabled={busy}>
|
||||
{busy ? 'Unlocking your toolkit…' : 'Get Access to the Toolkit'}
|
||||
</button>
|
||||
<p className="lp-privacy">
|
||||
By submitting this form you agree to BlackDice's{' '}
|
||||
<a href="https://www.blackdice.ai/privacy" target="_blank" rel="noreferrer">Privacy Policy</a>. We will
|
||||
not share your details with third parties.
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default function Landing({ onRegister }) {
|
||||
return (
|
||||
<div id="phase-preview">
|
||||
<Hero />
|
||||
<WhatYouGet />
|
||||
<RegistrationForm onRegister={onRegister} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
import { asset } from '../lib/asset.js';
|
||||
|
||||
const Caret = () => (
|
||||
<svg viewBox="0 0 10 6"><path d="M1 1l4 4 4-4" /></svg>
|
||||
);
|
||||
|
||||
const MENUS = [
|
||||
{ label: 'Products', links: [['Mobile SDK', 'mobile-sdk'], ['DNS Protect', 'dns-protect'], ['Halo CPE', 'halo-cpe']] },
|
||||
{ label: 'Solutions', links: [['Financial Services', 'financial-services']] },
|
||||
{
|
||||
label: 'For Operators',
|
||||
links: [['Overview', 'for-operators']],
|
||||
internalLinks: [['ROI Calculator', '#']],
|
||||
},
|
||||
{ label: 'Company', links: [['Why BlackDice', 'why-blackdice'], ['News', 'news'], ['Investors', 'investors']] },
|
||||
];
|
||||
|
||||
export default function Nav() {
|
||||
return (
|
||||
<nav className="site-nav">
|
||||
<div className="nav-inner">
|
||||
<a className="nav-logo" href="https://www.blackdice.ai">
|
||||
<img src={asset('img/logo.png')} alt="BlackDice" />
|
||||
</a>
|
||||
<div className="nav-links">
|
||||
{MENUS.map((m) => (
|
||||
<div className="nav-item" key={m.label}>
|
||||
<button className="nav-link" type="button">
|
||||
{m.label} <Caret />
|
||||
</button>
|
||||
<div className="nav-dropdown">
|
||||
<div className="nav-dropdown-label">{m.label}</div>
|
||||
{m.links.map(([t, slug]) => (
|
||||
<a key={slug} href={`https://www.blackdice.ai/${slug}`}>{t}</a>
|
||||
))}
|
||||
{m.internalLinks?.map(([t, href]) => (
|
||||
<a key={t} href={href}>{t}</a>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
<a className="nav-link" href="https://www.blackdice.ai/news">Blog</a>
|
||||
</div>
|
||||
<div className="nav-right">
|
||||
<a className="nav-cta" href="https://www.blackdice.ai/contact">Get in touch</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
import { useState } from 'react';
|
||||
import DeckViewer from './DeckViewer.jsx';
|
||||
import Calculator from './Calculator.jsx';
|
||||
|
||||
export default function Toolkit({ registrant, onReset }) {
|
||||
const [tab, setTab] = useState('deck');
|
||||
|
||||
return (
|
||||
<div id="phase-access" style={{ display: 'block' }}>
|
||||
<div className="access-welcome">
|
||||
<div className="access-welcome-inner">
|
||||
<div className="access-welcome-icon">
|
||||
<svg viewBox="0 0 24 24"><polyline points="20 6 9 17 4 12" /></svg>
|
||||
</div>
|
||||
<div className="access-welcome-text">
|
||||
<h2>Welcome {registrant.first}. You now have full access to the operator ROI toolkit.</h2>
|
||||
<p>
|
||||
Use the tabs below to view the strategy deck online or calculate your personalised ROI.
|
||||
<button type="button" className="welcome-reset" onClick={onReset}>Not {registrant.first}?</button>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style={{ background: '#f4f8fa', borderBottom: '2px solid #dde8eb' }}>
|
||||
<div className="lp-tabs" role="tablist" style={{ borderBottom: 'none', paddingBottom: 0 }}>
|
||||
<button role="tab" aria-selected={tab === 'deck'} className={`lp-tab${tab === 'deck' ? ' active' : ''}`} onClick={() => setTab('deck')}>
|
||||
<svg viewBox="0 0 24 24"><rect x="2" y="3" width="20" height="14" rx="2" /><line x1="8" y1="21" x2="16" y2="21" /><line x1="12" y1="17" x2="12" y2="21" /></svg>
|
||||
Strategy Deck
|
||||
</button>
|
||||
<button role="tab" aria-selected={tab === 'calc'} className={`lp-tab${tab === 'calc' ? ' active' : ''}`} onClick={() => setTab('calc')}>
|
||||
<svg viewBox="0 0 24 24"><rect x="4" y="2" width="16" height="20" rx="2" /><line x1="8" y1="6" x2="16" y2="6" /><line x1="8" y1="10" x2="16" y2="10" /><line x1="8" y1="14" x2="12" y2="14" /></svg>
|
||||
ROI Calculator
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Both tabs stay mounted so calculator inputs survive tab switches */}
|
||||
<div className={`lp-tab-content${tab === 'deck' ? ' active' : ''}`} style={{ background: '#f4f8fa' }}>
|
||||
<DeckViewer active={tab === 'deck'} registrant={registrant} />
|
||||
</div>
|
||||
<div className={`lp-tab-content${tab === 'calc' ? ' active' : ''}`} style={{ background: '#f4f8fa' }}>
|
||||
<Calculator registrant={registrant} active={tab === 'calc'} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
// ─────────────────────────────────────────────────────────────────────────────
|
||||
// CRM configuration
|
||||
//
|
||||
// Secrets/IDs come from .env (see .env.example). Field names live here so you
|
||||
// can match them to the property / field names in whichever CRM you pick.
|
||||
// Nothing in this file is secret: HubSpot portal IDs, form GUIDs and the
|
||||
// Salesforce Org ID are designed to be public (they're in every embed code).
|
||||
// ─────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
const env = import.meta.env;
|
||||
|
||||
/** One or more of: hubspot, salesforce, webhook (comma-separated). Empty = console only. */
|
||||
export const PROVIDERS = (env.VITE_CRM_PROVIDER || '')
|
||||
.split(',')
|
||||
.map((s) => s.trim().toLowerCase())
|
||||
.filter(Boolean);
|
||||
|
||||
export const LEAD_SOURCE = env.VITE_LEAD_SOURCE || 'Operator ROI Toolkit – Oct 2026 Campaign';
|
||||
|
||||
// ── HubSpot (Forms Submission API — no private key needed) ──────────────────
|
||||
export const HUBSPOT = {
|
||||
portalId: env.VITE_HUBSPOT_PORTAL_ID,
|
||||
formGuid: env.VITE_HUBSPOT_FORM_GUID,
|
||||
// Optional second form for ROI figures; falls back to the registration form.
|
||||
roiFormGuid: env.VITE_HUBSPOT_ROI_FORM_GUID || env.VITE_HUBSPOT_FORM_GUID,
|
||||
// EU-hosted portals: https://api-eu1.hsforms.com
|
||||
apiBase: env.VITE_HUBSPOT_API_BASE || 'https://api.hsforms.com',
|
||||
// Our key → HubSpot internal property name
|
||||
fields: {
|
||||
first: 'firstname',
|
||||
last: 'lastname',
|
||||
email: 'email',
|
||||
company: 'company',
|
||||
title: 'jobtitle',
|
||||
region: 'operator_region', // custom property — create in HubSpot
|
||||
subs: 'subscriber_base_band', // custom property (band derived from the count below)
|
||||
subscribers: 'active_subscribers', // custom property — "The device on your network" count
|
||||
leadSource: 'lead_source_detail', // custom property (optional)
|
||||
utm_source: 'utm_source',
|
||||
utm_medium: 'utm_medium',
|
||||
utm_campaign: 'utm_campaign',
|
||||
utm_term: 'utm_term',
|
||||
utm_content: 'utm_content',
|
||||
},
|
||||
roiFields: {
|
||||
roi_total_low: 'roi_total_low',
|
||||
roi_total_high: 'roi_total_high',
|
||||
roi_bandwidth: 'roi_bandwidth',
|
||||
roi_support_calls: 'roi_support_calls',
|
||||
roi_churn: 'roi_churn',
|
||||
roi_equipment: 'roi_equipment',
|
||||
roi_ddos: 'roi_ddos',
|
||||
roi_subscribers: 'roi_subscribers',
|
||||
roi_arpu: 'roi_arpu',
|
||||
roi_churn_rate: 'roi_churn_rate',
|
||||
roi_pricing_region: 'roi_pricing_region',
|
||||
roi_report_downloaded_at: 'roi_report_downloaded_at',
|
||||
},
|
||||
};
|
||||
|
||||
// ── Salesforce (Web-to-Lead) ────────────────────────────────────────────────
|
||||
export const SALESFORCE = {
|
||||
orgId: env.VITE_SALESFORCE_ORG_ID,
|
||||
endpoint:
|
||||
env.VITE_SALESFORCE_ENDPOINT ||
|
||||
'https://webto.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8',
|
||||
// Web-to-Lead always CREATES a lead, so a second (ROI) post makes a 2nd lead
|
||||
// unless you have duplicate/matching rules. Off by default.
|
||||
sendRoi: String(env.VITE_SALESFORCE_SEND_ROI || 'false') === 'true',
|
||||
fields: {
|
||||
first: 'first_name',
|
||||
last: 'last_name',
|
||||
email: 'email',
|
||||
company: 'company',
|
||||
title: 'title',
|
||||
region: '', // e.g. '00N5g00000XXXXX' (custom field ID) — blank = put in description
|
||||
subs: '', // e.g. '00N5g00000YYYYY'
|
||||
},
|
||||
};
|
||||
|
||||
// ── Generic webhook (Zapier / Make / n8n / Power Automate / your API) ──────
|
||||
export const WEBHOOK = {
|
||||
url: env.VITE_CRM_WEBHOOK_URL,
|
||||
};
|
||||
|
||||
// Max time the user waits on the form before we let them in regardless.
|
||||
export const SUBMIT_TIMEOUT_MS = 6000;
|
||||
@@ -0,0 +1,2 @@
|
||||
// Resolve a file in /public relative to the deployed base path (works in sub-folders too).
|
||||
export const asset = (p) => `${import.meta.env.BASE_URL}${p.replace(/^\//, '')}`;
|
||||
+200
@@ -0,0 +1,200 @@
|
||||
// ROI calculation — ported 1:1 from the original landing page so figures match exactly.
|
||||
|
||||
export const BW_KB = { cautious: 15, expected: 37, optimistic: 80 };
|
||||
export const BLOCKS_PER_SUB_MONTH = 8000;
|
||||
export const DDOS_LOW = 408000;
|
||||
export const DDOS_HIGH = 1200000;
|
||||
|
||||
export const REGIONS = [
|
||||
{ group: 'Africa', options: [{ value: '0.0095', label: 'South Africa (Johannesburg): $0.0095/GB' }] },
|
||||
{
|
||||
group: 'Asia Pacific',
|
||||
options: [
|
||||
{ value: '0.0139', label: 'Philippines (Manila): $0.0139/GB' },
|
||||
{ value: '0.0093', label: 'Indonesia (Jakarta): $0.0093/GB' },
|
||||
{ value: '0.0060', label: 'India (Mumbai): $0.0060/GB' },
|
||||
{ value: '0.0051', label: 'South Korea (Seoul): $0.0051/GB' },
|
||||
{ value: '0.0026', label: 'Taiwan (Taipei): $0.0026/GB' },
|
||||
{ value: '0.0016', label: 'Singapore: $0.0016/GB' },
|
||||
],
|
||||
},
|
||||
{
|
||||
group: 'Europe',
|
||||
options: [
|
||||
{ value: '0.0007', label: 'Netherlands (Amsterdam): $0.0007/GB' },
|
||||
{ value: '0.0010', label: 'Spain (Madrid): $0.0010/GB' },
|
||||
],
|
||||
},
|
||||
{
|
||||
group: 'Latin America',
|
||||
options: [
|
||||
{ value: '0.0031', label: 'Brazil (São Paulo): $0.0031/GB' },
|
||||
{ value: '0.0024', label: 'Mexico (Mexico City): $0.0024/GB' },
|
||||
{ value: '0.0035', label: 'Chile (Santiago): $0.0035/GB' },
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
export function regionLabel(value) {
|
||||
if (value === 'custom') return 'Custom price';
|
||||
for (const g of REGIONS) for (const o of g.options) if (o.value === value) return o.label.split(':')[0];
|
||||
return '';
|
||||
}
|
||||
|
||||
export const DEFAULT_INPUTS = {
|
||||
subs: '',
|
||||
region: '0.0093',
|
||||
customPrice: '',
|
||||
scenario: 'expected',
|
||||
callsPer1000: '18',
|
||||
callCost: '8',
|
||||
securityPct: 25,
|
||||
arpu: '',
|
||||
churn: '',
|
||||
netOpex: '',
|
||||
ddos: '0',
|
||||
ddosSlider: 50,
|
||||
touched: false,
|
||||
};
|
||||
|
||||
const num = (x) => parseFloat(x) || 0;
|
||||
|
||||
export function ddosCostFromSlider(pos) {
|
||||
return DDOS_LOW + (pos / 100) * (DDOS_HIGH - DDOS_LOW);
|
||||
}
|
||||
|
||||
export function calculate(i) {
|
||||
const subs = num(i.subs);
|
||||
const gbPrice = i.region === 'custom' ? num(i.customPrice) : parseFloat(i.region);
|
||||
const callsPer1k = num(i.callsPer1000) || 18;
|
||||
const callCost = num(i.callCost) || 8;
|
||||
const secPct = num(i.securityPct) / 100 || 0.25;
|
||||
const arpu = num(i.arpu);
|
||||
const netOpex = num(i.netOpex);
|
||||
const ddosInc = num(i.ddos);
|
||||
|
||||
// Support calls
|
||||
let callsLo = 0, callsHi = 0;
|
||||
if (subs > 0) {
|
||||
const secCalls = (subs / 1000) * callsPer1k * secPct;
|
||||
callsLo = secCalls * 0.6 * 12 * callCost;
|
||||
callsHi = secCalls * 0.7 * 12 * callCost;
|
||||
}
|
||||
|
||||
// Churn
|
||||
let churnLo = 0, churnHi = 0;
|
||||
if (subs > 0 && arpu > 0) {
|
||||
churnLo = subs * 0.003 * arpu * 12;
|
||||
churnHi = subs * 0.006 * arpu * 12;
|
||||
}
|
||||
|
||||
// Network equipment
|
||||
let equipLo = 0, equipHi = 0;
|
||||
if (netOpex > 0) {
|
||||
equipLo = netOpex * 0.02;
|
||||
equipHi = netOpex * 0.04;
|
||||
}
|
||||
|
||||
// Bandwidth (low = cautious, high = optimistic — same as original page)
|
||||
let bwLo = 0, bwHi = 0;
|
||||
if (subs > 0 && gbPrice > 0) {
|
||||
bwLo = subs * ((BLOCKS_PER_SUB_MONTH * 12 * BW_KB.cautious) / 1e6) * gbPrice;
|
||||
bwHi = subs * ((BLOCKS_PER_SUB_MONTH * 12 * BW_KB.optimistic) / 1e6) * gbPrice;
|
||||
}
|
||||
|
||||
// DDoS
|
||||
let ddosLo = 0, ddosHi = 0;
|
||||
if (ddosInc > 0) {
|
||||
ddosLo = ddosInc * DDOS_LOW;
|
||||
ddosHi = ddosInc * DDOS_HIGH;
|
||||
}
|
||||
|
||||
const totalLo = callsLo + churnLo + equipLo + bwLo + ddosLo;
|
||||
const totalHi = callsHi + churnHi + equipHi + bwHi + ddosHi;
|
||||
const hasData = subs > 0 || arpu > 0 || netOpex > 0 || ddosInc > 0;
|
||||
|
||||
return {
|
||||
bw: { lo: bwLo, hi: bwHi },
|
||||
calls: { lo: callsLo, hi: callsHi },
|
||||
churn: { lo: churnLo, hi: churnHi },
|
||||
equip: { lo: equipLo, hi: equipHi },
|
||||
ddos: { lo: ddosLo, hi: ddosHi },
|
||||
total: { lo: totalLo, hi: totalHi },
|
||||
complete: hasData && totalLo > 0,
|
||||
};
|
||||
}
|
||||
|
||||
// ── Formatting (identical to original) ──
|
||||
export function fmt(n) {
|
||||
if (n === null || n === undefined || isNaN(n) || n === 0) return null;
|
||||
if (n >= 1e9) return '$' + (n / 1e9).toFixed(2) + 'B';
|
||||
if (n >= 1e6) return '$' + (n / 1e6).toFixed(2) + 'M';
|
||||
if (n >= 1e3) return '$' + Math.round(n / 1e3).toLocaleString('en-US') + 'K';
|
||||
return '$' + Math.round(n).toLocaleString('en-US');
|
||||
}
|
||||
|
||||
/** "$1.20M – $2.40M" for the web UI */
|
||||
export function fmtRange(lo, hi, sep = ' – ') {
|
||||
if (!fmt(lo) && !fmt(hi)) return null;
|
||||
if (lo === hi || !hi) return fmt(lo);
|
||||
return fmt(lo) + sep + fmt(hi);
|
||||
}
|
||||
|
||||
// ── Shared with the deck-building code (Calculator + DeckViewer) ──
|
||||
export const INPUTS_KEY = 'bd_toolkit_calc_inputs';
|
||||
|
||||
/**
|
||||
* Loads this visitor's calculator inputs, however the page was reached.
|
||||
* If they haven't entered a subscriber count yet, it is pre-filled from the
|
||||
* "The device on your network" field on the registration form.
|
||||
* `touched` is true once the visitor has changed anything in the calculator.
|
||||
*/
|
||||
export function loadInputs(registrant) {
|
||||
let i = DEFAULT_INPUTS;
|
||||
try {
|
||||
i = { ...DEFAULT_INPUTS, ...JSON.parse(localStorage.getItem(INPUTS_KEY) || '{}') };
|
||||
} catch { /* storage unavailable */ }
|
||||
if (!i.subs && registrant?.subscribers) i = { ...i, subs: registrant.subscribers };
|
||||
return i;
|
||||
}
|
||||
|
||||
/** Value written into the PowerPoint when a category has no data. */
|
||||
export const NOT_INCLUDED = 'Not included';
|
||||
|
||||
/** Deck house style: "$65k", "$3.60m", "$1.20bn" (lower-case, matching the example figures in the deck). */
|
||||
export function fmtDeck(n) {
|
||||
const s = fmt(n);
|
||||
return s && s.replace(/B$/, 'bn').replace(/M$/, 'm').replace(/K$/, 'k');
|
||||
}
|
||||
const pptRange = (r) => {
|
||||
if (!fmt(r.lo) && !fmt(r.hi)) return NOT_INCLUDED;
|
||||
if (r.lo === r.hi || !r.hi) return fmtDeck(r.lo);
|
||||
return `${fmtDeck(r.lo)} to ${fmtDeck(r.hi)}`;
|
||||
};
|
||||
|
||||
/** Subscriber count in the deck's big-number style: 25000000 → "25m", 5500000 → "5.5m", 850000 → "850k". */
|
||||
export function fmtCount(n) {
|
||||
if (!n || n <= 0) return '';
|
||||
const short = (v, unit) => (v >= 100 ? Math.round(v) : parseFloat(v.toFixed(1))) + unit;
|
||||
if (n >= 1e9) return short(n / 1e9, 'bn');
|
||||
if (n >= 1e6) return short(n / 1e6, 'm');
|
||||
if (n >= 1e3) return short(n / 1e3, 'k');
|
||||
return String(Math.round(n));
|
||||
}
|
||||
|
||||
/** Values written into the PowerPoint ROI + device-count slides. */
|
||||
/**
|
||||
* @param registrant optional: if the calculator has no subscriber count, slide 3 falls back
|
||||
* to the "The device on your network" choice from the registration form.
|
||||
*/
|
||||
export function formatForDeck(i, r, registrant) {
|
||||
return {
|
||||
total: pptRange(r.total),
|
||||
bw: pptRange(r.bw),
|
||||
calls: pptRange(r.calls),
|
||||
churn: pptRange(r.churn),
|
||||
equip: pptRange(r.equip),
|
||||
ddos: pptRange(r.ddos),
|
||||
subs: fmtCount(num(i.subs)) || registrant?.deviceLabel || '',
|
||||
};
|
||||
}
|
||||
+171
@@ -0,0 +1,171 @@
|
||||
// Pluggable CRM submission layer.
|
||||
// submitLead(registrant) → called on registration
|
||||
// submitRoi(registrant, roiData) → called when the personalised report is downloaded
|
||||
//
|
||||
// Each provider is enabled via VITE_CRM_PROVIDER (see src/config/crm.config.js).
|
||||
// Failures never block the visitor — they are logged and reported back to the caller.
|
||||
|
||||
import { PROVIDERS, LEAD_SOURCE, HUBSPOT, SALESFORCE, WEBHOOK, SUBMIT_TIMEOUT_MS } from '../config/crm.config.js';
|
||||
|
||||
// ── helpers ─────────────────────────────────────────────────────────────────
|
||||
const UTM_KEYS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'gclid', 'fbclid', 'li_fat_id'];
|
||||
const UTM_STORE = 'bd_toolkit_utm';
|
||||
|
||||
/** Capture UTM/click IDs on first landing so they survive navigation & refresh. */
|
||||
export function captureUtm() {
|
||||
try {
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
const found = {};
|
||||
UTM_KEYS.forEach((k) => params.get(k) && (found[k] = params.get(k)));
|
||||
if (Object.keys(found).length) localStorage.setItem(UTM_STORE, JSON.stringify(found));
|
||||
return Object.keys(found).length ? found : JSON.parse(localStorage.getItem(UTM_STORE) || '{}');
|
||||
} catch {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
function getCookie(name) {
|
||||
const m = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)'));
|
||||
return m ? decodeURIComponent(m[1]) : undefined;
|
||||
}
|
||||
|
||||
function withTimeout(promise, ms) {
|
||||
return Promise.race([
|
||||
promise,
|
||||
new Promise((_, rej) => setTimeout(() => rej(new Error('timeout')), ms)),
|
||||
]);
|
||||
}
|
||||
|
||||
const pageContext = () => ({
|
||||
pageUri: window.location.href,
|
||||
pageName: document.title,
|
||||
referrer: document.referrer || undefined,
|
||||
});
|
||||
|
||||
// ── HubSpot ─────────────────────────────────────────────────────────────────
|
||||
async function hubspotSubmit(formGuid, valuesByOurKey, fieldMap) {
|
||||
if (!HUBSPOT.portalId || !formGuid) throw new Error('HubSpot portal ID / form GUID missing');
|
||||
const fields = Object.entries(valuesByOurKey)
|
||||
.filter(([k, v]) => fieldMap[k] && v !== undefined && v !== null && v !== '')
|
||||
.map(([k, v]) => ({ objectTypeId: '0-1', name: fieldMap[k], value: String(v) }));
|
||||
|
||||
const body = {
|
||||
submittedAt: Date.now(),
|
||||
fields,
|
||||
context: { hutk: getCookie('hubspotutk'), pageUri: pageContext().pageUri, pageName: pageContext().pageName },
|
||||
};
|
||||
const res = await fetch(
|
||||
`${HUBSPOT.apiBase}/submissions/v3/integration/submit/${HUBSPOT.portalId}/${formGuid}`,
|
||||
{ method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body), keepalive: true }
|
||||
);
|
||||
if (!res.ok) throw new Error(`HubSpot ${res.status}: ${await res.text()}`);
|
||||
return true;
|
||||
}
|
||||
|
||||
// ── Salesforce Web-to-Lead ──────────────────────────────────────────────────
|
||||
async function salesforceSubmit(values) {
|
||||
if (!SALESFORCE.orgId) throw new Error('Salesforce Org ID missing');
|
||||
const f = SALESFORCE.fields;
|
||||
const p = new URLSearchParams();
|
||||
p.set('oid', SALESFORCE.orgId);
|
||||
p.set('lead_source', LEAD_SOURCE);
|
||||
['first', 'last', 'email', 'company', 'title', 'region', 'subs'].forEach((k) => {
|
||||
if (f[k] && values[k]) p.set(f[k], values[k]);
|
||||
});
|
||||
if (values.description) p.set('description', values.description);
|
||||
// Web-to-Lead doesn't send CORS headers → opaque (fire-and-forget) request.
|
||||
await fetch(SALESFORCE.endpoint, { method: 'POST', mode: 'no-cors', body: p, keepalive: true });
|
||||
return true;
|
||||
}
|
||||
|
||||
// ── Webhook ─────────────────────────────────────────────────────────────────
|
||||
async function webhookSubmit(payload) {
|
||||
if (!WEBHOOK.url) throw new Error('Webhook URL missing');
|
||||
const res = await fetch(WEBHOOK.url, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(payload),
|
||||
keepalive: true,
|
||||
});
|
||||
if (!res.ok) throw new Error(`Webhook ${res.status}`);
|
||||
return true;
|
||||
}
|
||||
|
||||
async function runAll(tasks) {
|
||||
if (!tasks.length) return { ok: true, results: [] };
|
||||
const settled = await Promise.allSettled(tasks.map(([name, fn]) => withTimeout(fn(), SUBMIT_TIMEOUT_MS).then(() => name)));
|
||||
const results = settled.map((s, i) => ({
|
||||
provider: tasks[i][0],
|
||||
ok: s.status === 'fulfilled',
|
||||
error: s.status === 'rejected' ? String(s.reason?.message || s.reason) : undefined,
|
||||
}));
|
||||
results.filter((r) => !r.ok).forEach((r) => console.error(`[CRM] ${r.provider} failed:`, r.error));
|
||||
return { ok: results.some((r) => r.ok), results };
|
||||
}
|
||||
|
||||
// ── Public API ──────────────────────────────────────────────────────────────
|
||||
export async function submitLead(reg) {
|
||||
const utm = captureUtm();
|
||||
const values = { ...reg, ...utm, leadSource: LEAD_SOURCE };
|
||||
const tasks = [];
|
||||
|
||||
if (PROVIDERS.length === 0) console.info('[CRM] No provider configured — lead captured locally only:', values);
|
||||
|
||||
if (PROVIDERS.includes('hubspot')) tasks.push(['hubspot', () => hubspotSubmit(HUBSPOT.formGuid, values, HUBSPOT.fields)]);
|
||||
|
||||
if (PROVIDERS.includes('salesforce')) {
|
||||
const desc = [
|
||||
`Source: ${LEAD_SOURCE}`,
|
||||
!SALESFORCE.fields.region && reg.region ? `Region: ${reg.region}` : '',
|
||||
!SALESFORCE.fields.subs && reg.subs ? `Subscriber base: ${reg.subs}` : '',
|
||||
reg.subscribers ? `Devices on network (active subscribers): ${Number(reg.subscribers).toLocaleString('en-US')}` : '',
|
||||
Object.entries(utm).map(([k, v]) => `${k}: ${v}`).join('\n'),
|
||||
].filter(Boolean).join('\n');
|
||||
tasks.push(['salesforce', () => salesforceSubmit({ ...values, description: desc })]);
|
||||
}
|
||||
|
||||
if (PROVIDERS.includes('webhook'))
|
||||
tasks.push(['webhook', () => webhookSubmit({ event: 'toolkit_registration', submittedAt: new Date().toISOString(), lead: reg, utm, leadSource: LEAD_SOURCE, ...pageContext() })]);
|
||||
|
||||
return runAll(tasks);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param reg registrant object (first, last, email, …)
|
||||
* @param roi { inputs, results, formatted } from the calculator
|
||||
*/
|
||||
export async function submitRoi(reg, roi) {
|
||||
if (!reg?.email) return { ok: false, results: [] };
|
||||
const { inputs, results, formatted } = roi;
|
||||
const flat = {
|
||||
email: reg.email,
|
||||
roi_total_low: Math.round(results.total.lo),
|
||||
roi_total_high: Math.round(results.total.hi),
|
||||
roi_bandwidth: formatted.bw,
|
||||
roi_support_calls: formatted.calls,
|
||||
roi_churn: formatted.churn,
|
||||
roi_equipment: formatted.equip,
|
||||
roi_ddos: formatted.ddos,
|
||||
roi_subscribers: inputs.subs,
|
||||
roi_arpu: inputs.arpu,
|
||||
roi_churn_rate: inputs.churn,
|
||||
roi_pricing_region: inputs.regionLabel,
|
||||
roi_report_downloaded_at: new Date().toISOString(),
|
||||
};
|
||||
const tasks = [];
|
||||
|
||||
if (PROVIDERS.length === 0) console.info('[CRM] No provider configured — ROI data:', flat);
|
||||
|
||||
if (PROVIDERS.includes('hubspot'))
|
||||
tasks.push(['hubspot', () => hubspotSubmit(HUBSPOT.roiFormGuid, flat, { email: 'email', ...HUBSPOT.roiFields })]);
|
||||
|
||||
if (PROVIDERS.includes('salesforce') && SALESFORCE.sendRoi) {
|
||||
const desc = `ROI report downloaded\nTotal: ${formatted.total}\nBandwidth: ${formatted.bw}\nSupport calls: ${formatted.calls}\nChurn: ${formatted.churn}\nEquipment: ${formatted.equip}\nDDoS: ${formatted.ddos}\nSubscribers: ${inputs.subs} ARPU: ${inputs.arpu} Churn: ${inputs.churn}%`;
|
||||
tasks.push(['salesforce', () => salesforceSubmit({ ...reg, description: desc })]);
|
||||
}
|
||||
|
||||
if (PROVIDERS.includes('webhook'))
|
||||
tasks.push(['webhook', () => webhookSubmit({ event: 'roi_report_downloaded', submittedAt: new Date().toISOString(), lead: reg, roi: { inputs, results, formatted }, ...pageContext() })]);
|
||||
|
||||
return runAll(tasks);
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
// Builds the personalised ROI deck entirely in the browser:
|
||||
// fetch template .pptx → patch the ROI slide XML → zip → download.
|
||||
//
|
||||
// The template is the launch deck (V4). Its ROI slide carries EXAMPLE figures,
|
||||
// so the unmodified file doubles as the "example" deck for visitors who haven't
|
||||
// used the calculator yet (see getExampleDeck).
|
||||
|
||||
// JSZip is loaded on demand so it doesn't weigh down the first page load.
|
||||
import { personaliseDeviceSlideXml, personaliseSlideXml } from './slideXml.js';
|
||||
|
||||
export const DECK_URL = `${import.meta.env.BASE_URL}deck/BlackDice_Strategy_Deck.pptx`;
|
||||
// The ROI slide ("Total estimate annual savings") — slide 12 in the V4 deck.
|
||||
const ROI_SLIDE = import.meta.env.VITE_ROI_SLIDE_PATH || 'ppt/slides/slide12.xml';
|
||||
// The stats slide ("Your customers are in the crosshairs") — slide 3: active subscribers go in the "DeviceCount" box.
|
||||
const DEVICE_SLIDE = import.meta.env.VITE_DEVICE_SLIDE_PATH || 'ppt/slides/slide3.xml';
|
||||
const PPTX_MIME = 'application/vnd.openxmlformats-officedocument.presentationml.presentation';
|
||||
|
||||
let templatePromise = null;
|
||||
|
||||
/** Start downloading the template early (e.g. when the calculator tab opens). */
|
||||
export function prefetchTemplate() {
|
||||
if (!templatePromise) {
|
||||
templatePromise = fetch(DECK_URL).then((r) => {
|
||||
if (!r.ok) throw new Error(`Could not load deck template (${r.status})`);
|
||||
return r.arrayBuffer();
|
||||
});
|
||||
templatePromise.catch(() => (templatePromise = null)); // allow retry
|
||||
}
|
||||
return templatePromise;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {object} values { total, bw, calls, churn, equip, ddos, subs } — display strings
|
||||
* @param {object} meta { company, date }
|
||||
* @param {object} [opts] { roi: false } → leave slide 12's example figures alone and only
|
||||
* personalise slide 3 (used before the visitor has run the calculator)
|
||||
* @returns {Promise<Blob>}
|
||||
*/
|
||||
export async function buildPersonalisedDeck(values, meta = {}, { roi = true } = {}) {
|
||||
const buf = await prefetchTemplate();
|
||||
const { default: JSZip } = await import('jszip');
|
||||
const zip = await JSZip.loadAsync(buf);
|
||||
|
||||
if (roi) {
|
||||
const file = zip.file(ROI_SLIDE);
|
||||
if (!file) throw new Error(`ROI slide not found in template (${ROI_SLIDE})`);
|
||||
const xml = await file.async('string');
|
||||
|
||||
// Keep the subtitle on one line: cap very long company names.
|
||||
const co = meta.company && meta.company.length > 40 ? meta.company.slice(0, 39).trim() + '…' : meta.company;
|
||||
const prefix = co ? `Prepared for ${co} · ` : '';
|
||||
const { xml: patched, replaced } = personaliseSlideXml(xml, values, prefix);
|
||||
if (replaced === 0) throw new Error('ROI value boxes (TextBox 4, 10–14) not found on the ROI slide');
|
||||
zip.file(ROI_SLIDE, patched);
|
||||
}
|
||||
|
||||
// Slide 3: the operator's active subscribers above "The device on your network".
|
||||
const deviceFile = zip.file(DEVICE_SLIDE);
|
||||
if (deviceFile) {
|
||||
const dxml = await deviceFile.async('string');
|
||||
const { xml: dpatched, replaced: dreplaced } = personaliseDeviceSlideXml(dxml, values.subs);
|
||||
if (dreplaced) zip.file(DEVICE_SLIDE, dpatched);
|
||||
}
|
||||
|
||||
// Stamp document properties so the file is identifiable in the recipient's Files/SharePoint.
|
||||
const core = zip.file('docProps/core.xml');
|
||||
if (core && meta.company) {
|
||||
const esc = (s) => s.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
||||
let c = await core.async('string');
|
||||
const title = esc(`Network Protection ROI – ${meta.company}`);
|
||||
c = /<dc:title>.*?<\/dc:title>/s.test(c)
|
||||
? c.replace(/<dc:title>.*?<\/dc:title>/s, `<dc:title>${title}</dc:title>`)
|
||||
: c.replace('</cp:coreProperties>', `<dc:title>${title}</dc:title></cp:coreProperties>`);
|
||||
zip.file('docProps/core.xml', c);
|
||||
}
|
||||
|
||||
return zip.generateAsync({ type: 'blob', mimeType: PPTX_MIME, compression: 'DEFLATE' });
|
||||
}
|
||||
|
||||
/** The deck exactly as published, with the example figures on the ROI slide. */
|
||||
export async function getExampleDeck() {
|
||||
const buf = await prefetchTemplate();
|
||||
return new Blob([buf], { type: PPTX_MIME });
|
||||
}
|
||||
|
||||
export function triggerDownload(blob, filename) {
|
||||
const url = URL.createObjectURL(blob);
|
||||
const a = document.createElement('a');
|
||||
a.href = url;
|
||||
a.download = filename;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
a.remove();
|
||||
setTimeout(() => URL.revokeObjectURL(url), 10000);
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
// Pure string-level edits to the deck XML (no DOM needed → testable in Node).
|
||||
//
|
||||
// ROI slide (slide 12): each result box is a named text box with two lines —
|
||||
// a label ("1. Bandwidth savings") and a value. The launch deck (V4) ships with
|
||||
// EXAMPLE values in those boxes (e.g. "$65k to $365k"); older decks used a
|
||||
// "$XX to $XX" placeholder. Either way we overwrite the value line (the last
|
||||
// text run in the box), so the plain deck shows the example and the
|
||||
// personalised deck shows the operator's own figures.
|
||||
|
||||
export const PLACEHOLDER = '$XX to $XX';
|
||||
|
||||
// Slide 3 ("Your customers are in the crosshairs") — third column. A big-number
|
||||
// box named "DeviceCount" sits above "The device on your network" and shows the
|
||||
// operator's active subscribers (example "25m" in the published deck).
|
||||
export const DEVICE_COUNT_SHAPE = 'DeviceCount';
|
||||
|
||||
// Shape name in PowerPoint (Home → Arrange → Selection Pane) → result key
|
||||
export const SHAPE_MAP = [
|
||||
['TextBox 4', 'total'],
|
||||
['TextBox 10', 'bw'],
|
||||
['TextBox 11', 'calls'],
|
||||
['TextBox 12', 'churn'],
|
||||
['TextBox 13', 'equip'],
|
||||
['TextBox 14', 'ddos'],
|
||||
];
|
||||
const SUBTITLE_SHAPE = 'TextBox 5';
|
||||
|
||||
export const escapeXml = (s) =>
|
||||
String(s).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, ''');
|
||||
const unescapeXml = (s) =>
|
||||
s.replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, "'").replace(/&/g, '&');
|
||||
|
||||
const PH_TAG = `<a:t>${escapeXml(PLACEHOLDER)}</a:t>`;
|
||||
const RUN_RE = /<a:t>([^<]*)<\/a:t>/g;
|
||||
|
||||
/** Return [start, end) of the <p:sp> element whose cNvPr name matches exactly. */
|
||||
function findShape(xml, name) {
|
||||
const marker = `name="${escapeXml(name)}"`;
|
||||
const at = xml.indexOf(marker);
|
||||
if (at < 0) return null;
|
||||
const start = xml.lastIndexOf('<p:sp>', at);
|
||||
const end = xml.indexOf('</p:sp>', at);
|
||||
if (start < 0 || end < 0) return null;
|
||||
return [start, end + '</p:sp>'.length];
|
||||
}
|
||||
|
||||
/** Replace the text of the LAST run in a shape segment (the value line). */
|
||||
function replaceLastRun(seg, text) {
|
||||
const runs = [...seg.matchAll(RUN_RE)];
|
||||
if (runs.length < 2) return null; // need label + value
|
||||
const last = runs[runs.length - 1];
|
||||
return seg.slice(0, last.index) + `<a:t>${escapeXml(text)}</a:t>` + seg.slice(last.index + last[0].length);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} xml slide XML
|
||||
* @param {object} values { total, bw, calls, churn, equip, ddos } — display strings
|
||||
* @param {string} [subtitlePrefix] optional text prepended to the slide subtitle
|
||||
* @returns {{xml: string, replaced: number}}
|
||||
*/
|
||||
export function personaliseSlideXml(xml, values, subtitlePrefix) {
|
||||
let out = xml;
|
||||
let replaced = 0;
|
||||
const used = new Set();
|
||||
|
||||
// 1) by shape name — overwrite the value line (example figures or placeholder)
|
||||
for (const [shape, key] of SHAPE_MAP) {
|
||||
const r = findShape(out, shape);
|
||||
if (!r) continue;
|
||||
const next = replaceLastRun(out.slice(r[0], r[1]), values[key]);
|
||||
if (next === null) continue;
|
||||
out = out.slice(0, r[0]) + next + out.slice(r[1]);
|
||||
replaced++;
|
||||
used.add(key);
|
||||
}
|
||||
|
||||
// 2) fallback for renamed boxes in an older placeholder deck: fill any
|
||||
// remaining "$XX to $XX" in document order.
|
||||
if (out.includes(PH_TAG)) {
|
||||
const order = SHAPE_MAP.map(([, k]) => k).filter((k) => !used.has(k));
|
||||
let i = 0;
|
||||
out = out.split(PH_TAG).reduce((acc, part, idx) => {
|
||||
if (idx === 0) return part;
|
||||
const key = order[i++];
|
||||
replaced++;
|
||||
return acc + `<a:t>${escapeXml(key ? values[key] : '—')}</a:t>` + part;
|
||||
});
|
||||
}
|
||||
|
||||
// 3) Subtitle: drop the leading "Example" and add "Prepared for …".
|
||||
// PowerPoint often splits a line into several runs ("E" + "xample e" + …),
|
||||
// so we rebuild it into the first run and empty the rest.
|
||||
const r = findShape(out, SUBTITLE_SHAPE);
|
||||
if (r) {
|
||||
const seg = out.slice(r[0], r[1]);
|
||||
const runs = [...seg.matchAll(RUN_RE)];
|
||||
if (runs.length) {
|
||||
let text = unescapeXml(runs.map((m) => m[1]).join(''));
|
||||
text = text.replace(/^\s*example\s+/i, '');
|
||||
text = text.charAt(0).toUpperCase() + text.slice(1);
|
||||
text = (subtitlePrefix || '') + text;
|
||||
let n = 0;
|
||||
const next = seg.replace(RUN_RE, () => (n++ === 0 ? `<a:t>${escapeXml(text)}</a:t>` : '<a:t></a:t>'));
|
||||
out = out.slice(0, r[0]) + next + out.slice(r[1]);
|
||||
}
|
||||
}
|
||||
|
||||
return { xml: out, replaced };
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the active-subscriber figure into the "DeviceCount" box on slide 3.
|
||||
* @param {string} xml slide XML
|
||||
* @param {string} deviceCount display string, e.g. "5m" ("" leaves the box blank)
|
||||
* @returns {{xml: string, replaced: number}}
|
||||
*/
|
||||
export function personaliseDeviceSlideXml(xml, deviceCount) {
|
||||
const r = findShape(xml, DEVICE_COUNT_SHAPE);
|
||||
if (!r) return { xml, replaced: 0 };
|
||||
const seg = xml.slice(r[0], r[1]);
|
||||
const runs = [...seg.matchAll(RUN_RE)];
|
||||
if (!runs.length) return { xml, replaced: 0 };
|
||||
const last = runs[runs.length - 1];
|
||||
let next = seg.slice(0, last.index) + `<a:t>${escapeXml(deviceCount)}</a:t>` + seg.slice(last.index + last[0].length);
|
||||
// Ranges from the form dropdown ("10m–50m") are wider than a single figure: drop from
|
||||
// 44pt to 36pt so they stay on one line in the column.
|
||||
if (String(deviceCount).length > 6) next = next.replace(/sz="4400"/, 'sz="3600"');
|
||||
return { xml: xml.slice(0, r[0]) + next + xml.slice(r[1]), replaced: 1 };
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import { StrictMode } from 'react';
|
||||
import { createRoot } from 'react-dom/client';
|
||||
import './styles.css';
|
||||
import App from './App.jsx';
|
||||
|
||||
createRoot(document.getElementById('root')).render(
|
||||
<StrictMode>
|
||||
<App />
|
||||
</StrictMode>
|
||||
);
|
||||
+580
@@ -0,0 +1,580 @@
|
||||
/* Ported verbatim from BlackDice_Campaign_Landing_Page.html */
|
||||
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
||||
:root {
|
||||
--teal: #013B49;
|
||||
--teal2: #0E4F63;
|
||||
--teal3: #1A6070;
|
||||
--green: #35B888;
|
||||
--green2: #2A9A70;
|
||||
--lgrey: #B0C8CE;
|
||||
--mgrey: #6B9BA8;
|
||||
--white: #FFFFFF;
|
||||
--offwhite: #F4F8F9;
|
||||
--text: #0E2841;
|
||||
}
|
||||
body { font-family: 'Ubuntu', sans-serif; background: var(--offwhite); color: var(--text); min-height: 100vh; }
|
||||
|
||||
/* ─── NAV ─── */
|
||||
.site-nav { background: var(--teal); position: relative; z-index: 100; border-bottom: 1px solid rgba(176,200,206,0.12); }
|
||||
.nav-inner { max-width: 1200px; margin: 0 auto; padding: 0 48px; display: flex; align-items: center; height: 64px; gap: 0; }
|
||||
.nav-logo { flex-shrink: 0; margin-right: 40px; }
|
||||
.nav-logo img { height: 35px; width: auto; display: block; }
|
||||
.nav-links { display: flex; align-items: center; gap: 4px; flex: 1; }
|
||||
.nav-item { position: relative; }
|
||||
.nav-link { display: flex; align-items: center; gap: 4px; padding: 8px 14px; font-size: 13px; font-weight: 500; color: var(--lgrey); text-decoration: none; border-radius: 6px; transition: color 0.2s, background 0.2s; white-space: nowrap; font-family: 'Ubuntu', sans-serif; cursor: pointer; background: none; border: none; }
|
||||
.nav-link:hover, .nav-item:hover > .nav-link { color: var(--white); background: rgba(255,255,255,0.07); }
|
||||
.nav-link svg { width: 10px; height: 10px; fill: currentColor; transition: transform 0.2s; }
|
||||
.nav-item:hover > .nav-link svg { transform: rotate(180deg); }
|
||||
.nav-dropdown { position: absolute; top: calc(100% + 6px); left: 0; background: var(--teal2); border: 1px solid rgba(176,200,206,0.15); border-radius: 10px; padding: 8px; min-width: 200px; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity 0.2s, transform 0.2s, visibility 0.2s; box-shadow: 0 12px 40px rgba(0,0,0,0.3); z-index: 200; }
|
||||
.nav-item:hover .nav-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
|
||||
.nav-dropdown a { display: block; padding: 9px 14px; font-size: 13px; color: var(--lgrey); text-decoration: none; border-radius: 6px; transition: color 0.2s, background 0.2s; font-family: 'Ubuntu', sans-serif; }
|
||||
.nav-dropdown a:hover { color: var(--white); background: rgba(255,255,255,0.08); }
|
||||
.nav-dropdown-label { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mgrey); padding: 4px 14px 6px; }
|
||||
.nav-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
|
||||
.nav-cta { background: var(--green); color: var(--teal); font-family: 'Ubuntu', sans-serif; font-size: 12px; font-weight: 700; padding: 8px 18px; border-radius: 6px; text-decoration: none; transition: background 0.2s; white-space: nowrap; }
|
||||
.nav-cta:hover { background: #2eaa7a; }
|
||||
|
||||
/* ─── HERO ─── */
|
||||
.hero { background: linear-gradient(135deg, var(--teal) 0%, var(--teal2) 60%, var(--teal3) 100%); position: relative; overflow: hidden; padding: 0; }
|
||||
.hero-hex {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 0;
|
||||
transform: translateY(-50%);
|
||||
width: 50%;
|
||||
height: auto;
|
||||
opacity: 0.38;
|
||||
pointer-events: none;
|
||||
z-index: 0;
|
||||
}
|
||||
.hero-inner { max-width: 620px; }
|
||||
.hero-container { max-width: 1200px; margin: 0 auto; padding: 56px 48px 48px; position: relative; z-index: 1; }
|
||||
.hero-badge { display: inline-block; background: rgba(53,184,136,0.18); border: 1px solid rgba(53,184,136,0.4); color: var(--green); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; padding: 5px 14px; border-radius: 20px; margin-bottom: 18px; }
|
||||
.hero h1 { font-size: clamp(24px, 3.5vw, 38px); font-weight: 700; color: var(--white); line-height: 1.2; margin-bottom: 14px; }
|
||||
.hero h1 span { color: var(--green); }
|
||||
.hero p { font-size: 15px; font-weight: 300; color: var(--lgrey); line-height: 1.7; max-width: 560px; }
|
||||
|
||||
/* ─── SAVINGS RANKED NOTE ─── */
|
||||
.rank-bar { background: var(--teal2); border-top: 1px solid rgba(176,200,206,0.12); }
|
||||
.rank-bar-inner { max-width: 1200px; margin: 0 auto; padding: 10px 48px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
|
||||
.rank-label { font-size: 11px; font-weight: 600; color: var(--mgrey); text-transform: uppercase; letter-spacing: 0.08em; margin-right: 8px; }
|
||||
.rank-item { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--lgrey); padding: 3px 10px; border-radius: 20px; background: rgba(255,255,255,0.05); }
|
||||
.rank-item .num { font-size: 10px; font-weight: 700; background: var(--green); color: var(--teal); width: 16px; height: 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
|
||||
.rank-sep { color: rgba(176,200,206,0.3); font-size: 11px; }
|
||||
|
||||
/* ─── MAIN ─── */
|
||||
.main { max-width: 1200px; margin: 0 auto; padding: 40px 48px 64px; display: grid; grid-template-columns: 1fr 400px; gap: 32px; align-items: start; }
|
||||
|
||||
/* ─── CARDS ─── */
|
||||
.input-col { display: flex; flex-direction: column; gap: 20px; }
|
||||
.card { background: var(--white); border-radius: 12px; padding: 26px 30px; border: 1px solid #dce8ec; box-shadow: 0 2px 12px rgba(1,59,73,0.06); }
|
||||
.card.highlight { border-color: rgba(53,184,136,0.4); box-shadow: 0 2px 12px rgba(1,59,73,0.06), 0 0 0 1px rgba(53,184,136,0.15); }
|
||||
.card-header { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; padding-bottom: 16px; border-bottom: 1px solid #eaf0f2; }
|
||||
.card-icon { width: 38px; height: 38px; border-radius: 9px; background: linear-gradient(135deg, var(--teal), var(--teal3)); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
|
||||
.card-icon.green { background: linear-gradient(135deg, var(--green2), var(--green)); }
|
||||
.card-icon svg { width: 18px; height: 18px; stroke: var(--white); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
|
||||
.card-num { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--green); margin-bottom: 2px; }
|
||||
.card-title { font-size: 15px; font-weight: 700; color: var(--teal); }
|
||||
.card-subtitle { font-size: 12px; color: var(--mgrey); margin-top: 2px; }
|
||||
.biggest-tag { display: inline-block; font-size: 10px; font-weight: 700; background: rgba(53,184,136,0.12); color: var(--green); padding: 2px 8px; border-radius: 10px; margin-left: 8px; vertical-align: middle; text-transform: uppercase; letter-spacing: 0.06em; }
|
||||
|
||||
/* Fields */
|
||||
.field-group { margin-bottom: 18px; }
|
||||
.field-group:last-child { margin-bottom: 0; }
|
||||
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
|
||||
label { display: block; font-size: 12px; font-weight: 600; color: var(--teal); margin-bottom: 7px; letter-spacing: 0.02em; }
|
||||
.field-hint { font-size: 11px; color: var(--mgrey); margin-top: 5px; font-weight: 300; line-height: 1.5; }
|
||||
.input-wrap { position: relative; display: flex; align-items: center; }
|
||||
.input-prefix { position: absolute; left: 12px; font-size: 13px; font-weight: 500; color: var(--mgrey); pointer-events: none; }
|
||||
.input-suffix { position: absolute; right: 12px; font-size: 12px; font-weight: 500; color: var(--mgrey); pointer-events: none; }
|
||||
input[type=number], select { width: 100%; padding: 11px 13px; border: 1.5px solid #c8dde3; border-radius: 8px; font-family: 'Ubuntu', sans-serif; font-size: 14px; color: var(--text); background: #f9fcfd; outline: none; transition: border-color 0.2s, box-shadow 0.2s; -moz-appearance: textfield; appearance: none; }
|
||||
input[type=number]::-webkit-outer-spin-button, input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; }
|
||||
input[type=number]:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(53,184,136,0.15); background: var(--white); }
|
||||
.has-prefix input { padding-left: 28px; }
|
||||
.has-suffix input { padding-right: 38px; }
|
||||
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B9BA8' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; cursor: pointer; }
|
||||
|
||||
/* Slider */
|
||||
.slider-val { font-size: 13px; font-weight: 700; color: var(--teal); text-align: right; margin-bottom: 7px; }
|
||||
input[type=range] { -webkit-appearance: none; width: 100%; height: 4px; background: linear-gradient(to right, var(--green) 0%, var(--green) var(--pct,50%), #c8dde3 var(--pct,50%)); border-radius: 4px; outline: none; cursor: pointer; border: none; padding: 0; box-shadow: none; }
|
||||
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 17px; height: 17px; border-radius: 50%; background: var(--teal); border: 3px solid var(--white); box-shadow: 0 1px 5px rgba(1,59,73,0.3); cursor: pointer; }
|
||||
.slider-labels { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--mgrey); margin-top: 5px; }
|
||||
|
||||
/* Optional note */
|
||||
.opt-note { background: #f0f8f4; border: 1px solid rgba(53,184,136,0.25); border-radius: 8px; padding: 11px 14px; font-size: 11.5px; color: var(--teal2); line-height: 1.6; margin-bottom: 18px; }
|
||||
.opt-note strong { color: var(--teal); }
|
||||
|
||||
/* Scenario tabs */
|
||||
.scenario-tabs { display: flex; gap: 6px; margin-bottom: 18px; }
|
||||
.scenario-tab { flex: 1; padding: 8px 4px; text-align: center; font-size: 12px; font-weight: 600; border: 1.5px solid #c8dde3; border-radius: 8px; cursor: pointer; transition: all 0.2s; color: var(--mgrey); background: var(--white); font-family: 'Ubuntu', sans-serif; }
|
||||
.scenario-tab.active { background: var(--teal); border-color: var(--teal); color: var(--white); }
|
||||
|
||||
/* ─── RESULTS ─── */
|
||||
.results-col { position: sticky; top: 24px; }
|
||||
.results-card { background: var(--teal); border-radius: 14px; overflow: hidden; box-shadow: 0 8px 40px rgba(1,59,73,0.25); }
|
||||
.results-header { background: linear-gradient(135deg, var(--teal2), var(--teal3)); padding: 22px 26px 20px; border-bottom: 1px solid rgba(176,200,206,0.12); position: relative; overflow: hidden; }
|
||||
.results-header-hex { position: absolute; top: -20%; right: -10%; width: 55%; height: 160%; /* background image set inline in Results.jsx */ background-size: 80%; background-repeat: no-repeat; background-position: top right; opacity: 0.25; pointer-events: none; }
|
||||
.results-header h2 { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--lgrey); margin-bottom: 3px; position: relative; z-index: 1; }
|
||||
.results-header p { font-size: 11px; color: rgba(176,200,206,0.6); position: relative; z-index: 1; }
|
||||
|
||||
.results-body { padding: 20px 26px; }
|
||||
|
||||
/* Total */
|
||||
.total-block { text-align: center; padding: 22px 0 18px; border-bottom: 1px solid rgba(176,200,206,0.12); margin-bottom: 16px; }
|
||||
.total-label { font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--lgrey); margin-bottom: 6px; }
|
||||
.total-amount { font-size: clamp(20px, 2.8vw, 30px); font-weight: 700; color: var(--green); line-height: 1.1; letter-spacing: -0.5px; }
|
||||
.total-sep { color: rgba(176,200,206,0.35); margin: 0 8px; }
|
||||
.total-sub { font-size: 12px; color: var(--mgrey); margin-top: 5px; }
|
||||
|
||||
/* Breakdown */
|
||||
.breakdown { display: flex; flex-direction: column; gap: 8px; }
|
||||
.brow { background: rgba(255,255,255,0.05); border: 1px solid rgba(176,200,206,0.1); border-radius: 10px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
|
||||
.brow-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
|
||||
.dot-green { background: var(--green); }
|
||||
.dot-teal { background: #4EA7C4; }
|
||||
.dot-blue { background: var(--lgrey); }
|
||||
.dot-grey { background: var(--mgrey); }
|
||||
.dot-orange { background: #E97132; }
|
||||
.brow-info { flex: 1; min-width: 0; }
|
||||
.brow-name { font-size: 11.5px; color: var(--lgrey); margin-bottom: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
||||
.brow-val { font-size: 13.5px; font-weight: 700; color: var(--white); }
|
||||
.brow-val.muted { color: var(--mgrey); font-size: 11.5px; font-weight: 400; font-style: italic; }
|
||||
.assump-list.vis { display: block; }
|
||||
.assump-list a { color: rgba(53,184,136,0.7); }
|
||||
|
||||
/* Disclaimer */
|
||||
.disclaimer { max-width: 1200px; margin: 0 auto; padding: 0 48px 48px; font-size: 11px; color: #8aabb3; line-height: 1.7; }
|
||||
.disclaimer strong { color: var(--mgrey); }
|
||||
|
||||
/* Footer */
|
||||
.site-footer { background: var(--teal); padding: 22px 48px; text-align: center; font-size: 12px; color: rgba(176,200,206,0.5); }
|
||||
.site-footer a { color: var(--green); text-decoration: none; }
|
||||
|
||||
@media (max-width: 960px) {
|
||||
.main { grid-template-columns: 1fr; padding: 28px 24px 48px; }
|
||||
.results-col { position: static; }
|
||||
.hero, .rank-bar-inner, .disclaimer, .site-footer, .nav-inner { padding-left: 24px; padding-right: 24px; }
|
||||
.hero-container { padding-left: 24px; padding-right: 24px; padding-top: 40px; padding-bottom: 36px; }
|
||||
.field-row { grid-template-columns: 1fr; }
|
||||
}
|
||||
|
||||
|
||||
/* ═══════════════════════════════════════
|
||||
LANDING PAGE STYLES
|
||||
═══════════════════════════════════════ */
|
||||
#phase-preview { display: block; }
|
||||
#phase-access { display: none; }
|
||||
|
||||
/* HERO */
|
||||
.lp-hero {
|
||||
background: linear-gradient(135deg, var(--teal) 0%, var(--teal2) 60%, var(--teal3) 100%);
|
||||
position: relative; overflow: hidden; padding: 0;
|
||||
}
|
||||
.lp-hero-hex {
|
||||
position: absolute; top: 50%; left: 0;
|
||||
transform: translateY(-50%);
|
||||
width: 50%; height: auto;
|
||||
opacity: 0.38; pointer-events: none; z-index: 0;
|
||||
}
|
||||
.lp-hero-inner {
|
||||
max-width: 1200px; margin: 0 auto;
|
||||
padding: 72px 48px 64px;
|
||||
position: relative; z-index: 1;
|
||||
}
|
||||
.lp-hero-badge {
|
||||
display: inline-block;
|
||||
background: rgba(53,184,136,0.18);
|
||||
border: 1px solid rgba(53,184,136,0.4);
|
||||
color: var(--green);
|
||||
font-size: 0.72rem; font-weight: 700;
|
||||
letter-spacing: 0.1em; text-transform: uppercase;
|
||||
padding: 5px 12px; border-radius: 4px; margin-bottom: 20px;
|
||||
}
|
||||
.lp-hero h1 {
|
||||
font-size: clamp(1.9rem, 3.2vw, 2.8rem);
|
||||
font-weight: 700; color: var(--white);
|
||||
line-height: 1.15; margin-bottom: 20px; max-width: 700px;
|
||||
}
|
||||
.lp-hero h1 span { color: var(--green); }
|
||||
.lp-hero-sub {
|
||||
font-size: 1rem; color: var(--lgrey);
|
||||
line-height: 1.65; max-width: 580px; margin-bottom: 36px;
|
||||
}
|
||||
.lp-hero-proof { display: flex; gap: 40px; flex-wrap: wrap; }
|
||||
.lp-proof-item { display: flex; flex-direction: column; gap: 3px; }
|
||||
.lp-proof-num { font-size: 1.6rem; font-weight: 700; color: var(--green); }
|
||||
.lp-proof-label { font-size: 0.72rem; color: var(--lgrey); text-transform: uppercase; letter-spacing: 0.05em; }
|
||||
|
||||
/* WHAT YOU GET */
|
||||
.lp-what {
|
||||
background: #f8fafb;
|
||||
border-top: 1px solid #e2ecef;
|
||||
padding: 56px 0;
|
||||
}
|
||||
.lp-what-inner { max-width: 1200px; margin: 0 auto; padding: 0 48px; }
|
||||
.lp-section-label {
|
||||
text-align: center; font-size: 0.72rem; font-weight: 700;
|
||||
letter-spacing: 0.12em; text-transform: uppercase;
|
||||
color: var(--green); margin-bottom: 12px;
|
||||
}
|
||||
.lp-section-title {
|
||||
text-align: center; font-size: 1.7rem; font-weight: 700;
|
||||
color: var(--teal); margin-bottom: 8px;
|
||||
}
|
||||
.lp-section-sub {
|
||||
text-align: center; font-size: 0.96rem; color: #556; margin-bottom: 48px;
|
||||
}
|
||||
.lp-assets { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
|
||||
.lp-asset-card {
|
||||
background: white; border: 1px solid #dde8eb;
|
||||
border-radius: 12px; overflow: hidden;
|
||||
box-shadow: 0 2px 12px rgba(1,59,73,0.06);
|
||||
}
|
||||
.lp-asset-preview {
|
||||
background: var(--teal); padding: 24px 24px 0;
|
||||
min-height: 210px; overflow: hidden;
|
||||
}
|
||||
.lp-asset-preview-calc {
|
||||
background: #f4f9fb; padding: 20px 20px 0;
|
||||
min-height: 210px; border-bottom: 1px solid #dde8eb;
|
||||
}
|
||||
.lp-slide-thumb {
|
||||
border-radius: 4px 4px 0 0; width: 100%;
|
||||
display: block; box-shadow: 0 4px 16px rgba(0,0,0,0.3);
|
||||
}
|
||||
.calc-mock {
|
||||
background: white; border-radius: 8px 8px 0 0;
|
||||
padding: 16px; box-shadow: 0 4px 16px rgba(0,0,0,0.1);
|
||||
}
|
||||
.calc-mock-header {
|
||||
background: var(--teal); color: white;
|
||||
padding: 10px 14px; border-radius: 6px;
|
||||
font-size: 0.75rem; font-weight: 600; margin-bottom: 10px;
|
||||
}
|
||||
.calc-mock-row {
|
||||
display: grid; grid-template-columns: 1fr 1fr;
|
||||
gap: 6px; margin-bottom: 6px;
|
||||
}
|
||||
.calc-mock-field {
|
||||
background: #f4f9fb; border: 1px solid #dde;
|
||||
border-radius: 4px; padding: 7px 10px;
|
||||
font-size: 0.7rem; color: #667;
|
||||
}
|
||||
.calc-mock-result {
|
||||
background: linear-gradient(135deg,var(--teal),var(--teal2));
|
||||
border-radius: 6px; padding: 10px 14px; margin-top: 8px;
|
||||
}
|
||||
.calc-mock-result-label { font-size: 0.65rem; color: var(--lgrey); margin-bottom: 2px; }
|
||||
.calc-mock-result-val { font-size: 1.1rem; font-weight: 700; color: var(--green); }
|
||||
|
||||
.lp-asset-info { padding: 24px; }
|
||||
.lp-asset-tag {
|
||||
display: inline-block; font-size: 0.65rem; font-weight: 700;
|
||||
text-transform: uppercase; letter-spacing: 0.1em;
|
||||
color: var(--green); background: rgba(53,184,136,0.1);
|
||||
border: 1px solid rgba(53,184,136,0.2);
|
||||
padding: 3px 8px; border-radius: 3px; margin-bottom: 10px;
|
||||
}
|
||||
.lp-asset-info h3 {
|
||||
font-size: 1.05rem; font-weight: 700; color: var(--teal); margin-bottom: 8px;
|
||||
}
|
||||
.lp-asset-info p {
|
||||
font-size: 0.87rem; color: #556; line-height: 1.6; margin-bottom: 16px;
|
||||
}
|
||||
.lp-asset-bullets {
|
||||
list-style: none; margin: 0; padding: 0;
|
||||
display: flex; flex-direction: column; gap: 6px;
|
||||
}
|
||||
.lp-asset-bullets li {
|
||||
font-size: 0.82rem; color: #445;
|
||||
display: flex; align-items: flex-start; gap: 8px;
|
||||
}
|
||||
.lp-asset-bullets li::before {
|
||||
content: ''; width: 6px; height: 6px;
|
||||
background: var(--green); border-radius: 50%;
|
||||
margin-top: 5px; flex-shrink: 0;
|
||||
}
|
||||
|
||||
/* REGISTRATION */
|
||||
.lp-reg {
|
||||
background: white; border-top: 1px solid #e2ecef; padding: 64px 0;
|
||||
}
|
||||
.lp-reg-inner { max-width: 760px; margin: 0 auto; padding: 0 48px; }
|
||||
.lp-reg-box {
|
||||
background: white; border: 1px solid #dde8eb;
|
||||
border-radius: 16px; padding: 40px 48px;
|
||||
box-shadow: 0 4px 24px rgba(1,59,73,0.08);
|
||||
}
|
||||
.lp-reg-title {
|
||||
font-size: 1.5rem; font-weight: 700; color: var(--teal);
|
||||
margin-bottom: 8px; text-align: center;
|
||||
}
|
||||
.lp-reg-sub {
|
||||
text-align: center; font-size: 0.9rem; color: #667; margin-bottom: 32px;
|
||||
}
|
||||
.lp-form-grid {
|
||||
display: grid; grid-template-columns: 1fr 1fr;
|
||||
gap: 16px; margin-bottom: 16px;
|
||||
}
|
||||
.lp-form-full { grid-column: 1 / -1; }
|
||||
.lp-field { display: flex; flex-direction: column; gap: 5px; }
|
||||
.lp-field label {
|
||||
font-size: 0.78rem; font-weight: 600; color: var(--teal);
|
||||
text-transform: uppercase; letter-spacing: 0.05em;
|
||||
}
|
||||
.lp-field input, .lp-field select {
|
||||
padding: 11px 14px; border: 1.5px solid #ccd8dc;
|
||||
border-radius: 7px; font-family: 'Ubuntu', sans-serif;
|
||||
font-size: 0.9rem; color: #334; background: white; outline: none;
|
||||
transition: border-color 0.15s;
|
||||
}
|
||||
.lp-field input:focus, .lp-field select:focus {
|
||||
border-color: var(--teal); box-shadow: 0 0 0 3px rgba(1,59,73,0.08);
|
||||
}
|
||||
.lp-submit {
|
||||
width: 100%; padding: 14px;
|
||||
background: var(--green); color: white;
|
||||
font-family: 'Ubuntu', sans-serif;
|
||||
font-size: 1rem; font-weight: 700;
|
||||
border: none; border-radius: 8px;
|
||||
cursor: pointer; margin-top: 8px;
|
||||
transition: background 0.15s, transform 0.1s;
|
||||
}
|
||||
.lp-submit:hover { background: var(--green2); transform: translateY(-1px); }
|
||||
.lp-privacy {
|
||||
text-align: center; font-size: 0.75rem; color: #889; margin-top: 16px;
|
||||
}
|
||||
.lp-privacy a { color: var(--mgrey); }
|
||||
#form-error {
|
||||
background: #fff0f0; border: 1px solid #fcc; color: #c00;
|
||||
padding: 10px 14px; border-radius: 6px; font-size: 0.85rem;
|
||||
margin-bottom: 12px; display: none;
|
||||
}
|
||||
|
||||
/* POST-REGISTRATION */
|
||||
.lp-access { background: #f4f8fa; }
|
||||
|
||||
.access-welcome {
|
||||
background: linear-gradient(135deg, var(--teal) 0%, var(--teal2) 100%);
|
||||
padding: 28px 48px;
|
||||
display: flex; align-items: center; gap: 20px;
|
||||
max-width: 100%;
|
||||
}
|
||||
.access-welcome-icon {
|
||||
width: 44px; height: 44px;
|
||||
background: rgba(53,184,136,0.2); border-radius: 50%;
|
||||
display: flex; align-items: center; justify-content: center; flex-shrink: 0;
|
||||
}
|
||||
.access-welcome-icon svg { width:22px; height:22px; stroke:var(--green); fill:none; stroke-width:2.5; }
|
||||
.access-welcome-text h2 { font-size: 1.05rem; font-weight: 700; color: white; margin-bottom: 2px; }
|
||||
.access-welcome-text p { font-size: 0.85rem; color: var(--lgrey); }
|
||||
|
||||
/* Tab navigation */
|
||||
.lp-tabs {
|
||||
max-width: 1200px; margin: 0 auto;
|
||||
padding: 32px 48px 0;
|
||||
display: flex; gap: 0; border-bottom: 2px solid #dde8eb;
|
||||
}
|
||||
.lp-tab {
|
||||
padding: 12px 28px 14px;
|
||||
font-family: 'Ubuntu', sans-serif;
|
||||
font-size: 0.95rem; font-weight: 600;
|
||||
color: #778; border: none;
|
||||
background: none; cursor: pointer;
|
||||
border-bottom: 3px solid transparent;
|
||||
margin-bottom: -2px;
|
||||
transition: color 0.15s, border-color 0.15s;
|
||||
display: flex; align-items: center; gap: 8px;
|
||||
}
|
||||
.lp-tab svg { width:16px; height:16px; stroke:currentColor; fill:none; stroke-width:2; }
|
||||
.lp-tab.active { color: var(--teal); border-bottom-color: var(--green); }
|
||||
.lp-tab:hover:not(.active) { color: var(--teal); }
|
||||
|
||||
.lp-tab-content { display: none; }
|
||||
.lp-tab-content.active { display: block; }
|
||||
|
||||
/* DECK VIEWER */
|
||||
.deck-viewer-wrap {
|
||||
max-width: 1200px; margin: 0 auto; padding: 36px 48px 56px;
|
||||
}
|
||||
.deck-viewer-top {
|
||||
display: flex; align-items: center; justify-content: space-between;
|
||||
margin-bottom: 20px; gap: 16px; flex-wrap: wrap;
|
||||
}
|
||||
.deck-viewer-title { font-size: 1.1rem; font-weight: 700; color: var(--teal); }
|
||||
.deck-viewer-sub { font-size: 0.85rem; color: #667; margin-top: 2px; }
|
||||
.deck-dl-btn {
|
||||
display: inline-flex; align-items: center; gap: 8px;
|
||||
background: var(--teal); color: white; text-decoration: none;
|
||||
padding: 11px 22px; border-radius: 8px;
|
||||
font-family: 'Ubuntu', sans-serif;
|
||||
font-weight: 700; font-size: 0.88rem;
|
||||
transition: background 0.15s; flex-shrink: 0;
|
||||
}
|
||||
.deck-dl-btn:hover { background: var(--teal2); }
|
||||
.deck-dl-btn svg { width:15px; height:15px; stroke:currentColor; fill:none; stroke-width:2.5; }
|
||||
|
||||
/* Slide viewer */
|
||||
.slide-viewer {
|
||||
background: #1a1a2e;
|
||||
border-radius: 12px; overflow: hidden;
|
||||
box-shadow: 0 8px 40px rgba(0,0,0,0.3);
|
||||
}
|
||||
.slide-display {
|
||||
position: relative;
|
||||
background: #111;
|
||||
display: flex; align-items: center; justify-content: center;
|
||||
min-height: 400px;
|
||||
}
|
||||
.slide-display img {
|
||||
width: 100%; max-height: 600px;
|
||||
object-fit: contain; display: block;
|
||||
}
|
||||
.slide-nav-btn {
|
||||
position: absolute; top: 50%; transform: translateY(-50%);
|
||||
width: 44px; height: 44px;
|
||||
background: rgba(0,0,0,0.55); color: white;
|
||||
border: 1px solid rgba(255,255,255,0.15); border-radius: 50%;
|
||||
cursor: pointer; display: flex; align-items: center; justify-content: center;
|
||||
transition: background 0.15s; z-index: 2;
|
||||
font-family: 'Ubuntu', sans-serif; font-size: 1.1rem;
|
||||
}
|
||||
.slide-nav-btn:hover { background: rgba(0,0,0,0.8); }
|
||||
.slide-nav-btn.prev { left: 14px; }
|
||||
.slide-nav-btn.next { right: 14px; }
|
||||
.slide-nav-btn:disabled { opacity: 0.25; cursor: default; }
|
||||
|
||||
.slide-controls {
|
||||
background: #13131f;
|
||||
padding: 14px 20px;
|
||||
display: flex; align-items: center; justify-content: space-between; gap: 16px;
|
||||
}
|
||||
.slide-counter {
|
||||
font-size: 0.85rem; font-weight: 600; color: #aaa;
|
||||
min-width: 60px;
|
||||
}
|
||||
.slide-thumbs {
|
||||
display: flex; gap: 6px; overflow-x: auto;
|
||||
padding: 4px 0; flex: 1; justify-content: center;
|
||||
scrollbar-width: thin; scrollbar-color: #444 #13131f;
|
||||
}
|
||||
.slide-thumb-btn {
|
||||
width: 52px; height: 32px; flex-shrink: 0;
|
||||
border-radius: 3px; overflow: hidden; cursor: pointer;
|
||||
border: 2px solid transparent; padding: 0;
|
||||
transition: border-color 0.15s, opacity 0.15s;
|
||||
opacity: 0.5;
|
||||
}
|
||||
.slide-thumb-btn.active { border-color: var(--green); opacity: 1; }
|
||||
.slide-thumb-btn:hover { opacity: 0.85; }
|
||||
.slide-thumb-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
|
||||
|
||||
/* CALCULATOR TAB */
|
||||
.calc-tab-wrap {
|
||||
max-width: 1200px; margin: 0 auto; padding: 36px 48px 56px;
|
||||
}
|
||||
.calc-tab-header {
|
||||
margin-bottom: 24px; padding-bottom: 16px;
|
||||
border-bottom: 1px solid #e2ecef;
|
||||
}
|
||||
.calc-tab-header h2 {
|
||||
font-size: 1.2rem; font-weight: 700; color: var(--teal); margin-bottom: 4px;
|
||||
}
|
||||
.calc-tab-header p { font-size: 0.88rem; color: #667; }
|
||||
|
||||
/* Report download */
|
||||
.lp-report-bar {
|
||||
background: linear-gradient(135deg, #f0fdf7, #e8f8f1);
|
||||
border: 1.5px solid rgba(53,184,136,0.3);
|
||||
border-radius: 10px; padding: 24px 28px;
|
||||
display: flex; align-items: center; justify-content: space-between;
|
||||
gap: 24px; margin-top: 32px; flex-wrap: wrap;
|
||||
}
|
||||
.lp-report-bar-text h4 { font-size: 1rem; font-weight: 700; color: var(--teal); margin-bottom: 4px; }
|
||||
.lp-report-bar-text p { font-size: 0.85rem; color: #556; }
|
||||
.report-dl-btn {
|
||||
display: inline-flex; align-items: center; gap: 8px;
|
||||
background: var(--green); color: white; border: none;
|
||||
padding: 12px 24px; border-radius: 8px;
|
||||
font-family: 'Ubuntu', sans-serif; font-weight: 700; font-size: 0.9rem;
|
||||
cursor: pointer; transition: background 0.15s, opacity 0.15s; white-space: nowrap;
|
||||
}
|
||||
.report-dl-btn:disabled { opacity: 0.4; cursor: not-allowed; }
|
||||
.report-dl-btn:not(:disabled):hover { background: var(--green2); }
|
||||
.report-dl-btn svg { width:15px; height:15px; stroke:currentColor; fill:none; stroke-width:2.5; }
|
||||
.report-note { font-size: 0.75rem; color: #889; margin-top: 8px; }
|
||||
|
||||
/* FOOTER */
|
||||
.lp-footer {
|
||||
background: var(--teal); padding: 28px 48px; text-align: center;
|
||||
}
|
||||
.lp-footer p { font-size: 0.8rem; color: var(--lgrey); }
|
||||
.lp-footer a { color: var(--green); text-decoration: none; }
|
||||
|
||||
/* Responsive */
|
||||
@media (max-width: 900px) {
|
||||
.lp-hero-inner { padding: 48px 24px 40px; }
|
||||
.lp-assets { grid-template-columns: 1fr; }
|
||||
.lp-form-grid { grid-template-columns: 1fr; }
|
||||
.lp-reg-box { padding: 28px 24px; }
|
||||
.lp-reg-inner { padding: 0 24px; }
|
||||
.lp-what-inner { padding: 0 24px; }
|
||||
.lp-tabs { padding: 24px 24px 0; }
|
||||
.deck-viewer-wrap, .calc-tab-wrap { padding: 24px 24px 48px; }
|
||||
.access-welcome { padding: 20px 24px; }
|
||||
.main { grid-template-columns: 1fr !important; }
|
||||
.results-col { position: static !important; }
|
||||
.lp-report-bar { flex-direction: column; align-items: flex-start; }
|
||||
}
|
||||
|
||||
/* Assumptions */
|
||||
.assump-section { margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(176,200,206,0.1); }
|
||||
.assump-toggle { font-size: 11px; color: var(--mgrey); cursor: pointer; display: flex; align-items: center; gap: 5px; background: none; border: none; padding: 0; font-family: 'Ubuntu', sans-serif; transition: color 0.2s; }
|
||||
.assump-toggle:hover { color: var(--lgrey); }
|
||||
.assump-toggle svg { width: 11px; height: 11px; stroke: currentColor; fill: none; transition: transform 0.2s; }
|
||||
.assump-toggle.open svg { transform: rotate(180deg); }
|
||||
.assump-list { display: none; margin-top: 10px; font-size: 10.5px; color: rgba(176,200,206,0.55); line-height: 1.9; }
|
||||
|
||||
/* ── Welcome bar inner alignment ── */
|
||||
.access-welcome { padding: 0; }
|
||||
.access-welcome-inner {
|
||||
max-width: 1200px; margin: 0 auto;
|
||||
padding: 22px 48px;
|
||||
display: flex; align-items: center; gap: 20px; width: 100%;
|
||||
}
|
||||
|
||||
/* ── Calculator tab layout alignment ── */
|
||||
.calc-tab-wrap .main {
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
padding-top: 24px;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
.calc-tab-wrap .rank-bar-inner {
|
||||
padding-left: 20px;
|
||||
padding-right: 20px;
|
||||
max-width: none;
|
||||
}
|
||||
/* Disclaimer alignment and spacing */
|
||||
.calc-tab-wrap .disclaimer {
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
padding-bottom: 0;
|
||||
margin-top: 12px;
|
||||
}
|
||||
/* Report bar spacing */
|
||||
.calc-tab-wrap .lp-report-bar {
|
||||
margin-top: 14px;
|
||||
}
|
||||
@media (max-width: 900px) {
|
||||
.access-welcome-inner { padding: 18px 24px; }
|
||||
.calc-tab-wrap .rank-bar-inner { padding-left: 0; padding-right: 0; }
|
||||
}
|
||||
|
||||
/* ═══ React port additions ═══ */
|
||||
.lp-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
|
||||
.lp-submit:disabled { opacity: 0.6; cursor: wait; transform: none; }
|
||||
.welcome-reset { background: none; border: none; color: var(--green); font-family: 'Ubuntu', sans-serif; font-size: 0.8rem; cursor: pointer; padding: 0; margin-left: 6px; text-decoration: underline; }
|
||||
.report-error { color: #c00; }
|
||||
.report-dl-btn.busy { cursor: wait; }
|
||||
.lp-field-hint { font-size: 0.75rem; color: #889; line-height: 1.5; }
|
||||
Reference in New Issue
Block a user