|
| 1 | +# Intro to JavaScript |
| 2 | + |
| 3 | +<img width="300" src="assets/logo.png" /> |
| 4 | + |
| 5 | +An introductory ES6 workshop for beginners. |
| 6 | + |
| 7 | +## Getting Started |
| 8 | + |
| 9 | +If you are familiar with Git, you can clone this repository to your machine. |
| 10 | + |
| 11 | +If you don't know what Git is, relax. You can easily download the folder on your machine - go to green `Clone or download` button in the top right corner and click `Download Zip`. |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | +Unzip (extract) and open the folder, don't open files inside the .zip. |
| 16 | + |
| 17 | +Start from the `README.md` file, then read the `Getting Started` section to begin. |
| 18 | + |
| 19 | +To see the web-page in your browser, open `muses-code-website/index.html` by double clicking on it; if you see an option to 'open in browser' then choose that. Preferably use Chrome, but Firefox and Safari will work as well. |
| 20 | + |
| 21 | +Follow the instructions given in each step and type code in your text editor (this is where your code lives and you can write, edit and delete code). |
| 22 | + |
| 23 | +In order to see anything that you edit, you need to save the file and refresh the web page. The result of any `console.log()` statement will be in the _browser console_. |
| 24 | + |
| 25 | +### How to open the `Browser Console` |
| 26 | + |
| 27 | +| Browser | Platform | Instruction | |
| 28 | +| --- | --- | --- | |
| 29 | +| **Chrome** | Any | right-click the page and select `Inspect`, switch to `Console` tab in the developer tools | |
| 30 | +| **Chrome** | Mac | press `COMMAND + OPTION + J` | |
| 31 | +| **Chrome** | Windows | press `CONTROL + SHIFT + J` | |
| 32 | +| **Firefox** | Any | right-click the page and select `Inspect Element`, switch to `Console` tab | |
| 33 | +| **Firefox** | Mac | press `COMMAND + OPTION + K` | |
| 34 | +| **Firefox** | Windows | press `CONTROL + SHIFT + K` | |
| 35 | +| **Safari** | Mac | go to the menu bar and open `Safari > Preferences > Advanced >` and tick the box `Show Develop Menu` at the bottom, restart Safari, now you can right-click on the page and select `Inspect Element` to see the console. | |
| 36 | +| **Safari** | Mac | press `COMMAND + OPTION + C` | |
| 37 | + |
| 38 | +The console/developer tools will appear at the bottom or on the right side of the screen. |
| 39 | + |
| 40 | +You can write JavaScript code directly into the browser console and see the result straight away, but as soon as you refresh the page all the code will be gone, this is why we use a text editor in order to save our code. |
| 41 | + |
| 42 | +## Structure |
| 43 | + |
| 44 | +Inside this project you will find the `muses-code-website` folder. We will be editing the contents of this folder during the workshop. In the folder you will see three files: |
| 45 | +- `index.html` - a file that is responsible for the structure of our project |
| 46 | +- `style.css` - a file that is responsible for styles and how our project looks on the web |
| 47 | +- `script.js` - a file that makes our project work, it defines content and makes a static page functional |
| 48 | + |
| 49 | +We will be making changes to the `script.js` file. |
| 50 | + |
| 51 | +Our project also contains: |
| 52 | +- `README.md` - a file with explanations and any information about the project, how to run it, what it is for etc |
| 53 | +- `cheat-sheet.md` - a file with a quick overlook for key namings and their explanations |
| 54 | + |
| 55 | + |
| 56 | +🚦 Ready? Set. Go! |
| 57 | + |
| 58 | +### To run locally |
| 59 | +Unless you want to run the [Intro to JS tutorial](https://muses-code-js.github.io/intro-to-es6-melbourne/) locally instead of online version to make changes to it, you do not need to follow the steps below to do the workshop. |
| 60 | + |
| 61 | +1. [Install Ruby v2](https://www.ruby-lang.org/en/documentation/installation/) if you don't already have it. |
| 62 | + |
| 63 | +2. Install bundler: |
| 64 | + ``` |
| 65 | + gem install bundler |
| 66 | + ``` |
| 67 | +3. Install Ruby dependencies: |
| 68 | + ``` |
| 69 | + bundle install |
| 70 | + ``` |
| 71 | +
|
| 72 | +4. Then, run Jekyll command to serve the website locally on http://127.0.0.1:4000: |
| 73 | + ``` |
| 74 | + bundle exec jekyll serve |
| 75 | + ``` |
0 commit comments