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: projects/build-a-randomizer-generator-with-html-css-js/build-a-randomizer-generator-with-html-css-js.mdx
+4-5Lines changed: 4 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,6 @@ tags:
11
11
- css
12
12
- javascript
13
13
- intermediate
14
-
15
14
---
16
15
17
16
<BannerImage
@@ -61,7 +60,7 @@ Let's take a look at some [starter code](https://www.codedex.io/@Julien/build/ra
61
60
62
61
If you've taken the HTML, CSS, and JavaScript courses, our web stack for this project will look familiar. We have an HTML file that links to an external CSS stylesheet and an external JavaScript file, all contained within the same folder.
63
62
64
-
```terminal
63
+
```
65
64
CluelessGenerator/
66
65
├── index.html
67
66
├── style.css
@@ -210,7 +209,7 @@ The arrow buttons (`prevBtn` and `nextBtn`) allow the user to navigate through t
210
209
211
210
When the Next button is clicked, the index for the category increases by 1, and the `updateImage()` function is called to update the displayed image.
When the Prev button is clicked, the index decreases by 1, and again, the `updateImage()` function is called. It loops back to the last image if you go backward from the first one.
category.index= (category.index-1+category.images.length) %category.images.length; // Loop to last image
225
224
updateImage(cat);
@@ -266,7 +265,7 @@ To add styling for the shoes category, follow the same pattern as for other cate
266
265
You'll also add `.shoes-image`.
267
266
### JavaScript
268
267
In JavaScript, you'll need to add a new category to the categories object. Each category includes an array of images, an index to track the current image, references to the HTML elements, and button IDs for navigation. Here's how you'll add the shoes category:
0 commit comments