forked from GarimaSingh0109/Resum-Resume
-
Notifications
You must be signed in to change notification settings - Fork 0
/
resume2.js
217 lines (200 loc) · 7.05 KB
/
resume2.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
// this js file is part 2 for the collectResumeData.js
// dropdown info in step 1 section logic
const caret1 = document.querySelector('#caret1');
const caret2 = document.querySelector('#caret2');
const caret3 = document.querySelector('#caret3');
const caret4 = document.querySelector('#caret4');
const caret5 = document.querySelector('#caret5');
const caret6 = document.querySelector('#caret6');
const caret7 = document.querySelector('#caret7');
const pinfo = document.querySelector('.pInfo');
pinfo.style.display = 'none';
const education = document.querySelector('#education-fields');
const edubtn = document.querySelector('#add-education');
education.style.display = 'none';
edubtn.style.display = 'none';
const slabel = document.querySelector('#skill-label')
const sinput = document.querySelector('#skills-input')
slabel.style.display = 'none';
sinput.style.display = 'none';
const expfield = document.querySelector('#experience-fields');
const expbtn = document.querySelector('#add-experience');
expfield.style.display = 'none';
expbtn.style.display = 'none';
const achive = document.querySelector('.achive');
const achivebtm = document.querySelector('#add-achivement');
achive.style.display = 'none';
achivebtm.style.display = 'none';
const projfield = document.querySelector('#project-fields');
const projbtn = document.querySelector('#add-project');
projfield.style.display = 'none';
projbtn.style.display = 'none';
const lnglabel = document.querySelector('#langlabel');
const lnginput = document.querySelector('#languages-input');
lnglabel.style.display = 'none';
lnginput.style.display = 'none';
caret1.addEventListener('click',()=>{
if(pinfo.style.display === 'none'){
pinfo.style.display = '';
caret1.style.transform = 'rotate(180deg)';
}
else{
pinfo.style.display = 'none';
caret1.style.transform = 'rotate(0)';
}
})
caret2.addEventListener('click',()=>{
if(education.style.display === 'none'){
education.style.display = '';
edubtn.style.display = '';
caret2.style.transform = 'rotate(180deg)';
}
else{
education.style.display = 'none';
edubtn.style.display = 'none';
caret2.style.transform = 'rotate(0)';
}
})
caret3.addEventListener('click',()=>{
if(slabel.style.display === 'none'){
slabel.style.display = '';
sinput.style.display = '';
caret3.style.transform = 'rotate(180deg)';
}
else{
slabel.style.display = 'none';
sinput.style.display = 'none';
caret3.style.transform = 'rotate(0)';
}
})
caret4.addEventListener('click',()=>{
if(expfield.style.display === 'none'){
expfield.style.display = '';
expbtn.style.display = '';
caret4.style.transform = 'rotate(180deg)';
}
else{
expfield.style.display = 'none';
expbtn.style.display = 'none';
caret4.style.transform = 'rotate(0)';
}
})
caret5.addEventListener('click',()=>{
if(achive.style.display === 'none'){
achive.style.display = '';
achivebtm.style.display = '';
caret5.style.transform = 'rotate(180deg)';
}
else{
achive.style.display = 'none';
achivebtm.style.display = 'none';
caret5.style.transform = 'rotate(0)';
}
})
caret6.addEventListener('click',()=>{
if(projfield.style.display === 'none'){
projfield.style.display = '';
projbtn.style.display = '';
caret6.style.transform = 'rotate(180deg)';
}
else{
projfield.style.display = 'none';
projbtn.style.display = 'none';
caret6.style.transform = 'rotate(0)';
}
})
caret7.addEventListener('click',()=>{
if(lnglabel.style.display === 'none'){
lnglabel.style.display = '';
lnginput.style.display = '';
caret7.style.transform = 'rotate(180deg)';
}
else{
lnglabel.style.display = 'none';
lnginput.style.display = 'none';
caret7.style.transform = 'rotate(0)';
}
})
let exed1 = 0;
let exed2 = 0;
let exed3 = 0;
let exed4 = 0;
const limit = 300; // Maximum character limit
const myprofiledesc = document.querySelector('#profile');
const myprofilecount = document.querySelector('#pinfodesc');
myprofilecount.textContent = "0/" + limit; // Initialize character count for profile
myprofiledesc.addEventListener('input', () => {
const textlength = myprofiledesc.value.length;
myprofilecount.textContent = textlength + "/" + limit;
if (textlength > limit) {
myprofilecount.style.color = 'red';
exed1 = 1;
} else {
myprofilecount.style.color = ''; // Optional: Set back to default color
exed1 = 0;
}
updateWarningDisplay();
});
const myexpdesc = document.querySelector('#expdes');
const myexpcount = document.querySelector('#expdesc');
myexpcount.textContent = "0/" + limit; // Initialize character count for experience
myexpdesc.addEventListener('input', () => {
const textlength = myexpdesc.value.length;
myexpcount.textContent = textlength + "/" + limit;
if (textlength > limit) {
myexpcount.style.color = 'red';
exed2 = 1;
} else {
myexpcount.style.color = ''; // Optional: Set back to default color
exed2 = 0;
}
updateWarningDisplay();
});
const myachivedesc = document.querySelector('#achivedes');
const myachivecount = document.querySelector('#achivedesc');
myachivecount.textContent = "0/" + limit; // Initialize character count for achievements
myachivedesc.addEventListener('input', () => {
const textlength = myachivedesc.value.length;
myachivecount.textContent = textlength + "/" + limit;
if (textlength > limit) {
myachivecount.style.color = 'red';
exed3 = 1;
} else {
myachivecount.style.color = ''; // Optional: Set back to default color
exed3 = 0;
}
updateWarningDisplay();
});
const myprojdesc = document.querySelector('#projectdesc');
const myprojcount = document.querySelector('#projdesc');
myprojcount.textContent = "0/" + limit; // Initialize character count for projects
myprojdesc.addEventListener('input', () => {
const textlength = myprojdesc.value.length;
myprojcount.textContent = textlength + "/" + limit;
if (textlength > limit) {
myprojcount.style.color = 'red';
exed4 = 1;
} else {
myprojcount.style.color = ''; // Optional: Set back to default color
exed4 = 0;
}
updateWarningDisplay();
});
// Function to update the warning button and message display
const dummybtn = document.querySelector('#dummy1');
const realbtn = document.querySelector('#next-step');
const charwarning = document.querySelector('#limitwarning');
realbtn.style.display = 'block';
dummybtn.style.display = 'none';
charwarning.style.display = 'none';
function updateWarningDisplay() {
if (exed1 === 1 || exed2 === 1 || exed3 === 1 || exed4 === 1) {
dummybtn.style.display = 'block';
charwarning.style.display = 'block';
realbtn.style.display = 'none';
} else {
dummybtn.style.display = 'none';
charwarning.style.display = 'none';
realbtn.style.display = 'block';
}
}