-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
137 lines (121 loc) · 3.92 KB
/
main.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
/**This function is used for flip the card */
document.getElementById('clickToFlap').addEventListener('click', function() {
document.getElementById('flipCard').classList.toggle('flip');
setTimeout(() => {
document.getElementById('back-card').classList.toggle('d-block');
}, 200);
});
// when document is ready this function is called
$( document ).ready(function() {
//this function is used for making the details html
var detailsWrapper = document.getElementById("detail-list"); // get the details html div
var myDetailHTML = ''; //variable that hold my details html
//variable that contains my details
var myData = [
{
key : "Name",
value : "Harsh Joginbhai Patel",
},
{
key : "Date of birth",
value : "31/May/1998",
},
{
key : "Time of birth",
value : "11:15 AM",
},
{
key : "Place of birth",
value : "Khambhat, Gujarat",
},
{
key : "Complexion",
value : "Fair",
},
{
key : "Weight",
value : "68 kg",
},
{
key : "Height",
value : `5' 6"`,
},
{
key : "Cast",
value : "Kadva Patel",
},
{
key : "Sub Cast",
value : "42 Gam Kadva Patel",
},
{
key : "Education",
value : "IT Engineer",
},
{
key : "Profession",
value : "Software Engineer",
},
{
key : "Father's Name",
value : "Joginbhai Vadilal Patel",
},
{
key : "Fathers's Profession",
value : "Farmer",
},
{
key : "Mother's Name",
value : "Urmilaben Joginbhai Patel",
},
{
key : "Mother's Profession",
value : "House Wife",
},
{
key : "Brother",
value : "Meet Patel",
},
{
key : "Brother's Profession",
value : "Mechanical Engineer",
},
{
key : "Native",
value : "Kapadwanj",
},
{
key : "Mosal",
value : "Finav, Khambhat",
},
{
key : "Address",
value : "1328, Mota Patelwada, beside Swaminarayan Temple, Kapadwanj, Kheda-387620",
},
{
key : "Food Habbit",
value : "Veg",
}
]
for (var i = 0; i < myData.length; i++) { //generating my details html by using loop
myDetailHTML += `<dt class="font-weight-bold">${myData[i].key} </dt> <dd class="m-0">${myData[i].value}</dd>`;
}
detailsWrapper.innerHTML = myDetailHTML //adding the dynamic html as inner HTML of my details div
//this function is used for showing my all photos
var imagesWrapper = document.getElementById("all-images"); //this is holding the parent container where my all photo's html will be inserted
//this is the variable that hold my image name and my all images exist in assets folder
var myImageName = [
'harsh2.jpg',
'harsh3.jpg',
]
var myImageHTML = ''; //variable that hold the html of my all photos
for (var i = 0; i < myImageName.length; i++) {//generating html by of my all photos by using loop
myImageHTML += `<div class="card-back-img"><img class="pop-img" src="./assets/${myImageName[i]}" alt="Profile Picture"></div>`;
}
imagesWrapper.innerHTML = myImageHTML //adding the dynamic html of my all photos as inner HTML of parent div
//this function is used for open the image into popup
$('.pop-img').on('click', function() {
$('.imagepreview').attr('src', $(this).attr('src'));
$('#imagemodal').modal('show');
});
});