Conveyer adds Drag gestures to your Native Scroll.

Overview

Conveyer Logo
Conveyer

version npm weekly downloads npm bundle size (scoped) Github actions Coveralls github

Angular React Vue Vue Svelte

Demo / Documentation / Other components

Conveyer adds Drag gestures to your Native Scroll.
📱 💻 🖥


Features

  • You can use Native Scroll-like behavior through Drag.
  • By adding easing features such as bounce, elasticity, and back, you can create smooth scrolling animations like Native Scroll.
  • Supports Reactive Properties that can change state through properties that automatically detect changes instead of events.
  • You can use custom scroll events like onBeginScroll, onFinishScroll, onReachStart, onLeaveStart,

⚙️ Installation

npm

$ npm install --save @egjs/conveyer

CDN

🏃 Quick Start

HTML

<div class="items">
  <div class="item"></div>
  <div class="item"></div>
  <div class="item"></div>
  <div class="item"></div>
</div>

ES Modules

import Conveyer from "@egjs/conveyer";

const conveyer = new Conveyer(".items");

With CDN

<!-- Packaged with all dependencies -->
<!-- https://naver.github.io/egjs-conveyer/release/latest/dist/conveyer.min.js -->
<script src="https://unpkg.com/@egjs/conveyer/dist/conveyer.min.js"></script>
<script>
const conveyer = new Conveyer(".items");
</script>

How to use

HTML

<button class="prev">prev</button>
<button class="next">next</button>
<div class="items">
  <div class="item"></div>
  <div class="item"></div>
  <div class="item"></div>
  <div class="item"></div>
</div>

JS

import Conveyer from "@egjs/conveyer";

// Since events occur during initialization, set `autoInit` to false if you want to register events.
const conveyer = new Conveyer(".items", {
  autoInit: false,
});

const prev = document.querySelector(".prev");
const next = document.querySelector(".next");

prev.addEventListener("click", () => {
  // start to end
  conveyer.scrollIntoView("start", {
    align: "end",
    duration: 500,
    excludeStand: true,
  });
});
next.addEventListener("click", () => {
  // end to start
  conveyer.scrollIntoView("end", {
    align: "start",
    duration: 500,
    excludeStand: true,
  });
});
conveyer.subscribe("isReachStart", value => {
  prev.disabled = value;
});
conveyer.subscribe("isReachEnd", value => {
  next.disabled = value;
});

conveyer.init();

📦 Packages

Package Version Description
@egjs/ngx-conveyer version Angular Angular port of @egjs/conveyer
@egjs/react-conveyer version React React port of @egjs/conveyer
@egjs/vue-conveyer version Vue.js Vue.js@3 port of @egjs/conveyer
@egjs/vue2-conveyer version Vue.js Vue.js@2 port of @egjs/conveyer
@egjs/svelte-conveyer version Svelte Svelte port of @egjs/conveyer

🌐 Supported Browsers

IE Chrome Firefox Safari iOS Android
9+(With polyfill), 11+ for Angular & Svelte Latest Latest Latest 7+ 4+

📼 Demos

Check our Demos.

📖 Documentation

See Documentation page.

🙌 Contributing

See CONTRIBUTING.md.

📝 Feedback

Please file an Issue.

📜 License

@egjs/conveyer is released under the MIT license.

Copyright (c) 2022-present NAVER Corp.

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.

      

Comments
  • fix: set isReachEnd

    fix: set isReachEnd

    Details

    isReachEnd has bugs of being true when the scroll has reached the end on some device This is due to a bug in the scrollLeft on some device of having a decimal value In order to prevent the bug, this fix adds additional calculation. When scrollSize - size - pos < 1, it means the scroll has reached the end, but has a decimal scrollLeft value. Thus, it would be safe to assume, that it has reached the end if the above condition returns true

    opened by henrysha 6
  • feat: add useWheel option

    feat: add useWheel option

    Details

    Added useWheel to ConveyerOptions. The default value is true. useWheel decides whether to use the mouse wheel input for same scroll direction.

    If direction is horizontal and useWheel is true, the mouse wheel can move the Conveyer horizontally. If direction is horizontal and useWheel is false, the Conveyer moves only by drag as same as before.

    If direction is vertical and useWheel is true, the Conveyer moves by drag and mouse wheel as same as before. If direction is vertical and useWheel is false, the Conveyer moves only by drag.

    If you want to use it as the same Conveyer as before, set useWheel to true for vertical and false for horizontal.

    opened by malangfox 1
  • prevent scrollPos to contain decimal

    prevent scrollPos to contain decimal

    Issue

    Haven't opened a separate issue.

    Details

    scrollPos sometimes return number with .5 decimal. This causes isReachEnd to always return false even though scroll has reached the end position, since {element}.scrollWidth - {element}.scrollLeft returns offsetWidth + 0.5.

    opened by henrysha 1
  • Fixed: incorrect main/module/exports.

    Fixed: incorrect main/module/exports.

    Before change this in has an error: [vite] Internal server error: Failed to resolve entry for package "@egjs/svelte-conveyer". The package may have incorrect main/module/exports specified in its package.json.

    Issue

    Details

    opened by cnxisne3019 0
  • fix: check autoInit exact to be false to not init

    fix: check autoInit exact to be false to not init

    Details

    As the logic to init() when if (data.props.autoInit) { is passed, init() does not occur if data.props.autoInit is undefined or null. This solves the above problem by not using init() only when data.props.autoInit is exact to be false.

    opened by malangfox 0
  • docs: add useSideWheel demo

    docs: add useSideWheel demo

    Details

    Added horizontal conveyer demo using useSideWheel option to documentation and fixes demo page using InfiniteGrid. Also this changes the default value of useSideWheel to false.

    opened by malangfox 0
  • feat: use side wheel to move conveyer

    feat: use side wheel to move conveyer

    Details

    Added useSideWheel option to move the Conveyer using the mouse wheel in a direction aside from the scroll direction. If this option is enabled, horizontal Conveyer will be able to move by using vertical mouse wheel. Also vertical Conveyer can be moved using the horizontal mouse wheel.

    Behavior for Wheel event with mixed deltaX and deltaY

    In some cases, wheel event can have deltaX and deltaY, such as moving the trackpad diagonally. In this case, only the delta in the same direction as the Conveyer's direction will be applied to the move, even if useSideWheel is enabled.

    opened by malangfox 0
  • feat: add nested option

    feat: add nested option

    Details

    Added nested to ConveyerOptions. If nested is true, The parent component moves in the same direction after the Conveyer reaches the first/last scroll position. You can use any parent component which have same direction with Conveyer, such as Conveyer itself or Flicking.

    nestedconv

    In Conveyer, circular in AxesOption is true, so implementation using the nested option of Axes was not suitable. However, I implemented it in a way that disables the property that prevents event propagation in Axes according to the scroll state of the Conveyer.

    Also this is the part I am still thinking about - Is there a better way to understand the description of the nested option?

    When only Flicking component have nested option, there was only an example of Flicking placed inside Flicking. However, the nested option between multiple components is now compatible with each other as they determine whether events are spread to the parent component.

    I wish there was a way to make this easier to understand.

    opened by malangfox 0
  • Support framework events

    Support framework events

    Description

    
    const {
       onBeginScroll
    } = useConveyer();
    
    onBeginScroll(() => {
        console.log("begin scroll");
    }, []);
    

    Steps to check or reproduce

    opened by daybrush 0
  • In ie, scrollWidth is 1px larger than clientWidth.

    In ie, scrollWidth is 1px larger than clientWidth.

    Description

    items.style.width = "400.2px";
    
    // 400
    items.clientWidth
    
    // IE: 401, chrome: 400
    items.scrollWidth
    

    Steps to check or reproduce

    bug 
    opened by daybrush 0
  • doesn't works with Sveltekit

    doesn't works with Sveltekit

    i've written example code in Sveltekit

    ``

    <div class="examples"> <div class="items horizontal" use:ref> <div class="item">1</div> <div class="item">2</div> </div> </div>

    i received error message "Function called outside component initialization"

    bug complete 
    opened by luxmeroz 9
Releases(1.4.7)
  • 1.4.7(Dec 28, 2022)

    1.4.7 (2022-12-28)

    :sparkles: Packages

    • @egjs/conveyer 1.4.7
    • @egjs/react-conveyer 1.4.7
    • @egjs/svelte-conveyer 1.4.7
    • @egjs/vue-conveyer 1.4.7
    • @egjs/vue2-conveyer 1.4.7
    • @egjs/ngx-conveyer 1.4.7

    :bug: Bug Fix

    • All

    :mega: Other

    • All
      • update packages versions (859e335)
    Source code(tar.gz)
    Source code(zip)
  • 1.4.6(Dec 2, 2022)

    1.4.6 (2022-12-02)

    :sparkles: Packages

    • @egjs/conveyer 1.4.6
    • @egjs/react-conveyer 1.4.6
    • @egjs/svelte-conveyer 1.4.6
    • @egjs/vue-conveyer 1.4.6
    • @egjs/vue2-conveyer 1.4.6
    • @egjs/ngx-conveyer 1.4.6

    :bug: Bug Fix

    • @egjs/svelte-conveyer
      • fix incorrect main/module/exports. (#24) (976d2aa)
    • @egjs/conveyer
      • remove axes instance on destory (#26) (f7e7769)
      • fix drag occurs even after release (https://github.com/naver/egjs-axes/issues/208)

    :mega: Other

    • All
      • update packages versions (21ab1df)
    Source code(tar.gz)
    Source code(zip)
  • 1.4.5(Oct 14, 2022)

    1.4.5 (2022-10-14)

    :sparkles: Packages

    • @egjs/conveyer 1.4.5
    • @egjs/react-conveyer 1.4.5
    • @egjs/svelte-conveyer 1.4.5
    • @egjs/vue-conveyer 1.4.5
    • @egjs/vue2-conveyer 1.4.5
    • @egjs/ngx-conveyer 1.4.5

    :bug: Bug Fix

    • @egjs/vue2-conveyer, @egjs/vue-conveyer, @egjs/svelte-conveyer, @egjs/react-conveyer, @egjs/conveyer
      • add declaration files to package (#23) (8b907db)

    :mega: Other

    • All
      • update packages versions (1b3e74a)
    Source code(tar.gz)
    Source code(zip)
  • 1.4.4(Sep 7, 2022)

    1.4.4 (2022-09-07)

    :sparkles: Packages

    • @egjs/conveyer 1.4.4
    • @egjs/react-conveyer 1.4.4
    • @egjs/svelte-conveyer 1.4.4
    • @egjs/vue-conveyer 1.4.4
    • @egjs/vue2-conveyer 1.4.4
    • @egjs/ngx-conveyer 1.4.4

    :bug: Bug Fix

    • @egjs/conveyer
      • check autoInit exact to be false (86cfb1d)

    :mega: Other

    • All
      • update packages versions (a2dc556)
    Source code(tar.gz)
    Source code(zip)
  • 1.4.3(Sep 7, 2022)

    1.4.3 (2022-09-07)

    :sparkles: Packages

    • @egjs/conveyer 1.4.3
    • @egjs/react-conveyer 1.4.3
    • @egjs/svelte-conveyer 1.4.3
    • @egjs/vue-conveyer 1.4.3
    • @egjs/vue2-conveyer 1.4.3
    • @egjs/ngx-conveyer 1.4.3

    :bug: Bug Fix

    • @egjs/conveyer
      • fix autoInit option not working correctly (#21) (11bb2f1)

    :mega: Other

    • All
      • update packages versions (56e6a99)
    Source code(tar.gz)
    Source code(zip)
  • 1.4.2(Aug 24, 2022)

    1.4.2 (2022-08-24)

    :sparkles: Packages

    • @egjs/conveyer 1.4.2
    • @egjs/react-conveyer 1.4.2
    • @egjs/svelte-conveyer 1.4.2
    • @egjs/vue-conveyer 1.4.2
    • @egjs/vue2-conveyer 1.4.2
    • @egjs/ngx-conveyer 1.4.2

    :bug: Bug Fix

    • @egjs/conveyer
      • update axes version (#20) (57f83fa)

    :mega: Other

    • All
      • update packages versions (515ede9)
    Source code(tar.gz)
    Source code(zip)
  • 1.4.1(Aug 5, 2022)

    1.4.1 (2022-08-05)

    :sparkles: Packages

    • @egjs/conveyer 1.4.1
    • @egjs/react-conveyer 1.4.1
    • @egjs/svelte-conveyer 1.4.1
    • @egjs/vue-conveyer 1.4.1
    • @egjs/vue2-conveyer 1.4.1
    • @egjs/ngx-conveyer 1.4.1

    :mega: Other

    • All
      • add files field in package.json (b61b084)
    Source code(tar.gz)
    Source code(zip)
  • 1.4.0(Aug 4, 2022)

    1.4.0 (2022-08-04)

    :sparkles: Packages

    • @egjs/conveyer 1.4.0
    • @egjs/react-conveyer 1.4.0
    • @egjs/svelte-conveyer 1.4.0
    • @egjs/vue-conveyer 1.4.0
    • @egjs/vue2-conveyer 1.4.0
    • @egjs/ngx-conveyer 1.4.0

    :rocket: New Features

    • All

    :bug: Bug Fix

    • All
      • fix isReachStart's default value (#18) (9c49266)

    :memo: Documentation

    • @egjs/vue2-conveyer

    :mega: Other

    • All
      • update packages versions (491417a)
    Source code(tar.gz)
    Source code(zip)
  • 1.3.1(Jul 1, 2022)

  • 1.3.0(Jun 23, 2022)

    1.3.0 (2022-06-23)

    :sparkles: Packages

    • @egjs/conveyer 1.3.0
    • @egjs/react-conveyer 1.3.0
    • @egjs/svelte-conveyer 1.3.0
    • @egjs/vue-conveyer 1.3.0
    • @egjs/vue2-conveyer 1.3.0
    • @egjs/ngx-conveyer 1.3.0

    :rocket: New Features

    • @egjs/conveyer
      • use side wheel to move conveyer (#15) (3cdeab5)

    :mega: Other

    • All
    • Other
      • fix github actions workflows (dc5ce85)
      • fix github actions workflows (0de06d4)
    Source code(tar.gz)
    Source code(zip)
  • 1.2.0(Jun 2, 2022)

    1.2.0 (2022-06-02)

    :sparkles: Packages

    • @egjs/conveyer 1.2.0
    • @egjs/react-conveyer 1.2.0
    • @egjs/svelte-conveyer 1.2.0
    • @egjs/vue-conveyer 1.2.0
    • @egjs/vue2-conveyer 1.2.0
    • @egjs/ngx-conveyer 1.2.0

    :rocket: New Features

    • @egjs/conveyer
      • add nested option (#11) (f4bd222)

    :bug: Bug Fix

    • @egjs/conveyer

    :memo: Documentation

    :house: Code Refactoring

    • @egjs/conveyer

    :mega: Other

    • All
      • update packages versions (4dedd8a)
    Source code(tar.gz)
    Source code(zip)
  • 1.1.0(Mar 21, 2022)

    • @egjs/conveyer 1.1.0
    • @egjs/ngx-conveyer 1.1.0
    • @egjs/react-conveyer 1.1.0
    • @egjs/vue-conveyer 1.1.0
    • @egjs/vue2-conveyer 1.1.0
    • @egjs/svelte-conveyer 1.1.0

    Added

    • add scrollPos reactive property #8
    • add framework events #6
    Source code(tar.gz)
    Source code(zip)
  • 1.0.2(Mar 7, 2022)

    • @egjs/conveyer1.0.2
    • @egjs/ngx-conveyer1.0.3
    • @egjs/react-conveyer1.0.2
    • @egjs/vue-conveyer1.0.3
    • @egjs/vue2-conveyer1.0.3
    • @egjs/svelte-conveyer1.0.2

    Fixed

    • Fix scrollWidth in IE #4
    • Fix touchAction in mobile #1
    Source code(tar.gz)
    Source code(zip)
  • 1.0.1(Feb 23, 2022)

    • @egjs/conveyer1.0.1
    • @egjs/ngx-conveyer1.0.2
    • @egjs/react-conveyer1.0.1
    • @egjs/vue-conveyer1.0.2
    • @egjs/vue2-conveyer1.0.2
    • @egjs/svelte-conveyer1.0.1

    Fixed

    • Fix FindItemOptions's direction(target).
    Source code(tar.gz)
    Source code(zip)
  • 1.0.0(Feb 22, 2022)

    • @egjs/conveyer1.0.0
    • @egjs/ngx-conveyer1.0.1
    • @egjs/react-conveyer1.0.0
    • @egjs/vue-conveyer1.0.1
    • @egjs/vue2-conveyer1.0.1
    • @egjs/svelte-conveyer1.0.0

    Added

    • You can use Native Scroll-like behavior through Drag.
    • By adding easing features such as bounce, elasticity, and back, you can create smooth scrolling animations like Native Scroll.
    • Supports Reactive Properties that can detect changes, such as isReachStart, isReachEnd.
    • You can use custom scroll events like onBeginScroll, onFinishScroll, onReachStart, onLeaveStart,

    How To Use

    Source code(tar.gz)
    Source code(zip)
App that allows you to control and watch YouTube videos using hand gestures. Additionally, app that allows you to search for videos, playlists, and channels.

YouTube Alternative Interaction App An app I made with Edward Wu that allows you to search and watch videos from YouTube. Leverages Google's YouTube D

Aaron Lam 2 Dec 28, 2021
👇 Bread n butter utility for component-tied mouse/touch gestures in Svelte.

svelte-gesture svelte-gesture is a library that lets you bind richer mouse and touch events to any component or view. With the data you receive, it be

Robert Soriano 29 Dec 21, 2022
Super tiny size multi-touch gestures library for the web.    You can touch this →

Preview You can touch this → http://alloyteam.github.io/AlloyFinger/ Install You can install it via npm: npm install alloyfinger Usage var af = new Al

腾讯 AlloyTeam 3.3k Dec 12, 2022
👇 Bread n butter utility for component-tied mouse/touch gestures in Solid.

solid-gesture solid-gesture is a port of @use-gesture/react which lets you bind richer mouse and touch events to any component or view. With the data

Robert Soriano 8 Sep 30, 2022
🔍 A view component for React Native with pinch to zoom and drag to pan functionality.

react-native-pan-pinch-view A view component for React Native with pinch to zoom and drag to pan functionality. ?? Introduction Even though the demo s

Ivanka Todorova 43 Oct 6, 2022
Next-level academia! Repository for the Native Overleaf project, attempting to integrate Overleaf with native OS features for macOS, Linux and Windows.

Native Overleaf Overleaf is a fantastic webtool for writing and cooperating on LaTeX documents. However, would it not be even better if it were to beh

Floris-Jan Willemsen 40 Dec 18, 2022
📷 Detects your face and adds filters from your webcam. You can capture and download images.

Snapchat Filters on WebCam ?? Detects your face and adds filters from your webcam. You can capture and download images. ?? Visit site ?? Screenshots ?

Orhan Emre Dikicigil 2 Apr 27, 2022
Fancytree - JavaScript tree view / tree grid plugin with support for keyboard, inline editing, filtering, checkboxes, drag'n'drop, and lazy loading

Fancytree Fancytree (sequel of DynaTree 1.x) is a JavaScript tree view / tree grid plugin with support for keyboard, inline editing, filtering, checkb

Martin Wendt 2.6k Jan 9, 2023
A Drag-and-Drop library for all JavaScript frameworks implementing an enhanced transformation mechanism to manipulate DOM elements

JavaScript Project to Manipulate DOM Elements DFlex A Drag-and-Drop library for all JavaScript frameworks implementing an enhanced transformation mech

DFlex 1.5k Jan 8, 2023
DoMe is a ToDo App. you can add, delete and reorder elements of the todo list using drag and drop. You can also toggle between dark&light mode

DO ME Todo App Live Preview : DO ME Built With : - ReactJS - TailwindCSS Make sure you have: - Git - Nodejs version 14 or higher (we recommend using

Medjahdi Islem 5 Nov 18, 2022
An interactive app that allows adding, editing and removing tasks of a to-do list. Drag-and-drop featured added. Webpack was used to bundle all the Js modules in to one main Js file.

To-do List A to-do list app This app let you to set your own to-do list. Built With HTML CSS JavaScript WebPack Jest Live Page Page Link Getting Start

Kenny Salazar 7 May 5, 2022
Drag and drop Argo Workflows tool.

Visual Argo Workflows Live demo The goal of this project is to make it easier for everyone on a team to construct and run their own workflows. Workflo

Artem Golub 38 Dec 22, 2022
Allow moving/copying/and creation embeds for blocks with drag-n-drop just like Logseq or Roam

Demo Features Drag-n-drop for list items in the same pane and between different panes 3 modes: move block, copy block, embed block Automatic reference

null 92 Dec 26, 2022
Drag-and-drop editor for Docassemble interviews

GraphDoc Introduction GraphDoc is a web-application that has been developed on behalf of the Maastricht Law & Tech Lab, which is part of Maastricht Un

Maastricht Law & Tech Lab 16 Dec 28, 2022
A lightweight (~2kB) library to create range sliders that can capture a value or a range of values with one or two drag handles

range-slider-input A lightweight (~2kB) library to create range sliders that can capture a value or a range of values with one or two drag handles. Ex

Utkarsh Verma 42 Dec 24, 2022
Drag and drop library for two-dimensional, resizable and responsive lists

DEPRECATED This project is no longer maintained, please consider using react-grid-layout instead. GridList Drag and drop library for a two-dimensional

Hootsuite 3.6k Dec 14, 2022
A vanilla-js module for adding zoom-on-wheel and pan-on-drag behavior to inline SVG elements.

svg-pan-zoom-container A vanilla-js module for adding zoom-on-wheel and pan-on-drag behavior to inline SVG elements. No need to write scripts. Just ma

31 Dec 10, 2022
Nested Sort is a JavaScript library which helps you to sort a nested list of items via drag and drop.

Nested Sort Nested Sort is a vanilla JavaScript library, without any dependencies, which helps you to sort a nested list of items via drag and drop. U

Hesam Bahrami 40 Dec 7, 2022
Reorderable drag-and-drop lists for modern browsers and touch devices. No jQuery or framework required.

Sortable Sortable is a JavaScript library for reorderable drag-and-drop lists. Demo: http://sortablejs.github.io/Sortable/ Features Supports touch dev

SortableJS 26.1k Jan 5, 2023