All Projects → tympanix → pattern-lock-js

tympanix / pattern-lock-js

Licence: MIT License
An android inspired pattern lock in scalable vector graphics and pure javascript

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to pattern-lock-js

Termuxarch
You can use setupTermuxArch.bash 📲 to install Arch Linux in Amazon, Android, Chromebook and Windows. https://sdrausty.github.io/TermuxArch/docs/install
Stars: ✭ 653 (+1180.39%)
Mutual labels:  tablet, smartphone
TermuxPRoot
SetupTermuxPRoot.sh 📲 shall install Linux distributions in Termux on Android and Chrome. This setup script will attempt to set Linux distributions up in your Termux environment.
Stars: ✭ 59 (+15.69%)
Mutual labels:  tablet, smartphone
Termux Archlinux
You can use setupTermuxArch.bash 📲 to install Arch Linux in Termux on Amazon, Android, Chromebook and Windows. https://sdrausty.github.io/termux-archlinux/
Stars: ✭ 384 (+652.94%)
Mutual labels:  tablet, smartphone
Ngx Webcam
A simple Angular webcam component / pure & minimal, no flash-fallback
Stars: ✭ 148 (+190.2%)
Mutual labels:  tablet, smartphone
Boo
Boo - A beautiful, clean and responsive theme for Ghost.
Stars: ✭ 176 (+245.1%)
Mutual labels:  tablet, smartphone
Buildapks
Really quickly build APKs on handheld device (smartphone or tablet) in Amazon, Android, Chromebook and Windows📲 See https://buildapks.github.io/docsBuildAPKs/setup to start building APKs.
Stars: ✭ 218 (+327.45%)
Mutual labels:  tablet, smartphone
Termuxarch
Experience the pleasure of the Linux command prompt in Android, Chromebook, Fire OS and Windows on smartphone, smartTV, tablet and wearable https://termuxarch.github.io/TermuxArch/
Stars: ✭ 183 (+258.82%)
Mutual labels:  tablet, smartphone
termux-arch
You can use setupTermuxArch.sh 📲 to install Arch Linux in Termux on Android and Chrome. This setup script will attempt to set Arch Linux up in your Termux environment.
Stars: ✭ 25 (-50.98%)
Mutual labels:  tablet, smartphone
Binary-Calculator-JavaScript
📱 A handy Calculator for Binary operations, that works on all Devices 📱 💻 🖥 | ⛓ https://play.google.com/store/apps/details?id=com.binarycalculator.ayidouble.binarycalculator.app ⛓
Stars: ✭ 45 (-11.76%)
Mutual labels:  smartphone
CameraSlider
3D printed and smartphone controlled camera slider
Stars: ✭ 16 (-68.63%)
Mutual labels:  smartphone
Rainbow-Wifi-Hack-Utility-Android
The program implements brute Wi-Fi network method on platform Android
Stars: ✭ 39 (-23.53%)
Mutual labels:  smartphone
angular-keypad
📱🔢 A numerical keypad built for mobile devices.
Stars: ✭ 18 (-64.71%)
Mutual labels:  touch
R30X-Fingerprint-Sensor-Library
Arduino library for R30X series optical fingerprint scanners.
Stars: ✭ 13 (-74.51%)
Mutual labels:  touch
react-gallery-carousel
Mobile-friendly gallery carousel 🎠 with server side rendering, lazy loading, fullscreen, thumbnails, touch, mouse emulation, RTL, keyboard navigation and customisations.
Stars: ✭ 178 (+249.02%)
Mutual labels:  touch
roundy
Simple react round slider. Supports touch events.
Stars: ✭ 29 (-43.14%)
Mutual labels:  touch
CNN-VAD
A Convolutional Neural Network based Voice Activity Detector for Smartphones
Stars: ✭ 60 (+17.65%)
Mutual labels:  smartphone
FloatingView
FloatingView moved by finger supporting OverlaySystem, OverlayActivity, OverlayViewGroup modes
Stars: ✭ 58 (+13.73%)
Mutual labels:  touch
getting-touchy-presentation
Everything you (n)ever wanted to know about touch and pointer events
Stars: ✭ 42 (-17.65%)
Mutual labels:  touch
BezierCurtainEffect
贝塞尔曲线窗帘效果BezierCurtainEffect,BezierCurtainView,CurtainEffect,CurtainView
Stars: ✭ 45 (-11.76%)
Mutual labels:  touch
FT800-FT813
Multi-Platform C code Library for EVE graphics controllers from FTDI / Bridgetek (FT810, FT811, FT812, FT813, BT815, BT816, BT817, BT818)
Stars: ✭ 80 (+56.86%)
Mutual labels:  touch

pattern-lock-js

A passcode mechanism built with scalable vector graphics (SVG) and javascript for modern web application with mobile and tablet support

Demo

Install

Install using npm:

npm i pattern-lock-js --save

... or install using yarn:

yarn add pattern-lock-js

Getting started

Import dependecies:

<script src="jquery.js" charset="utf-8"></script>

Import the module:

<link rel="stylesheet" href="patternlock.min.css">
<script src="patternlock.min.js" charset="utf-8"></script>

Design your desired svg pattern (or use the default one below). Your svg graphics must as a minimum have the patternlock class and three groups <g> with the classes lock-actives, lock-lines and lock-dots

<svg class="patternlock" id="lock" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
    <g class="lock-actives"></g>
    <g class="lock-lines"></g>
    <g class="lock-dots">
        <circle cx="20" cy="20" r="2"/>
        <circle cx="50" cy="20" r="2"/>
        <circle cx="80" cy="20" r="2"/>

        <circle cx="20" cy="50" r="2"/>
        <circle cx="50" cy="50" r="2"/>
        <circle cx="80" cy="50" r="2"/>

        <circle cx="20" cy="80" r="2"/>
        <circle cx="50" cy="80" r="2"/>
        <circle cx="80" cy="80" r="2"/>
    </g>
</svg>

Initialise the component

var lock = new PatternLock("#lock", {
  onPattern: function(pattern) {
    // Context is the pattern lock instance
    console.log(pattern)
   }
});

Options

The returned object from new PatternLock(...) has the following utility functions:

  • clear() Clears the current pattern
  • success() Validates the pattern as correct
  • error() Validates the pattern as incorrect
  • getPattern() Returnes the currently active pattern or NaN

The pattern lock constructor accepts a second argument - an object literal with the following properties:

  • onPattern: function Called when a pattern is drawn with the pattern as argument. Returning true/false validates/invalidates the pattern - the same as calling success() and error(). The context is set to the pattern lock instance itself.
  • vibrate: boolean Defines if there should be vibrations while using the PatternLock (if available). Default: true
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].