Skip to content

Commit

Permalink
using local data isntead of cloud, removed testimonials, and made a f…
Browse files Browse the repository at this point in the history
…ew adjustments
  • Loading branch information
usman-khan-01 committed Oct 31, 2023
1 parent 52107d4 commit 04acc26
Show file tree
Hide file tree
Showing 3 changed files with 131 additions and 97 deletions.
12 changes: 4 additions & 8 deletions assets/data/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
"profession": "Web Developer",
"tagline": "I can help you achieve your goal as a web developer",
"profileImageUrl": "assets/images/profile/profile-image.jpg",
"about": "I'm an experienced web developer in Asp.net, Angular, WordPress and currently working on Fiverr and Upwork. I've reasonable amount of knowledge in my field. I’ve completed theme integration in Angular, Asp.net, WordPress as well as API Integration in Angular and Asp.net.",
"about": "Hi, I am a skilled web developer with close to 3 years of experience in Asp.Net, Angular, and WordPress. I am proficient in working with APIs and debugging. I am also familiar with a variety of development tools and methodologies such as N-Layered Architecture, SOLID Principles, Unit of Work, and Repository Pattern.",
"basicInfo": {
"mobile": "+92-323-1481150",
"mobile": "+92-327-4416761",
"email": "usmangorsi@outlook.com",
"address": "Lahore District, Punjab, Pakistan",
"industry": "Information Technologies",
"languages": "Urdu, English, Punjabi"
"languages": "English, Urdu, Punjabi"
},
"socialLinks": [
{
Expand All @@ -26,10 +26,6 @@
"platformName": "Hubstaff",
"link": "https://talent.hubstaff.com/profiles/usman-khan-5"
},
{
"platformName": "Fiverr",
"link": "https://fiverr.com/usman_gorsi1"
},
{
"platformName": "Upwork",
"link": "https://www.upwork.com/freelancers/~01a12c9161e7456dcc"
Expand Down Expand Up @@ -78,7 +74,7 @@
"degree": "Bscs",
"subject": "Computer Science",
"summary": "I'm currently doing my bechelors in computer science from virtual university.",
"yearOfGraduation": "2018 - Onwards"
"yearOfGraduation": "2017 - Onwards"
}
],
"licensesAndCertifications": [
Expand Down
173 changes: 107 additions & 66 deletions assets/js/script.js
Original file line number Diff line number Diff line change
@@ -1,45 +1,64 @@
var doc = new jsPDF('p', 'pt', 'legal');
var doc = new jsPDF("p", "pt", "legal");
var img = new Image();
var emailPattern = /^\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,3}$/;

getPlatformName = (s) => console.log(s[0].link);

// data
(async () => {
const response = await fetch('https://api.perspective-v.com/graph/resume', {
method: 'POST',
headers: {
"Content-Type": "application/json",
"Accept": "*/*",
},
body: JSON.stringify({
query: `query getMyResume($token:String!){
getByAccessToken(accesToken:$token){
name,
htmlTemplate,
jsonData
}
}`,
variables: {
token: 'FS6Tgrq/T0qblqiuIg7i4Q=='
}
})
});
const body = await response.json();
var data = JSON.parse(body.data.getByAccessToken.jsonData);
//#region cloud call
// const response = await fetch('https://api.perspective-v.com/graph/resume', {
// method: 'POST',
// headers: {
// "Content-Type": "application/json",
// "Accept": "*/*",
// },
// body: JSON.stringify({
// query: `query getMyResume($token:String!){
// getByAccessToken(accesToken:$token){
// name,
// htmlTemplate,
// jsonData
// }
// }`,
// variables: {
// token: 'FS6Tgrq/T0qblqiuIg7i4Q=='
// }
// })
// });
// const body = await response.json();
// var data = JSON.parse(body.data.getByAccessToken.jsonData);
//#endregion cloud call

$.getJSON("./assets/data/data.json", function (data) {
// basic info
$('.navbar-brand, .name').append(data.fullName);
$('.category').append(data.profession);
document.querySelector('.profile-image').src = data.profileImageUrl;
$(".navbar-brand, .name").append(data.fullName);
$(".category").append(data.profession);
document.querySelector(".profile-image").src = data.profileImageUrl;
// document.querySelector('.linkedIn_pdf').href = getPlatformName(data.socailLinks);
$('.aboutMe').append(data.about);
var basicInformation = ["Mobile", "Email", "Address", "Industry", "Languages"];
$.each(basicInformation, (i, value) => $('.pInfo .text-uppercase').append(value + ':' + '<br><br>'));
$.each(data.basicInfo, (i, value) => $('.pInfoValue').append((value != null && value === `${/^\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,3}$/g}`) ? `<a href="mailto:${value}">${value}</a><br><br>` : value + '<br><br>'));
$(".aboutMe").append(data.about);
// $(".miniIntro").append();
var basicInformation = [
"Mobile",
"Email",
"Address",
"Industry",
"Languages",
];
$.each(basicInformation, (i, value) =>
$(".pInfo .text-uppercase").append(value + ":" + "<br><br>")
);
$.each(data.basicInfo, (i, value) =>
$(".pInfoValue").append(
value != null && value === `${/^\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,3}$/g}`
? `<a href="mailto:${value}">${value}</a><br><br>`
: value + "<br><br>"
)
);

// skills
$.each(data.skills, function (i, skill) {
$('.skills').append(`
$(".skills").append(`
<div class="col-md-6 skill">
<div class="progress-container progress-primary"><span class="progress-badge">${skill.name}</span>
<div class="progress">
Expand All @@ -54,7 +73,7 @@ getPlatformName = (s) => console.log(s[0].link);

// portfolio
$.each(data.portfolios, function (i, portfolio) {
$('.portfolios').append(`
$(".portfolios").append(`
<div class="tab-content gallery mt-5 col-md-6" style="padding-bottom: 20px">
<div class="cc-porfolio-image img-raised" data-aos="fade-up" data-aos-anchor-placement="top-bottom">
<a href="${portfolio.link}" target="_blank">
Expand All @@ -72,7 +91,7 @@ getPlatformName = (s) => console.log(s[0].link);

// education
$.each(data.education, function (i, edu) {
$('.cc-education').append(`
$(".cc-education").append(`
<div class="card">
<div class="row education">
<div class="col-md-3 bg-primary" data-aos="fade-right" data-aos-offset="50" data-aos-duration="500">
Expand All @@ -93,12 +112,14 @@ getPlatformName = (s) => console.log(s[0].link);
`);
});

// testimonial
//#region testimonials
$.each(data.testimonials, function (i, testimonial) {
$('.carousel-indicators').append(`<li class="carousel-indicator" data-target="#cc-Indicators" dataSlideTo="0"></li>`);
if (i == 0) {
$('.carousel-indicator').addClass('active');
$('.carousel-inner').append(`<div class="carousel-item active">
$(".carousel-indicators").append(
`<li class="carousel-indicator" data-target="#cc-Indicators" dataSlideTo="0"></li>`
);
if (i == 0) {
$(".carousel-indicator").addClass("active");
$(".carousel-inner").append(`<div class="carousel-item active">
<div class="row testimonial">
<div class="col-lg-2 col-md-3 cc-reference-header">
<a href="${testimonial.link}" target="_blank">
Expand All @@ -108,9 +129,9 @@ getPlatformName = (s) => console.log(s[0].link);
<div class="col-lg-10 col-md-9"> <p>${testimonial.review}</p> </div>
</div>
</div>`);
} else {
$('.carousel-indicator').removeClass('active');
$('.carousel-inner').append(`<div class="carousel-item">
} else {
$(".carousel-indicator").removeClass("active");
$(".carousel-inner").append(`<div class="carousel-item">
<div class="row testimonial">
<div class="col-lg-2 col-md-3 cc-reference-header">
<a href="${testimonial.link}" target="_blank">
Expand All @@ -120,41 +141,61 @@ getPlatformName = (s) => console.log(s[0].link);
<div class="col-lg-10 col-md-9"> <p>${testimonial.review}</p> </div>
</div>
</div>`);
}
}
});
//#endregion testimonials

//#region pdf data
$('.username_pdf').append(data.fullName);
$('.address_pdf').append(data.basicaddress);
$('.mailAndMobile_pdf').append(data.basicInfo.email + '<br>' + data.basicInfo.mobile);
$('.about_pdf').append(data.about);
$(".username_pdf").append(data.fullName);
$(".address_pdf").append(data.basicaddress);
$(".mailAndMobile_pdf").append(
data.basicInfo.email + "<br>" + data.basicInfo.mobile
);
$(".about_pdf").append(data.about);
// doc.textWithLink(text, {url: getPlatformName(data.links) });
document.querySelector('.linkedIn_pdf').href = getPlatformName(data.socialLinks);
$.each(data.skills, (i, skill) => $('.skill_pdf').append(`<li>${skill.name}</li>`));
$.each(data.education, (i, edu) => $('.education_pdf').append(`<p>${edu.institution} - ${edu.subject}<br>${edu.yearOfGraduation}</p><br>`));
$.each(data.experiences, (i, exp) => $('.experience_pdf').append(`<p><b>${exp.profession} - ${exp.company}</b><br>${exp.duration}<br>${exp.description}</p><br>`));
$.each(data.licensesAndCertifications, (i, lcct) => $('.licensesAndCertifications_pdf').append(`<p><a href="${lcct.link}"><b>${lcct.name}</b></a> - ${lcct.institution}</p>`));
document.querySelector(".linkedIn_pdf").href = getPlatformName(
data.socialLinks
);
$.each(data.skills, (i, skill) =>
$(".skill_pdf").append(`<li>${skill.name}</li>`)
);
$.each(data.education, (i, edu) =>
$(".education_pdf").append(
`<p>${edu.institution} - ${edu.subject}<br>${edu.yearOfGraduation}</p><br>`
)
);
$.each(data.experiences, (i, exp) =>
$(".experience_pdf").append(
`<p><b>${exp.profession} - ${exp.company}</b><br>${exp.duration}<br>${exp.description}</p><br>`
)
);
$.each(data.licensesAndCertifications, (i, lcct) =>
$(".licensesAndCertifications_pdf").append(
`<p><a href="${lcct.link}"><b>${lcct.name}</b></a> - ${lcct.institution}</p>`
)
);
//#endregion pdf data

//#region generate pdf
$(document).on('click', '#gpdf', function () {
// doc.splitTextToSize(data.about, 50);
// doc.textWithLink('linkedin.com/in/uk-gorsi', {url: getPlatformName(data.links)});
// html2canvas('#pdf', {
// useCORS: true,
// onrendered: function (canvas) {
// }
// })
// img.src = data.profileImageUrl;
// doc.addImage(img, 'png', 10, 78, 12, 15);
doc.fromHTML($("#pdf").html(), 20, 0, {
width: 550,
pagesplit: true
});
// window.open(imageData);
doc.save(`${data.fullName}'s CV.pdf`);
$(document).on("click", "#gpdf", function () {
// doc.splitTextToSize(data.about, 50);
// doc.textWithLink('linkedin.com/in/uk-gorsi', {url: getPlatformName(data.links)});
// html2canvas('#pdf', {
// useCORS: true,
// onrendered: function (canvas) {
// }
// })
// img.src = data.profileImageUrl;
// doc.addImage(img, 'png', 10, 78, 12, 15);
doc.fromHTML($("#pdf").html(), 20, 0, {
width: 550,
pagesplit: true,
});
// window.open(imageData);
doc.save(`${data.fullName}'s CV.pdf`);
});
//#endregion generate pdf
});
})();

//#region json to pdf jsPDF
Expand Down
43 changes: 20 additions & 23 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,15 @@
<div class="cc-profile-image"><img src="" class="profile-image" /></div>
<div class="h2 title name"></div>
<p class="category text-white"></p>
<a class="btn btn-primary smooth-scroll mr-2" href="mailto:usmangorsi@outlook.com" data-aos="zoom-in"
<a class="btn btn-primary smooth-scroll mr-2" href="https://pk.linkedin.com/in/uk-gorsi" data-aos="zoom-in"
data-aos-anchor="data-aos-anchor">Contact Me</a>
<a class="btn btn-primary" href="https://www.fiverr.com/usman_gorsi1" target="_blank" data-aos="zoom-in"
data-aos-anchor="data-aos-anchor">Hire Me</a>
<!-- <a class="btn btn-primary smooth-scroll mr-2" href="mailto:usmangorsi@outlook.com" data-aos="zoom-in"
data-aos-anchor="data-aos-anchor">Contact Me</a> -->
</div>
</div>
<div class="section">
<div class="container">
<div class="button-container">
<a class="btn btn-default btn-round btn-lg btn-icon" href="https://www.fiverr.com/usman_gorsi1"
rel="tooltip" title="Follow me on Fiverr"><i class="fa fa-facebook"></i></a>
<a class="btn btn-default btn-round btn-lg btn-icon" href="https://twitter.com/GorsiUk" rel="tooltip"
title="Follow me on Twitter"><i class="fa fa-twitter"></i></a>
<!-- <a class="btn btn-default btn-round btn-lg btn-icon" href="#" rel="tooltip"
Expand All @@ -97,7 +95,7 @@
<div class="col-lg-6 col-md-12">
<div class="card-body">
<div class="h4 mt-0 title">About</div>
<!-- <p class="miniIntro"></p> -->
<p class="miniIntro"></p>
<p class="aboutMe"></p>
</div>
</div>
Expand Down Expand Up @@ -147,21 +145,22 @@
</div>
</div>

<!-- experiences -->
<!--#region experiences -->
<!-- <div class="container experiences">
<div class="experience-item">
<h4>Developer</h4>
<div class="experience-item">
<h4>Developer</h4>
<h5>2019 Present</h5>
<p><em>Company</em></p>
<p>
<ul>
<li>Lorem ipsum dolor sit amet consectetur adipisicing elit. Cupiditate, soluta rem inventore
perspiciatis voluptate vero fuga nesciunt, minus quae quia est modi! Quas vitae, impedit maxime
illo esse earum et!</li>
</ul>
</p>
<ul>
<li>Lorem ipsum dolor sit amet consectetur adipisicing elit. Cupiditate, soluta rem inventore
perspiciatis voluptate vero fuga nesciunt, minus quae quia est modi! Quas vitae, impedit maxime
illo esse earum et!</li>
</ul>
</p>
</div>
</div> -->
<!--#endregion experiences -->

<!-- education -->
<div class="section" id="education">
Expand All @@ -170,8 +169,8 @@ <h5>2019 Present</h5>
</div>
</div>

<!-- testimonials -->
<div class="section" id="testimonials">
<!--#region testimonials -->
<!-- <div class="section" id="testimonials">
<div class="container cc-reference">
<div class="h4 mb-4 text-center title">Testimonials</div>
<div class="card" data-aos="zoom-in">
Expand All @@ -183,7 +182,8 @@ <h5>2019 Present</h5>
</div>
</div>
</div>
</div>
</div> -->
<!--#endregion testimonials -->

<!-- download as pdf button -->
<div class="buttonHolder">
Expand All @@ -193,15 +193,12 @@ <h5>2019 Present</h5>
<!-- footer -->
<footer class="footer">
<div class="container text-center socialLinks">
<a class="cc-facebook btn btn-link" href="https://www.fiverr.com/usman_gorsi1">
<i class="fa fa-facebook fa-2x" aria-hidden="true"></i>
</a>
<a class="cc-twitter btn btn-link" href="https://twitter.com/GorsiUk">
<i class="fa fa-twitter fa-2x" aria-hidden="true"></i>
</a>
<a class="cc-twitter btn btn-link" href="https://www.upwork.com/freelancers/~01a12c9161e7456dcc">
<!-- <a class="cc-twitter btn btn-link" href="https://www.upwork.com/freelancers/~01a12c9161e7456dcc">
<i class="fa fa-twitter fa-2x" aria-hidden="true"></i>
</a>
</a> -->
<a class="cc-instagram btn btn-link" href="https://www.instagram.com/ukgorsi/">
<i class="fa fa-instagram fa-2x" aria-hidden="true"></i>
</a>
Expand Down

0 comments on commit 04acc26

Please sign in to comment.