https://github.com/eldoy/spinn
SVG spinner loader
https://github.com/eldoy/spinn
Last synced: about 2 months ago
JSON representation
SVG spinner loader
- Host: GitHub
- URL: https://github.com/eldoy/spinn
- Owner: eldoy
- License: mit
- Created: 2023-01-12T10:11:57.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-01-12T10:55:59.000Z (over 3 years ago)
- Last Synced: 2025-08-31T07:28:36.594Z (11 months ago)
- Language: JavaScript
- Homepage:
- Size: 18.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Spinn
SVG spinner loader. Very cool animated spinner with settings:
* Color
* Background color
* Size
Created by [Eldøy Projects →](https://eldoy.com)
### Install
```
npm i spinn
```
### Usage
**Server side rendered**
Require lib:
```js
const spinn = require('spinn')
```
Include on web page:
```
${spinn}</spinn>
```
**Client side rendered**
Include `dist/spinn-min.js`:
```html
<script src="spinn-min.js">
```
Create an element where the spinner should appear:
```
```
Use on page, include in `` tag:
```js
// Create spinner, showing default options
var spinner = spinn({
// Where to insert the spinner
el: 'spinn',
// The color of the spinner
color: 'tomato',
// Background color
bg: 'transparent',
// Size in pixels (width and height)
size: 20
})
// Start spinner
spinner.start()
// Stop spinner
spinner.stop()
// Stop spinner via element
spin({ el: 'spin' }).stop()
// Short cut, using default options
var spinner = spinn().start()
// Stop after 5 seconds
setTimeout(spinner.stop, 5000)
```
MIT Licensed. Enjoy!