Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Blur the Lines: Write Web Apps That Feel Native
Search
Rob Tarr
March 09, 2014
Technology
1
99
Blur the Lines: Write Web Apps That Feel Native
Slides from my presentation with @ethanbmuller and @mutewinter at SXSW 2014.
Rob Tarr
March 09, 2014
Tweet
Share
More Decks by Rob Tarr
See All by Rob Tarr
Frontend_Testing.pdf
robtarr
0
100
Blur The Lines - Native Feeling Web Apps
robtarr
0
86
Blur the Lines: How to write web apps that look native.
robtarr
0
83
Responsive JavaScript
robtarr
4
950
Development Tools and Responsive JavaScript
robtarr
1
160
JavaScript App Development
robtarr
3
390
Other Decks in Technology
See All in Technology
スタートアップ1人目QAエンジニアが QAチームを立ち上げ、“個”からチーム、 そして“組織”に成長するまで / How to set up QA team at reiwatravel
mii3king
1
1.1k
Moved to https://speakerdeck.com/toshihue/presales-engineer-career-bridging-tech-biz-ja
toshihue
2
550
Bounded Context: Problem or Solution?
ewolff
1
210
データ基盤の成長を加速させる:アイスタイルにおける挑戦と教訓
tsuda7
3
650
ハッキングの世界に迫る~攻撃者の思考で考えるセキュリティ~
nomizone
12
4.5k
目の前の仕事と向き合うことで成長できる - 仕事とスキルを広げる / Every little bit counts
soudai
22
5.8k
MC906491 を見据えた Microsoft Entra Connect アップグレード対応
tamaiyutaro
1
480
転生CISOサバイバル・ガイド / CISO Career Transition Survival Guide
kanny
2
390
Building Products in the LLM Era
ymatsuwitter
10
4.4k
バックエンドエンジニアのためのフロントエンド入門 #devsumiC
panda_program
16
6.5k
Tech Blogを書きやすい環境づくり
lycorptech_jp
PRO
0
120
トラシューアニマルになろう ~開発者だからこそできる、安定したサービス作りの秘訣~
jacopen
2
1.5k
Featured
See All Featured
Practical Orchestrator
shlominoach
186
10k
Reflections from 52 weeks, 52 projects
jeffersonlam
348
20k
Faster Mobile Websites
deanohume
306
31k
GraphQLの誤解/rethinking-graphql
sonatard
68
10k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Speed Design
sergeychernyshev
25
780
Bash Introduction
62gerente
610
210k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
27
1.5k
It's Worth the Effort
3n
184
28k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Optimising Largest Contentful Paint
csswizardry
34
3.1k
Transcript
Rob Tarr - @robtarr Jeremy Mack - @mutewinter Ethan Muller
- @ethanmuller Blur the Lines: Write Web Apps That Feel Native
Blur the Lines: Write web apps that look native What
are we talking about?
Building Native Web Apps
Blur the Lines: Write web apps that look native Who’s
Your Audience?
There are some advantages to a native app
A few native app cons ‣ Limited to certain devices
- iOS vs. Android ‣ Approval processes ‣ Delay in pushing out updates ‣ Some users don’t upgrade ‣ iOS no Nitro JavaScript engine
A few web app cons ‣ Limited access to APIs
‣ Publicity ‣ Harder to monetize
Building Native Web Apps
Blur the Lines: Write web apps that look native Typography
Safari Web Content Guide Apple’s Guide to Configuring Web Applications
bit.ly/1cMoCDB
iOS7 & Apple System Fonts
iOS7 & Apple System Fonts -apple-system-body -apple-system-caption1 -apple-system-caption2 -apple-system-footnote -apple-system-headline
-apple-system-short-body -apple-system-short-caption1 -apple-system-short-footnote -apple-system-short-headline -apple-system-short-subheadline bit.ly/1oDSoiS font: {
iOS7 & Apple System Fonts <div style="font:-apple-system-headline"> <div style="font-size:2em">This is
the headline…</div> </div>
Fallbacks for Apple System Fonts font-family: -apple-system-font, HelveticaNeue, Helvetica, sans-serif;
font-size: 17px; http://codepen.io/robtarr/pen/fsvIa
Safari Chrome
Safari Chrome <meta name="apple-mobile-web-app- capable" content="yes">
Safari Chrome <meta name="apple-mobile-web-app-status- bar-style" content=“black-translucent">
Safari Chrome navigator.standalone
Blur the Lines: Write web apps that look native Icons
Home Screen Icons
Home Screen Icons <link rel="apple-touch-icon" href="icon.png"> <link rel="apple-touch-icon" sizes="144x144" href="/icon-144x144.png">
bit.ly/1hnz18G
Home Screen Icons <link rel=“shortcut icon" sizes="144x144" href="icon.png"> <link rel=“shortcut
icon" sizes="196x196" href="/icon-144x144.png"> bit.ly/1ltRVzL
Home Screen Icons <meta name="msapplication-TileColor" content="#73c5d3"> <meta name="msapplication-TileImage" content="icon.png"> bit.ly/1lISkP3
Blur the Lines: Write web apps that look native Animations
We aren’t good at animation yet.
Be intentional about your animations.
Nothin’
Yikes.
Animated
Meh.
Timing Functions matthewlein.com/ceaser/
linear Really weird and unnatural-looking
ease-in-out Much nicer feeling (default in CSS)
easeOutExpo “The IKEA cabinet”
Timing Functions easings.net
Expo Ease Out
Mmkay. Getting There.
Nav Content Top of the page
Nav Content Top of the page
None
Nav Content Top of the page
Nav Content Top of the page
Tasty Parallaxy Feeling
Awwww yiss.
Now let’s get technical.
CSS transitions vs. CSS animations vs. JS animations CSS Transitions
& CSS Animations & JS based animations
CSS Transitions
CSS Animations
CSS transitions vs. CSS animations vs. JS animations JS Animation
Options
jQuery Animate
Transit http://ricostacruz.com/jquery.transit/
CSS animations are better than CSS animations, right?
Nah. Not necessarily. http://tinyurl.com/cssisntbetter
GreenSock http://www.greensock.com/
Famo.us http://famo.us/
CSS transitions vs. CSS animations vs. JS animations Rules of
thumb
Need to animate an active state on a button?
Need to animate an active state on a button? CSS
transitions
Need to animate an off-canvas menu or dropdown?
Need to animate an off-canvas menu or dropdown? Transit
Need to do a timeline-style animation?
Need to do a timeline-style animation? GreenSock
Need crazy, take-over- your-whole-interface animations?
None
CHALLENGE @sxblurthelines We’ll be tweeting codepen links from Fork the
pen, complete the mission, tweet your fork to @sxblurthelines
CHALLENGE You’ll need a codepen.io account. ! If you don’t
have one, go ahead and get one now.
CHALLENGE Replace jQuery’s animate with Transit’s transition (Transit is included
in this pen) Tweet your finished pen to @sxblurthelines
Blur the Lines: Write web apps that look native Behavior
fastclick ...mobile browsers will wait approximately 300ms from the time
that you tap the button to fire the click event. The reason for this is that the browser is waiting to see if you are actually performing a double tap. ! https://github.com/ftlabs/fastclick
fastclick playthreeve.com
fastclick
fastclick
fastclick
fastclick
CHALLENGE Add fastclick to some buttons (fastclick library included) Tweet
your finished pen to @sxblurthelines
dragging
dragging eightmedia.github.io/hammer.js/
Linking to Native Apps href=“tel:19374010915” href=“facetime:19374010915” ! href=“http://maps.apple.com? q=123+Webster+St.,+Dayton,+OH +45402”
bit.ly/1j2MswD
keyboards bit.ly/1fbFkOl
CHALLENGE Add proper input type to forms (no library needed)
Tweet your finished pen to @sxblurthelines
Blur the Lines: Write web apps that look native Performance
Performance bit.ly/1mu9bTz Simple explanation: ! The Nitro Javascript engine compiles
your code into native ARM code
Performance bit.ly/1mu9bTz Apps saved to the iOS home screen don’t
get the benefits of the Nitro JavaScript engine. BUSTED
Offline Apps Application Cache bit.ly/1bHGKAh bit.ly/1hs9ifb Service Workers mzl.la/1fkPWWa github.com/slightlyoff/ServiceWorker
github.com/phuu/ServiceWorker-Polyfill
Performance Write really good code.
Blur the Lines: Write web apps that look native New
APIs
Battery JavaScript APIs http://www.smartjava.org/examples/webapi-battery/
Camera JavaScript APIs <input type=“file”> bit.ly/1o3Lu3w
CHALLENGE Display a user-uploaded image inline (No library needed) Tweet
your finished pen to @sxblurthelines
JavaScript APIs shinydemos.com/warholiser/
Accelerometer JavaScript APIs isthisanearthquake.com
CHALLENGE Add “shake to clear” to a form (shake.js library
included) Tweet your finished pen to @sxblurthelines
Geolocation JavaScript APIs
CHALLENGE Use Geolocation to get the user’s address (no library
needed) Tweet your finished pen to @sxblurthelines
Blur the Lines: Write web apps that look native 3rd
Party APIs
What is an API?
Application Pudding Interface
Less code is better code
They’ve already got a JavaScript API
Blur the Lines: Write web apps that look native Good
Ones
Data ‣ Firebase ‣ Parse ‣ Dropbox Datastore
Payments ‣ Stripe ‣ Recurly ‣ Square ‣ Gumroad
File Storage ‣ Ink Filepicker ‣ Dropbox
Email ‣ Mandrill ‣ Sendgrid ‣ Postmark ‣ Mailgun
No Server ‣ Zapier ‣ Parse Cloud Functions ‣ UserApp
Blur the Lines: Write web apps that look native Frameworks
Ember
That’s it
Angular
React
Backbone
Building Native Web Apps
THANKS! @robtarr @mutewinter @ethanmuller