Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 25 additions & 9 deletions Form-Controls/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,29 @@
- [ ] Write a valid form
- [ ] Test with Devtools
- [ ] Refactor using Devtools
- [ ] Use version control by committing often and pushing regularly to GitHub
- [ ] Develop the habit of writing clean, well-structured, and error-free code
<!--{{<objectives>}}>-->

## Task

We are selling t-shirts. Write a form to collect the following data:
We are selling T-shirts. Write a form to collect the following data:

Our customers already have accounts, so we know their addresses and charging details already. We don't need to collect that data. We want to confirm they are the right person, then get them to choose a colour and size.

Writing that out as a series of questions to ask yourself:

1. What is the customer's name? I must collect this data, and validate it. But what is a valid name? I must decide something.
2. What is the customer's email? I must make sure the email is valid. Email addresses have a consistent pattern.
3. What colour should this t-shirt be? I must give 3 options. How will I make sure they don't pick other colours?
4. What size does the customer want? I must give the following 6 options: XS, S, M, L, XL, XXL
1. What is the customer's name? I must collect this data and ensure it contains at least two non-space characters.
2. What is the customer's email? I must make sure the email is valid. Email addresses follow a consistent pattern.
3. What colour should this T-shirt be? I must provide 3 options. How will I ensure they do not choose other colours?
4. What size does the customer want? I must provide the following 6 options: XS, S, M, L, XL, XXL

All fields are required.
Do not write a form action for this project.

## Developers must test their work.
## Acceptnce Criteria

### Developers must test their work.

Let's write out our testable criteria. Check each one off as you complete it.

Expand All @@ -35,17 +39,29 @@ Let's write out our testable criteria. Check each one off as you complete it.

### HTML

- [ ] My form is semantic html.
- [ ] My form is semantic HTML.
- [ ] All inputs have associated labels.
- [ ] My Lighthouse Accessibility score is 100.
- [ ] I require a valid name. I have defined a valid name as a text string of two characters or more.
- [ ] I require a valid name.
- [ ] I require a valid email.
- [ ] I require one colour from a defined set of 3 colours.
- [ ] I require one size from a defined set of 6 sizes.

## Resources
### Developers must adhere to professional standards.

> Before you say you're done: Is your code readable? Does it run correctly? Does it look professional?

These practices reflect the level of quality expected in professional work.
They ensure your code is reliable, maintainable, and presents a polished, credible experience to users.

- [ ] My HTML code has no errors or warnings when validated using https://validator.w3.org/
- [ ] My code is consistently formatted
- [ ] My page content is free of typos and grammatical mistakes
- [ ] I commit often and push regularly to GitHub

## Resources
- [MDN: Form controls](https://developer.mozilla.org/en-US/docs/Learn/Forms)
- [MDN: Form validation](https://developer.mozilla.org/en-US/docs/Learn/Forms/Form_validation)
- [Lighthouse](https://developers.google.com/web/tools/lighthouse)
- [Lighthouse Guide](https://programming.codeyourfuture.io/guides/testing/lighthouse)
- [Format Code and Make Logical Commits in VS Code](../practical_guide.md)
43 changes: 30 additions & 13 deletions Wireframe/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
# Wireframe

![Wireframe](./wireframe.png)

Using the provided wireframe and resources, write a new webpage explaining:

1. What is the purpose of a README file?
1. What is the purpose of a wireframe?
1. What is a branch in Git?

There are some provided HTML and CSS files you can use to get started. You can use these files as a starting point or create your own files from scratch. You _must_ modify the HTML and CSS files to meet the acceptance criteria and you must check this criteria yourself before you submit your work.

## Learning Objectives

<!--{{<objectives>}}>-->
Expand All @@ -19,20 +9,47 @@ There are some provided HTML and CSS files you can use to get started. You can u
- [ ] Check a webpage against a wireframe layout
- [ ] Test web code using [Lighthouse](https://programming.codeyourfuture.io/guides/testing/lighthouse)
- [ ] Use version control by committing often and pushing regularly to GitHub
- [ ] Develop the habit of writing clean, well-structured, and error-free code
<!--{{</objectives>}}>-->

## Task
![Wireframe](./wireframe.png)

Using the provided wireframe and resources, write a new webpage explaining:

1. What is the purpose of a README file?
1. What is the purpose of a wireframe?
1. What is a branch in Git?

The page layout should closely match the wireframe. Exact replication is the goal, but small differences may be accepted.

There are some provided HTML and CSS files you can use to get started. You can use these files as a starting point or create your own files from scratch. You _must_ modify the HTML and CSS files to meet the acceptance criteria and you must check this criteria yourself before you submit your work.

## Acceptance Criteria

- [ ] Semantic HTML tags are used to structure the webpage.
- [ ] The page scores 100 for Accessibility in the Lighthouse audit.
- [ ] The page header includes a title and description.
- [ ] The articles section has three unique articles, each including an image, title, summary, and a link.
- [ ] The page footer is fixed to the bottom of the viewport.
- [ ] The webpage is styled using a linked .css file.
- [ ] The webpage is properly committed and pushed to a branch on GitHub.
- [ ] The articles section contains three distinct articles, each with its own unique image, title, summary, and link.
- [ ] The page footer is fixed to the bottom of the viewport.
- [ ] The page layout closely match the wireframe.

### Developers must adhere to professional standards.

> Before you say you're done: Is your code readable? Does it run correctly? Does it look professional?

These practices reflect the level of quality expected in professional work.
They ensure your code is reliable, maintainable, and presents a polished, credible experience to users.

- [ ] My HTML code has no errors or warnings when validated using https://validator.w3.org/
- [ ] My code is consistently formatted
- [ ] My page content is free of typos and grammatical mistakes
- [ ] I commit often and push regularly to GitHub

## Resources

- [Wireframe](https://www.productplan.com/glossary/wireframe/)
- [Semantic HTML](https://www.w3schools.com/html/html5_semantic_elements.asp)
- [:first-child](https://developer.mozilla.org/en-US/docs/Web/CSS/:first-child)
- [Format Code and Make Logical Commits in VS Code](../practical_guide.md)
58 changes: 58 additions & 0 deletions practical_guide.md
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does anything actually point people at this file? I suspect they are unlikely to happen upon it by chance...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the link to this guide in the "Resources" section in the README.md file of each exercise.

Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
## Clean Code and Smart Commits: A Practical Guide

### 1. Formatting code consistently
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to add any requirements about formatting to the problem requirements? Or just leave this as a suggestion?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I now added a "Adhere to Professional Standards" category in the Acceptance Criteria, and included these checklist items:

  • My HTML code has no errors or warnings when validated using https://validator.w3.org/
  • My code is consistently formatted
  • My page content is free of typos and grammatical mistakes
  • I commit often and push regularly to GitHub


- In VS Code, right-click anywhere in the editor and choose "Format Document" from the context menu.

- You can also use the shortcut:
- Windows/Linux: `Shift + Alt + F`
- macOS: `Shift + Option + F`

- More details: https://code.visualstudio.com/docs/editing/codebasics#_formatting

---
### 2. Enabling automatic formatting

- Open your VS Code settings (user or workspace settings).
- Guide: https://code.visualstudio.com/docs/getstarted/settings#_creating-user-and-workspace-settings
- Search for `editor format`
- Set `editor.formatOnSave` and `editor.formatOnPaste` to true

This ensures your code stays clean without needing manual formatting each time.

---

### 3. Committing files often, in meaningful groups

Creating small, focused commits improves both your workflow and team collaboration.

Why this matters:
- **Clarity**: Each commit tells a clear story (one feature, one fix, one change).
- **Debugging**: Easy to find and undo the commit that caused a bug.
- **Collaboration**: Teammates can review and understand changes faster.
- **History**: Project log becomes a readable timeline, not a messy dump.
- **Safety**: Progress is saved in safe, logical steps—less risk of losing work.

#### Appraoch 1: Using VS Code

- In the Source Control panel, stage individual files instead of all changes.
- Commit only what is staged.
- Watch this video (around 12:50): https://www.youtube.com/watch?v=z5jZ9lrSpqk&t=705

#### Approach 2: Using Git commands

1. Stage a changed file (`git add`)

e.g.: To stage a modified file named `index.html`
```
git add index.html
```

2. Commit the staged changes: (`git commit`)

e.g.: To commit the staged changes with a short commit message
```
git commit -m "Fix syntax error"
```

- Additional resource: [W3School Git Tutorial](https://www.w3schools.com/git/default.asp?remote=github)