-
Notifications
You must be signed in to change notification settings - Fork 4
/
script.js
106 lines (76 loc) · 3.16 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
function addNewExp() {
let newnode = document.createElement("textarea");
newnode.classList.add("form-control");
newnode.style.marginTop = "20px";
newnode.classList.add("wefield");
newnode.setAttribute("rows", 3);
newnode.setAttribute("placeholder", "Enter your Work Experience");
let weAdd = document.getElementById("we");
let weAddButton = document.getElementById("weAddButton");
weAdd.insertBefore(newnode, weAddButton);
}
function addNewEdu() {
let newnode = document.createElement("textarea");
newnode.classList.add("form-control");
newnode.style.marginTop = "20px";
newnode.classList.add("edufield");
newnode.setAttribute("rows", 3);
newnode.setAttribute("placeholder", "Enter your Education");
let weAdd = document.getElementById("edu");
let weAddButton = document.getElementById("EAddButton");
weAdd.insertBefore(newnode, weAddButton);
}
//generating cv
function generateResume() {
let file = document.getElementById("imgField").files[0];
console.log(file);
let reader = new FileReader();
reader.readAsDataURL(file);
//set image
reader.onloadend = function () {
document.getElementById("my-img").src = reader.result;
};
let nameField = document.getElementById("namefield").value;
document.getElementById("nameT1").innerHTML = nameField;
// document.getElementById("nameT2").innerHTML = nameField;
let contactNo = document.getElementById("contactfield").value;
document.getElementById("noT").innerHTML = contactNo;
let email = document.getElementById("emailfield").value;
document.getElementById("emailT").innerHTML = email;
let address = document.getElementById("addressfield").value;
document.getElementById("addressT").innerHTML = address;
let Github = document.getElementById("githubfield").value;
document.getElementById("githubT").innerHTML = Github;
let Linkedin = document.getElementById("linkedinfield").value;
document.getElementById("linkedinT").innerHTML = Linkedin;
let Twitter = document.getElementById("twitterfield").value;
document.getElementById("twitterT").innerHTML = Twitter;
let Website = document.getElementById("websitefield").value;
document.getElementById("websiteT").innerHTML = Website;
let Skill = document.getElementById("skillfield").value;
document.getElementById("skillT").innerHTML = Skill;
let obj = document.getElementById("objfield").value;
document.getElementById("objT").innerHTML = obj;
// experience
let work = document.getElementsByClassName("wefield");
let str = "";
for (let e of work) {
str = str + `<li> ${e.value}</li>`;
}
document.getElementById("weT").innerHTML = str;
//education
let Education = document.getElementsByClassName("edufield");
let str2 = "";
for (let e of Education) {
str2 = str2 + `<li> ${e.value}</li>`;
console.log(str2);
}
document.getElementById("eduT").innerHTML = str2;
document.getElementById("cv-form").style.display = "none";
document.getElementById("cv-template").style.display = "block";
}
//printing the resume
function printResume() {
console.log("clicked");
window.print();
}