-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
106 lines (78 loc) · 3.38 KB
/
index.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() {
var firebaseDb = firebase.database();
firebaseDb.ref('/personalInfo').once('value').then(function(snapshot) {
$('#name').text(snapshot.val().name);
$('#tagLine').text(snapshot.val().tagLine);
$('#aboutMe').text(snapshot.val().aboutMe);
// ...
});
var skillsRef = firebaseDb.ref('/skills');
skillsRef.on('child_added', function(data) {
$('#skillList').append("<li>● "+data.val()+"</li>")
});
firebaseDb.ref('/resumeUrl').once('value').then(function(snapshot) {
$('#resumeUrl'). attr("href", snapshot.val());
});
firebaseDb.ref('/contact').once('value').then(function(snapshot) {
$('#address').append(snapshot.val().address)
$('#phone').append(snapshot.val().phone)
$('#email').append(snapshot.val().email)
$('#facebook').attr("href", snapshot.val().facebook);
$('#linkedIn').attr("href", snapshot.val().linkedIn);
$('#github').attr("href", snapshot.val().github);
$('#formAction').attr("action", snapshot.val().formAction);
});
var projectsRef = firebaseDb.ref('/projects');
projectsRef.on('child_added', function(data) {
part1= '<div class="w3-card-4" style="width:100%;margin-bottom:25px">'
+'<header class="w3-container w3-light-grey">'
+' <h3>'+data.val().name+' <a style="margin-bottom" href="'+data.val().github+'" target="_blank"><i class="fa fa-github w3-xxxlarge w3-text-black w3-hover-opacity w3-margin-right"></i></a></h3>'
+' </header>'
+' <div class="w3-container" style="background: gray">'
+' <hr>'
if(data.val().logo)
{
part2 = ' <img src="'+data.val().logo+'" alt="Avatar" class="w3-left w3-margin-right" style="width:100px"> '
}
else {
part2 = ''
}
part3 =' <p style="color: white">'+data.val().desc+'</p><br>'
+' </div>'
+'<form action="projectDetails.html" method="get">'
+'<input type="text" style="display:none" name="projectId" value="'+data.key+'">'
+'<input type="submit" class="w3-button w3-block w3-dark-grey" value="See More">'
+'</form>'
+'</div>';
$("#projects").append(part1+part2+part3);
});
var employmentRef = firebaseDb.ref('/employment');
employmentRef.on('child_added', function(data) {
$("#employment").append(
'<div class="w3-card-4" style="width:100%;margin-bottom:25px">'
+'<header class="w3-container w3-light-grey">'
+' <h3>'+data.val().title+' @ <a style="margin-bottom" href="'+data.val().url+'" target="_blank">'+data.val().name+'</a></h3>'
+' </header>'
+' <div class="w3-container" style="background: gray">'
+' <p style="color: white">'+data.val().duties+'</p><br>'
+' </div>'
+' <div class="w3-block w3-dark-grey" style="text-align:center">'+data.val().location+' | '+data.val().duration+'</div>'
+'</div>');
});
var additionalExpRef = firebaseDb.ref('/additionalExp');
additionalExpRef.on('child_added', function(data) {
$("#additionalExp").append(
'<div class="w3-card-4" style="width:100%;margin-bottom:25px">'
+'<header class="w3-container w3-light-grey">'
+' <h3>'+data.val().title+' @ '+data.val().name+'</h3>'
+' </header>'
+' <div class="w3-container" style="background: gray">'
+' <p style="color: white">'+data.val().duties+'</p><br>'
+' </div>'
+' <div class="w3-block w3-dark-grey" style="text-align:center">'+data.val().duration+'</div>'
+'</div>');
});
$( "#addExp" ).click(function() {
$("#additionalExp").toggle();
});
});