Skip to content

Commit

Permalink
Merge pull request #990 from Mohitranag18/inputgit
Browse files Browse the repository at this point in the history
Add GitHub Username Input Field to User Profile (#939)
  • Loading branch information
GarimaSingh0109 authored Nov 8, 2024
2 parents 4753cd4 + 9d27af0 commit db4ee85
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
11 changes: 7 additions & 4 deletions Resume.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,22 @@ body {
position: relative;
}
.herocontent{
height: 50%;
height: 40%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
position: relative;
text-align: center;
gap: 2rem;
gap: 1.5rem;
}
.herocontent h1{
width: 60%;
font-size: 5rem;
font-weight: 800;
color: white;
margin-bottom: 0;
border: 0;
}
.herocontent p{
width: 60%;
Expand All @@ -38,7 +40,7 @@ body {
color: white;
}
.herostep{
height: 10%;
height: 20%;
display: flex;
justify-content: space-evenly;
align-items: center;
Expand All @@ -58,6 +60,7 @@ body {
line-height: 2rem;
margin: 0;
line-height: 2.5rem;
border: 0;
}
.herostep i{
font-size: 3rem;
Expand Down Expand Up @@ -192,7 +195,7 @@ body {
width: 50%;
}
#profile{
height: 25rem;
height: 17rem;
}
#education-fields{
position: relative;
Expand Down
11 changes: 8 additions & 3 deletions Resume.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,14 @@ document.getElementById('next-step-2').addEventListener('click', function() {
const email = document.getElementById('email').value.trim();
const contact = document.getElementById('contact').value.trim();
const location = document.getElementById('location').value.trim();
const githubid = document.getElementById('githubid').value.trim();
const skills = document.getElementById('skillsinput').value.trim();
const educationEntries = collectEducationData();
const experienceEntries = collectExperienceData();
const projectEntries = collectProjectData();

// Generate resume HTML based on the selected template
const resumeContent = generateResumeHTML(name, profile, email, contact, location, skills, educationEntries, experienceEntries, projectEntries, selectedTemplate);
const resumeContent = generateResumeHTML(name, profile, email, contact, location, githubid, skills, educationEntries, experienceEntries, projectEntries, selectedTemplate);

document.getElementById('resume-display').innerHTML = resumeContent;
step2p.querySelector('.circle').textContent = '✓';
Expand All @@ -221,6 +222,7 @@ function collectResumeData() {
const email = document.getElementById('email').value.trim();
const contact = document.getElementById('contact').value.trim();
const location = document.getElementById('location').value.trim();
const githubid = document.getElementById('githubid').value.trim();
const skills = document.getElementById('skillsinput').value.trim();
const education = collectEducationData();
const experience = collectExperienceData();
Expand All @@ -232,6 +234,7 @@ function collectResumeData() {
email,
contact,
location,
githubid,
skills,
education,
experience,
Expand Down Expand Up @@ -271,7 +274,7 @@ function collectProjectData() {
}

// Function to generate resume HTML based on selected template
function generateResumeHTML(name, profile, email, contact, location, skills, educationEntries, experienceEntries, projectEntries, template) {
function generateResumeHTML(name, profile, email, contact, location, githubid, skills, educationEntries, experienceEntries, projectEntries, template) {
let educationHTML = educationEntries.map(edu => `
<div>
<strong>${edu.institute}</strong> (${edu.startYear} - ${edu.endYear})<br>
Expand Down Expand Up @@ -300,7 +303,7 @@ function generateResumeHTML(name, profile, email, contact, location, skills, ed
return `
<h1>${name}</h1>
<p>${profile}</p>
<p>Email: ${email} | Contact: ${contact} | Location: ${location}</p>
<p>Email: ${email} | Contact: ${contact} | Location: ${location} | Github: ${githubid}</p>
<br>
<p><b>Skills:</b> ${skills}</>
<h2>Education</h2>
Expand All @@ -321,6 +324,7 @@ else if(selecttemp === 2){
<h2>Contact Information</h2>
<p>Email: <span id="email">${email}</span></p>
<p>Contact No: <span id="contact">${contact}</span></p>
<p>Github: <span id="githubid">${githubid}</span></p>
<p>Location: <span id="location">${location}</span></p>
<h2>Skills</h2>
<p id="skills">${skills}</p>
Expand Down Expand Up @@ -391,6 +395,7 @@ else if(selecttemp ===3){
<h2>Contact Information</h2>
<p><i class="fa-solid fa-envelope"></i> Email: <span id="email">${email}</span></p>
<p><i class="fa-solid fa-address-book"></i> Contact No: <span id="contact">${contact}</span></p>
<p><i class="fa-brands fa-github"></i> Github: <span id="contact">${githubid}</span></p>
<p><i class="fa-solid fa-location-dot"></i> Location: <span id="location">${location}</span></p>
<h2>Education</h2>
Expand Down
3 changes: 3 additions & 0 deletions resume.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ <h3>Personal Information <i id="caret1" class="fa-solid fa-caret-down"></i></h3>
<label>Profile:</label>
<textarea id="profile" placeholder="Write about yourself"></textarea>
<p id="pinfodesc">0/150</p>

<label>Github Username:</label>
<input type="text" id="githubid" placeholder="Enter your username, Ex. johnsmith07">
</div>
</div>
</div>
Expand Down

0 comments on commit db4ee85

Please sign in to comment.