├── src ├── scss │ └── common │ │ ├── base.scss │ │ ├── _index.scss │ │ ├── _variable.scss │ │ ├── _utils.scss │ │ └── _mixin.scss ├── commonjs │ ├── data.js │ ├── dom.js │ ├── storage.js │ └── utils.js ├── style.scss ├── index.js └── lib │ ├── d-loading.scss │ ├── d-loading.js │ └── type.js ├── static ├── demo.png └── font-icon │ ├── fonts │ ├── icomoon.eot │ ├── icomoon.ttf │ ├── icomoon.woff │ └── icomoon.svg │ ├── Read Me.txt │ ├── demo-files │ ├── demo.js │ └── demo.css │ ├── musicsvg │ ├── search.svg │ ├── menu.svg │ ├── community.svg │ ├── message.svg │ ├── music.svg │ ├── market.svg │ ├── vip.svg │ └── wangyiyun.svg │ ├── font.css │ ├── style.css │ └── demo.html ├── .gitattributes ├── .gitignore ├── README.md ├── index.html ├── lib ├── index.css └── index.js ├── package.json └── webpack.config.js /src/scss/common/base.scss: -------------------------------------------------------------------------------- 1 | @import './_index.scss' -------------------------------------------------------------------------------- /static/demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFmiss/d-loading/master/static/demo.png -------------------------------------------------------------------------------- /static/font-icon/fonts/icomoon.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFmiss/d-loading/master/static/font-icon/fonts/icomoon.eot -------------------------------------------------------------------------------- /static/font-icon/fonts/icomoon.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFmiss/d-loading/master/static/font-icon/fonts/icomoon.ttf -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.js linguist-language=javascript 2 | *.css linguist-language=javascript 3 | *.html linguist-language=javascript -------------------------------------------------------------------------------- /static/font-icon/fonts/icomoon.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IFmiss/d-loading/master/static/font-icon/fonts/icomoon.woff -------------------------------------------------------------------------------- /src/scss/common/_index.scss: -------------------------------------------------------------------------------- 1 | @import "node_modules/compass-mixins/lib/compass/css3"; 2 | @import './_variable'; 3 | @import './_utils'; 4 | @import './_mixin'; -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | dist/ 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | 8 | # Editor directories and files 9 | .idea 10 | *.suo 11 | *.ntvs* 12 | *.njsproj 13 | *.sln -------------------------------------------------------------------------------- /src/commonjs/data.js: -------------------------------------------------------------------------------- 1 | // 数据交互相关方法 2 | // 比如图片加载 ajax请求的封装等等 3 | export const data = { 4 | // 图片加载的一个promise path 是图片的地址 5 | preloadImage (path) { 6 | return new Promise((resolve, reject) => { 7 | let image = new Image(); 8 | image.onload = resolve; 9 | image.onerror = reject; 10 | image.src = path; 11 | }); 12 | } 13 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # d-loading 2 | 3 | 4 | 一个通用的loading效果 5 | ### 使用方式 6 | 引入 7 |
8 | npm install @dw/d-loading 9 |10 | 11 | 调用 12 |
13 | import Loading from '@dw/d-loading' 14 | import '@dw/d-loading/lib/index.css' 15 | 16 | let dloading = new Loading(document.body) 17 | dloading.showLoading() 18 | 19 | dloading.hideLoading() 20 | 21 | dloading.removeLoading() 22 |23 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
Generated by IcoMoon
821 |