SlideShare ist ein Scribd-Unternehmen logo
1 von 26
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

Weitere ähnliche Inhalte

Was ist angesagt?

Untangling fall2017 week1
Untangling fall2017 week1Untangling fall2017 week1
Untangling fall2017 week1Derek Jacoby
 
Untangling - fall2017 - week 7
Untangling - fall2017 - week 7Untangling - fall2017 - week 7
Untangling - fall2017 - week 7Derek Jacoby
 
Untangling - fall2017 - week6
Untangling - fall2017 - week6Untangling - fall2017 - week6
Untangling - fall2017 - week6Derek Jacoby
 
Untangling spring week12
Untangling spring week12Untangling spring week12
Untangling spring week12Derek Jacoby
 
Untangling the web9
Untangling the web9Untangling the web9
Untangling the web9Derek Jacoby
 
Untangling - fall2017 - week 9
Untangling - fall2017 - week 9Untangling - fall2017 - week 9
Untangling - fall2017 - week 9Derek Jacoby
 
Untangling spring week2
Untangling spring week2Untangling spring week2
Untangling spring week2Derek Jacoby
 
Untangling - fall2017 - week 8
Untangling - fall2017 - week 8Untangling - fall2017 - week 8
Untangling - fall2017 - week 8Derek Jacoby
 
Untangling spring week7
Untangling spring week7Untangling spring week7
Untangling spring week7Derek Jacoby
 
Untangling - fall2017 - week 10
Untangling - fall2017 - week 10Untangling - fall2017 - week 10
Untangling - fall2017 - week 10Derek 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 101Greg Hurlman
 
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 beginnersGunjan Patel
 
The What & Why of Pattern Lab
The What & Why of Pattern LabThe What & Why of Pattern Lab
The What & Why of Pattern LabDave 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 ApplicationsStoyan Stefanov
 

Was ist angesagt? (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
 

Andere mochten auch

Untangling spring week6
Untangling spring week6Untangling spring week6
Untangling spring week6Derek Jacoby
 
Untangling spring week3
Untangling spring week3Untangling spring week3
Untangling spring week3Derek Jacoby
 
Untangling spring week1
Untangling spring week1Untangling spring week1
Untangling spring week1Derek Jacoby
 
Untangling the web week1
Untangling the web week1Untangling the web week1
Untangling the web week1Derek Jacoby
 
Untangling the web week 2 - SEO
Untangling the web week 2 - SEOUntangling the web week 2 - SEO
Untangling the web week 2 - SEODerek Jacoby
 
Untangling the web - week 3
Untangling the web - week 3Untangling the web - week 3
Untangling the web - week 3Derek 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 NicheLeslie Samuel
 
Mapa mental cooperativas
Mapa mental cooperativasMapa mental cooperativas
Mapa mental cooperativasRonny Ocanto
 
Ryan del rosario
Ryan del rosarioRyan del rosario
Ryan del rosarioyanyanz
 
Desigualdade de gênero no brasil
Desigualdade de gênero no brasilDesigualdade de gênero no brasil
Desigualdade de gênero no brasilFabio Cruz
 
Beyond the Gig Economy
Beyond the Gig EconomyBeyond the Gig Economy
Beyond the Gig EconomyJon 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 2020CEW Georgetown
 

Andere mochten auch (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
 

Ähnlich wie 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 ApplicationsTaylor 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 DeveloperOfer 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
 
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 TimesScott Taylor
 
Cypress report
Cypress reportCypress report
Cypress reportAdarsh
 
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 WebsiteAcquia
 
Git Going w/ Git
Git Going w/ GitGit Going w/ Git
Git Going w/ GitheyMP
 
Web component driven development
Web component driven developmentWeb component driven development
Web component driven developmentGil Fink
 
Sitecore development approach evolution – destination helix
Sitecore development approach evolution – destination helixSitecore development approach evolution – destination helix
Sitecore development approach evolution – destination helixPeter Nazarov
 
Intro to html5 Boilerplate
Intro to html5 BoilerplateIntro to html5 Boilerplate
Intro to html5 BoilerplateMichael Enslow
 
Masterin Large Scale Java Script Applications
Masterin Large Scale Java Script ApplicationsMasterin Large Scale Java Script Applications
Masterin Large Scale Java Script ApplicationsFabian Jakobs
 
Training presentation.pptx
Training presentation.pptxTraining presentation.pptx
Training presentation.pptxNishchaiyaBayla1
 
Beyond Domino Designer
Beyond Domino DesignerBeyond Domino Designer
Beyond Domino DesignerPaul 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 2011Timothy 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 frameworkOmkarsoft Bangalore
 

Ähnlich wie 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
 

Kürzlich hochgeladen

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701bronxfugly43
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 

Kürzlich hochgeladen (20)

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 

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