-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
389 lines (362 loc) · 11.7 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
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
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>unmodal jQuery Plugin</title>
<meta name="description" content="unmodal jQuery Plugin">
<meta name="author" content="Foliotek, Inc.">
<link href="demo/bootstrap.css" rel="stylesheet">
<style>
body {
padding: 0;
font-family: Corbel, "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", sans-serif;
}
.container {
border: solid 3px #ccc;
border-top:none;
border-bottom:none;
padding: 15px 20px;
padding-bottom: 50px;
-moz-box-shadow: 0 10px 20px #aaaaaa;
-webkit-box-shadow: 0 10px 20px #aaaaaa;
box-shadow: 0 10px 20px #aaaaaa;
}
body.noscript .scriptload {
display: none;
}
h1 {
font-size: 50px;
line-height: 70px;
float:left;
}
h2 {
margin: 20px 0;
margin-top: 40px;
color: #131;
border: solid 1px;
border-left: none;
border-right:none;
padding: 3px;
letter-spacing: .1em;
}
p, li {
font-family: Constantia, "Lucida Bright", Lucidabright, "Lucida Serif", Lucida, Georgia, serif;
font-size: 14px;
line-height: 1.8;
}
.container > h3 {
margin: 10px;
color: #282;
}
.container > pre {
margin-left: 30px;
margin-bottom: 20px;
}
.queue {
text-align: center;
background: #fafafa;
}
.queue h3 {
text-decoration: underline;
}
.queue .buttons {
border: solid 2px #ddd;
padding: 10px;
border-radius: 10px;
}
.node {
height: 40px;
line-height:40px;
opacity: .3;
width: 80%;
border-radius: 5px;
margin: 3px auto;
text-align: center;
position:relative;
}
.node strong {
position:absolute;
top:0;
left:6px;
}
.node b {
position:absolute;
left:30px;
top:0;
color:red;
}
.node i {
position:absolute;
top:0;
right:30px;
}
.node.beforesend b {
color: yellow;
}
.node.complete b {
color: green;
}
.node.error.complete b {
color: red;
}
.node.beforesend {
opacity: .6;
}
.node.complete {
opacity: 1;
}
#q1-container .node.error, #q2-container .node.error {
background: #f99;
}
#q1-container .node {
background: #9fd;
}
#q2-container .node {
background: #99d;
}
.btn-large {
font-size: 20px;
font-weight: normal;
padding: 14px 24px;
margin-right: 10px;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
}
.center {
margin: 20px 10px;
text-align: center;
background: #84c784;
border: solid 1px;
border-radius: 5px;
padding: 20px 10px;
}
.editable-container .floated {
float:left;
width: 40%;
margin: 10px 5%;
outline: solid 5px orange;
}
#header {
position: relative;
}
#check {
position:absolute;
right: 0;
top: 0;
color:green;
padding: 2px;
height: 60px;
line-height: 60px;
font-size: 72px;
font-weight:bold;
}
.show-grid [class*="span"] {
background-color: #EEE;
text-align: center;
min-height: 30px;
line-height: 30px;
outline: solid 1px orange;
}
.show-grid {
margin-top: 8px;
margin-bottom: 10px;
}
body.showing-grid .unmodal {
box-sizing: border-box;
border: dashed 1px orange;
}
</style>
<style type='text/css'>
.unmodal {
background: #000;
opacity: .5;
filter: alpha(opacity = 50);
-webkit-transition: opacity linear .3s;
-moz-transition: opacity linear .3s;
transition: opacity linear .3s;
}
.unmodal.unmodal-hidden {
opacity:0;
}
</style>
</head>
<body class='noscript'>
<div class="container">
<div id="header">
<h1>unmodal</h1>
<br style='clear:both;' />
<br />
<p>
A jQuery plugin for <strong>focusing in</strong> on elements by <strong>blacking out</strong> everything else.
</p>
<div id='check'>
!
</div>
</div>
<h2>Features</h2>
<ul>
<li><strong>Keeps elements in place</strong>. Moving elements out of their place can be a pain.</li>
<li><strong>Keyboard friendly </strong>. You can always get out of the modal by pressing <code>escape</code>.</li>
<li><strong>CSS Styling</strong>. You can use CSS transitions and style as much or as little as you'd like.</li>
</ul>
<p class='center'>
<a class='btn btn-large' href='http://github.com/Foliotek/unmodal'>View Project On Github</a>
<a class='btn btn-large' href='https://github.com/Foliotek/unmodal/blob/master/unmodal.js'>Just the JavaScript, Please</a>
</p>
<h2>Usage</h2>
<p>
Trigger unmodal on a jQuery as you would with other plugins. There are a few extra options you might want to be aware of.
</p>
<h3>Include CSS</h3>
<p><strong>Before you start</strong>, include some CSS to style the boxes:</p>
<pre>
<style type='text/css'>
.unmodal {
background: #000;
opacity: .5;
filter: alpha(opacity = 50);
}
</style>
</pre>
<p>Or, <strong>if you want to get fancy</strong> (like on this page), use CSS transitions:</p>
<pre>
<style type='text/css'>
.unmodal {
background: #000;
opacity: .5;
filter: alpha(opacity = 50);
-webkit-transition: opacity linear .3s;
-moz-transition: opacity linear .3s;
transition: opacity linear .3s;
}
.unmodal.unmodal-hidden {
opacity:0;
}
</style>
</pre>
<h3>$.unmodal</h3>
<pre>
// This will automatically black out everything except for all divs.
// Notice that it does work even with more than one element
$("div").unmodal(opts);
</pre>
<h3>Options</h3>
<pre>
$("div").unmodal({
hide: function() {
}
});
</pre>
<h3>$.unmodal.clear()</h3>
<p>
The unmodal will clear by default if the user clicks on it, or presses escape.
If you would like to trigger this programmatically, use $.unmodal.clear.
</p>
<pre>
$("div").unmodal();
$.unmodal.clear();
</pre>
<h3>$.unmodal.refresh()</h3>
<p>
If you ever need to trigger a refresh because of an external event, just call refresh - it is essentially a <code>noop</code> if there is not current unmodal.
</p>
<pre>
$("div").unmodal();
$("div").html("Changed content");
$.unmodal.refresh();
</pre>
<h2>Demos</h2>
<div id="gridSystem">
<h3>Content Editable Containers</h3>
<p>
The plugin will listen to <code>input</code> and <code>resize</code> events so that as you type and change the size of the region, the <code>unmodal</code>
will resize correctly. There is a fix for IE and Firefox (which don't support the input event) using <a href='http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-MutationEvent'>DOM Mutation Events</a>.
</p>
<div class='editable-container'>
<div class='floated'>
<div contenteditable>
Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.
</div>
</div>
<div class='floated'>
<div contenteditable>
Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.
</div>
</div>
<br style='clear:both;' />
</div>
<hr />
<h3>Grid Systems / Performance</h3>
<p>
Click on one of the geid cells and the plugin will blackout everything except all of the other cells.
and is fast enough to handle dozens of elements, even in older browsers.
It is smart enough to build many rectangles using <strong><a href='https://github.com/bgrins/inverse-intersection'>non intersection rectangle detection</a></strong>.
</p>
<div class="row show-grid">
<div class="span1">1</div>
<div class="span1">1</div>
<div class="span1">1</div>
<div class="span1">1</div>
<div class="span1">1</div>
<div class="span1">1</div>
<div class="span1">1</div>
<div class="span1">1</div>
<div class="span1">1</div>
<div class="span1">1</div>
<div class="span1">1</div>
<div class="span1">1</div>
</div>
<div class="row show-grid">
<div class="span4">4</div>
<div class="span4">4</div>
<div class="span4">4</div>
</div>
<div class="row show-grid">
<div class="span4">4</div>
<div class="span8">8</div>
</div>
<div class="row show-grid">
<div class="span6">6</div>
<div class="span6">6</div>
</div>
<div class="row show-grid">
<div class="span12">12</div>
</div>
<div class="row show-grid">
<div class="span1">1</div>
<div class="span1">1</div>
<div class="span1">1</div>
<div class="span1">1</div>
<div class="span1">1</div>
<div class="span1">1</div>
<div class="span1">1</div>
<div class="span1">1</div>
<div class="span1">1</div>
<div class="span1">1</div>
<div class="span1">1</div>
<div class="span1">1</div>
</div>
<div class="row show-grid">
<div class="span4">4</div>
<div class="span4">4</div>
<div class="span4">4</div>
</div>
<div class="row show-grid">
<div class="span4">4</div>
<div class="span8">8</div>
</div>
<div class="row show-grid">
<div class="span6">6</div>
<div class="span6">6</div>
</div>
<div class="row show-grid">
<div class="span12">12</div>
</div>
</div>
</div>
<script src='demo/jquery-1.7.1.js' type='text/javascript'></script>
<script src='unmodal.js' type='text/javascript'></script>
<script src='demo/demo.js' type='text/javascript'></script>
</body>
</html>