-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcircleanim.js
More file actions
75 lines (69 loc) · 1.9 KB
/
Copy pathcircleanim.js
File metadata and controls
75 lines (69 loc) · 1.9 KB
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
var btn = $('.menu-icon-toggle');
var background = $('body');
var width = 0;
var height = 0;
var r = 0;
setSize();
function setSize() {
width = $(window).width();
height = $(window).height();
r = Math.sqrt(width * width + height * height);
}
$(window).resize(setSize);
//var circle = $("<div unselectable='on' id='circle' style='z-index=9999'></div>");
var circle = $(".menu-shadow");
function close_circle() {
circle.animate({
width: 0,
height: 0,
'margin-left': 0,
'margin-top': 0
}, {
duration: 600,
easing: "easeInOutCubic",
queue: false,
complete: function() {
/*circle.parent().css('background-color',
$(this).css('background-color'));
circle.detach();*/
console.log("complete closing")
}
});
}
btn.click(function(e) {
if (!$("body").hasClass('open')) {
circle.css({
z_index: 300,
position: 'absolute',
'background': 'rgba(162, 87, 44, 0.82)',
width: 0,
height: 0,
"border-radius": "50%",
left: e.pageX,
top: e.pageY,
'margin-left': 0,
'margin-top': 0,
'webkit-user-select': 'none',
'-moz-user-select': 'none',
'-ms-user-select': 'none'
});
circle.animate({
width: (r * 2),
height: (r * 2),
'margin-left': -r,
'margin-top': -r
}, {
duration: 600,
easing: "easeInOutCubic",
queue: false,
complete: function() {
/*circle.parent().css('background-color',
$(this).css('background-color'));
circle.detach();*/
console.log("complete opening")
}
});
} else {
close_circle();
}
});