Mobile todoMVC
Feature Implementation
Basic Features
Add
Todo
Users can insert a new
todo
by entering information into the Input Field at the top of the interface and hitting Enter or, on iOS devices, tapping the Return key.Delete
Todo
Users can delete a
todo
by swiping it to the left or right.Display List
The page provides instant feedback each time a user adds or removes a
todo
.Complete/Uncomplete All
Users can mark all todos as complete or incomplete by clicking the
Finish All
button at the top of the interface.Delete Completed
A
Clear completed
button appears at the bottom when sometodo
items are completed, clicking it will remove these items.Toggle
todo
Item StatusUsers can change a
todo
item’s status from incomplete to complete by clicking the checkbox to the left of an uncompletedtodo
, and vice versa.
Advanced Features
Filter (
All
,Active
,Completed
)Users can filter the current
Todo
items by selecting a filter type at the bottom.Edit a Single
todo
Users can edit a
todo
by double-clicking on it.Save Page State
The data is saved using localStorage. (Note: PUT, POST, GET, DELETE interfaces were implemented, mirroring HTTP Request Methods in a RESTful API style)
Set
todo
DeadlineA
Date Picker
next to the input field allows users to set a deadline fortodo
items. Items are arranged according to the proximity of their deadlines, and color-coding distinguishes the urgency.Set Custom Tags for
todo
When entering a
todo
, users can create a tag by typing a comma after a keyword, which automatically generates a tag distinguished by color, displayed in the list below.Text Filtering (Search + Highlight Keywords)
Users can initiate a search by typing a character sequence starting with
?
in the input field and hitting Enter. The search is case-insensitive and can locate keywords in Tags ortodo
text, with corresponding keywords highlighted.Dark Mode
The interface adapts to the browser/system’s theme color (
prefers-color-scheme
), toggling between dark and standard modes accordingly.
Design Highlights
- Custom keyword entry is intuitive (separated by commas and automatically tagged, with highlighted keywords) for spotting vital information flexibly as opposed to standard high/medium/low urgency levels.
- Text search within the
todo
list (including both text and tags) is made efficient through regular expressions, with highlighted feature words usingstring.replace()
to add highlighted<span>
for quick information location. - Both features operate within a single input box to consider the limited screen size of mobile devices, avoiding clutter and preserving user experience by not overloading the page with components.
- Swipe gestures for deletion are implemented for mobile user convenience.
- Emulating mobile app design, the bottom filters and top header are fixed for quick navigation, even when the list of todos grows.
todo
items are organized by deadline to clarify priorities.- A self-invoking function (akin to a Class) in
tags-input.js
defines tagging and text separation, with the webpage input boxes and editabletodo
items below as instances, allowing the reuse of code across components with distinct functions.
References
Tags input inspired by https://codepen.io/juliendargelos/details/MJjJZm
- The method for tag input and deletion was particularly informative.
- During implementation, the initialization process and event listeners (keyboard events and focus, blur events, etc.) were rewritten for integration.
Extensive forum consultation, including StackOverflow and stackExchange.
Feature Demonstration
Two Color Modes
(Note: Dark mode is not as well adapted, and the layout is inconsistent with light mode, so it is recommended to test in light mode on computers or phones)
Light Mode | Dark Mode |
---|---|
Input and Deletion of Tags
Input Tag | Confirm Deletion of Tag |
---|---|
Adding and Editing todo
Add todo | Edit todo |
---|---|
Deletion of todo
Swipe Left to Delete | Swipe Right to Delete |
---|---|
Two Filtering Methods (Text and Tags)
Text Filter | Tag Search |
---|---|