├── LICENSE ├── README.md ├── components └── UnlockSlider.vue ├── demo.gif ├── index.js └── package.json /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # A NativeScript-Vue component for "Slide to unlock" 2 | 3 | Slide to unlock in iOS style with animations made with NativeScript-Vue. Works on iOS and Android. 4 | 5 | [![npm](https://img.shields.io/npm/v/@nativescript-community/ui-vue-unlock-slider.svg)](https://www.npmjs.com/package/@nativescript-community/ui-vue-unlock-slider) 6 | 7 | 8 | 9 | ## Installation 10 | 11 | ``` 12 | ns plugin add @nativescript-community/ui-vue-unlock-slider 13 | ``` 14 | 15 | ## Usage 16 | ```diff 17 | // app.js 18 | import Vue from 'nativescript-vue' 19 | ... 20 | + import UnlockSlider from '@nativescript-community/ui-vue-unlock-slider' 21 | + Vue.use(UnlockSlider) 22 | ``` 23 | 24 | ```xml 25 | 26 | ``` 27 | 28 | ```js 29 | export default { 30 | data() { 31 | return { 32 | slidePercent: 0 33 | } 34 | }, 35 | methods: { 36 | sliderChange(percent) { 37 | this.slidePercent = percent; 38 | }, 39 | reset() { 40 | this.$refs.unlockSlider.reset(); 41 | } 42 | } 43 | } 44 | ``` 45 | 46 | ## Properties 47 | | Name | Type | Default value | 48 | | ------------------------ | ------ | --------------- | 49 | | height | Number | 70 | 50 | | radius | Number | 70 | 51 | | containerBackgroundColor | String | lightgray | 52 | | buttonText | String | → | 53 | | buttonTextSize | Number | 20 | 54 | | buttonTextColor | String | black | 55 | | buttonTextFontWeight | String | normal | 56 | | buttonBackgroundColor | String | white | 57 | | infoText | String | Slide to unlock | 58 | | infoTextSize | Number | 16 | 59 | | infoTextColor | String | black | 60 | 61 | ## Events 62 | | Name | Type | Value | 63 | | -------| ------ | ------- | 64 | | change | Number | 0.00-1.00 | 65 | -------------------------------------------------------------------------------- /components/UnlockSlider.vue: -------------------------------------------------------------------------------- 1 | 41 | 42 | -------------------------------------------------------------------------------- /demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/ui-vue-unlock-slider/a3a604501ba84a47891885b44bfa0d677c9c1ff0/demo.gif -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | import UnlockSlider from './components/UnlockSlider' 2 | 3 | export default function install(Vue) { 4 | Vue.component('UnlockSlider', UnlockSlider) 5 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@nativescript-community/ui-vue-unlock-slider", 3 | "version": "1.0.0", 4 | "description": "A NativeScript-Vue component for 'Slide-to-unlock'", 5 | "main": "index.js", 6 | "nativescript": { 7 | "plugin": { 8 | "vue": "true" 9 | } 10 | }, 11 | "files": [ 12 | "index.js", 13 | "components" 14 | ], 15 | "keywords": [ 16 | "nativescript", 17 | "nativescript-vue", 18 | "unlock", 19 | "slider" 20 | ], 21 | "author": "André Sharghi ", 22 | "license": "MIT", 23 | "homepage": "https://github.com/nativescript-community/ui-vue-unlock-slider/#readme" 24 | } --------------------------------------------------------------------------------