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

CREATING A POSITIVE SCHOOL CULTURE CHAPTER 10
CREATING A POSITIVE SCHOOL CULTURE CHAPTER 10CREATING A POSITIVE SCHOOL CULTURE CHAPTER 10
CREATING A POSITIVE SCHOOL CULTURE CHAPTER 10uasjlagroup
 
'CASE STUDY OF INDIRA PARYAVARAN BHAVAN DELHI ,
'CASE STUDY OF INDIRA PARYAVARAN BHAVAN DELHI ,'CASE STUDY OF INDIRA PARYAVARAN BHAVAN DELHI ,
'CASE STUDY OF INDIRA PARYAVARAN BHAVAN DELHI ,Aginakm1
 
Top 10 Modern Web Design Trends for 2025
Top 10 Modern Web Design Trends for 2025Top 10 Modern Web Design Trends for 2025
Top 10 Modern Web Design Trends for 2025Rndexperts
 
办理(宾州州立毕业证书)美国宾夕法尼亚州立大学毕业证成绩单原版一比一
办理(宾州州立毕业证书)美国宾夕法尼亚州立大学毕业证成绩单原版一比一办理(宾州州立毕业证书)美国宾夕法尼亚州立大学毕业证成绩单原版一比一
办理(宾州州立毕业证书)美国宾夕法尼亚州立大学毕业证成绩单原版一比一F La
 
办理(USYD毕业证书)澳洲悉尼大学毕业证成绩单原版一比一
办理(USYD毕业证书)澳洲悉尼大学毕业证成绩单原版一比一办理(USYD毕业证书)澳洲悉尼大学毕业证成绩单原版一比一
办理(USYD毕业证书)澳洲悉尼大学毕业证成绩单原版一比一diploma 1
 
(办理学位证)埃迪斯科文大学毕业证成绩单原版一比一
(办理学位证)埃迪斯科文大学毕业证成绩单原版一比一(办理学位证)埃迪斯科文大学毕业证成绩单原版一比一
(办理学位证)埃迪斯科文大学毕业证成绩单原版一比一Fi sss
 
韩国SKKU学位证,成均馆大学毕业证书1:1制作
韩国SKKU学位证,成均馆大学毕业证书1:1制作韩国SKKU学位证,成均馆大学毕业证书1:1制作
韩国SKKU学位证,成均馆大学毕业证书1:1制作7tz4rjpd
 
ARt app | UX Case Study
ARt app | UX Case StudyARt app | UX Case Study
ARt app | UX Case StudySophia Viganò
 
Call Girls in Ashok Nagar Delhi ✡️9711147426✡️ Escorts Service
Call Girls in Ashok Nagar Delhi ✡️9711147426✡️ Escorts ServiceCall Girls in Ashok Nagar Delhi ✡️9711147426✡️ Escorts Service
Call Girls in Ashok Nagar Delhi ✡️9711147426✡️ Escorts Servicejennyeacort
 
Architecture case study India Habitat Centre, Delhi.pdf
Architecture case study India Habitat Centre, Delhi.pdfArchitecture case study India Habitat Centre, Delhi.pdf
Architecture case study India Habitat Centre, Delhi.pdfSumit Lathwal
 
昆士兰大学毕业证(UQ毕业证)#文凭成绩单#真实留信学历认证永久存档
昆士兰大学毕业证(UQ毕业证)#文凭成绩单#真实留信学历认证永久存档昆士兰大学毕业证(UQ毕业证)#文凭成绩单#真实留信学历认证永久存档
昆士兰大学毕业证(UQ毕业证)#文凭成绩单#真实留信学历认证永久存档208367051
 
How to Empower the future of UX Design with Gen AI
How to Empower the future of UX Design with Gen AIHow to Empower the future of UX Design with Gen AI
How to Empower the future of UX Design with Gen AIyuj
 
PORTAFOLIO 2024_ ANASTASIYA KUDINOVA
PORTAFOLIO   2024_  ANASTASIYA  KUDINOVAPORTAFOLIO   2024_  ANASTASIYA  KUDINOVA
PORTAFOLIO 2024_ ANASTASIYA KUDINOVAAnastasiya Kudinova
 
办理学位证(NTU证书)新加坡南洋理工大学毕业证成绩单原版一比一
办理学位证(NTU证书)新加坡南洋理工大学毕业证成绩单原版一比一办理学位证(NTU证书)新加坡南洋理工大学毕业证成绩单原版一比一
办理学位证(NTU证书)新加坡南洋理工大学毕业证成绩单原版一比一A SSS
 
1比1办理美国北卡罗莱纳州立大学毕业证成绩单pdf电子版制作修改
1比1办理美国北卡罗莱纳州立大学毕业证成绩单pdf电子版制作修改1比1办理美国北卡罗莱纳州立大学毕业证成绩单pdf电子版制作修改
1比1办理美国北卡罗莱纳州立大学毕业证成绩单pdf电子版制作修改yuu sss
 
Business research proposal mcdo.pptxBusiness research proposal mcdo.pptxBusin...
Business research proposal mcdo.pptxBusiness research proposal mcdo.pptxBusin...Business research proposal mcdo.pptxBusiness research proposal mcdo.pptxBusin...
Business research proposal mcdo.pptxBusiness research proposal mcdo.pptxBusin...mrchrns005
 
8377877756 Full Enjoy @24/7 Call Girls in Nirman Vihar Delhi NCR
8377877756 Full Enjoy @24/7 Call Girls in Nirman Vihar Delhi NCR8377877756 Full Enjoy @24/7 Call Girls in Nirman Vihar Delhi NCR
8377877756 Full Enjoy @24/7 Call Girls in Nirman Vihar Delhi NCRdollysharma2066
 
306MTAMount UCLA University Bachelor's Diploma in Social Media
306MTAMount UCLA University Bachelor's Diploma in Social Media306MTAMount UCLA University Bachelor's Diploma in Social Media
306MTAMount UCLA University Bachelor's Diploma in Social MediaD SSS
 
DAKSHIN BIHAR GRAMIN BANK: REDEFINING THE DIGITAL BANKING EXPERIENCE WITH A U...
DAKSHIN BIHAR GRAMIN BANK: REDEFINING THE DIGITAL BANKING EXPERIENCE WITH A U...DAKSHIN BIHAR GRAMIN BANK: REDEFINING THE DIGITAL BANKING EXPERIENCE WITH A U...
DAKSHIN BIHAR GRAMIN BANK: REDEFINING THE DIGITAL BANKING EXPERIENCE WITH A U...Rishabh Aryan
 
办理学位证(TheAuckland证书)新西兰奥克兰大学毕业证成绩单原版一比一
办理学位证(TheAuckland证书)新西兰奥克兰大学毕业证成绩单原版一比一办理学位证(TheAuckland证书)新西兰奥克兰大学毕业证成绩单原版一比一
办理学位证(TheAuckland证书)新西兰奥克兰大学毕业证成绩单原版一比一Fi L
 

Dernier (20)

CREATING A POSITIVE SCHOOL CULTURE CHAPTER 10
CREATING A POSITIVE SCHOOL CULTURE CHAPTER 10CREATING A POSITIVE SCHOOL CULTURE CHAPTER 10
CREATING A POSITIVE SCHOOL CULTURE CHAPTER 10
 
'CASE STUDY OF INDIRA PARYAVARAN BHAVAN DELHI ,
'CASE STUDY OF INDIRA PARYAVARAN BHAVAN DELHI ,'CASE STUDY OF INDIRA PARYAVARAN BHAVAN DELHI ,
'CASE STUDY OF INDIRA PARYAVARAN BHAVAN DELHI ,
 
Top 10 Modern Web Design Trends for 2025
Top 10 Modern Web Design Trends for 2025Top 10 Modern Web Design Trends for 2025
Top 10 Modern Web Design Trends for 2025
 
办理(宾州州立毕业证书)美国宾夕法尼亚州立大学毕业证成绩单原版一比一
办理(宾州州立毕业证书)美国宾夕法尼亚州立大学毕业证成绩单原版一比一办理(宾州州立毕业证书)美国宾夕法尼亚州立大学毕业证成绩单原版一比一
办理(宾州州立毕业证书)美国宾夕法尼亚州立大学毕业证成绩单原版一比一
 
办理(USYD毕业证书)澳洲悉尼大学毕业证成绩单原版一比一
办理(USYD毕业证书)澳洲悉尼大学毕业证成绩单原版一比一办理(USYD毕业证书)澳洲悉尼大学毕业证成绩单原版一比一
办理(USYD毕业证书)澳洲悉尼大学毕业证成绩单原版一比一
 
(办理学位证)埃迪斯科文大学毕业证成绩单原版一比一
(办理学位证)埃迪斯科文大学毕业证成绩单原版一比一(办理学位证)埃迪斯科文大学毕业证成绩单原版一比一
(办理学位证)埃迪斯科文大学毕业证成绩单原版一比一
 
韩国SKKU学位证,成均馆大学毕业证书1:1制作
韩国SKKU学位证,成均馆大学毕业证书1:1制作韩国SKKU学位证,成均馆大学毕业证书1:1制作
韩国SKKU学位证,成均馆大学毕业证书1:1制作
 
ARt app | UX Case Study
ARt app | UX Case StudyARt app | UX Case Study
ARt app | UX Case Study
 
Call Girls in Ashok Nagar Delhi ✡️9711147426✡️ Escorts Service
Call Girls in Ashok Nagar Delhi ✡️9711147426✡️ Escorts ServiceCall Girls in Ashok Nagar Delhi ✡️9711147426✡️ Escorts Service
Call Girls in Ashok Nagar Delhi ✡️9711147426✡️ Escorts Service
 
Architecture case study India Habitat Centre, Delhi.pdf
Architecture case study India Habitat Centre, Delhi.pdfArchitecture case study India Habitat Centre, Delhi.pdf
Architecture case study India Habitat Centre, Delhi.pdf
 
昆士兰大学毕业证(UQ毕业证)#文凭成绩单#真实留信学历认证永久存档
昆士兰大学毕业证(UQ毕业证)#文凭成绩单#真实留信学历认证永久存档昆士兰大学毕业证(UQ毕业证)#文凭成绩单#真实留信学历认证永久存档
昆士兰大学毕业证(UQ毕业证)#文凭成绩单#真实留信学历认证永久存档
 
How to Empower the future of UX Design with Gen AI
How to Empower the future of UX Design with Gen AIHow to Empower the future of UX Design with Gen AI
How to Empower the future of UX Design with Gen AI
 
PORTAFOLIO 2024_ ANASTASIYA KUDINOVA
PORTAFOLIO   2024_  ANASTASIYA  KUDINOVAPORTAFOLIO   2024_  ANASTASIYA  KUDINOVA
PORTAFOLIO 2024_ ANASTASIYA KUDINOVA
 
办理学位证(NTU证书)新加坡南洋理工大学毕业证成绩单原版一比一
办理学位证(NTU证书)新加坡南洋理工大学毕业证成绩单原版一比一办理学位证(NTU证书)新加坡南洋理工大学毕业证成绩单原版一比一
办理学位证(NTU证书)新加坡南洋理工大学毕业证成绩单原版一比一
 
1比1办理美国北卡罗莱纳州立大学毕业证成绩单pdf电子版制作修改
1比1办理美国北卡罗莱纳州立大学毕业证成绩单pdf电子版制作修改1比1办理美国北卡罗莱纳州立大学毕业证成绩单pdf电子版制作修改
1比1办理美国北卡罗莱纳州立大学毕业证成绩单pdf电子版制作修改
 
Business research proposal mcdo.pptxBusiness research proposal mcdo.pptxBusin...
Business research proposal mcdo.pptxBusiness research proposal mcdo.pptxBusin...Business research proposal mcdo.pptxBusiness research proposal mcdo.pptxBusin...
Business research proposal mcdo.pptxBusiness research proposal mcdo.pptxBusin...
 
8377877756 Full Enjoy @24/7 Call Girls in Nirman Vihar Delhi NCR
8377877756 Full Enjoy @24/7 Call Girls in Nirman Vihar Delhi NCR8377877756 Full Enjoy @24/7 Call Girls in Nirman Vihar Delhi NCR
8377877756 Full Enjoy @24/7 Call Girls in Nirman Vihar Delhi NCR
 
306MTAMount UCLA University Bachelor's Diploma in Social Media
306MTAMount UCLA University Bachelor's Diploma in Social Media306MTAMount UCLA University Bachelor's Diploma in Social Media
306MTAMount UCLA University Bachelor's Diploma in Social Media
 
DAKSHIN BIHAR GRAMIN BANK: REDEFINING THE DIGITAL BANKING EXPERIENCE WITH A U...
DAKSHIN BIHAR GRAMIN BANK: REDEFINING THE DIGITAL BANKING EXPERIENCE WITH A U...DAKSHIN BIHAR GRAMIN BANK: REDEFINING THE DIGITAL BANKING EXPERIENCE WITH A U...
DAKSHIN BIHAR GRAMIN BANK: REDEFINING THE DIGITAL BANKING EXPERIENCE WITH A U...
 
办理学位证(TheAuckland证书)新西兰奥克兰大学毕业证成绩单原版一比一
办理学位证(TheAuckland证书)新西兰奥克兰大学毕业证成绩单原版一比一办理学位证(TheAuckland证书)新西兰奥克兰大学毕业证成绩单原版一比一
办理学位证(TheAuckland证书)新西兰奥克兰大学毕业证成绩单原版一比一
 

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