-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo-2.html
342 lines (339 loc) · 14.3 KB
/
demo-2.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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>jQuery Quick Modal | Demo 2</title>
<link href="http://fonts.googleapis.com/css?family=PT+Mono|Source+Sans+Pro:400,700" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="css/quick-modal.min.css">
<style>
/* ----------------------------------------
Demo-Specific Styles
---------------------------------------- */
* {
box-sizing: border-box;
padding: 0;
margin: 0;
}
html, body {
width: 100%;
height: 100%;
padding: 0;
margin: 0;
}
body {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
color: #1e1e1e;
font-family: 'Source Sans Pro', sans-serif;
font-weight: 400;
font-size: 16px;
line-height: 24px;
background: -moz-linear-gradient(top, #e4af79 0%, #dc8e8e 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#e4af79), color-stop(100%,#dc8e8e)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #e4af79 0%,#dc8e8e 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #e4af79 0%,#dc8e8e 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #e4af79 0%,#dc8e8e 100%); /* IE10+ */
background: linear-gradient(to bottom, #e4af79 0%,#dc8e8e 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e4af79', endColorstr='#dc8e8e',GradientType=0 ); /* IE6-9 */
}
.background-image {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-size: cover;
background-image: url(http://www.kevinberonilla.com/hosted/demo-clouds.png);
background-position: center center;
opacity: 0.25;
pointer-events: none;
}
a, a:visited {
opacity: 1;
-webkit-transition: all 250ms ease;
transition: all 250ms ease;
}
a:hover {
opacity: 0.5;
}
header {
position: absolute;
top: 0;
z-index: 9990;
width: 100%;
height: 110px;
background-color: #1e1e1e;
}
#kb-logo {
position: absolute;
top: 30px;
left: 30px;
z-index: 9997;
padding: 10px;
width: 50px;
height: 50px;
border: 1px solid #fff;
border-radius: 50px;
opacity: 0.25;
-webkit-transition: all 250ms ease;
transition: all 250ms ease;
}
#kb-logo:hover {
opacity: 1;
}
#kb-logo img {
width: 28px;
height: auto;
padding-top: 4px;
padding-left: 1px;
}
#kb-logo:focus {
outline: none;
}
nav {
position: absolute;
top: 34px;
right: 34px;
display: inline-block;
}
nav a.button, nav a.button:visited {
display: inline-block;
margin-left: 10px;
max-width: initial;
padding: 8px 14px 10px;
margin-top: 0;
background-color: transparent;
font-weight: 300;
text-transform: none;
}
nav h1 {
color: #f8f5f0;
font-size: 20px;
display: inline-block;
margin-right: 16px;
}
pre {
font-family: 'PT Mono', monospace;
font-size: 18px;
line-height: 22px;
display: block;
max-width: 560px;
padding: 20px 24px;
margin: 0 auto;
overflow: auto;
background-color: #f8f5f0;
border-radius: 3px;
}
.pre-container:after {
content: '';
display: block;
width: 0;
height: 0;
border-style: solid;
border-width: 20px 20px 0 20px;
border-color: #f8f5f0 transparent transparent transparent;
margin: 0 auto;
position: relative;
bottom: 2px;
}
.container {
width: 100%;
padding: 0 40px;
position: relative;
top: 50%;
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
}
a.button, a.button:visited, #prev, #next {
display: block;
padding: 8px 0;
margin: 14px auto 0;
background-color: #e4af79;
color: #f8f5f0;
text-align: center;
max-width: 100px;
font-weight: 700;
letter-spacing: 0.5px;
text-decoration: none;
border-radius: 3px;
text-transform: uppercase;
}
#prev, #next {
display: block;
padding: 8px 12px;
margin: 0;
background-color: #1e1e1e;
font-size: 12px;
position: fixed;
top: 50%;
transform: translateY(-50%);
left: 20px;
z-index: 9997;
}
#next {
left: initial;
right: 20px;
}
p {
margin-top: 14px;
}
@media only screen and (max-width: 768px) {
pre {
font-size: 14px;
line-height: 20px;
}
#prev, #next {
display: none;
}
.mobile-off {
display: none !important;
}
nav {
top: 42px;
}
}
@media only screen and (max-width: 480px) {
pre {
font-size: 10px;
line-height: 16px;
}
nav h1 {
font-size: 16px;
}
}
</style>
</head>
<body>
<div class="background-image"></div>
<header>
<a id="kb-logo" href="http://www.kevinberonilla.com" target="_blank"><img src="http://www.kevinberonilla.com/hosted/kb-logo-reversed.svg"></a>
<nav>
<h1>jQuery Quick Modal</h1>
<a href="https://github.com/kevinberonilla/jquery-quick-modal" class="button mobile-off" target="_blank">GitHub</a>
<a href="https://github.com/kevinberonilla/jquery-quick-modal/archive/master.zip" class="button mobile-off" download="jquery-quick-modal.zip">Download</a>
</nav>
</header>
<a href="demo-1.html" id="prev">Prev</a>
<a href="demo-3.html" id="next">Next</a>
<div class="container">
<div class="pre-container">
<pre>
$(document).ready(function() {
$('.open-modal').quickModal({
animation: 'fade-left',
speed: 1000,
timing: 'ease-in-out',
closeModalSelector: '.qm-close-modal',
enableEsc: true,
enableClickAway: false,
appendBackgroundTo: 'body'
onOpen: function() { alert('Hi!'); },
onClose: function() { alert('Bye!'); }
});
});
</pre>
</div>
<a href="#" class="button open-modal" data-modal-id="my-modal">Click Me</a>
</div>
<div id="my-modal" class="qm-modal">
<div class="qm-close-modal"></div>
<h1>Hello, world!</h1>
<p>Jelly beans sweet roll wafer ice cream. Icing cake lemon drops pastry soufflé cheesecake. Fruitcake bear claw cotton candy chocolate cake. Apple pie sweet macaroon cake. Bonbon jelly-o chocolate bar bonbon pudding macaroon topping pastry. Tootsie roll cupcake pastry icing. Macaroon caramels muffin sugar plum topping dessert.</p>
<p>Sweet topping donut liquorice brownie. Tart macaroon pastry pie fruitcake tootsie roll topping cookie. Cheesecake liquorice liquorice. Macaroon ice cream brownie muffin donut brownie soufflé powder.</p>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="js/jquery.quick-modal.js"></script>
<script>
/* ----------------------------------------
prettyPre Plugin by Tim Medora
---------------------------------------- */
(function( $ ) {
$.fn.prettyPre = function( method ) {
var defaults = {
ignoreExpression: /\s/ // what should be ignored?
};
var methods = {
init: function( options ) {
this.each( function() {
var context = $.extend( {}, defaults, options );
var $obj = $( this );
var usingInnerText = true;
var text = $obj.get( 0 ).innerText;
// some browsers support innerText...some don't...some ONLY work with innerText.
if ( typeof text == "undefined" ) {
text = $obj.html();
usingInnerText = false;
}
// use the first line as a baseline for how many unwanted leading whitespace characters are present
var superfluousSpaceCount = 0;
var pos = 0;
var currentChar = text.substring( 0, 1 );
while ( context.ignoreExpression.test( currentChar ) ) {
if(currentChar !== "\n"){
superfluousSpaceCount++;
}else{
superfluousSpaceCount = 0;
}
currentChar = text.substring( ++pos, pos + 1 );
}
// split
var parts = text.split( "\n" );
var reformattedText = "";
// reconstruct
var length = parts.length;
for ( var i = 0; i < length; i++ ) {
// remove leading whitespace (represented by an empty string)
if(i === 0 && parts[0]=== ""){
continue;
}
// cleanup, and don't append a trailing newline if we are on the last line
reformattedText += parts[i].substring( superfluousSpaceCount ) + ( i == length - 1 ? "" : "\n" );
}
// modify original
if ( usingInnerText ) {
$obj.get( 0 ).innerText = reformattedText;
}
else {
// This does not appear to execute code in any browser but the onus is on the developer to not
// put raw input from a user anywhere on a page, even if it doesn't execute!
$obj.html( reformattedText );
}
} );
}
}
if ( methods[method] ) {
return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 ) );
}
else if ( typeof method === "object" || !method ) {
return methods.init.apply( this, arguments );
}
else {
$.error( "Method " + method + " does not exist on jQuery.prettyPre." );
}
}
} )( jQuery );
$(document).ready(function() {
$('pre').prettyPre();
});
/* ----------------------------------------
Demo-Specific Scripts
---------------------------------------- */
$(document).ready(function() {
$('.open-modal').quickModal({
animation: 'fade-left',
speed: 1000,
timing: 'ease-in-out',
closeModalSelector: '.qm-close-modal',
enableEsc: true,
enableClickAway: false,
appendBackgroundTo: 'body',
onOpen: function() { alert('Hi!'); },
onClose: function() { alert('Bye!'); }
});
});
</script>
</body>
</html>