-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
131 lines (122 loc) · 2.24 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
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
// This is ulgy but it works! :-)
$( document ).ready(function() {
$('[data-toggle="tooltip"]').tooltip();
var currentElement = null;
var buttonsToggle = $('.toggle')
function hide(element) {
var elementToHide = $(element)
elementToHide.animate({
height: "0px",
opacity: "0"
}, 500);
setTimeout(function () {
elementToHide.hide();
}, 500);
}
function show(element) {
var elementToShow = $(element)
elementToShow.show();
elementToShow.animate({
height: "300px",
opacity: "1"
}, 500);
}
function toggleContent(element) {
hide(currentElement);
if ($(element).attr('id') !== $(currentElement).attr('id')) {
currentElement = element;
setTimeout(function () {
show(element);
}, 500);
}
}
var ids = {}
for (var i = 0; i < buttonsToggle.length; i++) {
$(buttonsToggle[i]).on('click', function (e) {
this.id = "#" + $(e.target).attr("toggle");
this.newElement = $(this.id)
if (this.newElement) {
toggleContent(this.newElement);
}
});
}
// Generate with NodeJS
const drawImages = [ '0.png',
'1.png',
'2.png',
'3.png',
'4.png',
'6.png',
'7.png',
'9.png',
'12.png',
'14.png',
'16.png',
'17.png',
'18.png',
'20.png',
'26.png',
'27.png',
'29.png',
'30.png',
'31.png',
'32.png',
'33.png',
'34.png',
'35.png',
'36.png',
'39.png',
'40.png',
'41.png',
'42.png',
'43.png',
'44.png',
'45.png',
'46.png',
'47.png',
'48.png',
'49.png',
'50.png',
'53.png',
'55.png',
'59.png',
'61.png',
'63.png',
'64.png',
'65.png',
'66.png',
'68.png',
'69.png',
'70.png',
'71.png',
'73.png',
'74.png',
'75.png',
'76.png',
'77.png',
'79.png',
'80.png',
'81.png',
'82.png',
'83.png',
'84.png',
'85.png',
'86.png',
'87.png',
'89.png',
'90.png',
'91.png',
'92.png',
'93.png',
'94.png',
'95.png',
'96.png',
'97.png',
'98.png',
'99.png' ];
const modalBody = document.querySelector('.modal-body .row');
const imagesHTML = drawImages.map((image) => {
return '<div class="col-md-6"><img width="100%" src="./drawings/'+image+'"></div>'
}).join('');
modalBody.insertAdjacentHTML('afterbegin', imagesHTML);
});