Web Studio Editor Reference

Web Studio ⎋ is Codecraft Works’ online Integrated Development Environment (IDE) for web projects. It supports HTML, CSS, and JavaScript. This page describes every part of the editor. If you are new to Web Studio, start with the Web Studio Quick Start.

The Web Studio editor with the toolbar at the top, the HTML, CSS, and JS code panes on the left, and the live preview of a "Our Solar System" page on the right.

Who Can Do What

What you see in the editor depends on whether the project is yours:

Your projectSomeone else's project
Open itYesOnly if it is public (Codecraft Works instructors can also open private projects)
Save changesYesNo
Change settings, upload mediaYesNo (settings are shown, but read-only)
CloneYesYes, if it is public and you are signed in
Cloud variableYesNo
ShareYes, once it is publicYes, if it is public

Anyone viewing a project can type in the code panes to try ideas out, but only the project’s owner can save those changes. To keep your own version of someone else’s project, clone it.

The Toolbar

From left to right, the toolbar shows:

Toggles

Each toggle shows or hides one part of the screen. Toggles that are turned on are highlighted in blue. At least one part of the screen must always be showing.

On narrow screens such as phones, only one part shows at a time. The project’s owner starts on Code; everyone else starts on Preview.

Buttons

Code Editor

The code editor is divided into three panes labeled HTML, CSS, and JS. Drag the bars between them to resize them, and use the Side by side / Stacked button above the panes to change how they are arranged.

The code editor includes:

Press Ctrl+1, Ctrl+2, or Ctrl+3 to jump to the HTML, CSS, or JS pane. Press Escape to move from the code back to the toolbar.

You only write the contents of your page’s <body> in the HTML pane. Web Studio adds the rest of the page, like the <head> and page title, for you.

Live Preview

The preview shows your page as a visitor would see it, and updates about once a second as you type. There is no Run or Refresh button.

If your JavaScript gets stuck in a loop that runs for too long, Web Studio pauses your JavaScript and shows the message “JavaScript is paused because a loop ran too long.” Fix the loop, then select Resume JS on the JS pane bar.

A few things behave differently in the preview than on your published page:

Console

The console sits below the preview and starts closed. Select the Console bar to open or close it. Web Studio remembers whether you left it open.

The Web Studio console open below the preview. It shows the logged message "Planets loaded: 3", the expression "facts.Mars", and its result.

Project Settings

Select the Settings toggle to open the project’s settings. Anyone can view a public project’s settings, but only the project’s owner can change them.

The Web Studio Settings view, with the Project name field, Visibility options "Public" and "Private", Lock options "Locked" and "Unlocked", and a README editor with a live preview beside it.

Select Save settings to save your changes.

Deleting a Project

To delete a project, open Settings and select Delete project. You will be asked to confirm. Deleting a project also deletes its published page, and it cannot be undone. If the Delete project button is grayed out, the project is locked; set it to Unlocked and save your settings first.

Cloud Variables

A cloud variable stores one JSON value with your project, like a high score table, a shared counter, or some saved settings. Your project’s JavaScript can read it while the project runs. Only the project’s owner can see the Cloud variable button.

The "Cloud variable" pop-up with a JSON editor and, below it, a line of code for reading the value from your project.

  1. Select Cloud variable in the toolbar.
  2. Enter a valid JSON value, such as {"highScore": 120, "player": "Maya"}.
  3. Select Save.

The pop-up shows a line of code you can copy into your JavaScript to read the value. Each cloud variable must be smaller than 1 KB. Remember that cloud variables only work on your published page, not in the live preview.