From 24466b5535a9537f6ad27e530ae1fbcb4168cab3 Mon Sep 17 00:00:00 2001 From: Harmandeep Singh Date: Mon, 3 Jan 2022 20:47:33 +0530 Subject: [PATCH 1/3] day 1 task added --- harmandeep-singh/day 1/index.html | 56 +++++++++++++++++++++++++++++ harmandeep-singh/day 1/js/script.js | 7 ++++ 2 files changed, 63 insertions(+) create mode 100644 harmandeep-singh/day 1/index.html create mode 100644 harmandeep-singh/day 1/js/script.js diff --git a/harmandeep-singh/day 1/index.html b/harmandeep-singh/day 1/index.html new file mode 100644 index 00000000..8e648ac8 --- /dev/null +++ b/harmandeep-singh/day 1/index.html @@ -0,0 +1,56 @@ + + + + + + + + Task | Swiggy Day 1 + + + + + + + + +

Inline Script Implementation

+
+
+ Hey There! Hover over me! +
+
+
+ + +

Internal Script Implementation

+
+
+ I'm implemented using Internal Script! But you can still Hover over me! +
+
+
+ + +

External Script Implementation

+
+
+
+ +

+ + +
+
+ + + \ No newline at end of file diff --git a/harmandeep-singh/day 1/js/script.js b/harmandeep-singh/day 1/js/script.js new file mode 100644 index 00000000..4abafd13 --- /dev/null +++ b/harmandeep-singh/day 1/js/script.js @@ -0,0 +1,7 @@ +function display2(data) { + console.log('Display 2 called with ' + data); +} + +function greet(name) { + alert('Nice to meet you ' + name); +} \ No newline at end of file From 7c8ffd36a498b2af6a51ccaaa617a582dcd7b8f5 Mon Sep 17 00:00:00 2001 From: Harmandeep Singh Date: Tue, 4 Jan 2022 20:20:41 +0530 Subject: [PATCH 2/3] feat: added Day 2 task --- harmandeep-singh/day 2/index.html | 35 ++++++++++++++++++++++ harmandeep-singh/day 2/js/script.js | 45 +++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 harmandeep-singh/day 2/index.html create mode 100644 harmandeep-singh/day 2/js/script.js diff --git a/harmandeep-singh/day 2/index.html b/harmandeep-singh/day 2/index.html new file mode 100644 index 00000000..92fc0446 --- /dev/null +++ b/harmandeep-singh/day 2/index.html @@ -0,0 +1,35 @@ + + + + + + + + Task | Swiggy Day 2 + + + + + +

Task | Swiggy Day 2

+
+ +
+ Good Morning +

Hello World! How are you?

+
+ + + + + +

+
+ + + + + + + + \ No newline at end of file diff --git a/harmandeep-singh/day 2/js/script.js b/harmandeep-singh/day 2/js/script.js new file mode 100644 index 00000000..218914fc --- /dev/null +++ b/harmandeep-singh/day 2/js/script.js @@ -0,0 +1,45 @@ +const fontChoices = ["30px", "40px", "50px", "60px", "70px", "80px", "90px", "100px"]; +const displayChoices = ["block", "inline", "none"]; +const visibiltyChoices = ["visible", "hidden"]; + +function updateName() { + let name = document.getElementById("in1").value; + document.getElementById("name").innerHTML = name; +} + +function toggleFontSize() { + let name = document.getElementById("heading"); + let current = name.style.fontSize; + let index = fontChoices.indexOf(current); + if (index < fontChoices.length - 1) { + index++; + } + else { + index = 0; + } + name.style.fontSize = fontChoices[index]; +} +function toggleDisplay() { + let name = document.getElementById("heading"); + let current = name.style.display; + let index = displayChoices.indexOf(current); + if (index < displayChoices.length - 1) { + index++; + } + else { + index = 0; + } + name.style.display = displayChoices[index]; +} +function toggleVisibility() { + let name = document.getElementById("heading"); + let current = name.style.visibility; + let index = visibiltyChoices.indexOf(current); + if (index < visibiltyChoices.length - 1) { + index++; + } + else { + index = 0; + } + name.style.visibility = visibiltyChoices[index]; +} \ No newline at end of file From 37e55278afd3d1e5c6b7e43e6df373809e5ac6e1 Mon Sep 17 00:00:00 2001 From: Harmandeep Singh Date: Wed, 5 Jan 2022 20:59:52 +0530 Subject: [PATCH 3/3] feat: Day 3 task added --- harmandeep-singh/day 3/Files/demo.html | 16 ++++++++++++++++ harmandeep-singh/day 3/Files/demo.txt | 2 ++ harmandeep-singh/day 3/fsCreateFile.js | 20 ++++++++++++++++++++ harmandeep-singh/day 3/fsDeleteFile.js | 15 +++++++++++++++ harmandeep-singh/day 3/fsReadFile.js | 13 +++++++++++++ harmandeep-singh/day 3/fsUpdateFile.js | 6 ++++++ harmandeep-singh/day 3/serverTest.js | 7 +++++++ 7 files changed, 79 insertions(+) create mode 100644 harmandeep-singh/day 3/Files/demo.html create mode 100644 harmandeep-singh/day 3/Files/demo.txt create mode 100644 harmandeep-singh/day 3/fsCreateFile.js create mode 100644 harmandeep-singh/day 3/fsDeleteFile.js create mode 100644 harmandeep-singh/day 3/fsReadFile.js create mode 100644 harmandeep-singh/day 3/fsUpdateFile.js create mode 100644 harmandeep-singh/day 3/serverTest.js diff --git a/harmandeep-singh/day 3/Files/demo.html b/harmandeep-singh/day 3/Files/demo.html new file mode 100644 index 00000000..cb85c9e0 --- /dev/null +++ b/harmandeep-singh/day 3/Files/demo.html @@ -0,0 +1,16 @@ + + + + + + + + Demo Document + + + +

Header

+

This is a paragraph.

+ + + \ No newline at end of file diff --git a/harmandeep-singh/day 3/Files/demo.txt b/harmandeep-singh/day 3/Files/demo.txt new file mode 100644 index 00000000..69c4042e --- /dev/null +++ b/harmandeep-singh/day 3/Files/demo.txt @@ -0,0 +1,2 @@ +Hello world How are you? +This is i++ bootcamp. diff --git a/harmandeep-singh/day 3/fsCreateFile.js b/harmandeep-singh/day 3/fsCreateFile.js new file mode 100644 index 00000000..fa00b05f --- /dev/null +++ b/harmandeep-singh/day 3/fsCreateFile.js @@ -0,0 +1,20 @@ +var fs = require('fs'); + +fs.appendFile('newfile.txt', 'Hello World!', function (err) { + if (err) throw err; + console.log('Saved!'); +}); + +fs.writeFile('newfile1.txt', 'Hello World!', function (err) { + if (err) throw err; + console.log('Saved!'); +}); + +fs.open('newfile2.txt', 'w', function (err, file) { + if (err) return err; + console.log('File opened successfully.'); + fs.writeFile(file, 'New data added', function (err) { + if (err) throw err; + console.log('Data written successfully.'); + }); +}) diff --git a/harmandeep-singh/day 3/fsDeleteFile.js b/harmandeep-singh/day 3/fsDeleteFile.js new file mode 100644 index 00000000..47337b98 --- /dev/null +++ b/harmandeep-singh/day 3/fsDeleteFile.js @@ -0,0 +1,15 @@ +var fs = require('fs'); + +fs.open('dummyFile.txt', 'w', function (err, file) { + if (err) { + throw err; + } + console.log('File opened successfully.'); +}); + +fs.unlink('dummyFile.txt', function (err) { + if (err) { + throw err; + } + console.log('File deleted successfully.'); +}); \ No newline at end of file diff --git a/harmandeep-singh/day 3/fsReadFile.js b/harmandeep-singh/day 3/fsReadFile.js new file mode 100644 index 00000000..a6b2a9b8 --- /dev/null +++ b/harmandeep-singh/day 3/fsReadFile.js @@ -0,0 +1,13 @@ +var http = require('http'); +var fs = require('fs'); + +http.createServer(function (req, res) { + res.writeHead(200, { 'Content-Type': 'text/html' }); + fs.readFile('./Files/demo.html', function (err, data) { + if (err) { + throw err; + } + res.write(data); + res.end(); + }) +}).listen(8080); \ No newline at end of file diff --git a/harmandeep-singh/day 3/fsUpdateFile.js b/harmandeep-singh/day 3/fsUpdateFile.js new file mode 100644 index 00000000..2f57dd74 --- /dev/null +++ b/harmandeep-singh/day 3/fsUpdateFile.js @@ -0,0 +1,6 @@ +var fs = require('fs'); + +fs.appendFile('./Files/demo.txt', 'This is i++ bootcamp.\n', function (err) { + if (err) throw err; + console.log('Updated!'); +}); \ No newline at end of file diff --git a/harmandeep-singh/day 3/serverTest.js b/harmandeep-singh/day 3/serverTest.js new file mode 100644 index 00000000..9f5084b7 --- /dev/null +++ b/harmandeep-singh/day 3/serverTest.js @@ -0,0 +1,7 @@ +var http = require('http'); + +http.createServer(function (req, res) { + res.writeHead(200, { 'Content-Type': 'text/html' }); + res.write('

Swiggy task 3

'); + res.end('Hello World!'); +}).listen(8080); \ No newline at end of file