Skip to content

Commit e905fa4

Browse files
authored
Merge pull request #293 from ayushseth07/patch
darkmode_todolist
2 parents b14dd29 + ee07713 commit e905fa4

File tree

14 files changed

+855
-0
lines changed

14 files changed

+855
-0
lines changed

Index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,5 @@
116116
| [Art Gallery Template](https://github.com/soma2000-lang/Web-dev-mini-projects/tree/iron/Art-Gallery) |It is a simple and resonsive Art Gallery Website where you can add multiple pictures and navigate through them.
117117
| [Food Website Template](https://github.com/soma2000-lang/Web-dev-mini-projects/tree/iron/Food-Web) |It is a simple and resonsive Food Website Website, you can navigate through them.
118118
| [iCoder](https://github.com/soma2000-lang/Web-dev-mini-projects/tree/iron/iCoder) |It is a simple and resonsive website made using bootstrap.
119+
| [Darkmode To Do List](https://github.com/Ayushparikh-code/Web-dev-mini-projects/tree/main/darkmode_todolist) |This app allows you to make a list of events you want to do and you can strikeout the events completed.|
119120
| [Tabla](https://github.com/Ayushparikh-code/Web-dev-mini-projects/tree/main/tabla) | It is a webapp that plays tabla beat on clicked on the tabla or clicked d or t.

darkmode_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/

darkmode_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/darkmode_todolist/images/main.PNG"/>
47+
<img src="https://github.com/ayushseth07/Web-dev-mini-projects/blob/patch/darkmode_todolist/images/work.PNG"/>

darkmode_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+
});

darkmode_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+
};

darkmode_todolist/images/main.PNG

24.9 KB
Loading

darkmode_todolist/images/work.PNG

16.9 KB
Loading

darkmode_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)