Dan Tello
Front End Dev at Viget.
The untapped power of web apps.
github.com/greypants
by Dan Tello, which rhymes with Mayo.
Also... I really like mayo.
Designer —>
Front End Developer
#viget15
8+ years with mah ladies!
+ 1 or 2 kids in a couple weeks...
+ 1 or 2 kids in a couple weeks...
6 month and 18 month old brothers!
Why another Native vs. Web discussion?
It's not a problem of technology.
It's a problem of focus.
Just because someone understands the value of mobile
Native iOS Integrations
But none were needed. They were just cloning the web app.
Responsive? Meh.
Mobile will have the native apps
mobile traffic!
Misunderstanding = Missed opportunities.
A disparity exists, but...
It's not a problem of technology,
it's a problem of focus.
Misunderstanding is holding us back
If clients don't understand the value, we won't be given the time.
Our clients and teams need clarity if we want to move forward.
- Animation (60fps)
- "Native" feeling single page apps
- Home screen apps
- Offline modes
- Icons
- Splash screens
- Push notifications (on Android)
- Geolocation
- Touch Gestures
- Camera access
- DeviceMotion access
- Web Audio API (AudioContext)
- WebSockets
All the things!
(or at least a lot of the things!)
The natural world doesn't glitch
When we understand how our browsers render
"High Performance Web Animations"
by Paul Irish & Paul Lewis
transform vs
margin
is an awesome resource
demo:
demo:
demo:
Enable homescreen apps
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<link rel="icon" href="app-icon.png">
<link rel="apple-touch-icon" href="app-icon.png">
Add Icons
<link rel="apple-touch-startup-image" href="/startup.png">
Add Startup Image (iOS only)
(limited)
<input type="file">
demo:
Native gets these for free:
Tapping (any number of taps)
Pinching in and out (for zooming a view)
Panning or dragging
Swiping (in any direction)
Rotating (fingers moving in opposite directions)
Long press (also known as “touch and hold”)
demo:
(web app in a native wrapper)
<audio> vs AudioContext
Inputs -> Effects -> Destination
AudioContext
// Create an Audio Context
var context = new AudioContext()
// Create a source
var source = context.createBufferSource()
// Add Volume Node
gainNode = context.createGain()
// Tell the source which sound to use
source.buffer = someAjaxLoadedBuffer
// Set the volume
gainNode.gain.value = 11
// Connect the source to the volume effect
source.connect(gainNode)
// Connect the volume node to the speakers
gainNode.connect(context.destination)
// Play the sound now
source.start(0)
Demo: synthesized guitar
DeviceOrientation and DeviceMotion
DeviceMotionEvent.rotationRate
alpha z access
beta front to back
gamma left to right
DeviceMotionEvent.acceleration
x east/west
y north/south
z up/down
DeviceOrientationEvent
alpha z access 0-360
beta x -180 to 180) front to back
gamma -90 to 90 left to right
iOS
webkitCompassHeading 360°
Demo
navigator.geolocation.getCurrentPosition(function(position) {
foo(position.coords.latitude, position.coords.longitude)
})
navigator.geolocation.watchCurrentPosition(function(position) {
foo(position.coords.latitude, position.coords.longitude)
})
demo:
demo:
browser: "Hey server, gimme some data."
server: "Some data."
browser: "A user just submitted a form!!!!1"
server: "Cool."
Traditional http communication is
a one-sided conversation
server: "hey browser, a million people just logged on"
client: "Woah, I'll display that on the page! BTW,
my user just logged out."
server: "Aight."
WebSocket connections are bi-directional
WebSockets are awesome for:
is a great place to get started
demo
Create opportunities to try that one new
thing you been wanting to do
My Personal Pointless Weekend Goals
Advantages Web has over Native
Advantages Web has over Native
Advantages Web has over Native
Advantages Web has over Native (recap)
Get slides and comment on SpeakerRate:
By Dan Tello