// Stand-in camera pictures for the meeting mockups: an illustrated person in a
// room, drawn as SVG so the sheet needs no photographs. Each `.tl[data-p]`
// gets one; data-label adds the name pill, data-mic its state (on/off/talk),
// data-blur blurs the room the way "Blur my background" would.
const PEOPLE = {
sanne: { skin:'#eab894', hair:'#7a4a2a', style:'long', shirt:'#35558a', bg:'office' },
fatima: { skin:'#b07a58', hair:'#2a1a14', style:'hijab', hijab:'#7d3d52', shirt:'#5b3442', bg:'warm' },
daan: { skin:'#f0c7a8', hair:'#c8a167', style:'short', shirt:'#3e6a50', bg:'plants', beard:true },
mei: { skin:'#f2d1b5', hair:'#19120e', style:'bob', shirt:'#8669b5', bg:'shelf' },
you: { skin:'#eec2a0', hair:'#4b3a2b', style:'short', shirt:'#2b3a41', bg:'window', glasses:true },
joris: { skin:'#6a432f', hair:'#140d0a', style:'curly', shirt:'#c46a33', bg:'kitchen' },
bakker: { skin:'#e7bb9b', hair:'#a9a9a9', style:'side', shirt:'#1d2328', bg:'hall', glasses:true, tie:'#8a2f3a' },
anna: { skin:'#f3d0b0', hair:'#b5542f', style:'long', shirt:'#2f7f78', bg:'window' },
};
let uid = 0;
function shade(hex, f) {
const n = parseInt(hex.slice(1), 16);
const c = [n >> 16, (n >> 8) & 255, n & 255].map(v => Math.max(0, Math.min(255, Math.round(f < 0 ? v * (1 + f) : v + (255 - v) * f))));
return '#' + c.map(v => v.toString(16).padStart(2, '0')).join('');
}
const leaf = (x, y, r, a, c) => ``;
function room(kind, id) {
const wall = { office:['#46555b','#273136'], warm:['#6e5546','#35281f'], plants:['#45594d','#243029'], shelf:['#4b4759','#262331'],
window:['#5b666c','#2d3438'], kitchen:['#625c53','#2f2b26'], hall:['#3d4855','#1f252d'] }[kind];
let s = ``;
if (kind === 'office') s += `${leaf(30,112,16,-40,'#3f7a4c')}${leaf(44,104,18,-70,'#4f8f5a')}${leaf(52,116,15,-10,'#36693f')}`;
if (kind === 'warm') s += ``;
if (kind === 'plants') s += `${leaf(28,70,26,-50,'#4c8a57')}${leaf(16,104,24,-20,'#3b7046')}${leaf(44,92,22,-80,'#5d9c63')}
${leaf(292,64,26,50,'#4c8a57')}${leaf(304,100,24,20,'#3b7046')}${leaf(276,90,20,80,'#5d9c63')}`;
if (kind === 'shelf') { s += ``;
[['#c06630',14],['#2c917c',10],['#e2c46a',12],['#4374c4',9],['#b84868',13],['#c9c3b5',11],['#5f8a2e',10]].forEach(([c,w],i)=>{ s += ``; }); }
if (kind === 'window') s += ``;
if (kind === 'kitchen') s += ``;
if (kind === 'hall') s += `${[0,1,2,3,4,5].map(i=>``).join('')}
`;
return s + ``;
}
function person(p, id, talking) {
const sk = p.skin, hd = p.hair, dk = shade(sk, -0.18);
let back = '', front = '';
if (p.style === 'long') back = ``;
if (p.style === 'bob') back = ``;
if (p.style === 'hijab') back = ``;
if (p.style === 'short') front = ``;
if (p.style === 'long') front = ``;
if (p.style === 'bob') front = ``;
if (p.style === 'curly') { for (let a = -205; a <= 25; a += 23) { const r = a * Math.PI / 180; front += ``; } front += ``; }
if (p.style === 'side') front = ``;
const hij = p.style === 'hijab';
const rx = hij ? 25 : 29, ry = hij ? 31 : 35;
let s = back;
// torso, collar, neck
s += ``;
if (p.tie) s += ``;
else if (!hij) s += ``;
if (hij) s += ``;
// head
if (!hij) s += ``;
s += ``;
s += front;
// features
const ey = hij ? 84 : 83;
s += ``;
if (p.beard) s += ``;
s += talking
? ``
: ``;
if (p.glasses) s += ``;
return s;
}
function face(key, { blur = false, talking = false } = {}) {
const p = PEOPLE[key], id = ++uid;
return ``;
}
const I = n => ``;
document.querySelectorAll('.tl[data-p]').forEach(el => {
const mic = el.dataset.mic || 'off';
el.insertAdjacentHTML('afterbegin', face(el.dataset.p, { blur: 'blur' in el.dataset, talking: mic === 'talk' }));
if (mic === 'talk') el.classList.add('talk');
if (el.dataset.label) {
const m = mic === 'off' ? `${I('micoff')}`
: mic === 'talk' ? ``
: `${I('mic')}`;
el.insertAdjacentHTML('beforeend', `