Skip to content

Commit

Permalink
Merge pull request #4 from lemehovskiy/release/v2.0.0
Browse files Browse the repository at this point in the history
Release/v2.0.0
  • Loading branch information
lemehovskiy authored Dec 12, 2023
2 parents 05cde88 + f43035d commit 9bd8d1d
Show file tree
Hide file tree
Showing 35 changed files with 5,210 additions and 32,931 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/dist
19 changes: 19 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"modules": true,
"experimentalObjectRestSpread": true
}
},
"plugins": ["@typescript-eslint", "prettier"],
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
"rules": {
"prettier/prettier": 1,
"no-unused-vars": 0,
"@typescript-eslint/no-unused-vars": ["error"],
"@typescript-eslint/no-this-alias": 0
}
}
17 changes: 17 additions & 0 deletions .github/workflows/pullRequest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: pull-request
on:
pull_request:
branches:
- 'master'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up node
uses: actions/setup-node@v3
- name: Install dependencies
run: npm install
- name: Run linter
run: npm run lint
25 changes: 25 additions & 0 deletions .github/workflows/releaseCreated.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Publish Package to npmjs
on:
release:
types: [created]
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up node
uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm ci
- name: Run liter
run: npm run lint
- name: Deploy
run: |
npm run build
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
**/node_modules
.idea
.DS_Store
.vscode
/dist

10 changes: 10 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/node_modules
.husky
.vscode
src
.eslintrc.json
prettierrc.json
tsconfig.json
vite.config.ts
.github
.eslintignore
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Illia

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
71 changes: 43 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
parallaxBackground
parallax-background
-------

Create captivating parallax backgrounds effortlessly with the ParallaxBackground plugin. This lightweight Vanilla JavaScript plugin, powered by GSAP animation, supports Scroll, Mouse Move, and Gyroscope events. Choose from Rotate or Shifting animations, and easily configure zoom and animation duration for a personalized touch.

Features:

* Vanilla JavaScript and GSAP powered
* Scroll, Mouse Move, Gyroscope events
* Rotate or Shifting animations
* Customizable zoom and animation duration

### Demo

[https://lemehovskiy.github.io/parallax-background](https://lemehovskiy.github.io/parallax-background)


### Package Managers

```sh
Expand All @@ -18,17 +26,15 @@ npm install parallax_background
#### Include js

```html
<script src="TweenLite.min.js"></script>
<script src="CSSPlugin.min.js"></script>
<script src="jquery.min.js"></script>
<script src="parallax_background.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.10.4/gsap.min.js"></script>
<script src="parallaxBackground.umd.js"></script>
```

#### Set HTML

```html
<div class="parallax-background">
<div class="parallax-inner" style="background-image: url('background-image.jpg')">
<div class="parallax-inner" style="background-image: url('https://placekitten.com/1280/720')">
</div>
</div>
```
Expand All @@ -37,9 +43,12 @@ npm install parallax_background

```html
<script type="text/javascript">
$(document).ready(function() {
$('.parallax-background').parallaxBackground();
});
//Initialize with jQuery
$(document).ready(function() {
$('.parallax-background').parallaxBackground();
});
//Initialize with Vanilla JavaScript
new ParallaxBackground(document.querySelector(".parallax"));
</script>
```

Expand All @@ -53,19 +62,22 @@ npm install parallax_background
<body>

<div class="parallax-background">
<div class="parallax-inner" style="background-image: url('background-image.jpg')">
<div class="parallax-inner" style="background-image: url('https://placekitten.com/1280/720')">
</div>
</div>

<script src="TweenLite.min.js"></script>
<script src="CSSPlugin.min.js"></script>
<script src="jquery.min.js"></script>
<script src="parallax_background.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.10.4/gsap.min.js"></script>
//optional for jQuery initialize
<script src="https://code.jquery.com/jquery-3.7.1.js"></script>
<script src="parallaxBackground.umd.js"></script>

<script type="text/javascript">
//Initialize with jQuery
$(document).ready(function() {
$('.parallax-background').parallaxBackground();
});
//Initialize with Vanilla JavaScript
new ParallaxBackground(document.querySelector(".parallax"));
</script>

</body>
Expand All @@ -74,9 +86,9 @@ npm install parallax_background

### Data Attribute Settings

In parallaxBackground you can add settings using the data-parallax-background attribute. You still need to call
$(element).parallaxBackground()
to initialize parallaxBackground on the element.
In parallax-background you can add settings using the data-parallax-background attribute. You still need to call
new ParallaxBackground(selector)
to initialize parallax-background on the element.

Example:

Expand All @@ -91,22 +103,25 @@ Example:

Option | Type | Default
--- | --- | ---
event | string | scroll
animation_type | string | shift
events | [SCROLL, MOUSE, GYRO] | [SCROLL]
animationType | SHIFT \| ROTATE | SHIFT
zoom | int | 20
rotate_perspective | int | 1400
animate_duration | int | 1

rotatePerspective | int | 1400
animateDuration | int | 1

### Browser support

* Chrome
* Firefox
* Opera
* IE10/11


### Dependencies

* jQuery 1.7
* Gsap
* GSAP animation library (Version 3.10.4)

## Contributing

If you'd like to get involved, please consider opening an issue or submitting a pull request. Your input is highly valued, and I'm enthusiastic about collaborating to enhance this tool.

## License

parallax-background is released under the MIT License. See the [LICENSE](LICENSE) file for comprehensive details regarding the terms and conditions of use.
Loading

0 comments on commit 9bd8d1d

Please sign in to comment.