|
| 1 | +const pres = new pptxgen(); |
| 2 | +pres.layout = 'LAYOUT_16x9'; |
| 3 | +pres.title = 'My Presentation'; |
| 4 | +pres.author = 'Author\'s name'; |
| 5 | + |
| 6 | +// Slide 1 — Title |
| 7 | +let slide1 = pres.addSlide(); |
| 8 | +slide1.background = { color: '003B75' }; |
| 9 | +slide1.addText('My Presentation', { |
| 10 | + x: 0.5, y: 1.2, w: 9, h: 1.5, |
| 11 | + fontSize: 36, fontFace: 'Arial', |
| 12 | + color: 'FFFFFF', bold: true, align: 'center', |
| 13 | +}); |
| 14 | +slide1.addShape(pres.ShapeType.line, { |
| 15 | + x: 3, y: 2.7, w: 4, h: 0, |
| 16 | + line: { color: 'CCDDEE', width: 1 }, |
| 17 | +}); |
| 18 | +slide1.addText('Author\'s name, Company name', { |
| 19 | + x: 0.5, y: 3, w: 9, h: 0.8, |
| 20 | + fontSize: 18, fontFace: 'Arial', |
| 21 | + color: 'CCDDEE', align: 'center', |
| 22 | +}); |
| 23 | +slide1.addText('Sept 14, 2025 — Amazing Event, Location', { |
| 24 | + x: 0.5, y: 4.8, w: 9, h: 0.5, |
| 25 | + fontSize: 10, fontFace: 'Arial', |
| 26 | + color: '8899AA', align: 'center', |
| 27 | +}); |
| 28 | + |
| 29 | +// Slide 2 — Agenda |
| 30 | +let slide2 = pres.addSlide(); |
| 31 | +slide2.background = { color: 'FFFFFF' }; |
| 32 | +slide2.addText('Agenda:', { |
| 33 | + x: 0.5, y: 0.3, w: 9, h: 0.8, |
| 34 | + fontSize: 28, fontFace: 'Arial', |
| 35 | + color: '003B75', bold: true, |
| 36 | +}); |
| 37 | +slide2.addText([ |
| 38 | + { text: '1. Key item #1', options: { breakLine: true } }, |
| 39 | + { text: '2. Key item #2', options: { breakLine: true } }, |
| 40 | + { text: '3. Key item #3', options: { breakLine: true } }, |
| 41 | + { text: '4. Key item #4', options: {} }, |
| 42 | +], { |
| 43 | + x: 0.8, y: 1.5, w: 8, h: 3, |
| 44 | + fontSize: 18, fontFace: 'Arial', |
| 45 | + color: '333333', lineSpacingMultiple: 1.5, |
| 46 | +}); |
| 47 | + |
| 48 | +// Slide 3 — Section: Key item #1 |
| 49 | +let slide3 = pres.addSlide(); |
| 50 | +slide3.background = { color: '003B75' }; |
| 51 | +slide3.addText([ |
| 52 | + { text: 'Key', options: { bold: true } }, |
| 53 | + { text: ' item ' }, |
| 54 | + { text: '#1', options: { italic: true } }, |
| 55 | +], { |
| 56 | + x: 0.5, y: 2, w: 9, h: 1.5, |
| 57 | + fontSize: 32, fontFace: 'Arial', |
| 58 | + color: 'FFFFFF', align: 'center', |
| 59 | +}); |
| 60 | + |
| 61 | +// Slide 4 — A very important section |
| 62 | +let slide4 = pres.addSlide(); |
| 63 | +slide4.background = { color: 'FFFFFF' }; |
| 64 | +slide4.addText([ |
| 65 | + { text: 'A very ' }, |
| 66 | + { text: 'important', options: { bold: true } }, |
| 67 | + { text: ' section' }, |
| 68 | +], { |
| 69 | + x: 0.5, y: 0.3, w: 9, h: 0.8, |
| 70 | + fontSize: 24, fontFace: 'Arial', |
| 71 | + color: '003B75', |
| 72 | +}); |
| 73 | + |
| 74 | +// Slide 5 — Features |
| 75 | +let slide5 = pres.addSlide(); |
| 76 | +slide5.background = { color: 'FFFFFF' }; |
| 77 | +slide5.addText('Features', { |
| 78 | + x: 0.5, y: 0.3, w: 9, h: 0.8, |
| 79 | + fontSize: 24, fontFace: 'Arial', |
| 80 | + color: '003B75', |
| 81 | +}); |
| 82 | +slide5.addText([ |
| 83 | + { text: 'Pagination', options: { bold: true } }, |
| 84 | + { text: ': Slide-based navigation', options: { breakLine: true } }, |
| 85 | + { text: 'Formatting', options: { bold: true } }, |
| 86 | + { text: ': Support for Markdown', options: { breakLine: true } }, |
| 87 | + { text: 'Math', options: { bold: true } }, |
| 88 | + { text: ': Support for LaTeX, between $…$', options: { breakLine: true } }, |
| 89 | + { text: 'Themes', options: { bold: true } }, |
| 90 | + { text: ': Customizable appearance' }, |
| 91 | +], { |
| 92 | + x: 0.8, y: 1.5, w: 8, h: 3, |
| 93 | + fontSize: 18, fontFace: 'Arial', |
| 94 | + color: '333333', bullet: true, lineSpacingMultiple: 1.5, |
| 95 | +}); |
| 96 | + |
| 97 | +// Slide 6 — Citations support (inline) |
| 98 | +let slide6 = pres.addSlide(); |
| 99 | +slide6.background = { color: 'FFFFFF' }; |
| 100 | +slide6.addText([ |
| 101 | + { text: 'Citations', options: { bold: true } }, |
| 102 | + { text: ' support' }, |
| 103 | +], { |
| 104 | + x: 0.5, y: 0.3, w: 9, h: 0.8, |
| 105 | + fontSize: 24, fontFace: 'Arial', |
| 106 | + color: '003B75', |
| 107 | +}); |
| 108 | +slide6.addText('Inline:', { |
| 109 | + x: 0.8, y: 1.3, w: 8, h: 0.5, |
| 110 | + fontSize: 18, fontFace: 'Arial', |
| 111 | + color: '333333', |
| 112 | +}); |
| 113 | +slide6.addShape(pres.ShapeType.rect, { |
| 114 | + x: 0.8, y: 2, w: 8, h: 2, |
| 115 | + fill: { color: 'F5F5F5' }, |
| 116 | + line: { color: '003B75', width: 0.5 }, |
| 117 | + rectRadius: 0.05, |
| 118 | +}); |
| 119 | +slide6.addText([ |
| 120 | + { text: 'Mass–energy equivalence equation:\n', options: {} }, |
| 121 | + { text: 'E = mc²', options: { bold: true, fontSize: 22 } }, |
| 122 | + { text: '\n\n— Einstein, 1905', options: { italic: true } }, |
| 123 | +], { |
| 124 | + x: 1.2, y: 2.1, w: 7.2, h: 1.8, |
| 125 | + fontSize: 16, fontFace: 'Arial', |
| 126 | + color: '333333', |
| 127 | +}); |
| 128 | + |
| 129 | +// Slide 7 — Full-slide quote |
| 130 | +let slide7 = pres.addSlide(); |
| 131 | +slide7.background = { color: '003B75' }; |
| 132 | +slide7.addText('Mass–energy equivalence equation:', { |
| 133 | + x: 1, y: 1.5, w: 8, h: 0.8, |
| 134 | + fontSize: 20, fontFace: 'Arial', |
| 135 | + color: 'CCDDEE', italic: true, |
| 136 | +}); |
| 137 | +slide7.addText('E = mc²', { |
| 138 | + x: 1, y: 2.3, w: 8, h: 1.2, |
| 139 | + fontSize: 40, fontFace: 'Arial', |
| 140 | + color: 'FFFFFF', bold: true, align: 'center', |
| 141 | +}); |
| 142 | +slide7.addText('Einstein, 1905', { |
| 143 | + x: 1, y: 3.5, w: 8, h: 0.8, |
| 144 | + fontSize: 16, fontFace: 'Arial', |
| 145 | + color: 'CCDDEE', italic: true, align: 'center', |
| 146 | +}); |
| 147 | + |
| 148 | +// Slide 8 — Section: Key item #2 |
| 149 | +let slide8 = pres.addSlide(); |
| 150 | +slide8.background = { color: '003B75' }; |
| 151 | +slide8.addText([ |
| 152 | + { text: 'Key', options: { bold: true } }, |
| 153 | + { text: ' item ' }, |
| 154 | + { text: '#2', options: { italic: true } }, |
| 155 | +], { |
| 156 | + x: 0.5, y: 2, w: 9, h: 1.5, |
| 157 | + fontSize: 32, fontFace: 'Arial', |
| 158 | + color: 'FFFFFF', align: 'center', |
| 159 | +}); |
| 160 | + |
| 161 | +// Slide 9 — What's next? |
| 162 | +let slide9 = pres.addSlide(); |
| 163 | +slide9.background = { color: 'FFFFFF' }; |
| 164 | +slide9.addText([ |
| 165 | + { text: 'What\'s ' }, |
| 166 | + { text: 'next?', options: { bold: true } }, |
| 167 | +], { |
| 168 | + x: 0.5, y: 2, w: 9, h: 1.5, |
| 169 | + fontSize: 28, fontFace: 'Arial', |
| 170 | + color: '003B75', align: 'center', |
| 171 | +}); |
| 172 | + |
| 173 | +// Slide 10 — Thank you |
| 174 | +let slide10 = pres.addSlide(); |
| 175 | +slide10.background = { color: '003B75' }; |
| 176 | +slide10.addText('Thank you', { |
| 177 | + x: 0.5, y: 2, w: 9, h: 1.5, |
| 178 | + fontSize: 36, fontFace: 'Arial', |
| 179 | + color: 'FFFFFF', bold: true, align: 'center', |
| 180 | +}); |
0 commit comments