SlideShare une entreprise Scribd logo
1  sur  36
HTML5 APPS FOR iOS
(and probably beyond)


by Andi Farr
aka @semiBad


andi@semibad.com
http://semibad.com


                        ;(
WHY HTML5 APPS?
• ‘Install’   to device
• Cross-platform

• Perfect     for small ideas
• Buildapps quickly and using simple and
 familiar techniques
• Deploy      instantly from any web space
• Potential    for ‘dynamic’, personalised apps
UNFLappABLE
UNFLappABLE

A very simple notecard
application to help me through my
first time speaking!
Lives at unflappable.semibad.com
Optimised for use on an iPhone /
iPod Touch, but should work on
any device
UNFLappABLE

Login screen makes a simple AJAX
call and retrieves data from a
user’s online account
We store the JSON object locally,
and from this point we can access
the data whenever we like – even
without a network connection
UNFLappABLE
UNFLappABLE

The app is a single HTML page,
divided into ‘views’ which the app
moves between
Plain Old Semantic HTML!
Most of what’s going on, happens
in the <head>
Uses jQuery, but only so I could
develop it quickly
DESIGNING IT
Design for touch – buttons
and interactive elements
are nice and big
Also, think about
how a user will hold
the device – the next
button is placed to be
easy for a user holding
in that orientation
DESIGNING IT
Uses a few image textures
for a smaller number of
requests, with CSS to style
the graphical elements
DESIGNING IT
iOS devices now support          Futura
truetype @font-face              Baskerville
embedding, but have
a surprisingly good              Gill sans
selection of decent fonts        Cochin
available by default             American
Keep it lightweight – mobile /   Typewriter
tablet devices are a lot less
powerful, even at the top end
STYLING IT UP
• CSS3 – more than just rounded
 corners and drop shadows!
• Imageless      gradients – saves
 file size
• Multiplebackgrounds – adds
 texture over bg gradient

 background: url(/img/bg.png) top center,
 -webkit-gradient(linear, left top, left bottom, from(#1feee7), to(#16a6a1));
STYLING IT UP

• Multiplebox-shadow
 on flat textured
 elements – inset light
 colours for highlights
• Use box-sizing to
 change the box model
 of an element – useful
 for fluid designs
STYLING IT UP
• Uses   rgba() throughout for blended colours
           and transform for ‘shuffling’ the menu
• :nth-child
 cards a bit
 #menu li:nth-child(3n+2) { -webkit-transform: rotate(0.7deg); }
 #menu li:nth-child(3n+3) { -webkit-transform: rotate(-1deg); }
MEDIA QUERIES
Serve different stylesheets based on
different browser / device configurations
MEDIA QUERIES
• For  this app, the main stylesheet
  styles the app for iPhone / small
  screen devices
• This depends on the project, but
  using the simplest version is a good
  fallback for older mobile devices
• It
   also means that phones
  download use the smallest
  amount of bandwidth
MEDIA QUERIES
main.css contains a section
which restyles for landscape
orientation
/* landscape mode */


@media only screen and
(orientation:landscape) {


    body { xxx: xxx }


}
MEDIA QUERIES
MEDIA QUERIES
big.css is used for any
devices with a higher width
than 481px – desktop
browsers, iPads, etc.
<link href='/css/big.css' rel='stylesheet'
  media='only screen and (min-device-
  width: 481px)' />
HI RESOLUTION STYLES
Include using a min-device-pixels media query to
serve to high-DPI devices
<link href='/css/hi-res.css' rel='stylesheet'
  media='only screen and (-webkit-min-device-pixel-ratio: 2),
  only screen and (min-device-pixel-ratio: 2)' />
HI RESOLUTION STYLES
Add double-size graphics, then shrink them to the
proper size with background-size
Remember that these extra images take up a lot
of precious space
html {
    background: url(/img/bg-hi.png) top center (50%, 50%);
}


footer {
    background-image: url(/img/wood-hi.jpg);
    background-size: cover;
}
APP CACHING
Your cache manifest is a simple file that tells the
browser to cache certain files
You specify it using a manifest attribute on your
opening <html> tag:

<html manifest=‘cache.manifest’>
APP CACHING
The browser will need to be told how to read it,
either in the .htaccess file or using a PHP
wrapper file (or similar):
AddType text/cache-manifest .manifest



You could quite easily write a backend script to
generate your manifest automatically
APP CACHING
This one is very simple –       CACHE MANIFEST


it’s just a list of files that   # unflappable : cache v0.17

need caching (I’ve cut          /css/reset.css

some out here)                  /css/main.css
                                /css/big.css
                                /css/hi-res.css
Your file must start with
CACHE MANIFEST
                                /img/icon.png
                                /img/bg.png
                                /img/bg-hi.png
                                /img/brass.jpg
                                /img/brass-hi.jpg
                                /img/paper.jpg
                                /img/wood.jpg
                                /img/wood-hi.jpg
APP CACHING
Difficult to debug – fails silently if missing
files or on bad syntax. Chrome dev tools are
your friend!
APP CACHING
5MB limit on cached apps –
keep an eye on file / data size
When you update, you must
change the manifest in some
way – usually incrementing a
version number is best
# unflappable : cache v0.946
LOCAL STORAGE
Simple key / value pairs
Essentially just persistent variables, specific to
your app / domain
localStorage items are always strings – you can
save objects into it by using JSON.stringify()
This app uses localStorage to store the JSON
object with all the presentation data in
LOCAL STORAGE
To set a localStorage variable:
localStorage.setItem(‘key’, ‘value’);



To retrieve a localStorage variable:
localStorage.getItem(‘key’);



And then delete it permanently:
localStorage.removeItem(‘key’)
LOCAL STORAGE
For more complex data storage, you can also
use WebSQL – client side SQL databases
Cross-browser support isn’t as wide, though iOS
supports it fine
META TAGS & ICONS
A bunch of stuff in the <head> to set up
your app!
<meta name="viewport" content="width=device-width, initial-scale=1,
maximum-scale=1, user-scalable=0">
<meta name="apple-mobile-web-app-capable" content="yes" />


<link rel="icon" href="/img/icon.png" />
<link rel="apple-touch-icon" href="/img/apple-icon.png" />
<link rel="apple-touch-icon" href="/img/apple-icon-hi.png" sizes="114x114" />
META TAGS & ICONS
The viewport meta tag lets you set how iOS (and
other devices) will handle resizing, scrolling, and
other detail
<meta
  name="viewport"
  content="width=device-width,
  initial-scale=1,
  maximum-scale=1,
  user-scalable=0">
META TAGS & ICONS
The apple-mobile-web-app-capable meta tag tells
iOS to not display browser chrome when a user
runs this app from the home screen
<meta name="apple-mobile-web-app-capable" content="yes" />
META TAGS & ICONS
apple-mobile-web-app-status-bar-style allows you
to set the status bar colour
Default is the light bar, also black or black-
translucent
If you use black-translucent, your content will
have an extra 20px to fill:
META TAGS & ICONS
Icons specified in the <head> are used on the
user’s home screen alongside native apps
Use a 72px icon for iPad, and a 114px icon for
Retina displays – if you have more than one,
specify which is which using the sizes attribute

<link rel="icon" href="/img/icon.png" />
<link rel="apple-touch-icon"
href="/img/apple-icon.png" />
<link rel="apple-touch-icon"
href="/img/apple-icon-hi.png" sizes="114x114" />
WHAT NEXT?
This is a very simple introduction to what HTML5
apps can do in the mobile space
A surprising amount of features are exposed to
mobile browsers
Canvas interactivity, video, audio, geolocation,
and the accelerometer are just a few things
which are available for your apps
WHAT NEXT?
Dive into HTML5 (Mark Pilgrim)
http://diveintohtml5.org
The HTML5 Doctor (various)
http://html5doctor.com
HTML5 Poker cheat sheet (by... me)
http://semibad.com/s/poker
THANK YOU
Please refrain from asking difficult questions




@semibad
andi@semibad.com
http://semibad.com

Contenu connexe

Tendances

Progressively Enhancing WordPress Themes
Progressively Enhancing WordPress ThemesProgressively Enhancing WordPress Themes
Progressively Enhancing WordPress ThemesDigitally
 
Drupal Camp Manila 2014 - Theming with Zen
Drupal Camp Manila 2014 - Theming with ZenDrupal Camp Manila 2014 - Theming with Zen
Drupal Camp Manila 2014 - Theming with ZenJapo Domingo
 
Dissecting WordPress Themes and Page Templates, WordPress Columbus Meetup
Dissecting WordPress Themes and Page Templates, WordPress Columbus MeetupDissecting WordPress Themes and Page Templates, WordPress Columbus Meetup
Dissecting WordPress Themes and Page Templates, WordPress Columbus MeetupAngela Meeker
 
WordPress Multisite at WordCamp Columbus by Angie Meeker
WordPress Multisite at WordCamp Columbus by Angie MeekerWordPress Multisite at WordCamp Columbus by Angie Meeker
WordPress Multisite at WordCamp Columbus by Angie MeekerAngela Meeker
 
How to overengineer a meme generator
How to overengineer a meme generatorHow to overengineer a meme generator
How to overengineer a meme generatorKrešimir Antolić
 
Planning Adaptive Interfaces [RWD Summit 2016]
Planning Adaptive Interfaces [RWD Summit 2016]Planning Adaptive Interfaces [RWD Summit 2016]
Planning Adaptive Interfaces [RWD Summit 2016]Aaron Gustafson
 
Click and Create Sales Presentation
Click and Create Sales PresentationClick and Create Sales Presentation
Click and Create Sales Presentationcmevans2
 
Beyond Responsive [18F 2015]
Beyond Responsive [18F 2015]Beyond Responsive [18F 2015]
Beyond Responsive [18F 2015]Aaron Gustafson
 
Migrating to share point online using microsoft tools
Migrating to share point online using microsoft toolsMigrating to share point online using microsoft tools
Migrating to share point online using microsoft toolsspsnyc
 

Tendances (13)

Going responsive
Going responsiveGoing responsive
Going responsive
 
Css web gallery
Css web galleryCss web gallery
Css web gallery
 
Progressively Enhancing WordPress Themes
Progressively Enhancing WordPress ThemesProgressively Enhancing WordPress Themes
Progressively Enhancing WordPress Themes
 
Drupal Camp Manila 2014 - Theming with Zen
Drupal Camp Manila 2014 - Theming with ZenDrupal Camp Manila 2014 - Theming with Zen
Drupal Camp Manila 2014 - Theming with Zen
 
Seo hints
Seo hintsSeo hints
Seo hints
 
Challenges going mobile
Challenges going mobileChallenges going mobile
Challenges going mobile
 
Dissecting WordPress Themes and Page Templates, WordPress Columbus Meetup
Dissecting WordPress Themes and Page Templates, WordPress Columbus MeetupDissecting WordPress Themes and Page Templates, WordPress Columbus Meetup
Dissecting WordPress Themes and Page Templates, WordPress Columbus Meetup
 
WordPress Multisite at WordCamp Columbus by Angie Meeker
WordPress Multisite at WordCamp Columbus by Angie MeekerWordPress Multisite at WordCamp Columbus by Angie Meeker
WordPress Multisite at WordCamp Columbus by Angie Meeker
 
How to overengineer a meme generator
How to overengineer a meme generatorHow to overengineer a meme generator
How to overengineer a meme generator
 
Planning Adaptive Interfaces [RWD Summit 2016]
Planning Adaptive Interfaces [RWD Summit 2016]Planning Adaptive Interfaces [RWD Summit 2016]
Planning Adaptive Interfaces [RWD Summit 2016]
 
Click and Create Sales Presentation
Click and Create Sales PresentationClick and Create Sales Presentation
Click and Create Sales Presentation
 
Beyond Responsive [18F 2015]
Beyond Responsive [18F 2015]Beyond Responsive [18F 2015]
Beyond Responsive [18F 2015]
 
Migrating to share point online using microsoft tools
Migrating to share point online using microsoft toolsMigrating to share point online using microsoft tools
Migrating to share point online using microsoft tools
 

En vedette

En vedette (6)

Senior Project
Senior ProjectSenior Project
Senior Project
 
Revenue Management
Revenue ManagementRevenue Management
Revenue Management
 
Mcit
McitMcit
Mcit
 
Essential list 1
Essential list 1Essential list 1
Essential list 1
 
Guion tecnico
Guion tecnicoGuion tecnico
Guion tecnico
 
Kimpton Hotels, DC, MD and VA
Kimpton Hotels, DC, MD and VAKimpton Hotels, DC, MD and VA
Kimpton Hotels, DC, MD and VA
 

Similaire à HTML5 apps for iOS (and probably beyond)

Create Responsive Website Design with Bootstrap 3
Create Responsive Website Design with Bootstrap 3Create Responsive Website Design with Bootstrap 3
Create Responsive Website Design with Bootstrap 3Wahyu Putra
 
Eye candy for your iPhone
Eye candy for your iPhoneEye candy for your iPhone
Eye candy for your iPhoneBrian Shim
 
Practical tipsmakemobilefaster oscon2016
Practical tipsmakemobilefaster oscon2016Practical tipsmakemobilefaster oscon2016
Practical tipsmakemobilefaster oscon2016Doris Chen
 
Pinkoi Mobile Web
Pinkoi Mobile WebPinkoi Mobile Web
Pinkoi Mobile Webmikeleeme
 
Cm i padwebdev_lunch_learn
Cm i padwebdev_lunch_learnCm i padwebdev_lunch_learn
Cm i padwebdev_lunch_learnCritical Mass
 
Responsive & Responsible: Implementing Responsive Design at Scale
Responsive & Responsible: Implementing Responsive Design at ScaleResponsive & Responsible: Implementing Responsive Design at Scale
Responsive & Responsible: Implementing Responsive Design at Scalescottjehl
 
Fake it 'til you make it
Fake it 'til you make itFake it 'til you make it
Fake it 'til you make itJonathan Snook
 
Responsive design: techniques and tricks to prepare your websites for the mul...
Responsive design: techniques and tricks to prepare your websites for the mul...Responsive design: techniques and tricks to prepare your websites for the mul...
Responsive design: techniques and tricks to prepare your websites for the mul...Andreas Bovens
 
Html 5 mobile - nitty gritty
Html 5 mobile - nitty grittyHtml 5 mobile - nitty gritty
Html 5 mobile - nitty grittyMario Noble
 
Spectrum 2015 responsive design
Spectrum 2015   responsive designSpectrum 2015   responsive design
Spectrum 2015 responsive designNeil Perlin
 
Drupal performance and scalability
Drupal performance and scalabilityDrupal performance and scalability
Drupal performance and scalabilityTwinbit
 
Dreamweaver CS6, jQuery, PhoneGap, mobile design
Dreamweaver CS6, jQuery, PhoneGap, mobile designDreamweaver CS6, jQuery, PhoneGap, mobile design
Dreamweaver CS6, jQuery, PhoneGap, mobile designDee Sadler
 
Once Source to Rule Them All
Once Source to Rule Them AllOnce Source to Rule Them All
Once Source to Rule Them AllDavid Yeiser
 
“Good design is obvious. Great design is transparent.” — How we use Bootstrap...
“Good design is obvious. Great design is transparent.” — How we use Bootstrap...“Good design is obvious. Great design is transparent.” — How we use Bootstrap...
“Good design is obvious. Great design is transparent.” — How we use Bootstrap...Roni Banerjee
 
Responsive websites. Toolbox
Responsive websites. ToolboxResponsive websites. Toolbox
Responsive websites. ToolboxWojtek Zając
 

Similaire à HTML5 apps for iOS (and probably beyond) (20)

Responsive design
Responsive designResponsive design
Responsive design
 
Create Responsive Website Design with Bootstrap 3
Create Responsive Website Design with Bootstrap 3Create Responsive Website Design with Bootstrap 3
Create Responsive Website Design with Bootstrap 3
 
Eye candy for your iPhone
Eye candy for your iPhoneEye candy for your iPhone
Eye candy for your iPhone
 
Practical tipsmakemobilefaster oscon2016
Practical tipsmakemobilefaster oscon2016Practical tipsmakemobilefaster oscon2016
Practical tipsmakemobilefaster oscon2016
 
Pinkoi Mobile Web
Pinkoi Mobile WebPinkoi Mobile Web
Pinkoi Mobile Web
 
Cm i padwebdev_lunch_learn
Cm i padwebdev_lunch_learnCm i padwebdev_lunch_learn
Cm i padwebdev_lunch_learn
 
Responsive & Responsible: Implementing Responsive Design at Scale
Responsive & Responsible: Implementing Responsive Design at ScaleResponsive & Responsible: Implementing Responsive Design at Scale
Responsive & Responsible: Implementing Responsive Design at Scale
 
Fake it 'til you make it
Fake it 'til you make itFake it 'til you make it
Fake it 'til you make it
 
Responsive design: techniques and tricks to prepare your websites for the mul...
Responsive design: techniques and tricks to prepare your websites for the mul...Responsive design: techniques and tricks to prepare your websites for the mul...
Responsive design: techniques and tricks to prepare your websites for the mul...
 
Html 5 mobile - nitty gritty
Html 5 mobile - nitty grittyHtml 5 mobile - nitty gritty
Html 5 mobile - nitty gritty
 
Spectrum 2015 responsive design
Spectrum 2015   responsive designSpectrum 2015   responsive design
Spectrum 2015 responsive design
 
Drupal performance and scalability
Drupal performance and scalabilityDrupal performance and scalability
Drupal performance and scalability
 
Team styles
Team stylesTeam styles
Team styles
 
Dreamweaver CS6, jQuery, PhoneGap, mobile design
Dreamweaver CS6, jQuery, PhoneGap, mobile designDreamweaver CS6, jQuery, PhoneGap, mobile design
Dreamweaver CS6, jQuery, PhoneGap, mobile design
 
Html5 & less css
Html5 & less cssHtml5 & less css
Html5 & less css
 
Taking your Web App for a walk
Taking your Web App for a walkTaking your Web App for a walk
Taking your Web App for a walk
 
Once Source to Rule Them All
Once Source to Rule Them AllOnce Source to Rule Them All
Once Source to Rule Them All
 
“Good design is obvious. Great design is transparent.” — How we use Bootstrap...
“Good design is obvious. Great design is transparent.” — How we use Bootstrap...“Good design is obvious. Great design is transparent.” — How we use Bootstrap...
“Good design is obvious. Great design is transparent.” — How we use Bootstrap...
 
Html5
Html5Html5
Html5
 
Responsive websites. Toolbox
Responsive websites. ToolboxResponsive websites. Toolbox
Responsive websites. Toolbox
 

Dernier

Punjabi Housewife Call Girls Service Gomti Nagar \ 9548273370 Indian Call Gir...
Punjabi Housewife Call Girls Service Gomti Nagar \ 9548273370 Indian Call Gir...Punjabi Housewife Call Girls Service Gomti Nagar \ 9548273370 Indian Call Gir...
Punjabi Housewife Call Girls Service Gomti Nagar \ 9548273370 Indian Call Gir...nagunakhan
 
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...home
 
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service 🧵
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service  🧵CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service  🧵
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service 🧵anilsa9823
 
Peaches App development presentation deck
Peaches App development presentation deckPeaches App development presentation deck
Peaches App development presentation decktbatkhuu1
 
(AISHA) Ambegaon Khurd Call Girls Just Call 7001035870 [ Cash on Delivery ] P...
(AISHA) Ambegaon Khurd Call Girls Just Call 7001035870 [ Cash on Delivery ] P...(AISHA) Ambegaon Khurd Call Girls Just Call 7001035870 [ Cash on Delivery ] P...
(AISHA) Ambegaon Khurd Call Girls Just Call 7001035870 [ Cash on Delivery ] P...ranjana rawat
 
Editorial design Magazine design project.pdf
Editorial design Magazine design project.pdfEditorial design Magazine design project.pdf
Editorial design Magazine design project.pdftbatkhuu1
 
Nepali Escort Girl Gomti Nagar \ 9548273370 Indian Call Girls Service Lucknow...
Nepali Escort Girl Gomti Nagar \ 9548273370 Indian Call Girls Service Lucknow...Nepali Escort Girl Gomti Nagar \ 9548273370 Indian Call Girls Service Lucknow...
Nepali Escort Girl Gomti Nagar \ 9548273370 Indian Call Girls Service Lucknow...nagunakhan
 
Booking open Available Pune Call Girls Nanded City 6297143586 Call Hot India...
Booking open Available Pune Call Girls Nanded City  6297143586 Call Hot India...Booking open Available Pune Call Girls Nanded City  6297143586 Call Hot India...
Booking open Available Pune Call Girls Nanded City 6297143586 Call Hot India...Call Girls in Nagpur High Profile
 
Design Inspiration for College by Slidesgo.pptx
Design Inspiration for College by Slidesgo.pptxDesign Inspiration for College by Slidesgo.pptx
Design Inspiration for College by Slidesgo.pptxTusharBahuguna2
 
Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...
Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...
Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...Yantram Animation Studio Corporation
 
Kala jadu for love marriage | Real amil baba | Famous amil baba | kala jadu n...
Kala jadu for love marriage | Real amil baba | Famous amil baba | kala jadu n...Kala jadu for love marriage | Real amil baba | Famous amil baba | kala jadu n...
Kala jadu for love marriage | Real amil baba | Famous amil baba | kala jadu n...babafaisel
 
Dubai Call Girls Pro Domain O525547819 Call Girls Dubai Doux
Dubai Call Girls Pro Domain O525547819 Call Girls Dubai DouxDubai Call Girls Pro Domain O525547819 Call Girls Dubai Doux
Dubai Call Girls Pro Domain O525547819 Call Girls Dubai Douxkojalkojal131
 
Top Rated Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Call Girls in Nagpur High Profile
 
VIP Call Girl Amravati Aashi 8250192130 Independent Escort Service Amravati
VIP Call Girl Amravati Aashi 8250192130 Independent Escort Service AmravatiVIP Call Girl Amravati Aashi 8250192130 Independent Escort Service Amravati
VIP Call Girl Amravati Aashi 8250192130 Independent Escort Service AmravatiSuhani Kapoor
 
NO1 Trending kala jadu Love Marriage Black Magic Punjab Powerful Black Magic ...
NO1 Trending kala jadu Love Marriage Black Magic Punjab Powerful Black Magic ...NO1 Trending kala jadu Love Marriage Black Magic Punjab Powerful Black Magic ...
NO1 Trending kala jadu Love Marriage Black Magic Punjab Powerful Black Magic ...Amil baba
 
DragonBall PowerPoint Template for demo.pptx
DragonBall PowerPoint Template for demo.pptxDragonBall PowerPoint Template for demo.pptx
DragonBall PowerPoint Template for demo.pptxmirandajeremy200221
 
The_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdf
The_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdfThe_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdf
The_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdfAmirYakdi
 
SCRIP Lua HTTP PROGRACMACION PLC WECON CA
SCRIP Lua HTTP PROGRACMACION PLC  WECON CASCRIP Lua HTTP PROGRACMACION PLC  WECON CA
SCRIP Lua HTTP PROGRACMACION PLC WECON CANestorGamez6
 
Chapter 19_DDA_TOD Policy_First Draft 2012.pdf
Chapter 19_DDA_TOD Policy_First Draft 2012.pdfChapter 19_DDA_TOD Policy_First Draft 2012.pdf
Chapter 19_DDA_TOD Policy_First Draft 2012.pdfParomita Roy
 
VIP Russian Call Girls in Gorakhpur Deepika 8250192130 Independent Escort Ser...
VIP Russian Call Girls in Gorakhpur Deepika 8250192130 Independent Escort Ser...VIP Russian Call Girls in Gorakhpur Deepika 8250192130 Independent Escort Ser...
VIP Russian Call Girls in Gorakhpur Deepika 8250192130 Independent Escort Ser...Suhani Kapoor
 

Dernier (20)

Punjabi Housewife Call Girls Service Gomti Nagar \ 9548273370 Indian Call Gir...
Punjabi Housewife Call Girls Service Gomti Nagar \ 9548273370 Indian Call Gir...Punjabi Housewife Call Girls Service Gomti Nagar \ 9548273370 Indian Call Gir...
Punjabi Housewife Call Girls Service Gomti Nagar \ 9548273370 Indian Call Gir...
 
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
 
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service 🧵
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service  🧵CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service  🧵
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service 🧵
 
Peaches App development presentation deck
Peaches App development presentation deckPeaches App development presentation deck
Peaches App development presentation deck
 
(AISHA) Ambegaon Khurd Call Girls Just Call 7001035870 [ Cash on Delivery ] P...
(AISHA) Ambegaon Khurd Call Girls Just Call 7001035870 [ Cash on Delivery ] P...(AISHA) Ambegaon Khurd Call Girls Just Call 7001035870 [ Cash on Delivery ] P...
(AISHA) Ambegaon Khurd Call Girls Just Call 7001035870 [ Cash on Delivery ] P...
 
Editorial design Magazine design project.pdf
Editorial design Magazine design project.pdfEditorial design Magazine design project.pdf
Editorial design Magazine design project.pdf
 
Nepali Escort Girl Gomti Nagar \ 9548273370 Indian Call Girls Service Lucknow...
Nepali Escort Girl Gomti Nagar \ 9548273370 Indian Call Girls Service Lucknow...Nepali Escort Girl Gomti Nagar \ 9548273370 Indian Call Girls Service Lucknow...
Nepali Escort Girl Gomti Nagar \ 9548273370 Indian Call Girls Service Lucknow...
 
Booking open Available Pune Call Girls Nanded City 6297143586 Call Hot India...
Booking open Available Pune Call Girls Nanded City  6297143586 Call Hot India...Booking open Available Pune Call Girls Nanded City  6297143586 Call Hot India...
Booking open Available Pune Call Girls Nanded City 6297143586 Call Hot India...
 
Design Inspiration for College by Slidesgo.pptx
Design Inspiration for College by Slidesgo.pptxDesign Inspiration for College by Slidesgo.pptx
Design Inspiration for College by Slidesgo.pptx
 
Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...
Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...
Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...
 
Kala jadu for love marriage | Real amil baba | Famous amil baba | kala jadu n...
Kala jadu for love marriage | Real amil baba | Famous amil baba | kala jadu n...Kala jadu for love marriage | Real amil baba | Famous amil baba | kala jadu n...
Kala jadu for love marriage | Real amil baba | Famous amil baba | kala jadu n...
 
Dubai Call Girls Pro Domain O525547819 Call Girls Dubai Doux
Dubai Call Girls Pro Domain O525547819 Call Girls Dubai DouxDubai Call Girls Pro Domain O525547819 Call Girls Dubai Doux
Dubai Call Girls Pro Domain O525547819 Call Girls Dubai Doux
 
Top Rated Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
 
VIP Call Girl Amravati Aashi 8250192130 Independent Escort Service Amravati
VIP Call Girl Amravati Aashi 8250192130 Independent Escort Service AmravatiVIP Call Girl Amravati Aashi 8250192130 Independent Escort Service Amravati
VIP Call Girl Amravati Aashi 8250192130 Independent Escort Service Amravati
 
NO1 Trending kala jadu Love Marriage Black Magic Punjab Powerful Black Magic ...
NO1 Trending kala jadu Love Marriage Black Magic Punjab Powerful Black Magic ...NO1 Trending kala jadu Love Marriage Black Magic Punjab Powerful Black Magic ...
NO1 Trending kala jadu Love Marriage Black Magic Punjab Powerful Black Magic ...
 
DragonBall PowerPoint Template for demo.pptx
DragonBall PowerPoint Template for demo.pptxDragonBall PowerPoint Template for demo.pptx
DragonBall PowerPoint Template for demo.pptx
 
The_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdf
The_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdfThe_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdf
The_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdf
 
SCRIP Lua HTTP PROGRACMACION PLC WECON CA
SCRIP Lua HTTP PROGRACMACION PLC  WECON CASCRIP Lua HTTP PROGRACMACION PLC  WECON CA
SCRIP Lua HTTP PROGRACMACION PLC WECON CA
 
Chapter 19_DDA_TOD Policy_First Draft 2012.pdf
Chapter 19_DDA_TOD Policy_First Draft 2012.pdfChapter 19_DDA_TOD Policy_First Draft 2012.pdf
Chapter 19_DDA_TOD Policy_First Draft 2012.pdf
 
VIP Russian Call Girls in Gorakhpur Deepika 8250192130 Independent Escort Ser...
VIP Russian Call Girls in Gorakhpur Deepika 8250192130 Independent Escort Ser...VIP Russian Call Girls in Gorakhpur Deepika 8250192130 Independent Escort Ser...
VIP Russian Call Girls in Gorakhpur Deepika 8250192130 Independent Escort Ser...
 

HTML5 apps for iOS (and probably beyond)

  • 1. HTML5 APPS FOR iOS (and probably beyond) by Andi Farr aka @semiBad andi@semibad.com http://semibad.com ;(
  • 2. WHY HTML5 APPS? • ‘Install’ to device • Cross-platform • Perfect for small ideas • Buildapps quickly and using simple and familiar techniques • Deploy instantly from any web space • Potential for ‘dynamic’, personalised apps
  • 4. UNFLappABLE A very simple notecard application to help me through my first time speaking! Lives at unflappable.semibad.com Optimised for use on an iPhone / iPod Touch, but should work on any device
  • 5. UNFLappABLE Login screen makes a simple AJAX call and retrieves data from a user’s online account We store the JSON object locally, and from this point we can access the data whenever we like – even without a network connection
  • 7. UNFLappABLE The app is a single HTML page, divided into ‘views’ which the app moves between Plain Old Semantic HTML! Most of what’s going on, happens in the <head> Uses jQuery, but only so I could develop it quickly
  • 8. DESIGNING IT Design for touch – buttons and interactive elements are nice and big Also, think about how a user will hold the device – the next button is placed to be easy for a user holding in that orientation
  • 9. DESIGNING IT Uses a few image textures for a smaller number of requests, with CSS to style the graphical elements
  • 10. DESIGNING IT iOS devices now support Futura truetype @font-face Baskerville embedding, but have a surprisingly good Gill sans selection of decent fonts Cochin available by default American Keep it lightweight – mobile / Typewriter tablet devices are a lot less powerful, even at the top end
  • 11. STYLING IT UP • CSS3 – more than just rounded corners and drop shadows! • Imageless gradients – saves file size • Multiplebackgrounds – adds texture over bg gradient background: url(/img/bg.png) top center, -webkit-gradient(linear, left top, left bottom, from(#1feee7), to(#16a6a1));
  • 12. STYLING IT UP • Multiplebox-shadow on flat textured elements – inset light colours for highlights • Use box-sizing to change the box model of an element – useful for fluid designs
  • 13. STYLING IT UP • Uses rgba() throughout for blended colours and transform for ‘shuffling’ the menu • :nth-child cards a bit #menu li:nth-child(3n+2) { -webkit-transform: rotate(0.7deg); } #menu li:nth-child(3n+3) { -webkit-transform: rotate(-1deg); }
  • 14. MEDIA QUERIES Serve different stylesheets based on different browser / device configurations
  • 15. MEDIA QUERIES • For this app, the main stylesheet styles the app for iPhone / small screen devices • This depends on the project, but using the simplest version is a good fallback for older mobile devices • It also means that phones download use the smallest amount of bandwidth
  • 16. MEDIA QUERIES main.css contains a section which restyles for landscape orientation /* landscape mode */ @media only screen and (orientation:landscape) { body { xxx: xxx } }
  • 18. MEDIA QUERIES big.css is used for any devices with a higher width than 481px – desktop browsers, iPads, etc. <link href='/css/big.css' rel='stylesheet' media='only screen and (min-device- width: 481px)' />
  • 19. HI RESOLUTION STYLES Include using a min-device-pixels media query to serve to high-DPI devices <link href='/css/hi-res.css' rel='stylesheet' media='only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min-device-pixel-ratio: 2)' />
  • 20. HI RESOLUTION STYLES Add double-size graphics, then shrink them to the proper size with background-size Remember that these extra images take up a lot of precious space html { background: url(/img/bg-hi.png) top center (50%, 50%); } footer { background-image: url(/img/wood-hi.jpg); background-size: cover; }
  • 21. APP CACHING Your cache manifest is a simple file that tells the browser to cache certain files You specify it using a manifest attribute on your opening <html> tag: <html manifest=‘cache.manifest’>
  • 22. APP CACHING The browser will need to be told how to read it, either in the .htaccess file or using a PHP wrapper file (or similar): AddType text/cache-manifest .manifest You could quite easily write a backend script to generate your manifest automatically
  • 23. APP CACHING This one is very simple – CACHE MANIFEST it’s just a list of files that # unflappable : cache v0.17 need caching (I’ve cut /css/reset.css some out here) /css/main.css /css/big.css /css/hi-res.css Your file must start with CACHE MANIFEST /img/icon.png /img/bg.png /img/bg-hi.png /img/brass.jpg /img/brass-hi.jpg /img/paper.jpg /img/wood.jpg /img/wood-hi.jpg
  • 24. APP CACHING Difficult to debug – fails silently if missing files or on bad syntax. Chrome dev tools are your friend!
  • 25. APP CACHING 5MB limit on cached apps – keep an eye on file / data size When you update, you must change the manifest in some way – usually incrementing a version number is best # unflappable : cache v0.946
  • 26. LOCAL STORAGE Simple key / value pairs Essentially just persistent variables, specific to your app / domain localStorage items are always strings – you can save objects into it by using JSON.stringify() This app uses localStorage to store the JSON object with all the presentation data in
  • 27. LOCAL STORAGE To set a localStorage variable: localStorage.setItem(‘key’, ‘value’); To retrieve a localStorage variable: localStorage.getItem(‘key’); And then delete it permanently: localStorage.removeItem(‘key’)
  • 28. LOCAL STORAGE For more complex data storage, you can also use WebSQL – client side SQL databases Cross-browser support isn’t as wide, though iOS supports it fine
  • 29. META TAGS & ICONS A bunch of stuff in the <head> to set up your app! <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"> <meta name="apple-mobile-web-app-capable" content="yes" /> <link rel="icon" href="/img/icon.png" /> <link rel="apple-touch-icon" href="/img/apple-icon.png" /> <link rel="apple-touch-icon" href="/img/apple-icon-hi.png" sizes="114x114" />
  • 30. META TAGS & ICONS The viewport meta tag lets you set how iOS (and other devices) will handle resizing, scrolling, and other detail <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
  • 31. META TAGS & ICONS The apple-mobile-web-app-capable meta tag tells iOS to not display browser chrome when a user runs this app from the home screen <meta name="apple-mobile-web-app-capable" content="yes" />
  • 32. META TAGS & ICONS apple-mobile-web-app-status-bar-style allows you to set the status bar colour Default is the light bar, also black or black- translucent If you use black-translucent, your content will have an extra 20px to fill:
  • 33. META TAGS & ICONS Icons specified in the <head> are used on the user’s home screen alongside native apps Use a 72px icon for iPad, and a 114px icon for Retina displays – if you have more than one, specify which is which using the sizes attribute <link rel="icon" href="/img/icon.png" /> <link rel="apple-touch-icon" href="/img/apple-icon.png" /> <link rel="apple-touch-icon" href="/img/apple-icon-hi.png" sizes="114x114" />
  • 34. WHAT NEXT? This is a very simple introduction to what HTML5 apps can do in the mobile space A surprising amount of features are exposed to mobile browsers Canvas interactivity, video, audio, geolocation, and the accelerometer are just a few things which are available for your apps
  • 35. WHAT NEXT? Dive into HTML5 (Mark Pilgrim) http://diveintohtml5.org The HTML5 Doctor (various) http://html5doctor.com HTML5 Poker cheat sheet (by... me) http://semibad.com/s/poker
  • 36. THANK YOU Please refrain from asking difficult questions @semibad andi@semibad.com http://semibad.com

Notes de l'éditeur

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n