diff --git a/03_js-dom/linksammlung.md b/03_js-dom/linksammlung.md index 0805116..bad9dda 100644 --- a/03_js-dom/linksammlung.md +++ b/03_js-dom/linksammlung.md @@ -58,7 +58,14 @@ - [Dafont](https://www.dafont.com/de/) - [My Fonts](https://www.myfonts.com/pages/whatthefont/) - What the font +## Bilder/ Vektoren +- [Freepik | Magnific](https://www.magnific.com//) +- [Flaticon](https://www.flaticon.com/) +- [Pexels](https://www.pexels.com/de-de/) +- [FavIcon Generator](https://realfavicongenerator.net/) +- [SVG Flaggen](https://hampusborgos.github.io/country-flags/) +- [Flagicons](https://flagicons.lipis.dev/) ## Blog/ Techartikelseiten diff --git a/03_js-dom/unterricht/tag22/04_tooltip/assets/css/tooltips.css b/03_js-dom/unterricht/tag22/04_tooltip/assets/css/tooltips.css new file mode 100644 index 0000000..9b3780d --- /dev/null +++ b/03_js-dom/unterricht/tag22/04_tooltip/assets/css/tooltips.css @@ -0,0 +1,46 @@ +p { + font-size: 1.5em; +} + +.keyword { + font-weight: bolder; + color: #225; +} + +#tooltip { + width: 250px; + border: 2px solid #339; + padding: 1rem; + background-color: rgba(238, 238, 255, 0.9); + + font-size: 1em; + text-align: justify; + + position: absolute; + display: flex; + justify-content: center; + align-items: center; +} + +/* Modified */ +.show { + display: block !important; + animation-name: fadeIn; + animation-duration: 0.4s; + animation-fill-mode: both; +} +.hide { + display: none !important; +} + +@keyframes fadeIn { + 0% { + opacity: 0; + transform: translate3d(0, 20%, 0); + } + 100% { + opacity: 1; + + transform: translate3d(0, 0, 0); + } +} diff --git a/03_js-dom/unterricht/tag22/04_tooltip/assets/js/tooltips.js b/03_js-dom/unterricht/tag22/04_tooltip/assets/js/tooltips.js new file mode 100644 index 0000000..33f1c97 --- /dev/null +++ b/03_js-dom/unterricht/tag22/04_tooltip/assets/js/tooltips.js @@ -0,0 +1,56 @@ +'use strict'; + +(() => { + const $ = (qs) => document.querySelector(qs); + const $$ = (qs) => Array.from(document.querySelectorAll(qs)); + + // === DOM & VARS ======= + const MOUSE_OFFSET_Y = 20; + const MOUSE_OFFSET_X = 10; + + const DOM = { + keywords: $$('.keyword'), + tooltip: $('#tooltip'), + }; + + // === INIT ============= + const init = () => { + DOM.keywords.forEach((el) => { + el.addEventListener('mousemove', onMouseMoveKeyword); + el.addEventListener('mouseleave', onMouseLeaveKeyword); + }); + }; + + // === EVENTHANDLER ===== + const onMouseMoveKeyword = (e) => { + const keywordEl = e.currentTarget; + + DOM.tooltip.style.top = `${e.clientY + MOUSE_OFFSET_Y}px`; + DOM.tooltip.style.left = `${e.clientX + MOUSE_OFFSET_X}px`; + + showTooltip(keywordEl); + }; + const onMouseLeaveKeyword = (e) => { + hideTooltip(); + }; + // === XHR/FETCH ======== + + // === FUNCTIONS ======== + const showTooltip = (el) => { + // DOM.tooltip.style.display = 'block'; + DOM.tooltip.classList.add('show'); + DOM.tooltip.classList.remove('hide'); + DOM.tooltip.textContent = el.getAttribute('data-tooltip'); + + // DOM.tooltip.classList.replace('hide', 'show'); + }; + const hideTooltip = (e) => { + // DOM.tooltip.style.display = 'none'; + DOM.tooltip.classList.add('hide'); + DOM.tooltip.classList.remove('show'); + + // DOM.tooltip.classList.replace('show', 'hide'); + }; + + init(); +})(); diff --git a/03_js-dom/unterricht/tag22/04_tooltip/index.html b/03_js-dom/unterricht/tag22/04_tooltip/index.html new file mode 100644 index 0000000..a720f6a --- /dev/null +++ b/03_js-dom/unterricht/tag22/04_tooltip/index.html @@ -0,0 +1,48 @@ + + + + + Tooltips + + + + + +

Quantum Entanglement Mugs

+

DRINK IN SYNC.

+ +

+ In the realm of + quantum mechanics , particles can be + + entangled + + in such a way that the state of one instantly influences the state of another, no matter the distance. This + phenomenon fascinates physicists and challenges our understanding of reality. Imagine sipping your coffee from a + mug that celebrates this + + quantum + + wonder. Just like entangled particles, you and a friend can share a connection over any distance with these mugs. + Introducing the Quantum Entanglement Mugs. +

+ +

+ Each set of Quantum Entanglement Mugs includes two ceramic mugs designed to reflect + the concept of entanglement. Share one with a friend, and no matter how far apart you are, you'll feel connected. + Use them at your next physics meetup, and your colleagues will appreciate your thoughtful nod to quantum theory. + Enjoy your coffee! +

+
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quis voluptates, veniam facere laudantium. +
+ + diff --git a/03_js-dom/unterricht/tag22/05_auslesen-position/index.html b/03_js-dom/unterricht/tag22/05_auslesen-position/index.html new file mode 100644 index 0000000..d9171d0 --- /dev/null +++ b/03_js-dom/unterricht/tag22/05_auslesen-position/index.html @@ -0,0 +1,59 @@ + + + + + + Auslesen von Breite, Höhe und Postion + + + + + +
+
+

Auslesen von Breite, Höhe und Postion

+
+
+
+ + + diff --git a/03_js-dom/unterricht/tag22/06_data-attribute/index.html b/03_js-dom/unterricht/tag22/06_data-attribute/index.html new file mode 100644 index 0000000..1c5a513 --- /dev/null +++ b/03_js-dom/unterricht/tag22/06_data-attribute/index.html @@ -0,0 +1,119 @@ + + + + + + Eigene Attribute mit data-[ATTRIBUT_NAME] - DOMStringMap + + + +
+
+

Eigene Attribute mit data-[ATTRIBUT_NAME] - DOMStringMap

+

+ DOMStringMap + - Die DOMStringMap-Schnittstelle wird für das HTMLElement.dataset-Attribut verwendet, um Daten + für benutzerdefinierte Attribute darzustellen, die zu Elementen hinzugefügt werden. +

+
+ +

+ Lorem ipsum dolor sit + cerebral cortex + + amet consectetur adipisicing elit. Harum voluptatem iure earum suscipit nihil! Recusandae pariatur corporis + odit optio excepturi labore dolore non, expedita temporibus adipisci vero, modi magnam veritatis? +

+ +
+
+ + +