diff --git a/02-react/04-redux-saga/README.md b/02-react/04-redux-saga/README.md index 0cf535f..5d146d8 100644 --- a/02-react/04-redux-saga/README.md +++ b/02-react/04-redux-saga/README.md @@ -22,3 +22,4 @@ - Navya: https://codesandbox.io/s/infallible-dhawan-1emux?file=/src/App.js - Sumanth: https://codesandbox.io/s/optimistic-proskuriakova-jxqq5?file=/src/App.js - Pooja: https://codesandbox.io/s/gracious-snyder-hls4f?file=/src/App.js +- Anirudh: https://codesandbox.io/s/holy-bird-0zwxy?file=/src/App.js diff --git a/06-dom_manipulation/LEVEL_01/AnirudhSinghTomar/index.html b/06-dom_manipulation/LEVEL_01/AnirudhSinghTomar/index.html new file mode 100644 index 0000000..c878f67 --- /dev/null +++ b/06-dom_manipulation/LEVEL_01/AnirudhSinghTomar/index.html @@ -0,0 +1,36 @@ + + + + + Task 1 + + + +

Task 1

+

Paragraph 1

+

+

+

+

Paragraph 2

+

I am centered!
+ +

+ + + diff --git a/06-dom_manipulation/LEVEL_01/AnirudhSinghTomar/resourceLEVEL1.txt b/06-dom_manipulation/LEVEL_01/AnirudhSinghTomar/resourceLEVEL1.txt new file mode 100644 index 0000000..f08a99a --- /dev/null +++ b/06-dom_manipulation/LEVEL_01/AnirudhSinghTomar/resourceLEVEL1.txt @@ -0,0 +1 @@ +https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener diff --git a/06-dom_manipulation/LEVEL_02/AnirudhSinghTomar/index.html b/06-dom_manipulation/LEVEL_02/AnirudhSinghTomar/index.html new file mode 100644 index 0000000..6d5911c --- /dev/null +++ b/06-dom_manipulation/LEVEL_02/AnirudhSinghTomar/index.html @@ -0,0 +1,13 @@ + + + + + Task 2 + + + + + + + + diff --git a/06-dom_manipulation/LEVEL_02/AnirudhSinghTomar/resourceLEVEL2.txt b/06-dom_manipulation/LEVEL_02/AnirudhSinghTomar/resourceLEVEL2.txt new file mode 100644 index 0000000..ea0ef95 --- /dev/null +++ b/06-dom_manipulation/LEVEL_02/AnirudhSinghTomar/resourceLEVEL2.txt @@ -0,0 +1,3 @@ +https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers + +https://www.html5rocks.com/en/tutorials/workers/basics/ diff --git a/06-dom_manipulation/LEVEL_02/AnirudhSinghTomar/script.js b/06-dom_manipulation/LEVEL_02/AnirudhSinghTomar/script.js new file mode 100644 index 0000000..15968b0 --- /dev/null +++ b/06-dom_manipulation/LEVEL_02/AnirudhSinghTomar/script.js @@ -0,0 +1,18 @@ +addnumber = () => { + let num1 = parseInt(document.getElementById("number1").value); + let num2 = parseInt(document.getElementById("number2").value); + if (window.Worker) { + let worker1 = new Worker("worker.js"); + let message = { + toadd: { + number1: num1, + number2: num2 + } + }; + worker1.postMessage(message) + + worker1.onmessage = function(e) { + console.log(e.data.result); + }; + } +} diff --git a/06-dom_manipulation/LEVEL_02/AnirudhSinghTomar/worker.js b/06-dom_manipulation/LEVEL_02/AnirudhSinghTomar/worker.js new file mode 100644 index 0000000..35717a8 --- /dev/null +++ b/06-dom_manipulation/LEVEL_02/AnirudhSinghTomar/worker.js @@ -0,0 +1,7 @@ +this.onmessage = function(e) { + if (e.data.toadd !== undefined) { + this.postMessage({ + result: e.data.toadd.number1 + e.data.toadd.number2 + }); + } +}; diff --git a/06-dom_manipulation/LEVEL_03/AnirudhSinghTomar/index.html b/06-dom_manipulation/LEVEL_03/AnirudhSinghTomar/index.html new file mode 100644 index 0000000..fc18251 --- /dev/null +++ b/06-dom_manipulation/LEVEL_03/AnirudhSinghTomar/index.html @@ -0,0 +1,12 @@ + + + + + + Task 3 + + + + + + diff --git a/06-dom_manipulation/LEVEL_03/AnirudhSinghTomar/resourceLEVEL3.txt b/06-dom_manipulation/LEVEL_03/AnirudhSinghTomar/resourceLEVEL3.txt new file mode 100644 index 0000000..872326b --- /dev/null +++ b/06-dom_manipulation/LEVEL_03/AnirudhSinghTomar/resourceLEVEL3.txt @@ -0,0 +1 @@ +https://developer.mozilla.org/en-US/docs/Web/API/Document/createElement diff --git a/06-dom_manipulation/LEVEL_03/AnirudhSinghTomar/script.js b/06-dom_manipulation/LEVEL_03/AnirudhSinghTomar/script.js new file mode 100644 index 0000000..a2c53a2 --- /dev/null +++ b/06-dom_manipulation/LEVEL_03/AnirudhSinghTomar/script.js @@ -0,0 +1,26 @@ +const arr = ["p", "button", "li"]; +const text = ["Hey this is Anirudh Singh Tomar", "Click to Know me", "By"]; +function addtagss() { + let observer; + observer = new MutationObserver(mutated); + let config = { + childList: true, + }; + observer.observe(document.body, config); + + for (let i = 0; i < arr.length; i++) { + var node = document.createElement(arr[i]); + var textnode = document.createTextNode(text[i]); + node.appendChild(textnode); + var element = document.getElementById("body"); + element.appendChild(node); + } +} +function mutated(mutationList) { + Array.prototype.forEach.call(mutationList, function (data) { + let newnodes = data.addedNodes; + Array.prototype.forEach.call(newnodes, function (newN) { + console.log("Added a new node", newN.tagName); + }); + }); +}