Initial commit of BlackDice ROI toolkit

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-10-13 17:04:40 +05:00
co-authored by Claude Sonnet 5
commit a69e127331
51 changed files with 4950 additions and 0 deletions
+112
View File
@@ -0,0 +1,112 @@
# BlackDice Operator ROI Toolkit — campaign landing page
React (Vite) port of `BlackDice_Campaign_Landing_Page.html`:
1. **Intro + registration form** → lead is sent to your CRM
2. **Strategy deck** viewer (15 slides) + plain PPTX download
3. **ROI calculator** → *Download My ROI Report* generates the deck **in the browser** with the
visitor's figures written into slide 12 ("Total estimate annual savings") and
"Prepared for {Company}" on the subtitle. ROI figures are also sent to the CRM against the lead.
Slide 12 in the published deck carries **example figures** (an indicative operator). Until a
visitor completes the calculator, *Download Deck (PPTX)* gives them that example deck; once they
have entered their own numbers, both download buttons give the personalised version.
The site itself is static — no server needed. (An optional lead database lives in `server/`.)
## Run locally
```bash
npm install
cp .env.example .env # fill in CRM settings
npm run dev # http://localhost:5173
```
## Deploy (own server / any static host)
```bash
npm run build
```
Upload the **contents of `dist/`** to any folder on your web server. Paths are relative, so it
works at `/` or in a sub-folder (e.g. `blackdice.ai/roi-toolkit/`).
`.env` values are baked in at build time — rebuild after changing them.
On Webflow: host `dist/` on a sub-domain (e.g. `toolkit.blackdice.ai`) or embed it via an iframe;
Webflow can't host a multi-file React build directly.
## CRM setup
Set `VITE_CRM_PROVIDER` (you can combine, e.g. `hubspot,webhook`). Field names are mapped in
`src/config/crm.config.js`.
| Provider | What you need | Notes |
|---|---|---|
| **HubSpot** | Portal ID + Form GUID (Marketing → Forms → your form → Embed) | Create the contact properties listed in `crm.config.js` (`operator_region`, `subscriber_base_band`, `roi_total_low`, `roi_bandwidth`, …) and add them (hidden) to the form. ROI submission updates the same contact by email. Add the HubSpot tracking code in `index.html` to link page views. |
| **Salesforce** | Org ID (Setup → Company Information) | Web-to-Lead. Region/subscriber band go into Description unless you add custom field IDs in `crm.config.js`. ROI posts are off by default because each post creates a new lead. |
| **Webhook** | A URL (Zapier "Catch Hook", Make, n8n…) | Receives JSON with `event: "toolkit_registration"` and `event: "roi_report_downloaded"` — route to any CRM, Google Sheet, Slack, etc. The endpoint must allow CORS (Zapier/Make do). |
Also captured automatically: UTM parameters (`utm_source`, `utm_campaign`, …, `gclid`, `li_fat_id`),
page URL, referrer. A hidden honeypot field filters most bots.
CRM failures never block the visitor (max 6 s wait); errors are logged to the console.
## Updating the deck
- Template: `public/deck/BlackDice_Strategy_Deck.pptx` — web-optimised copy of
`2026_2309_BlackDice_LeadGen_Deck_V4.pptx` (large photos downscaled, 20 MB → 4.6 MB; slides unchanged).
- **ROI slide (slide 12):** the six result boxes are found by shape name in PowerPoint's
Selection Pane — `TextBox 4` = total, `TextBox 10`–`TextBox 14` = categories 1–5. Each box
has two lines (label, value); the **value line is overwritten**, so you can put any example
figures there. Keep the box names and the two-line layout. Older decks with `$XX to $XX`
placeholders still work.
- **Subtitle (`TextBox 5`):** a leading "Example" is removed and "Prepared for {Company} ·" added.
- Figures in the deck use the deck's style (`$65k`, `$3.60m`, `$1.20bn`); the web page uses `$65K`, `$3.60M`.
- If you move the ROI slide, update `VITE_ROI_SLIDE_PATH`.
- **Registration form → slide 3:** the optional "The device on your network" dropdown offers
subscriber bands (Under 500k … 50M+) or *Enter exact number…*. The choice is the big number on
slide 3 straight away — a band shows as a range (`10m–50m`, set in 36pt so it fits), an exact
number as `5.5m`. An exact number also pre-fills *Active subscribers* in the calculator; once the
calculator has a count, that figure is used on slide 3 instead. Sent to the CRM as
`subscriber_base_band` (always) and `active_subscribers` (exact number only). The options are
in `DEVICE_OPTIONS` at the top of `src/components/Landing.jsx` (and `DEVICE_DECK_LABELS` in
`standalone.html`).
- **Slide 3 — active subscribers:** the box named `DeviceCount` (the big number above
"The device on your network") shows the operator's active subscribers in the deck's style
(`25m`, `5.5m`, `850k`). The published deck shows the example `25m`, which matches the
example figures on slide 12. If you move that slide, update `VITE_DEVICE_SLIDE_PATH`.
- Slide preview images: `public/img/slides/slide-01.jpg` … `slide-15.jpg` (960×541). Re-export
any slide you change in the deck (PowerPoint: File → Export → JPEG) and resize to 960×541.
## Standalone version
`public/standalone.html` is a no-build, no-React copy of the whole toolkit (needs
`public/jszip.min.js` beside it). It mirrors the deck logic in `src/lib/` — **if you change
`slideXml.js`, `calc.js` or `pptxReport.js`, make the same change there.** It has no CRM wiring.
Everything in `public/` is published by `npm run build`; delete `standalone.html` and
`jszip.min.js` from `public/` if you don't want them on the live site.
## Lead database (optional)
`server/` is a small Express + SQL service that receives the webhook events
(`POST /api/webhook`). Point `VITE_CRM_WEBHOOK_URL` at it and set `VITE_CRM_PROVIDER=webhook`.
## Project map
```
src/
App.jsx registration state (persists in localStorage)
components/Landing.jsx hero, "inside the toolkit", registration form
components/Toolkit.jsx welcome bar + tabs
components/DeckViewer.jsx slide viewer + deck download (example or personalised)
components/Calculator.jsx ROI calculator + personalised report download
lib/calc.js ROI maths (identical to the original page) + deck formatting
lib/crm.js HubSpot / Salesforce / webhook submission
lib/pptxReport.js builds the personalised .pptx (JSZip, lazy-loaded)
lib/slideXml.js writes values into the ROI slide
config/crm.config.js CRM field mapping
public/
deck/ deck template (V4)
img/ logo, backgrounds, slide previews
standalone.html no-build copy of the toolkit
server/ optional lead database
```