Make a ppt on first aid Add these Title:-First aid Name surya Roll no 138
mkdir -p /home/daytona/workspace/first-aid-ppt
~/first-aid-ppt/create.js
const pptxgen = require("pptxgenjs");
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "First Aid";
pres.author = "Surya";
// ─── COLOR PALETTE ───────────────────────────────────────────
const RED = "C0392B"; // dominant red (medical)
const DARKRED = "922B21";
const WHITE = "FFFFFF";
const LIGHTGRAY= "F2F3F4";
const DARKBG = "1A1A2E"; // dark navy for title/section slides
const ACCENT = "E74C3C";
const TEXTDARK = "2C3E50";
const MIDGRAY = "7F8C8D";
// ─── HELPERS ─────────────────────────────────────────────────
function redHeader(slide, text) {
slide.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: "100%", h: 1.1,
fill: { color: RED },
});
slide.addText(text, {
x: 0.4, y: 0.15, w: 9.2, h: 0.8,
fontSize: 28, bold: true, color: WHITE, valign: "middle",
});
}
function footerStrip(slide) {
slide.addShape(pres.ShapeType.rect, {
x: 0, y: 5.3, w: "100%", h: 0.325,
fill: { color: RED },
});
slide.addText("First Aid Presentation | Surya | Roll No. 138", {
x: 0.3, y: 5.32, w: 9.4, h: 0.28,
fontSize: 9, color: WHITE, align: "right",
});
}
// ─────────────────────────────────────────────────────────────
// SLIDE 1 — TITLE
// ─────────────────────────────────────────────────────────────
{
const s = pres.addSlide();
// dark background
s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: DARKBG } });
// red accent bar left
s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.18, h: "100%", fill: { color: RED } });
// red cross symbol (two rectangles)
s.addShape(pres.ShapeType.rect, { x: 7.6, y: 1.0, w: 1.6, h: 0.45, fill: { color: RED }, line: { color: RED } });
s.addShape(pres.ShapeType.rect, { x: 8.175, y: 0.42, w: 0.45, h: 1.6, fill: { color: RED }, line: { color: RED } });
// Title
s.addText("FIRST AID", {
x: 0.5, y: 1.5, w: 6.8, h: 1.4,
fontSize: 60, bold: true, color: WHITE,
charSpacing: 8,
});
// subtitle
s.addText("Emergency Response & Basic Life Support", {
x: 0.5, y: 2.95, w: 6.8, h: 0.55,
fontSize: 18, color: "BFC9CA", italic: true,
});
// divider line
s.addShape(pres.ShapeType.rect, { x: 0.5, y: 3.62, w: 4.5, h: 0.05, fill: { color: RED } });
// presenter info
s.addText([
{ text: "Name: ", options: { bold: true, color: "BFC9CA" } },
{ text: "Surya", options: { color: WHITE } },
], { x: 0.5, y: 3.8, w: 5, h: 0.38, fontSize: 15 });
s.addText([
{ text: "Roll No: ", options: { bold: true, color: "BFC9CA" } },
{ text: "138", options: { color: WHITE } },
], { x: 0.5, y: 4.2, w: 5, h: 0.38, fontSize: 15 });
}
// ─────────────────────────────────────────────────────────────
// SLIDE 2 — WHAT IS FIRST AID?
// ─────────────────────────────────────────────────────────────
{
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: WHITE } });
redHeader(s, "What is First Aid?");
s.addText(
"First aid is the immediate assistance given to a person suffering from an illness or injury, with the aim of preserving life, preventing the condition from worsening, and promoting recovery — before professional medical help arrives.",
{
x: 0.4, y: 1.25, w: 9.2, h: 1.1,
fontSize: 15, color: TEXTDARK, italic: true,
line: { color: "E5E7E9", pt: 1 },
fill: { color: "FDEDEC" },
margin: 10,
}
);
// Three pillars
const pillars = [
{ icon: "❤️", title: "Preserve Life", body: "Keep the casualty alive by maintaining breathing and circulation." },
{ icon: "🛡️", title: "Prevent Worsening", body: "Stop bleeding, immobilize injuries, and avoid further harm." },
{ icon: "🏥", title: "Promote Recovery", body: "Comfort, reassure, and prepare for handover to professionals." },
];
pillars.forEach((p, i) => {
const x = 0.3 + i * 3.2;
s.addShape(pres.ShapeType.roundRect, {
x, y: 2.55, w: 2.9, h: 2.5,
fill: { color: i === 0 ? "FDEDEC" : i === 1 ? "FDFEFE" : "EBF5FB" },
line: { color: i === 0 ? RED : i === 1 ? "AAB7B8" : "2E86C1", pt: 1.5 },
rectRadius: 0.12,
});
s.addText(p.icon, { x, y: 2.6, w: 2.9, h: 0.55, fontSize: 24, align: "center" });
s.addText(p.title, { x, y: 3.12, w: 2.9, h: 0.4, fontSize: 14, bold: true, color: TEXTDARK, align: "center" });
s.addText(p.body, { x: x + 0.1, y: 3.55, w: 2.7, h: 1.3, fontSize: 11.5, color: MIDGRAY, align: "center", valign: "top" });
});
footerStrip(s);
}
// ─────────────────────────────────────────────────────────────
// SLIDE 3 — THE ABC OF FIRST AID
// ─────────────────────────────────────────────────────────────
{
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: LIGHTGRAY } });
redHeader(s, "The ABC of First Aid");
const abc = [
{ letter: "A", word: "Airway", detail: "Tilt head back, lift chin. Clear any obstruction from mouth/throat." },
{ letter: "B", word: "Breathing", detail: "Look, listen, feel for breathing. Give rescue breaths if absent." },
{ letter: "C", word: "Circulation", detail: "Check pulse. Begin chest compressions (CPR) if heart has stopped." },
];
abc.forEach((item, i) => {
const y = 1.25 + i * 1.35;
// big letter badge
s.addShape(pres.ShapeType.ellipse, {
x: 0.4, y: y, w: 0.85, h: 0.85,
fill: { color: RED }, line: { color: DARKRED, pt: 1 },
});
s.addText(item.letter, {
x: 0.4, y: y, w: 0.85, h: 0.85,
fontSize: 30, bold: true, color: WHITE, align: "center", valign: "middle",
});
// word
s.addText(item.word, {
x: 1.45, y: y + 0.02, w: 2.2, h: 0.42,
fontSize: 20, bold: true, color: RED,
});
// detail
s.addText(item.detail, {
x: 1.45, y: y + 0.44, w: 7.8, h: 0.55,
fontSize: 13, color: TEXTDARK,
});
// divider (not after last)
if (i < 2) {
s.addShape(pres.ShapeType.rect, { x: 0.4, y: y + 1.1, w: 9.2, h: 0.02, fill: { color: "D5D8DC" } });
}
});
footerStrip(s);
}
// ─────────────────────────────────────────────────────────────
// SLIDE 4 — COMMON EMERGENCIES
// ─────────────────────────────────────────────────────────────
{
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: WHITE } });
redHeader(s, "Common Emergencies & First Aid Steps");
const emergencies = [
{ emoji: "🩸", title: "Bleeding", steps: "Apply firm pressure · Elevate limb · Use clean bandage · Seek help if severe" },
{ emoji: "🔥", title: "Burns", steps: "Cool with running water (10 min) · Do NOT use ice or butter · Cover loosely" },
{ emoji: "🫀", title: "Heart Attack", steps: "Call emergency services · Keep calm/still · Loosen clothing · Begin CPR if needed" },
{ emoji: "🦴", title: "Fractures", steps: "Immobilize the area · Do NOT realign bone · Apply splint · Reduce swelling with ice" },
{ emoji: "😵", title: "Fainting", steps: "Lay person flat · Elevate legs · Loosen clothing · Do NOT give water immediately" },
{ emoji: "⚡", title: "Electric Shock", steps: "Do NOT touch victim · Cut power first · Call emergency · Check breathing" },
];
emergencies.forEach((e, i) => {
const col = i % 3;
const row = Math.floor(i / 3);
const x = 0.22 + col * 3.25;
const y = 1.3 + row * 2.05;
s.addShape(pres.ShapeType.roundRect, {
x, y, w: 3.05, h: 1.85,
fill: { color: row === 0 ? "FDEDEC" : "EBF5FB" },
line: { color: row === 0 ? "E74C3C" : "2E86C1", pt: 1 },
rectRadius: 0.1,
});
s.addText(`${e.emoji} ${e.title}`, {
x: x + 0.1, y: y + 0.07, w: 2.85, h: 0.38,
fontSize: 13, bold: true, color: TEXTDARK,
});
s.addText(e.steps, {
x: x + 0.1, y: y + 0.47, w: 2.85, h: 1.22,
fontSize: 10.5, color: MIDGRAY, valign: "top",
});
});
footerStrip(s);
}
// ─────────────────────────────────────────────────────────────
// SLIDE 5 — CPR STEPS
// ─────────────────────────────────────────────────────────────
{
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: DARKBG } });
// accent bar
s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.18, h: "100%", fill: { color: RED } });
s.addText("CPR — Cardiopulmonary Resuscitation", {
x: 0.4, y: 0.2, w: 9.2, h: 0.65,
fontSize: 24, bold: true, color: WHITE,
});
s.addText("Step-by-step guide for adults", {
x: 0.4, y: 0.82, w: 9.2, h: 0.35,
fontSize: 13, color: "BFC9CA", italic: true,
});
const steps = [
{ num: "1", text: "Ensure the scene is SAFE before approaching." },
{ num: "2", text: "Check for response — tap shoulders, shout \"Are you OK?\"" },
{ num: "3", text: "Call emergency services (or ask someone else to call)." },
{ num: "4", text: "Tilt head back, lift chin to open airway." },
{ num: "5", text: "Give 2 rescue breaths (if trained). Watch chest rise." },
{ num: "6", text: "Begin 30 chest compressions — hard and fast (100–120/min)." },
{ num: "7", text: "Continue cycle: 30 compressions → 2 breaths until help arrives." },
];
steps.forEach((step, i) => {
const y = 1.3 + i * 0.56;
s.addShape(pres.ShapeType.ellipse, {
x: 0.4, y: y, w: 0.4, h: 0.4,
fill: { color: RED }, line: { color: DARKRED, pt: 0.5 },
});
s.addText(step.num, {
x: 0.4, y: y, w: 0.4, h: 0.4,
fontSize: 12, bold: true, color: WHITE, align: "center", valign: "middle",
});
s.addText(step.text, {
x: 1.0, y: y + 0.02, w: 8.6, h: 0.4,
fontSize: 13, color: WHITE,
});
});
}
// ─────────────────────────────────────────────────────────────
// SLIDE 6 — FIRST AID KIT
// ─────────────────────────────────────────────────────────────
{
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: WHITE } });
redHeader(s, "What's in a First Aid Kit?");
const items = [
"🩹 Adhesive bandages (assorted sizes)",
"🧴 Antiseptic wipes & cream",
"💊 Pain relievers (paracetamol/ibuprofen)",
"✂️ Scissors & tweezers",
"🧤 Disposable gloves (latex-free)",
"🌡️ Digital thermometer",
"🩺 CPR face shield / mask",
"🔦 Torch / penlight",
"📋 Emergency contact list",
"🧊 Instant cold packs",
"🪤 Triangular bandages & slings",
"📦 Sterile gauze pads & rolls",
];
// 2 columns
items.forEach((item, i) => {
const col = i % 2;
const row = Math.floor(i / 2);
const x = 0.4 + col * 4.8;
const y = 1.22 + row * 0.67;
s.addShape(pres.ShapeType.roundRect, {
x, y, w: 4.5, h: 0.52,
fill: { color: col === 0 ? "FDEDEC" : "EBF5FB" },
line: { color: col === 0 ? "E74C3C" : "2E86C1", pt: 0.8 },
rectRadius: 0.08,
});
s.addText(item, {
x: x + 0.12, y: y + 0.06, w: 4.3, h: 0.42,
fontSize: 12, color: TEXTDARK, valign: "middle",
});
});
footerStrip(s);
}
// ─────────────────────────────────────────────────────────────
// SLIDE 7 — DO's and DON'Ts
// ─────────────────────────────────────────────────────────────
{
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: LIGHTGRAY } });
redHeader(s, "First Aid — Do's and Don'ts");
// DO column header
s.addShape(pres.ShapeType.rect, { x: 0.3, y: 1.2, w: 4.3, h: 0.45, fill: { color: "1E8449" } });
s.addText("✅ DO", { x: 0.3, y: 1.2, w: 4.3, h: 0.45, fontSize: 16, bold: true, color: WHITE, align: "center", valign: "middle" });
// DON'T column header
s.addShape(pres.ShapeType.rect, { x: 5.1, y: 1.2, w: 4.6, h: 0.45, fill: { color: RED } });
s.addText("❌ DON'T", { x: 5.1, y: 1.2, w: 4.6, h: 0.45, fontSize: 16, bold: true, color: WHITE, align: "center", valign: "middle" });
const dos = [
"Stay calm and reassure the victim",
"Call emergency services immediately",
"Keep the injured person warm",
"Use gloves when handling blood",
"Monitor breathing constantly",
];
const donts = [
"Do NOT move a spinal injury victim",
"Do NOT remove an embedded object",
"Do NOT apply ice directly to skin",
"Do NOT give food/water to unconscious",
"Do NOT leave the victim alone",
];
dos.forEach((d, i) => {
const y = 1.78 + i * 0.65;
s.addShape(pres.ShapeType.roundRect, {
x: 0.3, y, w: 4.3, h: 0.52,
fill: { color: "EAFAF1" }, line: { color: "1E8449", pt: 0.8 }, rectRadius: 0.07,
});
s.addText(d, { x: 0.45, y, w: 4.1, h: 0.52, fontSize: 12, color: "1E8449", valign: "middle" });
});
donts.forEach((d, i) => {
const y = 1.78 + i * 0.65;
s.addShape(pres.ShapeType.roundRect, {
x: 5.1, y, w: 4.6, h: 0.52,
fill: { color: "FDEDEC" }, line: { color: RED, pt: 0.8 }, rectRadius: 0.07,
});
s.addText(d, { x: 5.25, y, w: 4.4, h: 0.52, fontSize: 12, color: RED, valign: "middle" });
});
footerStrip(s);
}
// ─────────────────────────────────────────────────────────────
// SLIDE 8 — CONCLUSION / THANK YOU
// ─────────────────────────────────────────────────────────────
{
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: DARKBG } });
s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.18, h: "100%", fill: { color: RED } });
// large red cross
s.addShape(pres.ShapeType.rect, { x: 7.5, y: 0.8, w: 2.0, h: 0.55, fill: { color: RED }, line: { color: RED } });
s.addShape(pres.ShapeType.rect, { x: 8.225, y: 0.08, w: 0.55, h: 2.0, fill: { color: RED }, line: { color: RED } });
s.addText("THANK YOU", {
x: 0.5, y: 1.1, w: 6.5, h: 1.1,
fontSize: 52, bold: true, color: WHITE, charSpacing: 6,
});
s.addText("Remember: A little knowledge can save a life.", {
x: 0.5, y: 2.3, w: 7.5, h: 0.55,
fontSize: 17, color: "BFC9CA", italic: true,
});
s.addShape(pres.ShapeType.rect, { x: 0.5, y: 3.0, w: 4.5, h: 0.05, fill: { color: RED } });
s.addText("Presented by: Surya | Roll No. 138", {
x: 0.5, y: 3.15, w: 7, h: 0.38,
fontSize: 14, color: "BFC9CA",
});
s.addText("📞 Emergency: 112 | 🏥 Ambulance: 108", {
x: 0.5, y: 3.65, w: 7.5, h: 0.38,
fontSize: 13, color: WHITE, bold: true,
});
}
// ─────────────────────────────────────────────────────────────
// WRITE FILE
// ─────────────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/first-aid-ppt/First_Aid_Surya_138.pptx" })
.then(() => console.log("✅ Saved: /home/daytona/workspace/first-aid-ppt/First_Aid_Surya_138.pptx"))
.catch(err => { console.error(err); process.exit(1); });
node /home/daytona/workspace/first-aid-ppt/create.js
First Aid Surya 138
Presentation · PPTX
| Slide | Content |
|---|---|
| 1 | Title slide - "First Aid", Name: Surya, Roll No. 138 with red cross symbol |
| 2 | What is First Aid? - Definition + 3 pillars (Preserve Life, Prevent Worsening, Promote Recovery) |
| 3 | The ABC of First Aid - Airway, Breathing, Circulation |
| 4 | Common Emergencies - Bleeding, Burns, Heart Attack, Fractures, Fainting, Electric Shock |
| 5 | CPR Steps - 7-step guide on dark background |
| 6 | First Aid Kit - 12 essential items in a 2-column card layout |
| 7 | Do's and Don'ts - Green column vs Red column |
| 8 | Thank You - With emergency numbers (112 / 108) |