Code Monkey home page Code Monkey logo

device-posture's Introduction

favicon

Device Posture API

Authors

Abstract

This document specifies an API that allows web applications to request and be notified of changes of the posture of a device.

Goals

The device posture is the physical position in which a device holds which may be derived from sensors in addition to the angle. New types of mobile devices are appearing that have some sort of capabilities that allow them to change their posture. The most common types of devices are the ones that can fold (their screen or around their screen), allowing them to physically alter their form factor. The main interest in knowing the posture of a device is to enable new user experiences with responsive design.

Proposals

New CSS media query: device-posture

We propose a media query that would resolve to a set of fixed postures. These postures consist of a number of predefined values that each encompass a range of angles.

Among the values that the device-posture query can take are:

  • folded (applies to laptop/book postures)
  • folded-over (applies to tent modes)
  • continuous (applies to flat, tablet, or even seamless curved displays)

Examples

/*using the device in a 'book' posture*/
@media (device-posture: folded) and (screen-spanning: single-fold-vertical) { ... }

/*using the device in a 'tent' posture*/
@media (device-posture: folded-over) { ... }

New JS object in window.navigator: devicePosture

The Navigator property of Window navigator should host device capabilities and system states.

Proposed Object

DevicePosture : EventTarget {
  readonly attribute DevicePostureType type;
  attribute EventHandler onchange;
}

enum DevicePostureType {
  "folded",
  ...,
}

Stakeholder Feedback

No stakeholder feedback has been given at this time.

References & Acknowledgements

Many thanks for valuable feedback and advice from:

'drawing of different postures'

device-posture's People

Contributors

anssiko avatar beaufortfrancois avatar darktears avatar diekus avatar kenchris avatar xfq avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.