npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@vcv/device-emulator

v0.0.1

Published

a Vue component that simulates a mobile device screen within a desktop browser.

Downloads

1

Readme

device-emulator

Overview

The Device Emulator Vue Component is a Vue component that simulates a mobile device screen within a desktop browser. This component can be used to test responsive web design and to see how a website or web application looks on different devices.

The Device Emulator Vue Component is designed to be easily customizable and supports various devices and orientations.

Introduction

Device-Emulator is a Vue component that provides a simulation of different mobile and tablet devices to preview a website's responsiveness and layout. It's inspired by the Chrome DevTools Device Mode.

Features

  • Support for various devices, including iPhones, iPads, Samsung Galaxy, and more.
  • Preview website responsiveness and layout.
  • Switch between portrait and landscape modes.
  • Change the device's scale and resolution.
  • Toggle the device's borders and shadow.
  • Cross-browser compatibility.

Installation

To install the Device Emulator Vue Component, simply run:

npm install device-emulator --save
# 或者
yarn add device-emulator

Usage

To use the Device Emulator Vue Component, first import it into your Vue component:

import DeviceEmulator from 'device-emulator-vue'

Then, simply add the DeviceEmulator component to your template, passing in the device type and orientation as props:

<template>
  <div>
    <device-emulator :device-type="deviceType">
      <!-- 在这里放置要测试的内容 -->
      <p>Hello, world!</p>
    </device-emulator>
  </div>
</template>

<script>
import DeviceEmulator from 'device-emulator'

export default {
  components: {
    DeviceEmulator
  },
  data() {
    return {
      deviceType: 'iPhone X'
    }
  }
}
</script>

Props

The following props are available for the DeviceEmulator component:

  • device: The device type to emulate. Possible values are iphone-5, iphone-6, iphone-6-plus, iphone-x, ipad, ipad-pro, galaxy-s5, pixel-2, pixel-2-xl, and custom (default: iphone-x).
  • orientation: The orientation of the device. Possible values are portrait and landscape (default: portrait).
  • width: The width of the device in pixels (only applicable if device="custom").
  • height: The height of the device in pixels (only applicable if device="custom").

Props1

  • device (String, Required): The device to simulate. Available devices are listed in the table below.
  • scale (Number, Optional): The device's scale. Default is 1.
  • shadow (Boolean, Optional): Toggle the device's shadow. Default is true.
  • border (Boolean, Optional): Toggle the device's border. Default is true.

Examples

Here are some examples of how to use the Device Emulator Vue Component:

<template>
  <div>
    <!-- iPhone X, portrait -->
    <DeviceEmulator device="iphone-x" orientation="portrait">
      <!-- Your website or application content here -->
    </DeviceEmulator>

    <!-- iPad Pro, landscape -->
    <DeviceEmulator device="ipad-pro" orientation="landscape">
      <!-- Your website or application content here -->
    </DeviceEmulator>

    <!-- Custom device, 800x600, portrait -->
    <DeviceEmulator
      device="custom"
      orientation="portrait"
      :width="800"
      :height="600"
    >
      <!-- Your website or application content here -->
    </DeviceEmulator>
  </div>
</template>

<script>
  import DeviceEmulator from 'device-emulator-vue'

  export default {
    components: {
      DeviceEmulator
    }
  }
</script>

Available Devices

TODO

License

The Device Emulator Vue Component is open source software licensed under the MIT License.