Create an online code editor for HTML, CSS and JS code snippets using HTML, CSS and JQuery. The code editor’s functionality will be similar to that of jsbin.com
Create an online code editor for HTML, CSS and JS code snippets using HTML, CSS and JQuery. The code editor’s functionality will be similar to that of jsbin.com
Online code-editor is a tool that resides on a remote server and is accessible via browsers. Some online code editors have basic features like syntax highlighting or code completion similar to text editors while others are like complete IDEs.
For any developer, be it amateur or professional, often the liberty of using a local code editor may be unavailable. As online code-editors are fast, efficient and greatly popular, it is a familiar tool among developers. If you have used one, ever wondered how it can be made? This module will guide you through the process that can be followed to build your own code-editor for HTML, CSS and JS code snippets. Implementing the project will add an immense value to your profile.
This project is a good start for beginners, a new idea for intermediates and a refreshing hobby project for professionals. It involves the basic use of all of HTML, CSS and JS languages. Reason for following this tech-stack is that these languages are easy to use and are also fast in terms of execution time.
You are free to use JavaScript instead of JQuery but it is recommended to use JQuery as it is lighter to implement.
We can segregate the product architecture based on tools used:
The desired end result of this project is like this:
Some of the applications of online code editors are:
Create an online code editor for HTML, CSS and JS code snippets using HTML, CSS and JQuery. The code editor’s functionality will be similar to that of jsbin.com
Online code-editor is a tool that resides on a remote server and is accessible via browsers. Some online code editors have basic features like syntax highlighting or code completion similar to text editors while others are like complete IDEs.
For any developer, be it amateur or professional, often the liberty of using a local code editor may be unavailable. As online code-editors are fast, efficient and greatly popular, it is a familiar tool among developers. If you have used one, ever wondered how it can be made? This module will guide you through the process that can be followed to build your own code-editor for HTML, CSS and JS code snippets. Implementing the project will add an immense value to your profile.
This project is a good start for beginners, a new idea for intermediates and a refreshing hobby project for professionals. It involves the basic use of all of HTML, CSS and JS languages. Reason for following this tech-stack is that these languages are easy to use and are also fast in terms of execution time.
You are free to use JavaScript instead of JQuery but it is recommended to use JQuery as it is lighter to implement.
We can segregate the product architecture based on tools used:
The desired end result of this project is like this:
Some of the applications of online code editors are:
First validate the idea by doing a low level implementation (Proof of Concept) of the components involved in the project.
This helps you to:
Explore various aspects of the terms mentioned in the preceding sections, like why to use JQuery instead of JavaScript (ES6), XML vs HTML, why use HTML5/CSS3 and not the other versions, etc.
In this milestone, the basic structure of the code-editor is built (excluding the core functionality) using HTML.
iframe
element (can be done later). iframe
element is used to render the desired output as a webpage within a webpage.Since only HTML has been used, the site should look something like this-
Now that we have the basic skeleton ready, we can start our styling process. Needless to mention this is an iterative process as styling is dynamic to features and addition/removal of features does affect overall styling.
After implementing the styling (using CSS) and importing the stylesheet in the main HTML file, the site should look something like this (but keep improving the styling) -
Let's code the cool features now. The basic features to be implemented are the following:
iframe
element.var windowHeight = /* Use .height() method for window-class selector */;
var headerBarHeight = /* Use .height() method for header-class selector */;
var codeContainerHeight = /* TODO */;
$(".codeContainer").height(/* Give the height's value along with units */);
$(".toggle").click(function() {
$(this).toggleClass(/* Use an appropriate class name */);
var activeDiv = /* use .HTML() method on 'this' constructor reference */;
$(/* Logic to have a general class name */).toggle(500);
var showingDivs = /* use .filter() and then .css() for this logic */
console.log(showingDivs);
var width = 100/showingDivs;
/* Assign codeContainer it's width */
iframe
element). Using this you can insert HTML code. Basically you need to collect all the codes for the three code containers and form an HTML page containing the styling (CSS code input) and scripting (JS code input) and finally render the webpage of this new temporary HTML page made in a fourth container(the result container). This ‘new’ HTML page created is often referred to as Source Document or srcDoc
.$("#run").on( /* Event */, function() {
$("iframe")./* TODO */
/* Implement the 'run' logic command */
})
iframe
elementiframe
elementCheck if the code editor works as expected. At this point, the styling of the app may not be as intended. If that is the case, refer to milestone 3 again and do the necessary changes. Check out the status of all the features you have implemented; at the same time the style should be dynamic to all features.
Your final code-editor should function as shown in the demo below. Do keep improving your code-editor once this stage has been reached.
Finish your work in complete style.
Since this is a simple Javascript application, go one step further by using GitHub pages to host your app live (simplest way).
Share this link among your peers and add this project (with the link and proper documentation) to your resume and voila, you have just boosted your resume.