const pptxgen = require('pptxgenjs'); const path = require('path'); const fs = require('fs'); const html2pptx = require('./.claude/skills/pptx/scripts/html2pptx.js'); // Tingting's signature color palette + celebration touches const colors = { primary: '#6B2C3E', // Bordeaux profond accent: '#B8974F', // Or antique background: '#F5F1E8', // Crème ivoire celebration: '#E8B4B8', // Rose doux pour anniversaire warm: '#D4AF37', // Or chaud pour bougies text: '#2C1810' // Brun foncé pour lisibilité }; // CSS shared styles const sharedStyles = ` * { margin: 0; padding: 0; box-sizing: border-box; } body { width: 960px; height: 540px; margin: 0; padding: 0; overflow: hidden; } .slide { width: 960px; height: 540px; position: relative; font-family: 'Microsoft YaHei', 'Segoe UI', sans-serif; overflow: hidden; } .bg-primary { background: ${colors.primary}; } .bg-warm { background: ${colors.background}; } .bg-celebration { background: ${colors.celebration}; } .title-main { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; width: 90%; } .title-main h1 { font-size: 48px; color: ${colors.background}; margin-bottom: 20px; font-weight: 700; letter-spacing: 2px; } .title-main .subtitle { font-size: 24px; color: ${colors.celebration}; font-weight: 300; } .title-main .class-info { font-size: 20px; color: ${colors.accent}; margin-top: 15px; font-weight: 400; } .content-slide { padding: 50px 70px 60px 70px; } .content-slide h2 { font-size: 32px; color: ${colors.primary}; margin-bottom: 25px; font-weight: 700; } .content-slide p { font-size: 20px; line-height: 1.8; color: ${colors.text}; margin-bottom: 15px; } .content-slide ul { margin-left: 40px; margin-top: 20px; } .content-slide li { font-size: 18px; line-height: 1.8; color: ${colors.text}; margin-bottom: 8px; } .quote-box { background: white; padding: 25px 30px; margin: 25px 0; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); } .quote-box p { font-size: 22px; color: ${colors.primary}; font-style: italic; line-height: 1.6; } .number-highlight { display: inline-block; background: ${colors.accent}; color: white; padding: 5px 15px; border-radius: 20px; font-weight: bold; font-size: 24px; } .decoration-top { position: absolute; top: 0; right: 0; width: 200px; height: 200px; background: ${colors.accent}40; opacity: 0.3; border-radius: 50%; } .decoration-bottom { position: absolute; bottom: 0; left: 0; width: 150px; height: 150px; background: ${colors.celebration}40; opacity: 0.3; border-radius: 50%; } .v-center { position: absolute; top: 50%; transform: translateY(-50%); width: 100%; padding: 0 60px; } .section-title { background: ${colors.primary}; display: flex; align-items: center; justify-content: center; } .section-title h2 { font-size: 48px; color: ${colors.background}; text-align: center; font-weight: 700; padding: 0; } `; // Slide templates const slides = [ // Slide 1: Title `

🎂 生日主题班会 🎂

Birthday Celebration Class Meeting

七年三班 | Class 7-3

`, // Slide 2: Opening `

✨ 当这一刻来临

当教室的灯光暖起来

当桌上的气球飘起来

当我们的笑容扬起来

这一刻,属于你们 ❤️

`, // Slide 3: 373 Days `

📅 373天的故事

373天

不是一串冰冷的数字

是我们一起攒下的独家记忆

`, // Slide 4: Section title `

🌟 今天的主角 🌟

`, // Slide 5: Welcome Birthday Stars `

🎉 欢迎我们的寿星

在这个特别的日子里
让我们用最热烈的掌声
欢迎今天的寿星们

👏 掌声欢迎!👏

`, // Slide 6: Meaning of Birthdays `

🎂 生日的意义

生日,不仅仅是蛋糕和礼物

✨ 是成长的见证

💝 是爱的传递

🌈 是希望的延续

👨‍👩‍👧‍👦 是感恩的时刻

`, // Slide 7: Surprise (TYPO FIXED) `

🎁 惊喜时刻

但是... 等一下!
还有一个惊喜中的惊喜

🎊 我们没有忘记今天还有两位特别的寿星... 🎊

`, // Slide 8: Hosts' Birthday `

💝 特别的惊喜

为班会付出那么多的主持人们
今天也是你们的生日!

被人放在心上的感觉

真的很温暖 ❤️

`, // Slide 9: Growing Together (OPTIMIZED) `

🌱 一起成长的样子

从陌生到熟悉,从青涩到成熟

让我们一起回顾寿星们一路走来的精彩瞬间

`, // Slide 10: Making a Wish `

🕯️ 许愿时刻 🕯️

闭上眼睛
在心里许下你最美好的愿望
(我们给你们5秒钟的时间)

`, // Slide 11: Blow Candles `

🎂 吹蜡烛

一、二、三!
吹!🎉

愿你们的愿望都能实现 ✨

`, // Slide 12: Gifts `

🎁 拆礼物环节

每一份礼物都承载着心意

心意盒里有什么?

📝 手写的祝福卡片

📷 珍贵的照片回忆

🧸 可爱的小玩偶

❤️ 满满的班级温暖

`, // Slide 13: Interactive Blessings `

💬 同学祝福时刻

有哪位同学想要送上
你的祝福或者才艺表演?

🎤 舞台交给你们!🎤

`, // Slide 14: Gratitude to Parents `

🙏 感恩父母

生日这一天,我们要特别感谢...

给予我们生命的父母

陪伴我们成长的家人

教育我们成才的老师

一起欢笑的同学

感恩有你们 ❤️

`, // Slide 15: Birthday Wishes (TYPO FIXED: 住→祝) `

🎊 生日快乐 🎊

让我们一起他们
生日快乐!

Happy Birthday! 🎂✨

`, // Slide 16: Class Photo `

📷 全班合影时刻

来,七年三班
让我们一起留下这个
难忘的瞬间!

📸 咔嚓! 📸

`, // Slide 17: Looking Forward `

🌟 未来的路

今天,我们庆祝过去的成长

明天,我们期待新的精彩

愿每一个生日都是新的起点

愿七年三班的每一个人

都能成为更好的自己!

`, // Slide 18: Thank You `

谢谢大家!

Thank You Everyone

七年三班 | 永远是一家人 ❤️

` ]; // Create HTML files for each slide function createHTMLFiles() { const slideDir = path.join(__dirname, 'birthday_slides'); if (!fs.existsSync(slideDir)) { fs.mkdirSync(slideDir); } slides.forEach((slideContent, index) => { const htmlContent = ` ${slideContent} `; const filename = path.join(slideDir, `slide_${index + 1}.html`); fs.writeFileSync(filename, htmlContent, 'utf-8'); console.log(`✓ Created: slide_${index + 1}.html`); }); return slideDir; } async function createPresentation() { console.log('🚀 Generating Birthday Class Meeting PowerPoint...\n'); // Create HTML files const slideDir = createHTMLFiles(); console.log('\n📄 HTML files created successfully\n'); const pptx = new pptxgen(); pptx.layout = 'LAYOUT_16x9'; pptx.author = 'Tingting - Class 7-3'; pptx.title = '七年三班生日主题班会'; try { // Process each slide for (let i = 0; i < slides.length; i++) { const slideFile = path.join(slideDir, `slide_${i + 1}.html`); console.log(`📊 Processing Slide ${i + 1}/${slides.length}...`); await html2pptx(slideFile, pptx); } // Save presentation await pptx.writeFile({ fileName: 'Birthday_ClassMeeting_Class73.pptx' }); console.log('\n✅ PowerPoint generated successfully!'); console.log('📁 File: Birthday_ClassMeeting_Class73.pptx'); console.log('🎨 Style: Tingting Signature Elegant + Celebration'); console.log(`📊 Total slides: ${slides.length}`); console.log('\n✏️ Corrections applied:'); console.log(' • Slide 7: Fixed surprise moment text'); console.log(' • Slide 9: Optimized content (removed repetition)'); console.log(' • Slide 15: Fixed typo 住→祝'); console.log('\n➕ New slides added:'); console.log(' • Slide 13: Interactive classmate blessings'); console.log(' • Slide 14: Gratitude to parents'); console.log(' • Slide 16: Class photo moment'); console.log(' • Slide 17: Looking forward'); console.log('\n💡 All elements are 100% editable in PowerPoint!'); } catch (error) { console.error('\n❌ Error:', error.message); if (error.stack) { console.error('\nStack:', error.stack); } } } createPresentation();