-
Notifications
You must be signed in to change notification settings - Fork 10
/
index.html
313 lines (301 loc) · 21.1 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
<!DOCTYPE html>
<html lang="en">
<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>Fullscreen Mobile Modal Test Page</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<link href="dist/css/bootstrap-fs-modal.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" />
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
</head>
<body class="bootstrap-fs-modal">
<div class="container">
<h1>Fullscreen Mobile Modal Test Page</h1>
<div class="row">
<div class="col-md-3">
<p>
<button type="button" class="btn btn-block btn-primary" data-toggle="modal" data-target="#modalLarge">
Large Demo Modal
</button>
</p>
</div>
<div class="col-md-3">
<p>
<button type="button" class="btn btn-block btn-primary" data-toggle="modal" data-target="#modalSmall">
Small Demo Modal
</button>
</p>
</div>
<div class="col-md-3">
<p>
<button type="button" class="btn btn-block btn-primary" data-toggle="modal" data-target="#modalIconButtons">
Modal With Icon Buttons
</button>
</p>
</div>
<div class="col-md-3">
<p>
<button type="button" class="btn btn-block btn-primary" data-toggle="modal" data-target="#modalBottom">
Modal With Bottom Buttons
</button>
</p>
</div>
</div>
<p>
A simple, CSS-only solution to improve UX of Bootstrap 4 modals on mobile phones.
</p>
<p>
Source code and documentation is on <i class="fa fa-github" aria-hidden="true"></i> <a href="https://github.com/keaukraine/bootstrap4-fs-modal"></i> Github</a>.
</p>
<h4>Sample content to fill page</h4>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sed dui tempor, finibus ligula vitae, convallis mi. Sed posuere at neque nec hendrerit. Sed vitae felis gravida, ultricies dui eget, venenatis leo. Nunc hendrerit tellus non velit malesuada, eu dapibus sapien placerat. Sed non viverra magna, sit amet ornare erat. Fusce eros mi, consequat ac elit vel, ullamcorper molestie mauris. Proin auctor orci eget lacinia condimentum. Phasellus ultricies ligula id lacinia posuere. Nulla rutrum eros eu arcu tempor, imperdiet ornare lectus convallis. Nulla eleifend dapibus sem, vel viverra sapien.
</p>
<p>
Integer interdum ex augue, vel egestas nibh fermentum eu. Cras ut erat eu nisi ullamcorper scelerisque vitae in lorem. In hac habitasse platea dictumst. Pellentesque ino semper mauris. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vivamus pellentesque purus porta maximus blandit. Suspendisse id lorem pellentesque, vehicula nulla at, congue eros. Duis eleifend semper sodales. Morbi eu sagittis ex. Praesent commodo rhoncus nisi. Aenean quis arcu mauris.
</p>
<p>
Donec eget ex ut nibh ullamcorper commodo. Aenean ac faucibus mi. Nullam luctus dui diam, in congue sem fringilla et. Vivamus non metus at elit ornare maximus. Nam iaculis ex in dolor rutrum, at facilisis dolor euismod. Sed lacinia sagittis lobortis. Suspendisse turpis tellus, pharetra scelerisque odio eget, condimentum tempus nibh. Praesent in diam ac sapien dignissim luctus a quis sapien. Duis sed lacus magna. Maecenas at fringilla quam. Ut purus risus, ultricies eget risus ut, convallis hendrerit eros. Fusce vehicula libero quam, nec cursus nulla interdum eu. Quisque commodo suscipit justo, id auctor metus varius rutrum.
</p>
<div class="row">
<div class="col-md-3">
<p>
<button type="button" class="btn btn-block" data-toggle="modal" data-target="#modalLarge">
Large Demo Modal
</button>
</p>
</div>
<div class="col-md-3">
<p>
<button type="button" class="btn btn-block" data-toggle="modal" data-target="#modalSmall">
Small Demo Modal
</button>
</p>
</div>
<div class="col-md-3">
<p>
<button type="button" class="btn btn-block" data-toggle="modal" data-target="#modalIconButtons">
Modal With Icon Buttons
</button>
</p>
</div>
<div class="col-md-3">
<p>
<button type="button" class="btn btn-block" data-toggle="modal" data-target="#modalBottom">
Modal With Bottom Buttons
</button>
</p>
</div>
</div>
<div class="modal fade modal-fullscreen" id="modalLarge" tabindex="-1" role="dialog" aria-labelledby="modalLargeLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="modalLargeLabel">Modal with large content</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sed dui tempor, finibus ligula vitae, convallis mi. Sed posuere
at neque nec hendrerit. Sed vitae felis gravida, ultricies dui eget, venenatis leo. Nunc hendrerit tellus
non velit malesuada, eu dapibus sapien placerat. Sed non viverra magna, sit amet ornare erat. Fusce eros
mi, consequat ac elit vel, ullamcorper molestie mauris. Proin auctor orci eget lacinia condimentum. Phasellus
ultricies ligula id lacinia posuere. Nulla rutrum eros eu arcu tempor, imperdiet ornare lectus convallis.
Nulla eleifend dapibus sem, vel viverra sapien.
</p>
<p>
Integer interdum ex augue, vel egestas nibh fermentum eu. Cras ut erat eu nisi ullamcorper scelerisque vitae in lorem. In
hac habitasse platea dictumst. Pellentesque in ante aliquam, porta metus eu, viverra magna. Cras blandit,
augue in consequat rhoncus, nulla risus sodales mi, at tincidunt dolor leo semper mauris. Class aptent
taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vivamus pellentesque purus
porta maximus blandit. Suspendisse id lorem pellentesque, vehicula nulla at, congue eros. Duis eleifend
semper sodales. Morbi eu sagittis ex. Praesent commodo rhoncus nisi. Aenean quis arcu mauris.
</p>
<p>
Donec eget ex ut nibh ullamcorper commodo. Aenean ac faucibus mi. Nullam luctus dui diam, in congue sem fringilla et. Vivamus
non metus at elit ornare maximus. Nam iaculis ex in dolor rutrum, at facilisis dolor euismod. Sed lacinia
sagittis lobortis. Suspendisse turpis tellus, pharetra scelerisque odio eget, condimentum tempus nibh.
Praesent in diam ac sapien dignissim luctus a quis sapien. Duis sed lacus magna. Maecenas at fringilla
quam. Ut purus risus, ultricies eget risus ut, convallis hendrerit eros. Fusce vehicula libero quam,
nec cursus nulla interdum eu. Quisque commodo suscipit justo, id auctor metus varius rutrum.
</p>
<p>
Integer et fermentum sapien. Proin eu eros efficitur, malesuada ipsum vel, tincidunt risus. Proin cursus laoreet varius.
Donec eros sapien, accumsan ac facilisis id, egestas quis turpis. Mauris dignissim, sem et pellentesque
consequat, erat dui tempus nulla, ut laoreet neque ligula ac libero. Interdum et malesuada fames ac ante
ipsum primis in faucibus. Mauris dictum accumsan erat et tempus. Pellentesque ac ipsum at dui blandit
mollis. Suspendisse a turpis non velit commodo iaculis. Donec sit amet sem risus. Nunc pharetra lacus
vitae faucibus mattis. Vestibulum molestie, quam et efficitur consequat, dui nibh pulvinar sapien, sit
amet pharetra mauris sem sed massa.
</p>
<p>
In tempus neque vitae magna congue, convallis blandit dolor mollis. Fusce rutrum in diam ac pretium. Vivamus sagittis, elit
at cursus lacinia, mauris urna feugiat quam, et tincidunt nulla justo eget dui. Nullam malesuada felis
quis dolor aliquam scelerisque. Maecenas porta, neque sit amet auctor bibendum, urna nibh porta enim,
et auctor turpis ligula vel quam. In vulputate eu erat quis bibendum. Mauris vel felis luctus, ultricies
nulla ac, euismod diam.
</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" id="btnTestSaveLarge" class="btn btn-default">
<span class="d-none d-md-inline">Save changes</span>
<span class="d-md-none">Save</span>
</button>
</div>
</div>
</div>
</div>
<div class="modal fade modal-fullscreen" id="modalSmall" tabindex="-1" role="dialog" aria-labelledby="modalSmallLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="modalSmallLabel">Modal with small content</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<p>
Lorem ipsum dolor sit amet, consectetur. Sed posuere at neque nec hendrerit. Sed vitae felis gravida, ultricies dui eget, venenatis leo. Nunc hendrerit tellus.
</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" id="btnTestRefreshSmall" class="btn btn-default">
<span class="d-none d-md-inline">Reload Data</span>
<span class="d-md-none">Reload</span>
</button>
<button type="button" id="btnTestSaveSmall" class="btn btn-default">
<span class="d-none d-md-inline">Save changes</span>
<span class="d-md-none">Save</span>
</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="modalIconButtons" tabindex="-1" role="dialog" aria-labelledby="modalIconButtonsLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="modalIconButtonsLabel">Modal with icon buttons</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<p>
You can use Bootstrap 4 responsive classes to show icons for <code>xs</code> and <code>sm</code> breakpoints.
</p>
<p>
In this example, <i>Reload</i> and <i>Save</i> buttons use Font Awesome icons, and <i>Info</i> is a Google Material icon.
</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button"class="btn btn-default">
<span class="d-none d-md-inline">Reload Data</span>
<i class="d-md-none fa fa-refresh fa-fw"></i>
</button>
<button type="button"class="btn btn-default">
<span class="d-none d-md-inline">Details</span>
<i class="d-md-none material-icons">info</i>
</button>
<button type="button" class="btn btn-default">
<span class="d-none d-md-inline">Save changes</span>
<i class="d-md-none fa fa-save fa-fw"></i>
</button>
</div>
</div>
</div>
</div>
<div class="modal fade modal-fullscreen modal-fullscreen-bottom-footer" id="modalBottom" tabindex="-1" role="dialog" aria-labelledby="modalBottomLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="modalBottomLabel">Modal with bottom buttons</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sed dui tempor, finibus ligula vitae, convallis mi. Sed posuere
at neque nec hendrerit. Sed vitae felis gravida, ultricies dui eget, venenatis leo. Nunc hendrerit tellus
non velit malesuada, eu dapibus sapien placerat. Sed non viverra magna, sit amet ornare erat. Fusce eros
mi, consequat ac elit vel, ullamcorper molestie mauris. Proin auctor orci eget lacinia condimentum. Phasellus
ultricies ligula id lacinia posuere. Nulla rutrum eros eu arcu tempor, imperdiet ornare lectus convallis.
Nulla eleifend dapibus sem, vel viverra sapien.
</p>
<p>
Integer interdum ex augue, vel egestas nibh fermentum eu. Cras ut erat eu nisi ullamcorper scelerisque vitae in lorem. In
hac habitasse platea dictumst. Pellentesque in ante aliquam, porta metus eu, viverra magna. Cras blandit,
augue in consequat rhoncus, nulla risus sodales mi, at tincidunt dolor leo semper mauris. Class aptent
taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vivamus pellentesque purus
porta maximus blandit. Suspendisse id lorem pellentesque, vehicula nulla at, congue eros. Duis eleifend
semper sodales. Morbi eu sagittis ex. Praesent commodo rhoncus nisi. Aenean quis arcu mauris.
</p>
<p>
Donec eget ex ut nibh ullamcorper commodo. Aenean ac faucibus mi. Nullam luctus dui diam, in congue sem fringilla et. Vivamus
non metus at elit ornare maximus. Nam iaculis ex in dolor rutrum, at facilisis dolor euismod. Sed lacinia
sagittis lobortis. Suspendisse turpis tellus, pharetra scelerisque odio eget, condimentum tempus nibh.
Praesent in diam ac sapien dignissim luctus a quis sapien. Duis sed lacus magna. Maecenas at fringilla
quam. Ut purus risus, ultricies eget risus ut, convallis hendrerit eros. Fusce vehicula libero quam,
nec cursus nulla interdum eu. Quisque commodo suscipit justo, id auctor metus varius rutrum.
</p>
<p>
Integer et fermentum sapien. Proin eu eros efficitur, malesuada ipsum vel, tincidunt risus. Proin cursus laoreet varius.
Donec eros sapien, accumsan ac facilisis id, egestas quis turpis. Mauris dignissim, sem et pellentesque
consequat, erat dui tempus nulla, ut laoreet neque ligula ac libero. Interdum et malesuada fames ac ante
ipsum primis in faucibus. Mauris dictum accumsan erat et tempus. Pellentesque ac ipsum at dui blandit
mollis. Suspendisse a turpis non velit commodo iaculis. Donec sit amet sem risus. Nunc pharetra lacus
vitae faucibus mattis. Vestibulum molestie, quam et efficitur consequat, dui nibh pulvinar sapien, sit
amet pharetra mauris sem sed massa.
</p>
<p>
In tempus neque vitae magna congue, convallis blandit dolor mollis. Fusce rutrum in diam ac pretium. Vivamus sagittis, elit
at cursus lacinia, mauris urna feugiat quam, et tincidunt nulla justo eget dui. Nullam malesuada felis
quis dolor aliquam scelerisque. Maecenas porta, neque sit amet auctor bibendum, urna nibh porta enim,
et auctor turpis ligula vel quam. In vulputate eu erat quis bibendum. Mauris vel felis luctus, ultricies
nulla ac, euismod diam.
</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-default">
<span class="d-none d-md-inline">Save changes</span>
<span class="d-md-none">Save</span>
</button>
<button type="button" class="btn btn-default">
<span class="d-none d-md-inline">Discard changes</span>
<span class="d-md-none">Discard</span>
</button>
<button type="button" class="btn btn-default">
<span class="d-none d-md-inline">Reload Data</span>
<span class="d-md-none">Reload</span>
</button>
</div>
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
<script>
$(function() {
$('#btnTestSaveSmall, #btnTestSaveLarge, #btnTestSaveTextButtons, #btnTestSaveFAButtons').on('click', function() {
alert('Clicked save button #' + this.id);
$(this).parents('.modal').modal('hide');
});
$('#btnTestRefreshSmall, #btnTestRefreshTextButtons').on('click', function() {
alert('Clicked refresh button #' + this.id);
});
});
</script>
</body>
</html>