-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.js
76 lines (75 loc) · 1.82 KB
/
demo.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
(function(){
var interv;
$('.geolocation .ico').mouseenter(function(){
interv = setInterval(function(){
$('.geolocation span').css('opacity', '0');
setTimeout(function(){
$('.geolocation span').css('opacity', '1');
},600);
},800);
});
$('.geolocation .ico').mouseleave(
function(){
window.clearInterval(interv);
$('.geolocation span').css('opacity', '1');
});
})();
(function(){
$('.collapse .ico').mouseenter(function(){
$('.collapse .ico').css('-webkit-transform','scale(1, 0.5)');
});
$('.collapse .ico').mouseleave(function(){
$('.collapse .ico').css('-webkit-transform','scale(1, 1)');
});
})();
//slide icon created by HTML5 canvas
(function(){
var canv = $('#slide_icon')[0]
, cont = canv.getContext('2d');
//border
cont.beginPath();
cont.moveTo(8,10);
cont.arc(8,18,8,Math.PI*3/2,Math.PI,true);
cont.lineTo(0,70);
cont.arc(8,70,8,Math.PI, Math.PI/2,true);
cont.lineTo(92,78);
cont.arc(92,70,8,Math.PI/2,0,true);
cont.lineTo(100,18);
cont.arc(92,18,8,0,Math.PI*3/2,true);
cont.lineTo(8,10);
cont.strokeStyle = "#7f7f7f";
cont.closePath();
cont.stroke();
//content
cont.beginPath();
cont.moveTo(24,26);
cont.arc(24,34,8,Math.PI*3/2,Math.PI,true);
cont.lineTo(16,54);
cont.arc(24,54,8,Math.PI, Math.PI/2,true);
cont.lineTo(76,62);
cont.arc(76,54,8,Math.PI/2,0,true);
cont.lineTo(84,34);
cont.arc(76,34,8,0,Math.PI*3/2,true);
cont.lineTo(24,26);
cont.fillStyle = "#7f7f7f";
cont.closePath();
cont.fill();
//next triangle
cont.beginPath();
cont.moveTo(55.3,39);
cont.lineTo(64,44);
cont.lineTo(55.3,49);
cont.lineTo(55.3,39);
cont.fillStyle = "white";
cont.closePath();
cont.fill();
//pre triangle
cont.beginPath();
cont.moveTo(44.7,39);
cont.lineTo(36,44);
cont.lineTo(44.7,49);
cont.lineTo(44.7,39);
cont.fillStyle = "white";
cont.closePath();
cont.fill();
})();