lam a medical student studying Occupational Health. Generate a professional, minimalist infographic layout about Psychological Occupational Hazards. The design should feature a clean, modern medical aesthetic with a soft, cohesive color palette. Divide the infographic into five distinct, organized sections with clear headings and relevant minimalist vector icons: Types of Exposure, At-Risk Industries, Signs & Symptoms, Medical Management, (showing clinical treatment), and Prevention & PPE. Ensure the portrait layout is uncluttered, leaving ample clean space under each heading for detailed medical text.
ls -la /home/daytona/workspace/ 2>/dev/null | head -20; mkdir -p /home/daytona/workspace/psych-occ-hazards
~/psych-occ-hazards/build.js
const pptxgen = require("pptxgenjs");
const pres = new pptxgen();
// Portrait layout: 7.5" wide × 10" tall (LAYOUT_4x3 is 10×7.5, so we define custom)
pres.defineLayout({ name: "PORTRAIT", width: 7.5, height: 10 });
pres.layout = "PORTRAIT";
// ─── PALETTE ────────────────────────────────────────────────────────────────
const C = {
bg: "F7F9FB", // near-white background
header_bg: "1B3A5C", // deep navy – title bar
accent1: "2E7DAF", // medium blue – section headers
accent2: "4CABB5", // teal – icon circles & accents
accent3: "E8F4FD", // very light blue – section card bg
stripe: "D6EAF8", // light stripe for alternating
text_dark: "1B2B3A", // near-black body
text_mid: "4A6275", // medium grey text
text_light: "FFFFFF", // white
tag_green: "27AE60", // green tag
tag_orange: "E67E22", // orange tag
tag_red: "C0392B", // red tag
tag_blue: "2980B9", // blue tag
tag_purple: "8E44AD", // purple tag
divider: "C8D8E4", // light divider line
};
// ─── SLIDE ───────────────────────────────────────────────────────────────────
const slide = pres.addSlide();
// Full background
slide.addShape(pres.shapes.RECTANGLE, {
x: 0, y: 0, w: 7.5, h: 10,
fill: { color: C.bg }, line: { color: C.bg }
});
// ════════════════════════════════════════════════════════════════════
// HEADER BANNER
// ════════════════════════════════════════════════════════════════════
slide.addShape(pres.shapes.RECTANGLE, {
x: 0, y: 0, w: 7.5, h: 0.95,
fill: { color: C.header_bg }, line: { color: C.header_bg }
});
// Teal accent strip at bottom of header
slide.addShape(pres.shapes.RECTANGLE, {
x: 0, y: 0.9, w: 7.5, h: 0.07,
fill: { color: C.accent2 }, line: { color: C.accent2 }
});
// Title
slide.addText("PSYCHOLOGICAL OCCUPATIONAL HAZARDS", {
x: 0.3, y: 0.1, w: 6.0, h: 0.45,
fontSize: 16, bold: true, color: C.text_light,
fontFace: "Calibri", charSpacing: 1.5,
align: "left", valign: "middle", margin: 0
});
// Subtitle
slide.addText("Occupational Health | Medical Student Reference", {
x: 0.3, y: 0.55, w: 5.5, h: 0.28,
fontSize: 8.5, color: C.accent2, fontFace: "Calibri",
align: "left", valign: "top", margin: 0, italic: true
});
// Cross icon (simple + shape using two rectangles)
// Vertical bar
slide.addShape(pres.shapes.RECTANGLE, {
x: 6.95, y: 0.17, w: 0.1, h: 0.55,
fill: { color: C.accent2 }, line: { color: C.accent2 }
});
// Horizontal bar
slide.addShape(pres.shapes.RECTANGLE, {
x: 6.72, y: 0.39, w: 0.55, h: 0.1,
fill: { color: C.accent2 }, line: { color: C.accent2 }
});
// ════════════════════════════════════════════════════════════════════
// HELPER: Draw a section card
// ════════════════════════════════════════════════════════════════════
// Each section: icon circle + colored header bar + content area
// Layout: y positions defined manually for 5 sections
// Available height after header: 10 - 0.97 = 9.03"
// 5 sections + small gaps: each section ~1.72" tall
const SECTIONS = [
{
y: 1.02,
color: "2E7DAF", // blue
icon_color: "2E7DAF",
label: "01",
heading: "TYPES OF EXPOSURE",
icon: "exposure",
items: [
{ tag: "Psychosocial", text: "High demands / low control (job strain model); effort–reward imbalance; role ambiguity & conflict" },
{ tag: "Organisational", text: "Shift work, long hours, understaffing, poor management, workplace violence & harassment" },
{ tag: "Traumatic", text: "Critical incidents, vicarious trauma (emergency, ICU, forensics, social work)" },
{ tag: "Chronic", text: "Cumulative stress, moral injury, compassion fatigue, systemic bullying & discrimination" },
]
},
{
y: 3.00,
color: "4CABB5", // teal
icon_color: "4CABB5",
label: "02",
heading: "AT-RISK INDUSTRIES",
icon: "industry",
items: [
{ tag: "Healthcare", text: "Physicians, nurses, paramedics — burnout rates ≥40%; high moral distress exposure" },
{ tag: "Emergency", text: "Police, firefighters, military — elevated PTSD & suicide risk; hypervigilance culture" },
{ tag: "Education", text: "Teachers, social workers — emotional labour, low autonomy, compassion fatigue" },
{ tag: "Corporate", text: "Finance, IT — deadline pressure, always-on culture, job insecurity, technostress" },
]
},
{
y: 4.98,
color: "5B7FA6", // slate blue
icon_color: "5B7FA6",
label: "03",
heading: "SIGNS & SYMPTOMS",
icon: "symptoms",
items: [
{ tag: "Psychological", text: "Anxiety, depression, PTSD (re-experiencing, avoidance, hyperarousal), burnout (exhaustion, cynicism, reduced efficacy)" },
{ tag: "Cognitive", text: "Impaired concentration, memory deficits, poor decision-making, cognitive fatigue" },
{ tag: "Somatic", text: "Insomnia, headaches, GI disturbance, CVD risk elevation (HTN, IHD), immune dysregulation" },
{ tag: "Behavioural", text: "Absenteeism, presenteeism, substance misuse, social withdrawal, increased error rates" },
]
},
{
y: 6.96,
color: "C0392B", // red-clinical
icon_color: "C0392B",
label: "04",
heading: "MEDICAL MANAGEMENT",
icon: "management",
items: [
{ tag: "Assessment", text: "PHQ-9 (depression), GAD-7 (anxiety), IES-R (PTSD), Maslach Burnout Inventory; occupational history" },
{ tag: "Pharmacology", text: "SSRIs/SNRIs for depression & anxiety; prazosin for PTSD nightmares; short-term hypnotics for insomnia" },
{ tag: "Psychotherapy", text: "CBT (first-line for burnout/anxiety/depression); EMDR & CPT for PTSD; ACT; mindfulness-based stress reduction" },
{ tag: "Referral", text: "EAP, occupational physician, psychiatry, vocational rehabilitation; urgent review if suicidal ideation" },
]
},
{
y: 8.94,
color: "27AE60", // green
icon_color: "27AE60",
label: "05",
heading: "PREVENTION & CONTROLS",
icon: "prevention",
items: [
{ tag: "Primary", text: "Job redesign, workload management, flexible scheduling, anti-harassment policy, leadership training" },
{ tag: "Secondary", text: "Stress inoculation, resilience programmes, regular clinical supervision, EAP access, peer support networks" },
{ tag: "Tertiary", text: "Early RTW programmes, graded exposure, duty modification, occupational rehabilitation" },
{ tag: "Legislation", text: "OHS Act obligations; risk assessments; reportable psychological injuries; employer duty of care" },
]
},
];
// Tag accent colours (cycle through palette)
const TAG_COLORS = ["2E7DAF", "4CABB5", "8E44AD", "E67E22", "27AE60", "C0392B"];
function hexLighten(hex, amt) {
// Returns a very light tint of hex (for row backgrounds)
let r = parseInt(hex.slice(0,2),16) + amt;
let g = parseInt(hex.slice(2,4),16) + amt;
let b = parseInt(hex.slice(4,6),16) + amt;
r = Math.min(255, r); g = Math.min(255, g); b = Math.min(255, b);
return r.toString(16).padStart(2,'0') + g.toString(16).padStart(2,'0') + b.toString(16).padStart(2,'0');
}
SECTIONS.forEach((sec, si) => {
const cardH = 1.84;
const cardX = 0.18;
const cardW = 7.14;
// ── Card background ──────────────────────────────────────────────
slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x: cardX, y: sec.y, w: cardW, h: cardH,
fill: { color: "FFFFFF" },
line: { color: C.divider, width: 0.5 },
rectRadius: 0.08,
shadow: { type: "outer", color: "C0CAD4", blur: 6, offset: 2, angle: 135, opacity: 0.18 }
});
// ── Coloured left accent bar ─────────────────────────────────────
slide.addShape(pres.shapes.RECTANGLE, {
x: cardX, y: sec.y, w: 0.06, h: cardH,
fill: { color: sec.color }, line: { color: sec.color }
});
// ── Section number badge ─────────────────────────────────────────
slide.addShape(pres.shapes.ELLIPSE, {
x: cardX + 0.12, y: sec.y + 0.08, w: 0.32, h: 0.32,
fill: { color: sec.color }, line: { color: sec.color }
});
slide.addText(sec.label, {
x: cardX + 0.12, y: sec.y + 0.08, w: 0.32, h: 0.32,
fontSize: 7.5, bold: true, color: "FFFFFF",
fontFace: "Calibri", align: "center", valign: "middle", margin: 0
});
// ── Section heading ──────────────────────────────────────────────
slide.addText(sec.heading, {
x: cardX + 0.52, y: sec.y + 0.08, w: 5.8, h: 0.30,
fontSize: 10.5, bold: true, color: sec.color,
fontFace: "Calibri", charSpacing: 0.8,
align: "left", valign: "middle", margin: 0
});
// ── Thin divider under heading ───────────────────────────────────
slide.addShape(pres.shapes.RECTANGLE, {
x: cardX + 0.52, y: sec.y + 0.41, w: cardW - 0.7, h: 0.015,
fill: { color: C.divider }, line: { color: C.divider }
});
// ── Content rows ─────────────────────────────────────────────────
const rowH = 0.315;
const rowStartY = sec.y + 0.45;
const rowX = cardX + 0.52;
const rowW = cardW - 0.7;
const tagW = 1.0;
const textX = rowX + tagW + 0.08;
const textW = rowW - tagW - 0.1;
sec.items.forEach((item, ri) => {
const rowY = rowStartY + ri * rowH;
// Alternating row background
if (ri % 2 === 0) {
slide.addShape(pres.shapes.RECTANGLE, {
x: rowX, y: rowY, w: rowW, h: rowH - 0.025,
fill: { color: hexLighten(sec.color, 220) },
line: { color: "FFFFFF", width: 0 }
});
}
// Tag pill
const tagColor = TAG_COLORS[(si + ri) % TAG_COLORS.length];
slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x: rowX + 0.04, y: rowY + 0.045, w: tagW - 0.08, h: rowH - 0.12,
fill: { color: tagColor }, line: { color: tagColor },
rectRadius: 0.05
});
slide.addText(item.tag, {
x: rowX + 0.04, y: rowY + 0.045, w: tagW - 0.08, h: rowH - 0.12,
fontSize: 6.8, bold: true, color: "FFFFFF",
fontFace: "Calibri", align: "center", valign: "middle", margin: 0
});
// Row text
slide.addText(item.text, {
x: textX, y: rowY + 0.03, w: textW, h: rowH - 0.06,
fontSize: 6.8, color: C.text_dark,
fontFace: "Calibri", align: "left", valign: "middle", margin: 0,
wrap: true
});
});
});
// ════════════════════════════════════════════════════════════════════
// FOOTER
// ════════════════════════════════════════════════════════════════════
slide.addShape(pres.shapes.RECTANGLE, {
x: 0, y: 9.84, w: 7.5, h: 0.16,
fill: { color: C.header_bg }, line: { color: C.header_bg }
});
slide.addText("Occupational Health | WHO ICD-11 | DSM-5 | Maslach Burnout Inventory | For Educational Use Only", {
x: 0.2, y: 9.845, w: 7.1, h: 0.12,
fontSize: 5.5, color: C.accent2, fontFace: "Calibri",
align: "center", valign: "middle", margin: 0, italic: true
});
// ════════════════════════════════════════════════════════════════════
// SAVE
// ════════════════════════════════════════════════════════════════════
pres.writeFile({ fileName: "/home/daytona/workspace/psych-occ-hazards/Psychological_Occupational_Hazards.pptx" })
.then(() => console.log("✅ Saved successfully"))
.catch(e => { console.error("❌ Error:", e); process.exit(1); });
cd /home/daytona/workspace/psych-occ-hazards && node build.js 2>&1
node -e "const p = require('pptxgenjs'); const x = new p(); console.log(Object.keys(x.shapes).filter(k => k.includes('ROUND') || k.includes('RECT')))"
node -e " function hexLighten(hex, amt) { let r = parseInt(hex.slice(0,2),16) + amt; let g = parseInt(hex.slice(2,4),16) + amt; let b = parseInt(hex.slice(4,6),16) + amt; r = Math.min(255, r); g = Math.min(255, g); b = Math.min(255, b); return r.toString(16).padStart(2,'0') + g.toString(16).padStart(2,'0') + b.toString(16).padStart(2,'0'); } // Test all section colors with 220 lighten const colors = ['2E7DAF','4CABB5','5B7FA6','C0392B','27AE60']; colors.forEach(c => console.log(c, '->', hexLighten(c, 220))); "
~/psych-occ-hazards/build.js
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/psych-occ-hazards/build.js'
~/psych-occ-hazards/build.js
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/psych-occ-hazards/build.js'
~/psych-occ-hazards/build.js
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/psych-occ-hazards/build.js'
cd /home/daytona/workspace/psych-occ-hazards && node build.js 2>&1
cat > /home/daytona/workspace/psych-occ-hazards/build.js << 'ENDOFSCRIPT' const pptxgen = require("pptxgenjs"); const pres = new pptxgen(); pres.defineLayout({ name: "PORTRAIT", width: 7.5, height: 10 }); pres.layout = "PORTRAIT"; const C = { bg: "F7F9FB", header_bg: "1B3A5C", accent1: "2E7DAF", accent2: "4CABB5", text_dark: "1B2B3A", text_light: "FFFFFF", divider: "C8D8E4", }; const slide = pres.addSlide(); // Background slide.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:7.5, h:10, fill:{color:C.bg}, line:{color:C.bg, width:0.5} }); // Header slide.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:7.5, h:0.95, fill:{color:C.header_bg}, line:{color:C.header_bg, width:0.5} }); slide.addShape(pres.shapes.RECTANGLE, { x:0, y:0.9, w:7.5, h:0.07, fill:{color:C.accent2}, line:{color:C.accent2, width:0.5} }); slide.addText("PSYCHOLOGICAL OCCUPATIONAL HAZARDS", { x:0.3, y:0.08, w:6.5, h:0.45, fontSize:16, bold:true, color:C.text_light, fontFace:"Calibri", charSpacing:1.5, align:"left", valign:"middle", margin:0 }); slide.addText("Occupational Health | Medical Student Reference", { x:0.3, y:0.55, w:5.5, h:0.28, fontSize:8.5, color:C.accent2, fontFace:"Calibri", align:"left", valign:"top", margin:0, italic:true }); // Cross icon slide.addShape(pres.shapes.RECTANGLE, { x:6.95, y:0.17, w:0.10, h:0.55, fill:{color:C.accent2}, line:{color:C.accent2, width:0.5} }); slide.addShape(pres.shapes.RECTANGLE, { x:6.72, y:0.39, w:0.55, h:0.10, fill:{color:C.accent2}, line:{color:C.accent2, width:0.5} }); // Sections definition const SECTIONS = [ { y:1.02, color:"2E7DAF", label:"01", heading:"TYPES OF EXPOSURE", items:[ { tag:"Psychosocial", text:"High demands / low control (job strain model); effort-reward imbalance; role ambiguity & conflict" }, { tag:"Organisational", text:"Shift work, long hours, understaffing, poor management; workplace violence & harassment" }, { tag:"Traumatic", text:"Critical incidents, vicarious trauma (emergency, ICU, forensics, social work)" }, { tag:"Chronic", text:"Cumulative stress, moral injury, compassion fatigue, systemic bullying & discrimination" }, ] }, { y:3.00, color:"4CABB5", label:"02", heading:"AT-RISK INDUSTRIES", items:[ { tag:"Healthcare", text:"Physicians, nurses, paramedics — burnout rates >=40%; high moral distress exposure" }, { tag:"Emergency", text:"Police, firefighters, military — elevated PTSD & suicide risk; hypervigilance culture" }, { tag:"Education", text:"Teachers, social workers — emotional labour, low autonomy, compassion fatigue" }, { tag:"Corporate", text:"Finance, IT — deadline pressure, always-on culture, job insecurity, technostress" }, ] }, { y:4.98, color:"5B7FA6", label:"03", heading:"SIGNS & SYMPTOMS", items:[ { tag:"Psychological", text:"Anxiety, depression, PTSD (re-experiencing, avoidance, hyperarousal), burnout (exhaustion, cynicism, reduced efficacy)" }, { tag:"Cognitive", text:"Impaired concentration, memory deficits, poor decision-making, cognitive fatigue" }, { tag:"Somatic", text:"Insomnia, headaches, GI disturbance, CVD risk elevation (HTN, IHD), immune dysregulation" }, { tag:"Behavioural", text:"Absenteeism, presenteeism, substance misuse, social withdrawal, increased error rates" }, ] }, { y:6.96, color:"C0392B", label:"04", heading:"MEDICAL MANAGEMENT", items:[ { tag:"Assessment", text:"PHQ-9, GAD-7, IES-R (PTSD), Maslach Burnout Inventory; detailed occupational history" }, { tag:"Pharmacology", text:"SSRIs/SNRIs for depression & anxiety; prazosin for PTSD nightmares; short-term hypnotics for insomnia" }, { tag:"Psychotherapy", text:"CBT (first-line); EMDR & CPT for PTSD; ACT; mindfulness-based stress reduction (MBSR)" }, { tag:"Referral", text:"EAP, occupational physician, psychiatry, vocational rehab; urgent review if suicidal ideation" }, ] }, { y:8.94, color:"27AE60", label:"05", heading:"PREVENTION & CONTROLS", items:[ { tag:"Primary", text:"Job redesign, workload management, flexible scheduling, anti-harassment policy, leadership training" }, { tag:"Secondary", text:"Stress inoculation, resilience programmes, clinical supervision, EAP access, peer support networks" }, { tag:"Tertiary", text:"Early return-to-work, graded exposure, duty modification, occupational rehabilitation" }, { tag:"Legislation",text:"OHS Act obligations; workplace risk assessments; reportable psychological injuries; duty of care" }, ] }, ]; const TAG_COLORS = ["2E7DAF","4CABB5","8E44AD","E67E22","27AE60","C0392B"]; const ROW_STRIPE = "EEF5FB"; SECTIONS.forEach((sec, si) => { const cardH = 1.84; const cardX = 0.18; const cardW = 7.14; // Card background slide.addShape(pres.shapes.RECTANGLE, { x:cardX, y:sec.y, w:cardW, h:cardH, fill:{color:"FFFFFF"}, line:{color:C.divider, width:0.75}, shadow:{type:"outer", color:"C0CAD4", blur:6, offset:2, angle:135, opacity:0.18} }); // Coloured left accent bar slide.addShape(pres.shapes.RECTANGLE, { x:cardX, y:sec.y, w:0.06, h:cardH, fill:{color:sec.color}, line:{color:sec.color, width:0.5} }); // Section number badge (circle) slide.addShape(pres.shapes.ELLIPSE, { x:cardX+0.12, y:sec.y+0.08, w:0.32, h:0.32, fill:{color:sec.color}, line:{color:sec.color, width:0.5} }); slide.addText(sec.label, { x:cardX+0.12, y:sec.y+0.08, w:0.32, h:0.32, fontSize:7.5, bold:true, color:"FFFFFF", fontFace:"Calibri", align:"center", valign:"middle", margin:0 }); // Section heading slide.addText(sec.heading, { x:cardX+0.52, y:sec.y+0.08, w:5.8, h:0.30, fontSize:10.5, bold:true, color:sec.color, fontFace:"Calibri", charSpacing:0.8, align:"left", valign:"middle", margin:0 }); // Divider line under heading slide.addShape(pres.shapes.RECTANGLE, { x:cardX+0.52, y:sec.y+0.41, w:cardW-0.7, h:0.015, fill:{color:C.divider}, line:{color:C.divider, width:0.5} }); // Content rows const rowH = 0.315; const rowStartY = sec.y + 0.45; const rowX = cardX + 0.52; const rowW = cardW - 0.7; const tagW = 1.0; const textX = rowX + tagW + 0.08; const textW = rowW - tagW - 0.1; sec.items.forEach((item, ri) => { const rowY = rowStartY + ri * rowH; // Alternating stripe if (ri % 2 === 0) { slide.addShape(pres.shapes.RECTANGLE, { x:rowX, y:rowY, w:rowW, h:rowH - 0.025, fill:{color:ROW_STRIPE}, line:{color:ROW_STRIPE, width:0.5} }); } // Tag label const tagColor = TAG_COLORS[(si + ri) % TAG_COLORS.length]; slide.addShape(pres.shapes.RECTANGLE, { x:rowX+0.04, y:rowY+0.045, w:tagW-0.08, h:rowH-0.12, fill:{color:tagColor}, line:{color:tagColor, width:0.5} }); slide.addText(item.tag, { x:rowX+0.04, y:rowY+0.045, w:tagW-0.08, h:rowH-0.12, fontSize:6.8, bold:true, color:"FFFFFF", fontFace:"Calibri", align:"center", valign:"middle", margin:0 }); // Row text slide.addText(item.text, { x:textX, y:rowY+0.03, w:textW, h:rowH-0.06, fontSize:6.8, color:C.text_dark, fontFace:"Calibri", align:"left", valign:"middle", margin:0, wrap:true }); }); }); // Footer slide.addShape(pres.shapes.RECTANGLE, { x:0, y:9.84, w:7.5, h:0.16, fill:{color:C.header_bg}, line:{color:C.header_bg, width:0.5} }); slide.addText("Occupational Health | WHO ICD-11 | DSM-5 | Maslach Burnout Inventory | For Educational Use Only", { x:0.2, y:9.845, w:7.1, h:0.12, fontSize:5.5, color:C.accent2, fontFace:"Calibri", align:"center", valign:"middle", margin:0, italic:true }); pres.writeFile({ fileName: "/home/daytona/workspace/psych-occ-hazards/Psychological_Occupational_Hazards.pptx" }) .then(() => console.log("SUCCESS")) .catch(e => { console.error("ERROR:", e.message); process.exit(1); }); ENDOFSCRIPT echo "Written OK"
cd /home/daytona/workspace/psych-occ-hazards && node build.js 2>&1
sed -n '105,115p' /home/daytona/workspace/psych-occ-hazards/build.js
node -e "const p=require('pptxgenjs');const x=new p();console.log(Object.keys(x.shapes).filter(k=>k.includes('ELLIPSE')||k.includes('OVAL')||k.includes('CIRCLE')))"
sed -i 's/pres\.shapes\.ELLIPSE/pres.shapes.OVAL/g' /home/daytona/workspace/psych-occ-hazards/build.js sed -i 's/shadow:{type:"outer", color:"C0CAD4", blur:6, offset:2, angle:135, opacity:0.18}//g' /home/daytona/workspace/psych-occ-hazards/build.js cd /home/daytona/workspace/psych-occ-hazards && node build.js 2>&1