SlideShare a Scribd company logo
UNTANGLING THE WEB
Week 5: front end frameworks, intro to javascript, project 2 discussion
AGENDA
• Talk about homework 4
• Intro to bootstrap and UI-kit
• Javascript exercises
• Review – how to communicate between the page and the script
• Functions and how to call them and write them
• Variables – initialization and scope
• Calling built-in functions – date, time, math functions, etc.
• Control flow – for loops, while loops, if/then/else
• Project 2
HOMEWORK 4
• New stuff in this homework
• Getting onto the server
• Using git clone to move your website to the server
• Integrating html, css, and js onto a page
• Old stuff revisited in this homework
• Editing files
• Creating a github project repository
• Adding files to that repo, committing, and pushing files to the server
UI FRAMEWORKS
• There are a number of different frameworks
• Some are just styling
• Bootstrap (from twitter)
• UI-Kit
• Some are more full-featured frameworks
• React
• Angular
• Vue
• For the most part, we are going to talk about the styling frameworks today
• Choose one and stick with it. I suggest bootstrap, but UI-Kit is my current favourite
for more advanced projects
BOOTSTRAP
• Built by Twitter originally, but open sourced and now has a large following
• Some features are built on top of jquery
• http://jquery.com/: “jQuery is a fast, small, and feature-rich JavaScript library. It makes things
like HTML document traversal and manipulation, event handling, animation, and Ajax much
simpler with an easy-to-use API that works across a multitude of browsers. With a
combination of versatility and extensibility, jQuery has changed the way that millions of
people write JavaScript.”
• We will not use jquery directly very much in this course, but know it exists
BOOTSTRAP
• Most functions are just CSS, though, and you invoke them by attaching classnames
to your HTML objects
• Remember last week when we wrote CSS to target by class? Using a period in the
CSS targets the styling by class name
• So in your HTML you can use classnames that have definitions in the bootstrap CSS
files
• For instance, in a button this makes it a “danger” button:
<a href="#" class="btn btn-danger">Danger</a>
BOOTSTRAP EXERCISE 1
• Using the button definitions below, create one of each of the five button types in
bootstrap:
• btn-default
• btn-primary
• btn-success
• btn-info
• btn-warning
• btn-danger
• Start from this as an example: http://jsfiddle.net/fv2ohh8y/3/
• Note the external resources!
EXERCISE 1 ANSWER
• http://jsfiddle.net/fv2ohh8y/4/
BOOTSTRAP EXERCISE 2
• Reference: http://www.w3schools.com/bootstrap/
• Example: https://jsfiddle.net/oazgbqay/7
• Play with the page, understand what a responsive UI means
• Using the refence above, edit the page so that a tooltip pops up over the gray area
at the top (the “jumbotron”) that reads “Hooray!”
EXERCISE 2 ANSWER
• https://jsfiddle.net/oazgbqay/8/
BOOTSTRAP THEMES
• Because the CSS is open source, by editing the bootstrap CSS and re-releasing,
many different visual styles are possible.
• https://bootswatch.com/ is a good source of some of these, but there are many
different sites
• https://jsfiddle.net/oazgbqay/9/
BOOTSTRAP TEMPLATES
• https://startbootstrap.com/template-categories/all/
• There are also many templates available to get you started with bootstrap that
provide a website starting point for you. Some are paid, many are free.
UI-KIT
• Really just an alternative to bootstrap. Different look. Some different functionality
• I like that it has an icon set you can use to keep all of your iconography consistent
• Reference: https://getuikit.com/docs/documentation_get-started.html
• Example: https://jsfiddle.net/k0xp1jzy/
USING BOOTSTRAP OR UI-KIT ON YOUR
PAGES RATHER THAN JSFIDDLE
• Easiest to use a CDN, but could also place the .js and .css files on your site directly
• http://getbootstrap.com/getting-started/
• https://getuikit.com/v2/docs/documentation_get-started.html
• <link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/uikit/2.xx.x/css/uikit.min.css" />
• <script
src="https://cdnjs.cloudflare.com/ajax/libs/uikit/2.xx.x/js/uikit.min.js"></script>
SOME JAVASCRIPT
• We’ll go through a number of exercises, but I want to review how to impact the
page from your javascript and how to launch your javascript from the page
• innerHTML is where the page contents are changed, but you have to first find the
object. So give each HTML object you’ll want to change an ID
• Then in the javascript use document.getElementById to find that object
• https://jsfiddle.net/3p9fm0w7/
TO REMEMBER!
• In jsfiddle, you’ll generally want to set your javascript to run in the body (click the
settings in the upper right of the javascript pane)
• And when you get into trouble and don’t see things working remember to use the
developer console (f-12 on PC, Cmd+Opt+I on Mac)
VARIABLES AND SCOPE
• Generally, variables in JS are global to the file that they are in, but there are many
exceptions that we’ll cover later
• Since scripts in the body are run when the page loads, you can initialize variables
outside of any function, and then use them from within functions
• So “var count = 0;” site outside the function
• “Count++;” sits inside the function
• https://jsfiddle.net/3p9fm0w7/1/
BUILT IN FUNCTIONS
• Date, math functions, etc
• A bit of a dense read, but here is a good reference
• https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects
DATE
• Let’s look at date more carefully
• The following example uses the console.log statement, so you’ll have to open your
developer console
• https://jsfiddle.net/mL75y122/
• Reference: https://developer.mozilla.org/en-
US/docs/Web/JavaScript/Reference/Global_Objects/Date
MATH
• Let’s look at a couple of math functions
• https://jsfiddle.net/v7tr5cov/
• Reference: https://developer.mozilla.org/en-
US/docs/Web/JavaScript/Reference/Global_Objects/Math
STRING
• Anything that manipulates text generally uses the string functions
• https://jsfiddle.net/r5Lckof3/1/
• A few things to note in here:
• The body onload is calling a function, that function must be declared before the body
(so in the head) which in jsfiddle is by changing the settings
• Strings are an array of characters, and you can reference individual characters to build
up a new string
CONTROL FLOW
• In the last example we used the setInterval function. This is a form of control flow in
that it re-runs the contents of that function every x milliseconds
• Most control flow expressions test a variable rather than the time, though
• For instance, the for loop looks at the state of a counter variable
• Notice the if statement here as well
• https://jsfiddle.net/6ewnaLp1/
PROJECT 2
• There will be a presentation, but nothing as formal as for project 1. No slides, no
changing computers. Just from my computer opening your website.
• Maximum 3 minutes per group, plus 2 minutes for questions. I will stop things if
they go long this time.
• Goal is to give your elevator pitch, backed up by showing the website
• Nothing needs to work, ie. No back-end is needed.
• But it needs to be responsive and styled properly
PROJECT 2 GRADING
• 15 points total
• 4 points for being properly hosted and checked into github
• I can open the page properly from my computer, it looks right, links work, and the code is
checked in
• 3 points for showing a proper github history (meaning that changes are checked in as
work progresses, good commit messages, everyone contributing)
• 5 points for well-designed and responsive styling of the page, using either your own CSS
or a framework like bootstrap or UI-Kit
• 3 points for javascript and behaviours leading to effective interaction
• These don’t need to tie to a database or a backend of any sort, these are display behaviours
HOMEWORK 5
• We’re going to start on a multi-week project to create a pizza ordering website
• Initially, this website will just have to show images of various toppings, and a button
next to each one.
• When the button is pressed that topping is added to the pizza and a total is shown
at the bottom
• The code is to be checked into github and running on your webserver, so you will
submit a link to your github project, and a link to it running on your server
• You do not need to ensure that a topping is added only once, but there should be a
clear button to clear the order
HOMEWORK 5
<img> tag for images (keep the images in
github and deploy to your site)
Buttons that call javascript
Javascript that adds to a running total, and
shows that total on the page
A clear button to zero the total and update
the display
A point for styling the page

More Related Content

What's hot

Untangling fall2017 week1
Untangling fall2017 week1Untangling fall2017 week1
Untangling fall2017 week1
Derek Jacoby
 
Untangling - fall2017 - week 7
Untangling - fall2017 - week 7Untangling - fall2017 - week 7
Untangling - fall2017 - week 7
Derek Jacoby
 
Untangling7
Untangling7Untangling7
Untangling7
Derek Jacoby
 
Untangling - fall2017 - week6
Untangling - fall2017 - week6Untangling - fall2017 - week6
Untangling - fall2017 - week6
Derek Jacoby
 
Untangling spring week12
Untangling spring week12Untangling spring week12
Untangling spring week12
Derek Jacoby
 
Untangling the web9
Untangling the web9Untangling the web9
Untangling the web9
Derek Jacoby
 
Untangling - fall2017 - week 9
Untangling - fall2017 - week 9Untangling - fall2017 - week 9
Untangling - fall2017 - week 9
Derek Jacoby
 
Untangling6
Untangling6Untangling6
Untangling6
Derek Jacoby
 
Untangling spring week2
Untangling spring week2Untangling spring week2
Untangling spring week2
Derek Jacoby
 
Untangling - fall2017 - week 8
Untangling - fall2017 - week 8Untangling - fall2017 - week 8
Untangling - fall2017 - week 8
Derek Jacoby
 
Untangling spring week7
Untangling spring week7Untangling spring week7
Untangling spring week7
Derek Jacoby
 
Untangling - fall2017 - week 10
Untangling - fall2017 - week 10Untangling - fall2017 - week 10
Untangling - fall2017 - week 10
Derek Jacoby
 
Untangling11
Untangling11Untangling11
Untangling11
Derek Jacoby
 
Untangling8
Untangling8Untangling8
Untangling8
Derek Jacoby
 
Why use Go for web development?
Why use Go for web development?Why use Go for web development?
Why use Go for web development?
Weng Wei
 
SharePoint Development 101
SharePoint Development 101SharePoint Development 101
SharePoint Development 101
Greg Hurlman
 
What is HTML 5?
What is HTML 5?What is HTML 5?
What is HTML 5?
Susan Winters
 
The development workflow of git github for beginners
The development workflow of git github for beginnersThe development workflow of git github for beginners
The development workflow of git github for beginners
Gunjan Patel
 
The What & Why of Pattern Lab
The What & Why of Pattern LabThe What & Why of Pattern Lab
The What & Why of Pattern Lab
Dave Olsen
 
Don't make me wait! or Building High-Performance Web Applications
Don't make me wait! or Building High-Performance Web ApplicationsDon't make me wait! or Building High-Performance Web Applications
Don't make me wait! or Building High-Performance Web Applications
Stoyan Stefanov
 

What's hot (20)

Untangling fall2017 week1
Untangling fall2017 week1Untangling fall2017 week1
Untangling fall2017 week1
 
Untangling - fall2017 - week 7
Untangling - fall2017 - week 7Untangling - fall2017 - week 7
Untangling - fall2017 - week 7
 
Untangling7
Untangling7Untangling7
Untangling7
 
Untangling - fall2017 - week6
Untangling - fall2017 - week6Untangling - fall2017 - week6
Untangling - fall2017 - week6
 
Untangling spring week12
Untangling spring week12Untangling spring week12
Untangling spring week12
 
Untangling the web9
Untangling the web9Untangling the web9
Untangling the web9
 
Untangling - fall2017 - week 9
Untangling - fall2017 - week 9Untangling - fall2017 - week 9
Untangling - fall2017 - week 9
 
Untangling6
Untangling6Untangling6
Untangling6
 
Untangling spring week2
Untangling spring week2Untangling spring week2
Untangling spring week2
 
Untangling - fall2017 - week 8
Untangling - fall2017 - week 8Untangling - fall2017 - week 8
Untangling - fall2017 - week 8
 
Untangling spring week7
Untangling spring week7Untangling spring week7
Untangling spring week7
 
Untangling - fall2017 - week 10
Untangling - fall2017 - week 10Untangling - fall2017 - week 10
Untangling - fall2017 - week 10
 
Untangling11
Untangling11Untangling11
Untangling11
 
Untangling8
Untangling8Untangling8
Untangling8
 
Why use Go for web development?
Why use Go for web development?Why use Go for web development?
Why use Go for web development?
 
SharePoint Development 101
SharePoint Development 101SharePoint Development 101
SharePoint Development 101
 
What is HTML 5?
What is HTML 5?What is HTML 5?
What is HTML 5?
 
The development workflow of git github for beginners
The development workflow of git github for beginnersThe development workflow of git github for beginners
The development workflow of git github for beginners
 
The What & Why of Pattern Lab
The What & Why of Pattern LabThe What & Why of Pattern Lab
The What & Why of Pattern Lab
 
Don't make me wait! or Building High-Performance Web Applications
Don't make me wait! or Building High-Performance Web ApplicationsDon't make me wait! or Building High-Performance Web Applications
Don't make me wait! or Building High-Performance Web Applications
 

Viewers also liked

Untangling spring week6
Untangling spring week6Untangling spring week6
Untangling spring week6
Derek Jacoby
 
Untangling spring week3
Untangling spring week3Untangling spring week3
Untangling spring week3
Derek Jacoby
 
Untangling spring week1
Untangling spring week1Untangling spring week1
Untangling spring week1
Derek Jacoby
 
Untangling the web week1
Untangling the web week1Untangling the web week1
Untangling the web week1
Derek Jacoby
 
Untangling the web week 2 - SEO
Untangling the web week 2 - SEOUntangling the web week 2 - SEO
Untangling the web week 2 - SEO
Derek Jacoby
 
Untangling4
Untangling4Untangling4
Untangling4
Derek Jacoby
 
Untangling the web - week 3
Untangling the web - week 3Untangling the web - week 3
Untangling the web - week 3
Derek Jacoby
 
How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your Niche
Leslie Samuel
 
Meta 4.2
Meta 4.2Meta 4.2
Discapacidad visual
Discapacidad visualDiscapacidad visual
Discapacidad visual
Laura Buchelli Lamprea
 
Mapa mental cooperativas
Mapa mental cooperativasMapa mental cooperativas
Mapa mental cooperativas
Ronny Ocanto
 
Ryan del rosario
Ryan del rosarioRyan del rosario
Ryan del rosario
yanyanz
 
Desigualdade de gênero no brasil
Desigualdade de gênero no brasilDesigualdade de gênero no brasil
Desigualdade de gênero no brasil
Fabio Cruz
 
Beyond the Gig Economy
Beyond the Gig EconomyBeyond the Gig Economy
Beyond the Gig Economy
Jon Lieber
 
Recovery: Job Growth and Education Requirements Through 2020
Recovery: Job Growth and Education Requirements Through 2020Recovery: Job Growth and Education Requirements Through 2020
Recovery: Job Growth and Education Requirements Through 2020
CEW Georgetown
 

Viewers also liked (15)

Untangling spring week6
Untangling spring week6Untangling spring week6
Untangling spring week6
 
Untangling spring week3
Untangling spring week3Untangling spring week3
Untangling spring week3
 
Untangling spring week1
Untangling spring week1Untangling spring week1
Untangling spring week1
 
Untangling the web week1
Untangling the web week1Untangling the web week1
Untangling the web week1
 
Untangling the web week 2 - SEO
Untangling the web week 2 - SEOUntangling the web week 2 - SEO
Untangling the web week 2 - SEO
 
Untangling4
Untangling4Untangling4
Untangling4
 
Untangling the web - week 3
Untangling the web - week 3Untangling the web - week 3
Untangling the web - week 3
 
How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your Niche
 
Meta 4.2
Meta 4.2Meta 4.2
Meta 4.2
 
Discapacidad visual
Discapacidad visualDiscapacidad visual
Discapacidad visual
 
Mapa mental cooperativas
Mapa mental cooperativasMapa mental cooperativas
Mapa mental cooperativas
 
Ryan del rosario
Ryan del rosarioRyan del rosario
Ryan del rosario
 
Desigualdade de gênero no brasil
Desigualdade de gênero no brasilDesigualdade de gênero no brasil
Desigualdade de gênero no brasil
 
Beyond the Gig Economy
Beyond the Gig EconomyBeyond the Gig Economy
Beyond the Gig Economy
 
Recovery: Job Growth and Education Requirements Through 2020
Recovery: Job Growth and Education Requirements Through 2020Recovery: Job Growth and Education Requirements Through 2020
Recovery: Job Growth and Education Requirements Through 2020
 

Similar to Untangling spring week5

Best Practices for Building WordPress Applications
Best Practices for Building WordPress ApplicationsBest Practices for Building WordPress Applications
Best Practices for Building WordPress Applications
Taylor Lovett
 
Pearls and Must-Have Tools for the Modern Web / .NET Developer
Pearls and Must-Have Tools for the Modern Web / .NET DeveloperPearls and Must-Have Tools for the Modern Web / .NET Developer
Pearls and Must-Have Tools for the Modern Web / .NET Developer
Ofer Zelig
 
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
Anupam Ranku
 
Welcome to React.pptx
Welcome to React.pptxWelcome to React.pptx
Welcome to React.pptx
PraveenKumar680401
 
Live Coverage at The New York Times
Live Coverage at The New York TimesLive Coverage at The New York Times
Live Coverage at The New York Times
Scott Taylor
 
Cypress report
Cypress reportCypress report
Cypress report
Adarsh
 
SharePoint Framework 101 (SPFx)
SharePoint Framework 101 (SPFx)SharePoint Framework 101 (SPFx)
SharePoint Framework 101 (SPFx)
Matthew J. Bailey , MCT
 
Introduction to web application development with Vue (for absolute beginners)...
Introduction to web application development with Vue (for absolute beginners)...Introduction to web application development with Vue (for absolute beginners)...
Introduction to web application development with Vue (for absolute beginners)...
Lucas Jellema
 
5 Common Mistakes You are Making on your Website
 5 Common Mistakes You are Making on your Website 5 Common Mistakes You are Making on your Website
5 Common Mistakes You are Making on your Website
Acquia
 
Spring insight what just happened
Spring insight   what just happenedSpring insight   what just happened
Spring insight what just happened
Boulder Java User's Group
 
Git Going w/ Git
Git Going w/ GitGit Going w/ Git
Git Going w/ Git
heyMP
 
Web component driven development
Web component driven developmentWeb component driven development
Web component driven development
Gil Fink
 
Sitecore development approach evolution – destination helix
Sitecore development approach evolution – destination helixSitecore development approach evolution – destination helix
Sitecore development approach evolution – destination helix
Peter Nazarov
 
Intro to html5 Boilerplate
Intro to html5 BoilerplateIntro to html5 Boilerplate
Intro to html5 Boilerplate
Michael Enslow
 
Masterin Large Scale Java Script Applications
Masterin Large Scale Java Script ApplicationsMasterin Large Scale Java Script Applications
Masterin Large Scale Java Script Applications
Fabian Jakobs
 
Training presentation.pptx
Training presentation.pptxTraining presentation.pptx
Training presentation.pptx
NishchaiyaBayla1
 
Beyond Domino Designer
Beyond Domino DesignerBeyond Domino Designer
Beyond Domino Designer
Paul Withers
 
Streams API (Web Engines Hackfest 2015)
Streams API (Web Engines Hackfest 2015)Streams API (Web Engines Hackfest 2015)
Streams API (Web Engines Hackfest 2015)
Igalia
 
Developing High Performance Web Apps - CodeMash 2011
Developing High Performance Web Apps - CodeMash 2011Developing High Performance Web Apps - CodeMash 2011
Developing High Performance Web Apps - CodeMash 2011
Timothy Fisher
 
Know the reason behind choosing bootstrap as css framework
Know the reason behind choosing bootstrap as css frameworkKnow the reason behind choosing bootstrap as css framework
Know the reason behind choosing bootstrap as css framework
Omkarsoft Bangalore
 

Similar to Untangling spring week5 (20)

Best Practices for Building WordPress Applications
Best Practices for Building WordPress ApplicationsBest Practices for Building WordPress Applications
Best Practices for Building WordPress Applications
 
Pearls and Must-Have Tools for the Modern Web / .NET Developer
Pearls and Must-Have Tools for the Modern Web / .NET DeveloperPearls and Must-Have Tools for the Modern Web / .NET Developer
Pearls and Must-Have Tools for the Modern Web / .NET Developer
 
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
 
Welcome to React.pptx
Welcome to React.pptxWelcome to React.pptx
Welcome to React.pptx
 
Live Coverage at The New York Times
Live Coverage at The New York TimesLive Coverage at The New York Times
Live Coverage at The New York Times
 
Cypress report
Cypress reportCypress report
Cypress report
 
SharePoint Framework 101 (SPFx)
SharePoint Framework 101 (SPFx)SharePoint Framework 101 (SPFx)
SharePoint Framework 101 (SPFx)
 
Introduction to web application development with Vue (for absolute beginners)...
Introduction to web application development with Vue (for absolute beginners)...Introduction to web application development with Vue (for absolute beginners)...
Introduction to web application development with Vue (for absolute beginners)...
 
5 Common Mistakes You are Making on your Website
 5 Common Mistakes You are Making on your Website 5 Common Mistakes You are Making on your Website
5 Common Mistakes You are Making on your Website
 
Spring insight what just happened
Spring insight   what just happenedSpring insight   what just happened
Spring insight what just happened
 
Git Going w/ Git
Git Going w/ GitGit Going w/ Git
Git Going w/ Git
 
Web component driven development
Web component driven developmentWeb component driven development
Web component driven development
 
Sitecore development approach evolution – destination helix
Sitecore development approach evolution – destination helixSitecore development approach evolution – destination helix
Sitecore development approach evolution – destination helix
 
Intro to html5 Boilerplate
Intro to html5 BoilerplateIntro to html5 Boilerplate
Intro to html5 Boilerplate
 
Masterin Large Scale Java Script Applications
Masterin Large Scale Java Script ApplicationsMasterin Large Scale Java Script Applications
Masterin Large Scale Java Script Applications
 
Training presentation.pptx
Training presentation.pptxTraining presentation.pptx
Training presentation.pptx
 
Beyond Domino Designer
Beyond Domino DesignerBeyond Domino Designer
Beyond Domino Designer
 
Streams API (Web Engines Hackfest 2015)
Streams API (Web Engines Hackfest 2015)Streams API (Web Engines Hackfest 2015)
Streams API (Web Engines Hackfest 2015)
 
Developing High Performance Web Apps - CodeMash 2011
Developing High Performance Web Apps - CodeMash 2011Developing High Performance Web Apps - CodeMash 2011
Developing High Performance Web Apps - CodeMash 2011
 
Know the reason behind choosing bootstrap as css framework
Know the reason behind choosing bootstrap as css frameworkKnow the reason behind choosing bootstrap as css framework
Know the reason behind choosing bootstrap as css framework
 

Recently uploaded

Brigada Eskwela editable Certificate.pptx
Brigada Eskwela editable Certificate.pptxBrigada Eskwela editable Certificate.pptx
Brigada Eskwela editable Certificate.pptx
aiofits06
 
Java Full Stack Developer Interview Questions PDF By ScholarHat
Java Full Stack Developer Interview Questions PDF By ScholarHatJava Full Stack Developer Interview Questions PDF By ScholarHat
Java Full Stack Developer Interview Questions PDF By ScholarHat
Scholarhat
 
Parkinson Disease & Anti-Parkinsonian Drugs.pptx
Parkinson Disease & Anti-Parkinsonian Drugs.pptxParkinson Disease & Anti-Parkinsonian Drugs.pptx
Parkinson Disease & Anti-Parkinsonian Drugs.pptx
AnujVishwakarma34
 
C++ Interview Questions and Answers PDF By ScholarHat
C++ Interview Questions and Answers PDF By ScholarHatC++ Interview Questions and Answers PDF By ScholarHat
C++ Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
Form for Brigada eskwela-04 SY 2024.docx
Form for Brigada eskwela-04 SY 2024.docxForm for Brigada eskwela-04 SY 2024.docx
Form for Brigada eskwela-04 SY 2024.docx
VenuzSayanAday
 
Life of Ah Gong and Ah Kim ~ A Story with Life Lessons (Hokkien, English & Ch...
Life of Ah Gong and Ah Kim ~ A Story with Life Lessons (Hokkien, English & Ch...Life of Ah Gong and Ah Kim ~ A Story with Life Lessons (Hokkien, English & Ch...
Life of Ah Gong and Ah Kim ~ A Story with Life Lessons (Hokkien, English & Ch...
OH TEIK BIN
 
How to Fix Field Does Not Exist Error in Odoo 17
How to Fix Field Does Not Exist Error in Odoo 17How to Fix Field Does Not Exist Error in Odoo 17
How to Fix Field Does Not Exist Error in Odoo 17
Celine George
 
classroom orientation/ back to school...
classroom orientation/ back to school...classroom orientation/ back to school...
classroom orientation/ back to school...
RoselleRaguindin
 
Why study French Mackenzie Neale PowerPoint
Why study French Mackenzie Neale PowerPointWhy study French Mackenzie Neale PowerPoint
Why study French Mackenzie Neale PowerPoint
nealem1
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
Pedagogy/Definition/Features/Approaches/Types
Pedagogy/Definition/Features/Approaches/TypesPedagogy/Definition/Features/Approaches/Types
Pedagogy/Definition/Features/Approaches/Types
SobiaAlvi
 
Email Marketing in Odoo 17 - Odoo 17 Slides
Email Marketing  in Odoo 17 - Odoo 17 SlidesEmail Marketing  in Odoo 17 - Odoo 17 Slides
Email Marketing in Odoo 17 - Odoo 17 Slides
Celine George
 
FINAL MATATAG PE and Health CG 2023 Grades 4-10.pdf
FINAL MATATAG PE and Health CG 2023 Grades 4-10.pdfFINAL MATATAG PE and Health CG 2023 Grades 4-10.pdf
FINAL MATATAG PE and Health CG 2023 Grades 4-10.pdf
HayddieMaeCapunong
 
Production Technology of Mango in Nepal.pptx
Production Technology of Mango in Nepal.pptxProduction Technology of Mango in Nepal.pptx
Production Technology of Mango in Nepal.pptx
UmeshTimilsina1
 
Dr. Nasir Mustafa CERTIFICATE OF APPRECIATION "NEUROANATOMY"
Dr. Nasir Mustafa CERTIFICATE OF APPRECIATION "NEUROANATOMY"Dr. Nasir Mustafa CERTIFICATE OF APPRECIATION "NEUROANATOMY"
Dr. Nasir Mustafa CERTIFICATE OF APPRECIATION "NEUROANATOMY"
Dr. Nasir Mustafa
 
Lecture Notes Unit5 chapter 15 PL/SQL Programming
Lecture Notes Unit5 chapter 15 PL/SQL ProgrammingLecture Notes Unit5 chapter 15 PL/SQL Programming
Lecture Notes Unit5 chapter 15 PL/SQL Programming
Murugan146644
 
VRS An Strategic Approch to Meet Need of Organisation.pptx
VRS An Strategic Approch to Meet Need of Organisation.pptxVRS An Strategic Approch to Meet Need of Organisation.pptx
VRS An Strategic Approch to Meet Need of Organisation.pptx
Banker and Adjunct Lecturer
 
SQL Server Interview Questions PDF By ScholarHat
SQL Server Interview Questions PDF By ScholarHatSQL Server Interview Questions PDF By ScholarHat
SQL Server Interview Questions PDF By ScholarHat
Scholarhat
 
PRESS RELEASE - UNIVERSITY OF GHANA, JULY 16, 2024.pdf
PRESS RELEASE - UNIVERSITY OF GHANA, JULY 16, 2024.pdfPRESS RELEASE - UNIVERSITY OF GHANA, JULY 16, 2024.pdf
PRESS RELEASE - UNIVERSITY OF GHANA, JULY 16, 2024.pdf
nservice241
 

Recently uploaded (20)

Brigada Eskwela editable Certificate.pptx
Brigada Eskwela editable Certificate.pptxBrigada Eskwela editable Certificate.pptx
Brigada Eskwela editable Certificate.pptx
 
Java Full Stack Developer Interview Questions PDF By ScholarHat
Java Full Stack Developer Interview Questions PDF By ScholarHatJava Full Stack Developer Interview Questions PDF By ScholarHat
Java Full Stack Developer Interview Questions PDF By ScholarHat
 
Parkinson Disease & Anti-Parkinsonian Drugs.pptx
Parkinson Disease & Anti-Parkinsonian Drugs.pptxParkinson Disease & Anti-Parkinsonian Drugs.pptx
Parkinson Disease & Anti-Parkinsonian Drugs.pptx
 
C++ Interview Questions and Answers PDF By ScholarHat
C++ Interview Questions and Answers PDF By ScholarHatC++ Interview Questions and Answers PDF By ScholarHat
C++ Interview Questions and Answers PDF By ScholarHat
 
Form for Brigada eskwela-04 SY 2024.docx
Form for Brigada eskwela-04 SY 2024.docxForm for Brigada eskwela-04 SY 2024.docx
Form for Brigada eskwela-04 SY 2024.docx
 
Life of Ah Gong and Ah Kim ~ A Story with Life Lessons (Hokkien, English & Ch...
Life of Ah Gong and Ah Kim ~ A Story with Life Lessons (Hokkien, English & Ch...Life of Ah Gong and Ah Kim ~ A Story with Life Lessons (Hokkien, English & Ch...
Life of Ah Gong and Ah Kim ~ A Story with Life Lessons (Hokkien, English & Ch...
 
How to Fix Field Does Not Exist Error in Odoo 17
How to Fix Field Does Not Exist Error in Odoo 17How to Fix Field Does Not Exist Error in Odoo 17
How to Fix Field Does Not Exist Error in Odoo 17
 
classroom orientation/ back to school...
classroom orientation/ back to school...classroom orientation/ back to school...
classroom orientation/ back to school...
 
Why study French Mackenzie Neale PowerPoint
Why study French Mackenzie Neale PowerPointWhy study French Mackenzie Neale PowerPoint
Why study French Mackenzie Neale PowerPoint
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
Pedagogy/Definition/Features/Approaches/Types
Pedagogy/Definition/Features/Approaches/TypesPedagogy/Definition/Features/Approaches/Types
Pedagogy/Definition/Features/Approaches/Types
 
UM “ATÉ JÁ” ANIMADO! . .
UM “ATÉ JÁ” ANIMADO!                        .            .UM “ATÉ JÁ” ANIMADO!                        .            .
UM “ATÉ JÁ” ANIMADO! . .
 
Email Marketing in Odoo 17 - Odoo 17 Slides
Email Marketing  in Odoo 17 - Odoo 17 SlidesEmail Marketing  in Odoo 17 - Odoo 17 Slides
Email Marketing in Odoo 17 - Odoo 17 Slides
 
FINAL MATATAG PE and Health CG 2023 Grades 4-10.pdf
FINAL MATATAG PE and Health CG 2023 Grades 4-10.pdfFINAL MATATAG PE and Health CG 2023 Grades 4-10.pdf
FINAL MATATAG PE and Health CG 2023 Grades 4-10.pdf
 
Production Technology of Mango in Nepal.pptx
Production Technology of Mango in Nepal.pptxProduction Technology of Mango in Nepal.pptx
Production Technology of Mango in Nepal.pptx
 
Dr. Nasir Mustafa CERTIFICATE OF APPRECIATION "NEUROANATOMY"
Dr. Nasir Mustafa CERTIFICATE OF APPRECIATION "NEUROANATOMY"Dr. Nasir Mustafa CERTIFICATE OF APPRECIATION "NEUROANATOMY"
Dr. Nasir Mustafa CERTIFICATE OF APPRECIATION "NEUROANATOMY"
 
Lecture Notes Unit5 chapter 15 PL/SQL Programming
Lecture Notes Unit5 chapter 15 PL/SQL ProgrammingLecture Notes Unit5 chapter 15 PL/SQL Programming
Lecture Notes Unit5 chapter 15 PL/SQL Programming
 
VRS An Strategic Approch to Meet Need of Organisation.pptx
VRS An Strategic Approch to Meet Need of Organisation.pptxVRS An Strategic Approch to Meet Need of Organisation.pptx
VRS An Strategic Approch to Meet Need of Organisation.pptx
 
SQL Server Interview Questions PDF By ScholarHat
SQL Server Interview Questions PDF By ScholarHatSQL Server Interview Questions PDF By ScholarHat
SQL Server Interview Questions PDF By ScholarHat
 
PRESS RELEASE - UNIVERSITY OF GHANA, JULY 16, 2024.pdf
PRESS RELEASE - UNIVERSITY OF GHANA, JULY 16, 2024.pdfPRESS RELEASE - UNIVERSITY OF GHANA, JULY 16, 2024.pdf
PRESS RELEASE - UNIVERSITY OF GHANA, JULY 16, 2024.pdf
 

Untangling spring week5

  • 1. UNTANGLING THE WEB Week 5: front end frameworks, intro to javascript, project 2 discussion
  • 2. AGENDA • Talk about homework 4 • Intro to bootstrap and UI-kit • Javascript exercises • Review – how to communicate between the page and the script • Functions and how to call them and write them • Variables – initialization and scope • Calling built-in functions – date, time, math functions, etc. • Control flow – for loops, while loops, if/then/else • Project 2
  • 3. HOMEWORK 4 • New stuff in this homework • Getting onto the server • Using git clone to move your website to the server • Integrating html, css, and js onto a page • Old stuff revisited in this homework • Editing files • Creating a github project repository • Adding files to that repo, committing, and pushing files to the server
  • 4. UI FRAMEWORKS • There are a number of different frameworks • Some are just styling • Bootstrap (from twitter) • UI-Kit • Some are more full-featured frameworks • React • Angular • Vue • For the most part, we are going to talk about the styling frameworks today • Choose one and stick with it. I suggest bootstrap, but UI-Kit is my current favourite for more advanced projects
  • 5. BOOTSTRAP • Built by Twitter originally, but open sourced and now has a large following • Some features are built on top of jquery • http://jquery.com/: “jQuery is a fast, small, and feature-rich JavaScript library. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers. With a combination of versatility and extensibility, jQuery has changed the way that millions of people write JavaScript.” • We will not use jquery directly very much in this course, but know it exists
  • 6. BOOTSTRAP • Most functions are just CSS, though, and you invoke them by attaching classnames to your HTML objects • Remember last week when we wrote CSS to target by class? Using a period in the CSS targets the styling by class name • So in your HTML you can use classnames that have definitions in the bootstrap CSS files • For instance, in a button this makes it a “danger” button: <a href="#" class="btn btn-danger">Danger</a>
  • 7. BOOTSTRAP EXERCISE 1 • Using the button definitions below, create one of each of the five button types in bootstrap: • btn-default • btn-primary • btn-success • btn-info • btn-warning • btn-danger • Start from this as an example: http://jsfiddle.net/fv2ohh8y/3/ • Note the external resources!
  • 8. EXERCISE 1 ANSWER • http://jsfiddle.net/fv2ohh8y/4/
  • 9. BOOTSTRAP EXERCISE 2 • Reference: http://www.w3schools.com/bootstrap/ • Example: https://jsfiddle.net/oazgbqay/7 • Play with the page, understand what a responsive UI means • Using the refence above, edit the page so that a tooltip pops up over the gray area at the top (the “jumbotron”) that reads “Hooray!”
  • 10. EXERCISE 2 ANSWER • https://jsfiddle.net/oazgbqay/8/
  • 11. BOOTSTRAP THEMES • Because the CSS is open source, by editing the bootstrap CSS and re-releasing, many different visual styles are possible. • https://bootswatch.com/ is a good source of some of these, but there are many different sites • https://jsfiddle.net/oazgbqay/9/
  • 12. BOOTSTRAP TEMPLATES • https://startbootstrap.com/template-categories/all/ • There are also many templates available to get you started with bootstrap that provide a website starting point for you. Some are paid, many are free.
  • 13. UI-KIT • Really just an alternative to bootstrap. Different look. Some different functionality • I like that it has an icon set you can use to keep all of your iconography consistent • Reference: https://getuikit.com/docs/documentation_get-started.html • Example: https://jsfiddle.net/k0xp1jzy/
  • 14. USING BOOTSTRAP OR UI-KIT ON YOUR PAGES RATHER THAN JSFIDDLE • Easiest to use a CDN, but could also place the .js and .css files on your site directly • http://getbootstrap.com/getting-started/ • https://getuikit.com/v2/docs/documentation_get-started.html • <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/uikit/2.xx.x/css/uikit.min.css" /> • <script src="https://cdnjs.cloudflare.com/ajax/libs/uikit/2.xx.x/js/uikit.min.js"></script>
  • 15. SOME JAVASCRIPT • We’ll go through a number of exercises, but I want to review how to impact the page from your javascript and how to launch your javascript from the page • innerHTML is where the page contents are changed, but you have to first find the object. So give each HTML object you’ll want to change an ID • Then in the javascript use document.getElementById to find that object • https://jsfiddle.net/3p9fm0w7/
  • 16. TO REMEMBER! • In jsfiddle, you’ll generally want to set your javascript to run in the body (click the settings in the upper right of the javascript pane) • And when you get into trouble and don’t see things working remember to use the developer console (f-12 on PC, Cmd+Opt+I on Mac)
  • 17. VARIABLES AND SCOPE • Generally, variables in JS are global to the file that they are in, but there are many exceptions that we’ll cover later • Since scripts in the body are run when the page loads, you can initialize variables outside of any function, and then use them from within functions • So “var count = 0;” site outside the function • “Count++;” sits inside the function • https://jsfiddle.net/3p9fm0w7/1/
  • 18. BUILT IN FUNCTIONS • Date, math functions, etc • A bit of a dense read, but here is a good reference • https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects
  • 19. DATE • Let’s look at date more carefully • The following example uses the console.log statement, so you’ll have to open your developer console • https://jsfiddle.net/mL75y122/ • Reference: https://developer.mozilla.org/en- US/docs/Web/JavaScript/Reference/Global_Objects/Date
  • 20. MATH • Let’s look at a couple of math functions • https://jsfiddle.net/v7tr5cov/ • Reference: https://developer.mozilla.org/en- US/docs/Web/JavaScript/Reference/Global_Objects/Math
  • 21. STRING • Anything that manipulates text generally uses the string functions • https://jsfiddle.net/r5Lckof3/1/ • A few things to note in here: • The body onload is calling a function, that function must be declared before the body (so in the head) which in jsfiddle is by changing the settings • Strings are an array of characters, and you can reference individual characters to build up a new string
  • 22. CONTROL FLOW • In the last example we used the setInterval function. This is a form of control flow in that it re-runs the contents of that function every x milliseconds • Most control flow expressions test a variable rather than the time, though • For instance, the for loop looks at the state of a counter variable • Notice the if statement here as well • https://jsfiddle.net/6ewnaLp1/
  • 23. PROJECT 2 • There will be a presentation, but nothing as formal as for project 1. No slides, no changing computers. Just from my computer opening your website. • Maximum 3 minutes per group, plus 2 minutes for questions. I will stop things if they go long this time. • Goal is to give your elevator pitch, backed up by showing the website • Nothing needs to work, ie. No back-end is needed. • But it needs to be responsive and styled properly
  • 24. PROJECT 2 GRADING • 15 points total • 4 points for being properly hosted and checked into github • I can open the page properly from my computer, it looks right, links work, and the code is checked in • 3 points for showing a proper github history (meaning that changes are checked in as work progresses, good commit messages, everyone contributing) • 5 points for well-designed and responsive styling of the page, using either your own CSS or a framework like bootstrap or UI-Kit • 3 points for javascript and behaviours leading to effective interaction • These don’t need to tie to a database or a backend of any sort, these are display behaviours
  • 25. HOMEWORK 5 • We’re going to start on a multi-week project to create a pizza ordering website • Initially, this website will just have to show images of various toppings, and a button next to each one. • When the button is pressed that topping is added to the pizza and a total is shown at the bottom • The code is to be checked into github and running on your webserver, so you will submit a link to your github project, and a link to it running on your server • You do not need to ensure that a topping is added only once, but there should be a clear button to clear the order
  • 26. HOMEWORK 5 <img> tag for images (keep the images in github and deploy to your site) Buttons that call javascript Javascript that adds to a running total, and shows that total on the page A clear button to zero the total and update the display A point for styling the page