Skip to content

Commit c5b2eaf

Browse files
Refactor code/plugin
1 parent f1d5c5b commit c5b2eaf

24 files changed

+2774
-1569
lines changed

.babelrc

100644100755
Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
{
22
"presets": [
3-
["env", { "modules": false }],
4-
"stage-3"
3+
["env", {
4+
"targets": {
5+
"browsers": ["last 2 versions", "safari >= 7"]
6+
},
7+
"modules": "umd"
8+
}]
9+
],
10+
"plugins": [
11+
"transform-object-rest-spread",
12+
["transform-runtime", {
13+
"polyfill": false,
14+
"regenerator": true
15+
}]
516
]
617
}

.editorconfig

100644100755
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
1+
; This file is for unifying the coding style for different editors and IDEs.
2+
; More information at http://editorconfig.org
3+
14
root = true
25

36
[*]
47
charset = utf-8
5-
indent_style = space
68
indent_size = 4
9+
indent_style = space
710
end_of_line = lf
811
insert_final_newline = true
912
trim_trailing_whitespace = true
1013

14+
[{package.json,*.scss,*.css}]
15+
indent_size = 2
16+
1117
[*.md]
1218
trim_trailing_whitespace = false

.eslintrc

100644100755
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
2-
"extends": [
3-
"eslint:recommended",
4-
"plugin:vue/essential"
5-
],
6-
"rules": {
7-
"vue/no-unused-vars": 0
8-
}
2+
"extends": "spatie/vue",
3+
"parserOptions": {
4+
"ecmaVersion": 8
5+
},
6+
"env": {
7+
"browser": true,
8+
"node": true
9+
}
910
}

.gitignore

100644100755
Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
1-
.DS_Store
2-
node_modules/
1+
/node_modules
32
npm-debug.log
3+
yarn-debug.log
44
yarn-error.log
5-
6-
# Editor directories and files
7-
.idea
8-
*.suo
9-
*.ntvs*
10-
*.njsproj
11-
*.sln

.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.idea
2+
__tests__

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
language: node_js
2+
node_js:
3+
- 'stable'

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Changelog
2+
3+
All notable changes to `vue-scroll-indicator` will be documented in this file.
4+
5+
## [0.1.0] - 2018-03-19
6+
### Changed
7+
- Refactor code/plugin using [spatie/skeleton-vue](https://github.com/spatie/skeleton-vue).
8+
- Rename prop `indicator-color` > `color`.
9+
- Rename prop `bg-color` > `background`.
10+
11+
### Fixed
12+
- Add `destroyed()`lifecycle hook (`window.removeEventListener`).

CONTRIBUTING.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Contributing
2+
3+
Contributions are **welcome** and will be fully **credited**.
4+
5+
We accept contributions via Pull Requests on [Github](https://github.com/robbinfellow/vue-scroll-indicator).
6+
7+
## Pull Requests
8+
9+
- Use the ES2015 syntax.
10+
- Your patch won't be accepted if it doesn't pass the tests and lints (`yarn run test`).
11+
- If there's a `/demo` section, try to add an example.
12+
- **Document any change in behaviour:** Make sure the `README.md`, `CHANGELOG.md` and any other relevant documentation are kept up-to-date.
13+
- **Consider our release cycle:** We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option.
14+
- **Create feature branches:** Don't ask to pull from your master branch.
15+
- **One pull request per feature:** If you want to do more than one thing, send multiple pull requests.
16+
- **Send coherent history:** Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](http://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting.
17+
18+
## Running Tests
19+
20+
``` shell
21+
jest
22+
```
23+
24+
**Happy coding**!

LICENSE renamed to LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2018 Robbin Johansson <robbinfellow@gmail.com>
3+
Copyright (c) Robbin Johansson <robbinfellow@gmail.com>
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

100644100755
Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
[![npm](https://img.shields.io/npm/v/vue-scroll-indicator.svg)](https://www.npmjs.com/package/vue-scroll-indicator)
2-
[![npm](https://img.shields.io/npm/dt/vue-scroll-indicator.svg)](https://www.npmjs.com/package/vue-scroll-indicator)
3-
[![npm](https://img.shields.io/npm/l/vue-scroll-indicator.svg)](https://www.npmjs.com/package/vue-scroll-indicator)
1+
[![Latest Version on NPM](https://img.shields.io/npm/v/vue-scroll-indicator.svg?style=flat-square)](https://npmjs.com/package/vue-scroll-indicator)
2+
[![Total Downloads on NPM](https://img.shields.io/npm/dt/vue-scroll-indicator.svg)](https://www.npmjs.com/package/vue-scroll-indicator)
3+
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
4+
[![Build Status](https://img.shields.io/travis/robbinfellow/vue-scroll-indicator/master.svg?style=flat-square)](https://travis-ci.org/robbinfellow/vue-scroll-indicator)
45

56
# Vue-scroll-indicator
67
Scroll indicator component using Vue.js.
78

9+
## Demo
10+
11+
[Link](https://robbinfellow.github.io/vue-scroll-indicator)
12+
813
## Installation
914
```shell
1015
$ yarn add vue-scroll-indicator --dev
@@ -42,8 +47,8 @@ Display the component using custom style _(any valid use of css units will do)_:
4247
```html
4348
<vue-scroll-indicator
4449
height="7px"
45-
indicator-color="#11998e"
46-
bg-color="none"
50+
color="#11998e"
51+
background="none"
4752
>
4853
</vue-scroll-indicator>
4954
```
@@ -53,13 +58,22 @@ Display the component using custom style _(any valid use of css units will do)_:
5358
| Prop | Data Type | Required | Default | Description
5459
| :--- | :--- | :--- | :--- | :--- |
5560
| `height` | String | `false` | `5px` | Scroll indicator height
56-
| `bg-color` | String | `false` | `#eaeaea` | Scroll indicator background-color
57-
| `indicator-color` | String | `false` | `linear-gradient(to right, #ec008c, #fc6767)` | Scroll indicator color
61+
| `color` | String | `false` | `linear-gradient(to right, #ec008c, #fc6767)` | Scroll indicator color
62+
| `background` | String | `false` | `#eaeaea` | Scroll indicator background-color
63+
64+
### Changelog
65+
66+
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.
67+
68+
## Contributing
69+
70+
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
5871

5972
## Credits
6073

6174
* [Robbin Johansson](https://github.com/robbinfellow)
75+
* [spatie/skeleton-vue](https://github.com/spatie/skeleton-vue)
6276

6377
## License
6478

65-
Vue-scroll-indicator is an open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).
79+
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

0 commit comments

Comments
 (0)