CoolFace
Apppublic

dawoodmudaser2-cmd/linkedin-post-generator

sourceHugging Facemitupdated 2mo agoView on Hugging Face
0likes
script.js107 linesDownload Raw Back to root
1const generateBtn = document.getElementById("generateBtn");2const copyBtn = document.getElementById("copyBtn");3const result = document.getElementById("result");4 5generateBtn.addEventListener("click", () => {6 7    const topic = document.getElementById("topic").value.trim();8    const tone = document.getElementById("tone").value;9    const length = document.getElementById("length").value;10 11    if(topic === ""){12        alert("Please enter a topic.");13        return;14    }15 16    let post = "";17 18    if(length === "Short"){19 20        post =21`๐Ÿš€ Excited to share my latest project: ${topic}!22 23Building this project helped me improve my skills and learn valuable concepts in software development.24 25Looking forward to creating more amazing projects!26 27#${topic.replace(/\s+/g,"")} #Programming #Developer #Coding #LinkedIn`;28 29    }30 31    else if(length === "Medium"){32 33        post =34`๐Ÿš€ I'm excited to share my latest project: ${topic}.35 36This project allowed me to strengthen my technical skills while solving real-world problems.37 38Tone: ${tone}39 40Throughout this journey I learned a lot about planning, development, debugging, and creating user-friendly applications.41 42Every project teaches something new, and this one was another great learning experience.43 44Feedback is always welcome!45 46#${topic.replace(/\s+/g,"")}47#Programming48#WebDevelopment49#Developer50#Coding51#Learning52#AI`;53 54    }55 56    else{57 58        post =59`๐Ÿš€ Excited to share my latest project: ${topic}!60 61Developing this project has been an incredible learning journey.62 63I focused on writing clean code, improving user experience, and building a practical solution that can solve real problems.64 65Tone: ${tone}66 67Throughout development I learned the importance of problem-solving, debugging, project planning, and writing maintainable code.68 69Every challenge became an opportunity to improve my skills.70 71I'm continuously learning and looking forward to building even more impactful projects.72 73I would love to hear your feedback and suggestions.74 75#${topic.replace(/\s+/g,"")}76#SoftwareDevelopment77#Programming78#WebDevelopment79#Coding80#Developer81#Technology82#Learning83#AI84#Projects`;85 86    }87 88    result.value = post;89 90});91 92copyBtn.addEventListener("click", () => {93 94    if(result.value === ""){95        alert("Nothing to copy!");96        return;97    }98 99    navigator.clipboard.writeText(result.value);100 101    copyBtn.innerText = "Copied!";102 103    setTimeout(() => {104        copyBtn.innerText = "Copy Post";105    },2000);106 107});