Please install Node.Js for this project to run
This app utilizes virtual scrolling to efficiently load and display large text files. It also includes features for text searching, highlighting, and jumping to specific occurrences of the search term.
Use the following command in the terminal:
git clone https://github.com/mpduyanh/infinite-scroll-library.git-
Frontend Initialization:
- Navigate to the
infiniteScrollLibdirectory. - Run
npm installto install all necessary dependencies for the frontend. - Run
npm run devto start the frontend server.
- Navigate to the
-
Backend Initialization:
- Navigate to the
flask-serverdirectory. - Activate the virtual environment by running
source venv/bin/activate. - Run
pip3 install Flaskto run a Flask server locally. - Run
pip3 install Flask-Corsto install Flask Cors library in order to establish connection with the frontend. - Run
python3 server.pyto start the backend server.
- Navigate to the
- Locate the
staticfolder in theflask-serverdirectory. - Add your desired text file to the
staticfolder. - In the
server.pyfile, locate thegetfilesfunction. - In the
with openoperation within thegetfilesfunction, change the file path to match your text file. - Reload the localhost site to view the updated text.
- Infinite Scrolling: Allows users to scroll through large text files smoothly.
- Text Searching: Users can search for specific words or phrases within the text.
- Text Highlighting: Highlights the searched text within the viewport.
- Jumping to Text: Provides buttons to jump to the next or previous occurrence of the searched text within the viewport.