Are we there yet?
@miguelcamba
@cibernox
miguelcamba.com
Being the most important one...
Think.
Mobile.
First.
4M players
500K players
2 years
2 weeks!!
6x
1x
I have some numbers
Internet subcribers
2.2 B
2013
2020
4 B
Mobile
Desktop
2.4 B
2.8 B
*At least don't break misserably
User input
App update
export default Ember.Component.extend({
click: function(e) {
/* */
}
}
Text
export default Ember.Component.extend({
touchStart: function(e) {
/* preventDefault */
},
touchMove: function(e) {
/* preventDefault */
},
touchEnd: function(e) {
/* preventDefault */
},
click: function(e) {
/* fallback for desktop */
}
}
< 100ms
100-300
300-1s
> 1s
Instantaneous
Uncertainty
Classic workflow
Animated transition
100ms
Animation start
Animation end
50-100ms
User interaction
Perceived completeness
Animation
Watch Chrome Dev Summit talk by Paul Lewis
Animate along with the gesture
Preload content
// Basic usage
element.animate([{ left: 0, opacity: 0 }, { left: 100, opacity: 1 }], 2000);
// Fully customizable
element.animate(
[{ color: 'black' }, { color: 'yellow' }],
{ duration: 1000, delay: 250, easing: 'ease-in-out', iterations: 3 }
);
// Full control
var player = element.animate([{ left: 0 }, { left: 100 }], 2000);
// Pause
player.pause();
// Play
player.play();
// 2x speed
player.playbackRate = 2;
// Reverse
player.reverse();
// Seek
player.currentTime = 1000;
https://github.com/web-animations/web-animations-next
var CACHE_NAME = 'mobile-patterns-v1';
self.addEventListener('fetch', function(event) {
var fetchRequest = event.request.clone();
var cacheRequest = event.request.clone();
event.respondWith(
fetch(fetchRequest).then(function(response) {
caches.open(self.CACHE_NAME).then(function(cache) {
var cacheSaveRequest = event.request.clone();
cache.put(cacheSaveRequest, response.clone());
});
return response;
}).catch(function(err) {
return caches.match(cacheRequest);
})
);
});
offline-support.js
if ('serviceWorker' in window.navigator) {
window.navigator.serviceWorker.register('/offline-support.js');
}
Register the worker