Skip to content

Commit af1351f

Browse files
authored
Merge pull request #227 from ayushseth07/patch
Patch
2 parents a9ac290 + 57ff60e commit af1351f

File tree

14 files changed

+789
-3
lines changed

14 files changed

+789
-3
lines changed

Index.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@
8181
| [Chess Game](https://github.com/Ayushparikh-code/Web-dev-mini-projects/tree/main/Chess-Game) | A basic chess game for entertainment purpose. |
8282
| [Password Generator](https://github.com/Ayushparikh-code/Web-dev-mini-projects/tree/main/Password%20Generator) | A password generator app to generate strong passwords which can be easily used for authentication. |
8383
| [Parallex Website](https://github.com/Ayushparikh-code/Web-dev-mini-projects/tree/main/Chess-Game) | A basic website using HTML, CSS, JAVASCRIPT with modern look. |
84-
| [Weight Converter](https://github.com/Ayushparikh-code/Web-dev-mini-projects/tree/main/Weight%20Converter) |A web page where used can convert weight from kilograms to grams, ounces and pounds.
85-
| [Restaurant website](https://github.com/Ayushparikh-code/Web-dev-mini-projects/tree/main/Restaurant-website) |A Restuarant website with a simple and user friendly design ad a database linked to it.
86-
| [Speed-Distance-Time-Calculator](https://github.com/Ayushparikh-code/Web-dev-mini-projects/tree/main/speed-distance-time-calculator) |It is a multi pager Speed Distnace Time Calculator with simple but userfriendly design.
84+
85+
| [To Do List](https://github.com/Ayushparikh-code/Web-dev-mini-projects/tree/main/todolist) |This app allows you to make a list of events you want to do and you can strikeout the events completed.|
86+
| [Weight Converter](https://github.com/Ayushparikh-code/Web-dev-mini-projects/tree/main/Weight%20Converter) |A web page where used can convert weight from kilograms to grams, ounces and pounds.|
87+
| [Restaurant website](https://github.com/Ayushparikh-code/Web-dev-mini-projects/tree/main/Restaurant-website) |A Restuarant website with a simple and user friendly design ad a database linked to it.|
88+
| [Speed-Distance-Time-Calculator](https://github.com/Ayushparikh-code/Web-dev-mini-projects/tree/main/speed-distance-time-calculator) |It is a multi pager Speed Distnace Time Calculator with simple but userfriendly design.|

todolist/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.DS_Store
2+
node_modules/

todolist/Readme.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<h1>To Do List</h1>
2+
3+
<p>To Do list made using HTML, CSS,JS and Node.js.</p>
4+
5+
### To Do List :
6+
7+
<p>This app allows you to make a list of events you want to do and you can strikeout the events completed.</p>
8+
9+
<h3>Used Technologies</h3>
10+
<ul>
11+
<li>HTML5</li>
12+
<li>CSS3</li>
13+
<li>JavaScript</li>
14+
<li>Node.js</li>
15+
</ul>
16+
17+
#### Steps to Use:
18+
19+
---
20+
* Download [Node Js and npm(Node package manager)](https://nodejs.org/en/) (when you install Node, npm also gets installed by default)
21+
<br/>
22+
23+
* Clone the repository by running command
24+
```
25+
git clone https://github.com/Ayushparikh-code/Web-dev-mini-projects.git
26+
```
27+
in your git bash.
28+
<br/>
29+
30+
* Run command `cd todolist`.
31+
<br/>
32+
33+
* Run this command to install all dependencies for the project.
34+
```npm install
35+
36+
```
37+
*Run this command to run the file.
38+
```
39+
node app.js
40+
```
41+
* Open http://localhost:3000/ on your browser.
42+
<br/>
43+
44+
<h3>ScreenShots</h3>
45+
<br>
46+
<img src="https://github.com/ayushseth07/Web-dev-mini-projects/blob/patch/todolist/images/main.PNG"/>
47+
<img src="https://github.com/ayushseth07/Web-dev-mini-projects/blob/patch/todolist/images/work.PNG"/>

todolist/app.js

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
//jshint esversion:6
2+
3+
const express = require("express");
4+
const bodyParser = require("body-parser");
5+
const date = require(__dirname + "/date.js");
6+
7+
const app = express();
8+
9+
app.set('view engine', 'ejs');
10+
11+
app.use(bodyParser.urlencoded({
12+
extended: true
13+
}));
14+
app.use(express.static("public"));
15+
16+
const items = [];
17+
const workItems = [];
18+
19+
app.get("/", function(req, res) {
20+
21+
const day = date.getDate();
22+
23+
res.render("list", {
24+
listTitle: day,
25+
newListItems: items
26+
});
27+
28+
});
29+
30+
app.post("/", function(req, res) {
31+
32+
const item = req.body.newItem;
33+
34+
if (req.body.list === "Work") {
35+
workItems.push(item);
36+
res.redirect("/work");
37+
} else {
38+
items.push(item);
39+
res.redirect("/");
40+
}
41+
});
42+
43+
app.get("/work", function(req, res) {
44+
res.render("list", {
45+
listTitle: "Work List",
46+
newListItems: workItems
47+
});
48+
});
49+
50+
app.get("/about", function(req, res) {
51+
res.render("about");
52+
});
53+
54+
app.listen(3000, function() {
55+
console.log("Server started on port 3000");
56+
});

todolist/date.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
//jshint esversion:6
2+
3+
exports.getDate = function() {
4+
5+
const today = new Date();
6+
7+
const options = {
8+
weekday: "long",
9+
day: "numeric",
10+
month: "long"
11+
};
12+
13+
return today.toLocaleDateString("en-US", options);
14+
15+
};
16+
17+
exports.getDay = function() {
18+
19+
const today = new Date();
20+
21+
const options = {
22+
weekday: "long"
23+
};
24+
25+
return today.toLocaleDateString("en-US", options);
26+
27+
};

todolist/images/main.PNG

20.8 KB
Loading

todolist/images/work.PNG

18.4 KB
Loading

todolist/index.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html lang="en" dir="ltr">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>To Do List</title>
6+
</head>
7+
<body>
8+
<h1>It's a weekday!</h1>
9+
<p>Why are you not working!</p>
10+
</body>
11+
</html>

0 commit comments

Comments
 (0)