Skip to content

Commit c213835

Browse files
authored
Merge pull request #497 from uclaacm/jenna/blogs
fix blog images and re-add all blogs
2 parents 8a089b4 + 7f9f76f commit c213835

File tree

34 files changed

+2783
-2377
lines changed

34 files changed

+2783
-2377
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"react-router-dom": "^6.26.2",
2828
"react-slick": "^0.30.2",
2929
"react-snow-overlay": "^1.0.12",
30+
"rehype-raw": "^7.0.0",
3031
"slick-carousel": "^1.8.1"
3132
},
3233
"devDependencies": {
Binary file not shown.

public/blogPosts/fall2018/hackschool-session-1/index.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#### By Kristie Lim and Prateek Singh
88

99
**Location**: Covel 227
10+
1011
**Time**: 6-8pm
1112

1213
**Teachers**
@@ -57,25 +58,25 @@ Get [Atom](https://atom.io/).
5758

5859
Let's say Tim made this fantastic webpage that he wants to share with the world.
5960

60-
![Hello World](/src/data/blogPosts/fall2018/hackschool-session-1/images/helloworld.png)
61+
![Hello World](/blogPosts/fall2018/hackschool-session-1/images/helloworld.png)
6162

6263
So he puts the code for his webpage on a computer that's always running. This computer can **serve** your page whenever a **client** computer requests it. An example of a client in this situation could be your personal laptop, and an example of a server in this situation could be an AWS server in Arizona.
6364

64-
![IP Address](./images/ipaddress.png)
65+
![IP Address](/blogPosts/fall2018/hackschool-session-1/images/ipaddress.png)
6566

6667
How does your laptop know which server to ask for the webpage from? All computers have an address called an IP address. Think of it as a mailing address for computer. Each **domain name** (for example, helloworld.com) corresponds to an IP address to a server. So when you type in a [domain name](https://dyn.com/blog/dns-why-its-important-how-it-works/) from your computer, you are making a request to a server with that corresponding address.
6768

68-
<img src="./images/hiidlike.png" height="300">
69-
<img src="./images/yanoprobs.png" height="300">
69+
<img src="/blogPosts/fall2018/hackschool-session-1/images/hiidlike.png" height="300">
70+
<img src="/blogPosts/fall2018/hackschool-session-1/images/yanoprobs.png" height="300">
7071

7172
> These not actually the words computers use to communicate. The words that computers actually use to communicate is called a "protocol," and the protocol that web browsers and servers use to communicate is called HTTP or [HyperText Transfer Protocol](https://www.lifewire.com/hypertext-transfer-protocol-817944).
7273
7374
After all of this, you can view the web page on your computer through a browser like Google Chrome.
7475

7576
In fact we can see this in action using Google Chrome! If you right click on a webpage and select "Inspect," you open Chrome developer tools.
76-
<img src="./images/inspect.png" height="300">
77+
<img src="/blogPosts/fall2018/hackschool-session-1/images/inspect.png" height="300">
7778
Then navigate to the "Network" tab and hit refresh. All the files that you see have been delivered by the server through the network to the client. Notice in particular the different file types. We'll be learning more about the code in the documents, stylesheets, and scripts that you see here.
78-
<img src="./images/network.png" height="300">
79+
<img src="/blogPosts/fall2018/hackschool-session-1/images/network.png" height="300">
7980

8081
For more about what happens when you type a URL in the browser, check out this [article](https://medium.com/@maneesha.wijesinghe1/what-happens-when-you-type-an-url-in-the-browser-and-press-enter-bb0aa2449c1a).
8182

@@ -278,7 +279,7 @@ Then in `style.css`, add the following:
278279
}
279280
```
280281

281-
<img src="./images/class.png" height="300">
282+
<img src="/blogPosts/fall2018/hackschool-session-1/images/class.png" height="300">
282283

283284
Now let's say that we want the very last header to be special and have its own style. We can identify a single element with the `id` attribute. In `index.html`:
284285

@@ -299,7 +300,7 @@ Then in `style.css`, add the following:
299300

300301
Notice that in CSS, ids begin with a `#` and classes begin with a `.`. Also notice that the style for the id overrides the style for the class. This is part of the "cascading" nature of "cascading style sheets". The difference between a class and an id is that an id should identify just a single element.
301302

302-
<img src="./images/id.png" height="300">
303+
<img src="/blogPosts/fall2018/hackschool-session-1/images/id.png" height="300">
303304

304305
Next up is a cool animation thing and more fonts because the default ones are boring. (And here at Hackschool, we like to keep things fun and fresh!)
305306

@@ -322,16 +323,16 @@ Now that the animation has been defined, you can use the property `animation`! L
322323
```
323324
This means that we give this element an animation that lasts 4 seconds (0% is at 0 seconds, 50% is at 2 seconds, 100% is at 4 seconds), has a speed function of `ease` (read more [here](https://developer.mozilla.org/en-US/docs/Web/CSS/transition-timing-function)), and repeats infinitely.
324325

325-
<img src="./images/animation.png" height="300">
326+
<img src="/blogPosts/fall2018/hackschool-session-1/images/animation.png" height="300">
326327

327328
Next we're going to unlock a world of possibilities in fonts with how to use Google fonts! First, search up [Google Fonts](https://fonts.google.com/). Pick a font! Any font!
328329

329330
Click the "+" button for the font you have chosen. Then click the black bar in the bottom left and follow the instructions. You will need to add the first snippet to `index.html` and the second snippet in `style.css`.
330331

331-
<img src="./images/googlefonts1.png" height="300">
332-
<img src="./images/googlefonts2.png" height="300">
332+
<img src="/blogPosts/fall2018/hackschool-session-1/images/googlefonts1.png" height="300">
333+
<img src="/blogPosts/fall2018/hackschool-session-1/images/googlefonts2.png" height="300">
333334

334-
<img src="./images/fonts.png" height="300">
335+
<img src="/blogPosts/fall2018/hackschool-session-1/images/fonts.png" height="300">
335336

336337
Try the following on your own!
337338

@@ -394,7 +395,7 @@ The DOM is a representation of the page as an object.
394395

395396
Huh? This looks just like HTML. HTML also represents what the page should look like, but it is the source and not the actual DOM. Once you display your page in the browser, you can’t change the HTML source code anymore but you can change the DOM. Let's change some text on the screen using Chrome's Inspect Element. First click the box with a cursor in the upper left corner or use the shortcut Cmd+Shift+C. Then click the element on the page that you want to change. Lastly double click the highlighted and type something out. Your DOM manipulation should show up on the page.
396397

397-
![DOM Manipulation](./images/dommanipulation.png)
398+
![DOM Manipulation](/blogPosts/fall2018/hackschool-session-1/images/dommanipulation.png)
398399

399400
If we refresh, the changes will disappear. This is because we changed the DOM but not the HTML source code. Once we refresh, we reload a fresh copy of the source.
400401

@@ -406,7 +407,7 @@ So that’s cool and all, good for showing your parents your grades and making o
406407

407408
In the console of Chrome developer tools, we can run JavaScript! The console allows you to print the value of variables. `document` is a variable that represents the DOM. The function `getElementById` allows you to get a particular element from the DOM based on its id. The attribute `onclick` of an element can be set to a function that determines what happens when the element is clicked. The attribute `innerHTML` refers to the text between the tags of an element. In this case, we're setting the `onclick` attribute to a function that sets the element with id 'acm-title' to have the text of 'Secret message.'
408409

409-
![JavaScript](./images/javascript.png)
410+
![JavaScript](/blogPosts/fall2018/hackschool-session-1/images/javascript.png)
410411

411412
These may be new and confusing concepts that we will cover much more throughout Hackschool, but the key takeaway here is to see what JavaScript looks like and how it can be used to programmatically change a webpage. Read more about JavaScript [here](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/First_steps/What_is_JavaScript)
412413

@@ -441,7 +442,7 @@ document.getElementById('last').onclick = () => {
441442

442443
As a review, let's take a look again at the network tab of Chrome developer tools.
443444

444-
<img src="./images/networkagain.png" height="300">
445+
<img src="/blogPosts/fall2018/hackschool-session-1/images/networkagain.png" height="300">
445446

446447
If you look at some of the file types, you'll notice documents, stylesheets, and scripts--all of which we just learned about!
447448

0 commit comments

Comments
 (0)