Skip to content

Commit b4facd3

Browse files
committed
Update build-a-randomizer-generator-with-html-css-js.mdx
1 parent 00b9728 commit b4facd3

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

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

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,16 @@ CluelessGenerator/
7171

7272
HTML buttons allow users to interact with the outfit generator. These buttons control the behavior of the app, such as randomizing outfits and cycling through different images of accessories, tops, and bottoms. Here’s what each part does:
7373

74+
### Main Container
75+
76+
Below the header, add a div that wraps everything:
77+
78+
```html
79+
<div class="main-container">
80+
</div>
81+
```
82+
Everything else will go inside this container.
83+
7484
### Randomize Button:
7585

7686
<RoundedImage link="https://i.imgur.com/PL9cXAX.gif" description="" />
@@ -81,18 +91,24 @@ This button, labeled "randomize!", triggers the randomization of outfit pieces w
8191
<button class="random-button" id="random-btn">randomize!</button>
8292
```
8393

84-
### Arrow Buttons (Prev/Next)
94+
### Outfit sections
8595

86-
These buttons let the user cycle through different outfit pieces within each category (add-ons, tops, bottoms). For example, the `0prevBtn` and `0nextBtn` control the add-ons (accessories) images:
96+
Next, add three sections (Add Ons, Tops, and Bottoms), each with an image, and two arrow buttons below them (previous and next).
8797

98+
First, create the container section for Add Ons (hats and glasses):
8899
```html
89-
<div class="carousel-buttons">
90-
<button id="0prevBtn">←</button>
91-
<button id="0nextBtn">→</button>
100+
<div class="addons-container">
101+
<img id="addOns" class="addons-image" src="" alt="accessories" />
102+
<div class="carousel-buttons">
103+
<button id="0prevBtn">←</button>
104+
<button id="0nextBtn">→</button>
105+
</div>
92106
</div>
93107
```
94108

95-
Similarly, each outfit category has its own set of arrows to go backward or forward through the images.
109+
Then, follow the same format to create the Tops section and the Bottoms section. Make sure to change the `img id`, `class`, and `alt` descriptions, as well as the values of `button id`.
110+
111+
Each section has an empty image to be filled by JavaScript, uses unique IDs to match with your script later, and contains two buttons for cycling through images of the outfit pieces within each category.
96112

97113
## CSS Styling
98114

0 commit comments

Comments
 (0)