Initial commit: BlackDice site rebuild with integrated CMS

Rebuilds content management around a single admin route (/admin —
"BlackDice Studio"), replacing blackdice-studio.html. Publishing writes
one JSON content document instead of regenerating HTML files, so it can
no longer overwrite hand-made site changes the way the old tool did.

- /admin: click-to-edit copy/images, article CRUD with a Word-safe rich
  text editor, demo clip management, per-page SEO, enquiry log, publish
  history with rollback
- Real per-page URLs for all pages and articles, each with its own
  meta/canonical/OG/JSON-LD
- Newsroom + article pages driven by the CMS post library, seeded from
  the old studio's export (17 articles) plus a drafted GSMA Open Gateway
  press release awaiting approval
- Demo sections on Mobile SDK and Halo CPE, interactive by default and
  upgradable to an uploaded clip per slot
- Dependency-free Node API server (auth, publish, uploads, snapshots,
  leads, live sitemap)
- Deployment configs for Node/nginx/IIS, Vercel and Netlify

See docs/ARCHITECTURE.md, docs/PROJECT-STRUCTURE.md, docs/CMS-GUIDE.md
and docs/DEPLOYMENT.md.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-12 23:52:44 +05:00
co-authored by Claude Sonnet 5
commit 63a36e0dca
77 changed files with 19487 additions and 0 deletions
+59
View File
@@ -0,0 +1,59 @@
# BlackDice Threat-Detection Demo Videos
Seven recordable, in-app demo players that simulate the BlackDice mobile app detecting a
threat, raising a notification, moving the **BlackDice Angel risk score** in real time, showing the
response, and resolving — ending on a "Book a Demo" card. Each is built to be screen-recorded
into a 30–60s MP4.
## Where
| Route | What |
| --- | --- |
| `/threat-demos` | **Slider** of all 7 demos — cinematic `/demo-video`-style player, auto-plays each scenario, swipe via ‹ › arrows or the scenario tabs |
| `/threat-demo/:id` | Full-screen player for one scenario — **one URL per video** (best for recording a single MP4) |
Both use the same cinematic player as `/demo-video`: Apple bezel-less phone with 3D tilt,
breathing float, accent glow, Dynamic Island, glass sheen, the real BlackDice SVG icon set
(`Icons.tsx`) and hexagon logo, a vertical control dock, and a spoken-voiceover subtitle.
## The 7 demos
| id | Product | Risk | Export file |
| --- | --- | --- | --- |
| `callscam` | Mobile SDK | 25 → 85 (red) | `blackdice-demo-01-call-scam.mp4` |
| `smsscam` | Mobile SDK | 20 → 78 (red) | `blackdice-demo-02-sms-scam.mp4` |
| `simswap` | Mobile SDK | 15 → 92 (red) | `blackdice-demo-03-sim-swap.mp4` |
| `identity` | Halo Platform | 30 → 78 (yellow) | `blackdice-demo-04-identity-breach.mp4` |
| `wifi` | Halo Platform | 28 → 70 (yellow) | `blackdice-demo-05-wifi-security.mp4` |
| `dns` | DNS Shield | 35 → 45 (green) | `blackdice-demo-06-dns-block.mp4` |
| `appperms` | Mobile SDK | 32 → 66 (yellow) | `blackdice-demo-07-app-permissions.mp4` |
## Phase timeline (~34s each)
1. **Setup** (0–4s) — calm home screen, low/green BlackDice Angel score, family/context
2. **Detection** (4–9s) — notification banner slides in with the threat
3. **Risk Impact** (9–15s) — BlackDice Angel badge counts up to the threat level; meter fills; colour shifts green → yellow → red
4. **Response** (15–24s) — threat detail screen; the primary action auto-taps
5. **Resolution** (24–30s) — calm/secured state (prevention) or elevated state needing action
6. **End card** (30–34s) — BlackDice logo · "Powered by BlackDice" · **Book a Demo** · blackdice.com
## Voiceover
Each scenario carries 5 timed voiceover lines (setup / detection / risk / response / close),
spoken via the browser Web Speech API when you press **▶**. A 🔊/🔇 toggle in the dock mutes
it. For a polished recording, mute the in-app voice and record a professional VO over the
same lines (stored in `scenarios.ts → voCues`).
## How to record
1. Open `/threat-demo/<id>` (e.g. `/threat-demo/callscam`).
2. Set the browser to 1080p; the phone is the hero, centred.
3. Start your screen recorder at 60fps.
4. Press **▶** — it auto-plays all phases (~34s) and stops on the end card.
5. Crop to the phone + (optional) controls; the "← All demos" link and REC chip can be cropped out.
6. Export H.264 1080p using the file name from the table above.
## Editing the content
All copy, risk values, severities, detail lines, action buttons, and VO scripts live in
[`scenarios.ts`](./scenarios.ts) — edit there and every player + the hub update automatically.
+496
View File
@@ -0,0 +1,496 @@
import { useEffect, useRef, useState } from 'react'
import { AnimatePresence, animate, motion } from 'framer-motion'
import {
type ThreatScenario,
type Severity,
PHASES,
RISK_ANIM_MS,
scoreColor,
} from './scenarios'
import {
IconHome, IconUsers, IconApps, IconSliders, IconBell,
IconPhone, IconLock, IconEye, IconWifiOff, IconGlobe,
IconAlert, IconCheck, IconShieldCheck,
} from '../components/Icons'
import { SceneHome } from '../DemoScreen'
import '../demo.css'
const EASE_OUT = [0.23, 1, 0.32, 1] as const
const SPRING = { type: 'spring', stiffness: 340, damping: 28 } as const
// Display scale for the phone in the cinematic stage (content still renders at full
// 275×600 fidelity, just shown a touch smaller so it fits with the subtitle + chrome).
const PHONE_SCALE = 0.88
const T = {
bg: '#013B49',
bgGrad: 'radial-gradient(140% 90% at 50% 0%, #075466 0%, #013B49 55%, #01303b 100%)',
surface2: 'rgba(255,255,255,0.07)',
surface3: 'rgba(255,255,255,0.10)',
surfaceStr: '#0a4856',
border: 'rgba(255,255,255,0.09)',
text: '#e8f4f3',
text2: '#b9cdd1',
muted: '#8aa5ab',
dim: '#5a7a82',
accent: '#3BB586',
accentSoft: 'rgba(59,181,134,0.16)',
accentGlow: 'rgba(59,181,134,0.30)',
danger: '#ff6b6b',
dangerSoft: 'rgba(255,107,107,0.16)',
warn: '#ffb56b',
warnSoft: 'rgba(255,181,107,0.16)',
success: '#4ec99a',
successSoft: 'rgba(78,201,154,0.16)',
}
const SEV: Record<Severity, { color: string; soft: string }> = {
red: { color: T.danger, soft: T.dangerSoft },
yellow: { color: T.warn, soft: T.warnSoft },
green: { color: T.success, soft: T.successSoft },
}
type IconCmp = React.ComponentType<{ size?: number; style?: React.CSSProperties }>
const THREAT_ICON: Record<string, IconCmp> = {
callscam: IconPhone,
smsscam: IconBell,
simswap: IconLock,
identity: IconEye,
wifi: IconWifiOff,
dns: IconGlobe,
appperms: IconApps,
}
function phaseOf(elapsed: number): number {
if (elapsed < PHASES.setupEnd) return 1
if (elapsed < PHASES.detectEnd) return 2
if (elapsed < PHASES.riskEnd) return 3
if (elapsed < PHASES.responseEnd) return 4
if (elapsed < PHASES.resolutionEnd) return 5
return 6
}
const TABS = [
{ Icon: IconHome, label: 'Home' },
{ Icon: IconUsers, label: 'Family' },
{ Icon: IconApps, label: 'Devices' },
{ Icon: IconSliders, label: 'Controls' },
{ Icon: IconBell, label: 'Alerts' },
] as const
// BlackDice hexagonal-die logo (same as the /demo-video end card)
function HexLogo({ size = 52 }: { size?: number }) {
return (
<svg width={size} height={size} viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" style={{ color: T.accent, flexShrink: 0 }}>
<g fill="none" stroke="currentColor" strokeWidth="3" strokeLinejoin="round" strokeLinecap="round">
<path d="M32 6 L56 20 L56 46 L32 60 L8 46 L8 20 Z" />
<path d="M32 6 L32 32 M8 20 L32 32 M56 20 L32 32" />
</g>
<g fill="currentColor">
<circle cx="20" cy="26" r="2.4" /><circle cx="20" cy="34" r="2.4" /><circle cx="44" cy="34" r="2.4" />
</g>
</svg>
)
}
function NotifBanner({ s }: { s: ThreatScenario }) {
const sev = SEV[s.severity]
const Icon = THREAT_ICON[s.id] ?? IconAlert
return (
<motion.div
initial={{ y: -18, opacity: 0, scale: 0.97 }} animate={{ y: 0, opacity: 1, scale: 1 }} transition={SPRING}
style={{ background: sev.soft, border: `1px solid ${sev.color}55`, borderRadius: 12, padding: '11px 12px', display: 'flex', alignItems: 'flex-start', gap: 10, marginBottom: 11, boxShadow: '0 6px 22px rgba(0,0,0,.35)' }}>
<motion.div animate={{ scale: [1, 1.08, 1] }} transition={{ duration: 1.4, repeat: Infinity }}
style={{ width: 32, height: 32, borderRadius: 9, background: sev.color, display: 'flex', alignItems: 'center', justifyContent: 'center', flexShrink: 0 }}>
<Icon size={17} style={{ color: '#fff' }} />
</motion.div>
<div style={{ flex: 1, fontSize: 12, lineHeight: 1.45 }}>
<strong style={{ color: T.text, display: 'block', marginBottom: 1 }}>{s.threatTitle}</strong>
<span style={{ color: T.text2 }}>{s.threatBody}</span>
</div>
</motion.div>
)
}
function HomeContent({ s, phase }: { s: ThreatScenario; phase: number }) {
const sev = SEV[s.severity]
const alerted = phase >= 2
return (
<div style={{ position: 'relative' }}>
{/* The real BlackDice Angel home screen — dims once the threat hits */}
<div style={{ opacity: alerted ? 0.32 : 1, filter: alerted ? 'blur(1.5px)' : 'none', transition: 'opacity .45s ease, filter .45s ease', pointerEvents: 'none' }}>
<SceneHome />
</div>
{/* Threat notification + alert slide in over the home from phase 2 */}
<AnimatePresence>
{alerted && (
<motion.div key="alert" initial={{ opacity: 0 }} animate={{ opacity: 1 }} exit={{ opacity: 0 }}
style={{ position: 'absolute', top: 0, left: 0, right: 0 }}>
<NotifBanner s={s} />
<motion.div initial={{ opacity: 0, y: 6 }} animate={{ opacity: 1, y: 0 }} transition={{ delay: .12, ease: EASE_OUT }}
style={{ background: sev.soft, borderRadius: 14, padding: '12px 14px', display: 'flex', alignItems: 'center', gap: 10, marginBottom: 10, boxShadow: '0 6px 22px rgba(0,0,0,.35)' }}>
<div style={{ width: 32, height: 32, borderRadius: '50%', background: sev.color, display: 'flex', alignItems: 'center', justifyContent: 'center', flexShrink: 0 }}>
<IconAlert size={16} style={{ color: '#fff' }} />
</div>
<div style={{ flex: 1, fontSize: 12, color: sev.color, fontWeight: 500 }}>{s.detailHeadline}</div>
</motion.div>
{phase >= 3 && (
<motion.div initial={{ opacity: 0, y: 6 }} animate={{ opacity: 1, y: 0 }} transition={{ ease: EASE_OUT }}
style={{ background: T.surfaceStr, border: `1px solid ${T.border}`, borderRadius: 14, padding: '12px 14px', boxShadow: '0 6px 22px rgba(0,0,0,.35)' }}>
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 7 }}>
<span style={{ fontSize: 11, color: T.muted }}>BlackDice Angel risk</span>
<span style={{ fontSize: 11, fontWeight: 600, color: sev.color }}>{s.severity === 'green' ? 'Contained' : s.severity === 'yellow' ? 'Elevated' : 'Critical'}</span>
</div>
<div style={{ height: 6, background: T.surface3, borderRadius: 4, overflow: 'hidden' }}>
<motion.div initial={{ width: `${s.initialScore}%` }} animate={{ width: `${s.finalScore}%` }}
transition={{ duration: RISK_ANIM_MS / 1000, ease: EASE_OUT }}
style={{ height: '100%', borderRadius: 4, background: sev.color }} />
</div>
</motion.div>
)}
</motion.div>
)}
</AnimatePresence>
</div>
)
}
function DetailContent({ s, tapped }: { s: ThreatScenario; tapped: boolean }) {
const sev = SEV[s.severity]
const Icon = THREAT_ICON[s.id] ?? IconAlert
return (
<motion.div initial={{ opacity: 0, x: 14 }} animate={{ opacity: 1, x: 0 }} transition={{ ease: EASE_OUT }}>
<div style={{ display: 'flex', alignItems: 'center', gap: 8, marginBottom: 14 }}>
<span style={{ fontSize: 18, color: T.muted }}>‹</span>
<span style={{ fontSize: 15, fontWeight: 600, color: T.text }}>Threat details</span>
</div>
<div style={{ background: sev.soft, borderRadius: 14, padding: '16px 14px', textAlign: 'center', marginBottom: 12 }}>
<div style={{ width: 48, height: 48, borderRadius: 13, background: sev.color, display: 'flex', alignItems: 'center', justifyContent: 'center', margin: '0 auto 10px' }}>
<Icon size={24} style={{ color: '#fff' }} />
</div>
<div style={{ fontSize: 14, fontWeight: 700, color: T.text }}>{s.threatTitle}</div>
<div style={{ fontSize: 11, color: sev.color, marginTop: 3 }}>{s.detailHeadline}</div>
</div>
<div style={{ background: T.surface2, border: `1px solid ${T.border}`, borderRadius: 14, padding: '4px 14px', marginBottom: 12 }}>
{s.detailLines.map((line, i) => (
<motion.div key={line} initial={{ opacity: 0, x: -6 }} animate={{ opacity: 1, x: 0 }} transition={{ delay: 0.15 + i * 0.1 }}
style={{ display: 'flex', alignItems: 'flex-start', gap: 9, padding: '9px 0', borderTop: i === 0 ? 'none' : `1px solid ${T.border}`, fontSize: 11.5, color: T.text2, lineHeight: 1.4 }}>
<span style={{ width: 5, height: 5, borderRadius: '50%', background: sev.color, marginTop: 5, flexShrink: 0 }} />{line}
</motion.div>
))}
</div>
<div style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>
{s.actions.map((a) => (
<motion.div key={a.label}
animate={a.primary && tapped ? { scale: [1, 0.96, 1] } : {}} transition={{ duration: 0.4 }}
style={{
fontSize: 13, fontWeight: 600, borderRadius: 12, padding: '11px 14px',
border: a.primary ? 'none' : `1px solid ${T.border}`,
background: a.primary ? sev.color : 'transparent',
color: a.primary ? '#fff' : T.text2,
display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 7,
boxShadow: a.primary ? `0 6px 20px ${sev.color}55` : 'none',
}}>
{a.icon && <span>{a.icon}</span>}{a.label}
</motion.div>
))}
</div>
</motion.div>
)
}
function ResolutionContent({ s }: { s: ThreatScenario }) {
const tone = SEV[s.resolutionTone]
const calm = s.resolutionTone === 'green'
return (
<motion.div initial={{ opacity: 0 }} animate={{ opacity: 1 }} style={{ paddingTop: 6 }}>
<motion.div initial={{ scale: 0.94 }} animate={{ scale: 1 }} transition={SPRING}
style={{ background: tone.soft, borderRadius: 16, padding: '20px 14px', textAlign: 'center', marginBottom: 12 }}>
<motion.div initial={{ scale: 0, rotate: -20 }} animate={{ scale: 1, rotate: 0 }} transition={{ ...SPRING, delay: 0.1 }}
style={{ width: 54, height: 54, borderRadius: '50%', background: tone.color, display: 'flex', alignItems: 'center', justifyContent: 'center', margin: '0 auto 12px' }}>
{calm ? <IconCheck size={26} style={{ color: '#fff' }} /> : <IconShieldCheck size={26} style={{ color: '#fff' }} />}
</motion.div>
<div style={{ fontSize: 15, fontWeight: 700, color: T.text }}>{s.resolutionTitle}</div>
<div style={{ fontSize: 11.5, color: tone.color, marginTop: 4 }}>{s.resolutionBody}</div>
</motion.div>
{s.statusChange && (
<motion.div initial={{ opacity: 0, y: 6 }} animate={{ opacity: 1, y: 0 }} transition={{ delay: 0.2 }}
style={{ background: T.surface2, border: `1px solid ${T.border}`, borderRadius: 14, padding: '12px 14px', fontSize: 12, color: T.text2, display: 'flex', alignItems: 'center', gap: 9 }}>
<span style={{ color: tone.color }}>›</span>{s.statusChange}
</motion.div>
)}
</motion.div>
)
}
function EndCard() {
return (
<motion.div initial={{ opacity: 0 }} animate={{ opacity: 1 }} transition={{ duration: 0.5 }}
style={{ position: 'absolute', inset: 0, zIndex: 60, background: T.bg, backgroundImage: T.bgGrad, display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', gap: 16, padding: '0 24px', textAlign: 'center' }}>
<motion.div initial={{ scale: 0.6, opacity: 0 }} animate={{ scale: 1, opacity: 1 }} transition={SPRING} style={{ position: 'relative' }}>
<motion.div animate={{ scale: [1, 1.3, 1], opacity: [0.25, 0.05, 0.25] }} transition={{ duration: 3, repeat: Infinity }}
style={{ position: 'absolute', inset: -16, borderRadius: '50%', background: T.accent, filter: 'blur(12px)' }} />
<div style={{ position: 'relative' }}><HexLogo size={52} /></div>
</motion.div>
<div>
<div style={{ fontSize: 20, fontWeight: 700, color: T.text, letterSpacing: '-.4px' }}>BlackDice</div>
<div style={{ fontSize: 11, color: T.muted, marginTop: 4, letterSpacing: '.3px' }}>Powered by BlackDice</div>
</div>
<motion.div initial={{ opacity: 0, y: 8 }} animate={{ opacity: 1, y: 0 }} transition={{ delay: 0.35 }}
style={{ background: T.accent, color: '#fff', fontSize: 13, fontWeight: 600, padding: '11px 28px', borderRadius: 100, boxShadow: `0 10px 28px ${T.accent}55` }}>
Book a Demo
</motion.div>
<motion.div initial={{ opacity: 0 }} animate={{ opacity: 1 }} transition={{ delay: 0.6 }}
style={{ fontSize: 10.5, color: T.muted, letterSpacing: '.4px' }}>blackdice.com</motion.div>
</motion.div>
)
}
// Apple bezel-less phone (matches the /demo-video PhoneShell)
export function ThreatPhone({ s, phase, score, tapped }: {
s: ThreatScenario; phase: number; score: number; tapped: boolean
}) {
const activeTab = s.id === 'appperms' ? 4 : 0
return (
<div style={{
width: 275, height: 600, flexShrink: 0, position: 'relative',
borderRadius: 50, padding: 4,
background: 'linear-gradient(150deg, #2c3a42 0%, #0c1418 45%, #1a262d 100%)',
boxShadow: `0 50px 100px rgba(0,0,0,.75), 0 8px 30px rgba(0,0,0,.5), inset 0 0 0 1px rgba(255,255,255,.06)`,
}}>
<div style={{ width: '100%', height: '100%', borderRadius: 46, overflow: 'hidden', position: 'relative', background: T.bg, backgroundImage: T.bgGrad, boxShadow: 'inset 0 0 0 1px rgba(0,0,0,.6)' }}>
{/* status bar */}
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', padding: '16px 26px 8px', fontSize: 11, color: T.text, fontWeight: 600 }}>
<span>9:41</span><span style={{ fontSize: 10, color: T.muted }}>5G&nbsp;&nbsp;▲ 100%</span>
</div>
{/* dynamic island */}
<div style={{ position: 'absolute', top: 12, left: '50%', transform: 'translateX(-50%)', width: 92, height: 26, borderRadius: 14, background: '#000', zIndex: 30 }} />
<div style={{ position: 'absolute', top: 42, bottom: 58, left: 0, right: 0, overflowY: 'auto', padding: '6px 13px 8px' }}>
<motion.div key={phase <= 3 ? 'home' : phase === 4 ? 'detail' : 'resolution'}
initial={{ opacity: 0 }} animate={{ opacity: 1 }} transition={{ duration: 0.3 }}>
{phase <= 3 && <HomeContent s={s} phase={phase} />}
{phase === 4 && <DetailContent s={s} tapped={tapped} />}
{phase >= 5 && <ResolutionContent s={s} />}
</motion.div>
</div>
<div style={{ position: 'absolute', left: 0, right: 0, bottom: 0, height: 58, background: T.surfaceStr, borderTop: `1px solid ${T.border}`, display: 'flex', alignItems: 'center', justifyContent: 'space-around', paddingBottom: 6 }}>
{TABS.map((t, i) => (
<div key={t.label} style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 2, fontSize: 9, color: i === activeTab ? T.accent : T.dim }}>
<t.Icon size={18} style={{ color: i === activeTab ? T.accent : T.dim }} />{t.label}
</div>
))}
</div>
{phase >= 6 && <EndCard />}
<div style={{ position: 'absolute', inset: 0, borderRadius: 46, pointerEvents: 'none', background: 'linear-gradient(135deg, rgba(255,255,255,.07) 0%, rgba(255,255,255,0) 32%)', zIndex: 40 }} />
</div>
</div>
)
}
const PHASE_LABEL = ['', 'Setup', 'Detection', 'Risk Impact', 'Response', 'Resolution', 'Book a Demo']
// ── Cinematic player (matches /demo-video layout) ─────────────────────────────
export function ThreatCinematic({ scenario, autoPlay = false, chrome = true, bare = false }: {
scenario: ThreatScenario; autoPlay?: boolean; chrome?: boolean
/** Drops the player's own backdrop so the phone sits directly on the page. */
bare?: boolean
}) {
const [elapsed, setElapsed] = useState(0)
const [started, setStarted] = useState(false)
const [muted, setMuted] = useState(false)
const [score, setScore] = useState(scenario.initialScore)
const [tapped, setTapped] = useState(false)
const rafRef = useRef(0)
const t0Ref = useRef(0)
const riskStarted = useRef(false)
const spokenPhase = useRef(-1)
const phase = phaseOf(elapsed)
const cancelSpeech = () => { try { window.speechSynthesis && window.speechSynthesis.cancel() } catch { /* noop */ } }
function start() {
setStarted(true)
t0Ref.current = performance.now() - elapsed
const tick = () => {
const now = performance.now() - t0Ref.current
setElapsed(now)
if (now < PHASES.total) rafRef.current = requestAnimationFrame(tick)
else setStarted(false)
}
rafRef.current = requestAnimationFrame(tick)
}
function pause() { setStarted(false); cancelAnimationFrame(rafRef.current); cancelSpeech() }
// Auto-play on mount (used by the slider)
useEffect(() => {
if (!autoPlay) return
const id = setTimeout(() => start(), 450)
return () => clearTimeout(id)
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [])
useEffect(() => () => { cancelAnimationFrame(rafRef.current); cancelSpeech() }, [])
// Risk count-up (keyed on phase so it fires once)
useEffect(() => {
if (!started || phase < 3 || riskStarted.current) return
riskStarted.current = true
const controls = animate(scenario.initialScore, scenario.finalScore, {
duration: RISK_ANIM_MS / 1000, ease: [0.22, 1, 0.36, 1],
onUpdate: (v) => setScore(Math.round(v)),
})
return () => controls.stop()
}, [phase, started, scenario])
// Auto-tap the primary action in phase 4
useEffect(() => {
if (phase === 4 && !tapped) {
const id = setTimeout(() => setTapped(true), 2600)
return () => clearTimeout(id)
}
}, [phase, tapped])
// Muting mid-line only stops future cues by itself — the utterance already
// in flight keeps talking until it ends. Cancel it the instant mute is toggled on.
useEffect(() => {
if (muted) cancelSpeech()
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [muted])
// Voiceover per phase
useEffect(() => {
if (!started || muted) return
const cueIndex = phase >= 6 ? 4 : phase - 1
if (cueIndex < 0 || cueIndex > 4 || spokenPhase.current === cueIndex) return
spokenPhase.current = cueIndex
const synth = window.speechSynthesis
if (!synth) return
const cue = scenario.voCues[cueIndex]
if (!cue) return
const speakNow = () => {
synth.cancel()
const u = new SpeechSynthesisUtterance(cue.text)
u.lang = 'en-GB'; u.rate = 0.82; u.pitch = 0.84
// Muting or pausing calls synth.cancel(), which fires a benign
// "canceled"/"interrupted" error event on the utterance — swallow it.
u.onerror = () => {}
const vs = synth.getVoices()
// Prefer real neural/online voices (Edge, iOS, Chrome-on-Android) — they hold
// natural prosody even at a slowed rate, unlike legacy on-device synthetic voices.
const v = vs.find((x) => /en-GB/i.test(x.lang) && /natural|neural|online/i.test(x.name) && /libby|sonia|hazel|serena/i.test(x.name))
|| vs.find((x) => /en-GB/i.test(x.lang) && /natural|neural|online/i.test(x.name))
|| vs.find((x) => /en-GB/i.test(x.lang) && /libby|sonia|hazel|serena/i.test(x.name))
|| vs.find((x) => /en-GB/i.test(x.lang) && /female|google uk english female|samantha/i.test(x.name))
|| vs.find((x) => /en-GB/i.test(x.lang))
|| vs.find((x) => /^en/i.test(x.lang))
if (v) u.voice = v
synth.speak(u)
}
// getVoices() often returns an empty list on the very first call — the browser
// loads voices asynchronously, so without this the demo silently falls back to
// whatever default (often the least natural-sounding) voice is installed.
if (synth.getVoices().length === 0) {
const onReady = () => { synth.removeEventListener('voiceschanged', onReady); speakNow() }
synth.addEventListener('voiceschanged', onReady)
} else {
speakNow()
}
}, [phase, started, muted, scenario])
const curVo = scenario.voCues[phase >= 6 ? 4 : Math.max(0, phase - 1)]
return (
<div className="bd-demo-root" style={{
position: 'absolute', inset: 0, overflow: 'hidden',
background: bare
? 'transparent'
: 'radial-gradient(130% 90% at 50% 0%, #075466 0%, #013B49 38%, #021b22 72%, #0a1a22 100%)',
fontFamily: "'Ubuntu', -apple-system, system-ui, sans-serif", WebkitFontSmoothing: 'antialiased',
display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center',
}}>
{!bare && (
<div style={{ position: 'absolute', inset: 0, pointerEvents: 'none', background: 'radial-gradient(120% 80% at 50% 45%, transparent 50%, rgba(0,0,0,.5) 100%)' }} />
)}
{chrome && (
<div style={{ position: 'absolute', top: 20, left: 24, display: 'flex', alignItems: 'center', gap: 8, zIndex: 50 }}>
<span style={{ fontSize: 9, fontWeight: 700, letterSpacing: '1.5px', textTransform: 'uppercase', color: T.accent }}>{scenario.tagLabel}</span>
<span style={{ width: 14, height: 1, background: 'rgba(255,255,255,.2)' }} />
<span style={{ fontSize: 11, color: 'rgba(255,255,255,.65)' }}>{PHASE_LABEL[phase]}</span>
</div>
)}
{started && chrome && (
<div style={{ position: 'absolute', top: 18, right: 22, display: 'flex', alignItems: 'center', gap: 6, background: 'rgba(0,0,0,.5)', border: '1px solid rgba(255,255,255,.1)', borderRadius: 100, padding: '6px 12px', zIndex: 60 }}>
<motion.span animate={{ opacity: [1, 0, 1] }} transition={{ duration: 1.2, repeat: Infinity }} style={{ width: 8, height: 8, borderRadius: '50%', background: '#ef4444', display: 'inline-block' }} />
<span style={{ fontSize: 10, fontWeight: 700, color: '#fff' }}>REC</span>
</div>
)}
{/* stage: phone + VO subtitle, centred */}
<div style={{ flex: 1, minHeight: 0, display: 'flex', alignItems: 'center', justifyContent: 'center', zIndex: 1, padding: '8px 0' }}>
{/* phone column: device + its subtitle directly beneath */}
<div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 14 }}>
<motion.div style={{ perspective: 1300 }}>
<motion.div animate={{ rotateY: -3, rotateX: 2 }} transition={{ duration: 1.1, ease: EASE_OUT }} style={{ transformStyle: 'preserve-3d' }}>
<motion.div animate={{ y: [0, -7, 0] }} transition={{ duration: 5, repeat: Infinity, ease: 'easeInOut' }}
onClick={() => (started ? pause() : start())}
style={{ position: 'relative', width: 275 * PHONE_SCALE, height: 600 * PHONE_SCALE, cursor: 'pointer' }}>
<div style={{ position: 'absolute', inset: '8% 14%', borderRadius: '50%', background: T.accent, opacity: 0.16, filter: 'blur(55px)', zIndex: 0 }} />
<div style={{ transform: `scale(${PHONE_SCALE})`, transformOrigin: 'top left' }}>
<ThreatPhone s={scenario} phase={phase} score={score} tapped={tapped} />
</div>
<motion.button whileTap={{ scale: 0.92 }}
onClick={(e) => { e.stopPropagation(); setMuted((m) => !m) }}
title={muted ? 'Unmute' : 'Mute'}
style={{
position: 'absolute', top: 16, right: 16, zIndex: 55,
width: 32, height: 32, borderRadius: '50%',
background: 'rgba(0,0,0,.45)', backdropFilter: 'blur(10px)',
border: `1px solid ${muted ? 'rgba(255,255,255,.16)' : T.accentGlow}`,
color: muted ? 'rgba(255,255,255,.7)' : T.accent, fontSize: 13,
cursor: 'pointer', fontFamily: 'inherit',
display: 'flex', alignItems: 'center', justifyContent: 'center',
}}>
{muted ? '🔇' : '🔊'}
</motion.button>
</motion.div>
</motion.div>
</motion.div>
{/* VO subtitle — directly under the phone */}
<div style={{ position: 'relative', width: 320, maxWidth: '86vw', height: 46 }}>
<AnimatePresence mode="wait">
<motion.div key={phase} initial={{ opacity: 0, y: 6 }} animate={{ opacity: 1, y: 0 }} exit={{ opacity: 0, y: -4 }} transition={{ duration: 0.5, ease: EASE_OUT }}
style={{ position: 'absolute', inset: 0, display: 'flex', alignItems: 'flex-start', justifyContent: 'center', textAlign: 'center' }}>
<span style={{ fontSize: 14.5, color: 'rgba(255,255,255,.9)', lineHeight: 1.5 }}>{curVo?.text}</span>
</motion.div>
</AnimatePresence>
</div>
</div>
</div>
</div>
)
}
// Default export: full-screen single player (used by /threat-demo/:id)
export default function ThreatDemo({ scenario }: { scenario: ThreatScenario }) {
return (
<div style={{ position: 'relative', height: '100vh' }}>
<ThreatCinematic scenario={scenario} />
</div>
)
}
+36
View File
@@ -0,0 +1,36 @@
import { useNavigate, useParams } from 'react-router-dom'
import ThreatDemo from './ThreatDemo'
import { getScenario } from './scenarios'
/** Full-screen player for a single threat scenario — one URL per demo video. */
export default function ThreatDemoPlayerPage() {
const { id } = useParams()
const navigate = useNavigate()
const scenario = getScenario(id)
if (!scenario) {
return (
<div style={{ minHeight: '100vh', display: 'flex', alignItems: 'center', justifyContent: 'center', background: '#010e14', color: '#b9cdd1', fontFamily: "'Ubuntu', system-ui, sans-serif", flexDirection: 'column', gap: 16 }}>
<div>Demo not found.</div>
<button onClick={() => navigate('/threat-demos')} style={{ background: '#3BB586', color: '#fff', border: 'none', borderRadius: 100, padding: '10px 22px', fontFamily: 'inherit', fontWeight: 600, cursor: 'pointer' }}>← All demos</button>
</div>
)
}
return (
<div style={{ position: 'relative' }}>
<button
onClick={() => navigate('/threat-demos')}
style={{
position: 'fixed', top: 18, left: 24, zIndex: 80,
display: 'inline-flex', alignItems: 'center', gap: 7,
fontFamily: "'Ubuntu', system-ui, sans-serif", fontSize: 13, fontWeight: 500,
color: 'rgba(255,255,255,.75)', background: 'rgba(0,0,0,.45)', backdropFilter: 'blur(10px)',
border: '1px solid rgba(255,255,255,.12)', borderRadius: 100, padding: '7px 14px', cursor: 'pointer',
}}>
← All demos
</button>
<ThreatDemo scenario={scenario} />
</div>
)
}
+96
View File
@@ -0,0 +1,96 @@
import { useState } from 'react'
import { useNavigate } from 'react-router-dom'
import { AnimatePresence, motion } from 'framer-motion'
import { THREAT_SCENARIOS } from './scenarios'
import { ThreatCinematic } from './ThreatDemo'
import '../demo.css'
const ACCENT = '#3BB586'
// Isolated so useNavigate() is only ever invoked when this is actually mounted
// under a <Router> — the embedded (no-router) instance never renders it.
function BackToSiteButton() {
const navigate = useNavigate()
return (
<button onClick={() => navigate('/')} style={{ display: 'inline-flex', alignItems: 'center', gap: 7, fontFamily: 'inherit', fontSize: 13, fontWeight: 500, color: 'rgba(255,255,255,.8)', background: 'rgba(255,255,255,.05)', border: '1px solid rgba(255,255,255,.12)', borderRadius: 100, padding: '7px 14px', cursor: 'pointer', flexShrink: 0 }}>← Back to site</button>
)
}
export default function ThreatDemosSlider({ embedded = false }: { embedded?: boolean } = {}) {
const [idx, setIdx] = useState(0)
const [dir, setDir] = useState(1)
const scenario = THREAT_SCENARIOS[idx]
const n = THREAT_SCENARIOS.length
const go = (next: number) => {
setDir(next > idx ? 1 : -1)
setIdx((next + n) % n)
}
return (
<div className="bd-demo-root" style={{ position: 'relative', height: embedded ? '100%' : '100vh', overflow: 'hidden', background: '#010e14', fontFamily: "'Ubuntu', -apple-system, system-ui, sans-serif", display: 'flex', flexDirection: 'column' }}>
{/* ── Top bar (reserved) — standalone /threat-demos only ── */}
{!embedded && (
<div style={{ flexShrink: 0, height: 60, display: 'flex', alignItems: 'center', justifyContent: 'space-between', padding: '0 20px', borderBottom: '1px solid rgba(255,255,255,.06)', background: 'rgba(1,14,20,.7)', backdropFilter: 'blur(10px)', zIndex: 80 }}>
<BackToSiteButton />
<div style={{ textAlign: 'center', color: '#e8f4f3', minWidth: 0 }}>
<div style={{ fontSize: 14, fontWeight: 600, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>{scenario.title}</div>
<div style={{ fontSize: 10.5, color: '#8aa5ab' }}>{idx + 1} / {n} · {scenario.product}</div>
</div>
<div style={{ display: 'flex', alignItems: 'center', gap: 6, background: 'rgba(0,0,0,.4)', border: '1px solid rgba(255,255,255,.1)', borderRadius: 100, padding: '5px 11px', flexShrink: 0 }}>
<motion.span animate={{ opacity: [1, 0, 1] }} transition={{ duration: 1.2, repeat: Infinity }} style={{ width: 7, height: 7, borderRadius: '50%', background: '#ef4444', display: 'inline-block' }} />
<span style={{ fontSize: 10, fontWeight: 700, color: '#fff', letterSpacing: '.5px' }}>REC</span>
</div>
</div>
)}
{/* ── Stage (flex, holds the sliding players) ── */}
<div style={{ position: 'relative', flex: 1, minHeight: 0, overflow: 'hidden' }}>
<AnimatePresence initial={false} custom={dir} mode="popLayout">
<motion.div
key={scenario.id}
custom={dir}
initial={{ x: dir > 0 ? '100%' : '-100%' }}
animate={{ x: 0 }}
exit={{ x: dir > 0 ? '-100%' : '100%' }}
transition={{ type: 'spring', stiffness: 260, damping: 30 }}
style={{ position: 'absolute', inset: 0 }}>
<ThreatCinematic scenario={scenario} autoPlay chrome={false} />
</motion.div>
</AnimatePresence>
{/* Prev / Next arrows (inside the stage, vertically centred) */}
<button onClick={() => go(idx - 1)} aria-label="Previous" style={navBtn('left')}>‹</button>
<button onClick={() => go(idx + 1)} aria-label="Next" style={navBtn('right')}>›</button>
</div>
{/* ── Bottom: scenario tabs (reserved) — moves above the stage on mobile via .bd-demo-tabs media query ── */}
<div className="bd-demo-tabs" style={{ flexShrink: 0, minHeight: 56, display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 8, flexWrap: 'wrap', padding: '10px 16px', borderTop: '1px solid rgba(255,255,255,.06)', background: 'rgba(1,14,20,.7)', backdropFilter: 'blur(10px)', zIndex: 80 }}>
{THREAT_SCENARIOS.map((s, i) => (
<button key={s.id} onClick={() => go(i)}
style={{
fontFamily: 'inherit', fontSize: 11, fontWeight: 500, cursor: 'pointer',
padding: '6px 12px', borderRadius: 100,
border: `1px solid ${i === idx ? ACCENT : 'rgba(255,255,255,.12)'}`,
background: i === idx ? 'rgba(59,181,134,0.18)' : 'rgba(255,255,255,.03)',
color: i === idx ? ACCENT : 'rgba(255,255,255,.6)', whiteSpace: 'nowrap',
}}>
{s.title}
</button>
))}
</div>
</div>
)
}
function navBtn(side: 'left' | 'right'): React.CSSProperties {
return {
position: 'absolute', top: '50%', transform: 'translateY(-50%)', [side]: 16,
zIndex: 70, width: 44, height: 44, borderRadius: '50%',
background: 'rgba(0,0,0,.45)', backdropFilter: 'blur(10px)',
border: '1px solid rgba(255,255,255,.14)', color: '#e8f4f3',
fontSize: 22, lineHeight: 1, cursor: 'pointer', fontFamily: 'inherit',
display: 'flex', alignItems: 'center', justifyContent: 'center',
} as React.CSSProperties
}
+252
View File
@@ -0,0 +1,252 @@
// ── Threat-detection demo scenarios ──────────────────────────────────────────
// Each scenario drives a 5-phase, ~34s recordable demo video:
// P1 Setup → P2 Detection → P3 Risk-score impact → P4 Response → P5 Resolution/CTA
export type Severity = 'red' | 'yellow' | 'green'
export type ProductTag = 'sdk' | 'halo' | 'dns'
export interface ThreatAction {
label: string
primary?: boolean
icon?: string
}
export interface VoCue {
at: number // ms from start
text: string
}
export interface ThreatScenario {
id: string
file: string // export file name
product: string // "Mobile SDK" | "Halo Platform" | "DNS Shield"
tag: ProductTag
tagLabel: string // "SDK · CALL"
title: string
blurb: string
icon: string // emoji
context: string // home-screen context line
initialScore: number
finalScore: number
severity: Severity // colour at the final score
threatTitle: string
threatBody: string
detailHeadline: string
detailLines: string[]
actions: ThreatAction[] // first with primary:true is the highlighted/tapped one
resolutionTitle: string
resolutionBody: string
resolutionTone: Severity // calm green for prevention, else elevated
statusChange?: string // e.g. family member status after the event
voCues: VoCue[]
}
// Phase timings (ms) — shared across scenarios
export const PHASES = {
setupEnd: 4000,
detectEnd: 9000,
riskEnd: 15000,
responseEnd: 24000,
resolutionEnd: 30000,
endCard: 30000,
total: 34500,
}
// When the risk number animates (start of phase 3) and for how long
export const RISK_ANIM_AT = 9200
export const RISK_ANIM_MS = 2000
export const THREAT_SCENARIOS: ThreatScenario[] = [
{
id: 'callscam',
file: 'blackdice-demo-01-call-scam.mp4',
product: 'Mobile SDK',
tag: 'sdk',
tagLabel: 'SDK · CALL',
title: 'Scam Call Detection',
blurb: 'A suspicious call with a spoofed caller ID. BlackDice Angel risk rises to 85, and blocking is recommended.',
icon: '📞',
context: 'Your family is protected',
initialScore: 25,
finalScore: 85,
severity: 'red',
threatTitle: 'Scam Call Detected',
threatBody: 'Suspicious call from +44 7890 123456',
detailHeadline: 'Caller ID appears spoofed',
detailLines: [
'Number matches a known scam pattern',
'Caller ID does not match the carrier record',
'Reported by 240+ BlackDice users',
],
actions: [
{ label: 'Block caller', primary: true, icon: '🚫' },
{ label: 'Report', icon: '⚑' },
],
resolutionTitle: 'Caller blocked',
resolutionBody: 'Scam number blocked · incident reported',
resolutionTone: 'red',
statusChange: 'Risk stays elevated until reviewed',
voCues: [
{ at: 300, text: 'We monitor every incoming call in real time.' },
{ at: 4300, text: 'We detect a suspicious call with a spoofed caller ID.' },
{ at: 9400, text: 'Our BlackDice Angel risk score rises from 25 to 85, so we recommend taking a closer look.' },
{ at: 15500, text: 'With one tap, the user can block the caller and report the incident.' },
{ at: 30300, text: 'We protect families from phone scams. Book a demo today.' },
],
},
{
id: 'smsscam',
file: 'blackdice-demo-02-sms-scam.mp4',
product: 'Mobile SDK',
tag: 'sdk',
tagLabel: 'SDK · SMS',
title: 'Scam SMS Detection',
blurb: 'A phishing SMS with a malicious link. BlackDice Angel risk rises to 78, and it’s best not to click.',
icon: '✉️',
context: 'Your family is protected',
initialScore: 20,
finalScore: 78,
severity: 'red',
threatTitle: 'SMS Scam Detected',
threatBody: '“Your bank account has been compromised…”',
detailHeadline: 'Known phishing attempt',
detailLines: [
'Message contains a malicious shortened link',
'Impersonates your bank’s security team',
'Best not to tap the link or reply',
],
actions: [
{ label: 'Delete message', primary: true, icon: '🗑' },
{ label: 'Report', icon: '⚑' },
],
resolutionTitle: 'Message removed',
resolutionBody: 'Phishing SMS deleted · sender reported',
resolutionTone: 'red',
voCues: [
{ at: 300, text: 'We scan messages for phishing in real time.' },
{ at: 4300, text: 'A scam SMS tries to trick the user with a fake bank alert.' },
{ at: 9400, text: 'We raise the BlackDice Angel risk score to 78, flagging the suspicious link.' },
{ at: 15500, text: 'The user is gently warned not to click, and can delete and report the message.' },
{ at: 30300, text: 'We protect families from phishing. Book a demo today.' },
],
},
{
id: 'simswap',
file: 'blackdice-demo-03-sim-swap.mp4',
product: 'Mobile SDK',
tag: 'sdk',
tagLabel: 'SDK · SIM',
title: 'SIM Swap Detection',
blurb: 'Mia’s SIM was swapped to a new device. BlackDice Angel risk rises to 92, and we recommend acting quickly.',
icon: '📱',
context: 'Mia · Online',
initialScore: 15,
finalScore: 92,
severity: 'red',
threatTitle: 'SIM Swap Detected',
threatBody: 'Mia’s SIM card was changed to a new device',
detailHeadline: 'Worth reviewing as soon as you can',
detailLines: [
'SIM moved to an unrecognised device',
'Could allow someone to access accounts using one-time codes',
'Confirm it’s really Mia before continuing',
],
actions: [
{ label: 'Verify identity', primary: true, icon: '🛡' },
{ label: 'Contact Mia', icon: '📞' },
],
resolutionTitle: 'Account locked',
resolutionBody: 'Mia’s number secured · awaiting verification',
resolutionTone: 'red',
statusChange: 'Mia · ⚠️ SIM changed',
voCues: [
{ at: 300, text: 'We watch for SIM-swap attacks across the family.' },
{ at: 4300, text: 'We detect a SIM swap on Mia’s account.' },
{ at: 9400, text: 'Our BlackDice Angel risk score rises to 92, so we recommend acting quickly.' },
{ at: 15500, text: 'The parent is gently prompted to confirm Mia’s identity and block unauthorised access.' },
{ at: 30300, text: 'We help stop account takeover. Book a demo today.' },
],
},
{
id: 'dns',
file: 'blackdice-demo-06-dns-block.mp4',
product: 'DNS Shield',
tag: 'dns',
tagLabel: 'DNS · BLOCK',
title: 'Malicious DNS Block',
blurb: 'Request to a malicious domain blocked. BlackDice Angel risk stays low at 45 — prevention in action.',
icon: '🌐',
context: 'DNS Shield active',
initialScore: 35,
finalScore: 45,
severity: 'green',
threatTitle: 'Malicious DNS Blocked',
threatBody: 'Blocked request to phishing-domain.com',
detailHeadline: 'Threat blocked before it could load',
detailLines: [
'phishing-domain.com — known malicious domain',
'Request intercepted at the DNS layer',
'12 malicious domains blocked this week',
],
actions: [
{ label: 'View dashboard', primary: true, icon: '📊' },
{ label: 'Dismiss', icon: '×' },
],
resolutionTitle: 'Risk contained',
resolutionBody: 'DNS Shield blocked the threat automatically',
resolutionTone: 'green',
voCues: [
{ at: 300, text: 'Our DNS Shield filters every domain request.' },
{ at: 4300, text: 'A device tries to reach a known malicious domain.' },
{ at: 9400, text: 'We block it instantly — our risk score stays low at 45.' },
{ at: 15500, text: 'The threat is stopped before any damage, and logged in the dashboard.' },
{ at: 30300, text: 'We deliver prevention that just works. Book a demo today.' },
],
},
{
id: 'appperms',
file: 'blackdice-demo-07-app-permissions.mp4',
product: 'Mobile SDK',
tag: 'sdk',
tagLabel: 'SDK · PERM',
title: 'Risky App Permissions',
blurb: 'An app requests more permissions than it needs. BlackDice Angel risk rises to 66, worth a review.',
icon: '📲',
context: 'Approvals · 1 pending',
initialScore: 32,
finalScore: 66,
severity: 'yellow',
threatTitle: 'Risky App Permissions',
threatBody: '“PhotoEditor” requests contacts and location',
detailHeadline: 'Asking for more than it needs',
detailLines: [
'Contacts and location access requested',
'Not required for this app’s function',
'Age rating: 12+',
],
actions: [
{ label: 'Decline', primary: true, icon: '×' },
{ label: 'Approve & install', icon: '✓' },
],
resolutionTitle: 'Install declined',
resolutionBody: 'PhotoEditor blocked · request closed',
resolutionTone: 'yellow',
statusChange: 'PhotoEditor · request reviewed',
voCues: [
{ at: 300, text: 'We review every app your child wants to install.' },
{ at: 4300, text: 'PhotoEditor asks for more than it needs — contacts and location.' },
{ at: 9400, text: 'We flag the risk and raise our BlackDice Angel score to 66.' },
{ at: 15500, text: 'The parent can review the permissions and decline the install.' },
{ at: 30300, text: 'We make apps safer for younger users. Book a demo today.' },
],
},
]
export function getScenario(id: string | undefined): ThreatScenario | undefined {
return THREAT_SCENARIOS.find((s) => s.id === id)
}
export function scoreColor(score: number): Severity {
if (score >= 70) return 'red'
if (score >= 50) return 'yellow'
return 'green'
}