300
www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 1 PROJECT 3 Yipppeeee! CODEJIKA.COM

CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 1

PROJECT 3Yipppeeee!

CODEJIKA.COM

Page 2: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

PROJECT 3:

Build an awesome website for a Small Business with a simple JavaScript order form.

PROJECT 3

Training 1

PURPOSE: Teach yourself. Teach your friends. Help others.

LEARN: The practical skills of a Junior Web Developer over 12 Projects.

WHAT’S THE DEAL?

LEARN MORE: www.CODEJIKA.com

CODEJIKA.COM

2019 Copyright Code for Change | Ultimate Growth 2www.codejika.com

Desktop – v1

PRONOUNCED: CODE–GEE-KAJIKA MEANS “DANCE” OR TURN IN ZULU, A SOUTH AFRICAN LANGUAGE.

Page 3: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

5. Styling your Website // 4 Sessions | 3 Hours

PROJECTS OVERVIEW:

2019 Copyright Code for Change | Ultimate Growth 3www.codejika.com

1. Simple Landing Page // 4 Sessions | 90 Minutes

2. CV Website // 6 Sessions | 2.5 Hours

3. Simple Biz Website // 5 Sessions | 4 Hours

4. JavaScript OrderForm // 4 Sessions | 3 Hours

6. Basic Business Website // 5 Sessions | 4 Hours

<Certificate> Milestone

Project

Page 4: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

1. Setup: Header & Business Info

2. Learn Flex, add “Cards” & content.

3. Build tables & add a form.

2019 Copyright Code for Change | Ultimate Growth 4www.codejika.com

PROJECT 3 – SIMPLE BIZ WEBSITETRAINING SESSIONS:

4. JS | Send & receive information from HTML.

5. JS | Add input from form and play hide & seek.

6. Footer, TEAM section & content writing.

Page 5: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

1. Code the site structure

2. Add a header

3. Formulate an “Intro” section.

TRAINING SNAPSHOTThese are your missions for today.

PROJECT 3 – TRAINING 1

2019 Copyright Code for Change | Ultimate Growth 5www.codejika.com

PREVIEW

Page 6: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Code the site structure.

. . .

MISSION

This mission will include 2 challenges.

2019 Copyright Code for Change | Ultimate Growth 6www.codejika.com

Page 7: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 7www.codejika.com

START.Start by setting up the skeleton

of your code.

<!DOCTYPE html>

<head><style></style>

</head>

<body>

</body>

Page 8: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Add this section:CODE :CHALLENGE

STEP 1

2019 Copyright Code for Change | Ultimate Growth 8www.codejika.com

<!DOCTYPE html>

<head><style></style>

</head>Save a new notepad file as .html .

TIP:

Page 9: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Now add <header> and <section> in <body>.

CODE :CHALLENGESTEP 2

2019 Copyright Code for Change | Ultimate Growth 9www.codejika.com

<body>

<header></header>

<section></section>

</body>

Page 10: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 10www.codejika.com

GREAT JOB!

Page 11: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 11www.codejika.com

Or who are you making it for?

What’s the name of your business?

THINK

Page 12: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Add a simple header, h1 & sub-title.

. . .

MISSION

This mission will include 5 challenges.

2019 Copyright Code for Change | Ultimate Growth 12www.codejika.com

Page 13: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Add an <h1> in <header> with your company name or brand.

CODE :CHALLENGESTEP 1

2019 Copyright Code for Change | Ultimate Growth 13www.codejika.com

<h1>Awesome Industries Inc.

</h1>

Page 14: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Under the <h1> place an <h4> with the company tagline.

CODE :CHALLENGESTEP 2

2019 Copyright Code for Change | Ultimate Growth 14www.codejika.com

<h4>Cute Cupcakes for Best

Besties</h4>

Page 15: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 15www.codejika.com

NICE.Keep it up.

Page 16: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 16www.codejika.com

Now let’s style the <body> and <header>.

Page 17: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Add a body selector in CSS with these styles:

CODE :CHALLENGESTEP 3

2019 Copyright Code for Change | Ultimate Growth 17www.codejika.com

font-family: tahoma;text-align: center;

TIP :body { }

Page 18: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 18www.codejika.com

For your Company name make it white and have the

letters spaced-out.

Page 19: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Add header { } with a background color and some padding:

CODE :CHALLENGESTEP 4

2019 Copyright Code for Change | Ultimate Growth 19www.codejika.com

letter-spacing: 6px; background: royalblue;padding: 20px;

Page 20: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Make the text in header { } white with a CSS rule.

CODE :CHALLENGESTEP 5

2019 Copyright Code for Change | Ultimate Growth 20www.codejika.com

TIP :color: ???;

Page 21: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

CHECKPOINTYour code should look like this:

<!DOCTYPE html><head>

<style>body { font-family: tahoma;text-align: center;}

header {letter-spacing: 6px; color: white;background: royalblue;padding: 20px;}

</style></head>

2019 Copyright Code for Change | Ultimate Growth 21www.codejika.com

Page 22: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 22www.codejika.com

MARVELOUS!Keep it up.

Page 23: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Create an “Intro” section with content about the business.

. . .

MISSION

This mission will include 9 challenges.

2019 Copyright Code for Change | Ultimate Growth 23www.codejika.com

Page 24: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 24www.codejika.com

1. Stick a sub-title “Welcome” in a <h2>.

2. Explain the business in a <p>.

ALRIGHTY THEN.

Page 25: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Add an <h2> with this text in it:

WELCOME:

CODE :CHALLENGESTEP 1

2019 Copyright Code for Change | Ultimate Growth 25www.codejika.com

WHERE:Inside <section>.

Page 26: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 26www.codejika.com

Tell visitors of the site about the vision of the business.

NEXT.

Page 27: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Write a short Vision Statement.

Here is an example:

CONTENT:CHALLENGESTEP 2

2019 Copyright Code for Change | Ultimate Growth 27www.codejika.com

VISION: To create beautiful cupcakes for clients in the Randburg area.

Page 28: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Insert your vision statement in a <p>.

CODE :CHALLENGESTEP 3

2019 Copyright Code for Change | Ultimate Growth 28www.codejika.com

WHERE:After the welcome </h2> closing tag and still inside section.

Page 29: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 29www.codejika.com

Keep it up.

YOU’RE GETTING THERE.

Page 30: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Insert 2 <br> tags.CODE :CHALLENGE

STEP 4

2019 Copyright Code for Change | Ultimate Growth 30www.codejika.com

WHERE:After the VISION section. After the closing tag </p>.

Page 31: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 31www.codejika.com

Create an “About Us” section.

NOW.

Page 32: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Create an “About Us” explaination.

Here is an idea:

CONTENT:CHALLENGESTEP 5

2019 Copyright Code for Change | Ultimate Growth 32www.codejika.com

ABOUT US: Founded in 2018, by Thandi Ndlovo. We've served over 100 clients and delivered over 10,000 tasty treats.

Page 33: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Add the “About Us” content in a <p>.

CODE :CHALLENGESTEP 6

2019 Copyright Code for Change | Ultimate Growth 33www.codejika.com

WHERE:

After the VISION and the 2 <br>s.

Page 34: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Style h2 with font-size: 2em; and width 100%.

CODE :CHALLENGESTEP 7

2019 Copyright Code for Change | Ultimate Growth 34www.codejika.com

NOTE:The width: 100%; rule will make sure that the text does not wrap around other content.

Page 35: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Give the <section>s 30px padding and margin-bottom: 40px; .

CODE :CHALLENGESTEP 8

2019 Copyright Code for Change | Ultimate Growth 35www.codejika.com

TIP :section { }

Page 36: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 36www.codejika.com

You just added 35 lines of code in the first “Training”.

THAT’S AMAZING!

Page 37: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

CHECKPOINTYour code should look like this:

h2 {font-size: 2em;width: 100%; }section {padding: 30px;margin-bottom: 40px;}

</style></head><body><header>

<h1>Awesome Industries Inc.

</h1><h4>Cute Cupcakes for Best Besties

</h4></header>

2019 Copyright Code for Change | Ultimate Growth 37www.codejika.com

...

Content should be your own.

NOTE:

Page 38: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

CONGRATULATIONS

You’ve finished Training 1.

2019 Copyright Code for Change | Ultimate Growth 38www.codejika.com

Page 39: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 39www.codejika.com

Training 2 is waiting for you.

YOU’RE DONE.

Page 40: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 40www.codejika.com

Sign-up at: www.CodeJIKA.com

WANT THE LATEST NEWS AND BONUS SECTIONS?

Page 41: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 41

LOADING . . .

Page 42: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

PROJECT 3:

Build an awesome website for a Small Business with a simple JavaScript order form.

PROJECT 3

Training 2

PURPOSE: Teach yourself. Teach your friends. Help others.

LEARN: The practical skills of a Junior Web Developer over 12 Projects.

WHAT’S THE DEAL?

LEARN MORE: www.CODEJIKA.com

CODEJIKA.COM

2019 Copyright Code for Change | Ultimate Growth 42www.codejika.com

Desktop – v1

PRONOUNCED: CODE–GEE-KAJIKA MEANS “DANCE” OR TURN IN ZULU, A SOUTH AFRICAN LANGUAGE.

Page 43: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

5. Styling your Website // 4 Sessions | 3 Hours

PROJECTS OVERVIEW:

2019 Copyright Code for Change | Ultimate Growth 43www.codejika.com

1. Simple Landing Page // 4 Sessions | 90 Minutes

2. CV Website // 6 Sessions | 2.5 Hours

3. Simple Biz Website // 5 Sessions | 4 Hours

4. JavaScript OrderForm // 4 Sessions | 3 Hours

6. Basic Business Website // 5 Sessions | 4 Hours

<Certificate> Milestone

Project

Page 44: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

1. Setup: Header & Business Info

2. Learn Flex, add “Cards” & content.

3. Build tables & add a form.

2019 Copyright Code for Change | Ultimate Growth 44www.codejika.com

PROJECT 3 – SIMPLE BIZ WEBSITETRAINING SESSIONS:

4. JS | Send & receive information from HTML.

5. JS | Add input from form and play hide & seek.

6. Footer, TEAM section & content writing.

Page 45: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 45www.codejika.com

DUMELA*.

*”Hello” in Sotho.

Page 46: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

1. Learn about CSS Flex.

2. Use CSS Flex to make cool looking

boxes for your content.

TRAINING SNAPSHOTThese are your missions for today:

PROJECT 3 – TRAINING 2

2019 Copyright Code for Change | Ultimate Growth 46www.codejika.com

Page 47: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Learn about CSS Flex

. . .

MISSION

This mission will include 3 challenges.

2019 Copyright Code for Change | Ultimate Growth 47www.codejika.com

Page 48: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 48

Here we go.

Page 49: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

BRIEFING Flexbox

Flex allows you to easily space boxes or images.

1.1.2

Flexbox

2019 Copyright Code for Change | Ultimate Growth 49www.codejika.com

DESKTOP:

Example: For an image gallery.

Page 50: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

BRIEFING Flexbox

And they will shrink or stack based on the screen width.

1.1.2

Flexbox

2019 Copyright Code for Change | Ultimate Growth 50www.codejika.com

DESKTOP:MOBILE:

Page 51: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

BRIEFING Flexbox

To use flex, start with 1. A container. 2. Then add your content.

1.1.2

Flexbox

2019 Copyright Code for Change | Ultimate Growth 51www.codejika.com

1. 2. 3.

Page 52: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

BRIEFING Flexbox | Example1.1.2

Flexbox

2019 Copyright Code for Change | Ultimate Growth 52www.codejika.com

<section class="container">

<article> </article><article> </article><article> </article>

</section>

<section>

<article> <article> <article>

STEP 1: Add the container and content.

Page 53: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

BRIEFING Flexbox | Example1.1.2

Flexbox

2019 Copyright Code for Change | Ultimate Growth 53www.codejika.com

Container CSS

.container {

display: flex;

justify-content: center;

}

Flexbox Magic

STEP 2: Add the “Flexbox” Magic.

Page 54: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

BRIEFING Flexbox | Example1.1.2

Flexbox

2019 Copyright Code for Change | Ultimate Growth 54www.codejika.com

1. Container CSS

.container {

display: flex;

justify-content: center;

}

2. Flexbox Magic

STEP 3: Tell “Flexbox” how to arrange the content.

3. How to Arrange:

Page 55: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 55www.codejika.com

REFERENCE: https://medium.com/@js_tut

CSS FLEX REFERENCE:

JavaScript Teacher

Page 56: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 56www.codejika.com

LET’S FLEX!

Page 57: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Create a CSS class .container with:

CODE :CHALLENGE

STEP 1

2019 Copyright Code for Change | Ultimate Growth 57www.codejika.com

display: flex;justify-content: center;flex-wrap: wrap;

.container { } .T IP :

Page 58: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 58www.codejika.com

THAT’S FLEX-TASTIC !

Page 59: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Add a div styled with containerclass and 2x <article> tags.

CODE :CHALLENGESTEP 2

2019 Copyright Code for Change | Ultimate Growth 59www.codejika.com

Place below “Welcome” section closing tag </section>.

WHE RE :

<section class="container">

<article> </article><article> </article>

</section>

Page 60: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Insert a sub-title with <h2> at the top of the section: SERVICES://

CODE :CHALLENGESTEP 3

2019 Copyright Code for Change | Ultimate Growth 60www.codejika.com

<section class="container">

<h2>

SERVICES://

<h2>

Page 61: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 61www.codejika.com

SUPER

Now we’re going to add a card design to the <article> s.

Page 62: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Learn & create a “Cards” design style.

. . .

MISSION

This mission will include 5 challenges.

2019 Copyright Code for Change | Ultimate Growth 62www.codejika.com

Page 63: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

BRIEFING DESIGN STYLE: CARDS1.1.2

2019 Copyright Code for Change | Ultimate Growth 63www.codejika.com

CARDSYour flex content will look like “cards”.

This is a popular design style.

<article>

CARDS

Page 64: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

BRIEFING DESIGN STYLE: CARDS1.1.2

2019 Copyright Code for Change | Ultimate Growth 64www.codejika.com

CARDSEach “Card” has three elements inside:

1. Icon(or image)

2. Text3. Button

Page 65: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

BRIEFING DESIGN STYLE: CARDS1.1.2

2019 Copyright Code for Change | Ultimate Growth 65www.codejika.com

CARDSYour code will look like this:

1.2.

3.

<article class="card">

<div class="icons"> &#x1F60E; </div>

<h3>David Mukhura</h3>

<p>Jnr. Web Developer - Creates beautiful websites for businesses in Soweto.</p>

<button> Contact </button>

</article>

Page 66: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 66www.codejika.com

ANDIAMO*!

*ITALIAN: “Let’s do this!”

Page 67: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Create a CSS class called .cardand link to it in each <article> tag.

CODE :CHALLENGESTEP 1

2019 Copyright Code for Change | Ultimate Growth 67www.codejika.com

<article class="card">

TIP :

.card {

border: 1px solid #ccc;

background-color: ivory;

}

Page 68: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Add a padding and margin to the .card class.

CODE :CHALLENGESTEP 2

2019 Copyright Code for Change | Ultimate Growth 68www.codejika.com

.card {

border: 1px solid #ccc;

background-color: ivory;

margin: 25px;

padding: 25px;

}

Page 69: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Adapt flex and the “Cards” to show nicely on larger screens. Add this CSS:

CODE :CHALLENGESTEP 3

2019 Copyright Code for Change | Ultimate Growth 69www.codejika.com

You can put this at the end of the CSS code.

TIP :

@media screen and (min-width: 50em) { .card {flex-basis: 325px;}

}

Page 70: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Add this to make the site header look better on small screens:

CODE :CHALLENGENOT RELATED TO “CARDS.”

2019 Copyright Code for Change | Ultimate Growth 70www.codejika.com

@media screen and (min-width: 50em) { .card {flex-basis: 325px;}

header h1 {font-size:5em;}

}

Page 71: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 71www.codejika.com

FANCY

Let’s add a box-shadow to our .card .

The next 3 slides are optional.

Page 72: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

BRIEFING box-shadow: 6px 6px 6px yellow;1.1.2

box-shadow

2019 Copyright Code for Change | Ultimate Growth 72www.codejika.com

6px 6px 6px yellow;

1stRi

ght

2ndBo

ttom

box-shadow is used by the experts to make cards & pictures look more elegant.

Blur means to make something fuzzy.

TIP : 3rdBl

ur

Effe

ct

4thCo

lor

Page 73: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

BRIEFING RGBA Transparency Trick1.1.2

RGBA

2019 Copyright Code for Change | Ultimate Growth 73www.codejika.com

RGBA color: Use the last number to make it semi-transparent.

Transparent means “See-through.”

T I P : rgba ( 0 , 0 , 0 , 0 . 3 )

Red

Gree

n

Blue

Alph

a

This doesn’t work in all browsers.

T I P 2 :

Page 74: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 74www.codejika.com

WHAAAAT !?!?!?!

If you feel like this, don’t worry.

Page 75: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Use both box-shadow and a RGBA color to make your .card super PRO.

CODE :CHALLENGESTEP 4

2019 Copyright Code for Change | Ultimate Growth 75www.codejika.com

.card {

border: 1px solid #ccc;

background-color: ivory;

margin: 25px;

padding: 25px;

box-shadow: 6px 6px 6px rgba(0,0,0,0.3);

} This is an optional challenge. You can skip it if you like.

OPTIONAL :

Page 76: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 76www.codejika.com

Now we’re going to add content to the cards.

Page 77: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Add 3 content elements to the “Cards”.1. Add an icon class & div.2. Write the content.3. Insert a button & style it.

. . .

MISSION

This mission will include 7 lengthy challenges.

2019 Copyright Code for Change | Ultimate Growth 77www.codejika.com

Page 78: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 78www.codejika.com

LET’S GO.

Page 79: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Create a CSS class called .icons .CODE :CHALLENGE

STEP 1

2019 Copyright Code for Change | Ultimate Growth 79www.codejika.com

.icons {

font-size: 8em;

padding: 25px;

}

Page 80: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Create a <div> nested inside each<article> .

Insert an emoji in your <div>.

CODE :CHALLENGESTEP 2

2019 Copyright Code for Change | Ultimate Growth 80www.codejika.com

<article class="card">

<div class="icons"> &#10084;

</div>

</article>

Page 81: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 81www.codejika.com

LEKKER*!

*AFRIKAANS: “Nice one!”

Page 82: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Add a <h3> sub-title and a <p> of explainer text in each <article>.

CODE :CHALLENGESTEP 3

2019 Copyright Code for Change | Ultimate Growth 82www.codejika.com

<h3>David Mukhura</h3>

<p>Jnr. Web Developer - Creates simple, beautiful websites for businesses in Soweto.</p>

Below the icons </div> closing tag.

WHE RE :

E X A M PL E :

Page 83: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Add a <button> and closing tag </button> with the text “Contact” in the middle.Do this in each <article>.

CODE :CHALLENGESTEP 4

2019 Copyright Code for Change | Ultimate Growth 83www.codejika.com

<button> Contact </button>Below the </p> closing tag.

WHE RE :

E X A M PL E :

Page 84: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Add a <button> and closing tag </button> with the text “Contact” in the middle.Do this in each <article>.

CODE :CHALLENGESTEP 5

2019 Copyright Code for Change | Ultimate Growth 84www.codejika.com

<button> Contact </button>Below the </p> closing tag.

WHE RE :E X A M PL E :

Page 85: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

BRIEFING Style Multiple Classes1.1.2

Style Multiple Classes

2019 Copyright Code for Change | Ultimate Growth 85www.codejika.com

You can style multiple classes with the same code. Just separate them with a comma.

.button, .container {

margin: 10px;

}

E X A M PLE :

Page 86: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Style the <button> tag and the .button class with this CSS:

Note: We’ll use the class later.

CODE :CHALLENGESTEP 6

2019 Copyright Code for Change | Ultimate Growth 86www.codejika.com

button, .button {background: royalblue;border: 0;color: white;}

Page 87: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Add 3 rules to the button CSS:CODE :CHALLENGE

STEP 7

2019 Copyright Code for Change | Ultimate Growth 87www.codejika.com

button, .button {background: royalblue;border: 0;color: white;padding: 10px;width: 100%;margin-bottom: 10px;}

Page 88: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 88www.codejika.com

YAAAAAYYY!!!

You’re done.

Page 89: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

CHECKPOINTYour CSS code should look like this:

/* CSS CARDS */.container {display: flex;justify-content: center;flex-wrap: wrap;}

.card {border: 1px solid #ccc;background-color: ivory;margin: 25px;padding: 25px;box-shadow: 6px 6px 6pxrgba(0,0,0,0.3);}

2019 Copyright Code for Change | Ultimate Growth 89www.codejika.com

.icons {font-size: 8em;padding: 25px;}

button, .button {background: royalblue;border: 0;color: white;padding: 10px;width: 100%;margin-bottom: 10px;}

.blue {background: teal;}

...

Page 90: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Your HTML code should look like this:

<section class="blue container"><h2>

OUR SERVICES://</h2><article class="card"> <div class="icons">&#9749;</div><h3>Sub-title</h3><p> ... text. </p><button>Learn More</button>

</article><article class="card"><div class="icons">&#9734;</div><h3>Sub-title</h3><p> ... text. </p><button>Learn More</button>

</article></section>

2019 Copyright Code for Change | Ultimate Growth 90www.codejika.com

CHECKPOINT

Page 91: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Add another class to <section> tag: blue

BONUSCHALLENGE

2019 Copyright Code for Change | Ultimate Growth 91www.codejika.com

CLASSY BLUE25 POINTS

<section class="blue container">

CODE : 1 of 2

STEP 1

TIP:Add a space between blueand container.

Page 92: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Add this class.

BONUSCHALLENGE

2019 Copyright Code for Change | Ultimate Growth 92www.codejika.com

.blue {background: teal;}

CODE : 2 of 2

STEP 2

CLASSY BLUE25 POINTS

Page 93: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 93www.codejika.com

WELL DONE!

This was a long, hard lesson.

Page 94: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

What is flex for?QUIZ

It allows you to organize content simply.

It’s a body building technique.

Flexbox is a way of creating boxes.

All of the above.

QUESTION 3.2.1

A.

B.

C.

D.

1. 2.

2019 Copyright Code for Change | Ultimate Growth 94www.codejika.com

ANSWER: NEXT SLIDE

Page 95: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

What’s RGBA?

A type of HTML color code.

Red, green, blue & alpha.

Allows adding transparency to boxes.

All of the above.

QUESTION 3.2.2

A.

B.

C.

D.

1. 2.

PREVIOUS ANSWER: A.

QUIZ

2019 Copyright Code for Change | Ultimate Growth 95www.codejika.com

Page 96: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

1. 2.

PREVIOUS ANSWER: D.

WHAT WAS YOUR SCORE?

50% 100%

QUIZ

2019 Copyright Code for Change | Ultimate Growth 96www.codejika.com

Page 97: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

If you have internet:Download and install a better code editor.

WHY?It’s easier and shows any mistakes in your code.

2019 Copyright Code for Change | Ultimate Growth 97www.codejika.com

https://notepad-plus-plus.org/download/

We recommend:

Notepad++

FOLLOW THE LINK:

SUGGESTION:

Page 98: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Ready for Training 3?

2019 Copyright Code for Change | Ultimate Growth 98www.codejika.com

Page 99: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 99www.codejika.com

#CODEJIKA

Post on Social Media what you’re working on with #CodeJIKA .

Help other kids learn to code.

Page 100: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 100

LOADING . . .

Page 101: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

PROJECT 3:

You’ll create a website for a Small Business with an simple order form and a few lines of JavaScript.

PROJECT 3

Training 3

PURPOSE: Teach yourself. Teach your friends. Help others.

LEARN: The practical skills of a Junior Web Developer over 12 Projects.

WHAT’S THE DEAL?

LEARN MORE: www.CODEJIKA.com

CODEJIKA.COM

2019 Copyright Code for Change | Ultimate Growth 101www.codejika.com

Desktop – v6

PRONOUNCED: CODE–GEE-KAJIKA MEANS “DANCE” OR TURN IN ZULU, A LANGUAGE OF SOUTH AFRICA.

Page 102: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

5. Styling your Website // 4 Sessions | 3 Hours

PROJECTS OVERVIEW:

2019 Copyright Code for Change | Ultimate Growth 102www.codejika.com

1. Simple Landing Page // 4 Sessions | 90 Minutes

2. CV Website // 6 Sessions | 2.5 Hours

3. Simple Biz Website // 5 Sessions | 4 Hours

4. JavaScript OrderForm // 4 Sessions | 3 Hours

6. Basic Business Website // 5 Sessions | 4 Hours

<Certificate> Milestone

Project

Page 103: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

1. Setup: Header & Business Info

2. Learn Flex, add “Cards” & content.

3. Build tables & add a form.

4. Automatic Order Summary with JavaScript.

2019 Copyright Code for Change | Ultimate Growth 103www.codejika.com

5. Footer, TEAM section & content writing.

PROJECT 3 – SIMPLE BIZ WEBSITETRAINING SESSIONS:

Page 104: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 104www.codejika.com

JAMBO*.

*”Hello” in Swahili.

Page 105: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

1. Build tables.

2. Create a form from a table.

3. Add some buttons.

TRAINING SNAPSHOTThese are your missions for today:

PROJECT 3 – TRAINING 3

2019 Copyright Code for Change | Ultimate Growth 105www.codejika.com

Page 106: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Build tables.

. . .

MISSION

This mission will include 4 challenges.

2019 Copyright Code for Change | Ultimate Growth 106www.codejika.com

Page 107: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 107

YALLA*.

*”Come on” in Arabic.

Page 108: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

BRIEFING <table>

Tables consist of;A. Columns <th>B. Rows <tr>

1.1.2

HTML Table

2019 Copyright Code for Change | Ultimate Growth 108www.codejika.com

Example: HTML Table

Column 1 Column 3

Row 2

Row 3

COLUMN

ROW

Page 109: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

BRIEFING <table>

Tables are a great way to store and show information.Tables can also structure content, in a web form, for example.

1.1.2

HTML Table

2019 Copyright Code for Change | Ultimate Growth 109www.codejika.com

Example: HTML Table

Name Age Phone

Themba 14 074 7858588

John 18 098 5211611

Rachael 17 062 3241279

Page 110: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

BRIEFING 1.1.2

2019 Copyright Code for Change | Ultimate Growth 110www.codejika.com

<table><tr>

<td>Name:</td>

<td>Age:</td>

<td>Phone:</td>

</tr>

<tr>

<td>Themba</td>

<td>14</td>

<td>074 7858588</td>

</tr>

...

Example: HTML Table

ROW 1CELL 1CELL 2CELL 3

ROW END

ROW 2CELL 1CELL 2CELL 3

ROW END

<table>HTML Table

Page 111: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

BRIEFING 1.1.2

2019 Copyright Code for Change | Ultimate Growth 111www.codejika.com

<th> Table Header cell

<td rowspan="2"> Merge two cells

<table style="width:100%"> Style

<table class="t01"> HTML Class

.t01 { CSS Class Style

width: 100%;

background-color: #f1f1c1;

}

Options: Table Styling:

<table> | ResourceHTML Table

Page 112: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 112www.codejika.com

LET’S BUILD TABLES!

<table>

Page 113: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 113www.codejika.com

Let’s make a new <section> with a table in it.

Page 114: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Create a new <section> with an <h2> sub-title in it.

CODE :CHALLENGESTEP 1

2019 Copyright Code for Change | Ultimate Growth 114www.codejika.com

<section><h2> MY ORDER FORM: </h2>

</section>Below section with “Cards.”

WHERE :

Page 115: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Build this table:CODE :CHALLENGE

STEP 2

2019 Copyright Code for Change | Ultimate Growth 115www.codejika.com

<table><tr>

<td> Name: </td><td> </td>

</tr>

<tr><td> Address: </td><td> </td>

</tr></table>

Below </h2> and before </section>.

WHERE :

ROW 1

ROW 2

Page 116: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Add two more rows:CODE :CHALLENGE

STEP 3

2019 Copyright Code for Change | Ultimate Growth 116www.codejika.com

...<tr>

<td> Favourite drink: </td><td> </td>

</tr>

<tr><td> Quantity: </td><td> </td>

</tr>

...After row 2 and before the </table> closing.

WHERE :

ROW 3

ROW 4

Page 117: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 117www.codejika.com

BOOM!

You just built your first table.

Page 118: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

1. Pad table cells with 10px. 2. Center <table>.

CODE :CHALLENGESTEP 4

2019 Copyright Code for Change | Ultimate Growth 118www.codejika.com

td {padding: 10px;}

table {margin: auto;}You should know where

by now. ;)

WHERE :

Page 119: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Add a form to a table.

. . .

MISSION

This mission will include 6 challenges.

2019 Copyright Code for Change | Ultimate Growth 119www.codejika.com

Page 120: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

BRIEFING <form>

Form is used to collect user* input*.

1.1.2

HTML Form

2019 Copyright Code for Change | Ultimate Growth 120www.codejika.com

Example: HTML Form

GOOFY FORM:What’s the silliest idea you have ever had?

Submit

Definitions: *User : Anyone who uses your website.*Input : Information given.

Page 121: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

BRIEFING 1.1.2

2019 Copyright Code for Change | Ultimate Growth 121www.codejika.com

<form>

<h1>GOOFY FORM:</h1>

What’s the silliest idea you have ever had?

<br>

<input type="text" size="50">

<br><br>

<button>Submit</button>

</form>

Example: Simple HTML Form

INPUT 1

SUBMIT BUTTON

<form>HTML Form

Page 122: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

BRIEFING 1.1.2

2019 Copyright Code for Change | Ultimate Growth 122www.codejika.com

<form

id="my-form"

action="me.html"

target="_blank"

>

Example: Form Actions

CSS ID styling #my-form

<form action="">Form Actions

Where data is sent

_blank = new tab

_self = same page

Page 123: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Wrap the whole table in <form> tags.• With the id="my-form" .

CODE :CHALLENGESTEP 1

2019 Copyright Code for Change | Ultimate Growth 123www.codejika.com

<form id="my-form" >

... table ...

</form>

Page 124: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

BRIEFING 1.1.2

2019 Copyright Code for Change | Ultimate Growth 124www.codejika.com

<input type="text"

size="50"

name="idea"

value="Idea..." >

Example: Form Inputs

Types: Text, radio & submit.

Placeholder text.

<input>Form Inputs

Width input field in px.

Name for saving information.

Page 125: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

REFERENCE 1.1.2

HTML INPUT TYPES

2019 Copyright Code for Change | Ultimate Growth 125www.codejika.com

HTML INPUT TYPESSET 1 SET 2

TYPES

<input type="button">

<input type="checkbox">

<input type="color">

<input type="date">

<input type="datetime-local">

<input type="email">

<input type="file">

<input type="hidden">

<input type="image">

<input type="month">More online here:https://www.w3schools.com/html/html_form_input_types.asp

TYPES

<input type="password">

<input type="radio">

<input type="range">

<input type="reset">

<input type="search">

<input type="submit">

<input type="tel">

<input type="text">

<input type="time">

<input type="url">

<input type="week">

Page 126: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Insert an <input> in the second cell ( <td> ) of the first row.

CODE :CHALLENGESTEP 2

2019 Copyright Code for Change | Ultimate Growth 126www.codejika.com

<tr><td>Name:</td><td><input type="text" size="25"

name="my-name"></td></tr>

Page 127: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Insert an <input> in the second cell ( <td> ) of the second row.

CODE :CHALLENGESTEP 3

2019 Copyright Code for Change | Ultimate Growth 127www.codejika.com

<tr><td>Address:</td><td><input type="text" size="25"

name="my-address"></td></tr>

Page 128: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 128www.codejika.com

AMAZING!

You are “Acing” this <form> thing.

Page 129: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Insert a <select> option in the second cell ( <td> ) of the third row.

CODE :CHALLENGESTEP 4

2019 Copyright Code for Change | Ultimate Growth 129www.codejika.com

<tr><td>Favourite drink:</td><td><select name="my-drink"><option> Milk </option><option> Coffee </option><option> Tea </option>

</select></td>

</tr>

Page 130: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

BRIEFING 1.1.2

2019 Copyright Code for Change | Ultimate Growth 130www.codejika.com

Example: Form Type Number

<form type="number">Form Type Number

type="number" allows to limit the numbers the user can choose.

<input type="number" name="my-qty" value="1" min="1" max="5">

DEFAULT* VALUE

MINIMUM VALUE

MAXIMUMVALUE

DEFINITION: *Default : The standard. This value remains in effect unless changes are made.

Page 131: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

In ROW 4, add a “number” type of <input> .Define a minimum of 1 and a maximum of 5.

CODE :CHALLENGESTEP 5

2019 Copyright Code for Change | Ultimate Growth 131www.codejika.com

<tr><td>Quantity:</td><td>

<input type="number" name="my-qty" value="1" min="1" max="5">

</td></tr>

Page 132: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Add a short note below the <input> to notify the user of the limits. Make it <small> with HTML.

CODE :CHALLENGESTEP 6

2019 Copyright Code for Change | Ultimate Growth 132www.codejika.com

<td>Quantity:</td><td>

<input type="number" name="my-qty" value="1" min="1" max="5">

<small>(max 5)</small>

</td>

Page 133: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 133www.codejika.com

GOOD JOB!

You’ve just added an awesome form to the table.

Page 134: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 134www.codejika.com

Almost done.

Now just add a “Submit” button.

Page 135: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Add some buttons to the form.

. . .

MISSION

This mission will include 6 challenges.

2019 Copyright Code for Change | Ultimate Growth 135www.codejika.com

Page 136: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Add two rows. • We need a bit of space, so add a <br> in the

fifth ROW (below the “Quantity:” ROW. )

CODE :CHALLENGESTEP 1

2019 Copyright Code for Change | Ultimate Growth 136www.codejika.com

</tr><tr>

<br></tr>

<tr></tr>

</table>

ROW 5

ROW 6

Page 137: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Merge two cells in the 6 ROW together using: <td colspan="2" >

CODE :CHALLENGESTEP 2

2019 Copyright Code for Change | Ultimate Growth 137www.codejika.com

</tr><tr>

<br></tr>

<tr><td colspan="2" ></td>

</tr></table>

ROW 5

ROW 6

Page 138: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Add a button in ROW 6 using type="button" and a value of “Process Order”.

CODE :CHALLENGESTEP 3

2019 Copyright Code for Change | Ultimate Growth 138www.codejika.com

<tr><td colspan="2" >

<input type="button" value="Process Order" >

</td></tr>

ROW 6

Page 139: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Add a second button with type="reset" and a value of “Clear”.

CODE :CHALLENGESTEP 4

2019 Copyright Code for Change | Ultimate Growth 139www.codejika.com

<tr><td colspan="2" >

<input type="button" value="Process Order" >

<input type="reset" value="Clear" > </td>

</tr>

Page 140: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 140www.codejika.com

DO YOU REMEMBER?

You’ll link to that styling in the next Challenge.

In Training 2, you styled:button, .button {...

Page 141: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Add styling to BOTH the buttons using class="button" .

CODE :CHALLENGESTEP 5

2019 Copyright Code for Change | Ultimate Growth 141www.codejika.com

<td colspan="2" ><input class="button"

type="button" value="Process Order" >

<input class="button" type="reset" value="Clear" >

</td>

ROW 6

Within the <input> tags themselves.

WHERE :

Page 142: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 142www.codejika.com

CHECKTo make sure your buttons are reflecting the styling

correctly.

Page 143: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

DEBUGThere should be a HTML file in the folder with all the code for Training 1 -3.

File: CodeJIKA_Project3_T3_v191.html

Go and check there if your code has some problems and that haven’t figured out yet.

2019 Copyright Code for Change | Ultimate Growth 143www.codejika.com

COMPARE YOUR CODE

Page 144: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 144www.codejika.com

GUESS WHAT???

Page 145: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 145www.codejika.com

You’ve written over 150 lines of code in this PROJECT.

Page 146: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 146www.codejika.com

We think that’s something to celebrate about.

Page 147: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 147www.codejika.com

Show your friendswhat your site looks like.

Use: #codejikaSo that we can see too.

Page 148: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

What is input action for?QUIZ

Allows the form to save submitted content.

Uses _blank to clear the form when done.

Says where to show the results of the form.

All of the above.

QUESTION 2.1.1

A.

B.

C.

D.

1. 2.

2019 Copyright Code for Change | Ultimate Growth 148www.codejika.com

ANSWER: NEXT SLIDE

Page 149: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

What are input types?

Radio, number, text, date & much more.

Variable, type, style, action

Text, number, value, button

Value, button, submit, text & reset.

QUESTION 2.1.2

A.

B.

C.

D.

1. 2.

PREVIOUS ANSWER: C.

QUIZ

2019 Copyright Code for Change | Ultimate Growth 149www.codejika.com

Page 150: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

1. 2.

PREVIOUS ANSWER: A.

WHAT WAS YOUR SCORE?

50% 100%

QUIZ

2019 Copyright Code for Change | Ultimate Growth 150www.codejika.com

Page 151: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

It’s time for Training 4 and some JavaScript.

2019 Copyright Code for Change | Ultimate Growth 151www.codejika.com

Are you ready?

Page 152: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 152

LOADING . . .

Page 153: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

PROJECT 3:

Build an awesome website for a Small Business with a simple JavaScript order form.

PROJECT 3

Training 4

PURPOSE: Teach yourself. Teach your friends. Help others.

LEARN: The practical skills of a Junior Web Developer over 12 Projects.

WHAT’S THE DEAL?

LEARN MORE: www.CODEJIKA.com

CODEJIKA.COM

2019 Copyright Code for Change | Ultimate Growth 153www.codejika.com

Desktop – v18 2019

PRONOUNCED: CODE–GEE-KAJIKA MEANS “DANCE” OR TURN IN ZULU, A SOUTH AFRICAN LANGUAGE.

Page 154: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 154www.codejika.com

#CODEJIKA

Post on Social Media what you’re working on with #CodeJIKA .

Help other kids learn to code.

Page 155: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

5. Styling your Website // 4 Sessions | 3 Hours

PROJECTS OVERVIEW:

2019 Copyright Code for Change | Ultimate Growth 155www.codejika.com

1. Simple Landing Page // 4 Sessions | 90 Minutes

2. CV Website // 6 Sessions | 3 Hours

3. Simple Biz Website // 6 Sessions | 4.5 Hours

4. JavaScript OrderForm // 4 Sessions | 3 Hours

6. Basic Business Website // 5 Sessions | 4 Hours

<Certificate> Milestone

Project

Page 156: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

1. Setup: Header & Business Info

2. Learn Flex, add “Cards” & content.

3. Build tables & add a form.

4. JS | Send & receive information from HTML.

2019 Copyright Code for Change | Ultimate Growth 156www.codejika.com

5. JS | Add input from form and play hide & seek.

PROJECT 3 – SIMPLE BIZ WEBSITETRAINING SESSIONS:

6. Footer, TEAM section & content writing.

Page 157: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 157www.codejika.com

MORNING.

So glad you’re here today.

Page 158: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 158

WHAT’S JavaScript?

JavaScript is the programminglanguage of HTML and the Web.

Page 159: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

REMEMBER:

What’s JavaScript?

Page 160: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 160

CaPiTaLs matter. If you get one “CAPITAL” letter wrong

ALL your code might not work.

Page 161: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 161

Going forward, we’ll just call it “JS”.

It’s shorter and easier.

JavaScript = JS

Page 162: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 162

WHAT IF I DON’T UNDERSTAND?

Don’t worry.Today is just a quick intro.

JS will be explained more in PROJECT 4.

Page 163: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

1. Link a HTML Event & JS Function.

2. Create the order summary section.

3. Send results: Variable & HTML Method.

TRAINING SNAPSHOTMissions for today.

PROJECT 3 – TRAINING 4

2019 Copyright Code for Change | Ultimate Growth 163www.codejika.com

Create an automatic order summary:

Page 164: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Link a HTML Event & JS Function.

. . .

MISSION

This mission will include 4 challenges.

2019 Copyright Code for Change | Ultimate Growth 164www.codejika.com

Page 165: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 165www.codejika.com

JavaScript

Let’s go!!!

Page 166: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

BRIEFING JavaScript | <script>1.1.2

JavaScript

2019 Copyright Code for Change | Ultimate Growth 166www.codejika.com

THIS IS IMPORTANT:

JavaScript is written between <script> tags.

<script>

JavaScript Code

</script>

WHERE:At the end of site before </body> closing tag.

Page 167: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Add script tags before the closing </body> tag.

CODE :CHALLENGESTEP 1

2019 Copyright Code for Change | Ultimate Growth 167www.codejika.com

<script>

</script></body>

Page 168: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 168www.codejika.com

GOOD!

Page 169: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

BRIEFING HTML Events

Connect user actions on the website to JavaScript (& other things.)

1.1.2

HTML Events

2019 Copyright Code for Change | Ultimate Growth 169www.codejika.com

An HTML Event is where JS comes to make connections (friends).

Page 170: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

HTML Event TYPESREFERENCE 1.1.2

HTML EVENT TYPES

2019 Copyright Code for Change | Ultimate Growth 170www.codejika.com

HTML EVENT TYPESonclick Fires on a mouse click on the elementonkeypress Fires when a user presses a key

onmousemoveFires when the mouse pointer is moving while it is over an element

onload Fires after the page is finished loading

onofflineScript to be run when the browser starts to work offline

onresize Fires when the browser window is resizedoninput Script to be run when an element gets user input

More online here:https://www.w3schools.com/tags/ref_eventattributes.asp

CONTENT

Note: these are just a few. There are many more.

Page 171: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

onclick=""

2019 Copyright Code for Change | Ultimate Growth 171www.codejika.com

When mouse is clicked.

BRIEFING 1.1.2

HTML Event: onclick

When someone clicks this button (or image) then run this JavaScript function.

Page 172: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 172

EXAMPLE:

A HTML Event will trigger a JS Function

…when button is clicked.

BRIEFING 1.1.2

HTML Event: onclick

Page 173: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

BRIEFING 1.1.2

HTML Event: onclick

2019 Copyright Code for Change | Ultimate Growth 173www.codejika.com

3-STEP EXAMPLE:

onclick eventin button.

Triggersfunction placeOrder().

Function placeOrder()

is run.

<input class="button" type="button" value="Process Order" onclick="placeOrder();" >

<script>function placeOrder() {}

</script>

1.

2.

3.

onclick=""

Page 174: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Add the onclick HTML Event to the “Process Order” <input> with placeOrder() function.

CODE :CHALLENGESTEP 2

2019 Copyright Code for Change | Ultimate Growth 174www.codejika.com

<input class="button" type="button" value="Process Order" onclick="placeOrder();" >

Page 175: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 175www.codejika.com

RAD.Let’s learn function.

Page 176: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

BRIEFING JS | function1.1.2

2019 Copyright Code for Change | Ultimate Growth 176www.codejika.com

IT WORKS LIKE THIS: Name

function placeOrder () { }

FUNCTION

Calculations go in here.

It makes things happen.JS | Function

Page 177: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

REMEMBER

What’s a function?

Page 178: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Add a function called “placeOrder ()”.

CODE :CHALLENGESTEP 3

2019 Copyright Code for Change | Ultimate Growth 178www.codejika.com

<script>function placeOrder () {}

</script>Inside <script> tags.WHERE :

Page 179: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 179

TIP:JS:

placeOrder (With a CAPITAL “O”. )

Page 180: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Add a success message inside the function using:results = "<h3>Success</h3>…";

CODE :CHALLENGESTEP 4

2019 Copyright Code for Change | Ultimate Growth 180www.codejika.com

function placeOrder () {results = "<h3>Success!</h3> Here is your order."; }

Page 181: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 181

TIP:JS:

Put a ; semi-colon at the end of each line.

Page 182: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 182

You just finished mission 1.

GOOD JOB.

Page 183: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Create the order summary section.

. . .

MISSION

This mission will include 2 challenges.

2019 Copyright Code for Change | Ultimate Growth 183www.codejika.com

Page 184: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 184

LINK THE MASTERS

An ID to a <div> & a var.

MISSION BRIEFING P3.T4.M2

HTMLCSS JS

#my-order

Page 185: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 185

Function CSS ID

BRIEFING 1.1.2

JS | Variable

…to send the results to div.

Variable 2uses

<div ID>

Styling.

STRUCTURE:

Page 186: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

BRIEFING 1.1.2

2019 Copyright Code for Change | Ultimate Growth 186www.codejika.com

Like a CSS class, just with a #instead of . (dot.)

CSS | idCSS | id

#my-order { }

<div id="my-order"> </div>

HTML

CSS

Page 187: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Create a CSS ID called “my-order” with this styling:

CODE :CHALLENGESTEP 1

2019 Copyright Code for Change | Ultimate Growth 187www.codejika.com

#my-order { background-color: #29C1C4;padding: 25px;}

Of course, in the CSS <style> section.

WHERE :

Page 188: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Create a <div> with an “my-order” id inside.

CODE :CHALLENGESTEP 2

2019 Copyright Code for Change | Ultimate Growth 188www.codejika.com

</tr></table><br><div id="my-order"></div>

</form>Immediately before the </form> closing tag.

WHERE :

Page 189: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 189

What’s a variable?

ALRIGHTY THEN.

Page 190: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Send results: Variable & HTML Methods.

. . .

MISSION

This mission will include 3 challenges.

2019 Copyright Code for Change | Ultimate Growth 190www.codejika.com

Page 191: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

JS | var

2019 Copyright Code for Change | Ultimate Growth 191www.codejika.com

A vehicle to store data and give commands.

BRIEFING 1.1.2

JS | Variable

“Yaay. I love learning.”

“Get me some food.”

STORE DATA:

GIVE COMMANDS:

VARIABLE

Page 192: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

BRIEFING JS | var1.1.2

2019 Copyright Code for Change | Ultimate Growth 192www.codejika.com

IT WORKS LIKE THIS: Variable

var store = "I like cats."

VARIABLE

Variable Name

Every variable starts with varand has a name.

Data to store

JS | Variable

Page 193: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

BRIEFING 1.1.2

2019 Copyright Code for Change | Ultimate Growth 193www.codejika.com

Variable

var store = input from all sorts of sources…

Variable name

Variables can store data from tons of places.

Data to store

JS | varJS | Variable

IT WORKS LIKE THIS:VARIABLE

Page 194: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 194

Variables can also store data typed in a form.

Why would I want to store that?

Because maybe we want to show it later in a different format or send it to someone.

BRIEFING 1.1.2 JS | varJS | Variable

Page 195: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

CODE :CHALLENGESTEP 1

2019 Copyright Code for Change | Ultimate Growth 195www.codejika.com

function placeOrder() {results = "<h3>Success!</h3> Here is your order."; var orderResults = }

Add a JS variable called orderResults in the function.

Page 196: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

REMEMBER

What’s a variable?

Page 197: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 197

var orderResults = document.getElementById("my-order");

Variable: To send or pull data I need two things;

1. HTML Method to pull data.

2. Say from where ( what ID ).

Page 198: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

BRIEFING HTML Methods

Connect JS data and results with HTML.

1.1.2

HTML Methods

2019 Copyright Code for Change | Ultimate Growth 198www.codejika.com

HTML Methods are Heroswith super-powers that help all the parts of the site talk to each other.

Page 199: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 199

gEBI

BRIEFING 1.1.2

HTML Methods

A. Link to the ID name.

Variable 2

asks

</div ID>

HEROS WITH SUPER-POWERS.

INNER

B. Show the results in HTML.

Page 200: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

BRIEFING 1.1.2

HTML Method: gEBI

2019 Copyright Code for Change | Ultimate Growth 200www.codejika.com

getElementById

Hi, my name is gEBI.

I am a HTML Method.

.getElementById()

MY SUPER-POWER:

I create a link-up to send or pull information from anywhere, on a webpage or the internet.

FOR EXAMPLE:Link variable to <div> with the id="my-order" .

document.getElementById("my-order");

Page 201: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 201

READY?

Page 202: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Add gEBI ( getElementById ) to send results to ID: "my-order".

CODE :CHALLENGESTEP 2

2019 Copyright Code for Change | Ultimate Growth 202www.codejika.com

function placeOrder() {results = "<h3>Success!</h3> Here is your order."; var orderResults = document.getElementById("my-order");}

Page 203: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 203

GREAT WORK!

We’ve linked the var to the div.Now we need to say what we want to send.

Page 204: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

BRIEFING 1.1.2

Method: innerHTML

2019 Copyright Code for Change | Ultimate Growth 204www.codejika.com

Hi, my name is Inner.

I am a HTML Method.

.innerHTML =

MY SUPER-POWER:

I can send information to anywhere on the webpage.

FOR EXAMPLE:Send “results” with varorderResults which gEBI linked to id:"my-order" .

orderResults.innerHTML = results;

InnerHTML

Page 205: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Use Inner to show “results”.

From var orderResults to the “my-order” <div>.

CODE :CHALLENGESTEP 3

2019 Copyright Code for Change | Ultimate Growth 205www.codejika.com

function order() {results = "<h3>Success!</h3> Here is your order."; var orderResults = document.getElementById("my-order");orderResults.innerHTML = results; }

Page 206: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Inner is sending the “results” to where ever var is linked.

EXPLAINER :

2019 Copyright Code for Change | Ultimate Growth 206www.codejika.com

function order() {results = "<h3>Success!</h3> Here is your order."; var orderResults = document.getElementById("my-order");orderResults.innerHTML = results; }

Page 207: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

CHECK1. Do you see the results

section on your website?

2. When you click the “Process Order” button does it show “Success!” ?

2019 Copyright Code for Change | Ultimate Growth 207www.codejika.com

Page 208: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

CHECKPOINT Your JS code should look like this:

<script>

function placeOrder() {

results = "<h3>Success</h3> Here your order.";

var orderResults = document.getElementById( "my-order" );

orderResults.innerHTML = results;

}

</script>

2019 Copyright Code for Change | Ultimate Growth 208www.codejika.com

Page 209: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

CHECKPOINTYour CSS code should look like this:

/* CSS ID */

#my-order { background-color: #29C1C4;padding: 25px;}

/* HTML FORM BUTTON */

<input class="button" type="button" value="Process Order" onclick="placeOrder();" >

2019 Copyright Code for Change | Ultimate Growth 209www.codejika.com

Page 210: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 210

Here’s a breakdown of the program you are writing:

Page 211: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

BREAK-DOWN 1.1.2

P3 Training 4

2019 Copyright Code for Change | Ultimate Growth 211www.codejika.com

Event inside button.

Button click runs function.

onclick="placeOrder();"1.

2.

3.

function placeOrder() {}

var orderResults = var sends data to <div>.

<div id="my-order"> <div> shows results.4.

MY PROGRAM:

Page 212: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

CONGRATULATIONS

You’ve finished Training 4.

2019 Copyright Code for Change | Ultimate Growth 212www.codejika.com

Page 213: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Trigger a function with a click:QUIZ

<div class="button"> Contact </div>

Insert in CSS: onclick="ID"

Link function to ID name in onclick event.

None of the above.

QUESTION 3.4.1

A.

B.

C.

D.

1. 2.

2019 Copyright Code for Change | Ultimate Growth 213www.codejika.com

ANSWER: NEXT SLIDE

Page 214: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

What’s a variable like?

A dog chasing a cat.

A storage box with a special name.

A boat on the ocean.

No one really knows.

QUESTION 3.4.2

A.

B.

C.

D.

1. 2.

PREVIOUS ANSWER: C.

QUIZ

2019 Copyright Code for Change | Ultimate Growth 214www.codejika.com

Page 215: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

1. 2.

PREVIOUS ANSWER: B.

WHAT WAS YOUR SCORE?

50% 100%

QUIZ

2019 Copyright Code for Change | Ultimate Growth 215www.codejika.com

Page 216: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

It’s time for Training 5You will add some content to

your JS program.

2019 Copyright Code for Change | Ultimate Growth 216www.codejika.com

Are you ready?

Page 217: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 217www.codejika.com

• Learn to code.• Start a Coding League.• Partner with us.• Help other people.• Tell us how we can improve.• Use: #CodeJIKA on all posts &

publications.

DO: DON’T:• Say you’ve started a coding

program and not mention #CodeJIKA.

• Modify our material or say it’s your own.

• Issue press releases without mentioning #CodeJIKA .

• Be a stinky-poo.

THE RULES:

Page 218: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 218

LOADING . . .

Page 219: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

PROJECT 3:

Build an awesome website for a Small Business with a simple JavaScript order form.

PROJECT 3

Training 5

PURPOSE: Teach yourself. Teach your friends. Help others.

LEARN: The practical skills of a Junior Web Developer over 12 Projects.

WHAT’S THE DEAL?

LEARN MORE: www.CODEJIKA.com

CODEJIKA.COM

2019 Copyright Code for Change | Ultimate Growth 219www.codejika.com

Desktop – v3 2019

PRONOUNCED: CODE–GEE-KAJIKA MEANS “DANCE” OR TURN IN ZULU, A SOUTH AFRICAN LANGUAGE.

Page 220: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

5. Styling your Website // 4 Sessions | 3 Hours

PROJECTS OVERVIEW:

2019 Copyright Code for Change | Ultimate Growth 220www.codejika.com

1. Simple Landing Page // 4 Sessions | 90 Minutes

2. CV Website // 6 Sessions | 3 Hours

3. Simple Biz Website // 6 Sessions | 4.5 Hours

4. JavaScript OrderForm // 4 Sessions | 3 Hours

6. Basic Business Website // 5 Sessions | 4 Hours

<Certificate> Milestone

Project

Page 221: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

1. Setup: Header & Business Info

2. Learn Flex, add “Cards” & content.

3. Build tables & add a form.

4. JS | Send & receive information from HTML.

2019 Copyright Code for Change | Ultimate Growth 221www.codejika.com

5. JS | Add input from form & play hide & seek.

PROJECT 3 – SIMPLE BIZ WEBSITETRAINING SESSIONS:

6. Footer, TEAM section & content writing.

Page 222: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 222www.codejika.com

BOM DIA*.

*Portuguese: Good morning.

Page 223: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

1. Link variable to <form>.

2. List user responses from <form>.

3. Play hide and seek with the results section.

TRAINING SNAPSHOTMissions for today.

PROJECT 3 – TRAINING 4

2019 Copyright Code for Change | Ultimate Growth 223www.codejika.com

Create an automatic order summary:

Page 224: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Link variable to <form>.

. . .

MISSION

This mission will include 1 challenge.

2019 Copyright Code for Change | Ultimate Growth 224www.codejika.com

Page 225: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 225

Pull user responses from the form

into the var orderForm .

Page 226: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 226

1. HTML Method to pull data.

var orderForm = document.getElementById("my-form");

2. Say from where ( what ID ).

To pull data into a variable we need two things;

Page 227: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Create a new var called orderFormand using gEBI, link it to the “my-form” ID.

CODE :CHALLENGESTEP 1

2019 Copyright Code for Change | Ultimate Growth 227www.codejika.com

function order() {

var orderForm = document.getElementById("my-form");results = "<h3>Success!</h3> Here is your order."; var orderResults = document.getElementById("my-order");}

Page 228: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 228

TIP:Make sure the new var is:

A. On the first line of function.B. Within { } curly brackets.

Page 229: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 229

NICE.Now for the most exciting part:

Add the details from the <form> to the orderForm var

Page 230: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

List user responses from <form>.

. . .

MISSION

This mission will include 5 challenges.

2019 Copyright Code for Change | Ultimate Growth 230www.codejika.com

Page 231: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Add a <br> and a caption “Name: “ to the results using results += .

CODE :CHALLENGESTEP 1

2019 Copyright Code for Change | Ultimate Growth 231www.codejika.com

var orderForm = document.getElementById("my-form");results = "<h3>Success!</h3> Here is your order.";

results += "<br>Name: " var orderResults = document.getElementById("my-order");orderResults.innerHTML = results;

Before var orderResults .WHERE :

Page 232: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Use ID my-name and .value to pull the input.

CODE :CHALLENGESTEP 2

2019 Copyright Code for Change | Ultimate Growth 232www.codejika.com

results = "<h3>Success!</h3> Here is your order."; results += "<br>Name: " + orderForm.elements["my-name"].value;

Use + and always end with ; semi-colon.

T IP :

Page 233: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 233

TIP:A. Use += and always end with ; .B. Also, note we’re using [ ] brackets.

Page 234: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

CHECK

1. Is the “Name” input from the form showing in the results?( After you click “Process Order” button. )

2019 Copyright Code for Change | Ultimate Growth 234www.codejika.com

TIP: Use the F5 key to refresh your page.

Page 235: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Repeat with: Caption: "<br>Address: "ID: my-address

CODE :CHALLENGESTEP 3

2019 Copyright Code for Change | Ultimate Growth 235www.codejika.com

results = "<h3>Success!</h3> Here is your order."; results += "<br>Name: " + orderForm.elements["my-name"].value; results += "<br>Address: " + orderForm.elements["my-address"].value;

Page 236: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Repeat with: Caption: "<br>I like to order: "ID: my-drink

CODE :CHALLENGESTEP 4

2019 Copyright Code for Change | Ultimate Growth 236www.codejika.com

results = "<h3>Success!</h3> Here is your order."; results += "<br>Name: " + orderForm.elements["my-name"].value; results += "<br>Address: " + orderForm.elements["my-address"].value; results += "<br>I like to order: " + orderForm.elements["my-drink"].value;

Page 237: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 237

COME ON.You can do it.

It’s the last one.

Page 238: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Repeat with: Caption: "<br>Quantity: "ID: my-qty

CODE :CHALLENGESTEP 5

2019 Copyright Code for Change | Ultimate Growth 238www.codejika.com

results = "<h3>Success!</h3> Here is your order."; results += "<br>Name: " + orderForm.elements["my-name"].value; results += "<br>Address: " + orderForm.elements["my-address"].value; results += "<br>I like to order: " + orderForm.elements["my-drink"].value; results += "<br>Quantity: " + orderForm.elements["my-qty"].value;

Page 239: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Play hide and seek with the results section.

. . .

MISSION

This mission will include 7 challenges.

2019 Copyright Code for Change | Ultimate Growth 239www.codejika.com

Page 240: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 240

OK.Now, we want to hide the

results section until the order is submitted.

Page 241: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 241

1. Put a display: none; into the CSS ID.(This hides the section.)

orderResults.style.display = "block";

2. Override with HTML style once button is clicked.(This shows the section.)

How will we do that?

Page 242: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Hide the results by adding display: none; to the CSS #my-order ID.

CODE :CHALLENGESTEP 1

2019 Copyright Code for Change | Ultimate Growth 242www.codejika.com

#my-order { background-color: #29C1C4;padding: 25px;display: none;}

Page 243: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

BRIEFING 1.1.2

HTML: Style Display

2019 Copyright Code for Change | Ultimate Growth 243www.codejika.com

Hi, my name is Styl.

I am a HTML DOM.

.style.display =

MY SUPER-POWER:

I can make information appear or disappear anywhere on the webpage.

FOR EXAMPLE:In var orderResults I can use “block” or “none” to make results show or hide.

orderResults.style.display = "block";

Style.display

Page 244: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Use Styl to make the hidden results appear.

In var orderResults.

CODE :CHALLENGESTEP 2

2019 Copyright Code for Change | Ultimate Growth 244www.codejika.com

var orderResults = document.getElementById("my-order");orderResults.style.display = "block";orderResults.innerHTML = results;

Before innerHTML.WHERE :

Page 245: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

CHECK

1. Is the results section hidden on the webpage?

2. When you click the “Process Order” button does show?

2019 Copyright Code for Change | Ultimate Growth 245www.codejika.com

TIP: Use the F5 key to refresh your page.

Page 246: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 246

DONE.Was this hardest lesson so far?

Page 247: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

CHECKPOINT Your code should look like this:

<script>function placeOrder() {

var orderForm = document.getElementById("my-form");results = "<h3>Success</h3> Here your order."; results += "<br>Name: " + orderForm.elements["my-name"].value; results += "<br>Address: " + orderForm.elements["my-address"].value; results += "<br>I like to order: " + orderForm.elements["my-

drink"].value;results += "<br>Quantity: " + orderForm.elements["my-qty"].value;var orderResults = document.getElementById("my-order");orderResults.style.display = "block";orderResults.innerHTML = results;

}</script>

2019 Copyright Code for Change | Ultimate Growth 247www.codejika.com

Page 248: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

CHECKPOINT

Your CSS code should look like this:

/* CSS ID */

#my-order { background-color: #29C1C4;padding: 25px;display: none;}

/* HTML FORM BUTTON */

<input class="button" type="button" value="Process Order" onclick="placeOrder();" >

<input class="button" type="reset" value="Clear" onclick="document.getElementById('my-order').style.display = 'none'"; >

2019 Copyright Code for Change | Ultimate Growth 248www.codejika.com

BONUS:

Page 249: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 249

Here’s a breakdown of the program you are writing:

Page 250: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

BREAK-DOWN 1.1.2

P3 Training 4

2019 Copyright Code for Change | Ultimate Growth 250www.codejika.com

Event inside button.

Button click runs function.

onclick="placeOrder();"1.

2.

4.

function placeOrder() {}

var orderResults = var sends data to <div>.

<div id="my-order"> <div> shows results.5.

3. var orderForm = var pulls user info.

MY PROGRAM:

Page 251: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

A. Add the line ( button ) .B. Figure out what each part does.

TIP: Remember " at the end.

CODE :BONUS

2019 Copyright Code for Change | Ultimate Growth 251www.codejika.com

<input class="button" type="button" value="Process Order" onclick="placeOrder();" >

<input class="button" type="reset" value="Clear" onclick="document.getElementById('my-order').style.display = 'none'"; >

JS APPRENTICE200 POINTS

Page 252: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 252

TIP:Notice there are:

A. ( ' ) Single quotes.

B. ( " ) Double quotes.

Page 253: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

CONGRATULATIONS

You’ve finished Training 5.

2019 Copyright Code for Change | Ultimate Growth 253www.codejika.com

Page 254: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

getElementByIdQUIZ

Collects information from CSS.

Is an HTML form element to send user data.

Get info from an element in your document.

All of the above.

QUESTION 3.5.1

A.

B.

C.

D.

1. 2.

2019 Copyright Code for Change | Ultimate Growth 254www.codejika.com

ANSWER: NEXT SLIDE

Page 255: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

InnerHTML

Links user data with JS functions.

Allows a form to show anywhere.

Sets/returns HTML content of an element.

A compound JS term to confuse you.

QUESTION 3.5.2

A.

B.

C.

D.

1. 2.

PREVIOUS ANSWER: C.

QUIZ

2019 Copyright Code for Change | Ultimate Growth 255www.codejika.com

Page 256: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

1. 2.

PREVIOUS ANSWER: C.

WHAT WAS YOUR SCORE?

50% 100%

QUIZ

2019 Copyright Code for Change | Ultimate Growth 256www.codejika.com

Page 257: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Training 6 is really easyand it’s the last one.

2019 Copyright Code for Change | Ultimate Growth 257www.codejika.com

Are you ready?

Page 258: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 258

LOADING . . .

Page 259: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

PROJECT 3:

Build an awesome website for a Small Business with a simple JavaScript order form.

PROJECT 3

Training 6

PURPOSE: Teach yourself. Teach your friends. Help others.

LEARN: The practical skills of a Junior Web Developer over 12 Projects.

WHAT’S THE DEAL?

LEARN MORE: www.CODEJIKA.com

CODEJIKA.COM

2019 Copyright Code for Change | Ultimate Growth 259www.codejika.com

Desktop – v6

PRONOUNCED: CODE–GEE-KAJIKA MEANS “DANCE” OR TURN IN ZULU, A LANGUAGE OF SOUTH AFRICA.

Page 260: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

5. Styling your Website // 4 Sessions | 3 Hours

PROJECTS OVERVIEW:

2019 Copyright Code for Change | Ultimate Growth 260www.codejika.com

1. Simple Landing Page // 4 Sessions | 90 Minutes

2. CV Website // 6 Sessions | 2.5 Hours

3. Simple Biz Website // 5 Sessions | 4 Hours

4. JavaScript OrderForm // 4 Sessions | 3 Hours

6. Basic Business Website // 5 Sessions | 4 Hours

<Certificate> Milestone

Project

Page 261: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

1. Setup: Header & Business Info

2. Learn Flex, add “Cards” & content.

3. Build tables & add a form.

4. JS | Send & receive information from HTML.

2019 Copyright Code for Change | Ultimate Growth 261www.codejika.com

5. JS | Add input from form and play hide & seek.

PROJECT 3 – SIMPLE BIZ WEBSITETRAINING SESSIONS:

6. Footer, TEAM section & content writing.

Page 262: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

1. Create a stylish footer.

2. Write content for the business.

3. Add a “Team” section.

TRAINING SNAPSHOTThese are your missions for today.

PROJECT 3 – TRAINING 6

2019 Copyright Code for Change | Ultimate Growth 262www.codejika.com

Create footer and add more content.

Page 263: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Create a stylish footer.

. . .

MISSION

This mission will include 8 challenges.

2019 Copyright Code for Change | Ultimate Growth 263www.codejika.com

Page 264: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Create a class called “footer” with 30px padding and a grey background.

CODE :CHALLENGESTEP 1

2019 Copyright Code for Change | Ultimate Growth 264www.codejika.com

TIP:

padding: ???;background: ???;

Page 265: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Create a <div> and link it to .footer class styling.

CODE :CHALLENGESTEP 2

2019 Copyright Code for Change | Ultimate Growth 265www.codejika.com

WHERE:Immediately above the <script> section.

Page 266: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Write this in the <div> in an h3 tag:

Thanks for visiting.

CODE :CHALLENGESTEP 3

2019 Copyright Code for Change | Ultimate Growth 266www.codejika.com

WHERE:In the <div> you just created.

Page 267: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 267www.codejika.com

KEEP IT UP!

Page 268: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

1. Make another <div> inside the <div> you just created.

2. Apply the .container class styling to it.

CODE :CHALLENGESTEP 4

2019 Copyright Code for Change | Ultimate Growth 268www.codejika.com

WHERE:Immediately below the </h3> closing.

Page 269: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

1. Create two <article>s in the same <div>.

2. Style both with the “.card” class.

CODE :CHALLENGESTEP 5

2019 Copyright Code for Change | Ultimate Growth 269www.codejika.com

TIP:Make sure to close the first one before opening the next one.

Page 270: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 270www.codejika.com

THAT’S PROGRESS.

Page 271: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Add this in the first <article>:

In <h3>: Get in Touch.

In <p>: Probably the best place to buy cupcakes in all of Joburg.

CODE :CHALLENGESTEP 6

2019 Copyright Code for Change | Ultimate Growth 271www.codejika.com

Page 272: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Add this to the second <article>:

In H3: Contact Us:

In p: We would love to hear from you. <br> Call or email us. <br> Mobile: 072345 633 //Tel: 012 343 3432

CODE :CHALLENGESTEP 7

2019 Copyright Code for Change | Ultimate Growth 272www.codejika.com

Page 273: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Add a copyright line with &copy; , the year and company name.

CODE :CHALLENGESTEP 8

2019 Copyright Code for Change | Ultimate Growth 273www.codejika.com

WHERE:The bottom of the footer. Right before the </div> closing tag of the footer.

Page 274: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 274www.codejika.com

FOOTER COMPLETE.Hop on one foot to celebrate.

Page 275: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 275www.codejika.com

DESIGN OVERVIEW:

It should look something like this.

Feel free to swap the color and, of course, change the text.

Page 276: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Define the services of the business.

. . .

MISSION

This mission will include 1 VERY IMPORTANT bonus challenge.

2019 Copyright Code for Change | Ultimate Growth 276www.codejika.com

Page 277: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 277www.codejika.com

Learn about your client Who are you making the website for?

Explain their business well.

Use engaging Photos and text.TIP: Ask a friend to edit your text or shoot

photos for you.

WANNA BE A GREAT WEBDESIGNER?BUSINESS COACH:

Page 278: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

BRIEFING CONTENT CREATION:

Content is a boring name for awesome stuff.

Content =

1.1.2

CONTENT CREATION

2019 Copyright Code for Change | Ultimate Growth 278www.codejika.com

Videos.Photos.GIFs.Poems.Explanations.Any other type of text.

Page 279: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

BUSINESS COACH:

2019 Copyright Code for Change | Ultimate Growth 279www.codejika.com

“I created a checklist to help you discover and write about what the best part of the business.”NOTE: This is in your folder as a PDF or you can download from www.codejika.com .

WEBSITE CONTENT CHECKLIST:

Page 280: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 280www.codejika.com

PRINT THIS PAGE.

CODEJIKA.COM

LEVEL 1: BUSINESS WEBSITE CONTENT LIST

1. WARM-UP:

What is the purpose of your business?

What is special about your business?

What is the most important product or service in your business?

Why did you start this business?

2. CORE:

How do you describe your business in one sentence?

Option 1. ___________________________________________________________________

Option 2. ___________________________________________________________________

When was the business started? ___________

How many clients do you have? (Per month or in total.) ___________

3. DETAILS:

Address: ___________________________________________________________

Phone: ___________________________________________________________

Email: ___________________________________________________________

Preferred Web Domain ( Example: www.DaveDonut.com or www.CharlieIndustries.com )

1.: ___________________ 2.: ___________________ 3.:

___________________

PRINT THIS PAGE.

CODEJIKA.COM

4. TEAM:

(Optional: Get a simple, friendly photo of each person’s face and shoulders.)

Person 1:

Name: ____________________________ Designation: ________________________

One sentence about what this person is good at and why:

____________________________________________

Person 2:

Name: ____________________________ Designation: ________________________

One sentence about what this person is good at and why:

____________________________________________

1. CUSTOMER REVIEWS:

(Optional: Get a simple, friendly photo of each person’s face and shoulders.)

Customer 1:

Name: ______________________ From where: ________________________

A few words about what this customer likes about business or their experience:

____________________________________________________

Customer 2:

Name: ______________________ From where: ________________________

A few words about what this customer likes about business or their experience:

____________________________________________________

Page 281: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

A. Design a website for a business ( or organization, club or school.)

BUSINESS :BONUSCHALLENGE

2019 Copyright Code for Change | Ultimate Growth 281www.codejika.com

SALES PRO800 POINTS

TIPS: The checklist is attached at the end of the lesson.Just print those two pages.

B. Use the checklist to create the content.

Page 282: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 282www.codejika.com

NEVER, EVER meet a client alone. Be careful and suspicious, especially of people that are overly friendly.

You can usually get all your information over the phone or email.

IMPORTANT:

Page 283: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Add a “Team” section.

. . .

MISSION

This mission will include 4 challenges.

2019 Copyright Code for Change | Ultimate Growth 283www.codejika.com

Page 284: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 284www.codejika.com

Create a new section of the website by copying and

pasting a section of code.

USE IT TWICE!

Page 285: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 285www.codejika.com

Then, we’ll change the content (images and text) and the

background.

Page 286: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Duplicate: Copy and paste the whole <section> with “OUR SERVICES” in. From the opening to the closing tag.

CODE :CHALLENGESTEP 1

2019 Copyright Code for Change | Ultimate Growth 286www.codejika.com

WHERE:Paste it immediately below the first section’s closing tag </section>.

Page 287: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Change the second section into a “TEAM” section.

Change “OUR SERVICES” sub-title to: “OUR TEAM”.

CODE :CHALLENGESTEP 2

2019 Copyright Code for Change | Ultimate Growth 287www.codejika.com

Page 288: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Present two members of the team (in the cards.)

1. Change the emoji code.2. <h3>: First and Last Name.3. <p>: Add a short bio*.4. <button>: Remove.

CODE :CHALLENGESTEP 3

2019 Copyright Code for Change | Ultimate Growth 288www.codejika.com

*DEFINITION:“Bio” says what a person is good at, studied or accomplished.

Page 289: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 289www.codejika.com

Now change the background color of the section by adding a bit of

in-line styling.

GOOD!

Page 290: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Add style="background-color: deeppink;" to the “TEAM” <section> opening tag.

CODE :CHALLENGESTEP 4

2019 Copyright Code for Change | Ultimate Growth 290www.codejika.com

<section class="container" style="background-color: deeppink;">

Page 291: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

CHECK The “Team” section can look something like this.

2019 Copyright Code for Change | Ultimate Growth 291www.codejika.com

Page 292: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

1. Create a another new section for the website.

2. Decide what title and content should be there.

CONTENT :BONUSCHALLENGE

2019 Copyright Code for Change | Ultimate Growth 292www.codejika.com

CONTENT BOSS45 POINTS

1 of 2

STEP 1

Page 293: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

CHECK:

2019 Copyright Code for Change | Ultimate Growth 293www.codejika.com

CONTENT BOSS45 POINTS

It should have 3 <section> s with cards and content.

Make sure emojis (or photos) sub-title and paragraph are all unique in each section.

BONUSCHALLENGE

2 of 2

STEP 2

Page 294: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

CONGRATULATIONS

You’ve finished Training 5.

2019 Copyright Code for Change | Ultimate Growth 294www.codejika.com

Page 295: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 295www.codejika.com

Here’s another simple 2-step bonus.

Page 296: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Insert this above the copyright line.

BONUSCHALLENGE

2019 Copyright Code for Change | Ultimate Growth 296www.codejika.com

SOCIAL LINKS25 POINTS

<div class="circle">F</div><div class="circle">T</div><div class="circle">I</div>

CODE : 1 of 2

STEP 1

Page 297: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

Add this class.

BONUSCHALLENGE

2019 Copyright Code for Change | Ultimate Growth 297www.codejika.com

SOCIAL LINKS25 POINTS

.circle {color: white;font-size: 2.5em;display: inline-block;height: 40px;width: 40px;margin: 15px;border-radius: 50%;background: deeppink;padding: 5px 10px 15px 10px;font-family: helvetica;}

CODE : 2 of 2

STEP 2

Page 298: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

You just finished PROJECT 3.

That’s AMAZING. You should celebrate!!!

2019 Copyright Code for Change | Ultimate Growth 298www.codejika.com

Page 299: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

2019 Copyright Code for Change | Ultimate Growth 299www.codejika.com

Post what you would improve on Social Media or email us.

HOW CAN WE

DO BETTER?

Use the hashtag #CodeJIKA .

Page 300: CODEJIKA.COM PROJECT 3 · PROJECT 3: Build an awesome website for a Small Business with a simple JavaScript order form. PROJECT 3 Training 1 PURPOSE: Teach yourself. Teach your friends

www.codejika.com 2019 Copyright Code for Change | Ultimate Growth 300

BYE.See you soon.