UNPKG

2.2 kBMarkdownView Raw
1# S
2
3A light JavaScript library.
4
5## Installation
6
7 $ yarn add @ariiiman/s --dev
8
9## Usage
10
11Look at the **src** folder in the github repository for more information
12
13### Import
14
15 import S from '@ariiiman/s'
16
17### Return the body node of the document
18
19 const body = S.Dom.body
20
21### Add scroll event listener
22
23 S.L(element, 'add', 'click', callback)
24
25### Check if a variable is an object
26
27 const isObj = S.Is.object(variable)
28
29### Play animations with Merom
30
31 const animation = new S.M({el: '#id', p: {x: [0, 600, 'px']}, d: 2000, e: 'io4'})
32 animation.play()
33
34 animation.play({p: {x: {newEnd: 50}}, reverse: true})
35
36### Build sequences of Merom with Timeline
37
38 const tl = new S.TL()
39 tl.from({el: '#id0', p: {x: [0, 600, 'px'], rotate: [0, 360]}, d: 500, e: 'linear'})
40 tl.from({el: '#id1', p: {x: [0, 600, 'px'], rotate: [0, 360]}, d: 500, e: 'linear', delay: 300, cb: myCallback})
41
42 tl.play()
43
44 tl.pause()
45
46## Author
47
48Aristide Benoist
49
50[www.aristidebenoist.com](https://www.aristidebenoist.com)
51
52## Licence
53
54The MIT License (MIT)
55
56Copyright (c) 2018 Aristide Benoist
57
58Permission is hereby granted, free of charge, to any person obtaining a copy
59of this software and associated documentation files (the "Software"), to deal
60in the Software without restriction, including without limitation the rights
61to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
62copies of the Software, and to permit persons to whom the Software is
63furnished to do so, subject to the following conditions:
64
65The above copyright notice and this permission notice shall be included in all
66copies or substantial portions of the Software.
67
68THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
69IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
70FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
71AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
72LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
73OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
74SOFTWARE.