You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Week1/MAKEME.md
+13-15Lines changed: 13 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ Before we head into the exercises, it might be nice to do some interactive exerc
15
15
16
16
## **2. JavaScript exercises**
17
17
18
-
> Inside of your `JavaScript2` fork, create a folder called `week1`. Inside of that folder, create a folder called `js-exercises`. For all the following exercises create a new `.js`file in that folder (5 files in total). Make sure the name of each file reflects its content: for example, the filename for exercise one could be `bookList.js`.
18
+
> Inside of your `JavaScript2` fork, find the folder called `Week1`. Inside of that folder, find the folder called `js-exercises`. In this folder you will find five `.js`files (sometimes with a matching `.html` file), one for each exercise where you need to write your code. Please use the correct file for the respective exercise.
Start with this HTML and save it as "about_me.html":
55
+
Given this HTML:
56
56
57
57
```html
58
58
<!DOCTYPE html>
@@ -86,16 +86,15 @@ No homepage is safe from the logo bandit! Everytime he sees a Google Logo he rep
86
86
87
87
In this exercise you're expected to write a JavaScript function that can be executed in the console of the [Google website](https://www.google.com).
88
88
89
-
1. Inside a JavaScript file, called `hijackGoogleLogo.js`, create a function called hijackGoogleLogo
90
-
2. Find out how to select the element that contains the Google logo, and store it in a variable
91
-
3. Modify the source and sourceset of the logo so that it's replaced by the HackYourFuture logo instead
89
+
1. Find out how to select the element that contains the Google logo, and store it in a variable
90
+
2. Modify the source and sourceset of the logo so that it's replaced by the HackYourFuture logo instead
92
91
93
92
**Exercise 4: What's the time?**
94
93
95
94
Why wear a watch when you can check the time, live in your webpage?
96
95
97
-
1. Create an empty HTML file, called `time.html`
98
-
2.Create a JavaScript file called `showCurrentTime.js`and include it in the HTML file
96
+
1. Create a basic HTML file
97
+
2.Include a script tag and link the JavaScript file
99
98
3. Inside the JS file, write a function that adds the current time to the webpage. Make sure it's written in the HH:MM:SS notation (hour, minute, second). Hint: use `setInterval()` to make sure the time stays current
100
99
4. Have the function execute when it's loading in the browser
101
100
@@ -116,13 +115,12 @@ Start with this webpage, which has a single img tag of an animated GIF of a cat
116
115
</html>
117
116
```
118
117
119
-
1. Add a script tag at the bottom of the page, where you'll put all your code.
120
-
2. Create a variable to store a reference to the img.
121
-
3. Change the style of the img to have a "left" of "0px", so that it starts at the left hand of the screens.
122
-
4. Create a function called catWalk() that moves the cat 10 pixels to the right of where it started, by changing the "left" style property.
123
-
5. Call that function every 50 milliseconds. Your cat should now be moving across the screen from left to right. Hurrah!
124
-
6. When the cat reaches the right-hand of the screen, restart them at the left hand side ("0px"). So they should keep walking from left to right across the screen, forever and ever.
125
-
7. When the cat reaches the middle of the screen, replace the img with an image of a cat dancing (use this URL: https://tenor.com/StFI.gif), keep it dancing for 5 seconds, and then replace the img with the original image and have it continue the walk.
118
+
1. Create a variable to store a reference to the img.
119
+
2. Change the style of the img to have a "left" of "0px", so that it starts at the left hand of the screens.
120
+
3. Create a function called catWalk() that moves the cat 10 pixels to the right of where it started, by changing the "left" style property.
121
+
4. Call that function every 50 milliseconds. Your cat should now be moving across the screen from left to right. Hurrah!
122
+
5. When the cat reaches the right-hand of the screen, restart them at the left hand side ("0px"). So they should keep walking from left to right across the screen, forever and ever.
123
+
6. When the cat reaches the middle of the screen, replace the img with an image of a cat dancing (use this URL: https://tenor.com/StFI.gif), keep it dancing for 5 seconds, and then replace the img with the original image and have it continue the walk.
126
124
127
125
## **3. Code along**
128
126
@@ -136,7 +134,7 @@ Enjoy!
136
134
137
135
> Every week ends with a project you have to build on your own. Instead of getting clear-cut instructions, you'll get a list of criteria that your project needs to measure up to.
138
136
139
-
> Before you start, create a new folder called `project` that includes the files for the following app you'll be building.
137
+
> Write the project code in the folder `Week1 \ project`.
140
138
141
139
In this week's project you'll be making a Random Quote Generator! It includes a text box and a simple button that, when clicked, take a random quote out of a set amount of quotes and show it in the page. Here's how it should look:
No homepage is safe from the logo bandit!Everytime he sees a Google Logo he replaces it with a logo from HackYourfuture instead: https: //www.hackyourfuture.dk/static/logo-dark.svg.
6
+
7
+
In this exercise you 're expected to write a JavaScript function that can be executed in the console of the [Google website](https://www.google.com).
8
+
9
+
10
+
1. Find out how to select the element that contains the Google logo, and store it in a variable.
11
+
2. Modify the source and sourceset of the logo so that it 's replaced by the HackYourFuture logo instead.
Why wear a watch when you can check the time, live in your webpage ?
6
+
7
+
1. Create a basic HTML file
8
+
2. in the HTML file Include a script tag and link the JavaScript file
9
+
3. Inside the JS file, write a function that adds the current time to the webpage. Make sure it 's written in the HH:MM:ss notation (hour, minute, second). Hint: use `setInterval()` to make sure the time stays current
10
+
4. Have the function execute when it 's loading in the browser
Starting with an HTML, which has a single img tag of an animated GIF of a cat walking.
5
+
6
+
1. Create a variable to store a reference to the img.
7
+
2. Change the style of the img to have a "left" of "0px", so that it starts at the left hand of the screens.
8
+
3. Create a function called catWalk() that moves the cat 10 pixels to the right of where it started, by changing the "left" style property.
9
+
4. Call that function every 50 milliseconds.Your cat should now be moving across the screen from left to right.Hurrah!
10
+
5. When the cat reaches the right - hand of the screen, restart them at the left hand side("0px").So they should keep walking from left to right across the screen, forever and ever.
11
+
6. When the cat reaches the middle of the screen, replace the img with an image of a cat dancing(use this URL: https: //tenor.com/StFI.gif), keep it dancing for 5 seconds, and then replace the img with the original image and have it continue the walk.
0 commit comments