圣诞树动态页面生成
圣诞树动态页面生成
圣诞树动态页面生成 圣诞树动态页面生成 Modified December 31, 2024 Code block Python .container { position: relative; width: 100%; max width: 600px; text align: center; } .welcome screen { background: rgba(255, 255, 255, 0.1); padding: 2rem; border radius: 20px; backdrop filter: blur(10px); color: white; } .start button { background: linear gradient(45deg, ff4081, ff6b6b); border: none; padding: 15px 30px; color: white; border radius: 25px; font size: 1.2rem; cursor: pointer; transition: transform 0.3s; animation: pulse 2s infinite; } .start button:hover { transform: scale(1.05); } .christmas tree { display: none; color: ffd1dc; text shadow: 0 0 10px rgba(255,105,180,0.8); white space: pre; text align: center; font size: 1.2rem; line height: 1.6; animation: glow 2s ease in out infinite alternate; font family: monospace; } .santa message { display: none; position: fixed; bottom: 100px; left: 50%; transform: translateX( 50%); background: rgba(255,255,255,0.9); padding: 20px; border radius: 15px; box shadow: 0 0 20px rgba(255,105,180,0.5); transition: bottom 1s ease out; z index: 100; } .santa icon { font size: 3rem; margin bottom: 10px; } .gift box { display: none; position: fixed; top: 50%; left: 50%; transform: translate( 50%, 50%); font size: 12rem; cursor: pointer; animation: giftShake 1.5s infinite; z index: 1000; } .gift text { font size: 2rem; color: white; margin top: 2rem; text shadow: 0 0 10px rgba(255,255,255,0.5); } .blessing modal { display: none; position: fixed; top: 50%; left: 50%; transform: translate( 50%, 50%); background: rgba(255, 255, 255, 0.95); padding: 2rem; border radius: 20px; box shadow: 0 0 30px rgba(255,105,180,0.8); z index: 2000; max width: 80%; text align: center; } .blessing text { font size: 1.3rem; line height: 1.8; color: 333; margin: 1rem 0; } .blessing icon { font size: 4rem; margin bottom: 1rem; } @keyframes glow { from { text shadow: 0 0 5px fff, 0 0 10px fff, 0 0 15px ff69b4; } to { text shadow: 0 0 10px fff, 0 0 20px fff, 0 0 30px ff69b4; } } @keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } } @keyframes giftShake { 0% { transform: translate( 50%, 50%) rotate(0deg) scale(1); } 25% { transform: translate( 50%, 50%) rotate( 15deg) scale(1.05); } 75% { transform: translate( 50%, 50%) rotate(15deg) scale(1.05); } 100% { transform: translate( 50%, 50%) rotate(0deg) scale(1); } } @keyframes snowfall { 0% { transform: translateY( 100vh) rotate(0deg); } 100% { transform: translateY(100vh) rotate(360deg); } } .snowflake { position: fixed; color: white; opacity: 0.7; z index: 1; animation: snowfall linear infinite; } </style </head <body <div class="container" <div id="welcome" class="welcome screen animate animated animate fadeIn" <h1 🎄 圣诞快乐 🎄</h1 <p 准备好接收圣诞惊喜了吗?</p <button class="start button" onclick="startChristmas()" 开启圣诞魔法</button </div <div id="tree" class="christmas tree" ⭐ 💻码⌨️ 🖥️写代码🎮 ⚡需求变了💾 🔌又要加班了🖨️ 🎧产品经理找我💿 🔋线上服务器又崩啦📺 ||| 程 序 员</div <div id="santa message" class="santa message" <div class="santa icon" 🎅</div <p 圣诞快乐 </p <p 这是送给码农大神的特别礼物,快打开看看吧!</p </div <div id="gift" class="gift box" 🎁 <div class="gift text" 点击打开礼物</div </div <div id="blessing" class="blessing modal" <div class="blessing icon" 💻⌨️✨</div <div class="blessing text" 亲爱的程序员,圣诞快乐!<br <br 祝你2025年:<br 代码永远没有bug,<br 每次提交都一次过,<br 测试用例全部通过,<br 生产环境永不宕机,<br 服务器永远高可用,<br 项目经理从不改需求,<br 每天都能准时下班,<br 工资翻倍涨不停!<br 不用担心 AI 抢饭碗,<br 技术深度广度齐飞,<br 年终奖比 KPI 更高!<br <br 更愿你在编写代码的同时,<br 也能编写属于自己的精彩人生! </div </div </div <script function createSnowflakes() { const snowflakes = ['❄', '❅', '❆']; for (let i = 0; i < 30; i++) { const snowflake = document.createElement('div'); snowflake.className = 'snowflake'; snowflake.textContent = snowflakes[Math.floor(Math.random() snowflakes.length)]; snowflake.style.left = ; snowflake.style.fontSize = ; snowflake.style.animationDuration = ; document.body.appendChild(snowflake); } } function startChristmas() { const welcome = document.getElementById('welcome'); welcome.classList.add('animate fadeOut'); setTimeout(() = { welcome.style.display = 'none'; const tree = document.getElementById('tree'); tree.style.display = 'block'; tree.classList.add('animate animated', 'animate zoomIn'); setTimeout(() = { const santaMessage = document.getElementById('santa message'); santaMessage.style.display = 'block'; santaMessage.style.bottom = '20px'; setTimeout(() = { const gift = document.getElementById('gift'); gift.style.display = 'block'; gift.classList.add('animate animated', 'animate bounceIn'); }, 2000); }, 3000); }, 1000); } createSnowflakes(); document.getElementById('gift').addEventListener('click', function() { this.style.animation = 'none'; this.classList.add('animate animated', 'animate rubberBand'); setTimeout(() = { this.style.display = 'none'; const blessing = document.getElementById('blessing'); blessing.style.display = 'block'; blessing.classList.add('animate animated', 'animate zoomIn'); }, 1000); }); </script </body </html <!DOCTYPE html <html lang="zh CN" <head <meta charset="UTF 8" <meta name="viewport" content="width=device width, initial scale=1.0" <title 圣诞惊喜</title <link href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css" rel="stylesheet" <style body { background color: 331f1c; margin: 0; min height: 100vh; display: flex; justify content: center; align items: center; font family: monospace; overflow: hidden; } .container { position: relative; width: 100%; max width: 600px; text align: center; } .welcome screen { background: rgba(255, 255, 255, 0.1); padding: 2rem; border radius: 20px; backdrop filter: blur(10px); color: white; } .start button { background: linear gradient(45deg, ff4081, ff6b6b); border: none; padding: 15px 30px; color: white; border radius: 25px; font size: 1.2rem; cursor: pointer; transition: transform 0.3s; animation: pulse 2s infinite; } .start button:hover { transform: scale(1.05); } .christmas tree { display: none; color: ffd1dc; text shadow: 0 0 10px rgba(255,105,180,0.8); white space: pre; text align: center; font size: 1.2rem; line height: 1.6; animation: glow 2s ease in out infinite alternate; font family: monospace; } .santa message { display: none; position: fixed; bottom: 100px; left: 50%; transform: translateX( 50%); background: rgba(255,255,255,0.9); padding: 20px; border radius: 15px; box shadow: 0 0 20px rgba(255,105,180,0.5); transition: bottom 1s ease out; z index: 100; } .santa icon { font size: 3rem; margin bottom: 10px; } .gift box { display: none; position: fixed; top: 50%; 二)效果展示 No access 20241220220323 rec 00:00 四、总结 一段朴实无华的代码,和常见的 AI 修改代码!今天的祝福就送到这里啦 提前祝大家圣诞节快乐🌟,玩的开心 页面虽然简单,但是也承载着对每个努力工作的人最美好的祝福。无论你是哪个领域的专业人士,都希望这份充满创意的祝福能给你带来一丝温暖和欢乐。 然后永远别忘了,工作之外,家才是最温暖的港湾。在这个温馨的节日里,希望大家能放下工作的繁忙,多陪陪家人,让爱与欢乐充满每个家庭的每个角落。 甭管是啥节日,关键的是给自己一个休息的机会,多陪陪家人,也犒赏一下一年来一直努力的自己。对自己说一句“你真棒 ”。保持对生活的热爱和对未来的期待,最后也祝愿每个正在努力的你,都能在新的一年收获属于自己的精彩故事。 Code block Python """ 作者:景淮 对话语言:中文 执行逻辑:这段执行的内容就是模型的运行逻辑,用户输入任何内容都需要按照下面的伪代码逻辑来执行。用户未输入问题前,不自动执行任何。 """ def Christmas trees(input): ''' 根据用户的输入的职业,先生成对应的这个职业最常见的吐槽做成的圣诞树。同时圣诞树左右两边用小表情来装饰。 ''' 祝福=[] 祝福= 最常见的吐槽(input) &&"第一句的上面固定为"⭐""&& "第一句只有1 2个字" && "每一句比前一句多1 2个字" && "生成八句" && "文字之外左右两边增加相同小表情来装饰" && "将职业名称竖直排列作为树干基座" | few shot=" ⭐ 💻码⌨️ 🖥️写代码🎮 ⚡需求变了💾 🔌又要加班了🖨️ 🎧产品经理找我💿 📱测试提了一堆bug🖱️ 🔋线上服务器又崩啦📺 ||| 程 序 员 " return 吐槽圣诞树 """ 作者:景淮 对话语言:中文 执行逻辑:这段执行的内容就是模型的运行逻辑,用户输入任何内容都需要按照下面的伪代码逻辑来执行。用户未输入问题前,不自动执行任何。 """ def bless(input): ''' 根据用户的输入的职业,先生成对应的这个职业最想要的一段新年的祝福。 ''' 祝福=[] 祝福= 最想要的祝福(input) &&"第一句的上面固定为‘[职业相关表情][职业相关表情][职业相关表情]亲爱的[input],圣诞快乐🌟 ’"&& "第一句祝你 2025 年:" && "每一句比前一句更深的祝福" && "生成十句,不重复" && "文字之外增加小表情来装饰,让其更好看 " && "在最后给出终极祝福,上升到人生的祝福" | few shot=" 亲爱的程序员,圣诞快乐! 祝你2025年: 代码永远没有bug, 每次提交都一次过, 测试用例全部通过, 生产环境永不宕机, 服务器永远高可用, 项目经理从不改需求, 每天都能准时下班, 工资翻倍涨不停! 技术深度广度齐飞, 年终奖比KPI更高! 更愿你在编写代码的同时, 也能编写属于自己的精彩人生! " return 祝福 def card compound(吐槽圣诞树,祝福): """ 按照示例的样式输出对应动态 HTML 圣诞节页面。 """ 风格=“有呼吸感,有吸引力,动态” return HTML页面代码 二)效果展示 No access 20241220220323 rec 00:00 No access 20241220220323 rec 00:00 四、总结 一段朴实无华的代码,和常见的 AI 修改代码!今天的祝福就送到这里啦 提前祝大家圣诞节快乐🌟,玩的开心 页面虽然简单,但是也承载着对每个努力工作的人最美好的祝福。无论你是哪个领域的专业人士,都希望这份充满创意的祝福能给你带来一丝温暖和欢乐。 然后永远别忘了,工作之外,家才是最温暖的港湾。在这个温馨的节日里,希望大家能放下工作的繁忙,多陪陪家人,让爱与欢乐充满每个家庭的每个角落。 甭管是啥节日,关键的是给自己一个休息的机会,多陪陪家人,也犒赏一下一年来一直努力的自己。对自己说一句“你真棒 ”。保持对生活的热爱和对未来的期待,最后也祝愿每个正在努力的你,都能在新的一年收获属于自己的精彩故事。 好啦,写到这里我们今天的内容也结束啦,感谢大家的观看,也希望我的内容能够让大家喜欢,有所收获。感兴趣的小伙伴可以点个关注跟随我一起学习,观看更多往期文章。 下次见,我是景淮,祝你有个开心美好的一天 嘿,大家好呀,我是景淮,一个在加拿大的朋友,每天陪你一起玩转 AI。 圣诞节快到了,先提前祝大家圣诞快乐 李继刚老师倒是很稳定,每年更新下自己的小圣诞树 去年在 ChatGPT,今年换到了 Claude,看了下提示词,基本上可以说是朴实无华、精准精炼。 去年呢,我用 ChatGPT 做了圣诞贺卡,今年呢,就准备基于李继刚老师的圣诞树,做一个前端的升级版 所以,今天的主题是 圣诞树动态页面生成 本文会根据以下内容顺序进行: • 需求分析 • 分步实现 • 提示词编写、测试 • 总结 一、需求分析 这边是想让 Claude 基于职业生成前端的 HTML + JavaScrapt + CSS的前端页面出来,然后有动画和互动效果。 输入 一个职业名称 输出 输出一个对应的 HTML 动态页面和代码,可以下载保存本地观看娱乐。 二、分步实现 一)圣诞树生成 效果展示 💻 因为准备把格式调整的内容放在 CSS 里,做好限制,所以这边都是以左边成完整的排列。避免两边发生冲突。 因为准备把格式调整的内容放在 CSS 里,做好限制,所以这边都是以左边成完整的排列。避免两边发生冲突。 二)惊喜祝福 这边是准备圣诞老人送祝福的一个小的画面,所以也准备先做一段提示词,先生成好。 效果展示 三)页面制作