-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdialogCode.js
48 lines (41 loc) · 1.24 KB
/
dialogCode.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
const modal = document.querySelector('#modal');
const openModal = document.querySelector('#open-button');
const closeModal = document.querySelector('#close-button');
openModal.onclick = function () {
modal.style.display = "block";
const boxShadowText = document.getElementById('canvas2').innerHTML;
const base64Text = document.getElementById('canvas1').style.backgroundImage.slice(5,-2);
console.log(base64Text);
$('#box-shadow-text').text( boxShadowText );
$('#base64-text').text( base64Text );
}
closeModal.onclick = function () {
modal.style.display = "none";
}
$('.modal-header span').click( function () {
if(this.classList.contains('active')) {
return;
}
var headerItems = document.getElementsByClassName('modal-header-item');
var b;
for(a = 0; a < headerItems.length; a++) {
$(headerItems[a]).removeClass("active");
}
$(this).addClass('active');
})
$('.code-css-header').click( function () {
$('#base64-text').css({
"display": "none"
})
$('#box-shadow-text').css({
"display": "block"
})
})
$('.code-base64-header').click( function () {
$('#base64-text').css({
"display": "block"
})
$('#box-shadow-text').css({
"display": "none"
})
})