SlideShare a Scribd company logo
While your waiting...

• You will want to get:
  • https://github.com/MacBoyPro/
    simple_animation

  • git@github.com:MacBoyPro/
    simple_animation.git
Interactive Graphics
   w/ Javascript,
  HTML5 and CSS3
      Lee Lundrigan
Who am I?
• Employer: Blazing Cloud, Inc.
• Job: Software Engineer
• Languages: HTML, CSS, Javascript,
  Ruby, Objective-C, Java
• Gold star
  • Wrote a cross mobile browser CSS
    framework that ran on iPhone,
    Android, Blackberry and WinMo
Who are YOU?
Tools of the trade
• Oxygen XML Editor
 • http://www.oxygenxml.com
• Aptana
 • http://www.aptana.com
• TextEdit (on Mac)
• TextPad (on Windows)
Course Topics
• Animation
  • 2D and 3D / HTML5 Canvas
  • Collision detection
  • Sprites
  • Sound
• Interaction
• Best practices
Vocab


vec·tor /ˈvektər/
Noun: A quantity having direction as
well as magnitude, esp. as determining
the position of one point in space
relative to another.

                         10
                               15
hertz (Hz)
a unit of frequency of one cycle per
second. Ex. 60Hz = 60 times per second

’tween/twēn/
Contraction: time between. The process
of creating in between frames.
Coordinate System

• Cartesian Coordinate System
 • Starts in upper left
 • Origin is (0,0)
                   0
               0
Animation

• setInterval(code,millisec);
  • repeats until cleared
• setTimeout(code, millisec);
  • Fires the event once
• Note: There are 1000 milliseconds in
  one second.
Animation Cont...


function draw() {
    ball.x += 10;
}
Lab - Simple Animation
Collision Detection


• Bounding box
• Test using object’s center
  • {x: 10, y: 10}
Sound

• HTML5 <embed> Tag
  <embed src="pong.mp3" id=”pong
  ”width=”0” height=”0”
  autostart=”false”/>
• Get the object by id
• Call the Play() method
Keyboard Movement
• document.onkeydown
 • detect character code
   • left: 37 right: 39
 • set moving true
• document.onkeyup
 • set moving false
Keyboard Movement
        Cont...


• Webkit based browsers have a bug
 • the keypress event doesn’t work for
   the arrow keys
Lab - Game time
Ad

Recommended

Iagc2
Iagc2
Lee Lundrigan
 
Interactive Graphics
Interactive Graphics
Blazing Cloud
 
Interactive Graphics w/ Javascript, HTML5 and CSS3
Interactive Graphics w/ Javascript, HTML5 and CSS3
Blazing Cloud
 
HTML5 Canvas
HTML5 Canvas
Robyn Overstreet
 
Introduction to HTML5 Canvas
Introduction to HTML5 Canvas
Mindy McAdams
 
HTML 5_Canvas
HTML 5_Canvas
Vishakha Vaidya
 
Intro to HTML5 Canvas
Intro to HTML5 Canvas
Juho Vepsäläinen
 
Html5 canvas
Html5 canvas
Gary Yeh
 
Drawing with the HTML5 Canvas
Drawing with the HTML5 Canvas
Henry Osborne
 
Fast rendering with starling
Fast rendering with starling
Flash Conference
 
Scalable Assets Presentation
Scalable Assets Presentation
Nigel Barber
 
Mongo db washington dc 2014
Mongo db washington dc 2014
ikanow
 
Canvas in html5 - TungVD
Canvas in html5 - TungVD
Framgia Vietnam
 
nunuStudio Geometrix 2017
nunuStudio Geometrix 2017
José Ferrão
 
Improving Game Performance in the Browser
Improving Game Performance in the Browser
FITC
 
Tiling and Zooming ASCII Art @ iOSoho
Tiling and Zooming ASCII Art @ iOSoho
Daniel Doubrovkine
 
Pruebas mostrando pdf's
Pruebas mostrando pdf's
recepcioncedir
 
Photoshop
Photoshop
Soraya Elsayed
 
Interactive Vector-Graphics in the Browser
Interactive Vector-Graphics in the Browser
tec
 
Introduction about wireframing and responsive webdesign
Introduction about wireframing and responsive webdesign
ipmindthegap
 
Google's Principle's of Mobile Website Design
Google's Principle's of Mobile Website Design
Mrkt360 Inc.
 
Lecture3
Lecture3
Lee Lundrigan
 
Next Steps in Responsive Design
Next Steps in Responsive Design
Justin Avery
 
Webdesign New
Webdesign New
lyngdoh
 
10 Design and Layout Principles Guaranteed to Improve Your Website V2
10 Design and Layout Principles Guaranteed to Improve Your Website V2
Lauren Martin
 
CSS Dasar #6 : Background
CSS Dasar #6 : Background
Sandhika Galih
 
CSS Layout Techniques
CSS Layout Techniques
Harshal Patil
 
How to Make HTML and CSS Files
How to Make HTML and CSS Files
LearningNerd
 
CSS Layouting #5 : Position
CSS Layouting #5 : Position
Sandhika Galih
 
CSS Box Model Presentation
CSS Box Model Presentation
Reed Crouch
 

More Related Content

What's hot (10)

Drawing with the HTML5 Canvas
Drawing with the HTML5 Canvas
Henry Osborne
 
Fast rendering with starling
Fast rendering with starling
Flash Conference
 
Scalable Assets Presentation
Scalable Assets Presentation
Nigel Barber
 
Mongo db washington dc 2014
Mongo db washington dc 2014
ikanow
 
Canvas in html5 - TungVD
Canvas in html5 - TungVD
Framgia Vietnam
 
nunuStudio Geometrix 2017
nunuStudio Geometrix 2017
José Ferrão
 
Improving Game Performance in the Browser
Improving Game Performance in the Browser
FITC
 
Tiling and Zooming ASCII Art @ iOSoho
Tiling and Zooming ASCII Art @ iOSoho
Daniel Doubrovkine
 
Pruebas mostrando pdf's
Pruebas mostrando pdf's
recepcioncedir
 
Photoshop
Photoshop
Soraya Elsayed
 
Drawing with the HTML5 Canvas
Drawing with the HTML5 Canvas
Henry Osborne
 
Fast rendering with starling
Fast rendering with starling
Flash Conference
 
Scalable Assets Presentation
Scalable Assets Presentation
Nigel Barber
 
Mongo db washington dc 2014
Mongo db washington dc 2014
ikanow
 
Canvas in html5 - TungVD
Canvas in html5 - TungVD
Framgia Vietnam
 
nunuStudio Geometrix 2017
nunuStudio Geometrix 2017
José Ferrão
 
Improving Game Performance in the Browser
Improving Game Performance in the Browser
FITC
 
Tiling and Zooming ASCII Art @ iOSoho
Tiling and Zooming ASCII Art @ iOSoho
Daniel Doubrovkine
 
Pruebas mostrando pdf's
Pruebas mostrando pdf's
recepcioncedir
 

Viewers also liked (20)

Interactive Vector-Graphics in the Browser
Interactive Vector-Graphics in the Browser
tec
 
Introduction about wireframing and responsive webdesign
Introduction about wireframing and responsive webdesign
ipmindthegap
 
Google's Principle's of Mobile Website Design
Google's Principle's of Mobile Website Design
Mrkt360 Inc.
 
Lecture3
Lecture3
Lee Lundrigan
 
Next Steps in Responsive Design
Next Steps in Responsive Design
Justin Avery
 
Webdesign New
Webdesign New
lyngdoh
 
10 Design and Layout Principles Guaranteed to Improve Your Website V2
10 Design and Layout Principles Guaranteed to Improve Your Website V2
Lauren Martin
 
CSS Dasar #6 : Background
CSS Dasar #6 : Background
Sandhika Galih
 
CSS Layout Techniques
CSS Layout Techniques
Harshal Patil
 
How to Make HTML and CSS Files
How to Make HTML and CSS Files
LearningNerd
 
CSS Layouting #5 : Position
CSS Layouting #5 : Position
Sandhika Galih
 
CSS Box Model Presentation
CSS Box Model Presentation
Reed Crouch
 
CSS Box Model
CSS Box Model
Gerson Abesamis
 
Css box model
Css box model
Nicha Jutasirivongse
 
CSS Layouting #3 : Box Model
CSS Layouting #3 : Box Model
Sandhika Galih
 
CSS, CSS Selectors, CSS Box Model
CSS, CSS Selectors, CSS Box Model
jamiecavanaugh
 
Responsive webdesign
Responsive webdesign
Bart De Waele
 
5.1 css box model
5.1 css box model
Bulldogs83
 
Responsive web designing ppt(1)
Responsive web designing ppt(1)
admecindia1
 
10 Design & Layout Principles Guaranteed To Improve
10 Design & Layout Principles Guaranteed To Improve
Lauren Martin
 
Interactive Vector-Graphics in the Browser
Interactive Vector-Graphics in the Browser
tec
 
Introduction about wireframing and responsive webdesign
Introduction about wireframing and responsive webdesign
ipmindthegap
 
Google's Principle's of Mobile Website Design
Google's Principle's of Mobile Website Design
Mrkt360 Inc.
 
Next Steps in Responsive Design
Next Steps in Responsive Design
Justin Avery
 
Webdesign New
Webdesign New
lyngdoh
 
10 Design and Layout Principles Guaranteed to Improve Your Website V2
10 Design and Layout Principles Guaranteed to Improve Your Website V2
Lauren Martin
 
CSS Dasar #6 : Background
CSS Dasar #6 : Background
Sandhika Galih
 
CSS Layout Techniques
CSS Layout Techniques
Harshal Patil
 
How to Make HTML and CSS Files
How to Make HTML and CSS Files
LearningNerd
 
CSS Layouting #5 : Position
CSS Layouting #5 : Position
Sandhika Galih
 
CSS Box Model Presentation
CSS Box Model Presentation
Reed Crouch
 
CSS Layouting #3 : Box Model
CSS Layouting #3 : Box Model
Sandhika Galih
 
CSS, CSS Selectors, CSS Box Model
CSS, CSS Selectors, CSS Box Model
jamiecavanaugh
 
Responsive webdesign
Responsive webdesign
Bart De Waele
 
5.1 css box model
5.1 css box model
Bulldogs83
 
Responsive web designing ppt(1)
Responsive web designing ppt(1)
admecindia1
 
10 Design & Layout Principles Guaranteed To Improve
10 Design & Layout Principles Guaranteed To Improve
Lauren Martin
 
Ad

Similar to Interactive Graphics using Javascript, HTML5 and CSS3 (20)

XRobots
XRobots
Dr. Jan Köhnlein
 
Building a game engine with jQuery
Building a game engine with jQuery
Paul Bakaus
 
Mobile Web Development with HTML5
Mobile Web Development with HTML5
Roy Clarkson
 
Using Smalltalk for controlling robotics systems
Using Smalltalk for controlling robotics systems
Serge Stinckwich
 
HTML5 Animation in Mobile Web Games
HTML5 Animation in Mobile Web Games
livedoor
 
An Introduction to Go
An Introduction to Go
Cloudflare
 
Khan Academy Computer Science
Khan Academy Computer Science
jeresig
 
Yavorsky
Yavorsky
Maksym Stepanchuk
 
Build a game with javascript (may 21 atlanta)
Build a game with javascript (may 21 atlanta)
Thinkful
 
2015 Pharo Prague Lambda Meetup
2015 Pharo Prague Lambda Meetup
Pharo
 
Stupid Canvas Tricks
Stupid Canvas Tricks
deanhudson
 
Making HTML5 Mobile Games Indistinguishable from Native Apps
Making HTML5 Mobile Games Indistinguishable from Native Apps
FITC
 
COMP 4026 Lecture 5 OpenFrameworks and Soli
COMP 4026 Lecture 5 OpenFrameworks and Soli
Mark Billinghurst
 
Building Dynamic AWS Lambda Applications with BoxLang
Building Dynamic AWS Lambda Applications with BoxLang
Ortus Solutions, Corp
 
Building Dynamic AWS Lambda Applications with BoxLang
Building Dynamic AWS Lambda Applications with BoxLang
Ortus Solutions, Corp
 
Mobile native-hacks
Mobile native-hacks
DevelopmentArc LLC
 
20120514 nodejsdublin
20120514 nodejsdublin
Richard Rodger
 
Playing in Tune: How We Refactored Cube to Terabyte Scale
Playing in Tune: How We Refactored Cube to Terabyte Scale
MongoDB
 
Harmony intune final
Harmony intune final
MongoDB
 
BINARY DATA ADVENTURES IN BROWSER JAVASCRIPT
BINARY DATA ADVENTURES IN BROWSER JAVASCRIPT
Or Hiltch
 
Building a game engine with jQuery
Building a game engine with jQuery
Paul Bakaus
 
Mobile Web Development with HTML5
Mobile Web Development with HTML5
Roy Clarkson
 
Using Smalltalk for controlling robotics systems
Using Smalltalk for controlling robotics systems
Serge Stinckwich
 
HTML5 Animation in Mobile Web Games
HTML5 Animation in Mobile Web Games
livedoor
 
An Introduction to Go
An Introduction to Go
Cloudflare
 
Khan Academy Computer Science
Khan Academy Computer Science
jeresig
 
Build a game with javascript (may 21 atlanta)
Build a game with javascript (may 21 atlanta)
Thinkful
 
2015 Pharo Prague Lambda Meetup
2015 Pharo Prague Lambda Meetup
Pharo
 
Stupid Canvas Tricks
Stupid Canvas Tricks
deanhudson
 
Making HTML5 Mobile Games Indistinguishable from Native Apps
Making HTML5 Mobile Games Indistinguishable from Native Apps
FITC
 
COMP 4026 Lecture 5 OpenFrameworks and Soli
COMP 4026 Lecture 5 OpenFrameworks and Soli
Mark Billinghurst
 
Building Dynamic AWS Lambda Applications with BoxLang
Building Dynamic AWS Lambda Applications with BoxLang
Ortus Solutions, Corp
 
Building Dynamic AWS Lambda Applications with BoxLang
Building Dynamic AWS Lambda Applications with BoxLang
Ortus Solutions, Corp
 
Playing in Tune: How We Refactored Cube to Terabyte Scale
Playing in Tune: How We Refactored Cube to Terabyte Scale
MongoDB
 
Harmony intune final
Harmony intune final
MongoDB
 
BINARY DATA ADVENTURES IN BROWSER JAVASCRIPT
BINARY DATA ADVENTURES IN BROWSER JAVASCRIPT
Or Hiltch
 
Ad

Recently uploaded (20)

FIDO Seminar: Perspectives on Passkeys & Consumer Adoption.pptx
FIDO Seminar: Perspectives on Passkeys & Consumer Adoption.pptx
FIDO Alliance
 
Securing Account Lifecycles in the Age of Deepfakes.pptx
Securing Account Lifecycles in the Age of Deepfakes.pptx
FIDO Alliance
 
MuleSoft for AgentForce : Topic Center and API Catalog
MuleSoft for AgentForce : Topic Center and API Catalog
shyamraj55
 
PyCon SG 25 - Firecracker Made Easy with Python.pdf
PyCon SG 25 - Firecracker Made Easy with Python.pdf
Muhammad Yuga Nugraha
 
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC
 
"Database isolation: how we deal with hundreds of direct connections to the d...
"Database isolation: how we deal with hundreds of direct connections to the d...
Fwdays
 
OpenPOWER Foundation & Open-Source Core Innovations
OpenPOWER Foundation & Open-Source Core Innovations
IBM
 
“Key Requirements to Successfully Implement Generative AI in Edge Devices—Opt...
“Key Requirements to Successfully Implement Generative AI in Edge Devices—Opt...
Edge AI and Vision Alliance
 
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Alliance
 
UserCon Belgium: Honey, VMware increased my bill
UserCon Belgium: Honey, VMware increased my bill
stijn40
 
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Priyanka Aash
 
9-1-1 Addressing: End-to-End Automation Using FME
9-1-1 Addressing: End-to-End Automation Using FME
Safe Software
 
Securing AI - There Is No Try, Only Do!.pdf
Securing AI - There Is No Try, Only Do!.pdf
Priyanka Aash
 
2025_06_18 - OpenMetadata Community Meeting.pdf
2025_06_18 - OpenMetadata Community Meeting.pdf
OpenMetadata
 
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
caoyixuan2019
 
Security Tips for Enterprise Azure Solutions
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
 
From Manual to Auto Searching- FME in the Driver's Seat
From Manual to Auto Searching- FME in the Driver's Seat
Safe Software
 
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik
 
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Alliance
 
Information Security Response Team Nepal_npCERT_Vice_President_Sudan_Jha.pdf
Information Security Response Team Nepal_npCERT_Vice_President_Sudan_Jha.pdf
ICT Frame Magazine Pvt. Ltd.
 
FIDO Seminar: Perspectives on Passkeys & Consumer Adoption.pptx
FIDO Seminar: Perspectives on Passkeys & Consumer Adoption.pptx
FIDO Alliance
 
Securing Account Lifecycles in the Age of Deepfakes.pptx
Securing Account Lifecycles in the Age of Deepfakes.pptx
FIDO Alliance
 
MuleSoft for AgentForce : Topic Center and API Catalog
MuleSoft for AgentForce : Topic Center and API Catalog
shyamraj55
 
PyCon SG 25 - Firecracker Made Easy with Python.pdf
PyCon SG 25 - Firecracker Made Easy with Python.pdf
Muhammad Yuga Nugraha
 
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC
 
"Database isolation: how we deal with hundreds of direct connections to the d...
"Database isolation: how we deal with hundreds of direct connections to the d...
Fwdays
 
OpenPOWER Foundation & Open-Source Core Innovations
OpenPOWER Foundation & Open-Source Core Innovations
IBM
 
“Key Requirements to Successfully Implement Generative AI in Edge Devices—Opt...
“Key Requirements to Successfully Implement Generative AI in Edge Devices—Opt...
Edge AI and Vision Alliance
 
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Alliance
 
UserCon Belgium: Honey, VMware increased my bill
UserCon Belgium: Honey, VMware increased my bill
stijn40
 
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Priyanka Aash
 
9-1-1 Addressing: End-to-End Automation Using FME
9-1-1 Addressing: End-to-End Automation Using FME
Safe Software
 
Securing AI - There Is No Try, Only Do!.pdf
Securing AI - There Is No Try, Only Do!.pdf
Priyanka Aash
 
2025_06_18 - OpenMetadata Community Meeting.pdf
2025_06_18 - OpenMetadata Community Meeting.pdf
OpenMetadata
 
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
caoyixuan2019
 
Security Tips for Enterprise Azure Solutions
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
 
From Manual to Auto Searching- FME in the Driver's Seat
From Manual to Auto Searching- FME in the Driver's Seat
Safe Software
 
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik
 
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Alliance
 
Information Security Response Team Nepal_npCERT_Vice_President_Sudan_Jha.pdf
Information Security Response Team Nepal_npCERT_Vice_President_Sudan_Jha.pdf
ICT Frame Magazine Pvt. Ltd.
 

Interactive Graphics using Javascript, HTML5 and CSS3

Editor's Notes