File tree Expand file tree Collapse file tree 13 files changed +854
-0
lines changed Expand file tree Collapse file tree 13 files changed +854
-0
lines changed Original file line number Diff line number Diff line change
1
+ .DS_Store
2
+ node_modules /
Original file line number Diff line number Diff line change
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 " />
Original file line number Diff line number Diff line change
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
+ } ) ;
Original file line number Diff line number Diff line change
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
+ } ;
Original file line number Diff line number Diff line change
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 >
You can’t perform that action at this time.
0 commit comments