Skip to content

Commit af13a79

Browse files
alaa-yahiajdwilkin4Dario-DC
authored
feat(curriculum): add Build a Bookstore Page Workshop to FSD cert (freeCodeCamp#62723)
Co-authored-by: Jessica Wilkins <67210629+jdwilkin4@users.noreply.github.com> Co-authored-by: Dario <105294544+Dario-DC@users.noreply.github.com>
1 parent 930b09a commit af13a79

20 files changed

Lines changed: 918 additions & 0 deletions

client/i18n/locales/english/intro.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2087,6 +2087,12 @@
20872087
"In these lessons, you will learn about HTML fundamentals like the <code>div</code> element, the <code>id</code> and <code>class</code> attributes, the HTML boilerplate, HTML entities, and more."
20882088
]
20892089
},
2090+
"workshop-bookstore-page": {
2091+
"title": "Build a Bookstore Page",
2092+
"intro": [
2093+
"In this workshop, you will practice working with classes, ids and the <code>div</code> element by building a bookstore page."
2094+
]
2095+
},
20902096
"lecture-understanding-how-html-affects-seo": {
20912097
"title": "Understanding How HTML Affects SEO",
20922098
"intro": [
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: Introduction to the Build a Bookstore Page
3+
block: workshop-bookstore-page
4+
superBlock: full-stack-developer
5+
---
6+
7+
## Introduction to the Build a Bookstore Page
8+
9+
In this workshop, you will practice working with classes, ids and the <code>div</code> element by building a bookstore page.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
id: 68e97fe79367ad7b5dd6c9cd
3+
title: Step 1
4+
challengeType: 0
5+
dashedName: step-1
6+
demoType: onLoad
7+
---
8+
9+
# --description--
10+
11+
In this workshop, you will build a bookstore page by creating book cards that display information about different books. You'll practice organizing content using `div` elements, classes, and IDs.
12+
13+
Start by adding an `h1` element with the text `XYZ Bookstore`.
14+
15+
# --hints--
16+
17+
You should have an `h1` element.
18+
19+
```js
20+
assert.exists(document.querySelector('h1'));
21+
```
22+
23+
Your `h1` element's text should be `XYZ Bookstore`. Double check for spelling or capitalization errors.
24+
25+
```js
26+
assert.equal(document.querySelector('h1')?.innerText.trim(), 'XYZ Bookstore');
27+
```
28+
29+
# --seed--
30+
31+
## --seed-contents--
32+
33+
```html
34+
--fcc-editable-region--
35+
36+
--fcc-editable-region--
37+
```
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
id: 68ebdbacdd3fa474132cc975
3+
title: Step 2
4+
challengeType: 0
5+
dashedName: step-2
6+
---
7+
8+
# --description--
9+
10+
Below the `h1` element, add a `p` element with this text: `Browse our collection of amazing books!`.
11+
12+
# --hints--
13+
14+
You should have a `p` element.
15+
16+
```js
17+
assert.exists(document.querySelector('p'));
18+
```
19+
20+
Your `p` element's text should be: `Browse our collection of amazing books!`.
21+
22+
```js
23+
assert.equal(document.querySelector('p')?.innerText.trim(), 'Browse our collection of amazing books!');
24+
```
25+
26+
Your `p` element should be below your `h1` element.
27+
28+
```js
29+
assert.exists(document.querySelector('h1 + p'));
30+
```
31+
32+
# --seed--
33+
34+
## --seed-contents--
35+
36+
```html
37+
--fcc-editable-region--
38+
<h1>XYZ Bookstore</h1>
39+
40+
--fcc-editable-region--
41+
```
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
id: 68ec6cd5b7e8f5a8f7319e32
3+
title: Step 3
4+
challengeType: 0
5+
dashedName: step-3
6+
---
7+
8+
# --description--
9+
10+
The `div` element is used as a container to group other HTML elements. You will mainly use the `div` element when you want to group HTML elements that will share a set of CSS styles.
11+
12+
Below the `p` element, add a `div` element. This `div` will be a container for your book cards.
13+
14+
# --hints--
15+
16+
You should have a `div` element.
17+
18+
```js
19+
assert.exists(document.querySelector('div'));
20+
```
21+
22+
Your `div` element should be below your `p` element.
23+
24+
```js
25+
assert.exists(document.querySelector('p + div'));
26+
```
27+
28+
# --seed--
29+
30+
## --seed-contents--
31+
32+
```html
33+
--fcc-editable-region--
34+
<h1>XYZ Bookstore</h1>
35+
<p>Browse our collection of amazing books!</p>
36+
37+
--fcc-editable-region--
38+
```
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
id: 68ec6d9a315221aa31e54816
3+
title: Step 4
4+
challengeType: 0
5+
dashedName: step-4
6+
---
7+
8+
# --description--
9+
10+
The `class` attribute is used to identify one or more elements for styling. Unlike the `id` attribute, class names do not need to be unique: multiple elements can share the same class.
11+
12+
Here is an example:
13+
14+
```html
15+
<p class="example">example paragraph</p>
16+
```
17+
18+
Add a `class` attribute to your `div` element and set its value to `card-container`.
19+
20+
# --hints--
21+
22+
Your `div` element should have a `class` attribute.
23+
24+
```js
25+
assert.isTrue(document.querySelector('div')?.hasAttribute('class'));
26+
```
27+
28+
Your `div` element should have a `class` attribute with the value of `card-container`.
29+
30+
```js
31+
assert.equal(document.querySelector('div')?.className, 'card-container');
32+
```
33+
34+
# --seed--
35+
36+
## --seed-contents--
37+
38+
```html
39+
--fcc-editable-region--
40+
<h1>XYZ Bookstore</h1>
41+
<p>Browse our collection of amazing books!</p>
42+
<div>
43+
44+
</div>
45+
--fcc-editable-region--
46+
```
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
id: 68ec6e8d0caee3afaaf142ef
3+
title: Step 5
4+
challengeType: 0
5+
dashedName: step-5
6+
---
7+
8+
# --description--
9+
10+
Inside the element having a `class` of `card-container`, create another `div` element. This `div` will represent the first book card.
11+
12+
Add a `class` attribute to this new `div` element and set the value of the `class` attribute to `card`.
13+
14+
# --hints--
15+
16+
You should have a `div` element nested inside the element with a class of `card-container`.
17+
18+
```js
19+
assert.exists(document.querySelector('.card-container div'));
20+
```
21+
22+
Your new `div` element should have a `class` attribute.
23+
24+
```js
25+
assert.isTrue(document.querySelector('.card-container div')?.hasAttribute('class'));
26+
```
27+
28+
Your new `div` element should have a `class` having the value of `card`.
29+
30+
```js
31+
assert.exists(document.querySelector('.card-container div.card'));
32+
```
33+
34+
# --seed--
35+
36+
## --seed-contents--
37+
38+
```html
39+
--fcc-editable-region--
40+
<h1>XYZ Bookstore</h1>
41+
<p>Browse our collection of amazing books!</p>
42+
<div class="card-container">
43+
44+
</div>
45+
--fcc-editable-region--
46+
```
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
id: 68ec9332a9b5b2b32487bd00
3+
title: Step 6
4+
challengeType: 0
5+
dashedName: step-6
6+
---
7+
8+
# --description--
9+
10+
The `id` attribute adds a unique identifier to an HTML element. Each `id` should be unique within a page and should only be used once.
11+
12+
`id` values cannot contain spaces and should only contain letters, digits, underscores, and dashes.
13+
14+
Here is an example:
15+
16+
```html
17+
<p id="para">example paragraph</p>
18+
```
19+
20+
Add an `id` attribute to your element having a class of `card` and set its value to `sally-adventure-book`.
21+
22+
# --hints--
23+
24+
Your element with a class of `card` should have an `id` attribute.
25+
26+
```js
27+
assert.isTrue(document.querySelector('.card')?.hasAttribute('id'));
28+
```
29+
30+
Your element having a class of `card` should have an `id` having the value of `sally-adventure-book`.
31+
32+
```js
33+
assert.equal(document.querySelector('.card')?.id, 'sally-adventure-book');
34+
```
35+
36+
# --seed--
37+
38+
## --seed-contents--
39+
40+
```html
41+
<h1>XYZ Bookstore</h1>
42+
<p>Browse our collection of amazing books!</p>
43+
<div class="card-container">
44+
--fcc-editable-region--
45+
<div class="card">
46+
47+
</div>
48+
--fcc-editable-region--
49+
</div>
50+
```
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
id: 68ec98b38d83a3c28dd30efe
3+
title: Step 7
4+
challengeType: 0
5+
dashedName: step-7
6+
---
7+
8+
# --description--
9+
10+
Inside the first element having a class of `card`, add an `h2` element with the text `Sally's SciFi Adventure`.
11+
12+
# --hints--
13+
14+
You should have an `h2` element nested inside the element having a class of `card`.
15+
16+
```js
17+
assert.exists(document.querySelector('.card h2'));
18+
```
19+
20+
Your `h2` element's text should be `Sally's SciFi Adventure`.
21+
22+
```js
23+
assert.equal(document.querySelector('.card h2')?.innerText.trim(), "Sally's SciFi Adventure");
24+
```
25+
26+
# --seed--
27+
28+
## --seed-contents--
29+
30+
```html
31+
<h1>XYZ Bookstore</h1>
32+
<p>Browse our collection of amazing books!</p>
33+
<div class="card-container">
34+
--fcc-editable-region--
35+
<div class="card" id="sally-adventure-book">
36+
37+
</div>
38+
--fcc-editable-region--
39+
</div>
40+
```
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
id: 68ec99e478211dc578699944
3+
title: Step 8
4+
challengeType: 0
5+
dashedName: step-8
6+
---
7+
8+
# --description--
9+
10+
Below the `h2` element in the first element having a class of `card`, add a `p` element with the following text:
11+
12+
```md
13+
This is an epic story of Sally and her dog Rex as they navigate through other worlds.
14+
```
15+
16+
# --hints--
17+
18+
You should have a `p` element nested inside the element having a class of `card`.
19+
20+
```js
21+
assert.exists(document.querySelector('.card p'));
22+
```
23+
24+
Your `p` element's text should be `This is an epic story of Sally and her dog Rex as they navigate through other worlds.`.
25+
26+
```js
27+
assert.equal(document.querySelector('.card p')?.innerText.trim(), "This is an epic story of Sally and her dog Rex as they navigate through other worlds.");
28+
```
29+
30+
Your `p` element should be below your `h2` element.
31+
32+
```js
33+
assert.exists(document.querySelector('.card h2 + p'));
34+
```
35+
36+
# --seed--
37+
38+
## --seed-contents--
39+
40+
```html
41+
<h1>XYZ Bookstore</h1>
42+
<p>Browse our collection of amazing books!</p>
43+
<div class="card-container">
44+
--fcc-editable-region--
45+
<div class="card" id="sally-adventure-book">
46+
<h2>Sally's SciFi Adventure</h2>
47+
48+
</div>
49+
--fcc-editable-region--
50+
</div>
51+
```

0 commit comments

Comments
 (0)