Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jeremyckahn/shifty
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: bbe851c085b01d7e971c5b64d7b402e98c4faee6
Choose a base ref
...
head repository: jeremyckahn/shifty
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0159399baa770d071628ae9d873aa10f1313e7a3
Choose a head ref

Commits on Oct 2, 2019

  1. Copy the full SHA
    141cb5d View commit details

Commits on Dec 3, 2019

  1. Set publishConfig

    jeremyckahn committed Dec 3, 2019
    Copy the full SHA
    25b0696 View commit details
  2. 2.8.1

    jeremyckahn committed Dec 3, 2019
    Copy the full SHA
    17691c2 View commit details
  3. 2.8.2

    jeremyckahn committed Dec 3, 2019
    Copy the full SHA
    d7267db View commit details
  4. Revert "Set publishConfig"

    This reverts commit 25b0696.
    jeremyckahn committed Dec 3, 2019
    Copy the full SHA
    ebec598 View commit details
  5. 2.8.3

    jeremyckahn committed Dec 3, 2019
    Copy the full SHA
    28c59fc View commit details

Commits on Feb 8, 2020

  1. Update Rekapi link

    jeremyckahn committed Feb 8, 2020
    Copy the full SHA
    35cbb3d View commit details

Commits on May 12, 2020

  1. Copy the full SHA
    b9ab08b View commit details
  2. Copy the full SHA
    4813318 View commit details

Commits on May 13, 2020

  1. [#115] Fix syntax error

    jeremyckahn committed May 13, 2020
    Copy the full SHA
    0e597bc View commit details
  2. Copy the full SHA
    46dd4ba View commit details
  3. Fix comment formatting

    jeremyckahn committed May 13, 2020
    Copy the full SHA
    e20ca0a View commit details
  4. Merge pull request #115 from wparad/improve-stop-error-message

    Improve error message when stop is called.
    jeremyckahn authored May 13, 2020
    Copy the full SHA
    82f6b4d View commit details
  5. 2.9.0

    jeremyckahn committed May 13, 2020
    Copy the full SHA
    1e7828b View commit details

Commits on Jun 23, 2020

  1. Copy the full SHA
    3180c28 View commit details
  2. 2.9.1

    jeremyckahn committed Jun 23, 2020
    Copy the full SHA
    b85b991 View commit details

Commits on Aug 6, 2020

  1. Copy the full SHA
    fee183a View commit details
  2. Copy the full SHA
    d843407 View commit details
  3. 2.9.2

    jeremyckahn committed Aug 6, 2020
    Copy the full SHA
    6e0af94 View commit details
  4. Remove semicolons

    jeremyckahn committed Aug 6, 2020
    Copy the full SHA
    8c33d79 View commit details

Commits on Aug 14, 2020

  1. Copy the full SHA
    d18b278 View commit details
  2. Copy the full SHA
    eb4ab82 View commit details
  3. Run npm audit fix

    jeremyckahn committed Aug 14, 2020
    Copy the full SHA
    a91a990 View commit details
  4. 2.10.0

    jeremyckahn committed Aug 14, 2020
    Copy the full SHA
    ed1504c View commit details

Commits on Aug 16, 2020

  1. Set up .travis.yml

    jeremyckahn committed Aug 16, 2020
    Copy the full SHA
    f23d145 View commit details
  2. 2.10.1-0

    jeremyckahn committed Aug 16, 2020
    Copy the full SHA
    2e428d5 View commit details
  3. Remove pre-push hook

    jeremyckahn committed Aug 16, 2020
    Copy the full SHA
    8cce9a4 View commit details
  4. Copy the full SHA
    77ba3ea View commit details
  5. Copy the full SHA
    25c2c3d View commit details
  6. Copy the full SHA
    a3fa91f View commit details
  7. Copy the full SHA
    6bafbcb View commit details
  8. Copy the full SHA
    2899676 View commit details
  9. [#118] Fix config reuse

    jeremyckahn committed Aug 16, 2020
    Copy the full SHA
    5cf0f87 View commit details
  10. Copy the full SHA
    43b68a7 View commit details
  11. [#121] Fix step support

    jeremyckahn committed Aug 16, 2020
    Copy the full SHA
    d7fc83c View commit details
  12. Add code sample to README

    jeremyckahn committed Aug 16, 2020
    Copy the full SHA
    cabe2d1 View commit details
  13. 2.11.0

    jeremyckahn committed Aug 16, 2020
    Copy the full SHA
    27643f3 View commit details
  14. Copy the full SHA
    201c654 View commit details
  15. Tweak code sample

    jeremyckahn committed Aug 16, 2020
    Copy the full SHA
    7cc4e4c View commit details

Commits on Aug 17, 2020

  1. Copy the full SHA
    4a06847 View commit details
  2. Re-add setConfig check

    jeremyckahn committed Aug 17, 2020
    Copy the full SHA
    27c7f9a View commit details
  3. 2.11.1

    jeremyckahn committed Aug 17, 2020
    Copy the full SHA
    afe09ed View commit details

Commits on Aug 18, 2020

  1. Improve example in README

    jeremyckahn committed Aug 18, 2020
    Copy the full SHA
    ecc0934 View commit details

Commits on Aug 19, 2020

  1. Copy the full SHA
    de5e47d View commit details
  2. Copy the full SHA
    45945fb View commit details
  3. Copy the full SHA
    e4aad4e View commit details
  4. 2.12.0

    jeremyckahn committed Aug 19, 2020
    Copy the full SHA
    f70cef7 View commit details
  5. Copy the full SHA
    72e9f62 View commit details

Commits on Aug 20, 2020

  1. Copy the full SHA
    b933158 View commit details

Commits on Oct 1, 2020

  1. Copy the full SHA
    cc80297 View commit details
1 change: 0 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@
"plugins": ["jest", "prettier"],
"rules": {
"linebreak-style": ["error", "unix"],
"semi": ["error", "always"],
"valid-jsdoc": [
"error",
{
18 changes: 18 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: CI

on:
push:
branches:
- '**'

jobs:
run_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.1
- uses: actions/setup-node@v1
with:
node-version: 14
- run: npm ci
- run: npm run ci
- run: npm run build
67 changes: 67 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ develop ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ develop ]
schedule:
- cron: '39 19 * * 6'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
31 changes: 31 additions & 0 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish Docs

# https://github.com/marketplace/actions/deploy-to-github-pages

on:
push:
branches:
- 'master'

jobs:
run_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.1
with:
persist-credentials: false
- uses: actions/setup-node@v1
with:
node-version: 14

- run: npm ci
- run: npm run build
- run: npm run doc

- uses: JamesIves/github-pages-deploy-action@3.7.1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: dist
CLEAN: true
SINGLE_COMMIT: true
22 changes: 22 additions & 0 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Publish

on:
create:
tags:
- v*

jobs:
run_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.1
- uses: actions/setup-node@v1
with:
node-version: 14
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm run ci
- run: npm run build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"semi": false,
"singleQuote": true,
"trailingComma": "es5"
}
73 changes: 62 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,80 @@
# Shifty - A teeny tiny tweening engine in JavaScript
# Shifty - The fastest JavaScript animation engine on the web

- `master`: [![CI](https://github.com/jeremyckahn/shifty/workflows/CI/badge.svg?branch=master)](https://github.com/jeremyckahn/shifty/actions?query=workflow%3ACI+branch%3Amaster)
- `develop`: [![CI](https://github.com/jeremyckahn/shifty/workflows/CI/badge.svg?branch=develop)](https://github.com/jeremyckahn/shifty/actions?query=workflow%3ACI+branch%3Adevelop)

Shifty is a tweening engine for JavaScript. It is a lightweight library meant
to be encapsulated by higher level tools. At its core, Shifty provides:

- Best-in-class performance
- Interpolation of `Number`s over time (tweening)
- Playback control of an individual tween
- Extensibility hooks for key points in the tweening process
- `Promise` support for `async`/`await` programming

This is useful because it is the least amount of functionality needed to build
customizable animations. Shifty is optimized to run many times a second with
minimal processing and memory overhead, which is necessary to achieve smooth
animations.

## Browser compatibility

Shifty officially supports Evergreen browsers, Safari, and Node. If you
encounter a browser-specific bug, please [open an issue about
it](https://github.com/jeremyckahn/shifty/issues/new)!
```js
import { tween } from 'shifty'
;(async () => {
const element = document.querySelector('#tweenable')

const { tweenable } = await tween({
render: ({ scale, x }) => {
element.style.transform = `translateX(${x}px) scale(${scale})`
},
easing: 'easeInOutQuad',
duration: 500,
from: { scale: 1, x: 0 },
to: { x: 200 },
})

await tweenable.tween({
to: { x: 0 },
})

await tweenable.tween({
to: { scale: 3 },
})
})()
```

## Installation

```
npm install --save shifty
```

## Environment compatibility

Shifty officially supports Evergreen browsers, Safari, and Node 10 and above.
If you encounter a browser-specific bug, please [open an issue about
it](https://github.com/jeremyckahn/shifty/issues/new)!

### IE compatibility

Shifty is compatible with IE11 (possibly older versions as well), but you
will need to provide your own polyfills for it to work. If you are using
https://polyfill.io/, you just need the `es6` features enabled:

```
https://polyfill.io/v3/polyfill.min.js?features=es6
```

[Here's a polyfilled demo of Shifty that works with
IE11](https://codepen.io/jeremyckahn/pen/RwbzvEj). Please see [issue
#113](https://github.com/jeremyckahn/shifty/issues/113) for background on
this.

## Support this project!

Shifty is a labor of love that will always be free and open source. If you've
gotten value out of Shifty, **[please consider supporting the developer with a
small donation](https://github.com/jeremyckahn#please-help-support-my-work)**!

## Developing Shifty

First, install the dependencies via npm like so:
@@ -62,25 +113,25 @@ Shifty exposes a UMD module, so you can load it however you like:

```javascript
// ES6
import { tween } from 'shifty';
import { tween } from 'shifty'
```

Or:

```javascript
// AMD
define(['shifty'], function(shifty) {
shifty.tween({ from: { x: 0 }, to: { x: 10 } });
});
shifty.tween({ from: { x: 0 }, to: { x: 10 } })
})
```

Or even:

```javascript
// CommonJS
const shifty = require('shifty');
const { tween } = require('shifty')

shifty.tween({ from: { x: 0 }, to: { x: 10 } });
tween({ from: { x: 0 }, to: { x: 10 } })
```

## Using Shifty
Loading