SlideShare a Scribd company logo
HTML5
Colored HELLO WORLD
By : Solieman ElSaber
Agenda
1- HTML5 new elements
2- CSS3
3- Animation
4- Touch events
5- Javascript
6- Smartphone !!!
New elements
article
aside
audio
canvas
command
datalist
details
embed
figcaption
figure
footer
header
hgroup
keygen
mark
meter
nav
output
progress
rp
rt
ruby
section
source
summary
time
video
wbr
source
New elements
article
aside
audio
canvas
command
datalist
details
embed
figcaption
figure
footer
header
hgroup
keygen
mark
meter
nav
output
progress
rp
rt
ruby
section
source
summary
time
video
wbr
source
New elements
article
aside
audio
canvas
command
datalist
details
embed
figcaption
figure
footer
header
hgroup
keygen
mark
meter
nav
output
progress
rp
rt
ruby
section
source
summary
time
video
wbr
source
CSS3
-webkit-transition: all 2s ease;
-moz-transition: all 2s ease;
-ms-transition: all 2s ease;
-o-transition: all 2s ease;
transition: all 2s ease;
CSS3 Generator
Understand CSS3
Font
@font-face {
font-family: 'ourNewFont';
src: url('newfont.eot?') format('eot'),
url('newfont.woff') format('woff'),
url('newfont.ttf') format('truetype');
}
CSS3 Generator
CSS3 Animation
div {
animation-duration: 3s;
animation-name: rotateIt;
animation-iteration-count: infinite;
animation-direction: alternate;
}
@-ms-keyframes rotateIt {
0% {
-ms-transform: rotate(0deg)
}
50% {
-ms-transform: rotate(-5deg)
}
100% {
-ms-transform: rotate(0deg)
}
}
CSS3 Animation examples
http://www.creativebloq.com/css3/animation-with-css3-
712437
http://www.sitepoint.com/build-awesome-apps-with-css3-
animations/
https://developer.mozilla.org/en-
US/docs/CSS/Tutorials/Using_CSS_animations
Audio
<audio controls>
<source src="horse.ogg" type="audio/ogg">
<source src="horse.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
For Mobile :
audio-sprites
Video
<video width="320" height="240" controls>
<source src="movie.mp4" type="video/mp4">
<source src="movie.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>
Canvas
<canvas id="myCanvas" width="200" height="100"
style="border:1px solid #000000;">
<h1>Canvas is NOT supported in your browser</h1>
</canvas>
<script>
var ourCanvas=document.getElementById("myCanvas");
var ourContext=ourCanvas.getContext("2d");
ourContext.fillStyle="#FF0000";
ourContext.fillRect(0,0,150,75);
</script>
Canvas
<canvas id="canvas" width="838" height="220"></canvas>
<script>
var canvasContext = document.getElementById("canvas").
getContext("2d");
canvasContext.fillRect(250, 25, 150, 100);
canvasContext.beginPath();
canvasContext.arc(450, 110, 100, Math.PI * 1/2,Math.PI
*3/2);
canvasContext.lineWidth = 15;
canvasContext.lineCap = 'round';
canvasContext.strokeStyle = 'rgba(255, 127, 0, 0.5)';
canvasContext.stroke();
</script>
Canvas
<canvas id="canvas" width="838" height="220"></canvas>
<script>
var canvasContext = document.getElementById("canvas").
getContext("2d");
var img = new Image();
img.src = "ourImage.png";
canvasContext.drawImage(img,100,100,200,200);
canvasContext.drawImage(img,0,0,200,200,100,100,50,50);
</script>
Canvas
var TO_RADIANS = Math.PI/180; //here we rotate an image
function drawRotatedImage(image, x, y,width,height,angle)
{
// save the current co-ordinate system before we screw with
it
context.save();
// move to the middle of where we want to draw our image
context.translate(x, y);
// rotate, converting our angle from degrees to radians
context.rotate(angle * TO_RADIANS);
// draw it up and to the left by half the width and height of
the image
//context.drawImage(image, -(image.width/2), -(image.
height/2));
// and restore the co-ords to how they were when we began
context.restore();
}
Canvas
<canvas id="myCanvas" width="200" height="100"
style="border:1px solid #d3d3d3;">
Your browser does not support the HTML5 canvas
tag.
</canvas>
<script>
var c=document.getElementById("myCanvas");
var ctx=c.getContext("2d");
ctx.font="30px Arial";
ctx.strokeText("Hello World",10,50);
</script>
Canvas
imageData = c.getImageData(0, 0, width, height);
c.putImageData(imageData, 0, 0);
Source
Touch events
touchstart
touchmove
touchend
function init()
{
canvas.addEventListener("touchstart",start,false);
canvas.addEventListener("touchmove",draw,false);
canvas.addEventListener("touchend",stop,false);
canvas.addEventListener("mousedown",start,false);
canvas.addEventListener("mousemove",draw,false);
canvas.addEventListener("mouseup",stop,false);
canvas.addEventListener("mouseout",stop,false);
}
Touch events
canvas.addEventListener("touchstart",handleStart,
false);
function handleStart(evt)
{
evt.preventDefault();
var touches = evt.changedTouches;
pointerX = touches[0].clientX;
pointerY = touches[0].clientY;
}
Touch events
canvas.addEventListener("touchend",handleEnd,false);
function handleEnd(evt)
{
evt.preventDefault();
var touches = evt.changedTouches;
pointerX = touches[0].clientX;
pointerY = touches[0].clientY;
}
Touch events
canvas.addEventListener("touchmove",handleMove,false);
function handleMove(evt)
{
evt.preventDefault();
var touches = evt.changedTouches;
pointerX = touches[0].clientX;
pointerY = touches[0].clientY;
}
Javascript !!
- Web Storage
- Web SQL Database
- IndexedDB
- Application Cache
- Web Workers
- WebSocket
- Notifications
- Native Drag & Drop
- Desktop Drag-In (File API)
- Desktop Drag-Out
- FileSystem APIs
- Geolocation
- Device Orientation
Source
Smartphone
- Performance
- Limitations
- rAF
- Resources
Questions ?
contact me if you want :)
@selsaber

More Related Content

PDF
I Can't Believe It's Not Flash
PDF
HTML5 and CSS3 – exploring mobile possibilities - Dynabyte event
PDF
Workshop 18: CSS Animations & cool effects
PPTX
Css animation
KEY
Douban pulse
PDF
HTML5 Canvas - The Future of Graphics on the Web
PDF
AngularJS: The Bridge Between Today and Tomorrow's Web (Todd Motto)
PDF
Only JavaScript, only Meteor.js
I Can't Believe It's Not Flash
HTML5 and CSS3 – exploring mobile possibilities - Dynabyte event
Workshop 18: CSS Animations & cool effects
Css animation
Douban pulse
HTML5 Canvas - The Future of Graphics on the Web
AngularJS: The Bridge Between Today and Tomorrow's Web (Todd Motto)
Only JavaScript, only Meteor.js

Similar to Html5 (20)

PPT
HTML5 Canvas
PDF
How to build a html5 websites.v1
PPTX
HTML5 Animation in Mobile Web Games
PDF
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
PDF
Writing a Space Shooter with HTML5 Canvas
ODP
Graphics & Animation with HTML5
KEY
Interactive Graphics
PPTX
Intro to Canva
PPTX
Introduction to Canvas - Toronto HTML5 User Group
PDF
Introduction to Canvas - Toronto HTML5 User Group
PPT
Google tools for webmasters
PDF
Mapping the world with Twitter
PPTX
HTML 5_Canvas
PDF
Beyond the Standards
PDF
Creating Beautiful CSS3 Animations - FITC Amsterdam 2016
PDF
Mastering CSS Animations
PPTX
Javascript Animation with Canvas - Gregory Starr 2015
KEY
Rockstar Graphics with HTML5 @Media UK
PPTX
CSS Transitions, Transforms, Animations
KEY
HTML5, CSS3, and other fancy buzzwords
HTML5 Canvas
How to build a html5 websites.v1
HTML5 Animation in Mobile Web Games
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Writing a Space Shooter with HTML5 Canvas
Graphics & Animation with HTML5
Interactive Graphics
Intro to Canva
Introduction to Canvas - Toronto HTML5 User Group
Introduction to Canvas - Toronto HTML5 User Group
Google tools for webmasters
Mapping the world with Twitter
HTML 5_Canvas
Beyond the Standards
Creating Beautiful CSS3 Animations - FITC Amsterdam 2016
Mastering CSS Animations
Javascript Animation with Canvas - Gregory Starr 2015
Rockstar Graphics with HTML5 @Media UK
CSS Transitions, Transforms, Animations
HTML5, CSS3, and other fancy buzzwords
Ad

More from Soliman ElSaber (9)

PDF
Data for kids
PPTX
Learning style automatic detection
DOCX
Gamification thinking for D2L
PDF
moodle on wamp
PPTX
110 Ways To Find Happiness
PPSX
She .......
PDF
PDF
Benefits
PDF
Simulation For eLearning Material
Data for kids
Learning style automatic detection
Gamification thinking for D2L
moodle on wamp
110 Ways To Find Happiness
She .......
Benefits
Simulation For eLearning Material
Ad

Recently uploaded (20)

PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Spectroscopy.pptx food analysis technology
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Encapsulation theory and applications.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Machine learning based COVID-19 study performance prediction
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
sap open course for s4hana steps from ECC to s4
PDF
cuic standard and advanced reporting.pdf
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Electronic commerce courselecture one. Pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
NewMind AI Weekly Chronicles - August'25 Week I
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Spectral efficient network and resource selection model in 5G networks
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Spectroscopy.pptx food analysis technology
20250228 LYD VKU AI Blended-Learning.pptx
Encapsulation theory and applications.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Machine learning based COVID-19 study performance prediction
Mobile App Security Testing_ A Comprehensive Guide.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
sap open course for s4hana steps from ECC to s4
cuic standard and advanced reporting.pdf
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
MYSQL Presentation for SQL database connectivity
Diabetes mellitus diagnosis method based random forest with bat algorithm
Electronic commerce courselecture one. Pdf

Html5