-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscript.js
36 lines (28 loc) · 1.09 KB
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
function generateReadme() {
const name = document.getElementById('name').value;
const bio = document.getElementById('bio').value;
const location = document.getElementById('location').value;
const contact = document.getElementById('contact').value;
const skills = Array.from(document.getElementById('skills').selectedOptions).map(option => option.text);
const github = document.getElementById('github').value;
const linkedin = document.getElementById('linkedin').value;
const twitter = document.getElementById('twitter').value;
let socialLinks = '';
if (github) socialLinks += `[![GitHub](assets/icons/github.svg)](${github}) `;
if (linkedin) socialLinks += `[![LinkedIn](assets/icons/linkedin.svg)](${linkedin}) `;
if (twitter) socialLinks += `[![Twitter](assets/icons/twitter.svg)](${twitter}) `;
const readmeContent = `
# ${name}
## Bio
${bio}
## Location
${location}
## Contact
[${contact}](mailto:${contact})
## Skills
${skills.join(', ')}
## Social Links
${socialLinks}
`;
document.getElementById('readme-output').textContent = readmeContent;
}