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

vue-keys-display

v1.1.1

Published

<!-- Improved compatibility of back to top link: See: https://github.com/othneildrew/Best-README-Template/pull/73 -->

Downloads

3

Readme

Contributors Forks Stargazers Issues MIT License LinkedIn

About The Project

Product Name Screen Shot

Product Name Screen Shot

KeyDisplayPlugin ,as the name implies, is a plugin for Vue 3 that displays key pressed on your screen. KeyDisplayPlugin is a standalone component and require almost no dependencies.

Built With

Vue

Getting Started

Installation

To start using KeyDisplayPLugin:

  1. Install KeyDisplayPlugin using your package manager.
  • npm
    npm i vue-keys-display
  • yarn
    yarn install vue-keys-display
  • pnpm
    pnpm install vue-keys-display
  1. Import the plugin and use it

    import KeyDisplayPlugin from "vue-plugin-key-display";
    import App from "./App.vue";
    
    const app = createApp(App);
    app.use(KeyDisplayPlugin);
  2. (Optional) Import default CSS styling

    import "vue-plugin-key-display/style.css";
  3. Use the KeyAnchor component

<main
  class="flex items-center justify-center h-full overflow-scroll background-wrapper"
>
  <!-- Put anywhere in your app. For default css Styling, put it under body or your root -->
  <KeyAnchor
    :fadeDelay="1500"
    :displayOnEventCallOnly="false"
    :events="[events]"
    :blackList="[blacklisted]"
    :KeyCtrlStyleObject="{ color: 'red' }"
    :numberOfKeyGroupDisplayed="8"
  />
  <!-- Rest of you code Here -->
</main>

Usage

Using the plugin is pretty straight forward, use the props on KeyAnchor component to customize the behaviour. Below is a list of props accepted by option object.

KeyAnchor props

interface KeyPluginOptions {
  KeyAnchorStyleObject?: StyleValue | undefined;
  KeyContainerStyleObject?: StyleValue | undefined;
  KeyGroupStyleObject?: StyleValue | undefined;
  KeyBlocStyleObject?: StyleValue | undefined;
  KeyAltStyleObject?: StyleValue | undefined;
  KeyShiftStyleObject?: StyleValue | undefined;
  KeyCtrlStyleObject?: StyleValue | undefined;
  fadeDelay?: number;
  numberOfKeyGroupDisplayed?: number;
  blackList?: KeyEntity[];
  events?: KeyEntity[];
  displayOnEventCallOnly?: boolean;
}

| Props | Description | Type | Default | Example | | ------------------------- | ----------------------------------------------------------------------------------------------------------- | -------------------- | --------- | ------------------------------------------------- | | KeyAnchorStyleObject | Represents inline styling applied to the outer keys wrapper This is the direct parent to the keys container | StyleValue/undefined | undefined | { position: 'absolute', top: '50%', left: '50%' } | | KeyContainerStyleObject | Represents inline styling applied to the inner keys wrapper. This is the direct parent to the keys Group | StyleValue/undefined | undefined | { padding: '3rem' } | | KeyGroupStyleObject | Reperents inline styling applied to a key group. this is the direct parent to keys blocs. | StyleValue/undefined | undefined | { background-color: 'red', fontSize: '30px' } | | KeyBlocStyleObject | Reperents inline styling applied to a key bloc. | StyleValue/undefined | undefined | { color: 'blue' } | | KeyAltStyleObject | Reperents inline styling applied to the Alt bloc. | StyleValue/undefined | undefined | { color: 'green' } | | KeyShiftStyleObject | Reperents inline styling applied to the Alt bloc. | StyleValue/undefined | undefined | { color: 'yellow' } | | KeyCtrlStyleObject | Reperents inline styling applied to the Alt bloc. | StyleValue/undefined | undefined | { color: 'purple' } | | fadeDelay | Time in ms before key group fade out | Number | 2000 | 5000 | | numberOfKeyGroupDisplayed | Number of key groups displayed at the same time | Number | 3 | 8 | | blackList | Array of KeyEntities to blacklist | KeyEntity[] | undefined | See below | | events | Array of keyEntities that will call their function on press | KeyEntity[] | undefined | See below | | displayOnEventCallOnly | Boolean to show keys displayed only if they are linked to an events in the Events props | Boolean | false | |

// Constructor parameter of KeyEntity.ts
    private _content: string,
    private _modifiersKeyState: ModifiersKeysState = {
      altPressed: false,
      ctrlPressed: false,
      shiftPressed: false,
    },
    readonly _callback?: (...params: any) => void,
    private readonly _message?: string

Examples:

<template>
  <main
    class="flex items-center justify-center h-full overflow-scroll background-wrapper"
  >
    <KeyAnchor
      :fadeDelay="1500"
      :displayOnEventCallOnly="false"
      :events="[events]"
      :blackList="[blacklisted]"
      :KeyCtrlStyleObject="{ color: 'red' }"
      :numberOfKeyGroupDisplayed="8"
    />
    <h1 class="font-serif text-center dark:text-white text-7xl">
      KeyDisplayPlugin
    </h1>
  </main>
</template>

<script lang="ts">
  import { KeyAnchor, KeyEntity } from "vue-keys-display";

  export default {
    setup() {
      const events = new KeyEntity(
        "A",
        { altPressed: false, ctrlPressed: true, shiftPressed: false },
        () => {
          console.log("hello world from console");
        },
        "hello world 😂 on screen"
      );
      const blacklisted = new KeyEntity("X", {
        ctrlPressed: true,
        altPressed: false,
        shiftPressed: false,
      });
      return { events, blacklisted };
    },
    components: { KeyAnchor },
  };
</script>

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE.txt for more information.

Contact

Mehdi Mani - [email protected]

Project Link: https://github.com/Mehdi-Mani/KeyDisplayVuePlugin

Acknowledgments

Use this space to list resources you find helpful and would like to give credit to. I've included a few of my favorites to kick things off!