Skip to content

Commit df570d9

Browse files
committed
Update build-a-randomizer-generator-with-html-css-js.mdx
1 parent 6d5559d commit df570d9

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

projects/build-a-randomizer-generator-with-html-css-js/build-a-randomizer-generator-with-html-css-js.mdx

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Build a Randomizer Generator with HTML/CSS/JS
2+
title: Build an Avatar Generator with HTML, CSS, JavaScript
33
author: Julien Kris
44
uid: Jps14SaCwqgdbbnYvoMpvMKv92P2
55
datePublished: 2025-05-09
@@ -20,7 +20,7 @@ tags:
2020
cl="for-sidebar"
2121
/>
2222

23-
# Build a Randomizer Generator with HTML, CSS, and JavaScript
23+
# Build an Avatar Generator with HTML, CSS, JavaScript
2424

2525
<AuthorAvatar
2626
author_name="Julien Kris"
@@ -36,29 +36,26 @@ tags:
3636
/>
3737

3838
**Prerequisites:** HTML, CSS, JavaScript fundamentals
39-
**Versions:** None
4039
**Read Time:** 45 minutes
4140

4241
# Introduction
4342

44-
Are you familiar with Cher's closet from [Clueless](https://en.wikipedia.org/wiki/Clueless)?
43+
Are you familiar with Cher's closet from [Clueless](https://en.wikipedia.org/wiki/Clueless) or the randomize button in a game's character creator?
4544

4645
<RoundedImage link="https://i.imgur.com/TYmiJnX.gif" description="" />
4746

48-
It's an example of a randomizer generator! In Clueless, Cher used it to plan outfits by swiping through a catalogue of her entire wardrobe.
47+
These are both examples of randomizer generators! In Clueless, Cher used it to plan outfits by swiping through a catalogue of her entire wardrobe.
4948

5049
There are other types of cool generators out there in games, movies, and TV shows. We can use the same logic to design monsters or even avatars.
5150

5251
<RoundedImage link="https://i.imgur.com/jkgf7of.gif" description="" />
53-
…how many hours of BG3 do you think we've played? ⚔️
52+
…how many hours of Baldur's Gate 3 do you think we've played? ⚔️
5453

55-
Today, we'll be learning how to use HTML, CSS, and vanilla JavaScript to build our own Randomizer Generator.
54+
Today, we'll be learning how to use HTML, CSS, and vanilla JavaScript to build our own Random Generator.
5655

5756
## Code Structure
5857

59-
Let's take a look at some [starter code](https://www.codedex.io/@Julien/build/randomizer-starter-code) and some [final code](https://www.codedex.io/@Julien/build/randomizer-generator-final-code). We'll be learning how to get from point A to point B.
60-
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.
58+
Let's take a look at some [starter code](https://www.codedex.io/@Julien/build/randomizer-generator-starter-code). 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.
6259

6360
```
6461
CluelessGenerator/
@@ -87,8 +84,8 @@ This button, labeled "randomize!", triggers the randomization of outfit pieces w
8784

8885
```html
8986
<div class="carousel-buttons">
90-
<button id="0prevBtn"><--</button>
91-
<button id="0nextBtn">--></button>
87+
<button id="0prevBtn">⬅️</button>
88+
<button id="0nextBtn">➡️</button>
9289
</div>
9390
```
9491

@@ -197,7 +194,7 @@ updateImage(cat);
197194
```
198195
This shows the new image on screen using the category’s updated index.
199196
200-
Finally, we'll connect the real randomize() function to the button:
197+
Finally, we'll connect the real `randomize()` function to the button:
201198
202199
```js
203200
document.getElementById("random-btn").addEventListener("click", randomize);
@@ -225,7 +222,7 @@ document.getElementById(category.prevBtn).addEventListener("click", () => {
225222
});
226223
```
227224
228-
The modulo (%) operator is used here to make the images cycle in a continuous loop.
225+
The `%` modulo operator is used here to make the images cycle in a continuous loop.
229226
230227
## Avatar Creator
231228
@@ -292,6 +289,8 @@ If you've already added a fourth section, try making a feature that toggles a po
292289
293290
Congrats! You've built your own generator! Now you're equipped with the skills to build on this concept and create other kinds of generative projects!
294291
292+
Here's our [final code](https://www.codedex.io/@Julien/build/randomizer-generator-final-code).
293+
295294
## Additional Resources
296295
297296
- [90's Fashion Nova Holiday Hackathon Project by Ciera](https://www.codedex.io/community/hackathon/OSlnGKjR7MWDaIRgvNdD)

0 commit comments

Comments
 (0)