-
Notifications
You must be signed in to change notification settings - Fork 0
/
notes4.html
506 lines (502 loc) · 17.9 KB
/
notes4.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
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Bootstrap demo</title>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/bootstrap@4.1.3/dist/css/bootstrap.min.css"
integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO"
crossorigin="anonymous"
/>
</head>
<body>
<style>
body {
background-color: rgb(137, 241, 198);
color: darkblue;
}
p {
display: flex;
justify-content: center;
font-size: 27px;
}
</style>
<div class="container mb-4">
<h1 class="d-flex justify-content-center display-3 mb-4">
<u>Notes 4</u>
</h1>
</div>
<div class="container mt-3">
<h2 class="d-flex justify-content-center mt-4">
<b><u>Collapse</u></b>
</h2>
<p class="h3 mt-3 d-flex justify-content-center">
Collapse isn't exactly it's own component, rather it's a JavaScript
plug-in
</p>
<p>We add a few pieces to existing components, to show / hide content</p>
<p>
Essentially it's a way of connecting a button or a link to another peice
of content you want to display
</p>
<p>
To start we need to make a button or a link, then we set the
'data-toggle="collapse"' inside or anchor or button tag, then we specify
an href="#paragraphOne" or whatever html content, but we need to
remember to give the element the id, then link that id in our div /
button / anchor tag
</p>
<p>Here's an example:</p>
</div>
<div class="container mt-3">
<h2 class="display-3 text-center">Collapse Ex.</h2>
<a href="#contentOne" class="btn btn-success" data-toggle="collapse"
>Click me!</a
>
<div class="collapse" id="contentOne">
Lorem ipsum dolor sit amet consectetur adipisicing elit. Nemo repellat
optio omnis pariatur repellendus, quasi sit distinctio, et qui rerum
natus amet odio earum placeat? Omnis saepe id dolorem magnam?
</div>
</div>
<div class="container mt-3">
<h2 class="display-3 text-center">Card Collapse:</h2>
<a href="#content2" class="btn btn-info" data-toggle="collapse">
Collapse!
</a>
<div class="collapse" id="content2">
<div class="card">
<div class="card-body">
<h4 class="card-title">Collapsing!</h4>
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Quis animi
reprehenderit maxime sapiente corrupti? Aliquam at vitae, commodi
optio impedit veniam rem deleniti vero magni provident reprehenderit
alias in deserunt.
</div>
</div>
</div>
</div>
<div class="container mt-4">
<p class="justify-content-around">
<a
class="btn btn-primary"
data-toggle="collapse"
href="#collapseExample"
role="button"
aria-expanded="false"
aria-controls="collapseExample"
>
Link with href
</a>
<button
class="btn btn-primary"
type="button"
data-toggle="collapse"
data-target="#collapseExample"
aria-expanded="false"
aria-controls="collapseExample"
>
Button with data-target
</button>
</p>
<div class="collapse" id="collapseExample">
<div class="card card-body bg-dark text-light">
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus
terry richardson ad squid. Nihil anim keffiyeh helvetica, craft beer
labore wes anderson cred nesciunt sapiente ea proident.
</div>
</div>
</div>
<div class="container mt-4">
<p>We can also target multiple elements:</p>
<p class="d-flex justify-content-between">
<a
class="btn btn-primary"
data-toggle="collapse"
href="#multiCollapseExample1"
role="button"
aria-expanded="false"
aria-controls="multiCollapseExample1"
>Toggle first element</a
>
<button
class="btn btn-primary"
type="button"
data-toggle="collapse"
data-target="#multiCollapseExample2"
aria-expanded="false"
aria-controls="multiCollapseExample2"
>
Toggle second element
</button>
<button
class="btn btn-primary"
type="button"
data-toggle="collapse"
data-target=".multi-collapse"
aria-expanded="false"
aria-controls="multiCollapseExample1 multiCollapseExample2"
>
Toggle both elements
</button>
</p>
<div class="row">
<div class="col">
<div class="collapse multi-collapse" id="multiCollapseExample1">
<div class="card card-body bg-success text-dark">
Anim pariatur cliche reprehenderit, enim eiusmod high life
accusamus terry richardson ad squid. Nihil anim keffiyeh
helvetica, craft beer labore wes anderson cred nesciunt sapiente
ea proident.
</div>
</div>
</div>
<div class="col">
<div class="collapse multi-collapse" id="multiCollapseExample2">
<div class="card card-body bg-danger text-light">
Anim pariatur cliche reprehenderit, enim eiusmod high life
accusamus terry richardson ad squid. Nihil anim keffiyeh
helvetica, craft beer labore wes anderson cred nesciunt sapiente
ea proident.
</div>
</div>
</div>
</div>
</div>
<div class="container mt-4">
<h2 class="d-flex justify-content-center mt-3">
<u><b>Accordions:</b></u>
</h2>
<p>
Accordions are essentially card collections, where we have a set of
cards to display, and they're all contained inside of an accordion div,
and clicking on a accordion 'key' to display it's 'bellow'
</p>
</div>
<div class="container">
<p class="h2">Accordion</p>
<div>
<div class="accordion" id="accordionExample">
<div class="card bg-danger text-light">
<div class="card-header" id="headingOne">
<h5 class="mb-0">
<button
class="btn btn-link text-light"
type="button"
data-toggle="collapse"
data-target="#collapseOne"
aria-expanded="true"
aria-controls="collapseOne"
>
Collapsible Group Item #1
</button>
</h5>
</div>
<div
id="collapseOne"
class="collapse show"
aria-labelledby="headingOne"
data-parent="#accordionExample"
>
<div class="card-body">
Anim pariatur cliche reprehenderit, enim eiusmod high life
accusamus terry richardson ad squid. 3 wolf moon officia aute,
non cupidatat skateboard dolor brunch. Food truck quinoa
nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua
put a bird on it squid single-origin coffee nulla assumenda
shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore
wes anderson cred nesciunt sapiente ea proident. Ad vegan
excepteur butcher vice lomo. Leggings occaecat craft beer
farm-to-table, raw denim aesthetic synth nesciunt you probably
haven't heard of them accusamus labore sustainable VHS.
</div>
</div>
</div>
<div class="card bg-dark text-light">
<div class="card-header" id="headingTwo">
<h5 class="mb-0">
<button
class="btn btn-link collapsed text-light"
type="button"
data-toggle="collapse"
data-target="#collapseTwo"
aria-expanded="false"
aria-controls="collapseTwo"
>
Collapsible Group Item #2
</button>
</h5>
</div>
<div
id="collapseTwo"
class="collapse"
aria-labelledby="headingTwo"
data-parent="#accordionExample"
>
<div class="card-body">
Anim pariatur cliche reprehenderit, enim eiusmod high life
accusamus terry richardson ad squid. 3 wolf moon officia aute,
non cupidatat skateboard dolor brunch. Food truck quinoa
nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua
put a bird on it squid single-origin coffee nulla assumenda
shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore
wes anderson cred nesciunt sapiente ea proident. Ad vegan
excepteur butcher vice lomo. Leggings occaecat craft beer
farm-to-table, raw denim aesthetic synth nesciunt you probably
haven't heard of them accusamus labore sustainable VHS.
</div>
</div>
</div>
<div class="card bg-warning text-light">
<div class="card-header" id="headingThree">
<h5 class="mb-0">
<button
class="btn btn-link collapsed text-light"
type="button"
data-toggle="collapse"
data-target="#collapseThree"
aria-expanded="false"
aria-controls="collapseThree"
>
Collapsible Group Item #3
</button>
</h5>
</div>
<div
id="collapseThree"
class="collapse"
aria-labelledby="headingThree"
data-parent="#accordionExample"
>
<div class="card-body">
Anim pariatur cliche reprehenderit, enim eiusmod high life
accusamus terry richardson ad squid. 3 wolf moon officia aute,
non cupidatat skateboard dolor brunch. Food truck quinoa
nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua
put a bird on it squid single-origin coffee nulla assumenda
shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore
wes anderson cred nesciunt sapiente ea proident. Ad vegan
excepteur butcher vice lomo. Leggings occaecat craft beer
farm-to-table, raw denim aesthetic synth nesciunt you probably
haven't heard of them accusamus labore sustainable VHS.
</div>
</div>
</div>
</div>
</div>
</div>
<div class="container mt-4">
<p>
That's how we create an accordion, remember these are just cards, that
we're using collapse on
</p>
</div>
<div class="container mt-4">
<h2 class="d-flex justify-content-center">
<u><b>MODALS</b></u>
</h2>
<p>
A modal is a dialogue / pop-up to notify... or annoy your users, often
they're not widely used unless you're building a web app where it makes
sense to use them, they're useful if your users are editing content /
saving things
</p>
<p>
Modals have two parts: the trigger, and the modal itself, and we add tab
index, it controls how users can navigate using tab, so if we set
tabindex="-1", then we set role = 'dialogue'. for accessibility
</p>
</div>
<div class="container">
<h2 class="display-3 text-center">Modal ex:</h2>
<!-- trigger -->
</div>
<div class="container d-flex justify-content-center mt-3">
<button
class="btn btn-lg btn-info d-flex justify-content-center"
data-toggle="modal"
data-target="#myModal"
>
Launch modal
</button>
<!-- modal window -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Modal title</h5>
<button
type="button"
class="close"
data-dismiss="modal"
aria-label="Close"
>
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
Lorem ipsum dolor sit amet consectetur adipisicing elit. Fuga,
molestiae illo! Nam qui est earum perspiciatis doloribus quae quo
et!
</div>
<div class="modal-footer">
<button class="btn btn-secondary" data-dismiss="modal">
Close
</button>
<button class="btn btn-success">Save</button>
</div>
</div>
</div>
</div>
</div>
<div class="container mt-4 d-flex justify-content-center">
<!-- Button trigger modal -->
<button
type="button"
class="btn btn-lg btn-block p-4 btn-primary d-flex justify-content-center"
data-toggle="modal"
data-target="#exampleModal"
>
Launch demo modal
</button>
<!-- Modal -->
<div
class="modal fade"
id="exampleModal"
tabindex="-1"
role="dialog"
aria-labelledby="exampleModalLabel"
aria-hidden="true"
>
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
<button
type="button"
class="close"
data-dismiss="modal"
aria-label="Close"
>
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">...</div>
<div class="modal-footer">
<button
type="button"
class="btn btn-secondary"
data-dismiss="modal"
>
Close
</button>
<button type="button" class="btn btn-primary">
Save changes
</button>
</div>
</div>
</div>
</div>
</div>
<div class="container mt-4">
<h2 class="d-flex justify-content-center">
We can even use the grid system inside!
</h2>
</div>
<!-- Button trigger modal -->
<div class="container mt-4 d-flex justify-content-center">
<button
type="button"
class="btn btn-lg btn-success"
data-toggle="modal"
data-target="#exampleModalLong"
>
Launch demo modal
</button>
<!-- Modal -->
<div
class="modal fade"
id="exampleModalLong"
tabindex="-1"
role="dialog"
aria-labelledby="exampleModalLongTitle"
aria-hidden="true"
>
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLongTitle">
Modal title
</h5>
<button
type="button"
class="close"
data-dismiss="modal"
aria-label="Close"
>
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="container-fluid">
<div class="row">
<div class="col-md-4">.col-md-4</div>
<div class="col-md-4 ml-auto">.col-md-4 .ml-auto</div>
</div>
<div class="row">
<div class="col-md-3 ml-auto">.col-md-3 .ml-auto</div>
<div class="col-md-2 ml-auto">.col-md-2 .ml-auto</div>
</div>
<div class="row">
<div class="col-md-6 ml-auto">.col-md-6 .ml-auto</div>
</div>
<div class="row">
<div class="col-sm-9">
Level 1: .col-sm-9
<div class="row">
<div class="col-8 col-sm-6">
Level 2: .col-8 .col-sm-6
</div>
<div class="col-4 col-sm-6">
Level 2: .col-4 .col-sm-6
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button
type="button"
class="btn btn-secondary"
data-dismiss="modal"
>
Close
</button>
<button type="button" class="btn btn-primary">
Save changes
</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://cdn.jsdelivr.net/npm/popper.js@1.14.3/dist/umd/popper.min.js"
integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49"
crossorigin="anonymous"
></script>
<script
src="https://cdn.jsdelivr.net/npm/bootstrap@4.1.3/dist/js/bootstrap.min.js"
integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy"
crossorigin="anonymous"
></script>
</body>
</html>