-
Notifications
You must be signed in to change notification settings - Fork 19
/
desktop-mobile.html
executable file
·54 lines (46 loc) · 2.02 KB
/
desktop-mobile.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Desktop - Mobile</title>
<link rel="stylesheet" href="style.css">
<script src="snap.svg-min.js"></script>
<script>
window.onload = function () {
var whole = Snap.select("#whole-icon")
var icon = Snap.select("#icon");
var base = icon.select("#base");
var monitor = icon.select("#monitor");
function revert() {
monitor.animate({
d: "M5 5 145 5 145 105 5 105 z M15 15 135 15 135 75 15 75 z"
}, 1000, mina.bounce);
base.animate({
points: "50,130 100,130 90,100 60,100"
}, 1000, mina.bounce);
}
function open() {
clearTimeout(revert);
monitor.animate({
d: "M25 5 120 5 120 135 25 135 z M62.5 110a10 10 0 1 1 0 0.0001 z M35 15 110 15 110 90 35 90 z"
}, 1000, mina.bounce, function () { setTimeout(revert, 1000); });
base.animate({
points: "50,130 100,130 90,130 60,130"
}, 1000, mina.bounce);
}
whole.click(open);
}
</script>
</head>
<body>
<svg id ="whole-icon" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="150px" height="150px" viewBox="0 0 150 150" enable-background="new 0 0 150 150"
xml:space="preserve" style="width: 100px; height: 100px;">
<g id="icon">
<polygon fill="#FFFFFF" stroke="#FFFFFF" id="base" points="50,130 100,130 90,100 60,100" />
<path fill="#FFFFFF" stroke="#FFFFFF" id="monitor" d="M5 5 145 5 145 105 5 105 z M15 15 135 15 135 75 15 75 z"
fill-rule="evenodd"/>
</g>
</svg>
</body>
</html>