Skip to content

Commit

Permalink
Various updates (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
kopiro committed May 2, 2020
1 parent 9a17b6b commit 5ae128c
Show file tree
Hide file tree
Showing 23 changed files with 5,073 additions and 1,967 deletions.
15 changes: 10 additions & 5 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
{
"extends": "airbnb",
"env": {
"browser": true
}
}
"extends": ["plugin:prettier/recommended"],
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": ["prettier"],
"env": {
"browser": true
}
}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
node_modules/
node_modules/
3 changes: 2 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
test-webpack
node_modules/
etc/
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"semi": true,
"trailingComma": "all",
"singleQuote": false,
"printWidth": 120,
"tabWidth": 2
}
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,26 @@ The "Apple Siri" wave replicated in pure Javascript using the Canvas API.

### Classic style

<img src="classic.gif" />
<img src="etc/classic.gif" />

### iOS 9+ style

<img src="ios9.gif" />
<img src="etc/ios9.gif" />

## Usage

To use in the classic way, download the dist file under **./dist/siriwave.min.js**,
or use the CDN one **https://unpkg.com/siriwave/dist/siriwave.min.js**
and include in your web page as a script.
### Browser (via CDN) usage

```html
<script src="https://unpkg.com/siriwave/dist/siriwave.js"></script>
<script src="https://unpkg.com/siriwave/dist/siriwave.umd.min.js"></script>
```

Otherwise, the build is ready to import as ESM module via `npm i siriwave`.
### ES module

Install it through `npm install siriwave` or `yarn add siriwave` first:

```js
import SiriWave from 'siriwave';
import SiriWave from "siriwave";
```

## Instantitate
Expand All @@ -39,11 +39,11 @@ Create a div container and instantiate a SiriWave object
```html
<div id="siri-container"></div>
<script>
var siriWave = new SiriWave({
container: document.getElementById('siri-container'),
width: 640,
height: 200,
});
var siriWave = new SiriWave({
container: document.getElementById("siri-container"),
width: 640,
height: 200,
});
</script>
```

Expand Down Expand Up @@ -83,5 +83,5 @@ Set the new value of amplitude (animated)

## Grapher plots

- [GCX default](default.gcx)
- [GCX iOS 9](ios9.gcx)
- [GCX default](etc/gcx/default.gcx)
- [GCX iOS 9](etc/gcx/ios9.gcx)
Binary file removed back.png
Binary file not shown.
Loading

0 comments on commit 5ae128c

Please sign in to comment.