-
Notifications
You must be signed in to change notification settings - Fork 0
/
cv.js
276 lines (230 loc) · 10.2 KB
/
cv.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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
// If scrolled to bottom, create print button
// window.onscroll = () => {
// if (window.innerHeight + window.scrollY >= document.body.offsetHeight) {
// let main_div = document.querySelector('#main-div');
// main_div.innerHTML +=`
// <div id="print-button" class="w3-margin-right w3-margin-top w3-display-topright w3-display-hover w3-small " style="position: fixed;" >
// <button class="w3-button w3-blue w3-border w3-border-green w3-round-large" onclick="window.print()"><b>print</b></button>
// </div>`
// }else{
// var myobj = document.querySelector("#print-button");
// if ( myobj!==null && window.innerHeight + window.scrollY <= document.body.offsetHeight - 600) {
// myobj.remove();
// }
// }
// };
function skills_contant(tag, data, flag){
if(flag == 1){
tag.innerHTML +=`
<p >${data.lang}</p>
<div class="w3-round-xlarge w3-tiny w3-gray w3-margin-bottom" >
<div class="w3-container w3-center w3-round-xlarge w3-dark-gray" style="width:${data.known_persentge}">
<div class="w3-center w3-text-white ">${data.known_persentge}</div>
</div>
</div>
</div>`;
}else{
tag.innerHTML +=`
<p >${data.lang}</p>
</div>`;
}
}
function skills_tag(tag, icon, heading, class_name, data, flag){
tag.innerHTML += `
<p class="w3-large"><b><i class="fa ${icon} fa-fw w3-margin-right w3-text-teal"></i>${heading}</b></p>
<div class="w3-container zero-space">
<div id="${class_name}-left" class="w3-col l6 m11 s11" style="padding-right: 16px;">
</div>
<div id="${class_name}-right" class="w3-col l6 m11 s11" style="padding-right: 16px;">
</div>
</div>
<hr>`;
let left_div = document.querySelector('#'+class_name+'-left');
let right_div = document.querySelector('#'+class_name+'-right');
var i = 0;
for (i = 0; i < data.length; i++){
if( i % 2 == 0){
skills_contant(left_div, data[i],flag);
}else{
skills_contant(right_div, data[i],flag);
}
}
}
function skills(){
let left_column = document.querySelector('#left-coloumn');
left_column.innerHTML += `
<p class="w3-large"><h2><b><i class="fa fa-asterisk fa-fw w3-margin-right w3-text-teal"></i>Skills</b></h2></p>
`;
var data_obj = JSON.parse(skills_data);
skills_tag(left_column, "fa-code","Programming Languages","program-lang",data_obj.programming_languages, 1);
skills_tag(left_column, "fa-database","Data-base Management","data-base",data_obj.data_management, 1);
skills_tag(left_column, "fa-plus-circle","Additional Skills","additional-skills",data_obj.additional_skills, 1);
skills_tag(left_column, "fa-terminal","Tools","tools",data_obj.tools, 0);
skills_tag(left_column, "fa-desktop ","Operating System","operating-system",data_obj.operating_systems, 0);
//skills_tag(left_column, "fa-square","Boards","boards",data_obj.boards, 0);
}
function lang_contant(tag, data){
tag.innerHTML +=`
<p >${data.lang}</p>
<div class="w3-round-xlarge w3-tiny w3-gray w3-margin-bottom">
<div class="w3-center w3-round-xlarge w3-dark-gray" style="height:16px;width:${data.known_persentge}">
</div>
</div>`;
}
function language(){
let left_column = document.querySelector('#left-coloumn');
left_column.innerHTML += `
<p class="w3-large"><b><i class="fa fa-globe fa-fw w3-margin-right w3-text-teal"></i>Languages</b></p>
<div id="lang">
<div class="w3-container zero-space">
<div id="lang-left" class="w3-col l6 m11 s11" style="padding-right: 16px;">
</div>
<div id="lang-right" class="w3-col l6 m11 s11" style="padding-right: 16px;">
</div>
</div>
</div>
<br>`;
let lang_left_data_div = document.querySelector('#lang-left');
let lang_right_data_div = document.querySelector('#lang-right');
var data = JSON.parse(language_data);
for (i = 0; i < data.language.length; i++){
if( i % 2 == 0){
lang_contant(lang_left_data_div, data.language[i]);
}else{
lang_contant(lang_right_data_div, data.language[i]);
}
}
}
function work(){
let right_column = document.querySelector('#right-column');
right_column.innerHTML += `
<div class="w3-round-large w3-container w3-card grad-top-right-blue w3-margin-bottom">
<h2 class="w3-text-grey w3-padding-16"><i class="fa fa-suitcase fa-fw w3-margin-right w3-xlarge w3-text-blue-grey"></i>Work Experience</h2>
<div id="work" class="w3-container">
</div>
</div>
`;
let work_data_div = document.querySelector('#work');
var obj = JSON.parse(work_data);
obj.work.forEach(element => {
work_data_div.innerHTML +=`
<h5 class="w3-opacity"><b>${element.position } / ${element.company }</b></h5>
<p >${element.location}</p>
<h6 class="w3-text-teal">
<i class="fa fa-calendar fa-fw w3-margin-right"></i>${element.start_data} -
${element.end_data==='Current' ? `<span class="w3-tag w3-teal w3-round">${element.end_data}</span></h6>`:
`${element.end_data}</span></h6>`}
<p>${element.role}</p>
<hr>`;
});
}
function education(){
let right_column = document.querySelector('#right-column');
right_column.innerHTML += `
<div class="w3-round-large w3-container w3-card grad-top-right-blue w3-margin-bottom">
<h2 class="w3-text-grey w3-padding-16"><i class="fa fa-graduation-cap fa-fw w3-margin-right w3-xlarge w3-text-blue-grey"></i>Education</h2>
<div id="education" class="w3-container">
</div>
</div>
`;
let education_data_div = document.querySelector('#education');
var obj = JSON.parse(education_data);
obj.education.forEach(element => {
education_data_div.innerHTML += `
<h5 class="w3-opacity"><b>${element.course}</b></h5>
<h6 class="w3-text-teal"><i class="fa fa-calendar fa-fw w3-margin-right"></i>${element.start} - ${element.end}</h6>
<h5 class="zero-space w3-text-gray"><b>${element.college}</b></h5>
<p >${element.location}</p>
<hr>
`});
}
function ecsprofessional() {
let right_column = document.querySelector('#right-column');
right_column.innerHTML += `
<div class="w3-round-large w3-container w3-card grad-top-right-blue w3-margin-bottom">
<h2 class="w3-text-grey w3-padding-16"><i class="fa fa-building fa-fw w3-margin-right w3-xlarge w3-text-blue-grey"></i>Esprofessional</h2>
<div id="esprofessional" class="w3-container">
</div>
</div>
`;
let esprofessional_data_div = document.querySelector('#esprofessional');
var obj = JSON.parse(esprofessional_data);
obj.esprofessional.forEach(element => {
esprofessional_data_div.innerHTML += `
<h5 class="w3-opacity"><b>
${element.position!==null ? `${element.position} / ${element.company}`:
element.company}
</b></h5>
<p>${element.location}</p>
<h6 class="w3-text-teal"><i class="fa fa-calendar fa-fw w3-margin-right"></i>${element.start_date} - ${element.end_date}</h6>
<p>${element.brif}</p>
<hr>
`});
}
function certificates(){
let right_column = document.querySelector('#right-column');
right_column.innerHTML += `
<div class="w3-round-large w3-container w3-card grad-top-right-blue w3-margin-bottom">
<h2 class="w3-text-grey w3-padding-16"><i class="fa fa-certificate fa-fw w3-margin-right w3-xlarge w3-text-blue-grey"></i>Certificates</h2>
<div id="certificates" class="w3-container">
</div>
</div>
`;
let certificates_data_div = document.querySelector('#certificates');
var obj = JSON.parse(certificates_data);
obj.certificates.forEach(element => {
certificates_data_div.innerHTML += `
<h5 class="w3-opacity"><b>${element.certificate}</b></h5>
<p>${element.brif}</p>
<hr>
`});
}
function project_content(tag, data){
data.projects.forEach(element => {
tag.innerHTML += `
<h5 class="w3-opacity"><b><i class="fa fa-star fa-fw w3-margin-right w3-large w3-text-blue"></i>${element.tittle}</b></h5>
${
element.brif.map(function (brif) {
return `<p class="w3-margin-right"> <i class="fa fa-circle fa-fw w3-margin-right w3-tiny w3-text-blue"></i> ${ brif }</p>`
}).join("")
}
<hr>
`});
}
function academic_projects(){
let right_column = document.querySelector('#right-column');
right_column.innerHTML += `
<div class="w3-round-large w3-container w3-card grad-top-right-blue w3-margin-bottom">
<h2 class="w3-text-grey w3-padding-16"><i class="fa fa-snowflake-o fa-fw w3-margin-right w3-xlarge w3-text-blue-grey"></i>Academic Projects</h2>
<div id="academic-projects" class="w3-container">
</div>
</div>
`;
let acadimic_projects_data_div = document.querySelector('#academic-projects');
var data = JSON.parse(academic_projects_data);
project_content(acadimic_projects_data_div,data);
}
function projects(){
let right_column = document.querySelector('#right-column');
right_column.innerHTML += `
<div class="w3-round-large w3-container w3-card grad-top-right-blue w3-margin-bottom">
<h2 class="w3-text-grey w3-padding-16"><i class="fa fa-tasks fa-fw w3-margin-right w3-xlarge w3-text-blue-grey"></i>Projects</h2>
<div id="projects" class="w3-container">
</div>
</div>
`;
let projects_data_div = document.querySelector('#projects');
var data = JSON.parse(projects_data);
project_content(projects_data_div,data);
}
function load(){
skills();
language();
work();
education();
ecsprofessional();
certificates();
projects();
academic_projects();
}
document.addEventListener('DOMContentLoaded', load);