Live Editor is a web-based tool that allows you to preview HTML, CSS, and JavaScript code live in your browser in real-time. This editor provides a futuristic design and easy-to-use interface, making it a great tool for web developers to test and visualize their code instantly.
- Real-time Preview: See your HTML, CSS, and JavaScript code rendered live as you type.
- Template Examples: Load predefined templates for HTML, CSS, and JavaScript to kickstart your project.
- Clear Button: Clear all code inputs with a single click.
- Auto-Save: Automatically save your work in session storage to prevent data loss.
- Mobile Friendly: Responsive design for use on different devices.
To run this project locally, follow these steps:
-
Clone the repository:
git clone https://github.com/CodeAstralIzaX/live-editor.git
-
Navigate to the project directory:
cd live-editor -
Open
index.htmlin your browser: You can simply double-click onindex.htmlor serve it using a local server.
- Click the
Examplebutton to load predefined templates for HTML, CSS, and JavaScript.
- Click the
Clearbutton to clear all code inputs.
- Write your HTML, CSS, and JavaScript code in their respective textareas.
- The live preview will automatically update as you type.
live-editor/ ├── css/ │ └── global.css # Main stylesheet for the editor ├── js/ │ ├── jquery.min.js # jQuery library │ └── editor.js # Main JavaScript for handling editor functionality ├── img/ │ └── ico/ │ ├── apple-touch-icon-114-precomposed.png │ ├── apple-touch-icon-144-precomposed.png │ ├── apple-touch-icon-57-precomposed.png │ ├── apple-touch-icon-72-precomposed.png │ ├── favicon.png │ └── thumb.png ├── index.html # Main HTML file ├── README.md # Project README file
Here’s a brief overview of the CSS styles used in the project:
- Futuristic Design: The editor uses a dark theme with neon-like accents for a modern look.
- Responsive Layout: The layout adjusts for mobile devices with a columnar arrangement.
- Hover Effects: Buttons and links have hover effects for better user interaction.
The editor includes a set of predefined templates that can be loaded by clicking the Example button. These templates include common HTML structures with corresponding CSS and JavaScript.
The editor updates the preview pane in real-time as you type in the HTML, CSS, and JavaScript textareas. This is achieved using the onkeyup event listener that triggers the updatePreview function.
The editor saves the current state of your code in the browser’s session storage, ensuring that your work is not lost if the page is accidentally refreshed or closed.
If you would like to contribute to this project, please follow these steps:
- Fork the repository.
- Create a new branch:
git checkout -b feature-branch
- Make your changes and commit them:
git commit -m 'Add some feature' - Push to the branch:
git push origin feature-branch
- Submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for more details.
- jQuery: For simplifying DOM manipulation and event handling.
- Google Fonts: For the 'Roboto Mono' font used in the project.
- Favicon and Icons: From various sources for a cohesive design.
- Author: Prem Kumar E
- GitHub: CodeAstralIzaX
Feel free to reach out if you have any questions or suggestions!