Diff App is a web application that allows you to compare two pieces of text and highlight the differences between them. It provides a simple and intuitive interface for visualizing changes at the character, word, or line level.
- Compare text at the character, word, or line level
- Highlight added, removed, or modified text
- Display the total number of characters and words for each input box
- Responsive design for optimal viewing on different devices
- Engaging placeholder text that tells a story about how diff works
As a writer, I often find myself making changes to articles and documents. Keeping track of these changes can be challenging, especially when collaborating with others or revisiting a piece of writing after some time. I created Diff App to help me better track my changes and visually compare different versions of my articles. It has become an essential tool in my writing workflow, allowing me to easily identify and review modifications.
- HTML
- CSS (Tailwind CSS)
- JavaScript
- Vite (build tool)
- diff library (for comparing text)
To run the Diff App locally, follow these steps:
-
Clone the repository:
git clone https://github.com/llegomark/diff-app.git
-
Navigate to the project directory:
cd diff-app
-
Install the dependencies:
npm install
-
Start the development server:
npm run dev
-
Open your browser and visit
https://localhost:3000
to see the Diff App in action.
- Enter the original text in the left input box.
- Enter the modified text in the right input box.
- Select the desired diff level (characters, words, or lines) using the radio buttons.
- The differences between the two pieces of text will be highlighted in the result box.
- The total number of characters and words for each input box will be displayed below the respective input box.
- Implement keyboard navigation support for radio buttons
- Ensure input boxes and diff result section are focusable and keyboard-accessible
- Add keyboard shortcuts for common actions (e.g., copying diff result, resetting input)
- Conduct thorough accessibility testing with screen readers and keyboard navigation
- Provide detailed instructions or a help section for using the app with assistive technologies
- Optimize layout for smaller screens (adjust font sizes, padding, margins)
- Use a responsive grid system or CSS flexbox for a more flexible layout
- Allow customization of diff highlighting colors for added, removed, and unchanged text
- Provide options to toggle line numbers or display a side-by-side diff view
- Add a settings panel or menu to control customization options
- Implement file upload feature for comparing text files
- Add a "Download Diff" button to generate a downloadable file with the diff result
- Display statistics about the diff (number of added, removed, and unchanged lines/words)
- Calculate and show the percentage of similarity between the input texts
- Implement undo/redo feature for changes made to the input boxes
- Keep track of edit history and provide buttons or shortcuts to navigate undo/redo stack
- Enhance diff result with syntax highlighting based on language or format of input text
- Integrate a syntax highlighting library or use a syntax highlighting service
- Implement lazy loading for additional libraries or resources
- Optimize diff algorithm or explore alternative diff libraries for handling large input texts
- Minimize DOM manipulations and consider using virtual DOM techniques for faster rendering
- Display user-friendly error messages or notifications for issues with input or diff processing
- Provide a feedback mechanism for users to report bugs, suggest improvements, or seek assistance
- Update README.md with detailed installation, usage, and configuration instructions
- Add contributing guidelines and code of conduct for potential contributors
- Include screenshots or GIFs showcasing the app's features and functionality
- Implement unit tests for critical functions and components
- Write end-to-end tests to ensure the app works as expected
- Set up continuous integration and continuous deployment (CI/CD) pipelines
- Prepare the app for production deployment
- Configure necessary build tools and optimizations
- Set up hosting and deployment infrastructure
- Ensure the app is deployed securely and efficiently
- Regularly update dependencies and libraries to their latest stable versions
- Monitor and address any reported bugs or issues
- Plan and implement future enhancements and features based on user feedback and requirements
Contributions are welcome! If you have any ideas, suggestions, or bug reports, please open an issue or submit a pull request. Make sure to follow the existing code style and conventions.
This project is licensed under the MIT License.