New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

codein

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

codein

Tokenized code input

latest
Source
npmnpm
Version
0.2.1
Version published
Weekly downloads
10
-23.08%
Maintainers
1
Weekly downloads
 
Created
Source

Codein

Tokenized code input

Install

With Bower

bower install codein

With NPM

npm install codein

Example Setup

Javascript

import Codein from 'codein';

// create an instance (with the defaults)
const codein = new Codein({
  el: document.querySelector('.codein-input'),
  mask: document.querySelector('.codein-input-mask'),
  maskChar: 0,
  alphaNum: false,
  max: 6,
  digitClass: 'digit',
  enter: codein => {},
  update: codein => {},
});

Methods

codein.lock(); // lock the input
codein.unlock(); // unlock the input
codein.focus(); // focus the input
codein.value; // get the value
codein.value = '12123'; // set the value
codein.reset(); // reset the input
codein.destroy(); // destroy the codein

HTML

<div class="codein-input-wrapper">
  <div class="codein-input"></div>
  <div class="codein-input-mask"></div>
</div>

CSS

.codein-input-wrapper {
  font-family: monospace;
  width: 100%;
  max-width: 40rem;
  position: relative
}

.codein-input-wrapper .codein-input {
  border: 1px solid #ddd;
  position: relative;
  z-index: 10;
}

.codein-input-wrapper .codein-input:empty {
  padding-left: calc((100% / 6 / 2) - 0.35rem);
}

.codein-input-wrapper .codein-input,
.codein-input-wrapper .codein-input-mask {
  font-size: 1rem;
  width: 100%;
  height: 2rem;
  line-height: 2rem;
}

.codein-input-wrapper .codein-input-mask {
  color: #ccc;
  pointer-events: none;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

.codein-input-wrapper .digit {
  display: inline-block;
  pointer-events: none;
  text-align: center;
  width: calc(100% / 6);
  height: 100%;
}

License

MIT License

Keywords

code

FAQs

Package last updated on 08 Nov 2017

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