New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

foldable-device-configurator

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

foldable-device-configurator

A simple web component which you can add to emulate various type of foldables devices. It will set the appropriate media queries according to the device and the setup.

  • 3.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

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.

:warning: 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 Snowpack. If you install new dependencies using npm like npm install --save @material/mwc-button, then please run npx snowpack afterwards to generate the new modules in web_modules folder. Also, the web_modules 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

ESM compatible modules can be found using pika.dev. Material design web components can be found by searching for @material/mwc-. You can try out the demo page here: Material Web Components demo

Then run

$ 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

FAQs

Package last updated on 15 Feb 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc