-
Notifications
You must be signed in to change notification settings - Fork 55
/
henry.html
130 lines (126 loc) · 4.94 KB
/
henry.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
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
<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Dialog Effects | Henry</title>
<meta name="description" content="A Collection of Dialog Effects" />
<meta name="keywords" content="dialog, effect, modal, overlay, animation, web design" />
<meta name="author" content="Codrops" />
<link rel="shortcut icon" href="../favicon.ico">
<link rel="stylesheet" type="text/css" href="css/normalize.css" />
<link rel="stylesheet" type="text/css" href="css/demo.css" />
<!-- common styles -->
<link rel="stylesheet" type="text/css" href="css/dialog.css" />
<!-- individual effect -->
<link rel="stylesheet" type="text/css" href="css/dialog-henry.css" />
<script src="js/snap.svg-min.js"></script>
<script src="js/modernizr.custom.js"></script>
</head>
<body>
<div class="container">
<div class="content">
<header class="codrops-header">
<h1><span>A collection of</span> Dialog Effects</h1>
<div class="codrops-links">
<a class="codrops-icon codrops-icon-prev" href="http://tympanus.net/Development/MockupSlideshow/" title="Previous Demo"><span>Previous Demo</span></a> /
<a class="codrops-icon codrops-icon-drop" href="http://tympanus.net/codrops/?p=21386" title="Back to the article"><span>Back to the Codrops Article</span></a>
</div>
<div class="button-wrap"><button data-dialog="somedialog" class="trigger">Open Dialog</button></div>
</header>
<nav id="menu" class="menu">
<div>
<h2>Simple</h2>
<ul>
<li><a href="index.html">Sandra</a></li>
<li><a href="sally.html">Sally</a></li>
</ul>
<h2>Body</h2>
<ul>
<li><a href="dean.html">Dean</a></li>
<li><a href="susan.html">Susan</a></li>
</ul>
</div>
<div>
<h2>Move/Slide</h2>
<ul>
<li><a href="cathy.html">Cathy</a></li>
<li><a href="annie.html">Annie</a></li>
<li><a href="val.html">Val</a></li>
<li><a href="ricky.html">Ricky</a></li>
<li><a href="donna.html">Donna</a></li>
</ul>
</div>
<div>
<h2>Sticky</h2>
<ul>
<li><a href="ken.html">Ken</a></li>
<li><a href="alex.html">Alex</a></li>
</ul>
<h2>Jelly</h2>
<ul>
<li><a href="don.html">Don</a></li>
</ul>
</div>
<div>
<h2>SVG</h2>
<ul>
<li><a href="laura.html">Laura</a></li>
<li><a href="jamie.html">Jamie</a></li>
<li><a class="current-demo" href="henry.html">Henry</a></li>
<li><a href="jim.html">Jim</a></li>
<li><a href="wilma.html">Wilma</a></li>
</ul>
</div>
</nav>
<div id="somedialog" class="dialog">
<div class="dialog__overlay"></div>
<div class="dialog__content">
<div class="morph-shape" data-morph-open="M0,0h80c0,0,0,9.977,0,29.834c0,19.945,0,30.249,0,30.249H0c0,0,0-10.055,0-30.332C0,8.219,0,0,0,0z" data-morph-close="M0,29.75h80c0,0-3.083,0.014-3.083,0.041c0,0.028,3.083,0.042,3.083,0.042H0c0,0,3.084-0.014,3.084-0.042
C3.084,29.762,0,29.75,0,29.75z">
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 80 60" preserveAspectRatio="none">
<path d="M0,29.75h80c0,0-3.083,0.014-3.083,0.041c0,0.028,3.083,0.042,3.083,0.042H0c0,0,3.084-0.014,3.084-0.042
C3.084,29.762,0,29.75,0,29.75z"></path>
</svg>
</div>
<div class="dialog-inner">
<h2><strong>Howdy</strong>, I'm a dialog box</h2><div><button class="action" data-dialog-close>Close</button></div>
</div>
</div>
</div>
<!-- Related demos -->
<section class="related">
You might also like: <a href="http://tympanus.net/Development/FullscreenOverlayStyles/">Fullscreen Overlay Effects</a> and <a href="http://tympanus.net/Development/ModalWindowEffects/">Nifty Modal Window Effects</a>
</section>
</div><!-- /content -->
</div><!-- /container -->
<script src="js/classie.js"></script>
<script src="js/dialogFx.js"></script>
<script>
(function() {
var dlgtrigger = document.querySelector( '[data-dialog]' ),
somedialog = document.getElementById( dlgtrigger.getAttribute( 'data-dialog' ) ),
// svg..
morphEl = somedialog.querySelector( '.morph-shape' ),
s = Snap( morphEl.querySelector( 'svg' ) ),
path = s.select( 'path' ),
steps = {
open : morphEl.getAttribute( 'data-morph-open' ),
close : morphEl.getAttribute( 'data-morph-close' )
},
dlg = new DialogFx( somedialog, {
onOpenDialog : function( instance ) {
// animate path
path.stop().animate( { 'path' : steps.open }, 400, mina.easeinout );
},
onCloseDialog : function( instance ) {
// animate path
path.stop().animate( { 'path' : steps.close }, 400, mina.easeinout );
}
} );
dlgtrigger.addEventListener( 'click', dlg.toggle.bind(dlg) );
})();
</script>
</body>
</html>