-
Notifications
You must be signed in to change notification settings - Fork 488
/
Copy pathindex.html
executable file
·158 lines (149 loc) · 5.82 KB
/
index.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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<!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>Morphing Buttons Concept | Demo 1</title>
<meta name="description" content="Morphing Buttons Concept: Inspiration for revealing content by morphing the action element" />
<meta name="keywords" content="expanding button, morph, modal, fullscreen, transition, ui" />
<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" />
<link rel="stylesheet" type="text/css" href="css/component.css" />
<link rel="stylesheet" type="text/css" href="css/content.css" />
<script src="js/modernizr.custom.js"></script>
</head>
<body>
<div class="container">
<!-- Top Navigation -->
<div class="codrops-top clearfix">
<a class="codrops-icon codrops-icon-prev" href="http://tympanus.net/Development/PageLoadingEffects/"><span>Previous Demo</span></a>
<span class="right"><a class="codrops-icon codrops-icon-drop" href="http://tympanus.net/codrops/?p=19004"><span>Back to the Codrops Article</span></a></span>
</div>
<header class="codrops-header">
<h1>Morphing Buttons Concept</h1>
<p>Inspiration for revealing content by morphing the action element. Examples:</p>
<nav class="codrops-demos">
<a class="current-demo" href="index.html">Login/Signup</a>
<a href="index2.html">Terms</a>
<a href="index3.html">Info Overlay</a>
<a href="index4.html">Subscribe</a>
<a href="index5.html">Share</a>
<a href="index6.html">Video Player</a>
<a href="index7.html">Sidebar Settings</a>
</nav>
</header>
<section>
<p>Click one of the buttons below to see a <strong>modal dialog</strong>:</p>
<div class="mockup-content">
<p>Pea horseradish azuki bean lettuce avocado asparagus okra.</p>
<div class="morph-button morph-button-modal morph-button-modal-2 morph-button-fixed">
<button type="button">Login</button>
<div class="morph-content">
<div>
<div class="content-style-form content-style-form-1">
<span class="icon icon-close">Close the dialog</span>
<h2>Login</h2>
<form>
<p><label>Email</label><input type="text" /></p>
<p><label>Password</label><input type="password" /></p>
<p><button>Login</button></p>
</form>
</div>
</div>
</div>
</div><!-- morph-button -->
<strong class="joiner">or</strong>
<div class="morph-button morph-button-modal morph-button-modal-3 morph-button-fixed">
<button type="button">Signup</button>
<div class="morph-content">
<div>
<div class="content-style-form content-style-form-2">
<span class="icon icon-close">Close the dialog</span>
<h2>Sign Up</h2>
<form>
<p><label>Email</label><input type="text" /></p>
<p><label>Password</label><input type="password" /></p>
<p><label>Repeat Password</label><input type="password" /></p>
<p><button>Sign Up</button></p>
</form>
</div>
</div>
</div>
</div><!-- morph-button -->
<p>Kohlrabi radish okra azuki bean corn fava bean mustard tigernut juccama green bean celtuce collard greens avocado quandong.</p>
</div><!-- /form-mockup -->
</section>
<section class="related">
<p>If you enjoyed this demo you might also like:</p>
<a href="http://tympanus.net/Development/ProgressButtonStyles/">
<img src="http://tympanus.net/codrops/wp-content/uploads/2013/12/ProgressButtonStyles-300x162.png" />
<h3>Progress Button Styles</h3>
</a>
<a href="http://tympanus.net/Development/SidebarTransitions/">
<img src="http://tympanus.net/codrops/wp-content/uploads/2013/08/sidebartransitions-300x162.png" />
<h3>Sidebar Transitions</h3>
</a>
</section>
</div><!-- /container -->
<script src="js/classie.js"></script>
<script src="js/uiMorphingButton_fixed.js"></script>
<script>
(function() {
var docElem = window.document.documentElement, didScroll, scrollPosition;
// trick to prevent scrolling when opening/closing button
function noScrollFn() {
window.scrollTo( scrollPosition ? scrollPosition.x : 0, scrollPosition ? scrollPosition.y : 0 );
}
function noScroll() {
window.removeEventListener( 'scroll', scrollHandler );
window.addEventListener( 'scroll', noScrollFn );
}
function scrollFn() {
window.addEventListener( 'scroll', scrollHandler );
}
function canScroll() {
window.removeEventListener( 'scroll', noScrollFn );
scrollFn();
}
function scrollHandler() {
if( !didScroll ) {
didScroll = true;
setTimeout( function() { scrollPage(); }, 60 );
}
};
function scrollPage() {
scrollPosition = { x : window.pageXOffset || docElem.scrollLeft, y : window.pageYOffset || docElem.scrollTop };
didScroll = false;
};
scrollFn();
[].slice.call( document.querySelectorAll( '.morph-button' ) ).forEach( function( bttn ) {
new UIMorphingButton( bttn, {
closeEl : '.icon-close',
onBeforeOpen : function() {
// don't allow to scroll
noScroll();
},
onAfterOpen : function() {
// can scroll again
canScroll();
},
onBeforeClose : function() {
// don't allow to scroll
noScroll();
},
onAfterClose : function() {
// can scroll again
canScroll();
}
} );
} );
// for demo purposes only
[].slice.call( document.querySelectorAll( 'form button' ) ).forEach( function( bttn ) {
bttn.addEventListener( 'click', function( ev ) { ev.preventDefault(); } );
} );
})();
</script>
</body>
</html>