diff --git a/03_dom/agenda.md b/03_dom/agenda.md index 4d0058e..3f1d6a6 100644 --- a/03_dom/agenda.md +++ b/03_dom/agenda.md @@ -344,11 +344,11 @@ Projektarbeit **Übungen:** -Übungen 06 - 08 +Übungen 06 - 07 --- -#### Tag 24 +#### Tag 23 **Inhalt:** diff --git a/03_dom/uebungen/u06_tasse-01001/index.html b/03_dom/uebungen/u06_tasse-01001/index.html index e92dee4..f3adfb6 100644 --- a/03_dom/uebungen/u06_tasse-01001/index.html +++ b/03_dom/uebungen/u06_tasse-01001/index.html @@ -103,12 +103,30 @@ // Es besteht der Wunsch, den Text teilweise in grauer Schriftfarbe darzustellen. // 1. Schreibe eine Funktion, die allen p-Elementen die CSS-Klasse gray zuordnet. - - // 1. Schreibe eine Funktion, die allen p-Elementen die CSS-Klasse gray zuordnet. + $$('p').forEach((elem) => { + if (elem.classList.contains('buy_info_text')) return; + elem.classList.add('gray'); + }); // 2. Eine Ausnahme soll nur der Fließtext darstellen, der den Kaufvorgang enthält. Die p-Elemente mit der Klasse buy_info_text sollen dementsprechend von dem Vorgang ausgeschlossen werden. + $$('p.buy_info_text').forEach((elem) => { + elem.classList.remove('gray'); + }); + + $$('p:not(.buy_info_text)').forEach((elem) => { + elem.classList.add('gray'); + }); // 3. Weise nun allen Listenpunkten, die noch keine andere Klasse haben, die Klasse gray zu. + $$('li:not([class])').forEach((elem) => { + elem.classList.add('gray'); + }); + + $$('li').forEach((elem) => { + if (elem.classList.length === 0) { + elem.classList.add('gray'); + } + }); } diff --git a/03_dom/uebungen/u07_content-length/index.html b/03_dom/uebungen/u07_content-length/index.html index 038e29c..eea3a24 100644 --- a/03_dom/uebungen/u07_content-length/index.html +++ b/03_dom/uebungen/u07_content-length/index.html @@ -34,7 +34,28 @@ + + +
+
+

The Chat

+
+
+
+

+ Ladislaus: + Anybody there? +

+

+ Friedlinde + Yes, me! +

+
+ +
+ +
+
+ +
    +
  • Heribert
  • +
  • Friedlinde
  • +
  • Tusnelda
  • +
  • Berthold
  • +
  • Oswine
  • +
  • Ladislaus
  • +
+ + +
+
+
+ + diff --git a/03_dom/unterricht/tag23/02_defer-examples/01_example_defer.html b/03_dom/unterricht/tag23/02_defer-examples/01_example_defer.html new file mode 100644 index 0000000..10247ec --- /dev/null +++ b/03_dom/unterricht/tag23/02_defer-examples/01_example_defer.html @@ -0,0 +1,25 @@ + + + + + 01 Example Defer + + + + + + + + + + + + diff --git a/03_dom/unterricht/tag23/02_defer-examples/02_example_defer.html b/03_dom/unterricht/tag23/02_defer-examples/02_example_defer.html new file mode 100644 index 0000000..e9e57a4 --- /dev/null +++ b/03_dom/unterricht/tag23/02_defer-examples/02_example_defer.html @@ -0,0 +1,25 @@ + + + + + 02 Example Defer + + + + + + + + + + + + + diff --git a/03_dom/unterricht/tag23/02_defer-examples/03_example_defer.html b/03_dom/unterricht/tag23/02_defer-examples/03_example_defer.html new file mode 100644 index 0000000..46de993 --- /dev/null +++ b/03_dom/unterricht/tag23/02_defer-examples/03_example_defer.html @@ -0,0 +1,24 @@ + + + + + 03 Example Defer + + + + + + + + + + + + diff --git a/03_dom/unterricht/tag23/02_defer-examples/04_dom-laden.html b/03_dom/unterricht/tag23/02_defer-examples/04_dom-laden.html new file mode 100644 index 0000000..8863249 --- /dev/null +++ b/03_dom/unterricht/tag23/02_defer-examples/04_dom-laden.html @@ -0,0 +1,26 @@ + + + + + + DOM Laden - Event DOMContentLoaded + + + + +
+
+

DOM Laden - Event DOMContentLoaded

+
+
+ + + diff --git a/03_dom/unterricht/tag23/02_defer-examples/assets/js/file01.js b/03_dom/unterricht/tag23/02_defer-examples/assets/js/file01.js new file mode 100644 index 0000000..ffde053 --- /dev/null +++ b/03_dom/unterricht/tag23/02_defer-examples/assets/js/file01.js @@ -0,0 +1,7 @@ +'use strict'; + +console.log('File 01: '); + +const a = 'a'; + +console.log(output()); diff --git a/03_dom/unterricht/tag23/02_defer-examples/assets/js/file02.js b/03_dom/unterricht/tag23/02_defer-examples/assets/js/file02.js new file mode 100644 index 0000000..28b3deb --- /dev/null +++ b/03_dom/unterricht/tag23/02_defer-examples/assets/js/file02.js @@ -0,0 +1,7 @@ +"use strict"; + +console.log('File 02: '); + +const b = 'b'; + +console.log(output()); \ No newline at end of file diff --git a/03_dom/unterricht/tag23/02_defer-examples/assets/js/file03.js b/03_dom/unterricht/tag23/02_defer-examples/assets/js/file03.js new file mode 100644 index 0000000..427161f --- /dev/null +++ b/03_dom/unterricht/tag23/02_defer-examples/assets/js/file03.js @@ -0,0 +1,7 @@ +"use strict"; + +console.log('File 03: '); + +const c = 'c'; + +console.log(output()); \ No newline at end of file diff --git a/03_dom/unterricht/tag23/02_defer-examples/assets/js/file04.js b/03_dom/unterricht/tag23/02_defer-examples/assets/js/file04.js new file mode 100644 index 0000000..b07391c --- /dev/null +++ b/03_dom/unterricht/tag23/02_defer-examples/assets/js/file04.js @@ -0,0 +1,7 @@ +"use strict"; + +console.log('File 04: '); + +const d = 'd'; + +console.log(output()); \ No newline at end of file diff --git a/03_dom/unterricht/tag23/02_defer-examples/assets/js/helper.js b/03_dom/unterricht/tag23/02_defer-examples/assets/js/helper.js new file mode 100644 index 0000000..8be183f --- /dev/null +++ b/03_dom/unterricht/tag23/02_defer-examples/assets/js/helper.js @@ -0,0 +1,22 @@ +const output = () => { + let outputText = '\t'; + try{ + outputText += a + ','; + } catch(err) {} + try{ + outputText += b + ','; + } catch(err) {} + try{ + outputText += c + ','; + } catch(err) {} + try{ + outputText += d + ','; + } catch(err) {} + try{ + outputText += e + ','; + } catch(err) {} + try{ + outputText += i + ','; + } catch(err) {} + return outputText.replace(/,+$/,'');; +} \ No newline at end of file diff --git a/03_dom/unterricht/tag23/03_newsboard-lernheft/assets/css/main.css b/03_dom/unterricht/tag23/03_newsboard-lernheft/assets/css/main.css new file mode 100644 index 0000000..58fcd5a --- /dev/null +++ b/03_dom/unterricht/tag23/03_newsboard-lernheft/assets/css/main.css @@ -0,0 +1,227 @@ +* { + margin: 0; +} +html { + font-size: 100%; + padding: 0; + background-attachment: fixed; + background-image: -webkit-linear-gradient(top, #eef0f2, #d3d5d9); + background-image: -moz-linear-gradient(top, #eef0f2, #d3d5d9); + background-image: linear-gradient(to bottom, #eef0f2, #d3d5d9); +} +body { + color: #333; + font-size: 1em; + font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; + text-align: left; + margin: 1em; + padding: 0; +} +p, +h1, +h2, +h3, +h4, +h5, +h6 { + margin-bottom: 1rem; +} +p { + line-height: 1.5em; + -webkit-hyphens: auto; + -moz-hyphens: auto; + hyphens: auto; +} +p:last-child { + margin-bottom: 0; +} +a { + color: #2f83e8; + text-decoration: none; +} +a:hover { + text-decoration: underline; +} +strong, +b { + font-weight: bold; +} +em, +i { + font-style: italic; +} +.float_left { + float: left; +} +.float_right { + float: right; +} +.disabled { + opacity: 0.4; + cursor: default; +} +.message_number { + color: #fff; + font-size: 0.8em; + font-weight: bold; + text-align: center; + line-height: 1em; + position: absolute; + top: -0.5em; + left: -0.5em; + display: block; + padding-top: 0.3em; + min-width: 2em; + height: 2em; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + cursor: default; + background-color: #ea2314; + background-image: -webkit-linear-gradient(top, #f78f91, #c50404); + background-image: -moz-linear-gradient(top, #f78f91, #c50404); + background-image: linear-gradient(to bottom, #f78f91, #c50404); + border: 2px solid #fff; + -webkit-border-radius: 1em; + -moz-border-radius: 1em; + border-radius: 1em; + -webkit-box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.3); + -moz-box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.3); + box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.3); +} +.newsboard_wrapper { + margin: 0 auto 2em auto; + padding: 13px 0 0 17px; + max-width: 550px; + position: relative; + background: url('../img/sheets.png') no-repeat; +} +.newsboard_wrapper:before { + content: url('../img/paperclip.png'); + position: absolute; + top: 5px; + right: 35px; + z-index: 1; +} +.newsboard_wrapper .newsboard { + padding: 29px 1.25rem 4rem 1.25rem; + min-height: 20em; + position: relative; + border: 1px solid #ccc; + background-color: #fff; + background-image: -webkit-linear-gradient(#dddddd, #ffffff 1px); + background-image: -moz-linear-gradient(#dddddd, #ffffff 1px); + background-image: linear-gradient(#dddddd, #ffffff 1px); + background-position: 0 1.3em; + -webkit-background-size: 100% 1.5em; + -moz-background-size: 100% 1.5em; + background-size: 100% 1.5em; + -webkit-box-shadow: 0px 2px 3px rgba(0, 0, 0, 0.3); + -moz-box-shadow: 0px 2px 3px rgba(0, 0, 0, 0.3); + box-shadow: 0px 2px 3px rgba(0, 0, 0, 0.3); +} +.newsboard_wrapper .newsboard .close_button { + color: #777; + font-size: 1.2em; + text-decoration: none; + line-height: 1em; + position: absolute; + top: 10px; + right: 14px; + display: block; +} +.newsboard_wrapper .newsboard .close_button:hover { + color: #444; +} +.newsboard_wrapper .newsboard .newsboard_footer { + color: #999; + font-size: 0.8em; +} +.newsboard_wrapper .newsboard .paging_bar { + font-size: 1.8em; + padding: 0 1.25rem; + position: absolute; + left: 0; + right: 0; + bottom: 1rem; + white-space: nowrap; +} +.newsboard_wrapper .newsboard .paging_bar .float_left a, +.newsboard_wrapper .newsboard .paging_bar .float_right a { + color: #777; + text-decoration: none; +} +.newsboard_wrapper .newsboard .paging_bar .float_left a { + margin-right: 0.3em; +} +.newsboard_wrapper .newsboard .paging_bar .float_right a { + margin-left: 0.3em; +} +.newsboard_wrapper .newsboard .paging_bar .progressbar { + display: block; + width: 40%; + margin: 0 auto; +} +.newsboard_wrapper .newsboard .paging_bar progress { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + vertical-align: 0; + line-height: normal; + color: #2f83e8; + width: 100%; + height: 0.6rem; + border-style: none; + padding: 0; + background-color: #eee; + -webkit-border-radius: 0.3rem; + -moz-border-radius: 0.3rem; + border-radius: 0.3rem; + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4); + -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4); +} +.newsboard_wrapper .newsboard .paging_bar progress::-webkit-progress-bar { + padding: 0; + border-style: none; + background-color: transparent; +} +.newsboard_wrapper .newsboard .paging_bar progress::-webkit-progress-value { + -webkit-border-radius: 0.3rem; + border-radius: 0.3rem; + background-color: #2f83e8; + background-image: -webkit-linear-gradient(top, #8bbaf2, #176acd); + background-image: linear-gradient(to bottom, #8bbaf2, #176acd); +} +.newsboard_wrapper .newsboard .paging_bar progress::-moz-progress-bar { + -moz-border-radius: 0.3rem; + border-radius: 0.3rem; + background-color: #2f83e8; + background-image: -moz-linear-gradient(top, #8bbaf2, #176acd); + background-image: linear-gradient(to bottom, #8bbaf2, #176acd); +} +.newsboard_wrapper .newsboard .newsboard_content h1, +.newsboard_wrapper .newsboard .newsboard_content h2 { + font-weight: normal; + font-family: + 'Helvetica Neue Light', 'HelveticaNeue-Light', 'Helvetica Light', 'Helvetica-Light', Helvetica, Arial, sans-serif; + letter-spacing: 0.03em; +} +.newsboard_wrapper .newsboard .newsboard_content h1 { + font-size: 1.75em; +} +.newsboard_wrapper .newsboard .newsboard_content h2 { + color: #2f83e8; + font-size: 1.2em; + line-height: 1.4em; +} +.newsboard_wrapper .newsboard .newsboard_content:empty { + color: #999; + font-size: 1.15em; + text-align: center; + padding-top: 10.5rem; + background: url('../img/empty.png') no-repeat center 3.75rem; +} +.newsboard_wrapper .newsboard .newsboard_content:empty:after { + content: 'Keine neuen Mitteilungen.'; +} diff --git a/03_dom/unterricht/tag23/03_newsboard-lernheft/assets/img/empty.png b/03_dom/unterricht/tag23/03_newsboard-lernheft/assets/img/empty.png new file mode 100644 index 0000000..d650b1b Binary files /dev/null and b/03_dom/unterricht/tag23/03_newsboard-lernheft/assets/img/empty.png differ diff --git a/03_dom/unterricht/tag23/03_newsboard-lernheft/assets/img/paperclip.png b/03_dom/unterricht/tag23/03_newsboard-lernheft/assets/img/paperclip.png new file mode 100644 index 0000000..7f24721 Binary files /dev/null and b/03_dom/unterricht/tag23/03_newsboard-lernheft/assets/img/paperclip.png differ diff --git a/03_dom/unterricht/tag23/03_newsboard-lernheft/assets/img/sheets.png b/03_dom/unterricht/tag23/03_newsboard-lernheft/assets/img/sheets.png new file mode 100644 index 0000000..14680cb Binary files /dev/null and b/03_dom/unterricht/tag23/03_newsboard-lernheft/assets/img/sheets.png differ diff --git a/03_dom/unterricht/tag23/03_newsboard-lernheft/assets/js/main.js b/03_dom/unterricht/tag23/03_newsboard-lernheft/assets/js/main.js new file mode 100644 index 0000000..e69de29 diff --git a/03_dom/unterricht/tag23/03_newsboard-lernheft/index.html b/03_dom/unterricht/tag23/03_newsboard-lernheft/index.html new file mode 100644 index 0000000..be24e1e --- /dev/null +++ b/03_dom/unterricht/tag23/03_newsboard-lernheft/index.html @@ -0,0 +1,40 @@ + + + + + + Newsboard + + + + + + + +
+
+ 3 + + × + +
+ +
+ + « + + + + + + » + + + + + +
+
+
+ +