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

More Related Content

KEY
KEY
Interactive Graphics
KEY
Interactive Graphics w/ Javascript, HTML5 and CSS3
PPT
HTML5 Canvas
PPTX
Introduction to HTML5 Canvas
PPTX
HTML 5_Canvas
PDF
Intro to HTML5 Canvas
PDF
Html5 canvas
Interactive Graphics
Interactive Graphics w/ Javascript, HTML5 and CSS3
HTML5 Canvas
Introduction to HTML5 Canvas
HTML 5_Canvas
Intro to HTML5 Canvas
Html5 canvas

What's hot (10)

PPTX
Drawing with the HTML5 Canvas
PPT
Fast rendering with starling
PDF
Scalable Assets Presentation
PDF
Mongo db washington dc 2014
PPT
Canvas in html5 - TungVD
PPTX
nunuStudio Geometrix 2017
PPTX
Improving Game Performance in the Browser
PDF
Tiling and Zooming ASCII Art @ iOSoho
PDF
Pruebas mostrando pdf's
PPTX
Photoshop
Drawing with the HTML5 Canvas
Fast rendering with starling
Scalable Assets Presentation
Mongo db washington dc 2014
Canvas in html5 - TungVD
nunuStudio Geometrix 2017
Improving Game Performance in the Browser
Tiling and Zooming ASCII Art @ iOSoho
Pruebas mostrando pdf's
Photoshop
Ad

Viewers also liked (20)

ODP
Interactive Vector-Graphics in the Browser
 
PPTX
Introduction about wireframing and responsive webdesign
PPTX
Google's Principle's of Mobile Website Design
KEY
Lecture3
PDF
Next Steps in Responsive Design
PPT
Webdesign New
PPTX
10 Design and Layout Principles Guaranteed to Improve Your Website V2
PDF
CSS Dasar #6 : Background
PPTX
CSS Layout Techniques
ODP
How to Make HTML and CSS Files
PDF
CSS Layouting #5 : Position
PPSX
CSS Box Model Presentation
PDF
CSS Box Model
PDF
Css box model
PDF
CSS Layouting #3 : Box Model
PPT
CSS, CSS Selectors, CSS Box Model
PDF
Responsive webdesign
PPT
5.1 css box model
PPTX
Responsive web designing ppt(1)
PPTX
10 Design & Layout Principles Guaranteed To Improve
Interactive Vector-Graphics in the Browser
 
Introduction about wireframing and responsive webdesign
Google's Principle's of Mobile Website Design
Lecture3
Next Steps in Responsive Design
Webdesign New
10 Design and Layout Principles Guaranteed to Improve Your Website V2
CSS Dasar #6 : Background
CSS Layout Techniques
How to Make HTML and CSS Files
CSS Layouting #5 : Position
CSS Box Model Presentation
CSS Box Model
Css box model
CSS Layouting #3 : Box Model
CSS, CSS Selectors, CSS Box Model
Responsive webdesign
5.1 css box model
Responsive web designing ppt(1)
10 Design & Layout Principles Guaranteed To Improve
Ad

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

PDF
PDF
Building a game engine with jQuery
PDF
Mobile Web Development with HTML5
KEY
Using Smalltalk for controlling robotics systems
PPTX
HTML5 Animation in Mobile Web Games
PDF
An Introduction to Go
PDF
Khan Academy Computer Science
PDF
PDF
Build a game with javascript (may 21 atlanta)
PDF
2015 Pharo Prague Lambda Meetup
KEY
Stupid Canvas Tricks
PDF
Making HTML5 Mobile Games Indistinguishable from Native Apps
PDF
COMP 4026 Lecture 5 OpenFrameworks and Soli
PDF
Building Dynamic AWS Lambda Applications with BoxLang
PDF
Building Dynamic AWS Lambda Applications with BoxLang
PPTX
Mobile native-hacks
KEY
20120514 nodejsdublin
PDF
Harmony intune final
PDF
Playing in Tune: How We Refactored Cube to Terabyte Scale
PDF
BINARY DATA ADVENTURES IN BROWSER JAVASCRIPT
Building a game engine with jQuery
Mobile Web Development with HTML5
Using Smalltalk for controlling robotics systems
HTML5 Animation in Mobile Web Games
An Introduction to Go
Khan Academy Computer Science
Build a game with javascript (may 21 atlanta)
2015 Pharo Prague Lambda Meetup
Stupid Canvas Tricks
Making HTML5 Mobile Games Indistinguishable from Native Apps
COMP 4026 Lecture 5 OpenFrameworks and Soli
Building Dynamic AWS Lambda Applications with BoxLang
Building Dynamic AWS Lambda Applications with BoxLang
Mobile native-hacks
20120514 nodejsdublin
Harmony intune final
Playing in Tune: How We Refactored Cube to Terabyte Scale
BINARY DATA ADVENTURES IN BROWSER JAVASCRIPT

Recently uploaded (20)

PDF
Empathic Computing: Creating Shared Understanding
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
Cloud computing and distributed systems.
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPT
Teaching material agriculture food technology
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
KodekX | Application Modernization Development
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
Big Data Technologies - Introduction.pptx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Empathic Computing: Creating Shared Understanding
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Cloud computing and distributed systems.
The AUB Centre for AI in Media Proposal.docx
The Rise and Fall of 3GPP – Time for a Sabbatical?
Teaching material agriculture food technology
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Unlocking AI with Model Context Protocol (MCP)
KodekX | Application Modernization Development
Network Security Unit 5.pdf for BCA BBA.
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Big Data Technologies - Introduction.pptx
Building Integrated photovoltaic BIPV_UPV.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Digital-Transformation-Roadmap-for-Companies.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...

Interactive Graphics using Javascript, HTML5 and CSS3

  • 1. While your waiting... • You will want to get: • https://github.com/MacBoyPro/ simple_animation • git@github.com:MacBoyPro/ simple_animation.git
  • 2. Interactive Graphics w/ Javascript, HTML5 and CSS3 Lee Lundrigan
  • 3. 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
  • 5. Tools of the trade • Oxygen XML Editor • http://www.oxygenxml.com • Aptana • http://www.aptana.com • TextEdit (on Mac) • TextPad (on Windows)
  • 6. Course Topics • Animation • 2D and 3D / HTML5 Canvas • Collision detection • Sprites • Sound • Interaction • Best practices
  • 7. 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
  • 8. 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.
  • 9. Coordinate System • Cartesian Coordinate System • Starts in upper left • Origin is (0,0) 0 0
  • 10. Animation • setInterval(code,millisec); • repeats until cleared • setTimeout(code, millisec); • Fires the event once • Note: There are 1000 milliseconds in one second.
  • 12. Lab - Simple Animation
  • 13. Collision Detection • Bounding box • Test using object’s center • {x: 10, y: 10}
  • 14. 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
  • 15. Keyboard Movement • document.onkeydown • detect character code • left: 37 right: 39 • set moving true • document.onkeyup • set moving false
  • 16. Keyboard Movement Cont... • Webkit based browsers have a bug • the keypress event doesn’t work for the arrow keys
  • 17. Lab - Game time

Editor's Notes