A web-based todo MVC implementation, with vanilla JavaScript and CSS.
Tested on iPhone and ipad (chrome and safari), and the result was pretty good.
Note that it can not run on PC browser because I use the event of touch, which is only supported on mobile devices.
- input the information of 1 new item and add it to the list (by return)
- list items
- delete one item (by swipe left)
- delete all completed items at one time
- complete one item
- complete all items or set all to unfinished status
- use localStorage to keep the data
- edit the information of an item (by swipe right)
- filtered the items showing in the list by conditions like 'all/active/completed'
- Seperation of Model, View and Controller
- Instead of updating view according to the model using a render function, I made controller the center, and for each operation, the controller will send command to both view and controller, and update on these two aspects seperately.
.
├── css
│ └── style.css
├── img
│ └── screenshot.png
├── index.html
├── js
│ ├── app.js
│ └── utils.js
├── package.json
└── README.md
app.js --> TodoMVC --> TodoView ------|
--> TodoModel ------|
--> TodoController <--|
Simply download the file and open it in the browser, and turn on the mobile mode of chrome DevTool.
To view it on your mobile device, like iPhone, you can run this:
npm install serve -g
serve ./
The ip address and port will be shown.
More appropriately to be called "selling and boasting"
But still not enough :3
No framework or third-party library used. Good practice :3