Coder Social home page Coder Social logo

device-configurator's Introduction

Foldable Device Configurator

Foldable Device Configurator is a little Web Component which you can drop in your application to test the CSS Viewport Segments Polyfill located here

How to use the foldable configurator in your project?

$ npm install --save-dev foldable-device-configurator

You then need to import the ESM module into your project (which depends on how you import ES modules), here is an example :

    <script type='module' src="../node_modules/foldable-device-configurator/src/foldable-device-configurator.js"></script>

When imported, in your HTML file just add the following lines:

    <foldable-device-configurator></foldable-device-configurator>

Adapting your web application to foldable/dual screen devices

This web component will let you emulate various foldable configurations and will set the foldable polyfills accordingly. Currently there are two polyfills you can use to design or adapt web contents for foldable devices :

  • A JavaScript API called Viewport Segments located here
  • CSS Properties called Viewport Segments located here

Both are proposals from Microsoft. At this time the configurator will only set the viewportsegments media-queries.

โš ๏ธ The two aforementioned APIs are early work in progress and are subject to change anytime.

Demo

  • Go here

  • You can also try a more advanced demo here

Working on the foldable configurator component

This project makes use of ECMAScript Modules (ESM) and runs them directly in the browser using Vite. If you install new dependencies using npm like npm install --save my-dependency, then please run npm run build afterwards to generate the new modules in docs folder. Also, the docs folder should be committed. Make sure to update the package.json file accordingly.

To install app dependencies and but any further steps, run

$ npm install

Shoelace web components can be found here

$ npm run build

To test in the browser, run

$ npm run start

To build, run

$ npm run build

The build is then ready to publish to npm (inside the dist/ directory)

This demo is being developed by :

Intel

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.