• Stars
    star
    143
  • Rank 257,007 (Top 6 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created about 5 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Infinite Viewer is Document Viewer Component with infinite scrolling.

Infinite Viewer

npm version React Preact Angular Vue Vue 3 Svelte Lit

Infinite Viewer is Document Viewer Component with infinite scrolling up, down, left and right.

Demo / API / Main Project

❗Changed❗

  • Change name useForceWheel to useWheelScroll option

βš™οΈ Installation

npm

$ npm install infinite-viewer

scripts

<script src="//daybrush.com/infinite-viewer/release/latest/dist/infinite-viewer.min.js"></script>

πŸš€ How to use

  • In chrome, the scroll event is used instead of the wheel event due to the backward and forward swipe gesture. If you set overscroll-behavior: none; on the body, you can use useWheelScroll option.
<div class="viewer">
    <div class="viewport">
        AAAA
    </div>
</div>
import InfiniteViewer from "infinite-viewer";

const infiniteViewer = new InfiniteViewer(
    document.querySelector(".viewer"),
    document.querySelector(".viewport"),
    {
        margin: 0,
        threshold: 0, 
        zoom: 1,
        rangeX: [0, 0],
        rangeY: [0, 0],
    },
);

infiniteViewer.on("scroll", () => {
    console.log(infiniteViewer.getScrollLeft(), infiniteViewer.getScrollTop());
});

Structure

  • Before
<div class="viewer">
    <div class="viewport">
        AAAA
    </div>
</div>
  • After
<div class="container">
    <div class="infinite-viewer-wrapper">
        <div class="infinite-viewer-scroll-area"></div>
        <div class="viewport">AAA</div>
    </div>
    <div class="infinite-viewer-scroll-bar infinite-viewer-vertical-scroll-bar">
        <div class="infinite-viewer-scroll-thumb"></div>
    </div>
    <div class="infinite-viewer-scroll-bar infinite-viewer-horizontal-scroll-bar">
        <div class="infinite-viewer-scroll-thumb"></div>
    </div>
</div>

πŸ“¦ Packages

PackageΒ Name Β VersionΒ  Description
react-infinite-viewer A React Infinite Viewer Component that allows you to select elements in the drag area using the mouse or touch.
ngx-infinite-viewer An Angular Infinite Viewer Component that allows you to select elements in the drag area using the mouse or touch.
vue-infinite-viewer A Vue Infinite Viewer Component that allows you to select elements in the drag area using the mouse or touch.
vue3-infinite-viewer A Vue 3 Infinite Viewer Component that allows you to select elements in the drag area using the mouse or touch.
preact-infinite-viewer A Preact Infinite Viewer Component that allows you to select elements in the drag area using the mouse or touch.
svelte-infinite-viewer A Svelte Infinite Viewer Component that allows you to select elements in the drag area using the mouse or touch.
lit-infinite-viewer A Lit Infinite Viewer Component that allows you to select elements in the drag area using the mouse or touch.

⭐️ Show Your Support

Please give a ⭐️ if this project helped you!

πŸ‘ Contributing

If you have any questions or requests or want to contribute to infinite-viewer or other packages, please write the issue or give me a Pull Request freely.

🐞 Bug Report

If you find a bug, please report to us opening a new Issue on GitHub.

πŸ“ License

This project is MIT licensed.

MIT License

Copyright (c) 2020 Daybrush

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.

More Repositories

1

moveable

Moveable! Draggable! Resizable! Scalable! Rotatable! Warpable! Pinchable! Groupable! Snappable!
TypeScript
7,799
star
2

scenejs

🎬 Scene.js is JavaScript & CSS timeline-based animation library
TypeScript
2,441
star
3

selecto

Selecto.js is a component that allows you to select elements in the drag area using the mouse or touch.
TypeScript
1,280
star
4

scena

🎬 Scena is a component that represents the timeline of Scene.js. You can control time, properties, and items.
TypeScript
577
star
5

guides

A Guides component that can draw ruler and manage guidelines.
TypeScript
240
star
6

ruler

A Ruler component that can draw grids and scroll infinitely.
TypeScript
221
star
7

scenejs-timeline

🎬 @scenejs/timeline is a component that represents the timeline of Scene.js. You can control time, properties, and items.
TypeScript
150
star
8

scenejs-render

🎬 Make a movie of CSS animation through scenejs.
HTML
117
star
9

gesto

You can set up drag, pinch events in any browser.
TypeScript
74
star
10

overlap-area

Find the Overlap Area.
TypeScript
42
star
11

scenejs-effects

🎬 ✨ Effect collection library where you can add effects with Scene.js.
TypeScript
36
star
12

figur

Make SVG Polygon & Star Shape
TypeScript
28
star
13

keycon

Keyboard Controller
TypeScript
25
star
14

drag

You can set up drag events in any browser.
TypeScript
18
star
15

react-folder

A React Folder component that can fold, sort, and move lists.
TypeScript
15
star
16

moveable-helper

TypeScript
10
star
17

css-styled

βš–οΈ This component is a lightweight, simple line style component.
TypeScript
10
star
18

scenejs-media

🎬 A library for playing or controlling media
TypeScript
10
star
19

utils

utils for daybrush
TypeScript
9
star
20

framework-utils

utils for framework
TypeScript
8
star
21

dragscroll

TypeScript
7
star
22

daybrush.github.io

Daybrush https://daybrush.com
TypeScript
7
star
23

css-to-mat

TypeScript
6
star
24

ast-parser

ast parser
JavaScript
6
star
25

builder

JavaScript
6
star
26

css

5
star
27

matrix

TypeScript
5
star
28

scenejs-iframe

🎬 A library that control the animation of iframe with scenejs
TypeScript
5
star
29

tester

JavaScript
3
star
30

print-sizes

Prints a list of files in the directory.
JavaScript
3
star
31

react-simple-compat

Simple React for compatible use
TypeScript
3
star
32

data-dom

TypeScript
3
star
33

order-map

TypeScript
3
star
34

rollup-plugin-preact

Rollup Plugin for Preact Compat
JavaScript
3
star
35

keyframer

Make the CSS Keyframes the keyframes object.
TypeScript
3
star
36

fjx

fjx is an functional javascript extension. Support Typescript
TypeScript
2
star
37

pure-props

compare only the props. If the state does not change, do not re-render.
JavaScript
2
star
38

vue-test

TypeScript
2
star
39

pvu

JavaScript
2
star
40

list-map

πŸ“‹ A list-map collection in the form of key, value, that ensures the index.
TypeScript
2
star
41

rollup-plugin-react-compat

JavaScript
2
star
42

daylightjs

daylightJS
JavaScript
1
star
43

code-converter

TypeScript
1
star
44

scenejs-server

JavaScript
1
star
45

page

You can check the page in and out of the screen.
TypeScript
1
star
46

project

JavaScript
1
star
47

movable

You can add a movable element
1
star
48

daybrush

1
star
49

codepen

JavaScript
1
star
50

print-coveralls

print-coveralls
JavaScript
1
star
51

test-server

test
HTML
1
star
52

movable-angular-error

TypeScript
1
star
53

release

JavaScript
1
star
54

redux

JavaScript
1
star
55

demo

JavaScript
1
star