# ovos

> A library for animations based on scroll and touch events.

Latest version **1.3.3** (published 2025-04-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install ovos
pnpm add ovos
yarn add ovos
bun add ovos
```

## Health

**Score 50/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 1.3.3 |
| Published | 2025-04-28 |
| First published | 2021-01-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 1.2 MB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | jomito |

## Links

- npm: https://www.npmjs.com/package/ovos
- Repository: https://github.com/jomarcardoso/ovos
- Homepage: https://github.com/jomarcardoso/ovo#readme
- Issues: https://github.com/jomarcardoso/ovo/issues
- npm.io page: https://npm.io/package/ovos

## Dependencies (3)

- [rxjs](https://npm.io/package/rxjs.md) 7.8.1
- [lodash-es](https://npm.io/package/lodash-es.md) ^4.17.21
- [@babel/runtime](https://npm.io/package/@babel/runtime.md) 7.24.7

## Recent versions

- 1.3.3 (latest) — 2025-04-28
- 1.3.2 — 2025-04-18
- 1.3.1 — 2024-06-16
- 1.3.0 — 2024-05-19
- 1.2.5 — 2024-04-19
- 1.2.4 — 2024-04-18
- 1.2.3 — 2024-04-17
- 1.2.2 — 2024-04-08
- 1.2.1 — 2024-04-06
- 1.2.0 — 2024-04-04
- 1.1.0 — 2024-04-04
- 1.0.0 — 2024-04-04
- 0.13.7 — 2024-03-17
- 0.13.6 — 2024-03-04
- 0.13.5 — 2024-03-02
- … 44 more at https://npm.io/package/ovos/versions

## README

# ovos 🍳

![build](https://github.com/jomarcardoso/ovos/actions/workflows/release.yml/badge.svg?branch=master)
[![npm version](https://badge.fury.io/js/ovos.svg)](https://www.npmjs.com/package/ovos)
![semantic-release: typescript](https://img.shields.io/badge/semantic--release-typescript-e10079?logo=semantic-release)

<!-- ![build-status](https://travis-ci.com/jomarcardoso/ovos.svg?branch=master)
[![npm](https://shields.io/npm/v/ovos)](https://www.npmjs.com/package/ovos)
![downloads](https://img.shields.io/npm/dm/ovos) -->

A library for animations based on scroll and touch events.

![El Chavo scene puttin and egg on the table and it roll at the floor - https://gifs.com/gif/ovos-ZYP1G8](https://j.gifs.com/ZYP1G8.gif)

## Installation and usage

### NPM module

Install

```sh
yarn add ovos

# or

npm install --save ovos
```

Import:

```js
import { fitOnScreen } from 'ovos';
```

### CDN

```html
<script src="https://unpkg.com/ovos@1.3.2/dist/ovos.js"></script>
<script>window.ovos.fitOnScreen</script>
```

## Components

### Interface

- [Anchor](/src/interface/anchor)
- [Carousel](/src/interface/carousel)
- [Fit On Screen](/src/interface/fit-on-screen)
- [Page Progress](/src/interface/page-progress)
- [Parallax](/src/interface/parallax)
- [Scroll Spy](/src/interface/scrollspy)
- [Scrollable Sticky](/src/interface/scrollable-sticky)
- [Scrollable Tabs](/src/interface/scrollable-tabs)
- [Spin Images](/src/interface/spin-images)
- Sticky (to do)
- [Sticky Header](/src/interface/sticky-header)
- Drag and Drop (in progress)
- Drawer (to do)

### API

- [Scroll](/src/api/scroll)
- [Touch](/src/api/touch)

### Utilities

- [Axis](/src/utilities/axis)
- [Element](/src/utilities/element)
- [Scroll](/src/utilities/scroll)
- [View](/src/utilities/view)

## Patterns and concepts

### Less JavaScript

All config can be putted to the HTML. For example:

```html
<section
  data-carousel="carousel"
  data-carousel-visible-slides="3"
  data-carousel-autoplay="2000"
  data-ovo-auto
>
```

### 🥚 attribute name

Every 🥚 has its own root HTML attribute. The name follows the following pattern:

| default   | 🥚    name in kebab case | attribute in kebab case  |
|-----------|--------------------------|--------------------------|
| data-ovo- | spin-images              |                          |
| data-ovo- | spin-images              | -debounce="NUMBER"       |
| data-ovo- | spin-images              | -quantity="NUMBER"       |
| data-ovo- | scrollable-sticky        |                          |
| data-ovo- | carousel                 |                          |
| data-ovo- | carousel                 | -visible-slides="NUMBER" |

### Auto play

The attribute `data-ovo-auto` starts automatically any 🥚. Just put this HTML attribute to the respective the tag that you want the effect, for example: `<div data-ovo-anchor="to-anchor" data-ovo-auto>`.

### Global module

The 🍳 Ovos library is putted to the global object (window) and can be used everywhere. Below an example of the 🥚 Sticky Header made only on HTML.

```html
<html lang="en">
<head>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>OVO - Sticky Header</title>
  <style>
    body {
      font-size: 30px;
      font-family: Verdana, Geneva, Tahoma, sans-serif;
      margin: 0;
      min-height: 300vh;
      background-color: lightblue;    }

    main,
    header {
      padding: 40px;
    }

    header {
      background: black;
      color: white;
    }
  </style>
</head>
<body>
  <header data-ovo-hs="header" data-ovo-auto>
    HEADER
  </header>
  <main>
    <p>You can scroll down and the header will scroll together.</p>
    <p>Emmediately when you scroll up the header will appear again.</p>
  </main>
  <script src="https://unpkg.com/ovos@1.3.2/dist/ovos.js"></script>
</body>
</html>
```

---
_Source: https://npm.io/package/ovos · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
