/* @jsx React.createElement */
/* Enrollment Flow — multi-step interactive preview */
const ENROLL_STEPS = [
{ id: 0, label: 'Siapa' },
{ id: 1, label: 'Instrumen' },
{ id: 2, label: 'Format' },
{ id: 3, label: 'Jadwal' },
{ id: 4, label: 'Voucher' },
{ id: 5, label: 'Review' },
];
const FORMATS = [
{ id: 'private', name: 'Private', price: 1100000, sessions: 4, hint: '1-on-1 langsung sama Andre, di ruang kelas IMS.' },
{ id: 'group', name: 'Group', price: 700000, sessions: 4, hint: 'Maks 4 murid. Lebih murah, lebih seru, less spotlight.' },
{ id: 'in_home_private', name: 'In-Home Private', price: 1500000, sessions: 4, hint: 'Gurunya yang ke rumah kamu. Greater Jakarta only.' },
];
const SCHEDULES = [
{ day: 'Mon', slots: ['16:00', '17:30', '19:00'] },
{ day: 'Tue', slots: ['15:00', '16:30', '18:00', '19:30'] },
{ day: 'Wed', slots: ['16:00', '17:30'] },
{ day: 'Thu', slots: ['15:00', '17:00', '18:30'] },
{ day: 'Fri', slots: ['16:00', '17:30', '19:00'] },
{ day: 'Sat', slots: ['10:00', '11:30', '13:00', '15:00'] },
];
const VOUCHERS = [
{ code: 'INDIE-TRIAL', off: 100000, label: 'Trial bulan pertama · −Rp 100rb' },
{ code: 'IMS-WELCOME', off: 200000, label: 'Welcome to IMS · −Rp 200rb' },
{ code: 'GROUPSAVE-5', off: 50000, label: 'Group class saver · −Rp 50rb' },
];
function fmtIDR(n) {
return 'Rp ' + n.toLocaleString('id-ID');
}
function EnrollmentSection() {
const [step, setStep] = React.useState(0);
const [audience, setAudience] = React.useState('kid'); // 'kid' | 'adult'
const [instrument, setInstrument] = React.useState('guitar');
const [format, setFormat] = React.useState('private');
const [schedule, setSchedule] = React.useState({ day: 'Tue', slot: '17:30' });
const [voucher, setVoucher] = React.useState(null);
const formatObj = FORMATS.find(f => f.id === format);
const subtotal = formatObj.price;
const discount = voucher ? voucher.off : 0;
const total = subtotal - discount;
const next = () => setStep(s => Math.min(s + 1, ENROLL_STEPS.length - 1));
const back = () => setStep(s => Math.max(s - 1, 0));
return (
{/* Left: copy */}
「 Daftar · 5 step, ±3 menit 」
Coba dulu, gratis.
Decide later.
Pilih instrumen, pilih jam, dateng aja. Session pertama free buat murid baru.
Nggak perlu kartu kredit duluan. Enrollment beneran lewat Member App — ini cuma preview.
Butuh bantuan?
WA +62 899-8267-999
Andre Putra · Co-Founder & Main Teacher
{/* Right: stepper */}
{/* Steps header */}
{ENROLL_STEPS.map((s, i) => {
const done = i < step;
const active = i === step;
return (
setStep(i)} className="r-step-btn" style={{
all: 'unset', cursor: 'pointer', padding: '16px 12px',
display: 'flex', alignItems: 'center', gap: 10,
borderBottom: active ? '2px solid var(--accent-ims)' : '2px solid transparent',
background: 'transparent',
}}>
{done ? '✓' : i + 1}
{s.label}
);
})}
{/* Step content */}
{step === 0 && }
{step === 1 && }
{step === 2 && }
{step === 3 && }
{step === 4 && }
{step === 5 && }
{/* Footer */}
← Balik
Estimasi · 4 session / bulan
{fmtIDR(total)}
{step < ENROLL_STEPS.length - 1 ? (
Lanjut →
) : (
Confirm enrollment →
)}
);
}
/* ─── Step components ─── */
function StepLabel({ n, title, subtitle }) {
return (
Step 0{n}
{title}
{subtitle &&
{subtitle}
}
);
}
function StepWho({ audience, setAudience }) {
const opts = [
{ id: 'kid', title: 'Buat anakku', jp: 'こども', hint: 'Umur 5–17. Dashboard buat orang tua, stamp mingguan, no recital yang seram.' },
{ id: 'adult', title: 'Buat aku sendiri', jp: 'おとな', hint: 'Dewasa. Hobbyist welcome banget. Kita ketemuin di level kamu sekarang.' },
];
return (
{opts.map(o => {
const on = audience === o.id;
return (
setAudience(o.id)} style={{
all: 'unset', cursor: 'pointer',
padding: 22,
background: on ? 'var(--accent-ims)' : 'var(--page-surface)',
color: on ? '#fff' : 'var(--page-ink)',
border: `1.5px solid ${on ? 'var(--page-ink)' : 'var(--page-border)'}`,
borderRadius: 10,
boxShadow: on ? '4px 4px 0 var(--page-ink)' : 'none',
transform: on ? 'translate(-2px,-2px)' : 'translate(0,0)',
transition: 'all 180ms var(--ease-out)',
display: 'flex', flexDirection: 'column', gap: 10,
}}>
{o.title}
{o.jp}
{o.hint}
);
})}
Daftarin lebih dari satu orang? Pilih dulu yang pertama — sisanya bisa ditambah dari Member App.
);
}
function StepInstrument({ value, onChange }) {
return (
{window.INSTRUMENTS.map(i => {
const on = value === i.id;
return (
onChange(i.id)} style={{
all: 'unset', cursor: 'pointer',
padding: 18,
background: on ? 'var(--accent-ims)' : 'var(--page-surface)',
color: on ? '#fff' : 'var(--page-ink)',
border: `1.5px solid ${on ? 'var(--page-ink)' : 'var(--page-border)'}`,
borderRadius: 10,
boxShadow: on ? '3px 3px 0 var(--page-ink)' : 'none',
transform: on ? 'translate(-1px,-1px)' : 'translate(0,0)',
transition: 'all 180ms var(--ease-out)',
display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 10,
}}>
);
})}
);
}
function StepFormat({ value, onChange }) {
return (
{FORMATS.map(f => {
const on = value === f.id;
return (
onChange(f.id)} style={{
all: 'unset', cursor: 'pointer',
padding: '18px 22px',
background: on ? 'var(--page-surface)' : 'var(--page-bg)',
border: `1.5px solid ${on ? 'var(--accent-ims)' : 'var(--page-border)'}`,
borderRadius: 10,
boxShadow: on ? '4px 4px 0 var(--accent-ims)' : 'none',
transform: on ? 'translate(-2px,-2px)' : 'translate(0,0)',
transition: 'all 180ms var(--ease-out)',
display: 'flex', alignItems: 'center', gap: 20,
}}>
{fmtIDR(f.price)}
/ {f.sessions} session
);
})}
);
}
function StepSchedule({ value, onChange }) {
return (
{SCHEDULES.map(row => (
{row.day}
{row.slots.map(slot => {
const on = value.day === row.day && value.slot === slot;
return (
onChange({ day: row.day, slot })} style={{
all: 'unset', cursor: 'pointer',
padding: '8px 14px', borderRadius: 6,
background: on ? 'var(--accent-ims)' : 'var(--page-surface)',
color: on ? '#fff' : 'var(--page-ink)',
border: `1px solid ${on ? 'var(--page-ink)' : 'var(--page-border)'}`,
fontSize: 13, fontWeight: 600,
fontFamily: 'var(--font-mono)',
transition: 'all 160ms var(--ease-out)',
}}>{slot}
);
})}
))}
);
}
function StepVoucher({ value, onChange }) {
return (
{VOUCHERS.map(v => {
const on = value && value.code === v.code;
return (
onChange(on ? null : v)} style={{
all: 'unset', cursor: 'pointer',
padding: '16px 20px',
background: on ? 'var(--ims-red-tint)' : 'var(--page-surface)',
border: `1.5px dashed ${on ? 'var(--accent-ims)' : 'var(--page-border)'}`,
borderRadius: 10,
display: 'flex', alignItems: 'center', gap: 18,
transition: 'all 180ms var(--ease-out)',
}}>
{on ? '✓' : '%'}
);
})}
onChange(null)} style={{
all: 'unset', cursor: 'pointer',
padding: '14px 20px', fontSize: 14, color: 'var(--page-ink-3)',
alignSelf: 'flex-start',
}}>Skip voucher · lanjut tanpa diskon
);
}
function StepReview({ audience, instrument, format, formatObj, schedule, voucher, subtotal, discount, total }) {
const inst = window.INSTRUMENTS.find(i => i.id === instrument);
return (
Subtotal {fmtIDR(subtotal)}
{discount > 0 && (
Diskon −{fmtIDR(discount)}
)}
Total / bulan
{fmtIDR(total)}
Bayar lewat Xendit. Trial session pertama gratis buat murid baru — bayarnya setelah itu.
);
}
function ReviewRow({ k, v }) {
return (
{k}
{v}
);
}
Object.assign(window, { EnrollmentSection });