80
For Web Developers and Designers iOS 8 & iPhone 6 [email protected] 2014-09-23

iOS 8 and iPhone 6 for web developers and designers

Embed Size (px)

DESCRIPTION

iOS 8 is finally here while the new iPhone 6 and iPhone 6 plus will appear in a few days. New APIs appears on scene, as well as new challenges to support the new screen sizes. I’ve been playing with the final version and here you have my findings.

Citation preview

Page 1: iOS 8 and iPhone 6 for web developers and designers

For Web Developers and Designers

iOS 8 & iPhone 6

[email protected]

2014-09-23

Page 2: iOS 8 and iPhone 6 for web developers and designers

iPhone 6 and iPhone 6 Plus

New API support

New Safari features

Going Native with iOS 8

Safari extensions

New web design features

Contents

Page 3: iOS 8 and iPhone 6 for web developers and designers

1 iPhone6 and iPhone 6 Plus

Page 4: iOS 8 and iPhone 6 for web developers and designers

iPhone 6 screens overview

There is an excellent review of iPhone 6 screen sizes at iPhone 6 Screens Demystified

Page 5: iOS 8 and iPhone 6 for web developers and designers

iPhone 6 screens overview

iPhone 6 iPhone 6 Plus

Display size 4.7” 5.5”

Viewport’s device-width(in CSS pixels) 375 414

Viewport’s device-width on Android devices width similar display size

360 400

Device Pixel Ratio 2 3

Rendered Pixels(default viewport size * dpr)

750×1334 1242×2208

Physical pixels 750×1334 1080×1920

There is an excellent review of iPhone 6 screen sizes at iPhone 6 Screens Demystified

Page 6: iOS 8 and iPhone 6 for web developers and designers

Viewport size

iPhone 6 Plus

Page 7: iOS 8 and iPhone 6 for web developers and designers

Viewport size

<meta name="viewport"

content="width=375">

<meta name="viewport"

content="width=414">

iPhone 6 Plus

Page 8: iOS 8 and iPhone 6 for web developers and designers

Device Pixel Ratio

Page 9: iOS 8 and iPhone 6 for web developers and designers

Device Pixel Ratio 320×480 (points)

375×667 (points) 414×736

(points)

Original iPhone iPhone 6 iPhone 6 Plus

Page 10: iOS 8 and iPhone 6 for web developers and designers

render at 1x render at 2x render at 3x

320×480

(pixels)

750×1334 (pixels)

1242×2208 (pixels)

1080×1920 (pixels)

downsampling / 1.15

Page 11: iOS 8 and iPhone 6 for web developers and designers

render at 1x render at 2x

render at 3x

Original iPhone iPhone 6 iPhone 6 Plus

downsampling / 1.15

Page 12: iOS 8 and iPhone 6 for web developers and designers

Icon sizes

Page 13: iOS 8 and iPhone 6 for web developers and designers

Icon sizes

<!-- (iPhone 4/5)s --> <link rel="apple-touch-icon-precomposed" sizes="120x120" href="retinahd_icon.png">

<!-- (iPhone 6/6 plus)s --> <link rel="apple-touch-icon-precomposed" sizes="180x180" href="retinahd_icon.png">

Page 14: iOS 8 and iPhone 6 for web developers and designers

Launch Images

Page 15: iOS 8 and iPhone 6 for web developers and designers

Launch Images

<link rel="apple-touch-startup-image" href="launch6.png" media="(device-width: 375px)">

<link rel="apple-touch-startup-image" href="launch6plus.png" media="(device-width: 414px)">

Page 16: iOS 8 and iPhone 6 for web developers and designers

2 New API support

Page 17: iOS 8 and iPhone 6 for web developers and designers

WebGL for 3D canvas

Page 18: iOS 8 and iPhone 6 for web developers and designers

WebGL for 3D canvas

http://fishgl.com

Page 19: iOS 8 and iPhone 6 for web developers and designers

Support IndexedDB

Page 20: iOS 8 and iPhone 6 for web developers and designers

Support IndexedDB

var db; var request = window.indexedDB.open("newDatabase", 1); request.onerror = function(event) { console.log("error: "); }; request.onsuccess = function(event) { db = request.result; console.log("success: "+ db); }; request.onupgradeneeded = function(event) { }

Page 21: iOS 8 and iPhone 6 for web developers and designers
Page 22: iOS 8 and iPhone 6 for web developers and designers
Page 23: iOS 8 and iPhone 6 for web developers and designers

High Resolution Time API

Page 24: iOS 8 and iPhone 6 for web developers and designers

High Resolution Time API

window.performance.now();

Page 25: iOS 8 and iPhone 6 for web developers and designers
Page 26: iOS 8 and iPhone 6 for web developers and designers
Page 27: iOS 8 and iPhone 6 for web developers and designers

Navigation Timing API

window.addEventListener("load", function() { setTimeout(function() { var timing = window.performance.timing; var userTime = timing.loadEventEnd - timing.navigationStart; var dns = timing.domainLookupEnd - timing.domainLookupStart; var connection = timing.connectEnd - timing.connectStart; var requestTime = timing.responseEnd - timing.requestStart; var fetchTime = timing.responseEnd - timing.fetchStart; // use timing data }, 0); }, false);

Page 28: iOS 8 and iPhone 6 for web developers and designers
Page 29: iOS 8 and iPhone 6 for web developers and designers
Page 30: iOS 8 and iPhone 6 for web developers and designers

Web Cryptography API

Page 31: iOS 8 and iPhone 6 for web developers and designers

Web Cryptography API

var data = new Uint8Array([0x00, 0x01, 0x02, 0x03, 0x04]); var op = window.polycrypt.digest("SHA-256", data); op.oncomplete = function(e) { console.log( "Hash returned: " + e.target.result.toString() ); }

Page 32: iOS 8 and iPhone 6 for web developers and designers
Page 33: iOS 8 and iPhone 6 for web developers and designers
Page 34: iOS 8 and iPhone 6 for web developers and designers

3 New Safari features

Safari on iOS 8 has new features that might affect how our websites are rendered.

Page 35: iOS 8 and iPhone 6 for web developers and designers

Autocomplete and credit card scan

Page 36: iOS 8 and iPhone 6 for web developers and designers

Autocomplete and credit card scan

Page 37: iOS 8 and iPhone 6 for web developers and designers

Request the Desktop Site for Any Webpage

Page 38: iOS 8 and iPhone 6 for web developers and designers

Request the Desktop Site for Any Webpage

Page 39: iOS 8 and iPhone 6 for web developers and designers

Request Desktop Site Default User Agent

What's happening?

Page 40: iOS 8 and iPhone 6 for web developers and designers

Access Recently Closed Tabs Faster

Page 41: iOS 8 and iPhone 6 for web developers and designers

Access Recently Closed Tabs Faster

Page 42: iOS 8 and iPhone 6 for web developers and designers

Create a Separate Window for Private Browsing

Page 43: iOS 8 and iPhone 6 for web developers and designers

Create a Separate Window for Private Browsing

iOS 7 iOS 8

Page 44: iOS 8 and iPhone 6 for web developers and designers

RSS is alive

Page 45: iOS 8 and iPhone 6 for web developers and designers

RSS is alive

Page 46: iOS 8 and iPhone 6 for web developers and designers

DuckDuckGo is now available as a default search engine

Page 47: iOS 8 and iPhone 6 for web developers and designers

DuckDuckGo is now available as a default search engine

Page 48: iOS 8 and iPhone 6 for web developers and designers

4 Going Native with iOS 8

Page 49: iOS 8 and iPhone 6 for web developers and designers

The new WebView

WKWebKit

Page 50: iOS 8 and iPhone 6 for web developers and designers

5 Safari extensions

Page 51: iOS 8 and iPhone 6 for web developers and designers

6 New web design features

Page 52: iOS 8 and iPhone 6 for web developers and designers

Animated PNG

Page 53: iOS 8 and iPhone 6 for web developers and designers

Animated PNG

Page 54: iOS 8 and iPhone 6 for web developers and designers
Page 55: iOS 8 and iPhone 6 for web developers and designers

Hairline Border

Page 56: iOS 8 and iPhone 6 for web developers and designers

Hairline Border

Standard border syntax: div { border: 1px solid black; } Retina hairline border syntax: @media (-webkit-min-device-pixel-ratio: 2) { div { border-width: 0.5px; } }

Page 57: iOS 8 and iPhone 6 for web developers and designers
Page 58: iOS 8 and iPhone 6 for web developers and designers

SVG Fragment identifiers

Page 59: iOS 8 and iPhone 6 for web developers and designers

SVG Fragment identifiers

<view id="devil-view" viewBox="0 45 48 40"/> <view id="monkey-view" viewBox="0 0 48 41"/>

<img src='../images/faces.svg#devil-view'> <img src='../images/faces.svg#svgView(viewBox(0,45,48,40))'>

SVG code:

HTML code:

Page 60: iOS 8 and iPhone 6 for web developers and designers
Page 61: iOS 8 and iPhone 6 for web developers and designers

http://www.broken-links.com/tests/svg/fragment-identifiers.php

Page 62: iOS 8 and iPhone 6 for web developers and designers

CSS Compositing and Blending

Page 63: iOS 8 and iPhone 6 for web developers and designers

CSS Compositing and Blending

<svg> <circle cx="40" cy="40" r="40" fill="red"/> <circle cx="80" cy="40" r="40" fill="green"/> <circle cx="60" cy="80" r="40" fill="blue"/> </svg>

circle { mix-blend-mode: screen; }

SVG code:

CSS code:

Page 64: iOS 8 and iPhone 6 for web developers and designers
Page 65: iOS 8 and iPhone 6 for web developers and designers

http://codepen.io/bennettfeely/full/csjzd/

http://codepen.io/bennettfeely/full/csjzd/

Page 66: iOS 8 and iPhone 6 for web developers and designers

CSS Shapes

Page 67: iOS 8 and iPhone 6 for web developers and designers
Page 68: iOS 8 and iPhone 6 for web developers and designers

http://codepen.io/adobe/full/Brtdz

Page 69: iOS 8 and iPhone 6 for web developers and designers

Image Source Set

Page 70: iOS 8 and iPhone 6 for web developers and designers

Image Source Set

<img src="image-src.png" srcset="image-1x.png 1x, image-2x.png 2x, image-3x.png 3x, image-4x.png 4x">

Page 71: iOS 8 and iPhone 6 for web developers and designers
Page 72: iOS 8 and iPhone 6 for web developers and designers

http://www.webkit.org/demos/srcset/

Page 73: iOS 8 and iPhone 6 for web developers and designers

HTML Template Support

Page 74: iOS 8 and iPhone 6 for web developers and designers

HTML Template Support

<template id="row"> <tr><td><td> </template>

var template = document.querySelector('#row'); var clone = template.content.cloneNode(true); var cells = clone.querySelectorAll('td'); cells[0].textContent = 'Joe'; cells[1].textContent = 'red';

HTML code:

JavaScript code:

Page 75: iOS 8 and iPhone 6 for web developers and designers
Page 76: iOS 8 and iPhone 6 for web developers and designers
Page 77: iOS 8 and iPhone 6 for web developers and designers

Full Screen API for video elements

Page 78: iOS 8 and iPhone 6 for web developers and designers

Full Screen API for video elements document.querySelector("video").webkitEnterFullScreen()

Page 79: iOS 8 and iPhone 6 for web developers and designers
Page 80: iOS 8 and iPhone 6 for web developers and designers