@@ -3,16 +3,15 @@ The best way to create a placeholder layout effect.
33
44What is it?
55-------------
6+
67Placeload.js is a library to customize your interface previews/skeleton screen that yield a fantastic user experience.
78
89![ ] ( https://github.com/victorvoid/placeload.js/blob/master/placeload-desc.jpg )
910
10-
1111Getting started
1212------------
1313
14- Compiled and production-ready code can be found in the lib directory. The src directory contains development code.
15-
14+ Compiled and production-ready code can be found in the dist directory. The lib directory contains development code.
1615
1716Install placeload.js with npm:
1817
@@ -29,57 +28,58 @@ $ bower install https://github.com/victorvoid/placeload.js.git
2928### 1. Include placeload on your site.
3029
3130``` html
32- <link href =" lib /placeload.css" >
31+ <link href =" dist /placeload.min .css" >
3332
34- <script src =" lib /placeload.js" ></script >
33+ <script src =" dist /placeload.min .js" ></script >
3534```
3635
3736### 2. Paint your placeholder
3837
3938``` js
40- var placeUserUI = new Placeload (' .user__panel--placeholder' );
41- placeUserUI .draw ({
42- width: ' 300px' ,
43- height: ' 200px'
44- });
45-
46- placeUserUI .draw ({
47- width: ' 400px' ,
48- height: ' 20px' ,
49- marginTop: ' 10px'
50- });
51-
52- placeUserUI .draw ({
53- width: ' 400px' ,
54- height: ' 20px' ,
55- marginTop: ' 10px'
56- });
57-
58- placeUserUI .draw ({
59- width: ' 250px' ,
60- height: ' 20px' ,
61- marginTop: ' 10px'
62- });
39+
40+ import Placeload from ' placeload.js'
41+
42+ Placeload
43+ .$ (' .user-placeload' )
44+ .config ({speed: ' 2s' })
45+ .line ((element ) => element .width (300 ).height (200 ))
46+ .fold (
47+ (err ) => console .log (' error: ' , err),
48+ (allElements ) => console .log (' allElements: ' , allElements)
49+ )
6350```
6451
65- ![ ] ( https://github.com/victorvoid/placeload.js/blob/master/docs/imgs/placeload_example.gif )
52+ ### 3. Placeload uses lazy evaluation, in that nothing is evaluated until necessary.
6653
67- Demos
68- --------
54+ ``` js
6955
70- [ User load - vanillajs ] ( https://victorvoid.github.io/ placeload.js/examples/vanillajs/user_load/index.html )
56+ import Placeload from ' placeload.js'
7157
58+ const userContainer = Placeload
59+ .$ (' .user-placeload' )
60+ .config ({speed: ' 2s' })
61+ .line ((element ) => element .width (300 ).height (200 ))
62+ .config ({spaceBetween: ' 30px' })
63+ .line ((element ) => element .width (400 ).height (20 ))
64+ .config ({spaceBetween: ' 30px' })
65+ .line ((element ) => element .width (400 ).height (20 ))
66+ .config ({spaceBetween: ' 30px' })
67+ .line ((element ) => element .width (250 ).height (20 ))
7268
73- Learning More
74- -------------
7569
76- Read the [ reference documentation] ( https://victorvoid.github.io/placeload.js/#documentation ) .
70+ userContainer .fold (
71+ (err ) => console .log (' error: ' , err),
72+ (allElements ) => console .log (' allElements: ' , allElements)
73+ )
74+ ```
75+
76+ ![ ] ( https://github.com/victorvoid/placeload.js/blob/master/docs/imgs/placeload_example.gif )
7777
7878Authors
7979--------
8080The repo is written and maintained by [ Victor Igor] ( https://github.com/victorvoid ) . Other contributors that have submitted something, in alphabetical order:
8181
82- - [ Raniel Oliveira] ( https://github.com/raniel182 )
82+ - [ Raniel Oliveira] ( https://github.com/raniel182 ) - UX
8383
8484License
8585-------
0 commit comments