Skip to content

Commit

Permalink
fixes and nitpicks
Browse files Browse the repository at this point in the history
  • Loading branch information
rrcobb committed May 5, 2021
1 parent 154edd9 commit 1f2c895
Show file tree
Hide file tree
Showing 12 changed files with 75 additions and 72 deletions.
7 changes: 4 additions & 3 deletions T001-Course-Intro/p004-about-the-course.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ _Mise en place_ is French for "everything in its place". The phrase is used in c
distinguish prep work - gathering the ingredients, organizing the kitchen, chopping vegetables -
from the cooking.

For projects that allow creative freedom, we've seen that students get stuck in organizing their own
work. We're going to help you organize how you do your projects by providing a pre-project _Mise en
place_ checklist, so that you have all the 'ingredients' for your project before you start coding.
For projects that allow creative freedom, we've seen that students sometimes get stuck in organizing
their own work. We're going to help you organize how you do your projects by providing a pre-project
_Mise en place_ checklist, so that you have all the 'ingredients' for your project before you start
coding.
4 changes: 2 additions & 2 deletions T002-HTML-syntax/p003-html-recipe.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ free to add more elements to your page if you'd like - pictures, descriptions, t
- When you're done, submit through Repl.it and share your finished site in Discord and with your
friends!

## Mise-en-place
## Mise en place

Before you get started, you need to have your "ingredients" prepped and your tools organized.

Expand Down Expand Up @@ -71,7 +71,7 @@ first couple of pages, but feel free to read the whole thing if you're curious!

It's easy to get stuck - especially if this is your first time making a site in HTML.

If you are stuck, you can
If you are stuck:

- Look back at the examples from the previous page
- Ask for help in Discord
Expand Down
2 changes: 1 addition & 1 deletion T003-CSS-syntax/p001-css-intro.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ You can make the same HTML look like this:

![demo mission statement page with color, fonts, and position of elements configured](./mission-demo-with-styles.png)

CSS lets you apply _properties_ to particular HTML elements.
CSS lets you control _properties_ of HTML elements.

<FlashCard
prompt="Looking at the example, what are some properties that you think CSS lets you control?"
Expand Down
6 changes: 3 additions & 3 deletions T003-CSS-syntax/p003-css-selectors.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ The `id` selector uses the `#` character (pronounced 'hash' or 'pound'), then th

What CSS selector would you use to select the second list item?

````html
```html
<ol>
<li id="prep">10 minutes prep time</li>
<li id="bake">50 minutes bake time</li>
Expand Down Expand Up @@ -145,9 +145,9 @@ HTML.
You can combine selectors together to select elements that match all the parts. To select all the
paragraphs with `class="description"`

```css
```
p.description
````
```

You combine the `p` selector with the `.description` selector by joining them together.

Expand Down
2 changes: 1 addition & 1 deletion T003-CSS-syntax/p004-mission-statement.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ contentType: 'Project'
In this project, you'll write your mission statement and code a page from scratch using HTML and
CSS.

## Mise-en-place
## Mise en place

Before you start coding your site, you'll need to decide what you want to show on your page.

Expand Down
44 changes: 35 additions & 9 deletions T004-JS-Intro/p001-intro-to-javascript.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,48 @@ to do something with code that you think should be possible.

We encourage you to ask for help when you run into problems or questions.

## Recommended Resource: JavaScript in 14 minutes

For a quick look at some of the concepts in JavaScript, check out
[Jeremy Thomas's JavaScript in 14 minutes](https://jgthms.com/javascript-in-14-minutes/). It briefly
introduces the developer console and

## JavaScript Game Plan

There are different ways to approach JavaScript. If you've done some programming before, or feel
comfortable seeing the syntax with less context, you can <>Go to the Syntax</>.
comfortable seeing the syntax with less context, you can [jump straight to the syntax](./js-syntax).

If you'd rather see some examples of JavaScript code in action, and then learn what each part is
doing, you can <>Explore the examples</>. The examples will give you a more specific idea of what
javascript can do.
doing, you can [explore the examples](./js-examples) on the next page. The examples will give you a
more specific idea of what javascript can do.

After the syntax and examples, you'll practice what you've learned with small exercises. We'll
combine the small exercises into larger challenges integrating different concepts. Then we'll give
scoped, bounded projects where you can use your new skills in creative ways. That cycle will repeat
for a few different concepts.

## Recommended Resource: JavaScript in 14 minutes

For a quick look at some of the concepts in JavaScript, check out
[Jeremy Thomas's JavaScript in 14 minutes](https://jgthms.com/javascript-in-14-minutes/). It briefly
introduces the developer console and many of the core ideas we'll cover in the next few pages.

## Where does JavaScript run?

JavaScript runs in the browser, like HTML and CSS. But HTML and CSS _only_ run in the browser.
JavaScript _also_ runs on other platforms. It can run on a server, or in a terminal, or on an
embedded device (like a sensor or robot).

We practiced HTML and CSS in Repl.it. JavaScript works in Repl.it too, and that's where we'll focus
the practice in this course. It's also handy to experiment with JavaScript on other sites. The
Developer Console is a tool for running JavaScript in any desktop browser.

### The Developer Console

If you're using a computer with a keyboard, you can use the keyboard shortcut Shift + ⌘ + J (on
macOS) or Shift + CTRL + J (on Windows/Linux) to open the console.

You can copy and paste snippets of JavaScript into the console and press Return or Enter to run
them.

Practice now with the first example:

```js
alert('Hi there');
```

This will show an alert with the message `Hi there`.
26 changes: 0 additions & 26 deletions T004-JS-Intro/p005-js-problem-solving-debugging.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,6 @@ contentType: 'TextContent'

# JavaScript Problem Solving and Debugging

## Where can we run JavaScript?

### The Developer Console

If you're using a computer with a keyboard, you can use the keyboard shortcut Shift + ⌘ + J (on
macOS) or Shift + CTRL + J (on Windows/Linux) to open the console.

You can copy and paste snippets of JavaScript into the console and press Return or Enter to run
them.

Practice now with the first example:

```js
alert('Hi there');
```

This will show an alert with the message `Hi there`.

### Replit

When there's an embedded Repl, you can run the code by clicking the green play button.

### Code Demos

Many examples run the code in an iframe.

## Goal-driven JavaScript

Problem solving in JavaScript often starts from a goal.
Expand Down
2 changes: 1 addition & 1 deletion T005-Multi-page-sites/p005-wiki-project.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ contentType: 'TextContent'

Find a document and turn it into a multi-page site.

## Mise-en-place
## Mise en place

- Find a document
- Identify what the pages will be
Expand Down
50 changes: 26 additions & 24 deletions T006-JS-Loops-and-Functions/p005-infinite-scroll.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,42 +24,44 @@ possibilities are infinite!
- Use functions to generate content
- Add new content to the feed when the scroll reaches the bottom of the screen
- Make separate files for HTML, CSS, and JS
- Write small functions (about 3 to 10 lines) and compose them to make the overall program. There's
not a strict number of functions you have to use, but it would be surprising if you use fewer
than 5.
- Use at least two loops (in the demo, we loop in the link generator and when adding lots of content
at once)
- Write small functions (about 3 to 10 lines) and compose them to make the overall program.

Make it your own! Write content generating functions that are
There's not a strict number of functions you have to use, but it would be surprising if you use
fewer than 5.

## Mise En Place
Make it your own! Write content that makes you and your friends laugh.

## Mise en place

Before you start coding, do your prep! You can write your notes in a document or on paper - wherever
is best for you.

Here's some things you'll need in your plan:

1. What content will you generate for your site?
1. **What content will you generate for your site?**

Decide on the kind of content you're going to have in your feed. Come up with a few sample items,
either by searching for them or by writing them yourself.
Decide on the kind of content you're going to have in your feed. Come up with a few sample items,
either by searching for them or by writing them yourself.

2. Plan the content generator functions
2. **Plan the content generator functions**

Without writing the code, come up with a plan for how the functions will work. You might write
pseudocode or the big-picture steps that the code will follow to generate a new item.
Without writing the code, come up with a plan for how the functions will work. You might write
pseudocode or the big-picture steps that the code will follow to generate a new item.

3. Styles
3. **Design and Styles**

The demo site's styles are pretty simple. You can use it as a starting point, or you can take your
own approach. As much as possible, pick your design elements before you get started coding.
The demo site's styles are pretty simple. You can use it as a starting point, or you can take
your own approach. As much as possible, pick your design elements before you get started coding.

4. Plan your code
4. **Plan your code**

You've practiced adding content to the page, and you've practiced writing functions that generate
text. The other feature of this project is loading more content **when the user scrolls to the
bottom of the screen**. How do you detect that with code? There's no easy event listener to add -
the browser doesn't have a 'scrollToBottom' event. Instead, there's a handful of other approaches.
You've practiced adding content to the page, and you've practiced writing functions that generate
text. The other feature of this project is loading more content **when the user scrolls to the
bottom of the screen**. How do you detect that with code? There's no easy event listener to add -
the browser doesn't have a 'scrollToBottom' event. Instead, there's a handful of other
approaches.

Read more below about how to detect reaching the bottom of the screen.

Expand All @@ -75,8 +77,8 @@ math involved.

![screenshot of demo site, with viewport and window labeled](infinite-scroll-demo-viewport-window.png)

The 'viewport' is the section of the window that shows on the screen. The 'window' is larget than
the viewport - it's got more content, that the user can scroll to see.
The _window_ has all the content we could scroll to. The _viewport_ is the section of the window
that shows on the screen.

![screenshot of demo site scrolled down, with viewport and window labeled](infinite-scroll-viewport-window-scrolled.png)

Expand All @@ -95,13 +97,13 @@ document.documentElement.clientHeight; // how tall the viewport is
document.documentElement.scrollTop; // how far we've scrolled from the top
```

![screenshot of demo site, with scrollHeight, clientHeight, and scrollTop labeled](infinite-scroll-viewport-window-scrolled.png)
![screenshot of demo site, with scrollHeight, clientHeight, and scrollTop labeled](infinite-scroll-demo-height-properties-labeled.png)

If `scrollTop` plus `clientHeight` is greater than or equal to `scrollHeight`, then we've scrolled
to the bottom.

```js
scrollTop + clientHeight >= scrollHeight; // are scrolled to the bottom?
scrollTop + clientHeight >= scrollHeight; // scrolled to the bottom?
```

One problem. Sometimes the browser gives a fractional number for `scrollTop`, so it doesn't quite
Expand All @@ -114,7 +116,7 @@ scrollTop + clientHeight >= scrollHeight - 10; // scrolled to the bottom, with f

<Info>

There's a newer approach using a new tool called an IntersectionObserver.
There's a newer approach to this problem using a tool called an IntersectionObserver.

It's less familiar than the event listeners we've been using so far, but some of the same ideas
apply. See the
Expand Down
2 changes: 1 addition & 1 deletion T008-CSS-Layout/p005-article-layout.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ and here's a
Your article doesn't have to look exactly like this, but it should have a header, a footer, and a
column of content.

## Mise-en-place
## Mise en place

Before you get started coding, you need to organize your ingredients.

Expand Down
2 changes: 1 addition & 1 deletion T010-Remote-Data/p005-live-arrivals-and-departures.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ see in an airport terminal.

## Demo

## Mise-en-place
## Mise en place

- OpenSky Docs
- API key?
Expand Down

0 comments on commit 1f2c895

Please sign in to comment.