-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEWP-09-bootstrap.html
487 lines (369 loc) · 12.1 KB
/
EWP-09-bootstrap.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
<!doctype html>
<html lang="de">
<head>
<meta charset="utf-8">
<title>EWP: Bootstrap</title>
<meta name="description" content="Einführung in die Webprogrammierung SoSe 2016. Sitzung 09: bootstrap">
<meta name="author" content="Oliver Pohl">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
<link rel="stylesheet" href="css/reveal.css">
<link rel="stylesheet" href="css/theme/ibi.css" id="theme">
<link rel="stylesheet" href="plugin/font-awesome/css/font-awesome.min.css">
<!-- Code syntax highlighting -->
<link rel="stylesheet" href="lib/css/zenburn.css">
<!-- Printing and PDF exports -->
<script>
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = window.location.search.match( /print-pdf/gi ) ? 'css/print/pdf.css' : 'css/print/paper.css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
</script>
<!--[if lt IE 9]>
<script src="lib/js/html5shiv.js"></script>
<![endif]-->
<script src="js/jquery-1.11.1.min.js"></script>
<script src="js/ibi.js"></script>
</head>
<body>
<div class="reveal">
<!-- Any section element inside of this container is displayed as a slide -->
<div class="slides">
<section>
<h2>Einführung in die Webprogrammierung</h2>
<h4>Sitzung 09: Bootstrap</h4>
<h4>Oliver Pohl: <a href="mailto:opohl@bbaw.de">opohl@bbaw.de</a></h4>
</section>
<section>
<section>
<h2>Agenda</h2>
<ul>
<li>Warmup</li>
<li>Bootstrap</li>
<li>Grid & Layout</li>
<li>Komponenten</li>
</ul>
</section>
<section data-markdown="">
<script>
## Warmup
Bootstrap-Klassen zuordnen
</script>
</section>
</section>
<section>
<section data-markdown="">
<script>
## Bootstrap
</script>
</section>
<section data-markdown="">
<script>
## Was ist Bootstrap?
* CSS-Framework
* Responsive Webseiten erstellen
* Styles und Funktionen für alltägliche Komponenten
* Schnell (halbwegs) ansehliche Webseiten erstellen
</script>
</section>
<section data-markdown="">
<script>
## Warum Bootstrap?
* Grid-Layout
* Wiederverwendung durch andere Bibliotheken
* Wiederverwendbare Komponenten
</script>
</section>
<section data-markdown="">
<script>
## Wie einbinden?
* Manuell herunterladen und einbinden: http://getbootstrap.com/
* CDN
* npm
```
$ npm install bootstrap
```
</script>
</section>
<section data-markdown="">
<script>
## Reihenfolge
1. jquery
2. Bootstrap
3. Andere Libraries
4. Eigener Codes
</script>
</section>
</section>
<section>
<section data-markdown="">
<script>
## Layout & Grid
</script>
</section>
<section data-markdown="">
<script>
## Grid-Layout
* **xs** (< 768px): Smartphones
* **sm** (≥ 768px): Tablet
* **md** (≥ 992px): Desktop
* **lg** (≥ 1170px): Großer Desktop
**Layouts automatisch an Gerätetyp anpassen**
</script>
</section>
<section data-markdown="">
<script>
## Grid (Desktop)
* 12 Spalten verfügbar
* Spaltenbreite über Bootstrap-Klasse definieren
* ```.col-md-1```
* ```.col-md-2```
* ...
* ```.col-md-12```
[Beispiel](sessions/09/bootstrap-grid-example-md.html)
</script>
</section>
<section data-markdown="">
<script>
## Grid (Desktop & Mobile)
* 12 Spalten pro Grid-Klasse verfügbar
* Spaltenbreite für verschiedene Bildschirmgrößen
* ```.col-md-4 .col-xs-6```
* ```.col-md-6 .col-xs-12```
* usw.
* Bei Unterschreitung der Mindestbreite: Fallback auf nächstkleinere Klasse
[Beispiel](sessions/09/bootstrap-grid-example-md-xs.html)
</script>
</section>
<section data-markdown="">
<script>
## Container
* Zentriert Inhalte auf der Webseite
* Macht Elemente responsive
* Webseiten-Inhalt soll in den Container
```
<div class="container">
...
</div>
```
[Mit Container](sessions/09/bootstrap-grid-example-md-xs.html) - [Ohne Container](sessions/09/bootstrap-grid-example-md-xs-no-container.html)
</script>
</section>
<section data-markdown="">
<script>
## Übung: Bootstrap-Grid
[http://goo.gl/MYqyXY](http://jsbin.com/wowuvawiye/edit?html,output)
</script>
</section>
<section>
<h1>KAHOOT</h1>
<h3><a href="http://www.kahoot.it">www.kahoot.it</a></h3>
</section>
</section>
<section>
<section data-markdown="">
<script>
## Bootstrap Komponenten
* Jumbotron
* Buttons
* Collectoins
* Glyphicons
* (Navbar)
* (Dropdowns)
</script>
</section>
<section data-markdown="">
<script>
## Jumbotron
* Große Fläche für Header
* Gut für One-Pager-Projekte
* Normalerweise
* Überschrift
* Kurzbeschreibung
* Wichtigste Funktionen
```
<div class="container">
<div class="jumbotron">
<h1>Jumbotron mit Container-Breite</h1>
</div>
</div>
```
[Jumbotron-Beispiele](sessions/09/bootstrap-jumbotron.html)
</script>
</section>
<section data-markdown="">
<script>
## Buttons
https://getbootstrap.com/css/#buttons
* Button-Klasses für verschiedene Zwecke
* Normal: ```btn btn-default```
* Blau: ```btn btn-primary```
* Grün: ```btn btn-success```
* Gelb: ```btn btn-warning```
* Rot: ```btn btn-danger```
```
<button type="button" class="btn btn-success">Success</button>
```
[Button-Beispiele](sessions/09/bootstrap-buttons.html)
</script>
</section>
<section data-markdown="">
<script>
## Glyphicons (& Buttons)
[Glyphicon-Übersicht](https://getbootstrap.com/components/#glyphicons)
* Bootstrap-eigene Icons
* Verwendung via span-Elemente
Icon alleine
```
<span class="glyphicon glyphicon-pencil"></span>
```
Icon im Button
```
<button type="button" class="btn btn-primary">
<span class="glyphicon glyphicon-plus"></span> Add something
</button>
```
[Beispiele](sessions/09/bootstrap-glyphicon.html)
</script>
</section>
<section data-markdown="">
<script>
## Übung: Jumbotron, Buttons & Glyphicons
[http://goo.gl/xXRrz6](http://jsbin.com/sexayevaho/edit?html,output)
</script>
</section>
<section data-markdown="">
<script>
## List-Groups & Badges
https://getbootstrap.com/components/#list-group
* Darstellung von Listen
* Badges: Kleine Icons
```
<ul class="list-group">
<li class="list-group-item">
<span class="badge">3</span>
Äpfel
</li>
</ul>
```
[Beispiel](sessions/09/bootstrap-lists.html)
</script>
</section>
<section data-markdown="">
<script>
## Navbar
https://getbootstrap.com/components/#navbar
* Navigationsleiste
* Webseitenbereiche & Funktionen auflisten
* Außerhalb oder innerhalb des Containers
```
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Link <span class="sr-only">(current)</span></a></li>
<li><a href="#">Link</a></li>
</ul>
</div>
</div>
</nav>
```
[Beispiel](sessions/09/bootstrap-navbar.html)
</script>
</section>
<section data-markdown="">
<script>
## Dropdown-Buttons
https://getbootstrap.com/components/#btn-dropdowns
* Bei Klick: mehr Optionen
* Button(s) in button-group-div
```
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Action <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li role="separator" class="divider"></li>
<li><a href="#">Separated link</a></li>
</ul>
</div>
```
[Beispiel](sessions/09/bootstrap-dropdown-button.html)
</script>
</section>
</section>
<section>
<section>
<h2>Hausaufgabe 17</h2>
<ul>
<li>Ratespiel in Bootstrap implementieren</li>
<li>Entsprechende Bootstrap-Klassen nutzen</li>
<li>Klassen und jQuery-Funktionen selbst recherchieren</li>
<li>Bonus: Responsiveness erzeugen</li>
</ul>
</section>
<section data-markdown="">
<script>
## 14.07. - Keine Sitzung
</script>
</section>
</section>
</div>
<div class="footer">
<a href="https://creativecommons.org/licenses/by/4.0/">
<img src="img/cc-by.png" alt="CC-BY" id="cc-logo">
</a>
Oliver Pohl, Einführung in die Webprogrammierung (SoSe 2016), Sitzung 09: Bootstrap. -- <a href="http://telotadev.bbaw.de/ewp-helper/questions">Anonyme Fragen: http://goo.gl/dDkMeL</a>
</div>
</div>
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.js"></script>
<script>
// Full list of configuration options available at:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: true,
progress: true,
history: true,
center: true,
transition: 'slide', // none/fade/slide/convex/concave/zoom
// Optional reveal.js plugins
dependencies: [
{ src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } },
{ src: 'plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
{ src: 'plugin/zoom-js/zoom.js', async: true },
{ src: 'plugin/notes/notes.js', async: true },
{ src: 'plugin/chart/Chart.min.js' },
{ src: 'plugin/chart/csv2chart.js' },
{ src: 'plugin/externalcode/externalcode.js'},
],
chart: {
defaults: {
global: {
title: { fontColor: "#000" },
},
legend: {
labels: { fontColor: "#000" },
},
scale: {
scaleLabel: { fontColor: "#000" },
gridLines: { color: "#000", zeroLineColor: "#000" },
ticks: { fontColor: "#000" },
}
},
line: { borderColor: [ "rgba(20,220,220,.8)" , "rgba(220,120,120,.8)", "rgba(20,120,220,.8)" ], "borderDash": [ [5,10], [0,0] ]},
bar: { backgroundColor: [ "rgba(20,220,220,.8)" , "rgba(220,120,120,.8)", "rgba(20,120,220,.8)" ]},
pie: { backgroundColor: [ ["rgba(0,0,0,.8)" , "rgba(220,20,20,.8)", "rgba(20,220,20,.8)", "rgba(220,220,20,.8)", "rgba(20,20,220,.8)", "rgba(252,158,206, 0.8)"] ]},
radar: { borderColor: [ "rgba(20,220,220,.8)" , "rgba(220,120,120,.8)", "rgba(20,120,220,.8)" ]},
},
});
</script>
</body>
</html>